Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ShowSummary « Elements « Ticket « html « share - github.com/bestpractical/rt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 78685259750c284e9b9cfe77ef2945c9eb0f8c98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
%# This software is Copyright (c) 1996-2022 Best Practical Solutions, LLC
%#                                          <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
%#
%#
%# LICENSE:
%#
%# This work is made available to you under the terms of Version 2 of
%# the GNU General Public License. A copy of that license should have
%# been provided with this software, but in any event can be snarfed
%# from www.gnu.org.
%#
%# This work is distributed in the hope that it will be useful, but
%# WITHOUT ANY WARRANTY; without even the implied warranty of
%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
%# General Public License for more details.
%#
%# You should have received a copy of the GNU General Public License
%# along with this program; if not, write to the Free Software
%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
%# 02110-1301 or visit their web page on the internet at
%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
%#
%# (The following paragraph is not intended to limit the rights granted
%# to you to modify and distribute this software under the terms of
%# the GNU General Public License and is only of importance to you if
%# you choose to contribute your changes and enhancements to the
%# community by submitting them to Best Practical Solutions, LLC.)
%#
%# By intentionally submitting any modifications, corrections or
%# derivatives to this work, or any other work intended for use with
%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
%# you are the copyright holder for those contributions and you grant
%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
%# royalty-free, perpetual, license to use, copy, create derivative
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
<div class="row ticket-summary">
  <div class="boxcontainer col-md-6">
% $m->callback( %ARGS, CallbackName => 'LeftColumnTop' );

<%PERL>
my $modify_url = RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id;
my $modify_inline
    = '<a class="inline-edit-toggle edit" href="%s">'
    . qq{<span class="fas fa-pencil-alt icon-bordered fa-2x" alt="$edit_label" data-toggle="tooltip" data-placement="top" data-original-title="$edit_label"></span>}
    . '</a>'
    . '<a class="inline-edit-toggle cancel hidden" href="#">'
    . qq{<span class="fas fa-times icon-bordered fa-2x" alt="$cancel_label" data-toggle="tooltip" data-placement="top" data-original-title="$cancel_label"></span>}
    . '</a>';
my $modify_basics = sprintf( $modify_inline, $m->interp->apply_escapes( $modify_url, 'h' ) );
my $modify_behavior = $InlineEdit ? ($inline_edit_behavior{Basics} || $inline_edit_behavior{_default} || 'link') : 'hide';
</%PERL>

    <&| /Widgets/TitleBox, title => loc('The Basics'),
        (($can_modify || $can_modify_cf) ? (title_href => $modify_url) : ()),
        (($can_modify || $can_modify_cf) && $modify_behavior =~ /^(link|click)$/ ? (titleright_raw => $modify_basics) : ()),
        class => (join " ", 'ticket-info-basics', ($modify_behavior eq 'always' ? 'editing' : ())),
        data => { 'inline-edit-behavior' => $modify_behavior },
    &>
%       unless ($modify_behavior eq 'always') {
            <div class="inline-edit-display">
                <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &>
            </div>
%       }
%       if ($modify_behavior ne 'hide') {
            <form class="inline-edit" action="<%RT->Config->Get('WebPath')%>/Ticket/Display.html" method="post" enctype="multipart/form-data">
                <input type="hidden" class="hidden" name="id" value="<% $Ticket->id %>" />
                <& /Ticket/Elements/EditBasics, TicketObj => $Ticket, InTable => 1, ExcludeOwner => 1, ExcludeCustomRoles => 1 &>
                <& /Elements/EditCustomFields, Object => $Ticket, Grouping => 'Basics', InTable => 1 &>
                <div class="form-row">
                  <div class="col-12 text-right">
                    <input type="submit" class="button btn btn-primary" value="<&|/l&>Save</&>" />
                  </div>
                </div>
            </form>
%       }
    </&>
% $m->callback( %ARGS, CallbackName => 'AfterBasics' );
    <& /Elements/ShowCustomFieldCustomGroupings,
        Object       => $Ticket,
        title_href   => ($can_modify || $can_modify_cf) ? RT->Config->Get('WebPath')."/Ticket/Modify.html" : "",
        InlineEdit   => ($can_modify || $can_modify_cf) ? $InlineEdit : 0,
        &>

<%PERL>
my $people_url = RT->Config->Get('WebPath')."/Ticket/ModifyPeople.html?id=".$Ticket->Id;
my $people_inline = sprintf( $modify_inline, $m->interp->apply_escapes( $people_url, 'h' ) );
my $people_behavior = $InlineEdit ? ($inline_edit_behavior{People} || $inline_edit_behavior{_default} || 'link') : 'hide';
</%PERL>
    <&| /Widgets/TitleBox, title => loc('People'),
        (($can_modify || $can_modify_owner || $can_modify_people) ? (title_href => RT->Config->Get('WebPath')."/Ticket/ModifyPeople.html?id=".$Ticket->Id) : ()),
        class => (join " ", 'ticket-info-people', ($people_behavior eq 'always' ? 'editing' : ())),
        (($can_modify || $can_modify_owner || $can_modify_people) && $people_behavior =~ /^(link|click)$/ ? (titleright_raw => $people_inline) : ()),
        data => { 'inline-edit-behavior' => $people_behavior },
    &>
%       unless ($people_behavior eq 'always') {
            <div class="inline-edit-display">
                <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &>
            </div>
%       }
%       if ($people_behavior ne 'hide') {
            <form class="inline-edit" action="<%RT->Config->Get('WebPath')%>/Ticket/Display.html" method="post" enctype="multipart/form-data">
                <input type="hidden" class="hidden" name="id" value="<% $Ticket->id %>" />
                <& /Ticket/Elements/EditPeopleInline, Ticket => $Ticket &>
                <div class="form-row">
                  <div class="col-12 text-right">
                    <input type="submit" class="button btn btn-primary" value="<&|/l&>Save</&>" />
                  </div>
                </div>
            </form>
%       }
</&>

% $m->callback( %ARGS, CallbackName => 'AfterPeople' );
    <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $Attachments, Count => RT->Config->Get('AttachmentListCount') &>
% $m->callback( %ARGS, CallbackName => 'AfterAttachments' );
    <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &>
% $m->callback( %ARGS, CallbackName => 'LeftColumn' );
  </div>
  <div class="boxcontainer col-md-6">
% $m->callback( %ARGS, CallbackName => 'RightColumnTop' );
% if ( RT->Config->Get('EnableReminders') ) {
    <&|/Widgets/TitleBox, title => loc("Reminders"),
        title_href => RT->Config->Get('WebPath')."/Ticket/Reminders.html?id=".$Ticket->Id,
        class => 'ticket-info-reminders fullwidth',
    &>
        <form action="<%RT->Config->Get('WebPath')%>/Ticket/Display.html" name="UpdateReminders" id="UpdateReminders" method="post">
            <& /Ticket/Elements/Reminders, Ticket => $Ticket, ShowCompleted => 0 &>
        </form>
    </&>
% }
% $m->callback( %ARGS, CallbackName => 'AfterReminders' );

<%PERL>
my $dates_url = RT->Config->Get('WebPath')."/Ticket/ModifyDates.html?id=".$Ticket->Id;
my $dates_inline = sprintf( $modify_inline, $m->interp->apply_escapes( $dates_url, 'h' ) );
my $dates_behavior = $InlineEdit ? ($inline_edit_behavior{Dates} || $inline_edit_behavior{_default} || 'link') : 'hide';
</%PERL>
    <&| /Widgets/TitleBox, title => loc("Dates"),
        ($can_modify ? (title_href => $dates_url) : ()),
        class => (join " ", 'ticket-info-dates', ($dates_behavior eq 'always' ? 'editing' : ())),
        ($can_modify && $dates_behavior =~ /^(link|click)$/ ? (titleright_raw => $dates_inline) : ()),
        data => { 'inline-edit-behavior' => $dates_behavior },
    &>
%       unless ($dates_behavior eq 'always') {
            <div class="inline-edit-display">
                <& /Ticket/Elements/ShowDates, Ticket => $Ticket &>
            </div>
%       }
%       if ($dates_behavior ne 'hide') {
            <form class="inline-edit" action="<%RT->Config->Get('WebPath')%>/Ticket/Display.html" method="post" enctype="multipart/form-data">
                <input type="hidden" class="hidden" name="id" value="<% $Ticket->id %>" />
                <& /Ticket/Elements/EditDates, TicketObj => $Ticket &>
                <div class="form-row">
                  <div class="col-12 text-right">
                    <input type="submit" class="button btn btn-primary" value="<&|/l&>Save</&>" />
                  </div>
                </div>
            </form>
%       }
    </&>
% $m->callback( %ARGS, CallbackName => 'AfterDates' );
% my (@extra);
% push @extra, titleright_raw => '<a href="'. RT->Config->Get('WebPath'). '/Ticket/Graphs/index.html?id='.$Ticket->id.'">'.loc('Graph').'</a>' unless RT->Config->Get('DisableGraphViz');

<& /Ticket/Elements/ShowLinkedQueues,
    TicketObj => $Ticket,
&>

<& /Ticket/Elements/ShowAssets, Ticket => $Ticket &>
<%PERL>
my $links_url = RT->Config->Get('WebPath')."/Ticket/ModifyLinks.html?id=".$Ticket->Id;
my $links_inline = sprintf( $modify_inline, $m->interp->apply_escapes( $links_url, 'h' ) );
my $links_behavior = $InlineEdit ? ($inline_edit_behavior{Links} || $inline_edit_behavior{_default} || 'link') : 'hide';
my $alt = loc('Graph ticket links');
my $links_graph = '<a href="' . RT->Config->Get('WebPath') . '/Ticket/Graphs/index.html?id=' . $Ticket->id . '"><span class="fas fa-project-diagram icon-bordered fa-2x" alt="' . $alt . '" data-toggle="tooltip" data-placement="top" data-original-title="' . $alt . '"></span></a>';

my $links_titleright = join ' ',
    ($can_modify && $links_behavior =~ /^(link|click)$/ ? ($links_inline) : ()),
    (RT->Config->Get('DisableGraphViz') ? () : $links_graph);
push @extra, (titleright_raw => $links_titleright) if $links_titleright;
</%PERL>
% $m->callback( %ARGS, CallbackName => 'LinksExtra', extra => \@extra );
    <&| /Widgets/TitleBox, title => loc('Links'),
        ($can_modify ? (title_href => $links_url) : ()),
        class => (join " ", 'ticket-info-links', ($links_behavior eq 'always' ? 'editing' : ())),
        data => { 'inline-edit-behavior' => $links_behavior },
        ($can_modify ? (title_href => RT->Config->Get('WebPath')."/Ticket/ModifyLinks.html?id=".$Ticket->Id) : ()),
        @extra,
    &>
%       unless ($links_behavior eq 'always') {
            <div class="inline-edit-display">
                <& /Elements/ShowLinks, Object => $Ticket &>
            </div>
%       }
%       if ($links_behavior ne 'hide') {
            <form class="inline-edit" action="<%RT->Config->Get('WebPath')%>/Ticket/Display.html" method="post" enctype="multipart/form-data">
                <input type="hidden" class="hidden" name="id" value="<% $Ticket->id %>" />
                <& /Elements/EditLinks, Object => $Ticket, TwoColumn => 0 &>

                <h3><&|/l&>Merge</&></h3>
                <& /Ticket/Elements/EditMerge, Ticket => $Ticket, MergeTextClass => '', %ARGS &>

                <div class="form-row">
                  <div class="col-12 text-right">
                    <input type="submit" class="button btn btn-primary" value="<&|/l&>Save</&>" />
                  </div>
                </div>
            </form>
%       }
    </&>
% $m->callback( %ARGS, CallbackName => 'RightColumn' );
  </div>
</div>
<%ARGS>
$Ticket => undef
$Attachments => undef
$InlineEdit => 0
</%ARGS>
<%INIT>
my $can_modify = $Ticket->CurrentUserHasRight('ModifyTicket');
my $can_modify_cf = $Ticket->CurrentUserHasRight('ModifyCustomField');
my ($can_modify_owner) = $Ticket->CurrentUserCanSetOwner();
my $can_modify_people = $Ticket->CurrentUserHasRight('Watch')
                     || $Ticket->CurrentUserHasRight('WatchAsAdminCc');

$m->callback( CallbackName => 'ModifyRights', %ARGS, TicketObj => $Ticket, ARGSRef => \%ARGS,
    CanModify => \$can_modify, CanModifyCF => \$can_modify_cf,
    CanModifyOwner => \$can_modify_owner, CanModifyPeople => \$can_modify_people );

my $edit_label = $m->interp->apply_escapes( loc("Edit"), 'h' );
my $cancel_label = $m->interp->apply_escapes( loc("Cancel"), 'h' );

my %inline_edit_behavior;
if (RT->Config->Get('InlineEditPanelBehavior')) {
    %inline_edit_behavior = %{ RT->Config->Get('InlineEditPanelBehavior')->{'RT::Ticket'} || {} };
}
</%INIT>