Bug 16014: Display a warning on deleting OAI sets
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / oai_sets.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; [% IF ( op_new ) %]OAI sets configuration &rsaquo; Add a new OAI set[% ELSE %]OAI sets configuration[% END %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/javascript">
5 //<![CDATA[
6 function newDescField() {
7     $("#adddescription").before(
8         '<li><label>setDescription: </label>' +
9         '<textarea style="vertical-align:middle" rows="2" cols="30" name="description"></textarea>' +
10         '<a onclick="delDescField(this); return false;" class="clear-field" href="#">Remove</a>' +
11         '</li>'
12     );
13 }
14
15 function delDescField(minusButton) {
16     var li = $(minusButton).parent('li');
17     $(li).remove();
18 }
19
20 function confirmDelete() {
21   return confirm(_("Are you sure you want to delete this OAI set?"));
22 }
23
24 $(document).ready(function() {
25     $(".delete_oai_set").on("click",function(){
26         return confirmDelete();
27     });
28 });
29 //]]>
30 </script>
31 </head>
32
33 <body id="admin_oai_sets" class="admin">
34 [% INCLUDE 'header.inc' %]
35 [% INCLUDE 'cat-search.inc' %]
36
37 <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; [% IF ( op_new ) %]<a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a> &rsaquo; Add a new OAI set[% ELSIF ( op_mod ) %]<a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a> &rsaquo; Modify OAI set '[% spec %]'[% ELSE %] OAI sets configuration[% END %]</div>
38
39 <div id="doc3" class="yui-t2">
40
41 <div id="bd">
42   <div id="yui-main">
43     <div class="yui-b">
44         [% IF ( op_new || op_mod ) %]
45             <form method="post" action="/cgi-bin/koha/admin/oai_sets.pl" class="validated">
46             [% IF ( op_new ) %]
47                 <h2>Add a new OAI set</h2>
48                 <input type="hidden" name="op" value="savenew" />
49             [% ELSIF ( op_mod ) %]
50                 <h2>Modify OAI set '[% spec %]'</h2>
51                     <input type="hidden" name="op" value="savemod" />
52                     <input type="hidden" name="id" value="[% id %]" />
53             [% END %]
54                 <fieldset id="oaidetails" class="rows">
55                     <ol>
56                         <li>
57                             <label for="spec" class="required">setSpec: </label>
58                             <input type="text" id="spec" name="spec" value="[% spec %]" required="required" class="required" />
59                             <span class="required">Required</span>
60                         </li>
61                         <li>
62                             <label for="name" class="required">setName: </label>
63                             <input type="text" id="name" name="name" value="[% name %]" required="required" class="required" />
64                             <span class="required">Required</span>
65                         </li>
66                         [% FOREACH desc IN descriptions %]
67                             <li>
68                                 <label>setDescription: </label>
69                                 <textarea style="vertical-align:middle" rows="2" cols="30" name="description">[% desc.description %]</textarea>
70                                 <a onclick="delDescField(this); return false;" class="clear-field" href="#">Remove</a>
71                             </li>
72                         [% END %]
73                         <li id="adddescription"><span class="label">&nbsp;</span><a class="clone-field" href="#" onclick='newDescField(); return false;'>Add description</a></li>
74
75                     </ol>
76                 </fieldset>
77                 <fieldset class="action">
78                     <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/oai_sets.pl">Cancel</a>
79                 </fieldset>
80             </form>
81         [% ELSE %]
82
83         <div id="toolbar" class="btn-toolbar">
84             <a class="btn btn-small" id="newoaiset" href="/cgi-bin/koha/admin/oai_sets.pl?op=new"><i class="fa fa-plus"></i> New set</a>
85         </div>
86
87         <h2>OAI sets</h2>
88         [% IF sets_loop %]
89             <table>
90                 <thead>
91                     <tr>
92                         <th>setSpec</th>
93                         <th>setName</th>
94                         <th>setDescriptions</th>
95                         <th>Action</th>
96                     </tr>
97                 </thead>
98                 <tbody>
99                     [% FOREACH set IN sets_loop %]
100                         <tr>
101                             <td>[% set.spec %]</td>
102                             <td>[% set.name %]</td>
103                             <td>
104                                 [% IF set.descriptions %]
105                                     <ul>
106                                         [% FOREACH desc IN set.descriptions %]
107                                             <li>[% desc.description %]</li>
108                                         [% END %]
109                                     </ul>
110                                 [% ELSE %]
111                                     <em>No descriptions</em>
112                                 [% END %]
113                             </td>
114                             <td>
115                                 <a href="/cgi-bin/koha/admin/oai_sets.pl?op=mod&amp;id=[% set.id %]">Modify</a>
116                                 |
117                                 <a class="delete_oai_set" href="/cgi-bin/koha/admin/oai_sets.pl?op=del&amp;id=[% set.id %]">Delete</a>
118                                 |
119                                 <a href="/cgi-bin/koha/admin/oai_set_mappings.pl?id=[% set.id %]">Define mappings</a>
120                             </td>
121                         </tr>
122                     [% END %]
123                 </tbody>
124             </table>
125         [% ELSE %]
126             <div class="dialog message"><p>There are no sets defined.</p></div>
127         [% END %]
128         [% END %]
129
130     </div>
131   </div>
132   <div class="yui-b">
133     [% INCLUDE 'admin-menu.inc' %]
134   </div>
135 </div>
136 [% INCLUDE 'intranet-bottom.inc' %]