|
Lines 10-106
Link Here
|
| 10 |
</head> |
10 |
</head> |
| 11 |
|
11 |
|
| 12 |
<body id="tools_upload-images" class="tools"> |
12 |
<body id="tools_upload-images" class="tools"> |
| 13 |
[% INCLUDE 'header.inc' %] |
13 |
[% INCLUDE 'header.inc' %] |
| 14 |
[% INCLUDE 'cat-search.inc' %] |
14 |
[% INCLUDE 'cat-search.inc' %] |
| 15 |
|
15 |
|
| 16 |
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › [% IF ( uploadimage ) %]<a href="/cgi-bin/koha/tools/upload-cover-image.pl">Upload local cover image</a> › Upload results[% ELSE %]Upload local cover image[% END %]</div> |
16 |
<div id="breadcrumbs"> |
| 17 |
|
17 |
<a href="/cgi-bin/koha/mainpage.pl">Home</a> › |
| 18 |
<div class="main container-fluid"> |
18 |
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › |
| 19 |
<div class="row"> |
19 |
[% IF ( uploadimage ) %] |
| 20 |
<div class="col-sm-10 col-sm-push-2"> |
20 |
<a href="/cgi-bin/koha/tools/upload-cover-image.pl">Upload local cover image</a> › Upload results |
| 21 |
<main> |
21 |
[% ELSE %] |
| 22 |
|
22 |
Upload local cover image |
| 23 |
<h1>Upload local cover image</h1> |
23 |
[% END %] |
| 24 |
[% IF ( uploadimage ) %] |
|
|
| 25 |
<p>Image upload results :</p> |
| 26 |
<ul> |
| 27 |
<li>[% total | html %] images found</li> |
| 28 |
[% IF ( error ) %] |
| 29 |
<div class="dialog alert"> |
| 30 |
[% IF ( error == 'UZIPFAIL' ) %]<p><b>Failed to unzip archive.<br />Please ensure you are uploading a valid zip file and try again.</b></p> |
| 31 |
[% ELSIF ( error == 'OPNLINK' ) %]<p><b>Cannot open folder index (idlink.txt or datalink.txt) to read.<br />Please verify that it exists.</b></p> |
| 32 |
[% ELSIF ( error == 'OPNIMG' ) %]<p><b>Cannot process file as an image.<br />Please ensure you only upload GIF, JPEG, PNG, or XPM images.</b></p> |
| 33 |
[% ELSIF ( error == 'DELERR' ) %]<p><b>Unrecognized or missing field delimiter.<br />Please verify that you are using either a single quote or a tab.</b></p> |
| 34 |
[% ELSIF ( error == 'DBERR' ) %]<p><b>Unable to save image to database.</b></p> |
| 35 |
[% ELSE %]<p><b>An unknown error has occurred.<br />Please review the error log for more details.</b></p>[% END %] |
| 36 |
</div> |
| 37 |
</li> |
| 38 |
[% END %] |
| 39 |
<li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">View final record</a></li> |
| 40 |
<li><a href="/cgi-bin/koha/tools/tools-home.pl">Back</a></li> |
| 41 |
</ul> |
| 42 |
<hr /> |
| 43 |
[% END %] |
| 44 |
<ul> |
| 45 |
<li>Select an image file or ZIP file to upload. The tool will accept images in GIF, JPEG, PNG, and XPM formats.</li> |
| 46 |
</ul> |
| 47 |
<form method="post" action="/cgi-bin/koha/tools/upload-cover-image.pl" id="uploadfile" enctype="multipart/form-data"> |
| 48 |
<fieldset class="rows" > |
| 49 |
<legend>Upload images</legend> |
| 50 |
<ol> |
| 51 |
<li> |
| 52 |
<div id="fileuploadform"> |
| 53 |
<label for="fileToUpload" class="required">Select the file to upload: </label> |
| 54 |
<input type="file" id="fileToUpload" name="fileToUpload" required="required" class="required" /> |
| 55 |
<span class="required">Required</span> |
| 56 |
</div> </li> |
| 57 |
</ol> |
| 58 |
<fieldset class="action"><button class="submit btn btn-default">Upload file</button></fieldset> |
| 59 |
</fieldset> |
| 60 |
|
| 61 |
<div id="uploadpanel"> |
| 62 |
<div id="fileuploadstatus" class="progress_panel">Upload progress: |
| 63 |
<progress max="100" value="0" id="fileuploadprogress"> |
| 64 |
</progress> |
| 65 |
<span class="fileuploadpercent">0</span>% |
| 66 |
</div> |
| 67 |
<div id="fileuploadfailed"></div> |
| 68 |
</div> |
24 |
</div> |
| 69 |
</form> |
25 |
|
| 70 |
|
26 |
<div class="main container-fluid"> |
| 71 |
<form method="post" id="processfile" action="/cgi-bin/koha/tools/upload-cover-image.pl" enctype="multipart/form-data"> |
27 |
<div class="row"> |
| 72 |
<fieldset class="rows"> |
28 |
<div class="col-sm-10 col-sm-push-2"> |
| 73 |
<input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" /> |
29 |
<main> |
| 74 |
<input type="hidden" name="runinbackground" id="runinbackground" value="" /> |
30 |
|
| 75 |
<input type="hidden" name="completedJobID" id="completedJobID" value="" /> |
31 |
<h2>Upload local cover image</h2> |
| 76 |
</fieldset> |
32 |
|
| 77 |
<fieldset class="rows"> |
33 |
[% IF ( uploadimage ) %] |
| 78 |
<legend>File type</legend> |
34 |
<h3>Image upload results :</h3> |
| 79 |
<ol> |
35 |
[% IF ( error ) %] |
| 80 |
<li class="radio"> |
36 |
<div class="dialog alert"> |
| 81 |
[% IF (filetype != 'image' ) %]<input type="radio" id="zipfile" name="filetype" value="zip" checked="checked" />[% ELSE %]<input type="radio" id="zipfile" name="filetype" value="zip" />[% END %] |
37 |
[% IF ( error == 'UZIPFAIL' ) %] |
| 82 |
<label for="zipfile">ZIP file</label> |
38 |
<p><b>Failed to unzip archive.<br />Please ensure you are uploading a valid zip file and try again.</b></p> |
| 83 |
</li> |
39 |
[% ELSIF ( error == 'OPNLINK' ) %] |
| 84 |
<li class="radio"> |
40 |
<p><b>Cannot open folder index (idlink.txt or datalink.txt) to read.<br />Please verify that it exists.</b></p> |
| 85 |
[% 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 %] |
41 |
[% ELSIF ( error == 'OPNIMG' ) %] |
| 86 |
<label for="image">Image file</label> |
42 |
<p><b>Cannot process file as an image.<br />Please ensure you only upload GIF, JPEG, PNG, or XPM images.</b></p> |
| 87 |
</li> |
43 |
[% ELSIF ( error == 'DELERR' ) %] |
| 88 |
<li class="radio"> |
44 |
<p><b>Unrecognized or missing field delimiter.<br />Please verify that you are using either a single quote or a tab.</b></p> |
| 89 |
[% IF ( filetype == 'image' ) %]<span id="bibnum">[% ELSE %]<span id="bibnum" style="display: none">[% END %]<label for="biblionumber">Enter cover biblionumber: </label><input type="text" id="biblionumber" name="biblionumber" value="[% biblionumber | html %]" size="15" /></span> |
45 |
[% ELSIF ( error == 'DBERR' ) %] |
| 90 |
</li> |
46 |
<p><b>Unable to save image to database.</b></p> |
| 91 |
</ol> |
47 |
[% ELSE %] |
| 92 |
</fieldset> |
48 |
<p><b>An unknown error has occurred.<br />Please review the error log for more details.</b></p> |
| 93 |
<fieldset class="rows"> |
49 |
[% END %] |
| 94 |
<legend>Options</legend> |
50 |
</div> |
| 95 |
<ol> |
51 |
[% END %] |
| 96 |
<li class="checkbox"> |
52 |
<ul> |
| 97 |
[% IF AllowMultipleCovers == 0 %]<input type="checkbox" id="replace" name="replace" checked="checked" disabled="disabled" value="1" />[% ELSE %]<input type="checkbox" id="replace" name="replace" value="1" />[% END %] |
53 |
<li>[% total | html %] images found</li> |
| 98 |
<label for="replace">Replace existing covers</label> |
54 |
<li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">View final record</a></li> |
| 99 |
</li> |
55 |
<li><a href="/cgi-bin/koha/tools/tools-home.pl">Back</a></li> |
| 100 |
</ol> |
56 |
</ul> |
| 101 |
</fieldset> |
57 |
<hr /> |
| 102 |
<fieldset class="action"><button type="submit" class="btn btn-default btn-sm">Process images</button></fieldset> |
58 |
[% END %] |
| 103 |
</form> |
59 |
|
|
|
60 |
<p>Select an image file or ZIP file to upload. The tool will accept images in GIF, JPEG, PNG, and XPM formats.</p> |
| 61 |
|
| 62 |
<form method="post" action="/cgi-bin/koha/tools/upload-cover-image.pl" id="uploadfile" enctype="multipart/form-data"> |
| 63 |
<fieldset class="rows" > |
| 64 |
<legend>Upload images</legend> |
| 65 |
<ol> |
| 66 |
<li> |
| 67 |
<div id="fileuploadform"> |
| 68 |
<label for="fileToUpload" class="required">Select the file to upload: </label> |
| 69 |
<input type="file" id="fileToUpload" name="fileToUpload" required="required" class="required" /> |
| 70 |
<span class="required">Required</span> |
| 71 |
</div> |
| 72 |
</li> |
| 73 |
</ol> |
| 74 |
<fieldset class="action"> |
| 75 |
<button class="submit btn btn-default">Upload file</button> |
| 76 |
</fieldset> |
| 77 |
</fieldset> |
| 78 |
|
| 79 |
<div id="uploadpanel"> |
| 80 |
<div id="fileuploadstatus" class="progress_panel">Upload progress: |
| 81 |
<progress max="100" value="0" id="fileuploadprogress"></progress> |
| 82 |
<span class="fileuploadpercent">0</span>% |
| 83 |
</div> |
| 84 |
<div id="fileuploadfailed"></div> |
| 85 |
</div> |
| 86 |
</form> |
| 87 |
|
| 88 |
<form method="post" id="processfile" action="/cgi-bin/koha/tools/upload-cover-image.pl" enctype="multipart/form-data"> |
| 89 |
<fieldset class="rows"> |
| 90 |
<input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" /> |
| 91 |
<input type="hidden" name="runinbackground" id="runinbackground" value="" /> |
| 92 |
<input type="hidden" name="completedJobID" id="completedJobID" value="" /> |
| 93 |
|
| 94 |
<legend>File type</legend> |
| 95 |
<ol> |
| 96 |
<li class="radio"> |
| 97 |
[% IF (filetype != 'image' ) %] |
| 98 |
<input type="radio" id="zipfile" name="filetype" value="zip" checked="checked" /> |
| 99 |
[% ELSE %] |
| 100 |
<input type="radio" id="zipfile" name="filetype" value="zip" /> |
| 101 |
[% END %] |
| 102 |
<label for="zipfile">ZIP file</label> |
| 103 |
</li> |
| 104 |
<li class="radio"> |
| 105 |
[% IF (filetype == 'image' ) %] |
| 106 |
<input type="radio" id="image" name="filetype" value="image" checked="checked" /> |
| 107 |
[% ELSE %] |
| 108 |
<input type="radio" id="image" name="filetype" value="image" /> |
| 109 |
[% END %] |
| 110 |
<label for="image">Image file</label> |
| 111 |
</li> |
| 112 |
<li class="radio"> |
| 113 |
[% IF ( filetype == 'image' ) %] |
| 114 |
<span id="bibnum"> |
| 115 |
[% ELSE %] |
| 116 |
<span id="bibnum" style="display: none"> |
| 117 |
[% END %] |
| 118 |
<label for="biblionumber">Enter cover biblionumber: </label> |
| 119 |
<input type="text" id="biblionumber" name="biblionumber" value="[% biblionumber | html %]" size="15" /> |
| 120 |
</span> |
| 121 |
</li> |
| 122 |
</ol> |
| 123 |
</fieldset> |
| 124 |
|
| 125 |
<fieldset class="rows"> |
| 126 |
<legend>Options</legend> |
| 127 |
<ol> |
| 128 |
<li class="checkbox"> |
| 129 |
[% IF AllowMultipleCovers == 0 %] |
| 130 |
<input type="checkbox" id="replace" name="replace" checked="checked" disabled="disabled" value="1" /> |
| 131 |
[% ELSE %] |
| 132 |
<input type="checkbox" id="replace" name="replace" value="1" /> |
| 133 |
[% END %] |
| 134 |
<label for="replace">Replace existing covers</label> |
| 135 |
</li> |
| 136 |
</ol> |
| 137 |
</fieldset> |
| 138 |
|
| 139 |
<fieldset class="action"> |
| 140 |
<button type="submit" class="btn btn-default btn-sm">Process images</button> |
| 141 |
</fieldset> |
| 142 |
</form> |
| 104 |
|
143 |
|
| 105 |
</main> |
144 |
</main> |
| 106 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
145 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
|
Lines 110-116
Link Here
|
| 110 |
[% INCLUDE 'tools-menu.inc' %] |
149 |
[% INCLUDE 'tools-menu.inc' %] |
| 111 |
</aside> |
150 |
</aside> |
| 112 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
151 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
| 113 |
</div> <!-- /.row --> |
152 |
</div> <!-- /.row --> |
| 114 |
|
153 |
|
| 115 |
[% MACRO jsinclude BLOCK %] |
154 |
[% MACRO jsinclude BLOCK %] |
| 116 |
[% Asset.js("js/tools-menu.js") | $raw %] |
155 |
[% Asset.js("js/tools-menu.js") | $raw %] |
| 117 |
- |
|
|