4 [% INCLUDE 'doc-head-open.inc' %]
6 [% IF op =='add_form' %]
11 [% END %] › Background jobs › [% END %]
12 Administration › Koha
14 [% INCLUDE 'doc-head-close.inc' %]
17 <body id="admin_background_jobs" class="admin">
18 [% INCLUDE 'header.inc' %]
20 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
23 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
26 [% IF CAN_user_parameters_manage_background_jobs %]
28 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
31 <a href="#" aria-current="page">Background jobs</a>
35 <a href="#" aria-current="page">Administration</a>
41 <div class="main container-fluid">
43 <div class="col-sm-10 col-sm-push-2">
46 [% FOR m IN messages %]
47 <div class="dialog message">
49 [% CASE 'cannot_view_job' %]
50 <div><i class="fa fa-exclamation error"></i>Insufficient permission to see this job.</div>
58 <h1>Detail of job #[% job.id | html %]</h1>
60 <fieldset class="rows">
62 <li><span class="label">Job ID: </span>[% job.id | html %]</li>
63 <li><label for="job_status">Status: </label>[% job.status | html %]</li>
64 <li><label for="job_progress">Progress: </label>[% job.progress || 0 | html %] / [% job.size | html %]</li>
65 <li><label for="job_type">Type: </label>[% job.type | html %]</li>
66 <li><label for="job_enqueued_on">Queued: </label>[% job.enqueued_on | html %]</li>
67 <li><label for="job_started_on">Started: </label>[% job.started_on | html %]</li>
68 <li><label for="job_ended_on">Ended: </label>[% job.ended_on | html %]</li>
69 <li><label for="job_data">Report: </label>
71 [% CASE 'batch_biblio_record_modification' %]
72 [% SET report = job.report %]
74 [% IF report.total_records == report.total_success %]
75 <div class="dialog message">
76 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>
79 Add modified records to the following list:
80 <select name="add_bibs_to_list" id="add_bibs_to_list">
81 <option value="">Select a list</option>
82 [% FOREACH list IN lists %]
83 <option class="shelf" value="[% list.shelfnumber | html %]">[% list.shelfname | html %]</option>
89 <div class="dialog message">
90 [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred.
91 [% IF job.status == 'cancelled' %]The job has been cancelled before it finished.[% END %]
92 <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
96 [% CASE 'batch_authority_record_modification' %]
97 [% SET report = job.report %]
99 [% IF report.total_records == report.total_success %]
100 <div class="dialog message">
101 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>
104 <div class="dialog message">
105 [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred.
106 [% IF job.status == 'cancelled' %]The job has been cancelled before it finished.[% END %]
107 <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
111 [% CASE %]Job type "[% job.type | html %]" not handled in the template
114 <li><label for="job_data">Detailed messages: </label>
115 [% SWITCH job.type %]
116 [% CASE 'batch_biblio_record_modification' %]
117 [% FOR m IN job.messages %]
118 <div class="dialog message">
119 [% IF m.type == 'success' %]
120 <i class="fa fa-check success"></i>
121 [% ELSIF m.type == 'warning' %]
122 <i class="fa fa-warning warn"></i>
123 [% ELSIF m.type == 'error' %]
124 <i class="fa fa-exclamation error"></i>
127 [% CASE 'biblio_not_modified' %]
128 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 %].
129 [% CASE 'biblio_modified' %]
130 Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has successfully been modified.
134 [% CASE 'batch_authority_record_modification' %]
135 [% FOR m IN job.messages %]
136 <div class="dialog message">
137 [% IF m.type == 'success' %]
138 <i class="fa fa-check success"></i>
139 [% ELSIF m.type == 'warning' %]
140 <i class="fa fa-warning warn"></i>
141 [% ELSIF m.type == 'error' %]
142 <i class="fa fa-exclamation error"></i>
145 [% CASE 'authority_not_modified' %]
146 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 %].
147 [% CASE 'authority_modified' %]
148 Authority record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% m.authid | uri %]">[% m.authid | html %]</a> has successfully been modified.
152 [% CASE %]Job type "[% job.type | html %]" not handled in the template
158 [% IF CAN_user_parameters_manage_background_jobs %]
159 <a href="/cgi-bin/koha/admin/background_jobs.pl">Return to the job list</a>
163 [% IF op == 'list' %]
165 <h2>Background jobs</h2>
168 <table id="table_background_jobs">
178 <th class="noExport">Actions</th>
182 [% FOREACH job IN jobs %]
184 <td>[% job.id | html %]</td>
185 <td>[% job.status | html %]</td>
186 <td>[% job.progress || 0 | html %] / [% job.size | html %]</td>
188 [% SWITCH job.type %]
189 [% CASE 'batch_biblio_record_modification' %]Batch bibliographic record modification
190 [% CASE 'batch_authority_record_modification' %]Batch authority record modification
191 [% CASE %][% job.type | html %]
194 <td>[% job.enqueued_on | html %]</td>
195 <td>[% job.started_on| html %]</td>
196 <td>[% job.ended_on| html %]</td>
198 <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>
199 [% IF job.status == 'new' || job.status == 'started' %]
200 <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>
208 <div class="dialog message">
209 There are no background jobs yet.
215 </div> <!-- /.col-sm-10.col-sm-push-2 -->
217 <div class="col-sm-2 col-sm-pull-10">
219 [% INCLUDE 'admin-menu.inc' %]
221 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
222 </div> <!-- /.row -->
224 [% MACRO jsinclude BLOCK %]
225 [% Asset.js("js/admin-menu.js") | $raw %]
226 [% INCLUDE 'datatables.inc' %]
228 $(document).ready(function() {
229 $("#table_background_jobs").dataTable($.extend(true, {}, dataTablesDefaults, {
231 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
233 "aaSorting": [[ 0, "desc" ]],
234 "iDisplayLength": 10,
235 "sPaginationType": "full_numbers"
238 $("#add_bibs_to_list").change(function(){
239 var selected = $("#add_bibs_to_list").find("option:selected");
240 if ( selected.attr("class") == "shelf" ){
241 var shelfnumber = selected.attr("value");
242 var bibs = new Array();
243 [% FOREACH message IN job.messages %]
244 [% IF message.code == 'biblio_modified' %]
245 bibs.push("biblionumber="+[% message.biblionumber | html %]);
248 var bibstring = bibs.join("&");
249 window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&'+bibstring, 'popup', 'width=500,height=500,toolbar=false,scrollbars=yes,resizable=yes');
256 [% INCLUDE 'intranet-bottom.inc' %]