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 ( $("#marc_modification_template_id").val() > 0 ) {
45 return submitBackgroundJob(document.getElementById("process"));
47 alert(_("Please select a modification template."));
51 $("#marc_modification_template_id").change(function(){
52 var url = "/cgi-bin/koha/svc/records/preview?"
53 var mmtid = $(this).val();
54 $("a.preview").each(function(){
55 $(this).attr("href", url + "record_type=" + $(this).attr("data-record_type") + "&record_id=" + $(this).attr("data-record_id") + "&mmtid=" + mmtid);
59 $("a.preview").click(function(){
60 // Equivalent to rel="gb_page_center[600,500]"
61 return GB_showCenter(_("Preview MARC"), this.href , 600, 500);
68 <body id="tools_batch_record_modification" class="tools">
69 [% INCLUDE 'header.inc' %]
70 [% INCLUDE 'cat-search.inc' %]
72 <div id="breadcrumbs">
73 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
74 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
75 <a href="/cgi-bin/koha/tools/batch_record_modification.pl">Batch record modification</a>
78 <div id="doc3" class="yui-t2">
82 <h1>Batch record modification</h1>
83 [% FOREACH message IN messages %]
84 [% IF message.type == 'success' %]
85 <div class="dialog message">
86 [% ELSIF message.type == 'warning' %]
87 <div class="dialog alert">
88 [% ELSIF message.type == 'error' %]
89 <div class="dialog error" style="margin:auto;">
91 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber %]">[% biblio.title %]</a></td>
92 [% IF message.code == 'no_action_defined_for_the_template' %]
93 The selected template (id=[% message.mmtid%]) does not exist or no action is defined.
94 [% ELSIF message.code == 'biblio_not_exists' %]
95 The biblionumber [% message.biblionumber %] does not exist in the database.
96 [% ELSIF message.code == 'authority_not_exists' %]
97 The authority id [% message.authid %] does not exist in the database.
98 [% ELSIF message.code == 'biblio_not_modified' %]
99 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.
100 [% ELSIF message.code == 'authority_not_modified' %]
101 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.
102 [% ELSIF message.code == 'biblio_modified' %]
103 The biblio <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% message.biblionumber %]">[% message.biblionumber %]</a> has successfully been modified.
104 [% ELSIF message.code == 'authority_modified' %]
105 The authority <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% message.authid %]">[% message.authid %]</a> has successfully been modified.
107 [% IF message.error %]
108 (The error was: [% message.error%], see the Koha logfile for more information).
112 [% IF view == 'form' %]
113 <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/batch_record_modification.pl">
114 <fieldset class="rows">
115 <legend>Record type</legend>
117 <li><label for="biblio_type">Biblios: </label><input type="radio" name="recordtype" value="biblio" id="biblio_type" checked="checked" /></li>
118 <li><label for="authority_type">Authorities: </label><input type="radio" name="recordtype" value="authority" id="authority_type" /></li>
121 <fieldset class="rows">
122 <legend>Use a file</legend>
124 <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
127 <fieldset class="rows">
128 <legend>Or enter a list of record numbers</legend>
131 <label for="recordnumber_list">Record number list (one per line): </label>
132 <textarea rows="10" cols="30" id="recordnumber_list" name="recordnumber_list"></textarea>
136 <fieldset class="rows">
137 <legend>Use MARC Modification Template:</legend>
140 <label for="marc_modification_template_id" class="required">Modify record using the following template: </label>
141 <select name="marc_modification_template_id" id="marc_modification_template_id" required="required">
142 <option value="">Select a template</option>
143 [% FOREACH mmt IN MarcModificationTemplatesLoop %]
144 <option value="[% mmt.template_id %]">[% mmt.name %]</option>
150 <fieldset class="action">
151 <input type="hidden" name="op" value="list" />
152 <input type="submit" value="Continue" class="button" />
153 <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a>
156 [% ELSIF view == 'list' %]
158 <form action="/cgi-bin/koha/tools/batch_record_modification.pl" method="post" id="process">
159 <label for="marc_modification_template_id" class="required">Modify record using the following template: </label>
160 <select name="marc_modification_template_id" id="marc_modification_template_id" required="required">
161 <option value="">Select a template</option>
162 [% FOREACH mmt IN MarcModificationTemplatesLoop %]
163 [% IF mmt.selected %]
164 <option value="[% mmt.template_id %]" selected="selected">[% mmt.name %]</option>
166 <option value="[% mmt.template_id %]">[% mmt.name %]</option>
170 [% IF recordtype == 'biblio' %]
172 <a id="selectall" href="#">Select all</a>
173 | <a id="clearall" href="#">Clear all</a>
175 <table id="biblios" class="records">
179 <th>Biblionumber</th>
185 [% FOR biblio IN records %]
187 <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>
188 <td>[% biblio.biblionumber %]</td>
189 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber %]">[% biblio.title %]</a></td>
190 <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>
195 <div class="note">Reminder: this action will modify all selected biblios!</div>
198 <a id="selectall" href="#">Select all</a>
199 | <a id="clearall" href="#">Clear all</a>
201 <table id="authorities" class="records">
211 [% FOR authority IN records %]
213 <td><input type="checkbox" name="record_id" value="[% authority.authid %]" data-usage="[% authority.count_usage %]" /></td>
214 <td><a href="/cgi-bin/koha/authorities/detail.pl?authid=[% authority.authid %]">[% authority.authid %]</a></td>
215 <td>[% PROCESS authresult summary=authority.summary %]</td>
216 <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>
221 <div class="note">Reminder: this action will modify all selected authorities!</div>
223 <fieldset class="action">
224 <input type="hidden" name="op" value="modify" />
225 <input type="hidden" name="recordtype" value="[% recordtype %]" />
226 <input type="button" id="mainformsubmit" value="Modify selected records" class="button" />
227 <input type="hidden" name="runinbackground" id="runinbackground" value="" />
228 <input type="hidden" name="completedJobID" id="completedJobID" value="" />
229 <a class="cancel" href="/cgi-bin/koha/tools/batch_record_modification.pl">Cancel</a>
232 <div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
233 <div id="jobfailed"></div>
237 There is no record ids defined.
239 [% ELSIF view == 'report' %]
240 [% IF report.total_records == report.total_success %]
241 All records have successfully been modified!
243 [% report.total_success %] / [% report.total_records %] records have successfully been modified.
244 Some errors occurred.
246 <p><a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a></p>
247 [% ELSIF view == 'errors' %]
248 [% FOR error IN errors %]
249 [% IF error == 'no_template_defined' %]
250 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.
254 No action defined for the template.
259 [% INCLUDE 'tools-menu.inc' %]
262 [% INCLUDE 'intranet-bottom.inc' %]