Bug 22417: Fix spelling resizeable vs resizable
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / background_jobs.tt
blob40cf28c9cff5f1409afb468ade7baee1967d3cc3
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Administration &rsaquo; [% IF op =='add_form' %]Background jobs&rsaquo; [% IF job %] View background job[% ELSE %] Background jobs[% END %][% END %]</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 </head>
9 <body id="admin_background_jobs" class="admin">
10 [% INCLUDE 'header.inc' %]
12 <div id="breadcrumbs">
13     <a href="/cgi-bin/koha/mainpage.pl">Home</a>
14     &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
15     [% IF CAN_user_parameters_manage_background_jobs %]&rsaquo; <a href="/cgi-bin/koha/admin/background_jobs.pl">Background jobs</a>[% END %]
16 </div>
18 <div class="main container-fluid">
19     <div class="row">
20         <div class="col-sm-10 col-sm-push-2">
21             <main>
23 [% FOR m IN messages %]
24     <div class="dialog message">
25         [% SWITCH m.code %]
26         [% CASE 'cannot_retrieve_jobs' %]
27             <div><i class="fa fa-exclamation error"></i>Cannot retrieve pending jobs ([% m.error | html %])</div>
28         [% CASE 'cannot_view_job' %]
29             <div><i class="fa fa-exclamation error"></i>Insufficient permission to see this job.</div>
30         [% CASE %]
31             [% m.code | html %]
32         [% END %]
33     </div>
34 [% END %]
36 [% IF op == 'view' %]
37     <h1>Detail of job #[% job.id | html %]</h1>
39     <fieldset class="rows">
40         <ol>
41             <li><span class="label">Job ID: </span>[% job.id | html %]</li>
42             <li><label for="job_status">Status: </label>[% job.status | html %]</li>
43             <li><label for="job_progress">Progress: </label>[% job.progress || 0 | html %] / [% job.size | html %]</li>
44             <li><label for="job_type">Type: </label>[% job.type | html %]</li>
45             <li><label for="job_enqueued_on">enqueued_on: </label>[% job.enqueued_on | html %]</li>
46             <li><label for="job_started_on">started_on: </label>[% job.started_on | html %]</li>
47             <li><label for="job_ended_on">ended_on: </label>[% job.ended_on | html %]</li>
48             <li><label for="job_data">Report: </label>
49                 [% SWITCH job.type %]
50                 [% CASE 'batch_biblio_record_modification' %]
51                     [% SET report = job.report %]
52                     [% IF report %]
53                         [% IF report.total_records == report.total_success %]
54                             <div class="dialog message">
55                                 All records have successfully been modified! <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
56                                 [% IF lists.count %]
57                                     <br />
58                                     Add modified records to the following list:
59                                     <select name="add_bibs_to_list" id="add_bibs_to_list">
60                                         <option value="">Select a list</option>
61                                         [% FOREACH list IN lists %]
62                                             <option class="shelf" value="[% list.shelfnumber | html %]">[% list.shelfname | html %]</option>
63                                         [% END %]
64                                     </select>
65                                 [% END %]
66                             </div>
67                         [% ELSE %]
68                             <div class="dialog message">
69                                 [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred.
70                                 [% IF job.status == 'cancelled' %]The job has been cancelled before it finished.[% END %]
71                                 <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
72                             </div>
73                         [% END %]
74                     [% END %]
75                 [% CASE 'batch_authority_record_modification' %]
76                     [% SET report = job.report %]
77                     [% IF report %]
78                         [% IF report.total_records == report.total_success %]
79                             <div class="dialog message">
80                                 All records have successfully been modified! <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
81                             </div>
82                         [% ELSE %]
83                             <div class="dialog message">
84                                 [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred.
85                                 [% IF job.status == 'cancelled' %]The job has been cancelled before it finished.[% END %]
86                                 <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
87                             </div>
88                         [% END %]
89                     [% END %]
90                 [% CASE %]Job type "[% job.type | html %]" not handled in the template
91                 [% END %]
92             </li>
93             <li><label for="job_data">Detailed messages: </label>
94                 [% SWITCH job.type %]
95                 [% CASE 'batch_biblio_record_modification' %]
96                     [% FOR m IN job.messages %]
97                         <div class="dialog message">
98                             [% IF m.type == 'success' %]
99                                 <i class="fa fa-check success"></i>
100                             [% ELSIF m.type == 'warning' %]
101                                 <i class="fa fa-warning warn"></i>
102                             [% ELSIF m.type == 'error' %]
103                                 <i class="fa fa-exclamation error"></i>
104                             [% END %]
105                             [% SWITCH m.code %]
106                             [% CASE 'biblio_not_modified' %]
107                                 Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has not been modified. An error occurred on modifying it.[% IF m.error %] ([% m.error | html %])[% END %].
108                             [% CASE 'biblio_modified' %]
109                                 Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has successfully been modified.
110                             [% END %]
111                         </div>
112                     [% END %]
113                 [% CASE 'batch_authority_record_modification' %]
114                     [% FOR m IN job.messages %]
115                         <div class="dialog message">
116                             [% IF m.type == 'success' %]
117                                 <i class="fa fa-check success"></i>
118                             [% ELSIF m.type == 'warning' %]
119                                 <i class="fa fa-warning warn"></i>
120                             [% ELSIF m.type == 'error' %]
121                                 <i class="fa fa-exclamation error"></i>
122                             [% END %]
123                             [% SWITCH m.code %]
124                             [% CASE 'authority_not_modified' %]
125                                 Authority record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% m.authid | uri %]">[% m.authid | html %]</a> has not been modified. An error occurred on modifying it[% IF m.error %] ([% m.error | html %])[% END %].
126                             [% CASE 'authority_modified' %]
127                                 Authority record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% m.authid | uri %]">[% m.authid | html %]</a> has successfully been modified..
128                             [% END %]
129                         </div>
130                     [% END %]
131                 [% CASE %]Job type "[% job.type | html %]" not handled in the template
132                 [% END %]
133             </li>
134         </ol>
135     </fieldset>
137     [% IF CAN_user_parameters_manage_background_jobs %]
138         <a href="/cgi-bin/koha/admin/background_jobs.pl">Return to the job list</a>
139     [% END %]
140 [% END %]
142 [% IF op == 'list' %]
144     <h2>Background jobs</h2>
146     <div class="dialog message">
147         <i class="fa fa-info"></i>
148         [% IF pending_jobs.size > 0 %]
149             There is [% pending_jobs.size | html %] pending jobs on the server: [% pending_jobs.join(', ') | html %].
150         [% ELSE %]
151             There is no pending jobs on the server.
152         [% END %]
153     </div>
155     [% IF jobs.count %]
156         <table id="table_background_jobs">
157             <thead>
158                 <tr>
159                     <th>Job ID</th>
160                     <th>Status</th>
161                     <th>Progress</th>
162                     <th>Type</th>
163                     <th>Enqueued on</th>
164                     <th>Started on</th>
165                     <th>Ended on</th>
166                     <th>Actions (NIY)</th>
167                 </tr>
168             </thead>
169             <tbody>
170                 [% FOREACH job IN jobs %]
171                 <tr>
172                     <td>[% job.id | html %]</td>
173                     <td>[% job.status | html %]</td>
174                     <td>[% job.progress || 0 | html %] / [% job.size | html %]</td>
175                     <td>
176                         [% SWITCH job.type %]
177                         [% CASE 'batch_biblio_record_modification' %]Batch bibliographic record modification
178                         [% CASE 'batch_authority_record_modification' %]Batch authority record modification
179                         [% CASE %][% job.type | html %]
180                         [% END %]
181                     </td>
182                     <td>[% job.enqueued_on | html %]</td>
183                     <td>[% job.started_on| html %]</td>
184                     <td>[% job.ended_on| html %]</td>
185                     <td class="actions">
186                         <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/background_jobs.pl?op=view&amp;id=[% job.id | html %]"><i class="fa fa-eye"></i> View</a>
187                         [% IF job.status == 'new' || job.status == 'started' %]
188                             <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/background_jobs.pl?op=cancel&amp;id=[% job.id | html %]"><i class="fa fa-trash"></i> Cancel</a>
189                         [% END %]
190                         <a class="btn btn-default btn-xs disabled" href="/cgi-bin/koha/admin/background_jobs.pl?op=replay&amp;id=[% job.id | html %]"><i class="fa fa-refresh"></i> Replay</a>
191                     </td>
192                 </tr>
193                 [% END %]
194             </tbody>
195         </table>
196     [% ELSE %]
197         <div class="dialog message">
198             There are no background jobs yet.
199         </div>
200     [% END %]
201 [% END %]
203             </main>
204         </div> <!-- /.col-sm-10.col-sm-push-2 -->
206         <div class="col-sm-2 col-sm-pull-10">
207             <aside>
208                 [% INCLUDE 'admin-menu.inc' %]
209             </aside>
210         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
211      </div> <!-- /.row -->
213 [% MACRO jsinclude BLOCK %]
214     [% Asset.js("js/admin-menu.js") | $raw %]
215     [% INCLUDE 'datatables.inc' %]
216     <script>
217         $(document).ready(function() {
218             $("#table_background_jobs").dataTable($.extend(true, {}, dataTablesDefaults, {
219                 "aoColumnDefs": [
220                     { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
221                 ],
222                 "aaSorting": [[ 0, "desc" ]],
223                 "iDisplayLength": 10,
224                 "sPaginationType": "full_numbers"
225             }));
227             $("#add_bibs_to_list").change(function(){
228                 var selected = $("#add_bibs_to_list").find("option:selected");
229                 if ( selected.attr("class") == "shelf" ){
230                     var shelfnumber = selected.attr("value");
231                     var bibs = new Array();
232                     [% FOREACH message IN job.messages %]
233                         [% IF message.code == 'biblio_modified' %]
234                             bibs.push("biblionumber="+[% message.biblionumber | html %]);
235                         [% END %]
236                     [% END %]
237                     var bibstring = bibs.join("&");
238                     window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&'+bibstring, 'popup', 'width=500,height=500,toolbar=false,scrollbars=yes,resizable=yes');
239                     return false;
240                 }
241             });
242         });
243     </script>
244 [% END %]
245 [% INCLUDE 'intranet-bottom.inc' %]