Bug 12194: fix label for oblique_title
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / batch_record_modification.tt
1 [% PROCESS 'authorities-search-results.inc' %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Tools &rsaquo; 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">
11 //<![CDATA[
12 $(document).ready(function() {
13   $("#selectall").click(function(e){
14     e.preventDefault();
15     $(".records").checkCheckboxes();
16   });
17   $("#clearall").click(function(e){
18     e.preventDefault();
19     $(".records").unCheckCheckboxes();
20   });
21   $("#selectall").click();
22
23   $("table#biblios").dataTable($.extend(true, {}, dataTablesDefaults, {
24     "aoColumnDefs": [
25       { "aTargets": [ 0, 3 ], "bSortable": false, "bSearchable": false },
26       { "aTargets": [ 1 ], "sType": "num-html" }
27     ],
28     "sDom": 't',
29     "aaSorting": [],
30     "bPaginate": false
31   }));
32
33   $("table#authorities").dataTable($.extend(true, {}, dataTablesDefaults, {
34     "aoColumnDefs": [
35       { "aTargets": [ 0, 3 ], "bSortable": false, "bSearchable": false },
36       { "aTargets": [ 1 ], "sType": "num-html" }
37     ],
38     "sDom": 't',
39     "aaSorting": [],
40     "bPaginate": false
41   }));
42
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"));
46       return false;
47     }
48     if ( $("#marc_modification_template_id").val() <= 0 ) {
49       alert(_("Please select a modification template."));
50       return false;
51     }
52     return submitBackgroundJob(document.getElementById("process"));
53   });
54
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);
60     });
61   });
62
63   $("a.preview").click(function(){
64     // Equivalent to rel="gb_page_center[600,500]"
65     return GB_showCenter(_("Preview MARC"), this.href , 600, 500);
66   });
67
68 });
69 //]]>
70 </script>
71 </head>
72 <body id="tools_batch_record_modification" class="tools">
73 [% INCLUDE 'header.inc' %]
74 [% INCLUDE 'cat-search.inc' %]
75
76 <div id="breadcrumbs">
77     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
78     <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
79     <a href="/cgi-bin/koha/tools/batch_record_modification.pl">Batch record modification</a>
80 </div>
81
82 <div id="doc3" class="yui-t2">
83 <div id="bd">
84 <div id="yui-main">
85 <div class="yui-b">
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;">
94     [% END %]
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.
110     [% END %]
111     [% IF message.error %]
112       (The error was: [% message.error%], see the Koha logfile for more information).
113     [% END %]
114     </div>
115   [% END %]
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>
120         <ol>
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>
123         </ol>
124       </fieldset>
125       <fieldset class="rows">
126         <legend>Use a file</legend>
127         <ol>
128           <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
129         </ol>
130       </fieldset>
131       <fieldset class="rows">
132         <legend>Or enter a list of record numbers</legend>
133         <ol>
134           <li>
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>
137           </li>
138         </ol>
139       </fieldset>
140       <fieldset class="rows">
141         <legend>Use MARC Modification Template:</legend>
142         <ol>
143           <li>
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>
149                 [% END %]
150             </select>
151           </li>
152         </ol>
153       </fieldset>
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>
158       </fieldset>
159     </form>
160   [% ELSIF view == 'list' %]
161     [% IF records %]
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>
169             [% ELSE %]
170               <option value="[% mmt.template_id %]">[% mmt.name %]</option>
171             [% END %]
172           [% END %]
173         </select>
174         [% IF recordtype == 'biblio' %]
175           <div id="toolbar">
176             <a id="selectall" href="#">Select all</a>
177             | <a id="clearall" href="#">Clear all</a>
178           </div>
179           <table id="biblios" class="records">
180             <thead>
181               <tr>
182                 <th></th>
183                 <th>Biblionumber</th>
184                 <th>Title</th>
185                 <th>Preview</th>
186               </tr>
187             </thead>
188             <tbody>
189               [% FOR biblio IN records %]
190                 <tr>
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>
195                 </tr>
196               [% END %]
197             </tbody>
198           </table>
199           <div class="note">Reminder: this action will modify all selected biblios!</div>
200         [% ELSE %]
201           <div id="toolbar">
202             <a id="selectall" href="#">Select all</a>
203             | <a id="clearall" href="#">Clear all</a>
204           </div>
205           <table id="authorities" class="records">
206             <thead>
207               <tr>
208                 <th></th>
209                 <th>Authid</th>
210                 <th>Summary</th>
211                 <th>Preview</th>
212               </tr>
213             </thead>
214             <tbody>
215               [% FOR authority IN records %]
216                 <tr>
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>
221                 </tr>
222               [% END %]
223             </tbody>
224           </table>
225           <div class="note">Reminder: this action will modify all selected authorities!</div>
226         [% END %]
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>
234         </fieldset>
235         <div id="jobpanel">
236           <div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
237           <div id="jobfailed"></div>
238         </div>
239       </form>
240     [% ELSE %]
241       There is no record ids defined.
242     [% END %]
243   [% ELSIF view == 'report' %]
244     [% IF report.total_records == report.total_success %]
245       All records have successfully been modified!
246     [% ELSE %]
247       [% report.total_success %] / [% report.total_records %] records have successfully been modified.
248       Some errors occurred.
249     [% END %]
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.
255       [% END %]
256     [% END %]
257   [% ELSE %]
258     No action defined for the template.
259   [% END %]
260 </div>
261 </div>
262 <div class="yui-b">
263   [% INCLUDE 'tools-menu.inc' %]
264 </div>
265 </div>
266 [% INCLUDE 'intranet-bottom.inc' %]