[Rt-commit] rtir branch, 5.0/allow-inline-edit-on-ticket-display, repushed
? sunnavy
sunnavy at bestpractical.com
Thu Jan 7 13:56:01 EST 2021
The branch 5.0/allow-inline-edit-on-ticket-display was deleted and repushed:
was f1fca5b8dea587e677cf26711cf9bd62ec2654e7
now 1e6def55bc5bb33780567f889cfa2c07deef6077
1: 1e2fe5f7 ! 1: 55888211 Add inline edit to RTIR Display.html page
@@ -61,10 +61,10 @@
+ <div class="form-row">
+ <div class="label col-3">
+ <% loc("Status") %>:
++ </div>
++ <div class="value col-9">
++ <span class="current-value"><% $Ticket->Status %></span>
</div>
-+ <div class="value col-9">
-+ <span class="current-value"><% $Ticket->Status %></span>
-+ </div>
+ </div>
% if ( !$Ticket->QueueObj->SLADisabled ) {
- <div class="form-row">
@@ -77,10 +77,10 @@
+ <div class="form-row">
+ <div class="label col-3">
+ <&|/l&>SLA</&>:
++ </div>
++ <div class="value col-9">
++ <span class="current-value"><% loc($Ticket->SLA) %></span>
</div>
-+ <div class="value col-9">
-+ <span class="current-value"><% loc($Ticket->SLA) %></span>
-+ </div>
+ </div>
% }
- <div class="form-row">
@@ -111,26 +111,26 @@
+ </div>
+ <div class="value col-9">
+ <span class="current-value"><%loc('[_1] min', $TimeWorked)%></span>
-+ </div>
-+ </div>
-+
+ </div>
++ </div>
+
+- <& /Elements/ShowCustomFields, Grouping => 'Basics', Object => $Ticket, Table => 0 &>
+ <& /Elements/ShowCustomFields, Grouping => 'Basics', Object => $Ticket, Table => 0 &>
+ </div>
+% }
+% if ($modify_behavior ne 'hide') {
-+ <form class="inline-edit" action="<%RT->Config->Get('WebPath')%>/RTIR/Display.html" method="post" enctype="multipart/form-data">
++ <form class="inline-edit" action="<% RT::IR->HREFTo("Display.html") %>" method="post" enctype="multipart/form-data">
+ <input type="hidden" class="hidden" name="id" value="<% $Ticket->id %>" />
-+
+
+ <div class="form-row">
+ <div class="label col-3">
+ <&|/l&>Subject</&>:
- </div>
++ </div>
+ <div class="value col-9">
+ <input class="form-control" type="text" name="Subject" value="<% $ARGS{'Subject'} || $Ticket->Subject %>" />
+ </div>
-+ </div>
-
-- <& /Elements/ShowCustomFields, Grouping => 'Basics', Object => $Ticket, Table => 0 &>
+ </div>
+
+ <div class="form-row">
+ <div class="label col-3">
+ <% loc("Status") %>:
@@ -149,21 +149,7 @@
+% }
+ </div>
+ </div>
-
-+ <div class="form-row">
-+ <div class="label col-3">
-+ <&|/l&>Owner</&>:
-+ </div>
-+ <div class="value col-9">
-+ <& /Elements/SelectOwner,
-+ Name => 'Owner',
-+ Default => $ARGS{'Owner'} || $Ticket->Owner,
-+ TicketObj => $Ticket,
-+ QueueObj => $Ticket->QueueObj,
-+ &>
-+ </div>
- </div>
-
++
+ <div class="form-row">
+ <div class="label col-3">
+ <&|/l&>Queue</&>:
@@ -227,7 +213,7 @@
- title_href => RT::IR->HREFTo("Edit.html"),
+ title_href => RT::IR->HREFTo("Edit.html"),
+ InlineEdit => ($can_modify || $can_modify_cf) ? $InlineEdit : 0,
-+ ActionURL => RT->Config->Get('WebPath')."/RTIR/Display.html"
++ ActionURL => RT::IR->HREFTo("Display.html"),
&>
<& /RTIR/Elements/ShowArticles, Ticket => $Ticket &>
@@ -258,9 +244,9 @@
+ </div>
+% }
+% if ($people_behavior ne 'hide') {
-+ <form class="inline-edit" action="<%RT->Config->Get('WebPath')%>/RTIR/Display.html" method="post" enctype="multipart/form-data">
++ <form class="inline-edit" action="<% RT::IR->HREFTo("Display.html") %>" method="post" enctype="multipart/form-data">
+ <input type="hidden" class="hidden" name="id" value="<% $Ticket->id %>" />
-+ <& /RTIR/Elements/EditPeople, Ticket => $Ticket &>
++ <& /RTIR/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</&>" />
@@ -282,19 +268,19 @@
+ <&| /Widgets/TitleBox,
+ title => loc("Dates"),
+ title_href => RT::IR->HREFTo("Edit.html?id=". $Ticket->Id),
-+ class => (join " ", 'ticket-info-dates', ($modify_behavior eq 'always' ? 'editing' : ())),
++ class => (join " ", 'ticket-info-dates', ($dates_behavior eq 'always' ? 'editing' : ())),
+ data => { 'inline-edit-behavior' => $dates_behavior },
+ ($can_modify ? (title_href => $dates_url) : ()),
+ ($can_modify && $dates_behavior =~ /^(link|click)$/ ? (titleright_raw => $dates_inline) : ()),
&>
- <& /RTIR/Elements/ShowDates, Ticket => $Ticket &>
-+% unless ($modify_behavior eq 'always') {
++% unless ($dates_behavior eq 'always') {
+ <div class="inline-edit-display">
+ <& /RTIR/Elements/ShowDates, Ticket => $Ticket &>
+ </div>
+% }
-+% if ($modify_behavior ne 'hide') {
-+ <form class="inline-edit" action="<%RT->Config->Get('WebPath')%>/RTIR/Display.html" method="post" enctype="multipart/form-data">
++% if ($dates_behavior ne 'hide') {
++ <form class="inline-edit" action="<% RT::IR->HREFTo("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">
@@ -315,8 +301,8 @@
+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'} || {} };
++if ( my $config = RT->Config->Get('InlineEditPanelBehavior') ) {
++ %inline_edit_behavior = %{ $config->{'RTIR::Ticket'} || $config->{'RT::Ticket'} || {} };
+}
+
+my $can_modify = $Ticket->CurrentUserHasRight( 'ModifyTicket' );
@@ -342,3 +328,157 @@
+$InlineEdit => RT->Config->Get( 'InlineEdit', $session{CurrentUser} )
</%ARGS>
+diff --git a/html/RTIR/Elements/AddWatchers b/html/RTIR/Elements/AddWatchers
+--- a/html/RTIR/Elements/AddWatchers
++++ b/html/RTIR/Elements/AddWatchers
+@@
+ %# those contributions and any derivatives thereof.
+ %#
+ %# END BPS TAGGED BLOCK }}}
++% if ($ShowLabel) {
+ <br />
+
+ <&|/l&>Add new Correspondents</&>:<br />
++% }
+
+ % if ( $Users ) {
+ <div class="form-row">
+@@
+ </%INIT>
+
+ <%ARGS>
++$ShowLabel => 1
+ $UserField => 'Name'
+ $UserOp => '='
+ $UserString => undef
+
+diff --git a/html/RTIR/Elements/EditPeopleInline b/html/RTIR/Elements/EditPeopleInline
+new file mode 100644
+--- /dev/null
++++ b/html/RTIR/Elements/EditPeopleInline
+@@
++%# BEGIN BPS TAGGED BLOCK {{{
++%#
++%# COPYRIGHT:
++%#
++%# This software is Copyright (c) 1996-2020 Best Practical Solutions, LLC
++%# <sales at 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="form-row">
++ <div class="col-12">
++ <i><&|/l&>Current Correspondents</&>:</i>
++ </div>
++</div>
++<div class="form-row">
++ <div class="label col-3">
++ <&|/l&>Owner</&>:
++ </div>
++ <div class="value col-9">
++ <& /Elements/SelectOwner,
++ Name => 'Owner',
++ Default => $ARGS{'Owner'} || $Ticket->Owner,
++ TicketObj => $Ticket,
++ QueueObj => $Ticket->QueueObj,
++ &>
++ </div>
++</div>
++% if ($Ticket->Requestors->MembersObj->Count) {
++<div class="form-row">
++ <div class="label col-3">
++ <&|/l&>Correspondents</&>:
++ </div>
++ <div class="value col-9">
++ <& /Ticket/Elements/EditWatchers, TicketObj => $Ticket, Watchers => $Ticket->Requestors &>
++ </div>
++</div>
++% }
++% if ($Ticket->Cc->MembersObj->Count) {
++<div class="form-row">
++ <div class="label col-3">
++ <&|/l&>Cc</&>:
++ </div>
++ <div class="value col-9">
++ <& /Ticket/Elements/EditWatchers, TicketObj => $Ticket, Watchers => $Ticket->Cc &>
++ </div>
++</div>
++% }
++% if ($Ticket->AdminCc->MembersObj->Count) {
++<div class="form-row">
++ <div class="label col-3">
++ <&|/l&>Admin Cc</&>:
++ </div>
++ <div class="value col-9">
++ <& /Ticket/Elements/EditWatchers, TicketObj => $Ticket, Watchers => $Ticket->AdminCc &>
++ </div>
++</div>
++% }
++% my $multi_roles = $Ticket->QueueObj->CustomRoles;
++% $multi_roles->LimitToMultipleValue;
++% while (my $role = $multi_roles->Next) {
++% my $group = $Ticket->RoleGroup($role->GroupType);
++% if ($group->Id && $group->MembersObj->Count) {
++ <div class="form-row">
++ <div class="label col-3">
++ <% $role->Name %>:
++ </div>
++ <div class="value col-9">
++ <& /Ticket/Elements/EditWatchers, Watchers => $Ticket->RoleGroup($role->GroupType), TicketObj => $Ticket &>
++ </div>
++ </div>
++% }
++% }
++
++<div class="form-row">
++ <div class="col-12">
++ <i><&|/l&>Add new Correspondents</&>:</i>
++ </div>
++</div>
++
++<& AddWatchers, Ticket => $Ticket, ShowLabel => 0 &>
++
++<& /Elements/EditCustomFields, Object => $Ticket, Grouping => 'People', InTable => 1 &>
++
++<%ARGS>
++$Ticket => undef
++</%ARGS>
+
2: 1b5415f9 ! 2: ff01d4b8 Add inline edit to Incident/Display.html page
@@ -56,7 +56,7 @@
</div>
+% }
+% if ($modify_behavior ne 'hide') {
-+ <form class="inline-edit" action="<%RT->Config->Get('WebPath')%>/RTIR/Incident/Display.html" method="post" enctype="multipart/form-data">
++ <form class="inline-edit" action="<% RT::IR->HREFTo("Incident/Display.html") %>" method="post" enctype="multipart/form-data">
+ <input type="hidden" class="hidden" name="id" value="<% $TicketObj->id %>" />
+
+ <div class="form-row">
@@ -164,9 +164,9 @@
<& /Elements/ShowCustomFieldCustomGroupings,
Object => $TicketObj,
- title_href => RT::IR->HREFTo("Edit.html"),
-+ title_href => RT::IR->HREFTo("Edit.html"),
++ title_href => ($can_modify || $can_modify_cf) ? RT::IR->HREFTo("Edit.html") : '',
+ InlineEdit => ($can_modify || $can_modify_cf) ? $InlineEdit : 0,
-+ ActionURL => RT->Config->Get('WebPath')."/RTIR/Incident/Display.html"
++ ActionURL => RT::IR->HREFTo("Incident/Display.html"),
&>
+<%PERL>
@@ -183,17 +183,17 @@
-<& /RTIR/Elements/ShowDates, Ticket => $TicketObj &>
+ title => loc("Dates"),
+ title_href => RT::IR->HREFTo("Edit.html?id=".$id),
-+ class => (join " ", 'ticket-info-dates', ($modify_behavior eq 'always' ? 'editing' : ())),
++ class => (join " ", 'ticket-info-dates', ($dates_behavior eq 'always' ? 'editing' : ())),
+ data => { 'inline-edit-behavior' => $dates_behavior },
+ ($can_modify && $dates_behavior =~ /^(link|click)$/ ? (titleright_raw => $dates_inline) : ()),
+ &>
-+% unless ($modify_behavior eq 'always') {
++% unless ($dates_behavior eq 'always') {
+ <div class="inline-edit-display">
+ <& /RTIR/Elements/ShowDates, Ticket => $TicketObj &>
+ </div>
+% }
-+% if ($modify_behavior ne 'hide') {
-+ <form class="inline-edit" action="<%RT->Config->Get('WebPath')%>/RTIR/Incident/Display.html" method="post" enctype="multipart/form-data">
++% if ($dates_behavior ne 'hide') {
++ <form class="inline-edit" action="<% RT::IR->HREFTo("Incident/Display.html") %>" method="post" enctype="multipart/form-data">
+ <input type="hidden" class="hidden" name="id" value="<% $TicketObj->id %>" />
+ <& /Ticket/Elements/EditDates, TicketObj => $TicketObj &>
+ <div class="form-row">
@@ -214,8 +214,8 @@
+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'} || {} };
++if ( my $config = RT->Config->Get('InlineEditPanelBehavior') ) {
++ %inline_edit_behavior = %{ $config->{'RTIR::Ticket'} || $config->{'RT::Ticket'} || {} };
+}
+my $can_modify = $TicketObj->CurrentUserHasRight( 'ModifyTicket' );
+my $can_modify_cf = $TicketObj->CurrentUserHasRight( 'ModifyCustomField' );
3: f1fca5b8 ! 3: 90e04e6a Add ARG for /RTIR/Elements/ShowIncidents to add classes when in a form
@@ -53,3 +53,4 @@
$InlineEdit => RT->Config->Get('InlineEdit', $session{CurrentUser})
+$InForm => undef
</%ARGS>
+
-: ------- > 4: 1e6def55 Document inline edit behavior
More information about the rt-commit
mailing list