View | Details | Raw Unified | Return to bug 23196
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt (-326 / +325 lines)
Lines 8-284 Link Here
8
</head>
8
</head>
9
9
10
<body id="tools_batch_record_modification" class="tools">
10
<body id="tools_batch_record_modification" class="tools">
11
[% INCLUDE 'header.inc' %]
11
    [% INCLUDE 'header.inc' %]
12
[% INCLUDE 'cat-search.inc' %]
12
    [% INCLUDE 'cat-search.inc' %]
13
13
14
<div id="breadcrumbs">
14
    <div id="breadcrumbs">
15
    <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
15
        <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
16
    <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
16
        <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
17
    <a href="/cgi-bin/koha/tools/batch_record_modification.pl">Batch record modification</a>
17
        <a href="/cgi-bin/koha/tools/batch_record_modification.pl">Batch record modification</a>
18
</div>
18
    </div>
19
19
20
<div class="main container-fluid">
20
    <div class="main container-fluid">
21
    <div class="row">
21
        <div class="row">
22
        <div class="col-sm-10 col-sm-push-2">
22
            <div class="col-sm-10 col-sm-push-2">
23
            <main>
23
                <main>
24
24
25
  <h1>Batch record modification</h1>
25
                    <h1>Batch record modification</h1>
26
26
27
    [% IF ( messages ) %]
27
                    [% IF ( messages ) %]
28
        <div class="dialog message">
28
                        <div class="dialog message">
29
29
30
            [% FOREACH message IN messages %]
30
                            [% FOREACH message IN messages %]
31
                [% IF message.type == 'success' %]
31
                                [% IF message.type == 'success' %]
32
                    <div><i class="fa fa-check success"></i>
32
                                    <div><i class="fa fa-check success"></i>
33
                [% ELSIF message.type == 'warning' %]
33
                                [% ELSIF message.type == 'warning' %]
34
                    <div><i class="fa fa-warning warn"></i>
34
                                    <div><i class="fa fa-warning warn"></i>
35
                [% ELSIF message.type == 'error' %]
35
                                [% ELSIF message.type == 'error' %]
36
                    <div><i class="fa fa-exclamation error"></i>
36
                                    <div><i class="fa fa-exclamation error"></i>
37
                [% END %]
37
                                [% END %]
38
                [% IF message.code == 'no_action_defined_for_the_template' %]
38
                                [% IF message.code == 'no_action_defined_for_the_template' %]
39
                    The selected template (id=[% message.mmtid | html %]) does not exist or no action is defined.
39
                                    The selected template (id=[% message.mmtid | html %]) does not exist or no action is defined.
40
                [% ELSIF message.code == 'biblio_not_exists' %]
40
                                [% ELSIF message.code == 'biblio_not_exists' %]
41
                    Bibliographic record [% message.biblionumber | html %] does not exist in the database.
41
                                    Bibliographic record [% message.biblionumber | html %] does not exist in the database.
42
                [% ELSIF message.code == 'authority_not_exists' %]
42
                                [% ELSIF message.code == 'authority_not_exists' %]
43
                    Authority record [% message.authid | html %] does not exist in the database.
43
                                    Authority record [% message.authid | html %] does not exist in the database.
44
                [% ELSIF message.code == 'biblio_not_modified' %]
44
                                [% ELSIF message.code == 'biblio_not_modified' %]
45
                    Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% message.biblionumber | uri %]">[% message.biblionumber | html %]</a> has not been modified. An error occurred on modifying it.
45
                                    Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% message.biblionumber | uri %]">[% message.biblionumber | html %]</a> has not been modified. An error occurred on modifying it.
46
                [% ELSIF message.code == 'authority_not_modified' %]
46
                                [% ELSIF message.code == 'authority_not_modified' %]
47
                    Authority record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% message.authid | uri %]">[% message.authid | html %]</a> has not been modified. An error occurred on modifying it.
47
                                    Authority record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% message.authid | uri %]">[% message.authid | html %]</a> has not been modified. An error occurred on modifying it.
48
                [% ELSIF message.code == 'biblio_modified' %]
48
                                [% ELSIF message.code == 'biblio_modified' %]
49
                    Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% message.biblionumber | uri %]">[% message.biblionumber | html %]</a> has successfully been modified.
49
                                    Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% message.biblionumber | uri %]">[% message.biblionumber | html %]</a> has successfully been modified.
50
                [% ELSIF message.code == 'authority_modified' %]
50
                                [% ELSIF message.code == 'authority_modified' %]
51
                    Bibliographic record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% message.authid | uri %]">[% message.authid | html %]</a> has successfully been modified.
51
                                    Bibliographic record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% message.authid | uri %]">[% message.authid | html %]</a> has successfully been modified.
52
                [% END %]
52
                                [% END %]
53
                [% IF message.error %]
53
                                [% IF message.error %]
54
                    (The error was: [% message.error | html %]. See the Koha logfile for more information).
54
                                    (The error was: [% message.error | html %]. See the Koha logfile for more information).
55
                [% END %]
55
                                [% END %]
56
                </div>
56
                                </div>
57
            [% END %]
57
                            [% END %]
58
58
59
        </div>
59
                        </div>
60
    [% END %]
60
                    [% END %]
61
61
62
  [% IF view == 'form' %]
62
                    [% IF view == 'form' %]
63
    <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/batch_record_modification.pl" id="record_ids_selection">
63
                        <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/batch_record_modification.pl" id="record_ids_selection">
64
      <fieldset class="rows">
64
                            <fieldset class="rows">
65
        <legend>Record type</legend>
65
                                <legend>Record type</legend>
66
        <ol>
66
                                <ol>
67
          <li><label for="biblio_type">Biblios: </label><input type="radio" name="recordtype" value="biblio" id="biblio_type" checked="checked" /></li>
67
                                    <li><label for="biblio_type">Biblios: </label><input type="radio" name="recordtype" value="biblio" id="biblio_type" checked="checked" /></li>
68
          <li><label for="authority_type">Authorities: </label><input type="radio" name="recordtype" value="authority" id="authority_type" /></li>
68
                                    <li><label for="authority_type">Authorities: </label><input type="radio" name="recordtype" value="authority" id="authority_type" /></li>
69
        </ol>
69
                                </ol>
70
      </fieldset>
70
                            </fieldset>
71
71
72
      <br><br>
72
                            <br><br>
73
73
74
      <div id="batch_mod_form" class="toptabs">
74
                            <div id="batch_mod_form" class="toptabs">
75
        <ul>
75
                                <ul>
76
          <li><a href="#uploadfile_tab">Upload a file</a></li>
76
                                    <li><a href="#uploadfile_tab">Upload a file</a></li>
77
          [% IF lists.count %]<li id="show_list_option"><a href="#shelves_tab">Select a list of records</a></li>[% END %]
77
                                        [% IF lists.count %]<li id="show_list_option"><a href="#shelves_tab">Select a list of records</a></li>[% END %]
78
          <li><a href="#enterlist_tab">Enter a list of record numbers</a></li>
78
                                    <li><a href="#enterlist_tab">Enter a list of record numbers</a></li>
79
        </ul>
79
                                </ul>
80
80
81
        <div id="uploadfile_tab">
81
                                <div id="uploadfile_tab">
82
          <fieldset class="rows">
82
                                    <fieldset class="rows">
83
            <legend>Use a file</legend>
83
                                        <legend>Use a file</legend>
84
            <ol>
84
                                        <ol>
85
              <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
85
                                            <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
86
            </ol>
86
                                        </ol>
87
          </fieldset>
87
                                    </fieldset>
88
          &nbsp;
88
                                    &nbsp;
89
        </div>
89
                                </div>
90
90
91
        [% IF lists.count %]
91
                                [% IF lists.count %]
92
            <div id="shelves_tab">
92
                                    <div id="shelves_tab">
93
              <fieldset class="rows">
93
                                        <fieldset class="rows">
94
                <legend>Or select a list of records</legend>
94
                                            <legend>Or select a list of records</legend>
95
                <ol>
95
                                            <ol>
96
                  <li>
96
                                                <li>
97
                    <label for="shelf_number">Use records from the following list: </label>
97
                                                    <label for="shelf_number">Use records from the following list: </label>
98
                    <select name="shelf_number" id="shelf_number">
98
                                                    <select name="shelf_number" id="shelf_number">
99
                      <option value="">Select a list</option>
99
                                                        <option value="">Select a list</option>
100
                        [% FOREACH list IN lists %]
100
                                                        [% FOREACH list IN lists %]
101
                          <option value="[% list.shelfnumber | html %]">[% list.shelfname | html %]</option>
101
                                                        <option value="[% list.shelfnumber | html %]">[% list.shelfname | html %]</option>
102
                        [% END %]
102
                                                        [% END %]
103
                      </option>
103
                                                        </option>
104
                    </select>
104
                                                    </select>
105
                  </li>
105
                                                </li>
106
                </ol>
106
                                            </ol>
107
              </fieldset>
107
                                        </fieldset>
108
              &nbsp;
108
                                        &nbsp;
109
            </div>
109
                                    </div>
110
        [% END %]
110
                                [% END %]
111
111
112
        <div id="enterlist_tab">
112
                                <div id="enterlist_tab">
113
          <fieldset class="rows">
113
                                    <fieldset class="rows">
114
            <legend>Or enter a list of record numbers</legend>
114
                                        <legend>Or enter a list of record numbers</legend>
115
            <ol>
115
                                        <ol>
116
              <li>
116
                                            <li>
117
                <label for="recordnumber_list">List of biblionumbers or authority ids (one per line): </label>
117
                                                <label for="recordnumber_list">List of biblionumbers or authority ids (one per line): </label>
118
                <textarea rows="10" cols="30" id="recordnumber_list" name="recordnumber_list"></textarea>
118
                                                <textarea rows="10" cols="30" id="recordnumber_list" name="recordnumber_list"></textarea>
119
              </li>
119
                                            </li>
120
            </ol>
120
                                        </ol>
121
          </fieldset>
121
                                    </fieldset>
122
          &nbsp;
122
                                    &nbsp;
123
        </div>
123
                                </div>
124
124
125
      </div>
125
                            </div>
126
126
127
      <fieldset class="rows">
127
                            <fieldset class="rows">
128
        <legend>Use MARC Modification Template:</legend>
128
                                <legend>Use MARC Modification Template:</legend>
129
        <ol>
129
                                <ol>
130
          <li>
130
                                    <li>
131
            <label for="marc_modification_template_id" class="required">Modify record using the following template: </label>
131
                                        <label for="marc_modification_template_id" class="required">Modify record using the following template: </label>
132
            <select name="marc_modification_template_id" id="marc_modification_template_id" required="required">
132
                                        <select name="marc_modification_template_id" id="marc_modification_template_id" required="required">
133
              <option value="">Select a template</option>
133
                                            <option value="">Select a template</option>
134
                [% FOREACH mmt IN MarcModificationTemplatesLoop %]
134
                                            [% FOREACH mmt IN MarcModificationTemplatesLoop %]
135
                  <option value="[% mmt.template_id | html %]">[% mmt.name | html %]</option>
135
                                            <option value="[% mmt.template_id | html %]">[% mmt.name | html %]</option>
136
                [% END %]
136
                                            [% END %]
137
            </select>
137
                                        </select>
138
          </li>
138
                                    </li>
139
        </ol>
139
                                </ol>
140
      </fieldset>
140
                            </fieldset>
141
      <fieldset class="action">
141
                            <fieldset class="action">
142
        <input type="hidden" name="op" value="list" />
142
                                <input type="hidden" name="op" value="list" />
143
        <input type="submit" value="Continue" class="button" />
143
                                <input type="submit" value="Continue" class="button" />
144
        <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a>
144
                                <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a>
145
      </fieldset>
145
                            </fieldset>
146
    </form>
146
                        </form>
147
  [% ELSIF view == 'list' %]
147
                    [% ELSIF view == 'list' %]
148
    [% IF records %]
148
                        [% IF records %]
149
      <form action="/cgi-bin/koha/tools/batch_record_modification.pl" method="post" id="process">
149
                            <form action="/cgi-bin/koha/tools/batch_record_modification.pl" method="post" id="process">
150
        <label for="marc_modification_template_id" class="required">Modify record using the following template: </label>
150
                                <label for="marc_modification_template_id" class="required">Modify record using the following template: </label>
151
        <select name="marc_modification_template_id" id="marc_modification_template_id" required="required">
151
                                <select name="marc_modification_template_id" id="marc_modification_template_id" required="required">
152
          <option value="">Select a template</option>
152
                                    <option value="">Select a template</option>
153
          [% FOREACH mmt IN MarcModificationTemplatesLoop %]
153
                                    [% FOREACH mmt IN MarcModificationTemplatesLoop %]
154
            [% IF mmt.selected %]
154
                                        [% IF mmt.selected %]
155
              <option value="[% mmt.template_id | html %]" selected="selected">[% mmt.name | html %]</option>
155
                                            <option value="[% mmt.template_id | html %]" selected="selected">[% mmt.name | html %]</option>
156
            [% ELSE %]
156
                                        [% ELSE %]
157
              <option value="[% mmt.template_id | html %]">[% mmt.name | html %]</option>
157
                                            <option value="[% mmt.template_id | html %]">[% mmt.name | html %]</option>
158
            [% END %]
158
                                        [% END %]
159
          [% END %]
159
                                    [% END %]
160
        </select>
160
                                </select>
161
        <div id="marcPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
161
                                <div id="marcPreview" class="modal" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
162
            <div class="modal-dialog">
162
                                    <div class="modal-dialog">
163
                <div class="modal-content">
163
                                        <div class="modal-content">
164
                    <div class="modal-header">
164
                                            <div class="modal-header">
165
                        <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
165
                                                <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
166
                        <h3 id="marcPreviewLabel">MARC preview</h3>
166
                                                <h3 id="marcPreviewLabel">MARC preview</h3>
167
                    </div>
167
                                            </div>
168
                    <div class="modal-body">
168
                                            <div class="modal-body">
169
                        <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
169
                                                <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
170
                    </div>
170
                                            </div>
171
                    <div class="modal-footer">
171
                                            <div class="modal-footer">
172
                        <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
172
                                                <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
173
                    </div>
173
                                            </div>
174
                </div>
174
                                        </div>
175
            </div>
175
                                    </div>
176
        </div>
176
                                </div>
177
        [% IF recordtype == 'biblio' %]
177
                                [% IF recordtype == 'biblio' %]
178
          <div id="toolbar">
178
                                    <div id="toolbar">
179
            <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
179
                                        <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
180
            | <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a>
180
                                        | <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a>
181
          </div>
181
                                    </div>
182
          <table id="biblios" class="records">
182
                                    <table id="biblios" class="records">
183
            <thead>
183
                                        <thead>
184
              <tr>
184
                                            <tr>
185
                <th>&nbsp;</th>
185
                                                <th>&nbsp;</th>
186
                <th>Biblionumber</th>
186
                                                <th>Biblionumber</th>
187
                <th>Title</th>
187
                                                <th>Title</th>
188
                <th>&nbsp;</th>
188
                                                <th>&nbsp;</th>
189
              </tr>
189
                                            </tr>
190
            </thead>
190
                                        </thead>
191
            <tbody>
191
                                        <tbody>
192
              [% FOR biblio IN records %]
192
                                            [% FOR biblio IN records %]
193
                <tr>
193
                                                <tr>
194
                  <td><input type="checkbox" name="record_id" value="[% biblio.biblionumber | html %]" /></td>
194
                                                    <td><input type="checkbox" name="record_id" value="[% biblio.biblionumber | html %]" /></td>
195
                  <td>[% biblio.biblionumber | html %]</td>
195
                                                    <td>[% biblio.biblionumber | html %]</td>
196
                  <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.title | html %]</a></td>
196
                                                    <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.title | html %]</a></td>
197
                  <td class="actions">
197
                                                    <td class="actions">
198
                    <a href="/cgi-bin/koha/svc/records/preview?record_type=biblio&record_id=[% biblio.biblionumber | uri %]&mmtid=[% mmtid | uri %]" class="previewMARC btn btn-default btn-xs" data-record_type="biblio" data-record_id="[% biblio.biblionumber | html %]" data-mmtid="[% mmtid | html %]" title="Preview MARC"><i class="fa fa-eye"></i> Show MARC</a>
198
                                                        <a href="/cgi-bin/koha/svc/records/preview?record_type=biblio&record_id=[% biblio.biblionumber | uri %]&mmtid=[% mmtid | uri %]" class="previewMARC btn btn-default btn-xs" data-record_type="biblio" data-record_id="[% biblio.biblionumber | html %]" data-mmtid="[% mmtid | html %]" title="Preview MARC"><i class="fa fa-eye"></i> Show MARC</a>
199
                  </td>
199
                                                    </td>
200
                </tr>
200
                                                </tr>
201
              [% END %]
201
                                            [% END %]
202
            </tbody>
202
                                        </tbody>
203
          </table>
203
                                    </table>
204
          <div class="note"><i class="fa fa-exclamation"></i> Reminder: this action will modify all selected biblios!</div>
204
                                    <div class="note"><i class="fa fa-exclamation"></i> Reminder: this action will modify all selected biblios!</div>
205
        [% ELSE %]
205
                                [% ELSE %]
206
          <div id="toolbar">
206
                                    <div id="toolbar">
207
            <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
207
                                        <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
208
            | <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a>
208
                                        | <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a>
209
          </div>
209
                                    </div>
210
          <table id="authorities" class="records">
210
                                    <table id="authorities" class="records">
211
            <thead>
211
                                        <thead>
212
              <tr>
212
                                            <tr>
213
                <th></th>
213
                                                <th></th>
214
                <th>Authid</th>
214
                                                <th>Authid</th>
215
                <th>Summary</th>
215
                                                <th>Summary</th>
216
                <th>&nbsp;</th>
216
                                                <th>&nbsp;</th>
217
              </tr>
217
                                            </tr>
218
            </thead>
218
                                        </thead>
219
            <tbody>
219
                                        <tbody>
220
              [% FOR authority IN records %]
220
                                            [% FOR authority IN records %]
221
                <tr>
221
                                                <tr>
222
                  <td><input type="checkbox" name="record_id" value="[% authority.authid | html %]" data-usage="[% authority.count_usage | html %]" /></td>
222
                                                    <td><input type="checkbox" name="record_id" value="[% authority.authid | html %]" data-usage="[% authority.count_usage | html %]" /></td>
223
                  <td><a href="/cgi-bin/koha/authorities/detail.pl?authid=[% authority.authid | uri %]">[% authority.authid | html %]</a></td>
223
                                                    <td><a href="/cgi-bin/koha/authorities/detail.pl?authid=[% authority.authid | uri %]">[% authority.authid | html %]</a></td>
224
                  <td>[% PROCESS authresult summary=authority.summary %]</td>
224
                                                    <td>[% PROCESS authresult summary=authority.summary %]</td>
225
                  <td class="actions"><a href="/cgi-bin/koha/svc/records/preview?record_type=authority&record_id=[% authority.authid | uri %]&mmtid=[% mmtid | uri %]" data-record_type="authority" data-record_id="[% authority.authid | html %]" data-mmtid="[% mmtid | html %]" class="previewMARC btn btn-default btn-xs"><i class='fa fa-eye'></i> Show MARC</a>
225
                                                    <td class="actions"><a href="/cgi-bin/koha/svc/records/preview?record_type=authority&record_id=[% authority.authid | uri %]&mmtid=[% mmtid | uri %]" data-record_type="authority" data-record_id="[% authority.authid | html %]" data-mmtid="[% mmtid | html %]" class="previewMARC btn btn-default btn-xs"><i class='fa fa-eye'></i> Show MARC</a>
226
                </tr>
226
                                                </tr>
227
              [% END %]
227
                                            [% END %]
228
            </tbody>
228
                                        </tbody>
229
          </table>
229
                                    </table>
230
          <div class="note"><i class="fa fa-exclamation"></i> Reminder: this action will modify all selected authorities!</div>
230
                                    <div class="note"><i class="fa fa-exclamation"></i> Reminder: this action will modify all selected authorities!</div>
231
        [% END %]
231
                                [% END %]
232
        <fieldset class="action">
232
                                <fieldset class="action">
233
          <input type="hidden" name="op" value="modify" />
233
                                    <input type="hidden" name="op" value="modify" />
234
          <input type="hidden" name="recordtype" value="[% recordtype | html %]" />
234
                                    <input type="hidden" name="recordtype" value="[% recordtype | html %]" />
235
          <input type="button" id="mainformsubmit" value="Modify selected records" class="button" />
235
                                    <input type="button" id="mainformsubmit" value="Modify selected records" class="button" />
236
          <input type="hidden" name="runinbackground" id="runinbackground" value="" />
236
                                    <input type="hidden" name="runinbackground" id="runinbackground" value="" />
237
          <input type="hidden" name="completedJobID" id="completedJobID" value="" />
237
                                    <input type="hidden" name="completedJobID" id="completedJobID" value="" />
238
          <a class="cancel" href="/cgi-bin/koha/tools/batch_record_modification.pl">Cancel</a>
238
                                    <a class="cancel" href="/cgi-bin/koha/tools/batch_record_modification.pl">Cancel</a>
239
        </fieldset>
239
                                </fieldset>
240
        <div id="jobpanel">
240
                                <div id="jobpanel">
241
          <div id="jobstatus" class="progress_panel">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
241
                                    <div id="jobstatus" class="progress_panel">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
242
          <div id="jobfailed"></div>
242
                                    <div id="jobfailed"></div>
243
        </div>
243
                                </div>
244
      </form>
244
                            </form>
245
    [% ELSE %]
245
                        [% ELSE %]
246
        <div class="dialog message">
246
                            <div class="dialog message">
247
            No records were modified. <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
247
                                No records were modified. <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
248
        </div>
248
                            </div>
249
    [% END %]
249
                        [% END %]
250
  [% ELSIF view == 'report' %]
250
                    [% ELSIF view == 'report' %]
251
    [% IF report.total_records == report.total_success %]
251
                        [% IF report.total_records == report.total_success %]
252
        <div class="dialog message">
252
                            <div class="dialog message">
253
            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>
253
                                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>
254
        </div>
254
                            </div>
255
    [% ELSE %]
255
                        [% ELSE %]
256
        <div class="dialog message">
256
                            <div class="dialog message">
257
            [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred. <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
257
                                [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred. <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
258
        </div>
258
                            </div>
259
    [% END %]
259
                        [% END %]
260
  [% ELSIF view == 'errors' %]
260
                    [% ELSIF view == 'errors' %]
261
    [% FOR error IN errors %]
261
                        [% FOR error IN errors %]
262
      [% IF error == 'no_template_defined' %]
262
                            [% IF error == 'no_template_defined' %]
263
        <div class="dialog alert">
263
                                <div class="dialog alert">
264
            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.
264
                                    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.
265
        </div>
265
                                </div>
266
      [% END %]
266
                            [% END %]
267
    [% END %]
267
                        [% END %]
268
  [% ELSE %]
268
                    [% ELSE %]
269
        <div class="dialog alert">
269
                        <div class="dialog alert">
270
            No action defined for the template.
270
                            No action defined for the template.
271
        </div>
271
                        </div>
272
  [% END %]
272
                    [% END %]
273
            </main>
273
                </main>
274
        </div> <!-- /.col-sm-10.col-sm-push-2 -->
274
            </div> <!-- /.col-sm-10.col-sm-push-2 -->
275
275
276
        <div class="col-sm-2 col-sm-pull-10">
276
            <div class="col-sm-2 col-sm-pull-10">
277
            <aside>
277
                <aside>
278
                [% INCLUDE 'tools-menu.inc' %]
278
                    [% INCLUDE 'tools-menu.inc' %]
279
            </aside>
279
                </aside>
280
        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
280
            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
281
     </div> <!-- /.row -->
281
        </div> <!-- /.row -->
282
282
283
[% MACRO jsinclude BLOCK %]
283
[% MACRO jsinclude BLOCK %]
284
    [% Asset.js("js/tools-menu.js") | $raw %]
284
    [% Asset.js("js/tools-menu.js") | $raw %]
Lines 288-377 Link Here
288
    <script>
288
    <script>
289
        $(document).ready(function() {
289
        $(document).ready(function() {
290
290
291
          $("#batch_mod_form").tabs();
291
            $("#batch_mod_form").tabs();
292
292
293
          $("input[type='radio']").click(function(){
293
            $("input[type='radio']").click(function() {
294
            if ($(this).attr('id') == 'authority_type') {
294
                if ($(this).attr('id') == 'authority_type') {
295
              $("#show_list_option").hide();
295
                    $("#show_list_option").hide();
296
            } else if ($(this).attr('id') == 'biblio_type') {
296
                } else if ($(this).attr('id') == 'biblio_type') {
297
              $("#show_list_option").show();
297
                    $("#show_list_option").show();
298
            }
298
                }
299
          });
299
            });
300
          $("#selectall").click(function(e){
300
            $("#selectall").click(function(e) {
301
            e.preventDefault();
301
                e.preventDefault();
302
            $(".records").checkCheckboxes();
302
                $(".records").checkCheckboxes();
303
          });
303
            });
304
          $("#clearall").click(function(e){
304
            $("#clearall").click(function(e) {
305
            e.preventDefault();
305
                e.preventDefault();
306
            $(".records").unCheckCheckboxes();
306
                $(".records").unCheckCheckboxes();
307
          });
307
            });
308
          $("#selectall").click();
308
            $("#selectall").click();
309
309
310
          $("table#biblios").dataTable($.extend(true, {}, dataTablesDefaults, {
310
            $("table#biblios").dataTable($.extend(true, {}, dataTablesDefaults, {
311
            "aoColumnDefs": [
311
                "aoColumnDefs": [
312
              { "aTargets": [ 0, 3 ], "bSortable": false, "bSearchable": false },
312
                    { "aTargets": [0, 3], "bSortable": false, "bSearchable": false },
313
              { "aTargets": [ 1 ], "sType": "num-html" }
313
                    { "aTargets": [1], "sType": "num-html" }
314
            ],
314
                ],
315
            "sDom": 't',
315
                "sDom": 't',
316
            "aaSorting": [],
316
                "aaSorting": [],
317
            "bPaginate": false
317
                "bPaginate": false
318
          }));
318
            }));
319
319
320
          $("table#authorities").dataTable($.extend(true, {}, dataTablesDefaults, {
320
            $("table#authorities").dataTable($.extend(true, {}, dataTablesDefaults, {
321
            "aoColumnDefs": [
321
                "aoColumnDefs": [
322
              { "aTargets": [ 0, 3 ], "bSortable": false, "bSearchable": false },
322
                    { "aTargets": [0, 3], "bSortable": false, "bSearchable": false },
323
              { "aTargets": [ 1 ], "sType": "num-html" }
323
                    { "aTargets": [1], "sType": "num-html" }
324
            ],
324
                ],
325
            "sDom": 't',
325
                "sDom": 't',
326
            "aaSorting": [],
326
                "aaSorting": [],
327
            "bPaginate": false
327
                "bPaginate": false
328
          }));
328
            }));
329
329
330
          $("#mainformsubmit").click(function(){
330
            $("#mainformsubmit").click(function() {
331
            if ($("input[type=checkbox][name='record_id']:checked").length == 0 ) {
331
                if ($("input[type=checkbox][name='record_id']:checked").length == 0) {
332
              alert(_("Please select at least one record to process"));
332
                    alert(_("Please select at least one record to process"));
333
              return false;
333
                    return false;
334
            }
334
                }
335
            if ( $("#marc_modification_template_id").val() <= 0 ) {
335
                if ($("#marc_modification_template_id").val() <= 0) {
336
              alert(_("Please select a modification template."));
336
                    alert(_("Please select a modification template."));
337
              return false;
337
                    return false;
338
            }
338
                }
339
            return submitBackgroundJob(document.getElementById("process"));
339
                return submitBackgroundJob(document.getElementById("process"));
340
          });
340
            });
341
341
342
          $("#record_ids_selection").on("submit", function(e){
342
            $("#record_ids_selection").on("submit", function(e) {
343
            var tab = $(this).find('.ui-tabs-active:first a').attr('href');
343
                var tab = $(this).find('.ui-tabs-active:first a').attr('href');
344
            if ( tab == '#uploadfile_tab' ) {
344
                if (tab == '#uploadfile_tab') {
345
                $("#shelf_number").empty('');
345
                    $("#shelf_number").empty('');
346
                $("#recordnumber_list").val('');
346
                    $("#recordnumber_list").val('');
347
            } else if ( tab == '#shelves_tab' ) {
347
                } else if (tab == '#shelves_tab') {
348
                $("#uploadfile").val('')
348
                    $("#uploadfile").val('')
349
                $("#recordnumber_list").val('');
349
                    $("#recordnumber_list").val('');
350
            } else { // enterlist
350
                } else { // enterlist
351
                $("#uploadfile").val('')
351
                    $("#uploadfile").val('')
352
                $("#shelf_number").empty('');
352
                    $("#shelf_number").empty('');
353
            }
353
                }
354
          });
354
            });
355
355
356
          $("#marc_modification_template_id").change(function(){
356
            $("#marc_modification_template_id").change(function() {
357
            var url = "/cgi-bin/koha/svc/records/preview?"
357
                var url = "/cgi-bin/koha/svc/records/preview?"
358
            var mmtid = $(this).val();
358
                var mmtid = $(this).val();
359
            $("a.previewMARC").each(function(){
359
                $("a.previewMARC").each(function() {
360
              $(this).attr("href", url + "record_type=" + $(this).attr("data-record_type") + "&record_id=" + $(this).attr("data-record_id") + "&mmtid=" + mmtid);
360
                    $(this).attr("href", url + "record_type=" + $(this).attr("data-record_type") + "&record_id=" + $(this).attr("data-record_id") + "&mmtid=" + mmtid);
361
                });
361
            });
362
            });
362
          });
363
363
364
            $("body").on("click",".previewMARC", function(e){
364
            $("body").on("click", ".previewMARC", function(e) {
365
                e.preventDefault();
365
                e.preventDefault();
366
                var ltitle = $(this).text();
366
                var ltitle = $(this).text();
367
                var page = $(this).attr("href");
367
                var page = $(this).attr("href");
368
                $("#marcPreviewLabel").text(ltitle);
368
                $("#marcPreviewLabel").text(ltitle);
369
                $("#marcPreview .modal-body").load(page + " div");
369
                $("#marcPreview .modal-body").load(page + " div");
370
                $('#marcPreview').modal({show:true});
370
                $('#marcPreview').modal({ show: true });
371
            });
371
            });
372
            $("#marcPreview").on("hidden.bs.modal", function(){
372
            $("#marcPreview").on("hidden.bs.modal", function() {
373
                $("#marcPreviewLabel").html("");
373
                $("#marcPreviewLabel").html("");
374
                $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
374
                $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> " + _("Loading") + "</div>");
375
            });
375
            });
376
376
377
        });
377
        });
378
- 

Return to bug 23196