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 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'prefs-admin-search.inc' %]
13 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
16 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
19 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
22 <a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a>
25 <a href="#" aria-current="page">OAI set mappings</a>
30 <div class="main container-fluid">
32 <div class="col-sm-10 col-sm-push-2">
35 [% IF ( mappings_saved ) %]
36 <div class="dialog message">
37 <h4>Mappings have been saved</h4>
38 <p><a href="/cgi-bin/koha/admin/oai_sets.pl">Return to sets management</a></p>
41 <h1>Mappings for set '[% setName | html %]' ([% setSpec | html %])</h1>
42 [% UNLESS ( mappings ) %]
43 <div class="dialog alert"><p><strong>Warning:</strong> No mappings have been defined for this set</p></div>
45 <form action="/cgi-bin/koha/admin/oai_set_mappings.pl" method="post" id="mappingform">
49 <th>Rule operator</th>
60 [% FOREACH mapping IN mappings %]
63 <select name="rule_operator">
64 [% IF (mapping.rule_operator == 'and') %]
65 <option value="and" selected="selected">and</option>
67 <option value="and">and</option>
69 [% IF (mapping.rule_operator == 'or') %]
70 <option value="or" selected="selected">or</option>
72 <option value="or">or</option>
76 <td><input type="text" name="marcfield" size="3" value="[% mapping.marcfield | html %]" /></td>
77 <td><input type="text" name="marcsubfield" size="1" value="[% mapping.marcsubfield | html %]" /></td>
78 <td><select name=operator>
79 [% IF mapping.operator == 'equal' %]
80 <option value="equal" selected="selected">is equal to</option>
81 <option value="notequal">not equal to</option>
83 <option value="equal">is equal to</option>
84 <option value="notequal" selected="selected">not equal to</option>
87 <td><input type="text" name="marcvalue" value="[% mapping.marcvalue | html %]" /></td>
89 [% IF ( loop.last ) %]
90 <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>
93 <td><button class="btn btn-default btn-xs clear-field" type="button"><i class="fa fa-trash"></i> Delete</button></td>
99 <select name="rule_operator">
100 [% IF (mapping.rule_operator == 'and') %]
101 <option value="and" selected="selected">and</option>
103 <option value="and">and</option>
105 [% IF (mapping.rule_operator == 'or') %]
106 <option value="or" selected="selected">or</option>
108 <option value="or">or</option>
112 <td><input type="text" name="marcfield" size="3" /></td>
113 <td><input type="text" name="marcsubfield" size="1" /></td>
114 <td><select name=operator>
115 <option value="equal">is equal to</option>
116 <option value="notequal">not equal to</option>
118 <td><input type="text" name="marcvalue" /></td>
120 <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>
122 <td><button class="btn btn-default btn-xs clear-field" type="button"><i class="fa fa-trash"></i> Delete</button></td>
127 <input type="hidden" name="id" value="[% id | html %]" />
128 <input type="hidden" name="op" value="save" />
129 <fieldset class="action">
130 <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/oai_sets.pl">Cancel</a>
135 </div> <!-- /.col-sm-10.col-sm-push-2 -->
137 <div class="col-sm-2 col-sm-pull-10">
139 [% INCLUDE 'admin-menu.inc' %]
141 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
142 </div> <!-- /.row -->
144 [% MACRO jsinclude BLOCK %]
145 [% Asset.js("js/admin-menu.js") | $raw %]
147 $(document).ready(function() {
148 $("#mappingform").submit(function(){
151 $("body").on("click","#new_rule_button", function(e){
155 $("body").on("click",".clear-field",function(e){
159 $("#mappings tbody tr:first-child td:first-child select").hide();
162 function newCondition() {
163 var tr = $('#new_rule_button').parents('tr');
164 var clone = $(tr).clone();
165 $("#new_rule_button").parent('td').find("#new_rule_button").remove();
166 $(clone).find("select").show();
167 $(tr).parent('tbody').append(clone);
169 function clearRow(link){
170 var tr = $(link).parent().parent();
171 var found = tr.find('#new_rule_button');
173 tr.find('input[type="text"]').attr("value","");
177 $("#mappings tbody tr:first-child td:first-child select").hide();
179 function hideDialogBox() {
180 $('div.dialog').remove();
184 [% INCLUDE 'intranet-bottom.inc' %]