LP1116258 - Hide download circ history if none to be found
authorBen Shum <bshum@biblio.org>
Fri, 15 Mar 2013 05:04:06 +0000 (01:04 -0400)
committerBen Shum <bshum@biblio.org>
Fri, 15 Mar 2013 16:24:16 +0000 (12:24 -0400)
As noted in LP1116258, if there is no circ history for a patron, but they
click on the Download CSV button, it leads them to unhappy server errors.

So, hide the Download CSV button unless the number of circs > 0.

Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Pasi Kallinen <pasi.kallinen@pttk.fi>
Open-ILS/src/templates/opac/myopac/circ_history.tt2

index 3bb04bb..4582e81 100644 (file)
             <form action="[% mkurl(ctx.opac_root _ '/myopac/circ_history/export') %]" method="post">
                 <div>
                     [%- INCLUDE "opac/parts/preserve_params.tt2" %]
+                    [% IF ctx.circs.size > 0 %]
                     <input type="hidden" name="filename" value="[% l('circ_history.csv') %]"/> 
                     <button type="submit">[% l('Download CSV') %]</button>
+                    [% END %]
                 </div>
             </form>
         </span>