[Rt-commit] r4208 - in rtir/branches/1.9-EXPERIMENTAL: . html/RTIR html/RTIR/Elements

ruz at bestpractical.com ruz at bestpractical.com
Thu Dec 1 15:20:16 EST 2005


Author: ruz
Date: Thu Dec  1 15:20:15 2005
New Revision: 4208

Added:
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/UserDueIncidents
Modified:
   rtir/branches/1.9-EXPERIMENTAL/   (props changed)
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/DueIncidents
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/IncidentSummary
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/States
   rtir/branches/1.9-EXPERIMENTAL/html/RTIR/index.html
Log:


Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/DueIncidents
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/DueIncidents	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/DueIncidents	Thu Dec  1 15:20:15 2005
@@ -22,44 +22,24 @@
 %# 
 %# 
 %# END LICENSE BLOCK
-<& /Widgets/TitleBoxStart, title => $title, bodyclass=> '' &>
-
-<& /RTIR/Search/Elements/ShowResults, 
-   Query => $Query, 
-   QueryString => $QueryString, 
-   Format => $Format,
-   Rows => 10,
+<&| /Widgets/TitleBox,
+    title => $ARGS{'Title'} || loc("Most due incidents"),
+    bodyclass=> '',
 &>
 
-<& /Widgets/TitleBoxEnd &>
-
-<%INIT>
-$Format = $RT::RTIRSearchResultFormats->{'DueIncidents'};
-
-my $Query = "Queue = 'Incidents'";
+<& /RTIR/Search/Elements/ShowResults, %ARGS, Query => $Query &>
 
-if ($owner) {
-  $Query .= " AND (Owner = " . $owner->id . " OR Owner = 'Nobody')";
-}
+</&>
 
-$Query .= " AND " . 
-    $m->comp('/RTIR/Elements/NewQuery', 
-             Queue => 'Incidents',
-             states => [ 'new', 'open', 'stalled' ]);
+<%INIT>
+$ARGS{'Format'} ||= $RT::RTIRSearchResultFormats->{'DueIncidents'};
+$ARGS{'Rows'}   ||= 10;
 
-my $title;
-if ($owner) {
-  $title = loc("Most due incidents owned by [_1] (and unowned)", 
-              $owner->Name);
-} else {
-  $title = loc("Most due incidents");
-}
+my $Query  = "Queue = 'Incidents'";
+$Query    .= " AND ". $m->comp( '/RTIR/Elements/NewQuery', Queue => 'Incidents' );
+$Query    .= " AND $ARGS{Query}" if $ARGS{'Query'};
+
+use Data::Dumper;
+$RT::Logger->crit( Dumper(\%ARGS) );
+$RT::Logger->crit( $Query );
 </%INIT>
-
-<%ARGS>
-$rows => 10
-$owner => undef
-$OrderBy => undef
-$Format => undef
-$QueryString => undef
-</%ARGS>

Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/IncidentSummary
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/IncidentSummary	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/IncidentSummary	Thu Dec  1 15:20:15 2005
@@ -96,8 +96,8 @@
                                Query => $Query,
                                Format => $Format,
                                Rows => $Rows,
-                               OrderBy => $OrderBy,
-                               Order => $Order,
+                               OrderBy => $ARGS{'OrderBy'},
+                               Order => $ARGS{'Order'},
                                Page => $Page);
 
 </%INIT>
@@ -110,6 +110,4 @@
 $HideResults => 0
 $Rows => 50
 $Page => 1
-$OrderBy => 'id'
-$Order => 'ASC'
 </%ARGS>

Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/States
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/States	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/States	Thu Dec  1 15:20:15 2005
@@ -1,6 +1,6 @@
 <%ONCE>
 my %meta = (
-    'Incidents'        => { Active => ['new', 'open'], Inactive => [] },
+    'Incidents'        => { Active => ['new', 'open', 'stalled'], Inactive => [] },
     'Incident Reports' => { Active => ['new', 'open'], Inactive => ['rejected'] },
     'Investigations'   => { Active => ['open'], Inactive => ['stalled'] },
     'Blocks'        => { Active => ['pending activation', 'active', 'pending removal'], Inactive => [] },

Added: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/UserDueIncidents
==============================================================================
--- (empty file)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Elements/UserDueIncidents	Thu Dec  1 15:20:15 2005
@@ -0,0 +1,13 @@
+<& /RTIR/Elements/DueIncidents,
+    %ARGS,
+    Title => $Title,
+    Query => $Query,
+&>
+<%INIT>
+my $Owner = delete $ARGS{'Owner'} || $session{'CurrentUser'};
+
+my $Query  = "(Owner = " . $Owner->id . " OR Owner = 'Nobody')";
+$Query    .= " AND $ARGS{Query}" if $ARGS{'Query'};
+
+my $Title = loc( "Most due incidents owned by [_1] (and unowned)", $Owner->Name );
+</%INIT>

Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/index.html
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/index.html	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/index.html	Thu Dec  1 15:20:15 2005
@@ -44,7 +44,7 @@
 
 </TD></TR><TR VALIGN=TOP><TD colspan=2 WIDTH=100%>
 
-<& /RTIR/Elements/DueIncidents, owner => $session{'CurrentUser'} &>
+<& /RTIR/Elements/UserDueIncidents &>
 
 <BR>
 


More information about the Rt-commit mailing list