4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Administration › [% IF op =='add_form' %]Background jobs› [% IF job %] View background job[% ELSE %] Background jobs[% END %][% END %]</title>
6 [% INCLUDE 'doc-head-close.inc' %]
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 › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
15 [% IF CAN_user_parameters_manage_background_jobs %]› <a href="/cgi-bin/koha/admin/background_jobs.pl">Background jobs</a>[% END %]
18 <div class="main container-fluid">
20 <div class="col-sm-10 col-sm-push-2">
23 [% FOR m IN messages %]
24 <div class="dialog message">
26 [% CASE 'cannot_retrieve_jobs' %]
27 <div><i class="fa fa-exclamation error"></i>Cannot retrieve pending jobs ([% m.error %])</div>
28 [% CASE 'cannot_view_job' %]
29 <div><i class="fa fa-exclamation error"></i>Insufficient permission to see this job.</div>
37 <h1>Detail of job #[% job.id | html %]</h1>
39 <fieldset class="rows">
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>
50 [% CASE 'batch_biblio_record_modification' %]
51 [% SET report = job.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>
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>
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>
75 [% CASE 'batch_authority_record_modification' %]
76 [% SET report = job.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>
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>
90 [% CASE %]Job type "[% job.type | html %]" not handled in the template
93 <li><label for="job_data">Detailed messages: </label>
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>
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 %])[% 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.
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>
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 %])[% 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..
131 [% CASE %]Job type "[% job.type | html %]" not handled in the template
137 [% IF CAN_user_parameters_manage_background_jobs %]
138 <a href="/cgi-bin/koha/admin/background_jobs.pl">Return to the job list</a>
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 %] pending jobs on the server: [% pending_jobs.join(', ') %].
151 There is no pending jobs on the server.
156 <table id="table_background_jobs">
166 <th>Actions (NIY)</th>
170 [% FOREACH job IN jobs %]
172 <td>[% job.id | html %]</td>
173 <td>[% job.status | html %]</td>
174 <td>[% job.progress || 0 | html %] / [% job.size | html %]</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 %]
182 <td>[% job.enqueued_on | html %]</td>
183 <td>[% job.started_on| html %]</td>
184 <td>[% job.ended_on| html %]</td>
186 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/background_jobs.pl?op=view&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&id=[% job.id | html %]"><i class="fa fa-trash"></i> Cancel</a>
190 <a class="btn btn-default btn-xs disabled" href="/cgi-bin/koha/admin/background_jobs.pl?op=replay&id=[% job.id | html %]"><i class="fa fa-refresh"></i> Replay</a>
197 <div class="dialog message">
198 There are no background jobs yet.
204 </div> <!-- /.col-sm-10.col-sm-push-2 -->
206 <div class="col-sm-2 col-sm-pull-10">
208 [% INCLUDE 'admin-menu.inc' %]
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' %]
217 $(document).ready(function() {
218 $("#table_background_jobs").dataTable($.extend(true, {}, dataTablesDefaults, {
220 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
222 "aaSorting": [[ 0, "desc" ]],
223 "iDisplayLength": 10,
224 "sPaginationType": "full_numbers"
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 %]);
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,resizeable=yes');
245 [% INCLUDE 'intranet-bottom.inc' %]