Owen Leonard
eaa3287705
This patch modifies the staff client catalog-related administration templates so that JavaScript is included in the footer instead of the header. To test, apply the patch and test the JavaScript-driven features of each modified template: All button controls, DataTables functionality, tabs, etc. Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
132 lines
5.4 KiB
Text
132 lines
5.4 KiB
Text
[% SET footerjs = 1 %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Administration › OAI sets › OAI set mappings</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
</head>
|
|
|
|
<body id="admin_oai_set_mappings" class="admin">
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'prefs-admin-search.inc' %]
|
|
|
|
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › <a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a> › <a href="/cgi-bin/koha/admin/oai_set_mappings.pl?id=[% id %]">OAI set mappings</a></div>
|
|
|
|
<div id="doc3" class="yui-t2">
|
|
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
[% IF ( mappings_saved ) %]
|
|
<div class="dialog message">
|
|
<h4>Mappings have been saved</h4>
|
|
<p><a href="/cgi-bin/koha/admin/oai_sets.pl">Return to sets management</a></p>
|
|
</div>
|
|
[% END %]
|
|
<h1>Mappings for set '[% setName |html %]' ([% setSpec |html %])</h1>
|
|
[% UNLESS ( mappings ) %]
|
|
<div class="dialog alert"><p><strong>Warning:</strong> No mappings have been defined for this set</p></div>
|
|
[% END %]
|
|
<form action="/cgi-bin/koha/admin/oai_set_mappings.pl" method="post" id="mappingform">
|
|
<table id="mappings">
|
|
<thead>
|
|
<tr>
|
|
<th>Field</th>
|
|
<th>Subfield</th>
|
|
<th>Operator</th>
|
|
<th>Value</th>
|
|
<th> </th>
|
|
<th> </th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
[% IF ( mappings ) %]
|
|
[% FOREACH mapping IN mappings %]
|
|
<tr>
|
|
<td><input type="text" name="marcfield" size="3" value="[% mapping.marcfield %]" /></td>
|
|
<td style="text-align:center"><input type="text" name="marcsubfield" size="1" value="[% mapping.marcsubfield %]" /></td>
|
|
<td><select name=operator>
|
|
[% IF mapping.operator == 'equal' %]
|
|
<option value="equal" selected="selected">is equal to</option>
|
|
<option value="notequal">not equal to</option>
|
|
[% ELSE %]
|
|
<option value="equal">is equal to</option>
|
|
<option value="notequal" selected="selected">not equal to</option>
|
|
[% END %]
|
|
</select></td>
|
|
<td><input type="text" name="marcvalue" value="[% mapping.marcvalue %]" /></td>
|
|
<td style="text-align:center">
|
|
[% IF ( loop.last ) %]
|
|
<input type="button" id="ORbutton" value="OR" title="Add another condition" />
|
|
[% ELSE %]
|
|
OR
|
|
[% END %]
|
|
</td>
|
|
<td><button class="btn btn-default btn-xs clear-field" type="button"><i class="fa fa-trash"></i> Delete</button></td>
|
|
</tr>
|
|
[% END %]
|
|
[% ELSE %]
|
|
<tr>
|
|
<td><input type="text" name="marcfield" size="3" /></td>
|
|
<td style="text-align:center"><input type="text" name="marcsubfield" size="1" /></td>
|
|
<td><select name=operator>
|
|
<option value="equal">is equal to</option>
|
|
<option value="notequal">not equal to</option>
|
|
</select></td>
|
|
<td><input type="text" name="marcvalue" /></td>
|
|
<td><input type="button" id="ORbutton" value="OR" /></td>
|
|
<td><button class="btn btn-default btn-xs clear-field" type="button"><i class="fa fa-trash"></i> Delete</button></td>
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
<input type="hidden" name="id" value="[% id %]" />
|
|
<input type="hidden" name="op" value="save" />
|
|
<fieldset class="action">
|
|
<input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/oai_sets.pl">Cancel</a>
|
|
</fieldset>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="yui-b">
|
|
[% INCLUDE 'admin-menu.inc' %]
|
|
</div>
|
|
</div>
|
|
|
|
[% MACRO jsinclude BLOCK %]
|
|
<script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
$("#mappingform").submit(function(){
|
|
hideDialogBox();
|
|
});
|
|
$("body").on("click","#ORbutton", function(e){
|
|
e.preventDefault();
|
|
newCondition();
|
|
});
|
|
$("body").on("click",".clear-field",function(e){
|
|
e.preventDefault();
|
|
clearRow(e.target);
|
|
});
|
|
});
|
|
|
|
function newCondition() {
|
|
var tr = $('#ORbutton').parents('tr');
|
|
var clone = $(tr).clone();
|
|
$("#ORbutton").parent('td').replaceWith('<td style="text-align:center">OR</td>');
|
|
$(tr).parent('tbody').append(clone);
|
|
}
|
|
function clearRow(link){
|
|
var tr = $(link).parent().parent();
|
|
var found = tr.find('#ORbutton');
|
|
if( found.length ){
|
|
tr.find('input[type="text"]').attr("value","");
|
|
} else {
|
|
tr.find('input[type="text"]').attr("value","").end().hide();
|
|
}
|
|
}
|
|
function hideDialogBox() {
|
|
$('div.dialog').remove();
|
|
}
|
|
</script>
|
|
[% END %]
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|