Koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools/picture-upload.tt
Owen Leonard 26d3520ed7
Bug 33927: Improve translation of title tags: Tools
This patch modifies tools templates so that title tags can be
more easily translated. The patch also makes some modifications to
titles, breadcrumb navigation, and page headers in order to make them
more consistent with each other and with other similar pages.

To test, apply the patch and go to Tools. Test each of the following
pages and each variation of the page to confirm that titles,
breadcrumbs, and page headers look correct.

- Tools home page
- Import patrons
  - Import results
- Notices and slips
  - Main page
    - Main page filtered by library
    - New notice
    - Edit notice
      - Preview notice: With a CHECKIN, CHECKOUT, or HOLD_SLIP notice,
        fill in the "Data for preview" box in the "Email" section.
        Although the template loads in a modal window which doesn't show
        the page title, you can confirm that there are no errors.
- Overdue notice/status triggers
- Batch patron deletion
  - Confirmation page
- Batch patron modification
- Batch extend due dates
- Upload patron images

Print notices: With useDischarge enabled, log into the OPAC as a
user with no checkouts. Go to the "Ask for a discharge" tab and click
"Ask for a discharge."

Locate the patron's record in the staff interface and click "Discharges"
in the left-hand sidebar menu. Click "Generate discharge." Open the
resulting PDF file in a browser. The page title should be "Print notices
for [date]."

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-22 10:52:49 -03:00

204 lines
11 KiB
Text

[% USE raw %]
[% USE Asset %]
[% PROCESS 'i18n.inc' %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% FILTER collapse %]
[% IF ( TOTAL ) %]
[% t("Results") | html %] &rsaquo;
[% END %]
[% t("Upload patron images") | html %] &rsaquo;
[% t("Tools") | html %] &rsaquo;
[% t("Koha") | html %]
[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="tools_picture-upload" class="tools">
[% WRAPPER 'header.inc' %]
[% INCLUDE 'patron-search-header.inc' %]
[% END %]
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
[% END %]
[% IF ( TOTAL ) %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/tools/picture-upload.pl">Upload patron images</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Results</span>
[% END %]
[% ELSE %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Upload patron images</span>
[% END %]
[% END # /IF TOTAL %]
[% END #/ WRAPPER breadcrumbs %]
[% END #/ WRAPPER sub-header.inc %]
[% INCLUDE 'blocking_errors.inc' %]
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
[% IF ( TOTAL ) %]
[% IF ( ERRORS ) %]
[% IF ( TCOUNTS ) %]
<div class="dialog alert">
<h1>Patron image(s) uploaded with some errors</h1>
</div>
[% ELSE %]
<div class="dialog alert">
<h1>Patron image failed to upload</h1>
</div>
[% END %]
[% ELSE %]
<div class="dialog message">
<h1>Patron image(s) successfully uploaded</h1>
</div>
[% END %]
<div class="page-section">
<ul class="data">
<li>Unpacking completed</li>
<li>[% TOTAL | html %] directories scanned.</li>
<li>[% HANDLED | html %] directories processed.</li>
</ul>
[% FOREACH COUNT IN COUNTS %]
<table>
<caption>Results</caption>
<thead>
<tr><th>File name</th><th>Card number</th><th>Result</th></tr>
</thead>
<tbody>
[% IF ( COUNT.TCOUNTS ) %]<li>[% COUNT.TCOUNTS | html %] image(s) moved into the database:</li>[% END %]
[% FOREACH filename IN COUNT.filenames %]
<tr>
<td>[% filename.source | html %]</td>
<td><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% filename.cardnumber | url %]">[% filename.cardnumber | html %]</a></td>
<td>
[% IF ( filename.filerrors ) %]
[% FOREACH filerror IN filename.filerrors %]
[% IF ( filerror.DBERR ) %]<strong>ERROR:</strong> Image not imported because the database returned an error. Please refer to the error log for more details.
[% ELSIF ( filerror.IMGEXISTS ) %]<strong>ERROR:</strong> Image not imported because this patron does not exist in the database.
[% ELSIF ( filerror.MIMERR ) %]<strong>ERROR:</strong> Image not imported because the image format is unrecognized.
[% ELSIF ( filerror.CORERR ) %]<strong>ERROR:</strong> Image not imported because the image file is corrupted.
[% ELSIF ( filerror.OPNERR ) %]<strong>ERROR:</strong> Image not imported because Koha was unable to open the image for reading.
[% ELSIF ( filerror.OVRSIZ ) %]<strong>ERROR:</strong> Image not imported because the image file is too big (see online help for maximum size).
[% ELSIF ( filerror.CRDFIL ) %]<strong>ERROR:</strong> Image not imported ([% filerror.CRDFIL | html %] missing).
[% ELSIF ( filerror.CARDNUMBER_DOES_NOT_EXIST ) %]<strong>ERROR:</strong> Image not imported because this patron does not exist in the database.
[% ELSE %]<strong>ERROR:</strong> Image not imported because of an unknown error. Please refer to the error log for more details.
[% END %]
[% END %]
[% ELSE %] imported successfully.
[% END %]</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]
</div> <!-- /.page-section -->
<div class="page-section">
<ul>
[% IF ( borrowernumber ) %]
<li><a id="member" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber | html %]">Return to patron detail</a></li>
[% ELSE %]
<li><a id="uploadmore" href="/cgi-bin/koha/tools/picture-upload.pl">Upload more images</a></li>
<li><a id="doneupload" href="/cgi-bin/koha/tools/tools-home.pl">Return to tools</a></li>
[% END %]
</ul>
</div> <!-- /.page-section -->
[% ELSE %]
<h1>Upload patron images</h1>
[% IF ( ERRORS ) %]
<div class="dialog alert">
[% FOREACH ERROR IN ERRORS %]
[% IF ( ERROR.NOTZIP ) %]<li><strong>The upload file does not appear to be a zip file. The extension is not '.zip'.</strong></li>
[% ELSIF ( ERROR.NOWRITETEMP ) %]<li><strong>This script is not able to create/write to the necessary temporary directory.</strong></li>
[% ELSIF ( ERROR.EMPTYUPLOAD ) %]<li><strong>The upload file appears to be empty.</strong></li>
[% ELSIF ( ERROR.OPNLINK ) %]<li><strong>Cannot open [% ERROR.OPNLINK | html %] to read.<br />Please verify that it exists.</strong></li>
[% ELSIF ( ERROR.OPNIMG ) %]<li><strong>Cannot open [% ERROR.OPNIMG | html %] to read.<br />Please verify that it exists.</strong></li>
[% ELSIF ( ERROR.DELERR ) %]<li><strong>Unrecognized or missing field delimiter.<br />Please verify that you are using either a single quote or a tab.</strong></li>
[% ELSIF ( ERROR.UZIPFAIL ) %]<li><strong>[% ERROR.UZIPFAIL | html %] failed to unpack.<br />Please verify the integrity of the ZIP file and retry.</strong></li>
[% ELSE %]<li><strong>[% ERROR.CORERR | html %] An unknown error has occurred.<br />Please review the error log for more details.</strong></li>[% END %]
[% END %]
</div>
[% END %]
<form method="post" action="/cgi-bin/koha/tools/picture-upload.pl" enctype="multipart/form-data" id="upload_form">
<fieldset class="rows">
<p><strong>NOTE:</strong> Only PNG, GIF, JPEG, XPM formats are supported. Maximum image size is 2MB.</p>
<ol class="radio">
<li>
<label for="zipfile"><input type="radio" id="zipfile" name="filetype" value="zip" checked="checked" /> Zip file</label></li>
<li>
<label for="image">
[% IF ( filetype == 'image' ) %]<input type="radio" id="image" name="filetype" value="image" checked="checked" />[% ELSE %]<input type="radio" id="image" name="filetype" value="image" />[% END %] Image file</label>
</li>
[% IF ( filetype == 'image' ) %]
<li id="cardnum">
[% ELSE %]
<li id="cardnum" style="display: none">
[% END %]
<label for="cardnumber">Enter patron card number: </label>
<input type="text" id="cardnumber" name="cardnumber" value="[% cardnumber | html %]" size="15" />
<span class="required">Required</span>
</li>
<li class="required">
<label for="uploadfile">Select the file to upload: </label>
<input type="file" id="uploadfile" name="uploadfile" class="required" required="required" />
<span class="required">Required</span>
</li>
</ol>
</fieldset>
<fieldset class="action">
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
<input type="hidden" name="op" value="Upload" />
<input type="submit" class="btn btn-primary" value="Upload" />
<a href="/cgi-bin/koha/tools/tools-home.pl" class="cancel">Cancel</a>
</fieldset>
</form>
[% END %]
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'tools-menu.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/tools-menu.js") | $raw %]
[% INCLUDE 'str/members-menu.inc' %]
[% Asset.js("js/members-menu.js") | $raw %]
<script>
$(document).ready(function() {
$("#zipfile").click(function(){
$("#cardnum").hide();
});
$("#image").click(function(){
$("#cardnum").show();
});
$( "#upload_form" ).validate({
rules: {
cardnumber: {
required: {
depends: function(element) {
return $("#image").is(":checked");
}
}
}
}
});
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]