X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2Fm%2Fticket%2Fshow;h=ead23a75e4c05c849faf664c557e593701f86003;hb=679854b8bbc65d112071111bbd7f34a6a481fb30;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..ead23a75e 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-2013 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'); @@ -29,7 +76,6 @@ if ($ARGS{'id'} eq 'new') { unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) { Abort("No permission to view newly created ticket #".$Ticket->id."."); } - # }}} } else { $Ticket ||= LoadTicket($ARGS{'id'}); @@ -37,7 +83,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); @@ -64,11 +110,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( @@ -111,12 +160,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', @@ -161,7 +204,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 &> @@ -203,6 +246,10 @@ my $print_value = sub {
<&|/l&>Queue:
<& /Ticket/Elements/ShowQueue, QueueObj => $Ticket->QueueObj &>
+
+
+
<&|/l&>Bookmark:
+
<& /Ticket/Elements/Bookmark, id => $Ticket->id &>
@@ -297,7 +344,7 @@ if ($size) {
  • - + <&|/l, $rev->CreatedAsString, $size, $rev->CreatorObj->Name &>[_1] ([_2]) by [_3]
  • @@ -323,19 +370,6 @@ if ($size) { % } -% if ( @customers ) { - <&| /Widgets/TitleBox, title => loc("Customers"), - class => 'ticket-info-customers', - &> -% foreach my $customer ( @customers ) { -% my $resolver = $customer->TargetURI->Resolver or next; -
    <% $resolver->AsString |n%> -
    -% } #foreach - -% } # if @customers - - <&| /Widgets/TitleBox, title => loc("Dates"), class => 'ticket-info-dates', &>