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>
49 <div class="page-section">
50 <form action="/cgi-bin/koha/admin/oai_set_mappings.pl" method="post" id="mappingform">
54 <th>Rule operator</th>
65 [% FOREACH mapping IN mappings %]
68 <select name="rule_operator">
69 [% IF (mapping.rule_operator == 'and') %]
70 <option value="and" selected="selected">and</option>
72 <option value="and">and</option>
74 [% IF (mapping.rule_operator == 'or') %]
75 <option value="or" selected="selected">or</option>
77 <option value="or">or</option>
81 <td><input type="text" name="marcfield" size="3" value="[% mapping.marcfield | html %]" /></td>
82 <td><input type="text" name="marcsubfield" size="1" value="[% mapping.marcsubfield | html %]" /></td>
83 <td><select name=operator>
84 [% IF mapping.operator == 'equal' %]
85 <option value="equal" selected="selected">is equal to</option>
86 <option value="notequal">not equal to</option>
88 <option value="equal">is equal to</option>
89 <option value="notequal" selected="selected">not equal to</option>
92 <td><input type="text" name="marcvalue" value="[% mapping.marcvalue | html %]" /></td>
94 [% IF ( loop.last ) %]
95 <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>
98 <td><button class="btn btn-default btn-xs clear-field" type="button"><i class="fa fa-trash"></i> Delete</button></td>
104 <select name="rule_operator">
105 [% IF (mapping.rule_operator == 'and') %]
106 <option value="and" selected="selected">and</option>
108 <option value="and">and</option>
110 [% IF (mapping.rule_operator == 'or') %]
111 <option value="or" selected="selected">or</option>
113 <option value="or">or</option>
117 <td><input type="text" name="marcfield" size="3" /></td>
118 <td><input type="text" name="marcsubfield" size="1" /></td>
119 <td><select name=operator>
120 <option value="equal">is equal to</option>
121 <option value="notequal">not equal to</option>
123 <td><input type="text" name="marcvalue" /></td>
125 <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>
127 <td><button class="btn btn-default btn-xs clear-field" type="button"><i class="fa fa-trash"></i> Delete</button></td>
132 <input type="hidden" name="id" value="[% id | html %]" />
133 <input type="hidden" name="op" value="save" />
134 <fieldset class="action">
135 <input type="submit" class="btn btn-primary" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/oai_sets.pl">Cancel</a>
138 </div> <!-- /.page-section -->
141 </div> <!-- /.col-sm-10.col-sm-push-2 -->
143 <div class="col-sm-2 col-sm-pull-10">
145 [% INCLUDE 'admin-menu.inc' %]
147 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
148 </div> <!-- /.row -->
150 [% MACRO jsinclude BLOCK %]
151 [% Asset.js("js/admin-menu.js") | $raw %]
153 $(document).ready(function() {
154 $("#mappingform").submit(function(){
157 $("body").on("click","#new_rule_button", function(e){
161 $("body").on("click",".clear-field",function(e){
165 $("#mappings tbody tr:first-child td:first-child select").hide();
168 function newCondition() {
169 var tr = $('#new_rule_button').parents('tr');
170 var clone = $(tr).clone();
171 $("#new_rule_button").parent('td').find("#new_rule_button").remove();
172 $(clone).find("select").show();
173 $(tr).parent('tbody').append(clone);
175 function clearRow(link){
176 var tr = $(link).parent().parent();
177 var found = tr.find('#new_rule_button');
179 tr.find('input[type="text"]').attr("value","");
183 $("#mappings tbody tr:first-child td:first-child select").hide();
185 function hideDialogBox() {
186 $('div.dialog').remove();
190 [% INCLUDE 'intranet-bottom.inc' %]