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 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
15 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
18 [% IF CAN_user_parameters_manage_background_jobs %]
20 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
23 <a href="#" aria-current="page">Background jobs</a>
27 <a href="#" aria-current="page">Administration</a>
33 <div class="main container-fluid">
35 <div class="col-sm-10 col-sm-push-2">
38 [% FOR m IN messages %]
39 <div class="dialog message">
41 [% CASE 'cannot_view_job' %]
42 <div><i class="fa fa-exclamation error"></i>Insufficient permission to see this job.</div>
50 <h1>Detail of job #[% job.id | html %]</h1>
52 <fieldset class="rows">
54 <li><span class="label">Job ID: </span>[% job.id | html %]</li>
55 <li><label for="job_status">Status: </label>[% job.status | html %]</li>
56 <li><label for="job_progress">Progress: </label>[% job.progress || 0 | html %] / [% job.size | html %]</li>
57 <li><label for="job_type">Type: </label>[% job.type | html %]</li>
58 <li><label for="job_enqueued_on">Enqueued on: </label>[% job.enqueued_on | html %]</li>
59 <li><label for="job_started_on">Started on: </label>[% job.started_on | html %]</li>
60 <li><label for="job_ended_on">Ended on: </label>[% job.ended_on | html %]</li>
61 <li><label for="job_data">Report: </label>
63 [% CASE 'batch_biblio_record_modification' %]
64 [% SET report = job.report %]
66 [% IF report.total_records == report.total_success %]
67 <div class="dialog message">
68 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>
71 Add modified records to the following list:
72 <select name="add_bibs_to_list" id="add_bibs_to_list">
73 <option value="">Select a list</option>
74 [% FOREACH list IN lists %]
75 <option class="shelf" value="[% list.shelfnumber | html %]">[% list.shelfname | html %]</option>
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 'batch_authority_record_modification' %]
89 [% SET report = job.report %]
91 [% IF report.total_records == report.total_success %]
92 <div class="dialog message">
93 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>
96 <div class="dialog message">
97 [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred.
98 [% IF job.status == 'cancelled' %]The job has been cancelled before it finished.[% END %]
99 <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
103 [% CASE %]Job type "[% job.type | html %]" not handled in the template
106 <li><label for="job_data">Detailed messages: </label>
107 [% SWITCH job.type %]
108 [% CASE 'batch_biblio_record_modification' %]
109 [% FOR m IN job.messages %]
110 <div class="dialog message">
111 [% IF m.type == 'success' %]
112 <i class="fa fa-check success"></i>
113 [% ELSIF m.type == 'warning' %]
114 <i class="fa fa-warning warn"></i>
115 [% ELSIF m.type == 'error' %]
116 <i class="fa fa-exclamation error"></i>
119 [% CASE 'biblio_not_modified' %]
120 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 %].
121 [% CASE 'biblio_modified' %]
122 Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has successfully been modified.
126 [% CASE 'batch_authority_record_modification' %]
127 [% FOR m IN job.messages %]
128 <div class="dialog message">
129 [% IF m.type == 'success' %]
130 <i class="fa fa-check success"></i>
131 [% ELSIF m.type == 'warning' %]
132 <i class="fa fa-warning warn"></i>
133 [% ELSIF m.type == 'error' %]
134 <i class="fa fa-exclamation error"></i>
137 [% CASE 'authority_not_modified' %]
138 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 %].
139 [% CASE 'authority_modified' %]
140 Authority record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% m.authid | uri %]">[% m.authid | html %]</a> has successfully been modified.
144 [% CASE %]Job type "[% job.type | html %]" not handled in the template
150 [% IF CAN_user_parameters_manage_background_jobs %]
151 <a href="/cgi-bin/koha/admin/background_jobs.pl">Return to the job list</a>
155 [% IF op == 'list' %]
157 <h2>Background jobs</h2>
160 <table id="table_background_jobs">
170 <th class="noExport">Actions</th>
174 [% FOREACH job IN jobs %]
176 <td>[% job.id | html %]</td>
177 <td>[% job.status | html %]</td>
178 <td>[% job.progress || 0 | html %] / [% job.size | html %]</td>
180 [% SWITCH job.type %]
181 [% CASE 'batch_biblio_record_modification' %]Batch bibliographic record modification
182 [% CASE 'batch_authority_record_modification' %]Batch authority record modification
183 [% CASE %][% job.type | html %]
186 <td>[% job.enqueued_on | html %]</td>
187 <td>[% job.started_on| html %]</td>
188 <td>[% job.ended_on| html %]</td>
190 <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>
191 [% IF job.status == 'new' || job.status == 'started' %]
192 <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>
200 <div class="dialog message">
201 There are no background jobs yet.
207 </div> <!-- /.col-sm-10.col-sm-push-2 -->
209 <div class="col-sm-2 col-sm-pull-10">
211 [% INCLUDE 'admin-menu.inc' %]
213 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
214 </div> <!-- /.row -->
216 [% MACRO jsinclude BLOCK %]
217 [% Asset.js("js/admin-menu.js") | $raw %]
218 [% INCLUDE 'datatables.inc' %]
220 $(document).ready(function() {
221 $("#table_background_jobs").dataTable($.extend(true, {}, dataTablesDefaults, {
223 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
225 "aaSorting": [[ 0, "desc" ]],
226 "iDisplayLength": 10,
227 "sPaginationType": "full_numbers"
230 $("#add_bibs_to_list").change(function(){
231 var selected = $("#add_bibs_to_list").find("option:selected");
232 if ( selected.attr("class") == "shelf" ){
233 var shelfnumber = selected.attr("value");
234 var bibs = new Array();
235 [% FOREACH message IN job.messages %]
236 [% IF message.code == 'biblio_modified' %]
237 bibs.push("biblionumber="+[% message.biblionumber | html %]);
240 var bibstring = bibs.join("&");
241 window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&'+bibstring, 'popup', 'width=500,height=500,toolbar=false,scrollbars=yes,resizable=yes');
248 [% INCLUDE 'intranet-bottom.inc' %]