Koha/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/print.tt
Owen Leonard 95f881b969 Bug 19961: Move template JavaScript to the footer: Patron card creator
This patch modifies the staff client patron card creator templates so
that JavaScript is included in the footer instead of the header.

Also changed: Removed "type" attribute from script tags.

To test, apply the patch and test the JavaScript-driven features of
each modified template: All button controls, DataTables functionality,
form validation, etc.

- Creating and managing layouts
- Creating and managing card batches
- Creating and managing card templates
- Creating and managing printer profiles
- Creating and managing images

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-03-26 17:31:26 -03:00

133 lines
7.9 KiB
Text

[% SET footerjs = 1 %]
<!DOCTYPE html>
[% IF ( bidi ) %]<html lang="[% lang %]" dir="[% bidi %]">[% ELSE %]<html lang="[% lang %]">[% END %]
<head>
<title>Koha &rsaquo; Tools &rsaquo; Patron cards &rsaquo; Patron card printing/exporting</title>
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
[% INCLUDE intranetstylesheet.inc %]
[% IF ( IntranetUserCSS ) %]<style type="text/css">[% IntranetUserCSS %]</style>[% END %]
[% INCLUDE 'doc-head-close.inc' popup => 1%]
<style type="text/css">#custom-doc {width:47.23em; *width:46.04em; min-width:610px; margin:auto; margin-top:0.4em;}</style>
</head>
<body id="pcard_print" class="tools pcard">
<div id="custom-doc">
<div id="bd">
[% IF ( batches ) %]
<form>
<h3>Click on the following link(s) to download the exported batch(es).</h3>
<fieldset>
[% FOREACH batche IN batches %]
[% IF ( batche.label_ids ) %]
<legend>[% batche.card_count %] Single patron cards</legend>
<p>
<a class="document pdf" href="/cgi-bin/koha/patroncards/[% batche.create_script %]?batch_id=[% batche.batch_id %]&amp;template_id=[% batche.template_id %]&amp;layout_id=[% batche.layout_id %]]&amp;layout_back_id=[% batche.layout_back_id %]&amp;start_card=[% batche.start_card %][% batche.label_ids %]">label_single_[% batche.card_count %].pdf</a>
</p>
[% ELSIF ( batche.borrower_numbers ) %]
<legend>[% batche.card_count %] Single Patron Cards</legend>
<p>
<a class="document pdf" href="/cgi-bin/koha/patroncards/[% batche.create_script %]?template_id=[% batche.template_id %]&amp;layout_id=[% batche.layout_id %]&amp;layout_back_id=[% batche.layout_back_id %]&amp;start_card=[% batche.start_card %][% batche.borrower_numbers %]">label_single_[% batche.card_count %].pdf</a>
</p>
[% ELSE %]
<legend>Card batch number [% batche.batch_id %]</legend>
<p>
<a class="document pdf" href="/cgi-bin/koha/patroncards/create-pdf.pl?batch_id=[% batche.batch_id %]&amp;template_id=[% batche.template_id %]&amp;layout_id=[% batche.layout_id %]&amp;layout_back_id=[% batche.layout_back_id %]&amp;start_card=[% batche.start_card %]">label_batch_[% batche.batch_id %].pdf</a>
</p>
[% END %]
[% END %]
</fieldset>
<fieldset class="action">
<input type="button" class="gb-close" value="Done" />
</fieldset>
</form>
[% ELSIF ( patronlist_id && template_id && layout_id ) %]
<h3>Click on the link to download the patron cards from the patron list.</h3>
<p>
<a class="document pdf" href="/cgi-bin/koha/patroncards/create-pdf.pl?patronlist_id=[% patronlist_id %]&amp;template_id=[% template_id %]&amp;layout_id=[% layout_id %]&amp;layout_back_id=[% layout_back_id %]&amp;start_card=[% start_card %]">label_patronlist_[% patronlist_id %].pdf</a>
</p>
[% ELSE %]
<h3>
[% IF ( label_ids ) %]
[% IF ( card_count == 1 ) %]Exporting [% card_count %] patron card[% ELSE %]Exporting [% card_count %] patron cards[% END %]
[% ELSIF ( borrower_numbers ) %]
[% IF ( borrower_count == 1 ) %]Exporting [% borrower_count %] patron card[% ELSE %]Exporting [% borrower_count %] patron cards[% END %]
[% ELSIF ( patronlist_id ) %] Exporting from patron list
[% ELSE %]
[% IF ( multi_batch_count == 1 ) %][% multi_batch_count %] batch to export[% ELSE %][% multi_batch_count %] batches to export[% END %]
[% END %]
</h3>
<form id="exportingf" name="exporting" method="post" action="/cgi-bin/koha/patroncards/print.pl">
<input type="hidden" name="op" value="export" />
<input type="hidden" name="referer" value="[% referer %]" />
[% FOREACH batch_id IN batch_ids %]
<input type="hidden" name="batch_id" value="[% batch_id.batch_id %]" />
[% END %]
[% FOREACH label_id IN label_ids %]
<input type="hidden" name="label_id" value="[% label_id.label_id %]" />
[% END %]
[% FOREACH borrower_number IN borrower_numbers %]
<input type="hidden" name="borrower_number" value="[% borrower_number.borrower_number %]" />
[% END %]
[% IF (patronlist_id) %] <input type="hidden" name="patronlist_id" value="[% patronlist_id %]" /> [% END %]
<fieldset class="rows">
<ol>
<li>
<label style="width:9em" for="template_id">Select a template to be applied: </label>
<select name="template_id" id="template_id">
[% FOREACH template IN templates %]
<option value="[% template.template_id %]">[% template.template_code %]</option>
[% END %]
</select>
</li>
<li>
<label style="width:9em" for="layout_id">Select a layout to be applied: </label>
<select name="layout_id" id="layout_id">
[% FOREACH layout IN layouts %]
<option value="[% layout.layout_id %]">[% layout.layout_name %]</option>
[% END %]
</select>
</li>
<li>
<label style="width:9em" for="layout_back_id">Select a layout for back side: </label>
<select name="layout_back_id" id="layout_back_id">
<option value="0">Back side layout not used</option>
[% FOREACH layout IN layouts %]
<option value="[% layout.layout_id %]">[% layout.layout_name %]</option>
[% END %]
</select>
<span class="hint">Used for duplex printers (needs a '1 up template')</span>
</li>
<li>
<label style="width:9em" for="start_card">Enter starting card position: </label>
<input type="text" size="5" id="start_card" name="start_card" class="focus" title="Starting card number" value="1" />
</li>
</ol>
</fieldset>
<fieldset class="action">
<input type="submit" value="Export" />
<a href="#" class="cancel gb-close">Cancel</a>
</fieldset>
</form>
[% END %]
</div>
</div>
[% IF ( IntranetUserJS ) %]
<script src="[% interface %]/lib/jquery/jquery-2.2.3.min_[% KOHA_VERSION %].js"></script>
<script src="[% interface %]/lib/jquery/jquery-migrate-1.3.0.min_[% KOHA_VERSION %].js"></script>
<script>
[% IntranetUserJS %]
function Done() {
window.location = "[% referer %]";
};
$(document).ready(function(){
$(".gb-close").on("click",function(){
parent.parent.GB_hide();
});
});
</script>
[% END %]
[% INCLUDE 'popup-bottom.inc' %]