[Rt-commit] [rtir] 01/01: add a $Row param updater widget

Todd Wade todd at bestpractical.com
Tue Apr 14 23:46:55 EDT 2015


This is an automated email from the git hooks/post-receive script.

todd pushed a commit to branch 3.2/fromincident-row-updater
in repository rtir.

commit ab205c53bcf152a6c5e230b3b8341b5d5122ea3e
Author: Todd Wade <todd at bestpractical.com>
Date:   Tue Apr 14 22:48:52 2015 -0400

    add a $Row param updater widget
    
    By default the FromIncident page only shows 50 rows and if you want to see
    more rows you have to 'Edit Search'. This widget allows you to update the
    rows right from the linker page.
---
 html/RTIR/Link/FromIncident/index.html | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/html/RTIR/Link/FromIncident/index.html b/html/RTIR/Link/FromIncident/index.html
index 8f80c9f..30fff26 100644
--- a/html/RTIR/Link/FromIncident/index.html
+++ b/html/RTIR/Link/FromIncident/index.html
@@ -75,6 +75,21 @@
 <& /Elements/Submit, Name => "SubmitTicket", Caption => $title, Label => loc("Link") &>
 </form>
 
+
+<form action="index.html" method="post">
+% while ( my( $name, $value) = each %RowsFormHiddens ) {
+%   if ( defined $value ) {
+  <input type="hidden" name="<% $name %>" value="<% $value %>" />
+%   }
+% }
+  <div style="white-space: nowrap">
+    Show
+    <input autocomplete="off" type="text" name="Rows" size="2" value="<% $Rows %>" />
+    Rows (of <% $total_count %> total)
+    <input type="submit" name="UpdateRows"  value="Update" class="button" />
+  </div>
+</form>
+
 <%ARGS>
 $id          => undef
 $Queue       => undef
@@ -100,6 +115,20 @@ my $BaseQuery = RT::IR->Query(
     Constituency => $IncidentObj,
 );
 
+
+# Count the number of tickets for Rows form
+my $counter = RT::Tickets->new( $session{'CurrentUser'} );;
+$counter->FromSQL( join ' AND ', map "( $_ )", $BaseQuery, $Query );
+my $total_count = $counter->CountAll;
+
+# Prepare hidden fields for Rows form
+my %RowsFormHiddens = (
+  id => $id,
+  Queue => $Queue,
+  map { $_ => $ARGS{$_} } qw( Query Format Page Order OrderBy )
+);
+
+
 my $base_url = 'RTIR/Link/FromIncident/?'
     . $m->comp( '/Elements/QueryString', id => $id, Queue => $Queue );
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list