X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2Fm%2Fticket%2Fshow;h=90513bc870392cf9a14a8351e88831b3aaddbc91;hb=7322f2afedcc2f427e997d1535a503613a83f088;hp=4190bd34952be854b05db4ba604647b26f298a06;hpb=85e677b86fc37c54e6de2b06340351a28f5a5916;p=freeside.git diff --git a/rt/share/html/m/ticket/show b/rt/share/html/m/ticket/show index 4190bd349..90513bc87 100644 --- a/rt/share/html/m/ticket/show +++ b/rt/share/html/m/ticket/show @@ -1,3 +1,50 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC +%# +%# +%# (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 }}} <%args> $id => undef @@ -12,7 +59,7 @@ unless ($id) { if ($ARGS{'id'} eq 'new') { # {{{ Create a new ticket - my $Queue = new RT::Queue( $session{'CurrentUser'} ); + my $Queue = RT::Queue->new( $session{'CurrentUser'} ); $Queue->Load($ARGS{'Queue'}); unless ( $Queue->id ) { Abort('Queue not found'); @@ -22,14 +69,10 @@ if ($ARGS{'id'} eq 'new') { Abort('You have no permission to create tickets in that queue.'); } - ($Ticket, @Actions) = CreateTicket( - Attachments => delete $session{'Attachments'}, - %ARGS, - ); + ($Ticket, @Actions) = CreateTicket( %ARGS ); unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) { Abort("No permission to view newly created ticket #".$Ticket->id."."); } - # }}} } else { $Ticket ||= LoadTicket($ARGS{'id'}); @@ -37,7 +80,7 @@ if ($ARGS{'id'} eq 'new') { TicketObj => $Ticket, ActionsRef => \@Actions, ARGSRef => \%ARGS ); if ( defined $ARGS{'Action'} ) { - if ($ARGS{'Action'} =~ /^(Steal|Kill|Take|SetTold)$/) { + if ($ARGS{'Action'} =~ /^(Steal|Delete|Take|SetTold)$/) { my $action = $1; my ($res, $msg) = $Ticket->$action(); push(@Actions, $msg); @@ -49,14 +92,12 @@ if ($ARGS{'id'} eq 'new') { ARGSRef => \%ARGS, Actions => \@Actions); - $ARGS{UpdateAttachments} = $session{'Attachments'}; push @Actions, ProcessUpdateMessage( ARGSRef => \%ARGS, Actions => \@Actions, TicketObj => $Ticket, ); - delete $session{'Attachments'}; #Process status updates push @Actions, ProcessTicketWatchers(ARGSRef => \%ARGS, TicketObj => $Ticket ); @@ -64,11 +105,14 @@ if ($ARGS{'id'} eq 'new') { push @Actions, ProcessTicketLinks( ARGSRef => \%ARGS, TicketObj => $Ticket ); push @Actions, ProcessTicketDates( ARGSRef => \%ARGS, TicketObj => $Ticket ); push @Actions, ProcessObjectCustomFieldUpdates(ARGSRef => \%ARGS, TicketObj => $Ticket ); + push @Actions, ProcessTicketReminders( ARGSRef => \%ARGS, TicketObj => $Ticket ); - # XXX: we shouldn't block actions here if user has no right to see the ticket, - # but we should allow him to see actions he has done unless ($Ticket->CurrentUserHasRight('ShowTicket')) { - Abort("No permission to view ticket"); + if (@Actions) { + Abort("A change was applied successfully, but you no longer have permissions to view the ticket", Actions => \@Actions); + } else { + Abort("No permission to view ticket"); + } } if ( $ARGS{'MarkAsSeen'} ) { $Ticket->SetAttribute( @@ -103,7 +147,7 @@ if (@Actions) { # If we haven't been passed in an Attachments object (through the precaching mechanism) # then we need to find one -my $Attachments = $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket); +my $Attachments = $Ticket->Attachments; my %documents; while ( my $attach = $Attachments->Next() ) { @@ -111,12 +155,6 @@ while ( my $attach = $Attachments->Next() ) { unshift( @{ $documents{ $attach->Filename } }, $attach ); } -my $Customers = $Ticket->Customers; -my @customers; -while ( my $customer = $Customers->Next() ) { - push @customers, $customer; -} - my $CustomFields = $Ticket->CustomFields; $m->callback( CallbackName => 'MassageCustomFields', @@ -129,7 +167,7 @@ my $print_value = sub { my $linked = $value->LinkValueTo; if ( defined $linked && length $linked ) { my $linked = $m->interp->apply_escapes( $linked, 'h' ); - $m->out(''); + $m->out(''); } my $comp = "ShowCustomField". $cf->Type; $m->callback( @@ -161,7 +199,7 @@ my $print_value = sub { }; -<&| /m/_elements/wrapper, title => $Ticket->Subject &> +<&| /m/_elements/wrapper, title => loc("#[_1]: [_2]", $Ticket->Id, $Ticket->Subject || '') &>
<& /m/_elements/ticket_menu, ticket => $Ticket &> @@ -204,9 +242,13 @@ my $print_value = sub {
<&|/l&>Queue:
<& /Ticket/Elements/ShowQueue, QueueObj => $Ticket->QueueObj &>
+
+
<&|/l&>Bookmark:
+
<& /Ticket/Elements/Bookmark, id => $Ticket->id &>
+
-% if ($Ticket->CustomFields->First) { +% if ($CustomFields->Count) { <&| /Widgets/TitleBox, title => loc('Custom Fields'), class => 'ticket-info-cfs', &> @@ -242,20 +284,20 @@ my $print_value = sub {
<&|/l&>Owner:
-
<& /Elements/ShowUser, User => $Ticket->OwnerObj, Ticket => $Ticket &> +
<& /Elements/ShowUser, User => $Ticket->OwnerObj, Ticket => $Ticket, Link => 0 &>
<&|/l&>Requestors:
-
<& /Ticket/Elements/ShowGroupMembers, Group => $Ticket->Requestors, Ticket => $Ticket &>
+
<& /Ticket/Elements/ShowGroupMembers, Group => $Ticket->Requestors, Ticket => $Ticket, Link => 0 &>
<&|/l&>Cc:
-
<& /Ticket/Elements/ShowGroupMembers, Group => $Ticket->Cc, Ticket => $Ticket &>
+
<& /Ticket/Elements/ShowGroupMembers, Group => $Ticket->Cc, Ticket => $Ticket, Link => 0 &>
<&|/l&>AdminCc:
-
<& /Ticket/Elements/ShowGroupMembers, Group => $Ticket->AdminCc, Ticket => $Ticket &>
+
<& /Ticket/Elements/ShowGroupMembers, Group => $Ticket->AdminCc, Ticket => $Ticket, Link => 0 &>
@@ -271,34 +313,10 @@ my $print_value = sub { <%$key%>