Koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools/picture-upload.tmpl
Chris Nighswonger 1baf6348cc kohabug 2404 This patch removes Image::Magick and adds GD
This patch removes Image::Magick as a dependency and replaces it with
the (much) lighter GD. Functionality of patronimage code has not changed with
this conversion.

Adding errorhandling for corrupted image file and link to return to moremember.pl when called from there

Added notes about supported image mime types.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-07-30 03:38:18 -05:00

129 lines
7.5 KiB
Cheetah

<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha &rsaquo; Tools &rsaquo; Upload Patron Images</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<script type="text/javascript">
$(document).ready(function() {
$("#zipfile").click(function(){
$("#cardnum").hide();
});
$("#image").click(function(){
$("#cardnum").show();
});
});
</script>
</head>
<body>
<!-- TMPL_INCLUDE NAME="header.inc" -->
<!-- TMPL_INCLUDE NAME="patron-search.inc"-->
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; Upload Patron Images </div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<!-- TMPL_IF name="TOTAL" -->
<div class="yui-b">
<div class="yui-g">
<div class="yui-u first">
<!-- TMPL_IF name="ERRORS" -->
<!-- TMPL_IF name = "TCOUNTS" -->
<div class="dialog alert">
<h3>Patron Image(s) Uploaded With Some Errors</h3>
<!-- TMPL_ELSE -->
<div class="dialog alert">
<h3>Patron Image Failed to Upload</h3>
<!-- /TMPL_IF -->
<!-- TMPL_ELSE -->
<div class="dialog message">
<h3>Patron Image(s) Successfully Uploaded</h3>
<!-- /TMPL_IF -->
<ul class="data">
<li>Unpacking completed</li>
<li><!-- TMPL_VAR NAME ="TOTAL" --> directorie(s) scanned.</li>
<li><!-- TMPL_VAR NAME="HANDLED" --> directorie(s) processed.</li>
</ul>
<!-- TMPL_LOOP name="COUNTS" -->
<ul class="data">
<!-- TMPL_IF name = "TCOUNTS" --><li><!-- TMPL_VAR name="TCOUNTS" --> image(s) moved into the database:</li><!-- /TMPL_IF -->
<!-- TMPL_LOOP name="filenames" -->
<li><!-- TMPL_VAR name="source" --> - Cardnumber: <!-- TMPL_VAR name="cardnumber" -->
<!-- TMPL_IF NAME="filerrors" --><br /> <b>WARNING:</b> This image <i>not</i> imported because
<!-- TMPL_LOOP NAME="filerrors" -->
<!-- TMPL_IF NAME="DBERR" -->the database returned an error. Please refer to the error log for more details.</li>
<!-- TMPL_ELSIF NAME="IMGEXISTS" -->this patron does not exist in the database.</li>
<!-- TMPL_ELSIF NAME="MIMERR" -->the image format is unrecognized.</li>
<!-- TMPL_ELSIF NAME="CORERR" -->the image file is corrupted.</li>
<!-- TMPL_ELSIF NAME="OPNERR" -->Koha was unable to open the image for reading.</li>
<!-- TMPL_ELSIF NAME="OVRSIZ" -->the image file is too big.</li>
<!-- TMPL_ELSIF NAME="CRDFIL" -->the <!-- TMPL_VAR NAME="CRDFIL" --> is missing.</li>
<!-- TMPL_ELSE -->of an unknown error. Please refer to the error log for more details.</li><!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
<!--TMPL_ELSE --> imported successfully.</li>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</ul>
<!-- /TMPL_LOOP -->
</div>
<!-- TMPL_IF name = "borrowernumber" -->
<a id="member" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR name = "borrowernumber" -->">Return to Patron Detail</a>
<!-- TMPL_ELSE -->
<a id="uploadmore" href="/cgi-bin/koha/tools/picture-upload.pl">Upload More Images</a>
<a id="doneupload" href="/cgi-bin/koha/tools/tools-home.pl">Return to Tools</a>
<!-- /TMPL_IF -->
</div>
<!-- TMPL_ELSE -->
<div class="yui-b">
<div class="yui-g">
<div class="yui-u first">
<h1>Upload Patron Images</h1>
<!-- TMPL_IF name="ERRORS" -->
<div class="dialog alert">
<!-- TMPL_LOOP name="ERRORS" -->
<!-- TMPL_IF name="NOTZIP" --><li><b>The upload file does not appear to be a zip file. The extention is not '.zip'.</b></li>
<!-- TMPL_ELSIF name="NOWRITETEMP" --><li><b>This script is not able to create/write to the necessary temporary directory.</b></li>
<!-- TMPL_ELSIF name="EMPTYUPLOAD" --><li><b>The upload file appears to be empty.</b></li>
<!-- TMPL_ELSIF name="OPNLINK" --><li><b>Cannot open <!-- TMPL_VAR NAME="OPNLINK" --> to read.<br />Please verify that it exists.</b></li>
<!-- TMPL_ELSIF name="OPNIMG" --><li><b>Cannot open <!-- TMPL_VAR NAME="OPNIMG" --> to read.<br />Please verify that it exists.</b></li>
<!-- TMPL_ELSIF name="DELERR" --><li><b>Unrecognized or missing field delimeter.<br />Please verify that you are using either a single quote or a tab.</b></li>
<!-- TMPL_ELSIF name="UZIPFAIL" --><li><b><!-- TMPL_VAR name="UZIPFAIL" --> failed to unpack.<br />Please verify the integrity of the zip file and retry.</b></li>
<!-- TMPL_ELSE --><li><b><!-- TMPL_VAR name ="CORERR" --> An unknown error has occurred.<br />Please review the error log for more details.</b></li><!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
</div>
<!-- /TMPL_IF -->
<form method="post" action="/cgi-bin/koha/tools/picture-upload.pl" enctype="multipart/form-data">
<fieldset class="brief">
<div class="hint"><b>NOTE:</b> Only PNG, GIF, JPEG, XPM formats are supported.</div>
<ol class="radio">
<li class="radio">
<label for="zipfile"><input type="radio" id="zipfile" name="filetype" value="zip" checked="checked" /> zip file</label></li>
<li>
<label for="image">
<!-- TMPL_IF EXPR="filetype eq 'image'" --><input type="radio" id="image" name="filetype" value="image" checked="checked" /><!-- TMPL_ELSE --><input type="radio" id="image" name="filetype" value="image" /><!-- /TMPL_IF -->
image file</label>
<ol>
<li>
<label for="uploadfile">Select the file to upload: </label><input type="file" id="uploadfile" name="uploadfile" />
<!-- TMPL_IF EXPR="filetype eq 'image'" --><span id="cardnum"><!-- TMPL_ELSE --><span id="cardnum" style="display: none"><!-- /TMPL_IF --><label for="cardnumber">Enter patron cardnumber: </label><input type="text" id="cardnumber" name="cardnumber" value="<!-- TMPL_VAR NAME="cardnumber" -->" size="15" /></span>
</li>
</ol>
</li></ol>
</fieldset>
<fieldset class="action">
<input type="hidden" name="op" value="Upload" />
<input type="submit" value="Upload" class="submit" />
<a href="/cgi-bin/koha/tools/tools-home.pl" class="cancel">Cancel</a>
</fieldset>
</form>
</div>
<!-- /TMPL_IF -->
</div>
</div>
</div>
<div class="yui-b noprint">
<!-- TMPL_INCLUDE NAME="tools-menu.inc" -->
</div>
</div>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->