Bug 8906: Followup replace 'Clear' with 'Delete'
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / oai_set_mappings.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; OAI sets &rsaquo; OAI set mappings</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/javascript">
5 //<![CDATA[
6 $(document).ready(function() {
7     $("#mappingform").submit(function(){
8       hideDialogBox();
9     });
10     $("#ORbutton").live("click", function(){
11        newCondition();
12        return false;
13     });
14     $(".clear-field").live("click",function(e){
15         clearRow(e.target);
16     });
17 });
18
19 function newCondition() {
20     var tr = $('#ORbutton').parents('tr');
21     var clone = $(tr).clone();
22     $("#ORbutton").parent('td').replaceWith('<td style="text-align:center">OR</td>');
23     $(tr).parent('tbody').append(clone);
24 }
25 function clearRow(link){
26     var tr = $(link).parent().parent();
27     var found = tr.find('#ORbutton');
28     if( found.length ){
29       tr.find('input[type="text"]').attr("value","");
30     } else {
31       tr.find('input[type="text"]').attr("value","").end().hide();
32     }
33 }
34 function hideDialogBox() {
35     $('div.dialog').remove();
36 }
37 //]]>
38 </script>
39 </head>
40
41 <body id="admin_oai_set_mappings" class="admin">
42 [% INCLUDE 'header.inc' %]
43 [% INCLUDE 'cat-search.inc' %]
44
45 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; <a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a> &rsaquo; <a href="/cgi-bin/koha/admin/oai_set_mappings.pl?id=[% id %]">OAI set mappings</a></div>
46
47 <div id="doc3" class="yui-t2">
48
49 <div id="bd">
50   <div id="yui-main">
51     <div class="yui-b">
52       [% IF ( mappings_saved ) %]
53         <div class="dialog message">
54           <h4>Mappings have been saved</h4>
55           <p><a href="/cgi-bin/koha/admin/oai_sets.pl">Return to sets management</a></p>
56         </div>
57       [% END %]
58       <h1>Mappings for set '[% setName %]' ([% setSpec %])</h1>
59       [% UNLESS ( mappings ) %]
60         <div class="dialog alert"><p><strong>Warning:</strong> No mappings have been defined for this set</p></div>
61       [% END %]
62       <form action="/cgi-bin/koha/admin/oai_set_mappings.pl" method="post" id="mappingform">
63         <table id="mappings">
64           <thead>
65             <tr>
66               <th>Field</th>
67               <th>Subfield</th>
68               <th>&nbsp;</th>
69               <th>Value</th>
70               <th>&nbsp;</th>
71               <th>&nbsp;</th>
72             </tr>
73           </thead>
74           <tbody>
75             [% IF ( mappings ) %]
76               [% FOREACH mapping IN mappings %]
77                 <tr>
78                   <td><input type="text" name="marcfield" size="3" value="[% mapping.marcfield %]" /></td>
79                   <td style="text-align:center"><input type="text" name="marcsubfield" size="1" value="[% mapping.marcsubfield %]" /></td>
80                   <td>is equal to</td>
81                   <td><input type="text" name="marcvalue" value="[% mapping.marcvalue %]" /></td>
82                   <td style="text-align:center">
83                     [% IF ( loop.last ) %]
84                       <input type="button" id="ORbutton" value="OR" title="Add another condition" />
85                     [% ELSE %]
86                       OR
87                     [% END %]
88                   </td>
89                   <td><a class="clear-field" href="#">Delete</a></td>
90                 </tr>
91               [% END %]
92             [% ELSE %]
93               <tr>
94                 <td><input type="text" name="marcfield" size="3" /></td>
95                 <td style="text-align:center"><input type="text" name="marcsubfield" size="1" /></td>
96                 <td>is equal to</td>
97                 <td><input type="text" name="marcvalue" /></td>
98                 <td><input type="button" id="ORbutton" value="OR" /></td>
99                 <td><a class="clear-field" href="#">Delete</a></td>
100               </tr>
101             [% END %]
102           </tbody>
103         </table>
104         <input type="hidden" name="id" value="[% id %]" />
105         <input type="hidden" name="op" value="save" />
106         <fieldset class="action">
107             <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/oai_sets.pl">Cancel</a>
108         </fieldset>
109       </form>
110
111     </div>
112   </div>
113   <div class="yui-b">
114     [% INCLUDE 'admin-menu.inc' %]
115   </div>
116 </div>
117 [% INCLUDE 'intranet-bottom.inc' %]