Bug 10947: Fix editing the default authority type
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / authtypes.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; Authority types
3 [% IF ( add_form ) %]
4 &rsaquo; [% IF authtypecode.defined %]Modify authority type[% ELSE %]New authority type[% END %]
5 [% ELSIF ( delete_confirm ) %]
6 &rsaquo; Confirm deletion of authority type
7 [% END %]
8 </title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
11 [% INCLUDE 'datatables.inc' %]
12 <script type="text/javascript">
13 //<![CDATA[
14     $(document).ready(function() {
15         $("#authtypes").dataTable($.extend(true, {}, dataTablesDefaults, {
16             "aoColumnDefs": [
17                 { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
18             ],
19             "sPaginationType": "four_button"
20         }));
21     });
22 //]]>
23 </script>
24 </head>
25
26 <body id="admin_authtypes" class="admin">
27 [% INCLUDE 'header.inc' %]
28 [% INCLUDE 'cat-search.inc' %]
29
30 <div id="breadcrumbs">
31          <a href="/cgi-bin/koha/mainpage.pl">Home</a>
32 &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
33 &rsaquo; <a href="[% script_name %]">Authority types</a>
34 [% IF ( add_form ) %]
35 &rsaquo; [% IF authtypecode.defined %]Modify[% ELSE %]New[% END %] Authority type
36 [% ELSIF ( delete_confirm ) %]
37 &rsaquo; Confirm deletion of authority type
38 [% END %]
39 </div>
40
41 <div id="doc3" class="yui-t2">
42   <div id="bd">
43         <div id="yui-main">
44           <div class="yui-b">
45
46 [% IF ( add_form ) %]
47
48     <form action="[% script_name %]" name="Aform" method="post" class="validated">
49     <fieldset class="rows">
50     <legend>
51     [% IF authtypecode.defined %]
52         Modify authority type
53         [% ELSE %]
54         New authority type
55         [% END %]
56     </legend>
57     <ol>
58         <li>
59     [% IF authtypecode.defined %]
60             <span class="label">Authority type</span>
61             <input type="hidden" name="op" value="add_validate" />
62             <input type="hidden" name="checked" value="0" />
63             <input type="hidden" name="authtypecode" value="[% authtypecode %]" />[% authtypecode %]
64     [% ELSE %]
65             <label for="authtypecode" class="required">Authority type: </label>
66             <input id="authtypecode" type="text" class="required" required="required" name="authtypecode" size="10" maxlength="10" onblur="toUC(this)" />
67             <span class="required">Required</span>
68     [% END %]
69         </li>
70         <li>
71             <label for="authtypetext" class="required">Description: </label><input type="text" id="authtypetext" name="authtypetext" size="40" maxlength="80" value="[% authtypetext |html %]" class="required" required="required" />
72             <span class="required">Required</span>
73         </li>
74                 <li><label for="summary">Summary: </label><textarea id="summary" name="summary" cols="55" rows="7">[% summary %]</textarea></li>
75                 <li>
76                 <p class="tip">Note: for 'Authority field to copy', enter the authority field that should be copied from the authority record to the bibliographic record. E.g., in MARC21, field 100 in the authority record should be copied to field 100 in the bibliographic record</p>
77                 <label for="auth_tag_to_report">Authority field to copy: </label><input type="text" id="auth_tag_to_report" name="auth_tag_to_report" size="5" maxlength="3" value="[% auth_tag_to_report %]" />
78                 <input type="hidden" name="op" value="add_validate" />
79         [% IF authtypecode.defined %]
80         <input type="hidden" name="modif" value="1" />
81         [% END %]
82         </li>
83     </ol>
84         </fieldset>
85     <fieldset class="action">
86         <input type="submit" value="Submit" />
87         <a class="cancel" href="[% script_name %]">Cancel</a>
88     </fieldset>
89         </form>
90 [% END %]
91
92 [% IF ( delete_confirm ) %]
93         <div class="dialog alert"><h3>Confirm deletion of authority structure definition for <span class="ex">'[% authtypetext %]' ([% authtypecode %])</span></h3>
94         [% IF ( total ) %]
95                 <p>This record is used <strong>[% total %]</strong> times</p>
96         [% END %]               
97                         <form action="[% script_name %]" method="post"><input type="hidden" name="op" value="delete_confirmed" />
98                         <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
99             <fieldset class="action"><input type="submit" class="approve" value="Yes, delete" />
100                 </form>
101         <form action="[% script_name %]" method="get"><input type="submit" class="deny" value="No, do not delete" /></form>
102                 </div>
103 [% END %]
104
105 [% IF ( else ) %]
106
107 <div id="toolbar" class="btn-toolbar">
108     <a id="authtype" class="btn btn-small" href="[% script_name %]?op=add_form"><i class="icon-plus"></i> New authority type</a>
109 </div>
110
111 <h1>Authority types</h1>
112 <p>Define authority types, then authority MARC structure in the same way you define itemtypes and biblio MARC tag structure. Authority values are managed through plugins</p>
113 <table id="authtypes">
114     <thead>
115         <tr>
116                 <th>Code</th>
117                 <th>Description</th>
118                 <th>Summary</th>
119                 <th>Auth field copied</th>
120                 <th>&nbsp;</th>
121                 <th>Edit</th>
122                 <th>Delete</th>
123         </tr>
124     </thead>
125     <tbody>
126         [% FOREACH loo IN loop %]
127                 <tr>
128                         <td>[% loo.authtypecode %]</td>
129                         <td>[% loo.authtypetext %]</td>
130                         <td>[% loo.summary %]</td>
131                         <td>[% loo.auth_tag_to_report %]</td>
132                         <td><a href="auth_tag_structure.pl?authtypecode=[% loo.authtypecode %]" class="button parameters" >MARC structure</a></td>
133                         <td><a href="[% loo.script_name %]?op=add_form&amp;authtypecode=[% loo.authtypecode |html %]">Edit</a></td>
134                         <td><a href="[% loo.script_name %]?op=delete_confirm&amp;authtypecode=[% loo.authtypecode |html %]">Delete</a></td>
135                 </tr>
136         [% END %]
137     <tbody>
138 </table>
139
140 [% END %]
141 </div>
142 </div>
143 <div class="yui-b">
144 [% INCLUDE 'admin-menu.inc' %]
145 </div>
146 </div>
147 [% INCLUDE 'intranet-bottom.inc' %]