%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# %# This software is Copyright (c) 1996-2014 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->Config->Get('WebPath') ."/RTIR/Edit.html?id=".$Ticket->Id, class => 'ticket-info-basics', &> <& /Elements/ShowCustomFields, Object => $Ticket, Table => 0 &>
<% loc("Status") %>: <% $Ticket->Status %>
<% loc("Incident") %>: <& /RTIR/Elements/ShowIncidents, Ticket => $Ticket &>
<&|/l&>Time Worked: <%loc('[_1] min', $TimeWorked)%>
<& /RTIR/Elements/ShowArticles, Ticket => $Ticket &>
% $m->callback( %ARGS, Ticket => $Ticket, CallbackName => 'RightColumnStart' ); <&| /Widgets/TitleBox, title => loc('People'), title_href => RT->Config->Get('WebPath') ."/RTIR/Edit.html?id=". $Ticket->Id, class => 'ticket-info-people', &> <& /RTIR/Elements/ShowPeople, Ticket => $Ticket &> <&| /Widgets/TitleBox, title => loc("Dates"), title_href => RT->Config->Get('WebPath') ."/RTIR/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 => '/RTIR/Display.html' &>
<& /Ticket/Elements/ShowHistory, Ticket => $Ticket, Collapsed => $ARGS{'Collapsed'}, ShowHeaders => $ARGS{'ShowHeaders'}, DisplayPath => RT->Config->Get('WebPath') ."/RTIR/Display.html?id=$id", UpdatePath => RT->Config->Get('WebPath') ."/RTIR/Update.html", ForwardPath => RT->Config->Get('WebPath') ."/RTIR/Forward.html", EncryptionPath => RT->Config->Get('WebPath') ."/RTIR/GnuPG.html", WarnUnsigned => 1, &> <%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( Queue => $QueueObj ); return $m->comp( '/Ticket/Display.html', %ARGS ) unless $Type; if ($Type eq 'Block' && RT->Config->Get('RTIR_DisableBlocksQueue') ) { Abort(loc("Blocks queue is disabled via config file")); } if ( $m->comp_exists("/RTIR/$Type/Display.html") ) { return $m->comp("/RTIR/$Type/Display.html", %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, Attachments => delete $session{'Attachments'} ); } 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); } } $ARGS{UpdateAttachments} = delete $session{'Attachments'}; push @results, ProcessUpdateMessage( TicketObj => $Ticket, ARGSRef => \%ARGS ); 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 => '/RTIR/Display.html', 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 = $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket); <%ARGS> $id => 0 $Queue => undef @SelectedTickets => ()