Bug 9824: Make it possible to apply/cancel switch
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Fri, 17 May 2013 19:12:05 +0000 (21:12 +0200)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Sun, 19 May 2013 12:43:38 +0000 (08:43 -0400)
Using another existing string 'Apply filter' we are now
able to cancel the filter... and apply it... and cancel it
again... and so on.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
acqui/booksellers.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt

index 118034b..6db0bad 100755 (executable)
@@ -151,5 +151,6 @@ $template->param(
     supplier       => ( $booksellerid || $supplier ),
     count          => $supplier_count,
 );
+$template->{VARS}->{'allbaskets'} = $allbaskets;
 
 output_html_with_http_headers $query, $cookie, $template->output;
index 4064231..006980c 100644 (file)
@@ -62,7 +62,13 @@ $(document).ready(function() {
         </select>
         </p>
     [% END %]
-    <p><a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&booksellerid=[% booksellerid %]&allbaskets=1">Cancel filter</a></p>
+    <p>
+    [% IF ( allbaskets ) %]
+        <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&booksellerid=[% booksellerid %]">Apply filter</a>
+    [% ELSE %]
+        <a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&booksellerid=[% booksellerid %]&allbaskets=1">Cancel filter</a>
+    [% END %]
+    </p>
     <div id="acqui_order_supplierlist">
         [% FOREACH supplier IN loop_suppliers %]
             <div class="supplier">