Koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools/picture-upload.tt
Owen Leonard 897b28b44a
Bug 32254: Add 'page-section' to various tools pages
This patch adds a .page-section div to various pages in the tools
section in order to provide a consistent page structure.

Also changed: Corrected a couple of templates which were missing some
<tr> tags.

This patch includes indentation changes, so please ignore whitespace
when looking at the diff.

To test, apply the patch and view the following pages to confirm that
the primary page content is wrapped in a container with a white
background:

- Tools -> Access files
- Tools -> HTML customizations
  - Additional contents, news or pages-- all use the same template.
  - Check the list of existing entries.
- Tools -> Batch extend due dates
  - Choose a set of criteria that will return results and click
   "Continue".
  - Check the list of checkouts to be updated.
- Tools -> Batch patron modification
  - Submit a batch of patrons for modification.
  - Check the list of patrons to be modified.
- Tools -> Upload patron images
  - Upload one or more patron images
  - Check the view of results
- Tools -> Upload
  - Upload a file and view the results, or perform a search and check
    the view of results.
- Tools -> Patron card creator -> New patron card batch.
  - Submit a set of patrons and check the display of patrons in the
    resulting batch.
- Tools -> Cash summary for <library> and Tools -> Transaction history
  for <register>
  - Confirm that the table of data looks correct

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

Signed-off-by: David <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-11-22 16:33:08 -03:00

205 lines
10 KiB
Text

[% USE raw %]
[% USE Asset %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Upload patron images &rsaquo; Tools &rsaquo; Koha</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' %]
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
<ol>
<li>
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
</li>
<li>
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
</li>
[% IF ( TOTAL ) %]
<li>
<a href="/cgi-bin/koha/tools/picture-upload.pl">Upload patron images</a>
</li>
<li>
<a href="#" aria-current="page">
Results
</a>
</li>
[% ELSE %]
<li>
<a href="#" aria-current="page">
Upload patron images
</a>
</li>
[% END %]
</ol>
</nav>
[% END %]
[% 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' %]