1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 Koha -- Authority details
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
5 <!-- TMPL_INCLUDE NAME="menus.inc" -->
6 <!-- TMPL_INCLUDE NAME="menu-authorities.inc" -->
8 <fieldset id="authorities_authorities_add_or_modify">
9 <!-- TMPL_IF name="authid" -->
10 <legend>Modify authority #<!-- TMPL_VAR NAME="authid" --> (<!-- TMPL_VAR name="authtypetext" -->)</legend>
12 <legend>Adding authority (<!-- TMPL_VAR name="authtypetext" -->)</legend>
14 <form method="post" name="f">
15 <input type="hidden" name="op" value="add">
16 <input type="hidden" name="addfield_field" value="">
17 <input type="hidden" name="repeat_field" value="">
18 <input type="hidden" name="authtypecode" value="<!-- TMPL_VAR NAME="authtypecode" -->">
19 <input type="hidden" name="authid" value="<!-- TMPL_VAR NAME="authid" -->">
22 <!-- TMPL_IF name="authid" -->
23 <input type="button" value="Save" onClick="Check(this.form)" accesskey="w">
25 <input type="button" value="Add authority" onClick="Check(this.form)" accesskey="w">
29 <!-- TMPL_IF name="duplicateauthid" -->
31 <p>Duplicate suspected with <a href='javascript:openWindow("detail.pl?authid=<!-- TMPL_VAR name="duplicateauthid" -->&popup=1", "Duplicate Authority")' class="button authority"><!-- TMPL_VAR name="duplicateauthvalue" --></a></p>
32 <p>You must either :</p>
34 <p><input type="checkbox" value=1 name="confirm_not_duplicate">confirm it's not a duplicate (and click on <input type="button" value="Add authority" onClick="Check(this.form)" accesskey="w" class="button authority"> again)</p>
35 <p>Go to <a href="authorities.pl?authid=<!-- TMPL_VAR name="duplicateauthid" -->" >original authority</a></p>
40 <!-- TMPL_LOOP NAME="0XX" -->
41 <!-- TMPL_IF name="tag" -->
43 <input type="hidden" name="ind_tag" value="<!-- TMPL_VAR NAME="tag" -->">
44 <!-- TMPL_UNLESS name="hide_marc" --><a title="<!-- TMPL_VAR NAME="tag_lib" -->"><!-- TMPL_VAR NAME="tag" --></a>
45 <input tabindex="1" onblur="this.style.backgroundColor='#ffffff';" onfocus="this.style.backgroundColor='#ffffff;'" type="text" <!-- TMPL_IF NAME="fixedfield" --> style="display:none;" <!-- /TMPL_IF --> name="indicator" size="2" maxlength="2" value="<!-- TMPL_VAR NAME="indicator" -->" class="flat"> -
47 <input tabindex="1" type="hidden" <!-- TMPL_IF NAME="fixedfield" --> style="display:none;" <!-- /TMPL_IF --> name="indicator" value="<!-- TMPL_VAR NAME="indicator" -->"><!-- /TMPL_UNLESS -->
48 <!-- TMPL_UNLESS NAME="advancedMARCEditor" --><!-- TMPL_VAR NAME="tag_lib" --><!-- /TMPL_UNLESS -->
49 <!-- TMPL_IF name="repeatable" --><a href="#<!-- TMPL_VAR NAME="tag" -->" onclick="javascript:this.nextSibling.type='text';this.nextSibling.focus()">+</a><input type="hidden" value="" size="2" onchange="AddField('<!-- TMPL_VAR NAME="tag" -->',this.value)" ><!-- /TMPL_IF -->
52 <div><!-- TMPL_LOOP NAME="subfield_loop" -->
53 <!-- TMPL_IF NAME="visibility" -->
54 <a tabindex="1" style="color: grey; font-size: 80%; cursor: se-resize;" id="label<!-- TMPL_VAR name="index" -->" onclick="unHideSubfield('subfield<!-- TMPL_VAR NAME="tag" --><!-- TMPL_VAR name="index" -->','label<!-- TMPL_VAR name="index" -->')"><!-- TMPL_VAR NAME="subfield" --></a>
56 <div style="<!-- TMPL_VAR NAME='visibility' -->;" id="subfield<!-- TMPL_VAR NAME='tag' --><!-- TMPL_VAR NAME='index' -->"><!-- TMPL_UNLESS NAME="advancedMARCEditor" --><label <!-- TMPL_IF NAME="fixedfield" --> style="display:none;" <!-- /TMPL_IF --> class="labelsubfield"> <!-- /TMPL_UNLESS --><!-- TMPL_UNLESS name="hide_marc" --><img <!-- TMPL_IF NAME="fixedfield" --> style="display:none;" <!-- /TMPL_IF --> src="<!-- TMPL_VAR NAME="themelang" -->/images/up.png" onclick="upSubfield('subfield<!-- TMPL_VAR NAME="tag" --><!-- TMPL_VAR name="index" -->')"/><input title="<!-- TMPL_VAR NAME="marc_lib_plain" -->" style=" <!-- TMPL_IF NAME="fixedfield" -->display:none; <!-- /TMPL_IF -->border:0;" type="text" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->" size="1" maxlength="1" class="flat" DISABLE READONLY tabindex=-1 />
57 <!-- TMPL_ELSE --><input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->"/><!-- /TMPL_UNLESS -->
58 <!-- TMPL_UNLESS NAME="advancedMARCEditor" --><!-- TMPL_IF name="mandatory" --><b><!-- /TMPL_IF --><!-- TMPL_VAR NAME="marc_lib" --><!-- TMPL_IF name="mandatory" --> *</b><!-- /TMPL_IF --></label><!-- /TMPL_UNLESS -->
59 <!-- TMPL_VAR NAME="marc_value" --><!-- TMPL_IF NAME="repeatable" --><a style="cursor: crosshair; color: grey; font-size: 80%;" onclick="cloneSubfield('subfield<!-- TMPL_VAR NAME="tag" --><!-- TMPL_VAR name="index" -->')">+</a><!-- /TMPL_IF -->
60 <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->"/>
61 <input type="hidden" name="subfieldYYY" value="<!-- TMPL_VAR NAME="subfield" -->" size="2" maxlength="1"/>
62 <input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->"/>
63 <input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->"/>
64 <input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->"/>
65 </div><!-- /TMPL_LOOP --></div>
68 <div name="hidden" id="hidden" class="tab">
69 <!-- TMPL_LOOP NAME="hidden_loop" -->
70 <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="tag" -->">
71 <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="subfield" -->">
72 <input type="hidden" name="mandatory" value="<!-- TMPL_VAR NAME="mandatory" -->">
73 <input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->">
74 <input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->">
77 <!-- TMPL_IF name="oldauthnumtagfield" -->
78 <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="oldauthnumtagfield" -->">
79 <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="oldauthnumtagsubfield" -->">
80 <input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="authid" -->">
81 <input type="hidden" name="mandatory" value="0">
82 <input type="hidden" name="kohafield" value="<!-- TMPL_VAR NAME="kohafield" -->">
83 <input type="hidden" name="tag_mandatory" value="<!-- TMPL_VAR NAME="tag_mandatory" -->">
84 <input type="hidden" name="tag" value="<!-- TMPL_VAR NAME="oldauthtypetagfield" -->">
85 <input type="hidden" name="subfield" value="<!-- TMPL_VAR NAME="oldauthtypetagsubfield" -->">
86 <input type="hidden" name="field_value" value="<!-- TMPL_VAR NAME="authtypecode" -->">
89 <!-- TMPL_IF name="authid" -->
90 <input type="button" value="Save" onClick="Check(this.form)" accesskey="w">
92 <input type="button" value="Add authority" onClick="Check(this.form)" accesskey="w">
98 <script language="JavaScript" type="text/javascript">
99 function _(s) { return s } // dummy function for gettext
100 function active(numlayer)
102 for (i=0; i < 10 ; i++ ) {
106 document.getElementById(ong).style.visibility="visible";
108 document.getElementById(ong).style.visibility="hidden";
113 // Scan for nonempty fields
114 var field_is_nonempty_p = new Array();
115 for (i=0 ; i<f.field_value.length ; i++) {
116 field_is_nonempty_p[f.tag[i].value] = 0;
118 for (i=0 ; i<f.field_value.length ; i++) {
119 if (f.field_value[i].value.length != 0) {
120 field_is_nonempty_p[f.tag[i].value] += 1;
124 // Scan for missing mandatory subfields
125 var total_missing_mandatory_subfields = 0;
126 for (i=0 ; i<f.field_value.length-2 ; i++) {
127 if (f.field_value[i].value.length==0 && f.mandatory[i].value==1) {
128 // We should not flag an error unless the tag is also
129 // mandatory, or if something else in the tag is entered
131 if (f.tag_mandatory[i].value == 1 || field_is_nonempty_p[f.tag[i].value]) {
132 document.getElementById("error"+i).style.backgroundColor="#FF0000";
133 total_missing_mandatory_subfields++;
136 document.getElementById("error"+i).style.backgroundColor="#FFFFFF";
140 // Scan for missing mandatory tags
141 var total_missing_mandatory_tags = 0;
142 var seen_mandatory_tag_p = new Array();
143 for (i=0 ; i<f.field_value.length ; i++) {
144 var j = f.tag[i].value;
145 if (!field_is_nonempty_p[j] && f.tag_mandatory[i].value == 1) {
146 if (seen_mandatory_tag_p[j] != 1) {
147 seen_mandatory_tag_p[j] = 1;
148 total_missing_mandatory_tags++;
150 document.getElementById("error"+i).style.backgroundColor="#ffff00";
154 var total_errors = total_missing_mandatory_tags + total_missing_mandatory_subfields;
156 if (total_errors!=0) {
157 alertString2 = _("Form not submitted because of the following problem(s)");
158 alertString2 += "\n------------------------------------------------------------------------------------\n";
159 alertString2 += "\n- "+ total_missing_mandatory_tags +_(" mandatory tags empty");
160 alertString2 += "\n- "+ total_missing_mandatory_subfields +_(" mandatory fields empty (see bold subfields)");
163 document.forms['f'].submit();
166 function Dopop(link,i) {
167 defaultvalue=document.forms['f'].field_value[i].value;
168 newin=window.open(link+"&result="+defaultvalue,"value builder",'width=550,height=550,toolbar=false,scrollbars=yes');
171 function PopupZ3950() {
173 for (i=0 ; i<document.forms['f'].field_value.length ; i++) {
174 if (document.forms['f'].kohafield[i].value == "biblioitems.isbn" && document.forms['f'].field_value[i].value.length>0) {
175 strQuery += "&isbn="+document.forms['f'].field_value[i].value;
177 if (document.forms['f'].kohafield[i].value == "biblio.title" && document.forms['f'].field_value[i].value.length>0) {
178 strQuery += "&title="+document.forms['f'].field_value[i].value;
180 if (document.forms['f'].kohafield[i].value == "biblio.author" &&document.forms['f'].field_value[i].value.length>0) {
181 strQuery += "&author="+document.forms['f'].field_value[i].value;
183 if (document.forms['f'].kohafield[i].value == "biblioitems.issn" && document.forms['f'].field_value[i].value.length>0) {
184 strQuery += "&issn="+document.forms['f'].field_value[i].value;
187 newin=window.open("../z3950/search.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"+strQuery,"z3950search",'width=500,height=400,toolbar=false,scrollbars=yes');
190 function AddField(field,cntrepeatfield) {
191 document.forms['f'].op.value = "addfield";
192 document.forms['f'].addfield_field.value=field;
193 document.forms['f'].repeat_field.value=cntrepeatfield;
197 function cloneSubfield(index) {
198 var original = document.getElementById(index); //original <div>
199 var clone = original.cloneNode(true);
201 // set the attribute for the new 'div' subfields
202 clone.setAttribute('id',index + index);//set another id.
204 NumTabIndex = parseInt(original.getAttribute('tabindex'));
205 if(isNaN(NumTabIndex)) NumTabIndex = 0;
206 clone.setAttribute('tabindex',NumTabIndex+1);
210 CloneButtonPlus = clone.getElementsByTagName('a')[0];
211 CloneButtonPlus.setAttribute('onclick',"cloneSubfield('" + index + index + "')");
214 // do nothing if ButtonPlus & CloneButtonPlus don't exist.
217 // insert this line on the page
218 original.parentNode.insertBefore(clone,original.nextSibling);
221 function upSubfield(index) {
223 var line = document.getElementById(index); // get the line where the user has clicked.
227 var tag = line.parentNode; // get the dad of this line. (should be "<div tag=XXX>")
229 // getting all subfields for this tag
230 var subfields = tag.getElementsByTagName('div');
231 var subfieldsLength = subfields.length;
232 if(subfieldsLength<=1) return; // nothing to do if there is just one subfield.
233 // among all subfields
234 for(var i=0;i<subfieldsLength;i++){
235 if(subfields[i].getAttribute('id') == index){ //looking for the subfield which is clicked :
236 if(i==0){ // if the clicked subfield is on the top
237 tag.appendChild(subfields[0]);
240 var lineAbove = subfields[i-1];
241 tag.insertBefore(line,lineAbove);
248 function unHideSubfield(index,labelindex) {
249 subfield = document.getElementById(index);
250 subfield.style.display = 'block';
251 label = document.getElementById(labelindex);
252 label.style.display='none';
257 <!-- TMPL_INCLUDE name="intranet-bottom.inc" -->