1 [% PROCESS 'authorities-search-results.inc' %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Tools › Batch record modification</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% INCLUDE 'greybox.inc' %]
6 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
7 [% INCLUDE 'datatables.inc' %]
8 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
9 <script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
10 <script type="text/javascript">
12 $(document).ready(function() {
13 $("#selectall").click(function(e){
15 $(".records").checkCheckboxes();
17 $("#clearall").click(function(e){
19 $(".records").unCheckCheckboxes();
21 $("#selectall").click();
23 $("table#biblios").dataTable($.extend(true, {}, dataTablesDefaults, {
25 { "aTargets": [ 0, 3 ], "bSortable": false, "bSearchable": false },
26 { "aTargets": [ 1 ], "sType": "num-html" }
33 $("table#authorities").dataTable($.extend(true, {}, dataTablesDefaults, {
35 { "aTargets": [ 0, 3 ], "bSortable": false, "bSearchable": false },
36 { "aTargets": [ 1 ], "sType": "num-html" }
43 $("#mainformsubmit").click(function(){
44 if ($("input[type=checkbox][name='record_id']:checked").length == 0 ) {
45 alert(_("Please select at least one record to process"));
48 if ( $("#marc_modification_template_id").val() <= 0 ) {
49 alert(_("Please select a modification template."));
52 return submitBackgroundJob(document.getElementById("process"));
55 $("#marc_modification_template_id").change(function(){
56 var url = "/cgi-bin/koha/svc/records/preview?"
57 var mmtid = $(this).val();
58 $("a.preview").each(function(){
59 $(this).attr("href", url + "record_type=" + $(this).attr("data-record_type") + "&record_id=" + $(this).attr("data-record_id") + "&mmtid=" + mmtid);
63 $("a.preview").click(function(){
64 // Equivalent to rel="gb_page_center[600,500]"
65 return GB_showCenter(_("Preview MARC"), this.href , 600, 500);
72 <body id="tools_batch_record_modification" class="tools">
73 [% INCLUDE 'header.inc' %]
74 [% INCLUDE 'cat-search.inc' %]
76 <div id="breadcrumbs">
77 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
78 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
79 <a href="/cgi-bin/koha/tools/batch_record_modification.pl">Batch record modification</a>
82 <div id="doc3" class="yui-t2">
86 <h1>Batch record modification</h1>
87 [% FOREACH message IN messages %]
88 [% IF message.type == 'success' %]
89 <div class="dialog message">
90 [% ELSIF message.type == 'warning' %]
91 <div class="dialog alert">
92 [% ELSIF message.type == 'error' %]
93 <div class="dialog error" style="margin:auto;">
95 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber %]">[% biblio.title %]</a></td>
96 [% IF message.code == 'no_action_defined_for_the_template' %]
97 The selected template (id=[% message.mmtid%]) does not exist or no action is defined.
98 [% ELSIF message.code == 'biblio_not_exists' %]
99 The biblionumber [% message.biblionumber %] does not exist in the database.
100 [% ELSIF message.code == 'authority_not_exists' %]
101 The authority id [% message.authid %] does not exist in the database.
102 [% ELSIF message.code == 'biblio_not_modified' %]
103 The biblio <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% message.biblionumber %]">[% message.biblionumber %]</a> has not been modified. An error occurred on modifying it.
104 [% ELSIF message.code == 'authority_not_modified' %]
105 The authority <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% message.authid %]">[% message.authid %]</a> has not been modified. An error occurred on modifying it.
106 [% ELSIF message.code == 'biblio_modified' %]
107 The biblio <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% message.biblionumber %]">[% message.biblionumber %]</a> has successfully been modified.
108 [% ELSIF message.code == 'authority_modified' %]
109 The authority <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% message.authid %]">[% message.authid %]</a> has successfully been modified.
111 [% IF message.error %]
112 (The error was: [% message.error%], see the Koha logfile for more information).
116 [% IF view == 'form' %]
117 <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/batch_record_modification.pl">
118 <fieldset class="rows">
119 <legend>Record type</legend>
121 <li><label for="biblio_type">Biblios: </label><input type="radio" name="recordtype" value="biblio" id="biblio_type" checked="checked" /></li>
122 <li><label for="authority_type">Authorities: </label><input type="radio" name="recordtype" value="authority" id="authority_type" /></li>
125 <fieldset class="rows">
126 <legend>Use a file</legend>
128 <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
131 <fieldset class="rows">
132 <legend>Or enter a list of record numbers</legend>
135 <label for="recordnumber_list">Record number list (one per line): </label>
136 <textarea rows="10" cols="30" id="recordnumber_list" name="recordnumber_list"></textarea>
140 <fieldset class="rows">
141 <legend>Use MARC Modification Template:</legend>
144 <label for="marc_modification_template_id" class="required">Modify record using the following template: </label>
145 <select name="marc_modification_template_id" id="marc_modification_template_id" required="required">
146 <option value="">Select a template</option>
147 [% FOREACH mmt IN MarcModificationTemplatesLoop %]
148 <option value="[% mmt.template_id %]">[% mmt.name %]</option>
154 <fieldset class="action">
155 <input type="hidden" name="op" value="list" />
156 <input type="submit" value="Continue" class="button" />
157 <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a>
160 [% ELSIF view == 'list' %]
162 <form action="/cgi-bin/koha/tools/batch_record_modification.pl" method="post" id="process">
163 <label for="marc_modification_template_id" class="required">Modify record using the following template: </label>
164 <select name="marc_modification_template_id" id="marc_modification_template_id" required="required">
165 <option value="">Select a template</option>
166 [% FOREACH mmt IN MarcModificationTemplatesLoop %]
167 [% IF mmt.selected %]
168 <option value="[% mmt.template_id %]" selected="selected">[% mmt.name %]</option>
170 <option value="[% mmt.template_id %]">[% mmt.name %]</option>
174 [% IF recordtype == 'biblio' %]
176 <a id="selectall" href="#">Select all</a>
177 | <a id="clearall" href="#">Clear all</a>
179 <table id="biblios" class="records">
183 <th>Biblionumber</th>
189 [% FOR biblio IN records %]
191 <td><input type="checkbox" name="record_id" value="[% biblio.biblionumber %]" data-items="[% biblio.itemnumbers.size %]" data-issues="[% biblio.issues_count %]" data-reserves="[% biblio.reserves.size %]" /></td>
192 <td>[% biblio.biblionumber %]</td>
193 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber %]">[% biblio.title %]</a></td>
194 <td><a href="/cgi-bin/koha/svc/records/preview?record_type=biblio&record_id=[% biblio.biblionumber %]&mmtid=[% mmtid %]" class="preview" data-record_type="biblio" data-record_id="[% biblio.biblionumber %]" data-mmtid="[% mmtid %]" title="Preview MARC" >Preview MARC</a>
199 <div class="note">Reminder: this action will modify all selected biblios!</div>
202 <a id="selectall" href="#">Select all</a>
203 | <a id="clearall" href="#">Clear all</a>
205 <table id="authorities" class="records">
215 [% FOR authority IN records %]
217 <td><input type="checkbox" name="record_id" value="[% authority.authid %]" data-usage="[% authority.count_usage %]" /></td>
218 <td><a href="/cgi-bin/koha/authorities/detail.pl?authid=[% authority.authid %]">[% authority.authid %]</a></td>
219 <td>[% PROCESS authresult summary=authority.summary %]</td>
220 <td><a href="/cgi-bin/koha/svc/records/preview?record_type=authority&record_id=[% authority.authid %]&mmtid=[% mmtid %]" class="preview" data-record_type="authority" data-record_id="[% authority.authid %]" data-mmtid="[% mmtid %]" title="Preview MARC" rel="gb_page_center[600,500]">Preview MARC</a>
225 <div class="note">Reminder: this action will modify all selected authorities!</div>
227 <fieldset class="action">
228 <input type="hidden" name="op" value="modify" />
229 <input type="hidden" name="recordtype" value="[% recordtype %]" />
230 <input type="button" id="mainformsubmit" value="Modify selected records" class="button" />
231 <input type="hidden" name="runinbackground" id="runinbackground" value="" />
232 <input type="hidden" name="completedJobID" id="completedJobID" value="" />
233 <a class="cancel" href="/cgi-bin/koha/tools/batch_record_modification.pl">Cancel</a>
236 <div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
237 <div id="jobfailed"></div>
241 There is no record ids defined.
243 [% ELSIF view == 'report' %]
244 [% IF report.total_records == report.total_success %]
245 All records have successfully been modified!
247 [% report.total_success %] / [% report.total_records %] records have successfully been modified.
248 Some errors occurred.
250 <p><a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a></p>
251 [% ELSIF view == 'errors' %]
252 [% FOR error IN errors %]
253 [% IF error == 'no_template_defined' %]
254 No MARC modification template is defined. You have <a href="/cgi-bin/koha/tools/marc_modification_templates.pl">to create</a> at least one template for using this tool.
258 No action defined for the template.
263 [% INCLUDE 'tools-menu.inc' %]
266 [% INCLUDE 'intranet-bottom.inc' %]