Lines 13-19
Link Here
|
13 |
|
13 |
|
14 |
<script type="text/javascript"> |
14 |
<script type="text/javascript"> |
15 |
//<![CDATA[ |
15 |
//<![CDATA[ |
16 |
|
|
|
17 |
function doSubmit(op, id) { |
16 |
function doSubmit(op, id) { |
18 |
$('<input type="hidden"/>') |
17 |
$('<input type="hidden"/>') |
19 |
.attr('name', 'op') |
18 |
.attr('name', 'op') |
Lines 51-58
function doSubmit(op, id) {
Link Here
|
51 |
} |
50 |
} |
52 |
|
51 |
|
53 |
$(document).ready(function(){ |
52 |
$(document).ready(function(){ |
54 |
$('#btn-help').click(function() { |
53 |
$('#doremove').on("click",function(){ |
55 |
$('#help').toggle(); |
54 |
doSubmit('doremove'); |
|
|
55 |
}); |
56 |
$('#doedit').on("click",function(){ |
57 |
doSubmit('doedit', $("#doedit").attr('value')); |
58 |
}); |
59 |
$('#add').on("click", function(){ |
60 |
doSubmit('add'); |
61 |
return false; |
62 |
}); |
63 |
$('#btn_batchremove').on("click", function(){ |
64 |
doSubmit('remove'); |
56 |
}); |
65 |
}); |
57 |
|
66 |
|
58 |
/* disable some options if subfield is indicator */ |
67 |
/* disable some options if subfield is indicator */ |
Lines 116-123
$(document).ready(function(){
Link Here
|
116 |
{"bSearchable": false, "bSortable": false} |
125 |
{"bSearchable": false, "bSortable": false} |
117 |
], |
126 |
], |
118 |
"sPaginationType": "four_button" |
127 |
"sPaginationType": "four_button" |
119 |
} )); |
128 |
})); |
120 |
|
|
|
121 |
}); |
129 |
}); |
122 |
//]]> |
130 |
//]]> |
123 |
</script> |
131 |
</script> |
Lines 135-326
$(document).ready(function(){
Link Here
|
135 |
<div id="yui-main"> |
143 |
<div id="yui-main"> |
136 |
<div class="yui-b"> |
144 |
<div class="yui-b"> |
137 |
|
145 |
|
138 |
<h1>Manage MARC field permissions <a href="#" id="btn-help"><button type="button" class="btn btn-small"><i class="icon-question-sign"></i></button></a></h1> |
146 |
<h1>Manage MARC field permissions</h1> |
|
|
147 |
|
139 |
[% UNLESS Koha.Preference( 'MARCPermissions' ) %] |
148 |
[% UNLESS Koha.Preference( 'MARCPermissions' ) %] |
140 |
<div class="dialog message"> |
149 |
<div class="dialog message"> |
141 |
The <b>MARCPermissions</b> preference is not set, don't forget to enable it for rules to take effect. |
150 |
The <b>MARCPermissions</b> preference is not set, don't forget to enable it for rules to take effect. |
142 |
</div> |
151 |
</div> |
143 |
[% END %] |
152 |
[% END %] |
144 |
<div id="help" style="display:none;" class="well"> |
|
|
145 |
<h3>Rule evaluation</h3> |
146 |
<p> |
147 |
Rules are evaluated from least specific to most specific. This means that a |
148 |
more specific rule will override a less specific rule. |
149 |
|
150 |
<b>*</b> is less specific than a regular expression. A regular expression is |
151 |
less specific than a normal field name (e.g. <b>245</b>). |
152 |
|
153 |
A <i>Subfield tag</i> is more specific than a <i>Tag</i>. |
154 |
|
155 |
<p> |
156 |
To add a field-specific rule (i.e. not a subfield), leave the <i>Subfield |
157 |
tag</i> field blank. |
158 |
</p> |
159 |
</p> |
160 |
<h4>Defaults</h4> |
161 |
<p> |
162 |
Default action when no rules exist is to replace the old record with the new |
163 |
record. Same as if <b>MARCPermissions</b> is disabled. |
164 |
</p> |
165 |
<p> |
166 |
Default action when no matching rule is found is to leave a field |
167 |
unchanged (<b>skip</b>). If you wish to changed the default actions for |
168 |
fields and subfields, please add wildcard rules. |
169 |
</p> |
170 |
|
171 |
<h4>Wildcards</h4> |
172 |
<p> |
173 |
<b>*</b> can be used as a wildcard for <i>Tag</i>, <i>Subfield tag</i> and |
174 |
<i>Filter</i>. <b>*</b> is considered less specific than a non wildcard value, |
175 |
and thus will be overridden by a non wildcard value (e.g. "100", "a", etc). |
176 |
</p> |
177 |
|
178 |
<h4>Regular expressions</h4> |
179 |
Regular expressions can be used in both the <i>Tag</i> and <i>Subfield |
180 |
tag</i> fields. Beware though, using regular expressions may create |
181 |
overlapping matches, in which case they will be applied in a sorted order. |
182 |
|
183 |
<h4>Example rules</h4> |
184 |
<p> |
185 |
Following is an example rule set in order of specificity. |
186 |
</p> |
187 |
<table> |
188 |
<thead><tr> |
189 |
<th>Tag</th> |
190 |
<th>Subfield tag</th> |
191 |
<th>Module</th> |
192 |
<th>Filter</th> |
193 |
<th>Description</th> |
194 |
</tr></thead> |
195 |
<tbody> |
196 |
<tr> |
197 |
<td>*</td> |
198 |
<td></td> |
199 |
<td>[% modules.0.name %]</td> |
200 |
<td>*</td> |
201 |
<td><i>Match any field regardless of [% modules.0.name %]</i></td> |
202 |
</tr> |
203 |
<tr> |
204 |
<td>*</td> |
205 |
<td>*</td> |
206 |
<td>[% modules.0.name %]</td> |
207 |
<td>*</td> |
208 |
<td><i>Match any subfield regardless of [% modules.0.name %]</i></td> |
209 |
</tr> |
210 |
<tr> |
211 |
<td>245</td> |
212 |
<td>*</td> |
213 |
<td>[% modules.0.name %]</td> |
214 |
<td>z39.50</td> |
215 |
<td><i>Match any subfield under <b>245</b> when [% modules.0.name %] |
216 |
is <b>z39.50</b></i></td> |
217 |
</tr> |
218 |
<tr> |
219 |
<td>*</td> |
220 |
<td>b</td> |
221 |
<td>[% modules.0.name %]</td> |
222 |
<td>z39.50</td> |
223 |
<td><i>Match subfield <b>b</b> regardless of field when [% modules.0.name %] |
224 |
is <b>z39.50</b></i></td> |
225 |
</tr> |
226 |
<tr> |
227 |
<td>500</td> |
228 |
<td>[a-d]</td> |
229 |
<td>[% modules.0.name %]</td> |
230 |
<td>z39.50</td> |
231 |
<td><i>Match subfields <b>a, b, c, d</b> when field is 500 and [% |
232 |
modules.0.name %] is <b>z39.50</b></i></td> |
233 |
</tr> |
234 |
<tr> |
235 |
<td>5..</td> |
236 |
<td>a</td> |
237 |
<td>[% modules.0.name %]</td> |
238 |
<td>z39.50</td> |
239 |
<td><i>Match subfield <b>a</b> when field matches the regular |
240 |
expression <b>5..</b> (500-599) and [% modules.0.name %] is <b>z39.50</b></i></td> |
241 |
</tr> |
242 |
<tr> |
243 |
<td>245</td> |
244 |
<td>a</td> |
245 |
<td>[% modules.0.name %]</td> |
246 |
<td>z39.50</td> |
247 |
<td><i>Match subfield <b>a</b> when field is <b>500</b> and [% |
248 |
modules.0.name %] is <b>z39.50</b></i></td> |
249 |
</tr> |
250 |
</tbody> |
251 |
</table> |
252 |
|
253 |
<h3>Available filter modules</h3> |
254 |
Filters cannot be regular expressions. Please use a single <b>*</b> as a |
255 |
wildcard if need. |
256 |
<table> |
257 |
<thead> |
258 |
<tr> |
259 |
<th>Specificity</th> |
260 |
<th>Module</th> |
261 |
<th>Description</th> |
262 |
</tr> |
263 |
</thead> |
264 |
<tbody> |
265 |
[% FOREACH module IN modules %] |
266 |
<tr> |
267 |
<td>[% module.specificity %]</td> |
268 |
<td>[% module.name %]</td> |
269 |
<td>[% module.description %]</td> |
270 |
</tr> |
271 |
[% END %] |
272 |
</tbody> |
273 |
</table> |
274 |
|
275 |
<h3>Available sources</h3> |
276 |
The following sources currently implement MARCPermissions. |
277 |
|
278 |
<table> |
279 |
<thead> |
280 |
<tr> |
281 |
<th>Name</th> |
282 |
<th>Description</th> |
283 |
</tr> |
284 |
</thead> |
285 |
<tbody> |
286 |
<tr> |
287 |
<td>bulkmarcimport</td> |
288 |
<td>bin/migration_tools/bulkmarcimport.pl</td> |
289 |
</tr> |
290 |
<tr> |
291 |
<td>import_lexile</td> |
292 |
<td>bin/migration_tools/import_lexile.pl</td> |
293 |
</tr> |
294 |
<tr> |
295 |
<td>z39.50</td> |
296 |
<td>Import from Z39.50 search in browser</td> |
297 |
</tr> |
298 |
<tr> |
299 |
<td>intranet</td> |
300 |
<td>Modifications from intranet in browser</td> |
301 |
</tr> |
302 |
<tr> |
303 |
<td>batchmod</td> |
304 |
<td>Batch record modification in browser</td> |
305 |
</tr> |
306 |
</tbody> |
307 |
</table> |
308 |
|
309 |
|
310 |
|
311 |
<h3>Indicators</h3> |
312 |
<p> |
313 |
Indicators can be addressed as <b>i1</b> and <b>i2</b> in the <i>Subfield |
314 |
tag</i> field. Some actions might not be available for indicators, in which |
315 |
case they will be disabled. |
316 |
</p> |
317 |
|
318 |
<h3>Logging</h3> |
319 |
<p>If <b>MARCPermissionsLog</b> is enabled, log entries for each record |
320 |
modification will be available in the <b>Modification log</b> in the |
321 |
<b>Catalog</b> module under the <b>Modify</b> action. This can be very |
322 |
helpful when debugging rule sets.</p> |
323 |
</div> |
324 |
|
153 |
|
325 |
[% IF removeConfirm %] |
154 |
[% IF removeConfirm %] |
326 |
<div class="dialog alert"> |
155 |
<div class="dialog alert"> |
Lines 330-336
The <b>MARCPermissions</b> preference is not set, don't forget to enable it for
Link Here
|
330 |
<form action="[% script_name %]" method="GET"> |
159 |
<form action="[% script_name %]" method="GET"> |
331 |
<input type="submit" value="No, do not remove" class="deny"/> |
160 |
<input type="submit" value="No, do not remove" class="deny"/> |
332 |
</form> |
161 |
</form> |
333 |
<input type="button" value="Yes, remove" class="approve" onClick="doSubmit('doremove');"/> |
162 |
<input type="button" value="Yes, remove" class="approve" id="doremove" /> |
334 |
</div> |
163 |
</div> |
335 |
[% END %] |
164 |
[% END %] |
336 |
|
165 |
|
Lines 345-351
The <b>MARCPermissions</b> preference is not set, don't forget to enable it for
Link Here
|
345 |
<th>On Existing</th> |
174 |
<th>On Existing</th> |
346 |
<th>On New</th> |
175 |
<th>On New</th> |
347 |
<th>On Removed</th> |
176 |
<th>On Removed</th> |
348 |
<th> </th> |
177 |
<th>Actions</th> |
349 |
<th> </th> |
178 |
<th> </th> |
350 |
</tr></thead> |
179 |
</tr></thead> |
351 |
[% UNLESS edit %] |
180 |
[% UNLESS edit %] |
Lines 383-390
The <b>MARCPermissions</b> preference is not set, don't forget to enable it for
Link Here
|
383 |
[% END %] |
212 |
[% END %] |
384 |
</select> |
213 |
</select> |
385 |
</th> |
214 |
</th> |
386 |
<th><button class="btn btn-small" type="button" title="Add" onClick="doSubmit('add');" ><i class="icon-plus"></i></button></th> |
215 |
<th><button class="btn btn-small" title="Add" id="add"><i class="fa fa-plus"></i> Add rule</button></th> |
387 |
<th><button id="btn_batchremove" disabled="disabled" class="btn btn-small" type="button" title="Batch remove" onClick="doSubmit('remove');" ><i class="icon-trash"></i></button></th> |
216 |
<th><button id="btn_batchremove" disabled="disabled" class="btn btn-small" title="Batch remove"><i class="fa fa-trash"></i> Delete selected</button></th> |
388 |
</tr> |
217 |
</tr> |
389 |
</tfoot> |
218 |
</tfoot> |
390 |
[% END %] |
219 |
[% END %] |
Lines 440-448
The <b>MARCPermissions</b> preference is not set, don't forget to enable it for
Link Here
|
440 |
[% END %] |
269 |
[% END %] |
441 |
</select> |
270 |
</select> |
442 |
</td> |
271 |
</td> |
443 |
<td> |
272 |
<td class="actions"> |
444 |
<button class="btn btn-small" type="button" title="Save" onClick="doSubmit('doedit', [% rule.id %]);"><i class="icon-ok"></i></button> |
273 |
<button class="btn btn-mini" title="Save" id="doedit" value="[% rule.id %]"><i class="fa fa-check"></i> Save</button> |
445 |
<a href="?"><button class="btn btn-small" type="button" title="Cancel" ><i class="icon-ban-circle"></i></button></a> |
274 |
<a href="?"><button class="btn btn-mini" title="Cancel" ><i class="fa fa-times"></i> Cancel</button></a> |
446 |
</td> |
275 |
</td> |
447 |
<td></td> |
276 |
<td></td> |
448 |
[% ELSE %] |
277 |
[% ELSE %] |
Lines 454-462
The <b>MARCPermissions</b> preference is not set, don't forget to enable it for
Link Here
|
454 |
<td>[% rule.on_existing %]</td> |
283 |
<td>[% rule.on_existing %]</td> |
455 |
<td>[% rule.on_new %]</td> |
284 |
<td>[% rule.on_new %]</td> |
456 |
<td>[% rule.on_removed %]</td> |
285 |
<td>[% rule.on_removed %]</td> |
457 |
<td> |
286 |
<td class="actions"> |
458 |
<a href="?op=remove&id=[% rule.id %]" title="Remove"><i class="icon-remove"></i></a> |
287 |
<a href="?op=remove&id=[% rule.id %]" title="Delete" class="btn btn-mini"><i class="fa fa-trash"></i> Delete</a> |
459 |
<a href="?op=edit&id=[% rule.id %]" title="Edit"><i class="icon-pencil"></i></a> |
288 |
<a href="?op=edit&id=[% rule.id %]" title="Edit" class="btn btn-mini"><i class="fa fa-pencil"></i> Edit</a> |
460 |
</td> |
289 |
</td> |
461 |
<td> |
290 |
<td> |
462 |
[% IF rule.remove %] |
291 |
[% IF rule.remove %] |