[Rt-commit] r7569 - in rtir/branches/2.3-EXPERIMENTAL: . etc html/RTIR html/RTIR/Elements html/RTIR/Incident

jesse at bestpractical.com jesse at bestpractical.com
Thu Apr 19 11:51:51 EDT 2007


Author: jesse
Date: Thu Apr 19 11:51:49 2007
New Revision: 7569

Modified:
   rtir/branches/2.3-EXPERIMENTAL/   (props changed)
   rtir/branches/2.3-EXPERIMENTAL/etc/RTIR_Config.pm
   rtir/branches/2.3-EXPERIMENTAL/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
   rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Display.html
   rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/QueueTabs
   rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/ShowIncidents
   rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/ShowRTIRField
   rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Incident/Display.html
   rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Update.html

Log:
 r54808 at pinglin:  jesse | 2007-04-12 20:30:06 -0400
  * Locking API
 r54810 at pinglin:  jesse | 2007-04-12 21:59:49 -0400
 * First pass at locking
 r55613 at pinglin:  jesse | 2007-04-18 02:00:58 -0400
  * quick attempt to add locking for incidents.
 r55717 at pinglin:  jesse | 2007-04-18 14:32:51 -0400
 * Removed "TakeOrSteal" functionality
 * Corrected Locking support for Incidents
 * Minor cleanups to ticket display page
 


Modified: rtir/branches/2.3-EXPERIMENTAL/etc/RTIR_Config.pm
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/etc/RTIR_Config.pm	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/etc/RTIR_Config.pm	Thu Apr 19 11:51:49 2007
@@ -194,7 +194,7 @@
     NewReports =>
         q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
           '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
-          __Requestors__, __OwnerName__, __DueRelative__, __TakeOrSteal__},
+          __Requestors__, __OwnerName__, __DueRelative__, __Take__},
 
     ChildReport =>
         q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',

Modified: rtir/branches/2.3-EXPERIMENTAL/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once	Thu Apr 19 11:51:49 2007
@@ -60,6 +60,17 @@
         $COLUMN_MAP->{ "CustomField.{$name}" } = \%h;
 }
 
+$COLUMN_MAP->{'Take'} = {
+    title => 'Take',
+    value => sub {
+        my $t = shift;
+        return '' if $t->Owner != $RT::Nobody->id;
+        my $action = 'Take';
+        my $link = RT->Config->Get('WebPath') ."/Ticket/Display.html?Action=$action&id=". $t->id;
+        $link = qq{<a href="$link">}. $t->loc($action) .qq{</a>};
+        return \$link;
+    },
+};
 $COLUMN_MAP->{'TakeOrSteal'} = {
     title => 'Take/Steal',
     value => sub {

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 Apr 19 11:51:49 2007
@@ -145,8 +145,6 @@
 
 </&>
 
-</td>
-  <td valign="top" width="50%">
 % if ($RT::FM::VERSION) {
 <&| /Widgets/TitleBox, title => loc("Articles"),
     title_href => RT->Config->Get('WebPath') ."/RTIR/Advanced.html?id=".$id, 
@@ -170,19 +168,15 @@
 
 </&>
 % }
-  </td>
-</tr>
-<tr>
-  <td valign="top" width="50%">
-    <br />
+</td> <td valign="top" width="50%">
+%#  </td> </tr> <tr> <td valign="top" width="50%">
     <&| /Widgets/TitleBox, title => loc('People'), 
         title_href  => RT->Config->Get('WebPath') ."/RTIR/Edit.html?id=". $Ticket->Id,
         title_class => 'inverse' &>
     <& /RTIR/Elements/ShowPeople, Ticket => $Ticket &>
     </&>
     <br />
-  </td>
-  <td>
+%#  </td> <td>
         <br />
           <&| /Widgets/TitleBox, title => loc("Dates"),
                 title_href  => RT->Config->Get('WebPath') ."/RTIR/Edit.html?id=". $Ticket->Id,
@@ -254,14 +248,6 @@
     }
 
 
-    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
-        if ($status) { $ARGS{'Lock'} = 'add'; }
-    }
-
     if ( $ARGS{'Lock'} ) {
 
         if ( $ARGS{'Lock'} eq 'add' ) {

Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/QueueTabs
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/QueueTabs	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/QueueTabs	Thu Apr 19 11:51:49 2007
@@ -260,12 +260,12 @@
     {
         if ( $Type eq 'Report' ) {
             $actions->{'B'} = {
-                path => "RTIR/Update.html?Action=Comment&TakeOrStealFirst=1&DefaultStatus=rejected&id=$id",
+                path => "RTIR/Update.html?Action=Comment&DefaultStatus=rejected&id=$id",
                  title => loc('Reject'),
             };
 
             $actions->{'Bb'} = {
-                path  => "RTIR/Display.html?Status=rejected&TakeOrStealFirst=1&id=$id",
+                path  => "RTIR/Display.html?Status=rejected&Action=Take&id=$id",
                 title => loc('Quick Reject'),
             };
         }

Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/ShowIncidents
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/ShowIncidents	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/ShowIncidents	Thu Apr 19 11:51:49 2007
@@ -25,10 +25,10 @@
 % while ( my $incident = $incidents->Next ) {
 % $m->out('<ul>') unless $count;
 <li>
+<a href="<% RT->Config->Get('WebPath') %>/RTIR/Display.html?id=<% $incident->Id %>"><% $incident->Id %>: <% $incident->Subject %></a> <i>( <& /RTIR/Elements/ShowRTIRField, Ticket => $incident, Name => 'State' &> )</i>
 % if ( $show_unlink ) {
 <a href="<% RT->Config->Get('WebPath') %>/RTIR/Display.html?id=<% $Ticket->Id %>&DeleteLink--MemberOf-<% $incident->Id %>=1">[<% loc('Unlink') %>]</a>
 % }
-<a href="<% RT->Config->Get('WebPath') %>/RTIR/Display.html?id=<% $incident->Id %>"><% $incident->Id %>: <% $incident->Subject %></a><i>(<& /RTIR/Elements/ShowRTIRField, Ticket => $incident, Name => 'State' &>)</i>
 % if ( $depth < 8 ) {
 <& /RTIR/Elements/ShowIncidents, Ticket => $incident, depth => ($depth+1) &>
 % }

Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/ShowRTIRField
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/ShowRTIRField	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/ShowRTIRField	Thu Apr 19 11:51:49 2007
@@ -24,6 +24,7 @@
 %# END LICENSE BLOCK
 % unless ( $count ) {
 <span class="cf-value novalue"><&|/l&>no value</&></class>
+% return;
 % } elsif ( $count == 1 ) {
 <span class="cf-value"><% $values->First->Content %></span>
 % } else {

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 Apr 19 11:51:49 2007
@@ -324,21 +324,21 @@
 
     }
     if ( $ARGS{'Lock'} ) {
-        my $Ticket = $TicketObj;
+
         if ( $ARGS{'Lock'} eq 'add' ) {
-            if ( $Ticket->RT::IR::Ticket::Lock() ) {
+            if ( $TicketObj->RT::IR::Ticket::Lock() ) {
                 push @results, loc('You now have a lock on this ticket');
             } else {
                 push @results, loc('Your attempt to lock this ticket failed');
 
             }
         } elsif ( $ARGS{'Lock'} eq 'remove' ) {
-            my $lock = $Ticket->RT::IR::Ticket::Locked();
+            my $lock = $TicketObj->RT::IR::Ticket::Locked();
             if ( !$lock ) {
                 push @results, loc('This ticket was not locked');
 
                 } elsif ( $lock->Content->{'User'} == $session{'CurrentUser'}->id ) {
-                $Ticket->RT::IR::Ticket::Unlock();
+                $TicketObj->RT::IR::Ticket::Unlock();
                 push @results, loc('You have unlocked this ticket');
             } else {
                 push @results,
@@ -347,7 +347,7 @@
             }
 
         } elsif ( $ARGS{'Lock'} eq 'break' ) {
-            $Ticket->RT::IR::Ticket::BreakLock();
+            $TicketObj->RT::IR::Ticket::BreakLock();
             push @results, loc('You have broken the lock on this ticket');
         }
     }

Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Update.html
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Update.html	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Update.html	Thu Apr 19 11:51:49 2007
@@ -37,7 +37,6 @@
 <input type="hidden" name="Status" value="<% $DefaultStatus %>" />
 % }
 <input type="hidden" name="Action" value="<% $Action || '' %>" />
-<input type="hidden" name="TakeOrStealFirst" value="<% $ARGS{TakeOrStealFirst} || '' %>" />
 % if ($Type eq 'Report' and $ARGS{'DefaultStatus'} eq 'rejected') {
 %   my $query = "Queue = 'Incidents' AND HasMember = $id";
 %   my $incidents = new RT::Tickets($session{'CurrentUser'});


More information about the Rt-commit mailing list