1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Authorities › [% IF ( authid ) %]Modify authority #[% authid %] ([% authtypetext %])[% ELSE %]Adding authority ([% authtypetext %])[% END %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
5 <script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
7 <script type="text/javascript">
9 $(window).load(function(){
12 $(document).ready(function() {
13 $('#authoritytabs').tabs();
14 $('#toolbar').fixFloat();
15 $("#addauth").click(function(){
20 $("#z3950submit").click(function(){
21 if (confirm(_("Please note that this Z39.50 search could replace the current record."))){
22 var strQuery = GetZ3950Terms();
24 window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl?authid=[% authid %]"+strQuery,"z3950search",'width=740,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes');
32 * check if z3950 mandatories are set or not
34 function GetZ3950Terms(){
35 var strQuery="&authtypecode="+document.forms['f'].authtypecode.value;
36 var mandatories = new Array();
37 var mandatories_label = new Array();
38 [% FOREACH BIG_LOO IN BIG_LOOP %][% FOREACH innerloo IN BIG_LOO.innerloop %][% FOREACH subfield_loo IN innerloo.subfield_loop %][% IF ( subfield_loo.z3950_mandatory ) %]mandatories.push("[% subfield_loo.id %]");
39 mandatories_label.push("[% subfield_loo.z3950_mandatory %]");[% END %][% END %][% END %][% END %]
41 for(var i=0,len=mandatories.length; i<len ; i++){
42 var field_value = document.getElementById(mandatories[i]).value;
44 strQuery += "&"+mandatories_label[i]+"="+field_value;
51 * check if mandatory subfields are written
53 function AreMandatoriesNotOk(){
54 var mandatories = new Array();
55 var mandatoriesfields = new Array();
56 var tab = new Array();
57 var label = new Array();
58 [% FOREACH BIG_LOO IN BIG_LOOP %]
59 [% FOREACH innerloo IN BIG_LOO.innerloop %]
60 [% IF ( innerloo.mandatory ) %]
61 mandatoriesfields.push(new Array("[% innerloo.tag %]","[% innerloo.index %][% innerloo.random %]","[% innerloo.index %]"));
63 [% FOREACH subfield_loo IN innerloo.subfield_loop %]
64 [% IF ( subfield_loo.mandatory ) %]mandatories.push("[% subfield_loo.id %]");
65 tab.push("[% BIG_LOO.number %]");
66 label.push("[% subfield_loo.marc_lib |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]");
72 for(var i=0,len=mandatories.length; i<len ; i++){
73 var id_string = mandatories[i];
75 if( ! $("#" + id_string).val() ){
76 $("#" + id_string).attr('class','subfield_not_filled').focus();
77 StrAlert += "\t* " + _("%s in tab %s").format(label[i], tab[i]) + "\n";
81 /* Check for mandatories field(not subfields) */
82 for(var i=0,len=mandatoriesfields.length; i<len; i++){
84 arr = mandatoriesfields[i];
85 divid = "tag_" + arr[0] + "_" + arr[1];
86 varegexp = new RegExp("^tag_" + arr[0] + "_code_");
88 if(parseInt(arr[0]) >= 10){
89 elem = document.getElementById(divid);
90 eleminputs = elem.getElementsByTagName('input');
92 for(var j=0,len2=eleminputs.length; j<len2; j++){
94 if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
95 inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
97 for( var k=0; k<len2; k++){
98 if(eleminputs[k].id.match(inputregexp) && eleminputs[k].value){
110 StrAlert += "\t* " + _("Field %s is mandatory, at least one of its subfields must be filled.").format(arr[0]) + "\n";
117 return _("Can't save this record because the following field aren't filled :") + "\n\n" + StrAlert;
123 var StrAlert = AreMandatoriesNotOk();
133 function AddField(field,cntrepeatfield) {
134 document.forms['f'].op.value = "addfield";
135 document.forms['f'].addfield_field.value=field;
136 document.forms['f'].repeat_field.value=cntrepeatfield;
140 function addauthority() {
141 X = document.forms[0].authtype.value;
142 window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X;
144 function searchauthority() {
145 X = document.forms[0].authtype2.value;
146 Y = document.forms[0].value.value;
147 window.location="/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&authtypecode="+X+"&value="+Y+"&marclist=&and_or=and&excluding=&operator=contains";
149 function confirmnotdup(redirect){
150 $("#confirm_not_duplicate").attr("value","1");
155 <link type="text/css" rel="stylesheet" href="[% interface %]/[% theme %]/css/addbiblio.css" />
157 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" />
160 <body id="auth_authorities" class="auth">
163 <div>Loading, please wait...</div>
166 [% INCLUDE 'header.inc' %]
168 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a> › [% IF ( authid ) %]Modify authority #[% authid %] ([% authtypetext %])[% ELSE %]Adding authority [% authtypetext %][% END %] </div>
170 <div id="doc" class="yui-t7">
177 <h1>Modify authority #[% authid %] [% authtypetext %]</h1>
179 <h1>Adding authority [% authtypetext %]</h1>
182 [% IF ( duplicateauthid ) %]
183 <div class="dialog alert">
184 <h3>Duplicate record suspected</h3>
185 <p>Is this a duplicate of <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% duplicateauthid %]" class="popup" onclick="openWindow('/cgi-bin/koha/authorities/detail.pl?authid=[% duplicateauthid %]&popup=1', 'DuplicateAuthority','800','600'); return false;" class="button">[% duplicateauthvalue %]</a> ?</p>
187 <form action="authorities.pl" method="get">
188 <input type="hidden" name="authid" value="[% duplicateauthid %]" />
189 <button type="submit" class="new"><i class="fa fa-pencil"></i> Yes: Edit existing authority</button>
191 <form action="authorities.pl" method="get">
192 <button class="new" onclick="confirmnotdup('items'); return false;"><i class="fa fa-save"></i> No: Save as new authority</button>
197 <form method="post" name="f" action="/cgi-bin/koha/authorities/authorities.pl">
198 <input type="hidden" name="op" value="add" />
199 <input type="hidden" name="addfield_field" value="" />
200 <input type="hidden" name="repeat_field" value="" />
201 <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
202 <input type="hidden" name="authid" value="[% authid %]" />
203 <input type="hidden" name="index" value="[% index %]" />
204 <input type="hidden" value="0" id="confirm_not_duplicate" name="confirm_not_duplicate" />
206 <div id="toolbar" class="btn-toolbar">
207 <div class="btn-group"><a href="#" id="addauth" class="btn btn-small" accesskey="w"><i class="fa fa-save"></i> Save</a></div>
208 <div class="btn-group">
209 <a class="btn btn-small" id="z3950submit" href="#"><i class="fa fa-search"></i> Z39.50 search</a>
213 <div id="authoritytabs" class="toptabs numbered">
215 [% FOREACH BIG_LOO IN BIG_LOOP %]
216 <li><a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a></li>
220 [% FOREACH BIG_LOO IN BIG_LOOP %]
221 <div id="tab[% BIG_LOO.number %]XX">
223 [% FOREACH innerloo IN BIG_LOO.innerloop %]
224 [% IF ( innerloo.tag ) %]
225 <div class="tag clearfix" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
226 <div class="tag_title" id="div_indicator_tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
227 [% UNLESS hide_marc %]
228 [% IF advancedMARCEditor %]
229 <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;">[% innerloo.tag %]</a>
231 <span title="[% innerloo.tag_lib %]">[% innerloo.tag %]</span>
233 [% IF ( innerloo.fixedfield ) %]
236 class="indicator flat"
237 style="display:none;"
238 name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
241 value="[% innerloo.indicator1 %]" />
244 class="indicator flat"
245 style="display:none;"
246 name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
249 value="[% innerloo.indicator2 %]" />
253 class="indicator flat"
254 name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
257 value="[% innerloo.indicator1 %]" />
260 class="indicator flat"
261 name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
264 value="[% innerloo.indicator2 %]" />
267 [% IF ( innerloo.fixedfield ) %]
270 name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
271 value="[% innerloo.indicator1 %]" />
274 name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
275 value="[% innerloo.indicator2 %]" />
279 name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
280 value="[% innerloo.indicator1 %]" />
283 name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
284 value="[% innerloo.indicator2 %]" />
288 [% UNLESS advancedMARCEditor %]
289 <a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib %]</a>
291 <span class="field_controls">
292 [% IF ( innerloo.repeatable ) %]
293 <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]','[% hide_marc %]','[% advancedMARCEditor %]'); return false;" title="Repeat this Tag">
294 <img src="[% interface %]/[% theme %]/img/repeat-tag.png" alt="Repeat this Tag" />
297 <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Delete this Tag">
298 <img src="[% interface %]/[% theme %]/img/delete-tag.png" alt="Delete this Tag" />
304 [% FOREACH subfield_loo IN innerloo.subfield_loop %]
305 <!-- One line on the marc editor -->
306 <div class="subfield_line" style="[% subfield_loo.visibility %]" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]">
308 [% UNLESS advancedMARCEditor %]
309 [% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" style="display:none;" class="labelsubfield">
310 [% ELSE %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield">
314 [% UNLESS hide_marc %]
315 <span class="subfieldcode">
316 [% IF ( subfield_loo.fixedfield ) %]
317 <img class="buttonUp" style="display:none;" src="[% interface %]/[% theme %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
319 <img class="buttonUp" src="[% interface %]/[% theme %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
322 title="[% subfield_loo.marc_lib %]"
323 style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
324 name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
325 value="[% subfield_loo.subfield %]"
333 name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
334 value="[% subfield_loo.subfield %]" />
337 [% UNLESS advancedMARCEditor %]
338 [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %]
339 [% subfield_loo.marc_lib %]
340 [% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %]
345 [% SET mv = subfield_loo.marc_value %]
346 [% IF ( mv.type == 'select' ) %]
347 <select name="[%- mv.name -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id -%]">
348 [% FOREACH aval IN mv.values %]
349 [% IF aval == mv.default %]
350 <option value="[%- aval -%]" selected="selected">[%- mv.labels.$aval -%]</option>
352 <option value="[%- aval -%]">[%- mv.labels.$aval -%]</option>
356 [% ELSIF ( mv.type == 'text1' ) %]
357 <input type="text" id="[%- mv.id -%]" name="[%- mv.id -%]" value="[%- mv.value -%]" class="input_marceditor" tabindex="1" />
358 <a href="#" class="buttonDot" onclick="openAuth(this.parentNode.getElementsByTagName('input')[1].id,'[%- mv.authtypecode -%]','auth'); return false;" tabindex="1" title="Tag editor">...</a>
359 [% ELSIF ( mv.type == 'text2' ) %]
360 <input type="text" id="[%- mv.id -%]" size="67" maxlength="[%- mv.maxlength -%]" name="[%- mv.name -%]" value="[%- mv.value -%]" class="input_marceditor" />
362 <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup">...</a>
364 <a href="#" id="buttonDot_[% mv.id %]" class="buttonDot tag_editor" title="Tag editor">...</a>
367 [% ELSIF ( mv.type == 'text' ) %]
368 <input type="text" id="[%- mv.id -%]" name="[%- mv.name -%]" value="[%- mv.value -%]" class="input_marceditor" tabindex="1" size="67" maxlength="[%- mv.maxlength -%]" />
369 [% ELSIF ( mv.type == 'textarea' ) %]
370 <textarea cols="70" rows="4" id="[%- mv.id -%]" name="[%- mv.name -%]" class="input_marceditor" tabindex="1" size="67" maxlength="[%- mv.maxlength -%]">[%- mv.value -%]</textarea>
371 [% ELSIF ( mv.type == 'hidden' ) %]
372 <input tabindex="1" type="hidden" id="[%- mv.id -%]" name="[%- mv.name -%]" size="67" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
373 [% ELSIF ( mv.type == 'hidden_simple' ) %]
374 <input type="hidden" name="[%- mv.name -%]" />
377 <span class="subfield_controls">
378 [% IF ( subfield_loo.repeatable ) %]
379 <a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]','[% advancedMARCEditor %]'); return false;">
380 <img src="[% interface %]/[% theme %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
382 <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;">
383 <img src="[% interface %]/[% theme %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
389 <!-- End of the line -->
393 [% END %]<!-- if innerloo.tag -->
394 [% END %]<!-- BIG_LOO.innerloop -->
396 [% END %]<!-- BIG_LOOP -->
400 <div name="hidden" id="hidden" class="tab">
401 [% FOREACH hidden_loo IN hidden_loop %]
402 <input type="hidden" name="tag" value="[% hidden_loo.tag %]" />
403 <input type="hidden" name="subfield" value="[% hidden_loo.subfield %]" />
404 <input type="hidden" name="mandatory" value="[% hidden_loo.mandatory %]" />
405 <input type="hidden" name="kohafield" value="[% hidden_loo.kohafield %]" />
406 <input type="hidden" name="tag_mandatory" value="[% hidden_loo.tag_mandatory %]" />
409 [% IF ( oldauthnumtagfield ) %]
410 <input type="hidden" name="tag" value="[% oldauthnumtagfield %]" />
411 <input type="hidden" name="subfield" value="[% oldauthnumtagsubfield %]" />
412 <input type="hidden" name="field_value" value="[% authid %]" />
413 <input type="hidden" name="mandatory" value="0" />
414 <input type="hidden" name="kohafield" value="[% kohafield %]" />
415 <input type="hidden" name="tag_mandatory" value="[% tag_mandatory %]" />
416 <input type="hidden" name="tag" value="[% oldauthtypetagfield %]" />
417 <input type="hidden" name="subfield" value="[% oldauthtypetagsubfield %]" />
418 <input type="hidden" name="field_value" value="[% authtypecode %]" />
421 <fieldset class="action">
422 <input type="button" id="addauth2" value="Save" onclick="Check(this.form)" accesskey="w" />
431 [% INCLUDE 'intranet-bottom.inc' %]