%# 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 }}} <& /RTIR/Elements/Header, Title => $Title &> <& /Elements/Tabs &> % $m->callback(CallbackName => 'BeforeActionList', %ARGS, Actions => \@results, ARGSRef => \%ARGS, Ticket => $Ticket); <& /Elements/ListActions, actions => \@results &> <& /Ticket/Elements/ShowUpdateStatus, Ticket => $Ticket, DisplayPath => 'RTIR' &>
<&| /Widgets/TitleBox, title => loc('Ticket metadata') &>
% $m->callback( %ARGS, Ticket => $Ticket, CallbackName => 'LeftColumnStart' ); <&| /Widgets/TitleBox, title => loc("The Basics"), title_href => RT::IR->HREFTo("Edit.html?id=".$Ticket->Id), class => 'ticket-info-basics', &> % if (my $constituency = RT::IR->ConstituencyFor($Ticket)) { % } <& /Elements/ShowCustomFields, Grouping => 'Basics', Object => $Ticket, Table => 0 &>
<% loc("Constituency") %>: <% $constituency %>
<% loc("Status") %>: <% $Ticket->Status %>
<% loc("Incident") %>: <& /RTIR/Elements/ShowIncidents, Ticket => $Ticket &>
<&|/l&>Time Worked: <%loc('[_1] min', $TimeWorked)%>
<& /Elements/ShowCustomFieldCustomGroupings, Object => $Ticket, title_href => RT::IR->HREFTo("Edit.html"), &> <& /RTIR/Elements/ShowArticles, Ticket => $Ticket &>
% $m->callback( %ARGS, Ticket => $Ticket, CallbackName => 'RightColumnStart' ); <&| /Widgets/TitleBox, title => loc('People'), title_href => RT::IR->HREFTo("Edit.html?id=". $Ticket->Id), class => 'ticket-info-people', &> <& /RTIR/Elements/ShowPeople, Ticket => $Ticket &> <&| /Widgets/TitleBox, title => loc("Dates"), title_href => RT::IR->HREFTo("Edit.html?id=". $Ticket->Id), class => 'ticket-info-dates', &> <& /RTIR/Elements/ShowDates, Ticket => $Ticket &>
<& /Ticket/Elements/ShowAttachments, Ticket => $Ticket, Attachments => $attachments &> <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket, DisplayPath => RT::IR->HREFTo("Display.html") &>
% my $ShowHistory = RT->Config->Get("ShowHistory", $session{'CurrentUser'}); % if ($ShowHistory eq "delay") { <& /Ticket/Elements/DelayShowHistory, Ticket => $Ticket, ShowHeaders => $ARGS{'ShowHeaders'}, &> % } elsif (not $ForceShowHistory and $ShowHistory eq "click") { <& /Ticket/Elements/ClickToShowHistory, Ticket => $Ticket, ShowHeaders => $ARGS{'ShowHeaders'}, &> % } else { <& /Elements/ShowHistory, Object => $Ticket, ShowHeaders => $ARGS{'ShowHeaders'}, DisplayPath => RT::IR->HREFTo("Display.html?id=$id"), UpdatePath => RT::IR->HREFTo("Update.html"), ForwardPath => RT::IR->HREFTo("Forward.html"), EncryptionPath => RT::IR->HREFTo("Crypt.html"), WarnUnsigned => 1, PathPrefix => RT::IR->HREFTo("Ticket/"), &> % } <%INIT> my ($name); my $Ticket = RT::Ticket->new( $session{'CurrentUser'} ); my $QueueObj; unless ( $id eq 'new' ) { $Ticket = LoadTicket( $id ); unless ($Ticket->CurrentUserHasRight('ShowTicket')) { Abort("No permission to view ticket"); } $QueueObj = $Ticket->QueueObj; } else { $QueueObj = RT::Queue->new( $session{'CurrentUser'} ); $QueueObj->Load($Queue) || Abort(loc("Queue could not be loaded.")); } my $Type = RT::IR::TicketType( Lifecycle => $QueueObj->Lifecycle ); # If it's not an RTIR ticket type, just show the regular # RT ticket display page RT::Interface::Web::Redirect(RT->Config->Get('WebURL') . 'Ticket/Display.html?' . $m->comp('/Elements/QueryString', %ARGS )) unless $Type; if (RT::IR->IsCountermeasureQueue($QueueObj) && RT->Config->Get('RTIR_DisableCountermeasures') ) { Abort(loc("Countermeasure queues are disabled via config file")); } # If there's an RTIR specific display page for this kind of ticket, show that if ( $m->comp_exists("/RTIR/$Type/Display.html") ) { RT::Interface::Web::Redirect(RT::IR->HREFTo("$Type/Display.html?".$m->comp('/Elements/QueryString', %ARGS ))); } my @results; if ( $id eq 'new' ) { unless ($QueueObj->CurrentUserHasRight('CreateTicket')) { Abort('You have no permission to create tickets in that queue.'); } ($Ticket, @results) = CreateTicket( %ARGS ); } elsif( $id ) { $m->callback( CallbackName => 'ProcessArguments', Ticket => $Ticket, ARGSRef => \%ARGS, Actions => \@results, ); if ( $ARGS{'Action'} && $ARGS{'Action'} =~ /^(Steal|Kill|Take|SetTold)$/ ) { my $action = $1; my ($status, $msg) = $Ticket->$action(); push @results, $msg; # If they succeeded in taking the ticket, they should also get a lock if ($status && $action =~ /^(?:Take|Steal)$/) { $m->callback(CallbackName => 'TicketTakeOrSteal', %ARGS, Ticket => $Ticket, Type => $Type, Results => \@results); } } if ( $ARGS{'TakeOrStealFirst'} and $Ticket->Owner != $Ticket->CurrentUser->Id) { my ($status, $msg) = $Ticket->SetOwner($Ticket->CurrentUser->Id, 'Force'); push @results, $msg if $msg; # If they succeeded in taking the ticket, they should also get a lock ## Should they? This should only happen when a ticket is rejected, do we want to lock it? if ($status) { $m->callback(CallbackName => 'TicketTakeOrSteal', %ARGS, Ticket => $Ticket, Type => $Type, Results => \@results); } } push @results, ProcessUpdateMessage( TicketObj => $Ticket, ARGSRef => \%ARGS, Actions => \@results ); push @results, ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS ); my $strict_acl = RT->Config->Set( StrictLinkACL => 0 ); push @results, ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS ); RT->Config->Set( StrictLinkACL => $strict_acl ); push @results, ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS ); } if ( $ARGS{'BulkArticles'} && @SelectedTickets ) { my $ref = join " ", map "a:$_", @SelectedTickets; push @results, ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => {$Ticket->Id."-RefersTo" => $ref} ); } unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) { if( $id eq 'new' ) { Abort("No permission to view newly created ticket #".$Ticket->id."."); } Abort("No permission to view ticket"); } if ( $ARGS{'MarkAsSeen'} ) { $Ticket->SetAttribute( Name => 'User-'. $Ticket->CurrentUser->id .'-SeenUpTo', Content => $Ticket->LastUpdated, ); push @results, loc('Marked all messages as seen'); } # update id argument in the case we took merged or created new $ARGS{'id'} = $id = $Ticket->Id; MaybeRedirectForResults( Path => RT::IR->HREFTo("Display.html", IncludeWebPath => 0), Actions => \@results, Arguments => { id => $id }, Anchor => $ARGS{'Anchor'}, ); if ( $Type eq 'Report' ) { $name = "Incident Report"; } else { $name = $Type; } my $Title = loc("[_1] #[_2]: [_3]", $name, $Ticket->Id, $Ticket->Subject); my $TimeWorked = $Ticket->TimeWorked; if (defined $Ticket->TimeLeft && $Ticket->TimeLeft > 0 ) { $TimeWorked .= "/".$Ticket->TimeLeft; } my $attachments = $Ticket->Attachments; <%ARGS> $id => 0 $Queue => undef @SelectedTickets => () $ForceShowHistory => 0