Bug 7731 - Library should be used instead of branch and site
[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 ) %]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 <script type="text/javascript">
11 //<![CDATA[
12 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
13 function isNotNull(f,noalert) {
14         if (f.value.length ==0) {
15                 return false;
16         }
17         return true;
18 }
19 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
20 function toUC(f) {
21         var x=f.value.toUpperCase();
22         f.value=x;
23         return true;
24 }
25 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
26 function Check(f) {
27         var _alertString="";
28         var alertString2;
29         if (f.authtypecode.value.length==0) {
30                 _alertString += "\n- " + _("Authority type : code missing");
31         }
32         if (!(isNotNull(window.document.Aform.authtypetext,1))) {
33                 _alertString += "\n- " + _("Description missing");
34         }
35         if (_alertString.length==0) {
36                 document.Aform.submit();
37         } else {
38                 alertString2  = _("Form not submitted because of the following problem(s)");
39                 alertString2 += "\n------------------------------------------------------------------------------------\n";
40                 alertString2 += _alertString;
41                 alert(alertString2);
42         }
43 }
44
45 $(document).ready(function() {
46     new YAHOO.widget.Button("authtype");
47 });
48 //]]>
49 </script>
50 </head>
51 <body>
52 [% INCLUDE 'header.inc' %]
53 [% INCLUDE 'cat-search.inc' %]
54
55 <div id="breadcrumbs">
56          <a href="/cgi-bin/koha/mainpage.pl">Home</a>
57 &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
58 &rsaquo; <a href="[% script_name %]">Authority Types</a>
59 [% IF ( add_form ) %]
60 &rsaquo; [% IF ( authtypecode ) %]Modify[% ELSE %]New[% END %] Authority Type
61 [% ELSIF ( delete_confirm ) %]
62 &rsaquo; Confirm Deletion of Authority Type
63 [% END %]
64 </div>
65
66 <div id="doc3" class="yui-t2">
67   <div id="bd">
68         <div id="yui-main">
69           <div class="yui-b">
70
71 [% IF ( add_form ) %]
72
73     <form action="[% script_name %]" name="Aform" method="post">
74     <fieldset class="rows">
75     <legend>
76     [% IF ( authtypecode ) %]
77         Modify authority type
78         [% ELSE %]
79         New authority type
80         [% END %]
81     </legend>
82     <ol>
83         <li>
84     [% IF ( authtypecode ) %]
85             <span class="label">Authority type</span>
86             <input type="hidden" name="op" value="add_validate" />
87             <input type="hidden" name="checked" value="0" />
88             <input type="hidden" name="authtypecode" value="[% authtypecode %]" />[% authtypecode %]
89     [% ELSE %]
90             <label for="authtypecode">Authority type: </label>
91             <input id="authtypecode" type="text" name="authtypecode" size="10" maxlength="10" onblur="toUC(this)" />
92     [% END %]
93         </li>
94                 <li><label for="authtypetext">Description: </label><input type="text" id="authtypetext" name="authtypetext" size="40" maxlength="80" value="[% authtypetext |html %]" /></li>
95                 <li><label for="summary">Summary: </label><textarea id="summary" name="summary" cols="55" rows="7">[% summary %]</textarea></li>
96                 <li>
97                 <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>
98                 <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 %]" />
99                 <input type="hidden" name="op" value="add_validate" />
100         [% IF ( authtypecode ) %]
101         <input type="hidden" name="modif" value="1" />
102         [% END %]
103         </li>
104     </ol>
105         </fieldset>
106         <fieldset class="action"><input type="submit" value="Submit" onclick="Check(this.form); return false;" />
107         <a class="cancel" href="[% script_name %]">Cancel</a>
108     </fieldset>
109         </form>
110 [% END %]
111
112 [% IF ( delete_confirm ) %]
113                 <div class="dialog alert"><h3>Confirm Deletion of authority structure definition for <span class="ex">'[% authtypetext %]' ([% authtypecode %])</span></h3>
114         [% IF ( total ) %]
115                 <p>This record is used <strong>[% total %]</strong> times</p>
116         [% END %]               
117                         <form action="[% script_name %]" method="post"><input type="hidden" name="op" value="delete_confirmed" />
118                         <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
119                         <fieldset class="action"><input type="submit" class="approve" value="Yes, Delete" />
120                 </form>
121                 <form action="[% script_name %]" method="get"><input type="submit" class="deny" value="No, Do Not Delete" /></form>
122                 </div>
123 [% END %]
124
125 [% IF ( else ) %]
126
127 <div id="toolbar">
128         <ul class="toolbar">
129         <li><a id="authtype" href="[% script_name %]?op=add_form">New Authority Type</a></li>
130 </ul></div>
131
132 <h1>Authority Types</h1>
133 <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>
134 <table>
135         <tr>
136                 <th>Code</th>
137                 <th>Description</th>
138                 <th>Summary</th>
139                 <th>Auth field copied</th>
140                 <th>&nbsp;</th>
141                 <th>Edit</th>
142                 <th>Delete</th>
143         </tr>
144         
145         [% FOREACH loo IN loop %]
146         [% IF ( loop.odd ) %]
147                 <tr>
148         [% ELSE %]
149         <tr class="highlight">
150         [% END %]
151                         <td>[% loo.authtypecode %]</td>
152                         <td>[% loo.authtypetext %]</td>
153                         <td>[% loo.summary %]</td>
154                         <td>[% loo.auth_tag_to_report %]</td>
155                         <td><a href="auth_tag_structure.pl?authtypecode=[% loo.authtypecode %]" class="button parameters" >MARC structure</a></td>
156                         <td><a href="[% loo.script_name %]?op=add_form&amp;authtypecode=[% loo.authtypecode |html %]">Edit</a></td>
157                         <td><a href="[% loo.script_name %]?op=delete_confirm&amp;authtypecode=[% loo.authtypecode |html %]">Delete</a></td>
158                 </tr>
159         [% END %]
160 </table>
161
162         [% IF ( previous ) %]<p><a href="[% previous %]">&lt;&lt; Previous</a></p>[% END %]
163         [% IF ( next ) %]<p><a href="[% next %]">Next &gt;&gt;</a></p>[% END %]
164
165 [% END %]
166 </div>
167 </div>
168 <div class="yui-b">
169 [% INCLUDE 'admin-menu.inc' %]
170 </div>
171 </div>
172 [% INCLUDE 'intranet-bottom.inc' %]