4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Administration › OAI sets › OAI set mappings</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 <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 | html %]">OAI set mappings</a></div>
15 <div class="main container-fluid">
17 <div class="col-sm-10 col-sm-push-2">
20 [% IF ( mappings_saved ) %]
21 <div class="dialog message">
22 <h4>Mappings have been saved</h4>
23 <p><a href="/cgi-bin/koha/admin/oai_sets.pl">Return to sets management</a></p>
26 <h1>Mappings for set '[% setName | html %]' ([% setSpec | html %])</h1>
27 [% UNLESS ( mappings ) %]
28 <div class="dialog alert"><p><strong>Warning:</strong> No mappings have been defined for this set</p></div>
30 <form action="/cgi-bin/koha/admin/oai_set_mappings.pl" method="post" id="mappingform">
34 <th>Rule operator</th>
45 [% FOREACH mapping IN mappings %]
48 <select name="rule_operator">
49 [% IF (mapping.rule_operator == 'and') %]
50 <option value="and" selected="selected">and</option>
52 <option value="and">and</option>
54 [% IF (mapping.rule_operator == 'or') %]
55 <option value="or" selected="selected">or</option>
57 <option value="or">or</option>
61 <td><input type="text" name="marcfield" size="3" value="[% mapping.marcfield | html %]" /></td>
62 <td style="text-align:center"><input type="text" name="marcsubfield" size="1" value="[% mapping.marcsubfield | html %]" /></td>
63 <td><select name=operator>
64 [% IF mapping.operator == 'equal' %]
65 <option value="equal" selected="selected">is equal to</option>
66 <option value="notequal">not equal to</option>
68 <option value="equal">is equal to</option>
69 <option value="notequal" selected="selected">not equal to</option>
72 <td><input type="text" name="marcvalue" value="[% mapping.marcvalue | html %]" /></td>
73 <td style="text-align:center">
74 [% IF ( loop.last ) %]
75 <input type="button" id="new_rule_button" value="add" title="Add another condition" />
78 <td><button class="btn btn-default btn-xs clear-field" type="button"><i class="fa fa-trash"></i> Delete</button></td>
84 <select name="rule_operator">
85 [% IF (mapping.rule_operator == 'and') %]
86 <option value="and" selected="selected">and</option>
88 <option value="and">and</option>
90 [% IF (mapping.rule_operator == 'or') %]
91 <option value="or" selected="selected">or</option>
93 <option value="or">or</option>
97 <td><input type="text" name="marcfield" size="3" /></td>
98 <td style="text-align:center"><input type="text" name="marcsubfield" size="1" /></td>
99 <td><select name=operator>
100 <option value="equal">is equal to</option>
101 <option value="notequal">not equal to</option>
103 <td><input type="text" name="marcvalue" /></td>
104 <td><input type="button" id="new_rule_button" value="Add" /></td>
105 <td><button class="btn btn-default btn-xs clear-field" type="button"><i class="fa fa-trash"></i> Delete</button></td>
110 <input type="hidden" name="id" value="[% id | html %]" />
111 <input type="hidden" name="op" value="save" />
112 <fieldset class="action">
113 <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/oai_sets.pl">Cancel</a>
118 </div> <!-- /.col-sm-10.col-sm-push-2 -->
120 <div class="col-sm-2 col-sm-pull-10">
122 [% INCLUDE 'admin-menu.inc' %]
124 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
125 </div> <!-- /.row -->
127 [% MACRO jsinclude BLOCK %]
128 [% Asset.js("js/admin-menu.js") | $raw %]
130 $(document).ready(function() {
131 $("#mappingform").submit(function(){
134 $("body").on("click","#new_rule_button", function(e){
138 $("body").on("click",".clear-field",function(e){
142 $("#mappings tbody tr:first-child td:first-child select").hide();
145 function newCondition() {
146 var tr = $('#new_rule_button').parents('tr');
147 var clone = $(tr).clone();
148 $("#new_rule_button").parent('td').find("#new_rule_button").remove();
149 $(clone).find("select").show();
150 $(tr).parent('tbody').append(clone);
152 function clearRow(link){
153 var tr = $(link).parent().parent();
154 var found = tr.find('#new_rule_button');
156 tr.find('input[type="text"]').attr("value","");
160 $("#mappings tbody tr:first-child td:first-child select").hide();
162 function hideDialogBox() {
163 $('div.dialog').remove();
167 [% INCLUDE 'intranet-bottom.inc' %]