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_view_job' %]
27 <div><i class="fa fa-exclamation error"></i>Insufficient permission to see this job.</div>
35 <h1>Detail of job #[% job.id | html %]</h1>
37 <fieldset class="rows">
39 <li><span class="label">Job ID: </span>[% job.id | html %]</li>
40 <li><label for="job_status">Status: </label>[% job.status | html %]</li>
41 <li><label for="job_progress">Progress: </label>[% job.progress || 0 | html %] / [% job.size | html %]</li>
42 <li><label for="job_type">Type: </label>[% job.type | html %]</li>
43 <li><label for="job_enqueued_on">Enqueued on: </label>[% job.enqueued_on | html %]</li>
44 <li><label for="job_started_on">Started on: </label>[% job.started_on | html %]</li>
45 <li><label for="job_ended_on">Ended on: </label>[% job.ended_on | html %]</li>
46 <li><label for="job_data">Report: </label>
48 [% CASE 'batch_biblio_record_modification' %]
49 [% SET report = job.report %]
51 [% IF report.total_records == report.total_success %]
52 <div class="dialog message">
53 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 Add modified records to the following list:
57 <select name="add_bibs_to_list" id="add_bibs_to_list">
58 <option value="">Select a list</option>
59 [% FOREACH list IN lists %]
60 <option class="shelf" value="[% list.shelfnumber | html %]">[% list.shelfname | html %]</option>
66 <div class="dialog message">
67 [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred.
68 [% IF job.status == 'cancelled' %]The job has been cancelled before it finished.[% END %]
69 <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
73 [% CASE 'batch_authority_record_modification' %]
74 [% SET report = job.report %]
76 [% IF report.total_records == report.total_success %]
77 <div class="dialog message">
78 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 class="dialog message">
82 [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred.
83 [% IF job.status == 'cancelled' %]The job has been cancelled before it finished.[% END %]
84 <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
88 [% CASE %]Job type "[% job.type | html %]" not handled in the template
91 <li><label for="job_data">Detailed messages: </label>
93 [% CASE 'batch_biblio_record_modification' %]
94 [% FOR m IN job.messages %]
95 <div class="dialog message">
96 [% IF m.type == 'success' %]
97 <i class="fa fa-check success"></i>
98 [% ELSIF m.type == 'warning' %]
99 <i class="fa fa-warning warn"></i>
100 [% ELSIF m.type == 'error' %]
101 <i class="fa fa-exclamation error"></i>
104 [% CASE 'biblio_not_modified' %]
105 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 %].
106 [% CASE 'biblio_modified' %]
107 Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has successfully been modified.
111 [% CASE 'batch_authority_record_modification' %]
112 [% FOR m IN job.messages %]
113 <div class="dialog message">
114 [% IF m.type == 'success' %]
115 <i class="fa fa-check success"></i>
116 [% ELSIF m.type == 'warning' %]
117 <i class="fa fa-warning warn"></i>
118 [% ELSIF m.type == 'error' %]
119 <i class="fa fa-exclamation error"></i>
122 [% CASE 'authority_not_modified' %]
123 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 %].
124 [% CASE 'authority_modified' %]
125 Authority record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% m.authid | uri %]">[% m.authid | html %]</a> has successfully been modified.
129 [% CASE %]Job type "[% job.type | html %]" not handled in the template
135 [% IF CAN_user_parameters_manage_background_jobs %]
136 <a href="/cgi-bin/koha/admin/background_jobs.pl">Return to the job list</a>
140 [% IF op == 'list' %]
142 <h2>Background jobs</h2>
145 <table id="table_background_jobs">
155 <th class="noExport">Actions</th>
159 [% FOREACH job IN jobs %]
161 <td>[% job.id | html %]</td>
162 <td>[% job.status | html %]</td>
163 <td>[% job.progress || 0 | html %] / [% job.size | html %]</td>
165 [% SWITCH job.type %]
166 [% CASE 'batch_biblio_record_modification' %]Batch bibliographic record modification
167 [% CASE 'batch_authority_record_modification' %]Batch authority record modification
168 [% CASE %][% job.type | html %]
171 <td>[% job.enqueued_on | html %]</td>
172 <td>[% job.started_on| html %]</td>
173 <td>[% job.ended_on| html %]</td>
175 <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>
176 [% IF job.status == 'new' || job.status == 'started' %]
177 <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>
185 <div class="dialog message">
186 There are no background jobs yet.
192 </div> <!-- /.col-sm-10.col-sm-push-2 -->
194 <div class="col-sm-2 col-sm-pull-10">
196 [% INCLUDE 'admin-menu.inc' %]
198 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
199 </div> <!-- /.row -->
201 [% MACRO jsinclude BLOCK %]
202 [% Asset.js("js/admin-menu.js") | $raw %]
203 [% INCLUDE 'datatables.inc' %]
205 $(document).ready(function() {
206 $("#table_background_jobs").dataTable($.extend(true, {}, dataTablesDefaults, {
208 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
210 "aaSorting": [[ 0, "desc" ]],
211 "iDisplayLength": 10,
212 "sPaginationType": "full_numbers"
215 $("#add_bibs_to_list").change(function(){
216 var selected = $("#add_bibs_to_list").find("option:selected");
217 if ( selected.attr("class") == "shelf" ){
218 var shelfnumber = selected.attr("value");
219 var bibs = new Array();
220 [% FOREACH message IN job.messages %]
221 [% IF message.code == 'biblio_modified' %]
222 bibs.push("biblionumber="+[% message.biblionumber | html %]);
225 var bibstring = bibs.join("&");
226 window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&'+bibstring, 'popup', 'width=500,height=500,toolbar=false,scrollbars=yes,resizable=yes');
233 [% INCLUDE 'intranet-bottom.inc' %]