[Rt-commit] rt branch, 3.8-trunk, updated. rt-3.8.6-104-ga9ebe0e

Ruslan Zakirov ruz at bestpractical.com
Sun Nov 29 20:26:03 EST 2009


The branch, 3.8-trunk has been updated
       via  a9ebe0e31752ea25dbedd4db6fdee60323af3da1 (commit)
       via  7b14bc55065d0968da727506ee20b7e90946755b (commit)
      from  c10d6c8609698d406a898765c653cdba1049a654 (commit)

Summary of changes:
 share/html/Admin/Queues/index.html |   44 ++++++++++++++++++++++++++++++-----
 share/html/Elements/SelectUsers    |    4 +-
 2 files changed, 39 insertions(+), 9 deletions(-)

- Log -----------------------------------------------------------------
commit 7b14bc55065d0968da727506ee20b7e90946755b
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Mon Nov 30 04:23:00 2009 +0300

    we shouldn't escape selected="selected"

diff --git a/share/html/Elements/SelectUsers b/share/html/Elements/SelectUsers
index e5581cb..b4a3aa0 100755
--- a/share/html/Elements/SelectUsers
+++ b/share/html/Elements/SelectUsers
@@ -47,11 +47,11 @@
 %# END BPS TAGGED BLOCK }}}
 <select name="UserField">
 % foreach my $col (RT::User->BasicColumns) {
-<option <% ($UserField eq $col->[0]) ? 'selected="selected"' : '' %> value="<% $col->[0] %>"><% loc($col->[1]) %></option>
+<option <% ($UserField eq $col->[0]) ? 'selected="selected"' : '' |n %> value="<% $col->[0] %>"><% loc($col->[1]) %></option>
 % }
 % while (my $CF = $CFs->Next) {
 %   my $val = "CustomField-" . $CF->Id;
-<option <% ($UserField eq $val) ? 'selected="selected"' : '' %> value="<% $val %>"><&|/l&>CustomField</&>: <% $CF->Name %></option>
+<option <% ($UserField eq $val) ? 'selected="selected"' : '' |n %> value="<% $val %>"><&|/l&>CustomField</&>: <% $CF->Name %></option>
 % }
 </select>
 <& /Elements/SelectMatch, Name => 'UserOp', Default => $UserOp &>

commit a9ebe0e31752ea25dbedd4db6fdee60323af3da1
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Mon Nov 30 04:23:55 2009 +0300

    add simple search on Admin/Queues page

diff --git a/share/html/Admin/Queues/index.html b/share/html/Admin/Queues/index.html
index 727849c..52e7b3b 100755
--- a/share/html/Admin/Queues/index.html
+++ b/share/html/Admin/Queues/index.html
@@ -64,25 +64,51 @@
     Format => $Format,
     Collection => $queues,
     AllowSorting => 1,
-    PassArguments => [qw(Format Rows Page Order OrderBy FindDisabledQueues)],
+    PassArguments => [qw(
+        Format Rows Page Order OrderBy
+        FindDisabledQueues QueueString QueueOp QueueField
+    )],
 &>
 % }
 <form method="post" action="<% RT->Config->Get('WebPath') %>/Admin/Queues/index.html">
+% foreach my $field( qw(Format Rows Page Order OrderBy) ) {
+%     next unless defined $ARGS{ $field } && length $ARGS{ $field };
+<input type="hidden" name="<% $field %>" value="<% $ARGS{ $field } %>" />
+% }
+
+<select name="QueueField">
+% foreach my $col (qw(Name Description CorrespondAddress CommentAddress InitialPriority FinalPriority DefaultDueIn)) {
+<option <% $QueueField eq $col ? 'selected="selected"' : '' |n %> value="<% $col %>"><% loc($col) %></option>
+% }
+</select>
+<& /Elements/SelectMatch, Name => 'QueueOp', Default => $QueueOp &>
+<input size="8" name="QueueString" value="<% $QueueString %>" />
+<br />
+
 <input type="checkbox" class="checkbox" name="FindDisabledQueues" value="1" <% $FindDisabledQueues? 'checked="checked"': '' |n%> />
 <&|/l&>Include disabled queues in listing.</&>
 <div align="right"><input type="submit" class="button" value="<&|/l&>Go!</&>" /></div> 
 </form>
 
 <%INIT>
-my ($queue, $caption);
 my $queues = new RT::Queues($session{'CurrentUser'});
-$queues->UnLimit();
+$queues->{'find_disabled_rows'} = 1 if $FindDisabledQueues;
 
-if ($FindDisabledQueues) {
-    $caption = loc("All Queues");
-    $queues->{'find_disabled_rows'} = 1;
+my ($caption);
+if ( defined $QueueString && length $QueueString ) {
+    $caption = $FindDisabledQueues
+        ? loc("All queues matching search criteria")
+        : loc("Enabled queues matching search criteria");
+    $queues->Limit(
+        FIELD    => $QueueField,
+        OPERATOR => $QueueOp,
+        VALUE    => $QueueString,
+    );
 } else {
-    $caption = loc("Enabled Queues");
+    $queues->UnLimit;
+    $caption = $FindDisabledQueues
+        ? loc("All Queues")
+        : loc("Enabled Queues");
 }
 
 $Format ||= q{'<a href="__WebPath__/Admin/Queues/Modify.html?id=__id__">__id__</a>/TITLE:#'}
@@ -93,4 +119,8 @@ $Format ||= q{'<a href="__WebPath__/Admin/Queues/Modify.html?id=__id__">__id__</
 <%ARGS>
 $FindDisabledQueues => 0
 $Format             => undef
+
+$QueueField         => 'Name'
+$QueueOp            => '='
+$QueueString        => ''
 </%ARGS>

-----------------------------------------------------------------------


More information about the Rt-commit mailing list