[Rt-commit] r8387 - in rtir/branches/2.3-EXPERIMENTAL: . html/RTIR
thayes at bestpractical.com
thayes at bestpractical.com
Thu Aug 2 18:58:28 EDT 2007
Author: thayes
Date: Thu Aug 2 18:58:28 2007
New Revision: 8387
Modified:
rtir/branches/2.3-EXPERIMENTAL/ (props changed)
rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Create.html
rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Display.html
rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Create.html
rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Display.html
Log:
r8574 at toth: toth | 2007-08-02 18:49:12 -0400
* Now accomodates passing an ID to /Elements/ShowLock, to keep track of locks not being looked at
Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Create.html
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Create.html (original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Create.html Thu Aug 2 18:58:28 2007
@@ -47,10 +47,7 @@
&>
% }
-% if($Split) {
- <& /Elements/ShowLock, Ticket => $TicketObj, Unlock => 0 &>
-% }
-
+<& /Elements/ShowLock, Ticket => $TicketObj, Unlock => 0, Id => $ARGS{'Ticket'} &>
<& /Elements/ListActions, actions => \@results &>
% if ( $Split && !$TicketObj->CurrentUserHasRight('ModifyTicket') ) {
@@ -331,17 +328,6 @@
my $QueueObj = new RT::Queue( $session{'CurrentUser'} );
$QueueObj->Load( $Queue ) || Abort( loc("Queue could not be loaded.") );
-if($ARGS{'Child'}) {
- my $ChildObj = LoadTicket($ARGS{'Child'});
- if($ARGS{'CreateIncident'} || $ARGS{'CreateWithInvestigation'}) {
- $ChildObj->Unlock('Take');
- }
- else
- {
- $ChildObj->Lock('Take');
- }
-}
-
my $Type = RT::IR::TicketType( Queue => $Queue );
if ($Type eq 'Block' && RT->Config->Get('RTIR_DisableBlocksQueue') ) {
Abort(loc("Blocks queue is disabled via config file"));
Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Display.html
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Display.html (original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Display.html Thu Aug 2 18:58:28 2007
@@ -31,7 +31,7 @@
Title => $Title &>
% $Duration ||= $ARGS{'Duration'};
-<& /Elements/ShowLock, Ticket => $Ticket, Duration => $Duration &>
+<& /Elements/ShowLock, Ticket => $Ticket, Duration => $Duration, Id => $ARGS{'Id'} &>
<& /Elements/ListActions, actions => \@results &>
<table border="0" cellpadding="0" cellspacing="2" width="100%">
<tr>
Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Create.html
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Create.html (original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Create.html Thu Aug 2 18:58:28 2007
@@ -29,10 +29,8 @@
Title => $Title,
Ticket => $TicketObj &>
-% if($Split) {
- <& /Elements/ShowLock, Ticket => $TicketObj, Unlock => 0 &>
-% }
+<& /Elements/ShowLock, Ticket => $TicketObj, Unlock => 0, Id => $Id, Duration => $Duration &>
<& /Elements/ListActions, actions => \@results &>
<%PERL>
@@ -206,12 +204,26 @@
# if there isn't a subject, but there is a child, use that one
my $ChildObj;
+my $Duration;
+my $Id;
if ( $Child ) {
$ChildObj = LoadTicket( $Child );
$Child = $ARGS{'Child'} = $ChildObj->id;
$ARGS{'Subject'} ||= $ChildObj->Subject;
+ if($ARGS{'CreateIncident'} || $ARGS{'CreateWithInvestigation'}) {
+ my $lock = $ChildObj->Unlock('Take');
+ $Duration = time() - $lock->Content->{'Timestamp'} if $lock;
+ }
+ else
+ {
+ $ChildObj->Lock('Take');
+ }
+ $Id = $ARGS{'Child'};
}
+$Id = $ARGS{'Ticket'} if $Split;
+
+
my $QueueObj = RT::Queue->new( $session{'CurrentUser'} );
$QueueObj->Load( 'Incidents' ) || Abort( loc("Queue could not be loaded.") );
@@ -275,8 +287,8 @@
}
}
if( $inc_obj ) {
- $TicketObj->Unlock() if $TicketObj;
- return $m->comp('Display.html', id => $inc_obj->id, results => \@results );
+ $Id = $ChildObj->id if $ChildObj;
+ return $m->comp('Display.html', id => $inc_obj->id, Duration => $Duration, Id => $Id, results => \@results );
}
}
Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Display.html
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Display.html (original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Display.html Thu Aug 2 18:58:28 2007
@@ -30,7 +30,7 @@
Title => loc("Incident #[_1]: [_2]", $id, $TicketObj->Subject) &>
% $Duration ||= $ARGS{'Duration'};
-<& /Elements/ShowLock, Ticket => $TicketObj, Duration => $Duration &>
+<& /Elements/ShowLock, Ticket => $TicketObj, Duration => $Duration, Id => $ARGS{'Id'} &>
<& /Elements/ListActions, actions => \@results &>
<table border="0" cellpadding="0" cellspacing="2" width="100%"><tr><td valign="top" width="50%">
More information about the Rt-commit
mailing list