[rt-users] PATCH: Selection toggle for Bulk update page

George Barnett george at alink.co.za
Fri Jun 3 11:45:42 EDT 2005


Hi,

One of our users requested a toggle switch to change the selection of 
tickets when doing a bulk update of multiple tickets.  I hope it's of 
some use to somebody.

This is against RT 3.2.3.

Best regards,

George

--------CUT HERE--------
--- Bulk.html.old        Mon Nov  1 04:42:41 2004
+++ Bulk.html   Fri Jun  3 16:30:10 2005
@@ -47,7 +47,7 @@
  <& /Elements/Tabs, Title => loc("Bulk ticket update") &>

  <& /Elements/ListActions, actions => \@results &>
-<FORM METHOD="POST" ACTION="<%$RT::WebPath%>/Search/Bulk.html" >
+<FORM NAME="Form" METHOD="POST" 
ACTION="<%$RT::WebPath%>/Search/Bulk.html" >
  <input type="hidden" name="Query" value="<%$ARGS{'Query'}%>">
  <TABLE WIDTH=100% border=0 cellpadding=3 CELLSPACING=0>
  <TR>
@@ -60,6 +60,28 @@
  %}
  </TR>

+<SCRIPT LANGUAGE="JavaScript">
+<!--
+function Select() {
+  for (var i=0;i<document.Form.elements.length;i++)
+    {
+        if (document.Form.elements[i].type=='checkbox')
+         {
+           if (document.Form.elements[i].checked==false)
+           {
+             document.Form.elements[i].checked=true;
+           }
+           else
+            {
+             document.Form.elements[i].checked=false;
+            }
+         }
+    }
+}
+// -->
+</SCRIPT>
+<TR><TD><A onClick="Select();">[Invert]</A></TD></TR>
+
  <%PERL>

  my $i;
@@ -75,7 +97,7 @@
   }
        </%PERL>
  <TR bgcolor="<%$bgcolor%>">
-<TD><input type=checkbox name="UpdateTicket<%$Ticket->Id%>" CHECKED></TD>
+<TD><input type=checkbox name="UpdateTicket<%$Ticket->Id%>"></TD>
  %# The ticket view is controlled by config.pm, WebOptions
  %foreach my $col (@cols) {
  <TD>













-- 
George Barnett
Reality Engineer

m: (+44) 778 884 7205
e: george at alink.co.za

If you want to know what god thinks of money, just look at the people he 
gave it to. -- Dorthy Parker



More information about the rt-users mailing list