4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>OAI set mappings › OAI sets › Administration › Koha</title>
6 [% INCLUDE 'doc-head-close.inc' %]
9 <body id="admin_oai_set_mappings" class="admin">
10 [% WRAPPER 'header.inc' %]
11 [% INCLUDE 'prefs-admin-search.inc' %]
14 [% WRAPPER 'sub-header.inc' %]
15 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
18 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
21 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
24 <a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a>
27 <a href="#" aria-current="page">OAI set mappings</a>
33 <div class="main container-fluid">
35 <div class="col-sm-10 col-sm-push-2">
38 [% IF ( mappings_saved ) %]
39 <div class="dialog message">
40 <h4>Mappings have been saved</h4>
41 <p><a href="/cgi-bin/koha/admin/oai_sets.pl">Return to sets management</a></p>
44 <h1>Mappings for set '[% setName | html %]' ([% setSpec | html %])</h1>
45 [% UNLESS ( mappings ) %]
46 <div class="dialog alert"><p><strong>Warning:</strong> No mappings have been defined for this set</p></div>
48 <form action="/cgi-bin/koha/admin/oai_set_mappings.pl" method="post" id="mappingform">
52 <th>Rule operator</th>
63 [% FOREACH mapping IN mappings %]
66 <select name="rule_operator">
67 [% IF (mapping.rule_operator == 'and') %]
68 <option value="and" selected="selected">and</option>
70 <option value="and">and</option>
72 [% IF (mapping.rule_operator == 'or') %]
73 <option value="or" selected="selected">or</option>
75 <option value="or">or</option>
79 <td><input type="text" name="marcfield" size="3" value="[% mapping.marcfield | html %]" /></td>
80 <td><input type="text" name="marcsubfield" size="1" value="[% mapping.marcsubfield | html %]" /></td>
81 <td><select name=operator>
82 [% IF mapping.operator == 'equal' %]
83 <option value="equal" selected="selected">is equal to</option>
84 <option value="notequal">not equal to</option>
86 <option value="equal">is equal to</option>
87 <option value="notequal" selected="selected">not equal to</option>
90 <td><input type="text" name="marcvalue" value="[% mapping.marcvalue | html %]" /></td>
92 [% IF ( loop.last ) %]
93 <button type="button" id="new_rule_button" class="btn btn-default btn-xs" title="Add another condition"><i class="fa fa-plus"></i> Add</button>
96 <td><button class="btn btn-default btn-xs clear-field" type="button"><i class="fa fa-trash"></i> Delete</button></td>
102 <select name="rule_operator">
103 [% IF (mapping.rule_operator == 'and') %]
104 <option value="and" selected="selected">and</option>
106 <option value="and">and</option>
108 [% IF (mapping.rule_operator == 'or') %]
109 <option value="or" selected="selected">or</option>
111 <option value="or">or</option>
115 <td><input type="text" name="marcfield" size="3" /></td>
116 <td><input type="text" name="marcsubfield" size="1" /></td>
117 <td><select name=operator>
118 <option value="equal">is equal to</option>
119 <option value="notequal">not equal to</option>
121 <td><input type="text" name="marcvalue" /></td>
123 <button type="button" id="new_rule_button" class="btn btn-default btn-xs" title="Add another condition"><i class="fa fa-plus"></i> Add</button>
125 <td><button class="btn btn-default btn-xs clear-field" type="button"><i class="fa fa-trash"></i> Delete</button></td>
130 <input type="hidden" name="id" value="[% id | html %]" />
131 <input type="hidden" name="op" value="save" />
132 <fieldset class="action">
133 <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/oai_sets.pl">Cancel</a>
138 </div> <!-- /.col-sm-10.col-sm-push-2 -->
140 <div class="col-sm-2 col-sm-pull-10">
142 [% INCLUDE 'admin-menu.inc' %]
144 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
145 </div> <!-- /.row -->
147 [% MACRO jsinclude BLOCK %]
148 [% Asset.js("js/admin-menu.js") | $raw %]
150 $(document).ready(function() {
151 $("#mappingform").submit(function(){
154 $("body").on("click","#new_rule_button", function(e){
158 $("body").on("click",".clear-field",function(e){
162 $("#mappings tbody tr:first-child td:first-child select").hide();
165 function newCondition() {
166 var tr = $('#new_rule_button').parents('tr');
167 var clone = $(tr).clone();
168 $("#new_rule_button").parent('td').find("#new_rule_button").remove();
169 $(clone).find("select").show();
170 $(tr).parent('tbody').append(clone);
172 function clearRow(link){
173 var tr = $(link).parent().parent();
174 var found = tr.find('#new_rule_button');
176 tr.find('input[type="text"]').attr("value","");
180 $("#mappings tbody tr:first-child td:first-child select").hide();
182 function hideDialogBox() {
183 $('div.dialog').remove();
187 [% INCLUDE 'intranet-bottom.inc' %]