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 <option value="and" [% IF (mapping.rule_operator == 'and') %] selected="selected" [% END %]>and</option>
50 <option value="or" [% IF (mapping.rule_operator == 'or') %] selected="selected" [% END %]>or</option>
53 <td><input type="text" name="marcfield" size="3" value="[% mapping.marcfield | html %]" /></td>
54 <td style="text-align:center"><input type="text" name="marcsubfield" size="1" value="[% mapping.marcsubfield | html %]" /></td>
55 <td><select name=operator>
56 [% IF mapping.operator == 'equal' %]
57 <option value="equal" selected="selected">is equal to</option>
58 <option value="notequal">not equal to</option>
60 <option value="equal">is equal to</option>
61 <option value="notequal" selected="selected">not equal to</option>
64 <td><input type="text" name="marcvalue" value="[% mapping.marcvalue | html %]" /></td>
65 <td style="text-align:center">
66 [% IF ( loop.last ) %]
67 <input type="button" id="new_rule_button" value="add" title="Add another condition" />
70 <td><button class="btn btn-default btn-xs clear-field" type="button"><i class="fa fa-trash"></i> Delete</button></td>
76 <select name="rule_operator">
77 <option value="and" [% IF (mapping.rule_operator == 'and') %] selected="selected" [% END %]>and</option>
78 <option value="or" [% IF (mapping.rule_operator == 'or') %] selected="selected" [% END %]>or</option>
81 <td><input type="text" name="marcfield" size="3" /></td>
82 <td style="text-align:center"><input type="text" name="marcsubfield" size="1" /></td>
83 <td><select name=operator>
84 <option value="equal">is equal to</option>
85 <option value="notequal">not equal to</option>
87 <td><input type="text" name="marcvalue" /></td>
88 <td><input type="button" id="new_rule_button" value="Add" /></td>
89 <td><button class="btn btn-default btn-xs clear-field" type="button"><i class="fa fa-trash"></i> Delete</button></td>
94 <input type="hidden" name="id" value="[% id | html %]" />
95 <input type="hidden" name="op" value="save" />
96 <fieldset class="action">
97 <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/oai_sets.pl">Cancel</a>
102 </div> <!-- /.col-sm-10.col-sm-push-2 -->
104 <div class="col-sm-2 col-sm-pull-10">
106 [% INCLUDE 'admin-menu.inc' %]
108 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
109 </div> <!-- /.row -->
111 [% MACRO jsinclude BLOCK %]
112 [% Asset.js("js/admin-menu.js") | $raw %]
114 $(document).ready(function() {
115 $("#mappingform").submit(function(){
118 $("body").on("click","#new_rule_button", function(e){
122 $("body").on("click",".clear-field",function(e){
126 $("#mappings tbody tr:first-child td:first-child select").hide();
129 function newCondition() {
130 var tr = $('#new_rule_button').parents('tr');
131 var clone = $(tr).clone();
132 $("#new_rule_button").parent('td').find("#new_rule_button").remove();
133 $(clone).find("select").show();
134 $(tr).parent('tbody').append(clone);
136 function clearRow(link){
137 var tr = $(link).parent().parent();
138 var found = tr.find('#new_rule_button');
140 tr.find('input[type="text"]').attr("value","");
144 $("#mappings tbody tr:first-child td:first-child select").hide();
146 function hideDialogBox() {
147 $('div.dialog').remove();
151 [% INCLUDE 'intranet-bottom.inc' %]