View | Details | Raw Unified | Return to bug 25941
Collapse All | Expand All

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

Return to bug 25941