View | Details | Raw Unified | Return to bug 7455
Collapse All | Expand All

(-)a/cataloguing/additem.pl (-3 / +3 lines)
Lines 244-250 sub generate_subfield_form { Link Here
244
		    my $change = index($javascript, 'function Change') > -1 ?
244
		    my $change = index($javascript, 'function Change') > -1 ?
245
		        "return Change$function_name($subfield_data{random}, '$subfield_data{id}');" :
245
		        "return Change$function_name($subfield_data{random}, '$subfield_data{id}');" :
246
		        'return 1;';
246
		        'return 1;';
247
                    $subfield_data{marc_value} = qq[<input $attributes
247
                    $subfield_data{marc_value} = qq[<input type="text" $attributes
248
                        onfocus="Focus$function_name($subfield_data{random}, '$subfield_data{id}');"
248
                        onfocus="Focus$function_name($subfield_data{random}, '$subfield_data{id}');"
249
			onchange=" $change"
249
			onchange=" $change"
250
                         onblur=" Blur$function_name($subfield_data{random}, '$subfield_data{id}');" />
250
                         onblur=" Blur$function_name($subfield_data{random}, '$subfield_data{id}');" />
Lines 252-258 sub generate_subfield_form { Link Here
252
                        $javascript];
252
                        $javascript];
253
                } else {
253
                } else {
254
                    warn "Plugin Failed: $plugin";
254
                    warn "Plugin Failed: $plugin";
255
                    $subfield_data{marc_value} = "<input $attributes />"; # supply default input form
255
                    $subfield_data{marc_value} = "<input type=\"text\" $attributes />"; # supply default input form
256
                }
256
                }
257
        }
257
        }
258
        elsif ( $tag eq '' ) {       # it's an hidden field
258
        elsif ( $tag eq '' ) {       # it's an hidden field
Lines 271-277 sub generate_subfield_form { Link Here
271
            $subfield_data{marc_value} = "<textarea $attributes_no_value>$value</textarea>\n";
271
            $subfield_data{marc_value} = "<textarea $attributes_no_value>$value</textarea>\n";
272
        } else {
272
        } else {
273
           # it's a standard field
273
           # it's a standard field
274
           $subfield_data{marc_value} = "<input $attributes />";
274
           $subfield_data{marc_value} = "<input type=\"text\" $attributes />";
275
        }
275
        }
276
        
276
        
277
        return \%subfield_data;
277
        return \%subfield_data;
(-)a/koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css (-2 / +8 lines)
Lines 50-57 div.tag { Link Here
50
}
50
}
51
51
52
div.subfield_line {
52
div.subfield_line {
53
	padding-bottom : .3em;
53
    padding-bottom: .3em;
54
    clear: both;
54
    float: left;
55
    clear: left;
56
    width: 100%;
55
}
57
}
56
58
57
div.subfield_line label {
59
div.subfield_line label {
Lines 63-68 div.subfield_line label { Link Here
63
    clear:left;
65
    clear:left;
64
}
66
}
65
67
68
.subfieldcode img {
69
    cursor: pointer;
70
}
71
66
.tag_title {
72
.tag_title {
67
	font-size : 90%;
73
	font-size : 90%;
68
	padding : .2em 0;
74
	padding : .2em 0;
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js (+463 lines)
Line 0 Link Here
1
/*
2
 * Unified file for catalogue edition
3
 */
4
5
/* Functions developed for addbiblio.tt and authorities.tt */
6
7
// returns the fieldcode based upon tag div id
8
function getFieldCode(tagDivId){
9
    // format : tag_<tagnumber>_...
10
    return tagDivId.substr(3+1,3);
11
}
12
13
//returns the field and subfieldcode based upon subfield div id
14
function getFieldAndSubfieldCode(subfieldDivId){
15
 // format : subfield<tagnumber><subfieldnumber>...
16
    return subfieldDivId.substr(8,3+1);
17
}
18
19
//returns the subfieldcode based upon subfieldid writing
20
function getSubfieldCode(tagsubfieldid){
21
    // 3 : tag +3 : tagnumber +4 : number of _ +8 subfield -1 begins at 0  
22
    return tagsubfieldid.substr(3+3+4+8-1,1);
23
}
24
25
// Take the base of tagsubfield information (removing the subfieldcodes and subfieldindexes)
26
// returns the filter
27
function getTagInputnameFilter(tagsubfieldid){
28
    var tagsubfield=tagsubfieldid.substr(0,tagsubfieldid.lastIndexOf("_"));  
29
    var tagcode=tagsubfield.substr(tagsubfield.lastIndexOf("_"));
30
    tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
31
    tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
32
    tagsubfield=tagsubfield+"_."+tagcode;
33
    return tagsubfield;  
34
}
35
36
function openAuth(tagsubfieldid,authtype) {
37
    // let's take the base of tagsubfield information (removing the indexes and the codes
38
    var element=document.getElementById(tagsubfieldid);
39
    var tagsubfield=getTagInputnameFilter(tagsubfieldid);
40
    var elementsubfcode=getSubfieldCode(element.name);
41
    var mainmainstring=element.value;
42
    var mainstring="";
43
    var inputs = element.parentNode.parentNode.getElementsByTagName("input");
44
45
    for (var myindex =0; myindex<inputs.length;myindex++){
46
        if (inputs[myindex].name && inputs[myindex].name.match(tagsubfield)){
47
            var subfieldcode=getSubfieldCode(inputs[myindex].name);
48
            if (isNaN(parseInt(subfieldcode)) && inputs[myindex].value != "" && subfieldcode!=elementsubfcode){
49
                mainstring=inputs[myindex].value+" "+mainstring;
50
            }      
51
        }
52
    }           
53
    newin=window.open("../authorities/auth_finder.pl?authtypecode="+  authtype+ "&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes');
54
}
55
56
function ExpandField(index) {
57
    var original = document.getElementById(index); //original <div>
58
    var divs = original.getElementsByTagName('div');
59
    for(var i=0,divslen = divs.length ; i<divslen ; i++){   // foreach div
60
        if(divs[i].getAttribute('id').match(/^subfield/)){  // if it s a subfield
61
            if (!divs[i].style.display) {
62
                // first time => show all subfields
63
                divs[i].style.display = 'block';
64
            } else if (divs[i].style.display == 'none') {
65
                // show
66
                divs[i].style.display = 'block';
67
            } else {
68
                // hide
69
                divs[i].style.display = 'none';
70
            }
71
        }
72
    }
73
}
74
/**
75
 * To clone a field
76
 * @param hideMarc '0' for false, '1' for true
77
 * @param advancedMARCEditor '0' for false, '1' for true
78
 */ 
79
function CloneField(index, hideMarc, advancedMARCEditor) {
80
    var original = document.getElementById(index); //original <div>
81
    var clone = original.cloneNode(true);
82
    var new_key = CreateKey();
83
    var new_id  = original.getAttribute('id')+new_key;
84
    
85
    clone.setAttribute('id',new_id); // setting a new id for the parent div
86
    
87
    var divs = clone.getElementsByTagName('div');
88
    
89
    if(hideMarc == '0') {
90
        // No indicator if hide_marc
91
        // setting a new name for the new indicator
92
        for(var i=0; i < 2; i++) {
93
            var indicator = clone.getElementsByTagName('input')[i];
94
            indicator.setAttribute('name',indicator.getAttribute('name')+new_key);
95
        }
96
    }
97
    
98
    // settings all subfields
99
    for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div
100
        if(divs[i].getAttribute("id").match(/^subfield/)){  // if it s a subfield
101
            
102
            // set the attribute for the new 'div' subfields
103
            divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
104
            
105
            var inputs   = divs[i].getElementsByTagName('input');
106
            var id_input = "";
107
            
108
            for( j = 0 ; j < inputs.length ; j++ ) {
109
                if(inputs[j].getAttribute("id") && inputs[j].getAttribute("id").match(/^tag_/) ){
110
                    inputs[j].value = "";
111
                }
112
            }
113
            
114
            inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
115
            inputs[0].setAttribute('name',inputs[0].getAttribute('name')+new_key);
116
            var id_input;
117
            try {
118
                id_input = inputs[1].getAttribute('id')+new_key;
119
                inputs[1].setAttribute('id',id_input);
120
                inputs[1].setAttribute('name',inputs[1].getAttribute('name')+new_key);
121
            } catch(e) {
122
                try{ // it s a select if it is not an input
123
                    var selects = divs[i].getElementsByTagName('select');
124
                    id_input = selects[0].getAttribute('id')+new_key;
125
                    selects[0].setAttribute('id',id_input);
126
                    selects[0].setAttribute('name',selects[0].getAttribute('name')+new_key);
127
                }catch(e2){ // it is a textarea if it s not a select or an input
128
                    var textaeras = divs[i].getElementsByTagName('textarea');
129
                    id_input = textaeras[0].getAttribute('id')+new_key;
130
                    textaeras[0].setAttribute('id',id_input);
131
                    textaeras[0].setAttribute('name',textaeras[0].getAttribute('name')+new_key);
132
                }
133
            }
134
            
135
            if (advancedMARCEditor == '0') {
136
                // when cloning a subfield, re set its label too.
137
                var labels = divs[i].getElementsByTagName('label');
138
                labels[0].setAttribute('for',id_input);
139
            }
140
            
141
            if(hideMarc == '0') {
142
                // updating javascript parameters on button up
143
                var imgs = divs[i].getElementsByTagName('img');
144
                imgs[0].setAttribute('onclick',"upSubfield(\'"+divs[i].getAttribute('id')+"\');");
145
            }
146
            
147
            // setting its '+' and '-' buttons
148
            try {
149
                var anchors = divs[i].getElementsByTagName('a');
150
                for (var j = 0; j < anchors.length; j++) {
151
                    if(anchors[j].getAttribute('class') == 'buttonPlus'){
152
                        anchors[j].setAttribute('onclick',"CloneSubfield('" + divs[i].getAttribute('id') + "','" + advancedMARCEditor + "'); return false;");
153
                    } else if (anchors[j].getAttribute('class') == 'buttonMinus') {
154
                        anchors[j].setAttribute('onclick',"UnCloneField('" + divs[i].getAttribute('id') + "'); return false;");
155
                    }
156
                }
157
            }
158
            catch(e){
159
                // do nothig if ButtonPlus & CloneButtonPlus don t exist.
160
            }
161
            
162
            // button ...
163
            var spans=0;
164
            try {
165
                spans = divs[i].getElementsByTagName('a');
166
            } catch(e) {
167
                // no spans
168
            }
169
            if(spans){
170
                var buttonDot;
171
                if(!CloneButtonPlus){ // it s impossible to have  + ... (buttonDot AND buttonPlus)
172
                    buttonDot = spans[0];
173
                    if(buttonDot){
174
                        // 2 possibilities :
175
                        try{
176
                            var buttonDotOnClick = buttonDot.getAttribute('onclick');
177
                            if(buttonDotOnClick.match('Clictag')){   // -1- It s a plugin
178
                                var re = /\('.*'\)/i;
179
                                buttonDotOnClick = buttonDotOnClick.replace(re,"('"+inputs[1].getAttribute('id')+"')");
180
                                if(buttonDotOnClick){
181
                                    buttonDot.setAttribute('onclick',buttonDotOnClick);
182
                                }
183
                            } else {
184
                                if(buttonDotOnClick.match('Dopop')) {  // -2- It's a auth value
185
                                    var re1 = /&index=.*',/;
186
                                    var re2 = /,.*\)/;
187
188
                                    buttonDotOnClick = buttonDotOnClick.replace(re1,"&index="+inputs[1].getAttribute('id')+"',");
189
                                    buttonDotOnClick = buttonDotOnClick.replace(re2,",'"+inputs[1].getAttribute('id')+"')");
190
                                    
191
                                    if(buttonDotOnClick){
192
                                            buttonDot.setAttribute('onclick',buttonDotOnClick);
193
                                    }
194
                                }
195
                            }
196
                            try {
197
                                // do not copy the script section.
198
                                var script = spans[0].getElementsByTagName('script')[0];
199
                                spans[0].removeChild(script);
200
                            } catch(e) {
201
                                // do nothing if there is no script
202
                            }
203
                        }catch(e){}
204
                    }
205
                }
206
            }
207
            if(hideMarc == '0') {
208
                var buttonUp = divs[i].getElementsByTagName('img')[0];
209
                buttonUp.setAttribute('onclick',"upSubfield('" + divs[i].getAttribute('id') + "')");
210
            }
211
            
212
        } else { // it's a indicator div
213
            if(divs[i].getAttribute('id').match(/^div_indicator/)){
214
                var inputs = divs[i].getElementsByTagName('input');
215
                inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
216
                inputs[1].setAttribute('id',inputs[1].getAttribute('id')+new_key);
217
                
218
                var CloneButtonPlus;
219
                try {
220
                    var anchors = divs[i].getElementsByTagName('a');
221
                    for (var j = 0; j < anchors.length; j++) {
222
                        if (anchors[j].getAttribute('class') == 'buttonPlus') {
223
                            anchors[j].setAttribute('onclick',"CloneField('" + new_id + "','" + hideMarc + "','" + advancedMARCEditor + "'); return false;");
224
                        } else if (anchors[j].getAttribute('class') == 'buttonMinus') {
225
                            anchors[j].setAttribute('onclick',"UnCloneField('" + new_id + "'); return false;");
226
                        } else if (anchors[j].getAttribute('class') == 'expandfield') {
227
                            anchors[j].setAttribute('onclick',"ExpandField('" + new_id + "'); return false;");
228
                        }
229
                    }
230
                }
231
                catch(e){
232
                    // do nothig CloneButtonPlus doesn't exist.
233
                }
234
235
            }
236
        }
237
    }
238
    
239
    // insert this line on the page
240
    original.parentNode.insertBefore(clone,original.nextSibling);
241
}
242
243
/**
244
 * To clone a subfield
245
 * @param index
246
 * @param advancedMARCEditor '0' for false, '1' for true
247
 */
248
function CloneSubfield(index, advancedMARCEditor){
249
    var original = document.getElementById(index); //original <div>
250
    var clone = original.cloneNode(true);
251
    var new_key = CreateKey();
252
    
253
    // set the attribute for the new 'div' subfields
254
    var inputs     = clone.getElementsByTagName('input');
255
    var selects    = clone.getElementsByTagName('select');
256
    var textareas  = clone.getElementsByTagName('textarea');
257
    var linkid;
258
259
    // input
260
    var id_input = "";
261
    for(var i=0,len=inputs.length; i<len ; i++ ){
262
        id_input = inputs[i].getAttribute('id')+new_key;
263
        inputs[i].setAttribute('id',id_input);
264
        inputs[i].setAttribute('name',inputs[i].getAttribute('name')+new_key);
265
        linkid = id_input;
266
    }
267
    
268
    // select 
269
    for(var i=0,len=selects.length; i<len ; i++ ){
270
        id_input = selects[i].getAttribute('id')+new_key;
271
        selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
272
        selects[i].setAttribute('name',selects[i].getAttribute('name')+new_key);
273
    }
274
    
275
    // textarea
276
    for(var i=0,len=textareas.length; i<len ; i++ ){
277
        id_input = textareas[i].getAttribute('id')+new_key;
278
        textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
279
        textareas[i].setAttribute('name',textareas[i].getAttribute('name')+new_key);
280
    }
281
282
    // Changing the "..." link's onclick attribute for plugin callback
283
    var links  = clone.getElementsByTagName('a');
284
    var link = links[0];
285
    var buttonDotOnClick = link.getAttribute('onclick');
286
    if(buttonDotOnClick.match('Clictag')){   // -1- It s a plugin
287
    var re = /\('.*'\)/i;
288
        buttonDotOnClick = buttonDotOnClick.replace(re,"('"+linkid+"')");
289
        if(buttonDotOnClick){
290
        link.setAttribute('onclick',buttonDotOnClick);
291
        }
292
    }
293
294
    if(advancedMARCEditor == '0') {
295
        // when cloning a subfield, reset its label too.
296
        var label = clone.getElementsByTagName('label')[0];
297
        label.setAttribute('for',id_input);
298
    }
299
    
300
    // setting a new id for the parent div    
301
    var new_id  = original.getAttribute('id')+new_key;
302
    clone.setAttribute('id',new_id);
303
    
304
    try {
305
        var buttonUp = clone.getElementsByTagName('img')[0];
306
        buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
307
        var anchors = clone.getElementsByTagName('a');
308
        if(anchors.length){
309
            for(var i = 0 ,lenanchors = anchors.length ; i < lenanchors ; i++){
310
                if(anchors[i].getAttribute('class') == 'buttonPlus'){
311
                    anchors[i].setAttribute('onclick',"CloneSubfield('" + new_id + "','" + advancedMARCEditor + "'); return false;");
312
                } else if (anchors[i].getAttribute('class') == 'buttonMinus') {
313
                    anchors[i].setAttribute('onclick',"UnCloneField('" + new_id + "'); return false;");
314
                }
315
            }
316
        }
317
    }
318
    catch(e){
319
        // do nothig if ButtonPlus & CloneButtonPlus don't exist.
320
    }
321
    // insert this line on the page
322
    original.parentNode.insertBefore(clone,original.nextSibling);
323
}
324
325
 /**
326
 * This function removes or clears unwanted subfields
327
 */
328
function UnCloneField(index) {
329
    var original = document.getElementById(index);
330
    var canUnclone = false;
331
    if ($(original).hasClass("tag")) {
332
        // unclone a field, check if there will remain one field
333
        var fieldCode = getFieldCode(index);
334
        // tag divs with id begining with original field code
335
        var cloneFields = $('.tag[id^="tag_'+fieldCode+'"]');
336
        if (cloneFields.length > 1) {
337
            canUnclone = true;
338
        }
339
    } else {
340
        // unclone a subfield, check if there will remain one subfield
341
        var subfieldCode = getFieldAndSubfieldCode(index);
342
        // subfield divs with id begining with original field and subfield field code
343
        var cloneSubfields = $('.subfield_line[id^="subfield'+subfieldCode+'"]');
344
        if (cloneSubfields.length > 1) {
345
            canUnclone = true;
346
        }
347
    }
348
    if (canUnclone) {
349
        // remove clone
350
        original.parentNode.removeChild(original);
351
    } else {
352
        // clear inputs, but don't delete
353
        $(":input.input_marceditor", original).each(function(){
354
            // thanks to http://www.learningjquery.com/2007/08/clearing-form-data for
355
            // hint about clearing selects correctly
356
            var type = this.type;
357
            var tag = this.tagName.toLowerCase();
358
            if (type == 'text' || type == 'password' || tag == 'textarea') {
359
                this.value = "";
360
            } else if (type == 'checkbox' || type == 'radio') {
361
                this.checked = false;
362
            } else if (tag == 'select') {
363
                this.selectedIndex = -1;
364
            }
365
        });
366
        $(":input.indicator", original).val("");
367
    }
368
}
369
370
/**
371
 * This function create a random number
372
 */
373
function CreateKey(){
374
    return parseInt(Math.random() * 100000);
375
}
376
377
/**
378
 * This function allows to move a subfield up by clickink on the 'up' button .
379
 */
380
function upSubfield(index) {
381
    try{
382
        var line = document.getElementById(index); // get the line where the user has clicked.
383
    } catch(e) {
384
        return; // this line doesn't exist...
385
    }
386
    var tag = line.parentNode; // get the dad of this line. (should be "<div id='tag_...'>")
387
    
388
    // getting all subfields for this tag
389
    var subfields = tag.getElementsByTagName('div');
390
    var subfieldsLength = subfields.length;
391
    
392
    if(subfieldsLength<=1) return; // nothing to do if there is just one subfield.
393
    
394
    // among all subfields 
395
    for(var i=0;i<subfieldsLength;i++){ 
396
        if(subfields[i].getAttribute('id') == index){ //looking for the subfield which is clicked :
397
            if(i==1){ // if the clicked subfield is on the top
398
                tag.appendChild(subfields[1]);
399
                return;
400
            } else {
401
                var lineAbove = subfields[i-1];
402
                tag.insertBefore(line,lineAbove);
403
                return;
404
            }
405
        }
406
    }
407
}
408
409
// FIXME :: is it used ?
410
function unHideSubfield(index,labelindex) {
411
    subfield = document.getElementById(index);
412
    subfield.style.display = 'block';
413
    label = document.getElementById(labelindex);
414
    label.style.display='none'; 
415
}
416
417
/* Functions developed for additem.tt */
418
419
/**
420
 * To clone a subfield.<br>
421
 * @param original subfield div to clone
422
 */
423
function CloneItemSubfield(original){
424
    var clone = original.cloneNode(true);
425
    var new_key = CreateKey();
426
427
    // set the attribute for the new 'div' subfields
428
    var inputs     = clone.getElementsByTagName('input');
429
    var selects    = clone.getElementsByTagName('select');
430
    var textareas  = clone.getElementsByTagName('textarea');
431
432
    // input (except hidden type)
433
    var id_input = "";
434
    for(var i=0,len=inputs.length; i<len ; i++ ){
435
        if (inputs[i].getAttribute('type') != 'hidden') {
436
            id_input = inputs[i].getAttribute('id')+new_key;
437
            inputs[i].setAttribute('id',id_input);
438
        }
439
    }
440
441
    // select
442
    for(var i=0,len=selects.length; i<len ; i++ ){
443
        id_input = selects[i].getAttribute('id')+new_key;
444
        selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
445
    }
446
447
    // textarea
448
    for(var i=0,len=textareas.length; i<len ; i++ ){
449
        id_input = textareas[i].getAttribute('id')+new_key;
450
        textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
451
    }
452
453
    // when cloning a subfield, reset its label too.
454
    var label = clone.getElementsByTagName('label')[0];
455
    label.setAttribute('for',id_input);
456
457
    // setting a new if for the parent div
458
    var new_id = original.getAttribute('id')+new_key;
459
    clone.setAttribute('id',new_id);
460
    
461
    // insert this line on the page
462
    original.parentNode.insertBefore(clone,original.nextSibling);
463
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt (-512 / +144 lines)
Lines 2-37 Link Here
2
<title>Koha &rsaquo; Authorities &rsaquo; [% IF ( authid ) %]Modify authority #[% authid %] ([% authtypetext %])[% ELSE %]Adding authority ([% authtypetext %])[% END %]</title>
2
<title>Koha &rsaquo; Authorities &rsaquo; [% IF ( authid ) %]Modify authority #[% authid %] ([% authtypetext %])[% ELSE %]Adding authority ([% authtypetext %])[% END %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
3
[% INCLUDE 'doc-head-close.inc' %]
4
<script type="text/javascript" src="[% themelang %]/lib/yui/plugins/bubbling-min.js"></script>
4
<script type="text/javascript" src="[% themelang %]/lib/yui/plugins/bubbling-min.js"></script>
5
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
5
6
6
<script type="text/javascript">
7
<script type="text/javascript">
7
//<![CDATA[
8
//<![CDATA[
8
9
9
     var fields_in_use = {};
10
	 $(document).ready(function() {
10
	 $(document).ready(function() {
11
        $('#authoritytabs').tabs();
11
        $('#authoritytabs').tabs();
12
        $('.tag').each(function() {
12
        
13
            var field_id = this.getAttribute('id').substring(0, 7);
14
            if (field_id in fields_in_use) {
15
                fields_in_use[field_id]++;
16
            } else {
17
                fields_in_use[field_id] = 1;
18
            }
19
        });
20
        $('.subfield_line').each(function() {
21
            var field_id = this.getAttribute('id').substring(0, 12);
22
            if (field_id in fields_in_use) {
23
                fields_in_use[field_id]++;
24
            } else {
25
                fields_in_use[field_id] = 1;
26
            }
27
        });
28
		$("#f").submit(function(){
13
		$("#f").submit(function(){
29
			return $(this).Check();
14
			return $(this).Check();
30
		});
15
		});
31
	 });
16
	 });
32
17
33
/**
18
/**
34
 * check if mandatory subfields are writed
19
 * check if mandatory subfields are written
35
 */
20
 */
36
function AreMandatoriesNotOk(){
21
function AreMandatoriesNotOk(){
37
    var mandatories = new Array();
22
    var mandatories = new Array();
Lines 75-81 function AreMandatoriesNotOk(){ Link Here
75
	    	for(var j=0,len2=eleminputs.length; j<len2; j++){
60
	    	for(var j=0,len2=eleminputs.length; j<len2; j++){
76
	
61
	
77
	    		if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
62
	    		if(eleminputs[j].name.match(varegexp) && eleminputs[j].value){
78
					/* tag_801_subfield_c_841304_545657 */
79
					inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
63
					inputregexp = new RegExp("^tag_" + arr[0] + "_subfield_" + eleminputs[j].value + "_" + arr[2]);
80
					
64
					
81
					for( var k=0; k<len2; k++){
65
					for( var k=0; k<len2; k++){
Lines 118-161 function Check(){ Link Here
118
    }
102
    }
119
}
103
}
120
104
121
122
// returns the subfieldcode based upon subfieldid writing
123
function getSubfieldcode(tagsubfieldid){
124
    // 3 : tag +3 : tagnumber +4 : number of _ +8 subfield -1 begins at 0  
125
    return tagsubfieldid.substr(3+3+4+8-1,1);
126
}
127
128
// Take the base of tagsubfield information (removing the subfieldcodes and subfieldindexes)
129
// returns the filter
130
function getTagInputnameFilter(tagsubfieldid){
131
    var tagsubfield=tagsubfieldid.substr(0,tagsubfieldid.lastIndexOf("_"));  
132
    var tagcode=tagsubfield.substr(tagsubfield.lastIndexOf("_"));
133
    tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
134
    tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
135
    tagsubfield=tagsubfield+"_."+tagcode;
136
    return tagsubfield;  
137
}
138
139
function openAuth(tagsubfieldid,authtype) {
140
    // let's take the base of tagsubfield information (removing the indexes and the codes
141
    var element=document.getElementById(tagsubfieldid);
142
    var tagsubfield=getTagInputnameFilter(tagsubfieldid);
143
    var elementsubfcode=getSubfieldcode(element.name);
144
    var mainmainstring=element.value;
145
    var mainstring="";  
146
    var inputs = element.parentNode.parentNode.getElementsByTagName("input");
147
148
    for (var myindex =0; myindex<inputs.length;myindex++){
149
        if (inputs[myindex].name && inputs[myindex].name.match(tagsubfield)){
150
            var subfieldcode=getSubfieldcode(inputs[myindex].name);
151
            if (isNaN(parseInt(subfieldcode)) && inputs[myindex].value != "" && subfieldcode!=elementsubfcode){
152
                mainstring=inputs[myindex].value+" "+mainstring;
153
            }      
154
        }
155
    }           
156
	newin=window.open("../authorities/auth_finder.pl?authtypecode="+  authtype+ "&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes');
157
}
158
159
function AddField(field,cntrepeatfield) {
105
function AddField(field,cntrepeatfield) {
160
    document.forms['f'].op.value = "addfield";
106
    document.forms['f'].op.value = "addfield";
161
    document.forms['f'].addfield_field.value=field;
107
    document.forms['f'].addfield_field.value=field;
Lines 163-497 function AddField(field,cntrepeatfield) { Link Here
163
    document.f.submit();
109
    document.f.submit();
164
}
110
}
165
111
166
167
function ExpandField(index) {
168
    var original = document.getElementById(index); //original <div>
169
    var divs = original.getElementsByTagName('div');
170
    for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div
171
        if(divs[i].getAttribute("name") == 'line'){  // if it s a subfield
172
            if (divs[i].style.display == 'block') {
173
                divs[i].style.display = 'none';
174
            } else {
175
                divs[i].style.display = 'block';
176
            }
177
        }
178
    }
179
}
180
181
/**
182
 * To clone a field or a subfield by clickink on '+' button
183
 */ 
184
function CloneField(index) {
185
    var original = document.getElementById(index); //original <div>
186
    fields_in_use[index.substr(0, 7)]++;
187
    var clone = original.cloneNode(true);
188
    var new_key = CreateKey();
189
    var new_id  = original.getAttribute('id')+new_key;
190
    
191
    clone.setAttribute('id',new_id); // setting a new id for the parent div
192
    
193
    var divs = clone.getElementsByTagName('div');
194
    
195
    [% UNLESS ( hide_marc ) %] // No indicator if hide_marc
196
        // setting a new name for the new indicator
197
        for(var i=0; i < 2; i++) {
198
            var indicator = clone.getElementsByTagName('input')[i];
199
            indicator.setAttribute('name',indicator.getAttribute('name')+new_key);
200
        }
201
    [% END %]
202
        
203
    // settings all subfields
204
    for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div
205
        if(divs[i].getAttribute("name") == 'line'){  // if it s a subfield
206
            
207
            // set the attribute for the new 'div' subfields
208
            divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
209
            
210
            var inputs   = divs[i].getElementsByTagName('input');
211
            var id_input = "";
212
            
213
            inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
214
            inputs[0].setAttribute('name',inputs[0].getAttribute('name')+new_key);
215
            var id_input;
216
            try {
217
              id_input = inputs[1].getAttribute('id')+new_key;
218
                inputs[1].setAttribute('id',id_input);
219
                inputs[1].setAttribute('name',inputs[1].getAttribute('name')+new_key);
220
            } catch(e) {
221
              try{ // it s a select if it is not an input
222
                    var selects = divs[i].getElementsByTagName('select');
223
                    id_input = selects[0].getAttribute('id')+new_key;
224
                    selects[0].setAttribute('id',id_input);
225
                    selects[0].setAttribute('name',selects[0].getAttribute('name')+new_key);
226
                }catch(e2){ // it is a textarea if it s not a select or an input
227
                  var textaeras = divs[i].getElementsByTagName('textarea');
228
                  id_input = textaeras[0].getAttribute('id')+new_key;
229
                  textaeras[0].setAttribute('id',id_input);
230
                    textaeras[0].setAttribute('name',textaeras[0].getAttribute('name')+new_key);
231
                }
232
            }
233
            
234
            [% UNLESS ( advancedMARCEditor ) %]
235
            // when cloning a subfield, re set its label too.
236
            var labels = divs[i].getElementsByTagName('label');
237
            labels[0].setAttribute('for',id_input);
238
            [% END %]
239
            
240
            [% UNLESS ( hide_marc ) %]
241
                // updating javascript parameters on button up
242
                var imgs = divs[i].getElementsByTagName('img');
243
                imgs[0].setAttribute('onclick',"upSubfield(\'"+divs[i].getAttribute('id')+"\');");
244
            [% END %]
245
            
246
            // setting its '+' and '-' buttons
247
            try {
248
                var spans = divs[i].getElementsByTagName('span');
249
                for (var j = 0; j < spans.length; j++) {
250
                    if(spans[j].getAttribute('class') == 'buttonPlus'){
251
                        spans[j].setAttribute('onclick',"CloneSubfield('" + divs[i].getAttribute('id') + "')");
252
                    } else if (spans[j].getAttribute('class') == 'buttonMinus') {
253
                        spans[j].setAttribute('onclick',"UnCloneField('" + divs[i].getAttribute('id') + "')");
254
                    }
255
                }
256
            }
257
            catch(e){
258
                // do nothig if ButtonPlus & CloneButtonPlus don t exist.
259
            }
260
            
261
            // button ...
262
            var spans=0;
263
            try {
264
                spans = divs[i].getElementsByTagName('span');
265
            } catch(e) {
266
                // no spans
267
            }
268
            if(spans){
269
                var buttonDot;
270
                if(!CloneButtonPlus){ // it s impossible to have  + ... (buttonDot AND buttonPlus)
271
                    buttonDot = spans[0];
272
                    if(buttonDot){
273
                        // 2 possibilities :
274
                        try{
275
                            var buttonDotOnClick = buttonDot.getAttribute('onclick');
276
                            if(buttonDotOnClick.match('Clictag')){   // -1- It s a plugin
277
                                var re = /\('.*'\)/i;
278
                                buttonDotOnClick = buttonDotOnClick.replace(re,"('"+inputs[1].getAttribute('id')+"')");
279
                                if(buttonDotOnClick){
280
                                    buttonDot.setAttribute('onclick',buttonDotOnClick);
281
                                }
282
                            } else {
283
                                if(buttonDotOnClick.match('Dopop')) {  // -2- It's a auth value
284
                                    
285
                                    var re1 = /&index=.*',/;
286
                                    var re2 = /,.*\)/;
287
288
                                    buttonDotOnClick = buttonDotOnClick.replace(re1,"&index="+inputs[1].getAttribute('id')+"',");
289
                                    buttonDotOnClick = buttonDotOnClick.replace(re2,",'"+inputs[1].getAttribute('id')+"')");
290
                                    
291
                                    if(buttonDotOnClick){
292
                                            buttonDot.setAttribute('onclick',buttonDotOnClick);
293
                                    }
294
                                }
295
                            }
296
                            try {
297
                              // do not copy the script section.
298
                              var script = spans[0].getElementsByTagName('script')[0];
299
                              spans[0].removeChild(script);
300
                            } catch(e) {
301
                              // do nothing if there is no script
302
                            }
303
                      }catch(e){}
304
                  }
305
                }
306
            }
307
            [% UNLESS ( hide_marc ) %]
308
                var buttonUp = divs[i].getElementsByTagName('img')[0];
309
                buttonUp.setAttribute('onclick',"upSubfield('" + divs[i].getAttribute('id') + "')");
310
            [% END %]
311
            
312
        } else { // it's a indicator div
313
            if(divs[i].getAttribute('name') == 'div_indicator'){
314
                var inputs = divs[i].getElementsByTagName('input');
315
                inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
316
                inputs[1].setAttribute('id',inputs[1].getAttribute('id')+new_key);
317
                
318
                var CloneButtonPlus;
319
                try {
320
                    var anchors = divs[i].getElementsByTagName('span');
321
                    for (var j = 0; j < anchors.length; j++) {
322
                        if (anchors[j].getAttribute('class') == 'buttonPlus') {
323
                            anchors[j].setAttribute('onclick',"CloneField('" + new_id + "')");
324
                        } else if (anchors[j].getAttribute('class') == 'buttonMinus') {
325
                            anchors[j].setAttribute('onclick',"UnCloneField('" + new_id + "')");
326
                        }
327
                    }
328
                }
329
                catch(e){
330
                    // do nothig CloneButtonPlus doesn't exist.
331
                }
332
                
333
                // setting its 'Expand' property
334
                var ExpandFieldA=0;
335
                try {
336
                    ExpandFieldA = divs[i].getElementsByTagName('a')[0];
337
                    ExpandFieldA.setAttribute('onclick',"ExpandField('" + divs[i].parentNode.getAttribute('id') + "')");
338
                }
339
                catch(e){
340
                    // do nothig if ButtonPlus & CloneButtonPlus don t exist.
341
                }
342
                
343
            }
344
        }
345
    }
346
    
347
    // insert this line on the page
348
    original.parentNode.insertBefore(clone,original.nextSibling);
349
}
350
351
function CloneSubfield(index){
352
    var original = document.getElementById(index); //original <div>
353
    fields_in_use[index.substr(0, 12)]++;
354
    var clone = original.cloneNode(true);
355
    var new_key = CreateKey();
356
    var new_id  = original.getAttribute('id')+new_key;
357
    
358
    // set the attribute for the new 'div' subfields
359
    var inputs     = clone.getElementsByTagName('input');
360
    var selects    = clone.getElementsByTagName('select');
361
    var textareas  = clone.getElementsByTagName('textarea');
362
        
363
    // input
364
    var id_input = "";
365
    for(var i=0,len=inputs.length; i<len ; i++ ){
366
        id_input = inputs[i].getAttribute('id')+new_key;
367
        inputs[i].setAttribute('id',id_input);
368
        inputs[i].setAttribute('name',inputs[i].getAttribute('name')+new_key);
369
    }
370
    
371
    // select 
372
    for(var i=0,len=selects.length; i<len ; i++ ){
373
        id_input = selects[i].getAttribute('id')+new_key;
374
        selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
375
        selects[i].setAttribute('name',selects[i].getAttribute('name')+new_key);
376
    }
377
    
378
    // textarea
379
    for(var i=0,len=textareas.length; i<len ; i++ ){
380
        id_input = textareas[i].getAttribute('id')+new_key;
381
        textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
382
        textareas[i].setAttribute('name',textareas[i].getAttribute('name')+new_key);
383
    }
384
    
385
    [% UNLESS ( advancedMARCEditor ) %]
386
    // when cloning a subfield, reset its label too.
387
    var label = clone.getElementsByTagName('label')[0];
388
    label.setAttribute('for',id_input);
389
    [% END %]
390
    
391
    // setting a new if for the parent div
392
    clone.setAttribute('id',new_id);
393
    
394
    try {
395
      var buttonUp = clone.getElementsByTagName('img')[0];
396
      buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
397
      var spans = clone.getElementsByTagName('span');
398
      if(spans.length){
399
          for(var i = 0 ,lenspans = spans.length ; i < lenspans ; i++){
400
            if(spans[i].getAttribute('class') == 'buttonPlus'){
401
                    spans[i].setAttribute('onclick',"CloneSubfield('" + new_id + "')");
402
                } else if (spans[i].getAttribute('class') == 'buttonMinus') {
403
                    spans[i].setAttribute('onclick',"UnCloneField('" + new_id + "')");
404
                }
405
            }
406
        }
407
    }
408
    catch(e){
409
        // do nothig if ButtonPlus & CloneButtonPlus don't exist.
410
    }
411
    // insert this line on the page
412
    original.parentNode.insertBefore(clone,original.nextSibling);
413
}
414
415
 /**
416
 * This function removes or clears unwanted subfields
417
 */
418
function UnCloneField(index) {
419
    var original = document.getElementById(index);
420
    var field_id;
421
    if (index.match("tag")) {
422
        field_id = index.substr(0, 7);
423
    } else {
424
        field_id = index.substr(0, 12);
425
    }
426
    if (1 == fields_in_use[field_id]) {
427
        // clear inputs, but don't delete
428
        $(":input.input_marceditor", original).each(function(){
429
            // thanks to http://www.learningjquery.com/2007/08/clearing-form-data for
430
            // hint about clearing selects correctly
431
            var type = this.type;
432
            var tag = this.tagName.toLowerCase();
433
            if (type == 'text' || type == 'password' || tag == 'textarea') {
434
                this.value = "";
435
            } else if (type == 'checkbox' || type == 'radio') {
436
                this.checked = false;
437
            } else if (tag == 'select') {
438
                this.selectedIndex = -1;
439
            }
440
        });
441
        $(":input.indicator", original).val("");
442
    } else {
443
        original.parentNode.removeChild(original);
444
        fields_in_use[field_id]--;
445
    }
446
}
447
448
449
/**
450
 * This function create a random number
451
 */
452
function CreateKey(){
453
    return parseInt(Math.random() * 100000);
454
}
455
456
/**
457
 * This function allows to move a subfield up by clickink on the 'up' button .
458
 */
459
function upSubfield(index) {
460
    try{
461
        var line = document.getElementById(index); // get the line where the user has clicked.
462
    } catch(e) {
463
        return; // this line doesn't exist...
464
    }
465
    var tag = line.parentNode; // get the dad of this line. (should be "<div id='tag_...'>")
466
    
467
    // getting all subfields for this tag
468
    var subfields = tag.getElementsByTagName('div');
469
    var subfieldsLength = subfields.length;
470
    
471
    if(subfieldsLength<=1) return; // nothing to do if there is just one subfield.
472
    
473
    // among all subfields 
474
    for(var i=0;i<subfieldsLength;i++){ 
475
        if(subfields[i].getAttribute('id') == index){ //looking for the subfield which is clicked :
476
            if(i==1){ // if the clicked subfield is on the top
477
                tag.appendChild(subfields[1]);
478
                return;
479
            } else {
480
                var lineAbove = subfields[i-1];
481
                tag.insertBefore(line,lineAbove);
482
                return;
483
            }
484
        }
485
    }
486
}
487
488
function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
489
    subfield = document.getElementById(index);
490
    subfield.style.display = 'block';
491
    label = document.getElementById(labelindex);
492
    label.style.display='none'; 
493
}
494
495
function addauthority() {
112
function addauthority() {
496
    X = document.forms[0].authtype.value;
113
    X = document.forms[0].authtype.value;
497
    window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X;
114
    window.location="/cgi-bin/koha/authorities/authorities.pl?authtypecode="+X;
Lines 590-739 function searchauthority() { Link Here
590
	<ul class="toolbar"><li id="addauthc"><input id="addauth" type="submit" value="Save" accesskey="w" /></li></ul></div>
207
	<ul class="toolbar"><li id="addauthc"><input id="addauth" type="submit" value="Save" accesskey="w" /></li></ul></div>
591
208
592
<div id="authoritytabs" class="toptabs numbered">
209
<div id="authoritytabs" class="toptabs numbered">
593
       <ul> [% FOREACH BIG_LOO IN BIG_LOOP %]
210
    <ul>
594
            <li>[% IF ( BIG_LOO.number ) %]
211
        [% FOREACH BIG_LOO IN BIG_LOOP %]
595
                <a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>
212
        <li><a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a></li>
596
            [% ELSE %]
213
        [% END %]
597
                <a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>
214
    </ul>
598
            [% END %]</li>
599
        [% END %]</ul>
600
215
601
[% FOREACH BIG_LOO IN BIG_LOOP %]
216
[% FOREACH BIG_LOO IN BIG_LOOP %]
602
    <!-- hide every tab except the 1st -->
217
    <div id="tab[% BIG_LOO.number %]XX">
603
            [% IF ( BIG_LOO.number ) %]
218
    
604
                <div id="tab[% BIG_LOO.number %]XX">
219
    [% FOREACH innerloo IN BIG_LOO.innerloop %]
220
    [% IF ( innerloo.tag ) %]
221
    <div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
222
        <div class="tag_title" id="div_indicator_tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
223
        [% UNLESS hide_marc %]
224
            [% IF advancedMARCEditor %]
225
                <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>
605
            [% ELSE %]
226
            [% ELSE %]
606
                <div id="tab[% BIG_LOO.number %]XX">
227
                <span title="[% innerloo.tag_lib %]">[% innerloo.tag %]</span>
607
            [% END %]
228
            [% END %]
608
        
229
                [% IF ( innerloo.fixedfield ) %]
609
        [% FOREACH innerloo IN BIG_LOO.innerloop %]
230
                    <input type="text"
610
            [% IF ( innerloo.tag ) %]
231
                        tabindex="1"
611
                <div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
232
                        class="indicator flat"
612
                <div class="tag_title" name="div_indicator">
233
                        style="display:none;"
613
                [% UNLESS ( innerloo.hide_marc ) %]
234
                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
614
		    [% IF ( innerloo.advancedMARCEditor ) %]
235
                        size="1"
615
                    <a class="tagnum" onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]')">[% innerloo.tag %]</a>
236
                        maxlength="1"
616
		    [% ELSE %]
237
                        value="[% innerloo.indicator1 %]" />
617
                    <span title="[% innerloo.tag_lib %]">[% innerloo.tag %]</span>
238
                    <input type="text"
618
		    [% END %]
239
                        tabindex="1"
619
                    [% IF ( innerloo.fixedfield ) %]
240
                        class="indicator flat"
620
                    <input class="indicator flat"
241
                        style="display:none;"
621
                                type="text"
242
                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
622
                                style="display:none;"
243
                        size="1"
623
                                name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
244
                        maxlength="1"
624
                                size="1"
245
                        value="[% innerloo.indicator2 %]" />
625
                                maxlength="1"
626
                                value="[% innerloo.indicator1 %]" />
627
                    <input class="indicator flat"
628
                                type="text"
629
                                style="display:none;"
630
                                name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
631
                                size="1"
632
                                maxlength="1"
633
                                value="[% innerloo.indicator2 %]" />
634
                    [% ELSE %]
635
                    <input class="indicator flat"
636
                                type="text"
637
                                name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
638
                                size="1"
639
                                maxlength="1"
640
                                value="[% innerloo.indicator1 %]" />
641
                    <input class="indicator flat"
642
                                type="text"
643
                                name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
644
                                size="1"
645
                                maxlength="1"
646
                                value="[% innerloo.indicator2 %]" />
647
                    [% END %] -
648
                [% ELSE %]
246
                [% ELSE %]
649
                    [% IF ( innerloo.fixedfield ) %]
247
                    <input type="text"
650
                        <input type="hidden"
248
                        tabindex="1"
651
                            name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %]"
249
                        class="indicator flat"
652
                            value="[% innerloo.indicator1 %][% innerloo.random %]" />
250
                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
653
                        <input type="hidden"
251
                        size="1"
654
                            name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %]"
252
                        maxlength="1"
655
                            value="[% innerloo.indicator2 %][% innerloo.random %]" />
253
                        value="[% innerloo.indicator1 %]" />
656
                    [% ELSE %]
254
                    <input type="text"
657
                        <input type="hidden"
255
                        tabindex="1"
658
                            name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %]"
256
                        class="indicator flat"
659
                            value="[% innerloo.indicator1 %][% innerloo.random %]" />
257
                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
660
                        <input type="hidden"
258
                        size="1"
661
                            name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %]"
259
                        maxlength="1"
662
                            value="[% innerloo.indicator2 %][% innerloo.random %]" />
260
                        value="[% innerloo.indicator2 %]" />
663
                    [% END %]
261
                [% END %] -
664
                [% END %]
262
        [% ELSE %]
665
    
263
                [% IF ( innerloo.fixedfield ) %]
666
                [% UNLESS ( innerloo.advancedMARCEditor ) %]
264
                    <input type="hidden"
667
                    <a onclick="ExpandField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]')">[% innerloo.tag_lib %]</a>
265
                        tabindex="1"
266
                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
267
                        value="[% innerloo.indicator1 %]" />
268
                    <input type="hidden"
269
                        tabindex="1"
270
                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
271
                        value="[% innerloo.indicator2 %]" />
272
                [% ELSE %]
273
                    <input type="hidden"
274
                        tabindex="1"
275
                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
276
                        value="[% innerloo.indicator1 %]" />
277
                    <input type="hidden"
278
                        tabindex="1"
279
                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
280
                        value="[% innerloo.indicator2 %]" />
668
                [% END %]
281
                [% END %]
282
        [% END %]
283
284
            [% UNLESS advancedMARCEditor %]
285
                <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>
286
            [% END %]
287
                <span class="field_controls">
669
                [% IF ( innerloo.repeatable ) %]
288
                [% IF ( innerloo.repeatable ) %]
670
                    <span class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]')">+</span>
289
                    <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]','[% hide_marc %]','[% advancedMARCEditor %]'); return false;" title="Repeat this Tag">
290
                        <img src="/intranet-tmpl/prog/img/repeat-tag.png" alt="Repeat this Tag" />
291
                    </a>
671
                [% END %]
292
                [% END %]
672
                [% UNLESS ( innerloo.mandatory ) %]
293
                    <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Delete this Tag">
673
                    <span class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]')">&#8722;</span>
294
                        <img src="/intranet-tmpl/prog/img/delete-tag.png" alt="Delete this Tag" />
295
                    </a>
296
                </span>
297
        
298
        </div>
299
        
300
        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
301
            <!--  One line on the marc editor -->
302
            <div class="subfield_line" style="[% subfield_loo.visibility %]" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]">
303
            
304
                [% UNLESS advancedMARCEditor %]
305
                    [% 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">
306
                    [% ELSE %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield">
307
                    [% END %]
674
                [% END %]
308
                [% END %]
675
                
309
                
676
            </div>
310
                [% UNLESS hide_marc %]
677
    
311
                <span class="subfieldcode">
678
            [% FOREACH subfield_loo IN innerloo.subfield_loop %]
679
                <!--  One line on the marc editor -->
680
                <div name="line" class="subfield_line" style="[% subfield_loo.visibility %];" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %]">
681
                
682
                    [% UNLESS ( subfield_loo.advancedMARCEditor ) %]
683
                        [% 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" >
684
                        [% ELSE %] <label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield" >[% END %]
685
                    [% END %] 
686
                    
687
                    [% UNLESS ( subfield_loo.hide_marc ) %]
688
                    [% IF ( subfield_loo.fixedfield ) %]
312
                    [% IF ( subfield_loo.fixedfield ) %]
689
                        <img class="buttonUp" style="display:none;" src="[% themelang %]/../img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %]')" alt="Move Up" title="Move Up" />
313
                        <img class="buttonUp" style="display:none;" src="/intranet-tmpl/prog/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
690
                    [% ELSE %]
314
                    [% ELSE %]
691
                        <img class="buttonUp"  src="[% themelang %]/../img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %]')" alt="Move Up" title="Move Up" />
315
                        <img class="buttonUp" src="/intranet-tmpl/prog/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
692
                        [% END %]
693
                            <input title="[% subfield_loo.marc_lib_plain %]"
694
                                style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;" type="text"
695
                                name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
696
                                value="[% subfield_loo.subfield %]"
697
                                size="1"
698
                                maxlength="1"
699
                                class="flat"
700
                                tabindex="0" />
701
                    [% ELSE %]
702
                        <input type="hidden"
703
                            name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
704
                            value="[% subfield_loo.subfield %]"/>
705
                    [% END %]
316
                    [% END %]
317
                        <input type="text"
318
                            title="[% subfield_loo.marc_lib_plain %]"
319
                            style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
320
                            name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
321
                            value="[% subfield_loo.subfield %]"
322
                            size="1"
323
                            maxlength="1"
324
                            class="flat"
325
                            tabindex="0" />
326
                </span>
327
                [% ELSE %]
328
                    <input type="hidden"
329
                        name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
330
                        value="[% subfield_loo.subfield %]" />
331
                [% END %]
332
            
333
                [% UNLESS advancedMARCEditor %]
334
                    [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %]
335
                        [% subfield_loo.marc_lib_plain %]
336
                        [% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %]
337
                    </span>
338
                    </label>
339
                [% END %]
706
                
340
                
707
                    [% UNLESS ( subfield_loo.advancedMARCEditor ) %]
341
                [% subfield_loo.marc_value %]
708
                        [% IF ( subfield_loo.mandatory ) %]<span class="subfield_mandatory">[% END %]
342
                
709
                            [% subfield_loo.marc_lib %]
343
                <span class="subfield_controls">
710
                        [% IF ( subfield_loo.mandatory ) %]</span>[% END %]
344
                [% IF ( subfield_loo.repeatable ) %]
711
                        </label>
345
                    <a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]','[% advancedMARCEditor %]'); return false;">
712
                    [% END %]
346
                        <img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
713
                    
347
                    </a>
714
                    [% subfield_loo.marc_value %]
348
                    <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;">
715
                    
349
                        <img src="/intranet-tmpl/prog/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
716
                    [% IF ( subfield_loo.repeatable ) %]
350
                    </a>
717
                        <a href="#" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %]'); return false;"><img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /></a>
351
                [% END %]
718
                    [% END %]
352
                </span>
719
                    [% UNLESS ( subfield_loo.mandatory ) %]
720
                        <a href="#" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;"><img src="/intranet-tmpl/prog/img/delete-subfield.png" alt="Delete" title="Delete this subfield" /></a>
721
                    [% END %]
722
                    
723
                </div>
724
                <!-- End of the line -->
725
                
353
                
726
            [% END %]
727
            </div>
354
            </div>
728
            [% END %]<!-- tag -->
355
            <!-- End of the line -->
729
        [% END %]
356
        [% END %]
730
        </div>
357
    
731
[% END %]
358
    </div>
359
    [% END %]<!-- if innerloo.tag -->
360
    [% END %]<!-- BIG_LOO.innerloop -->
361
    </div>
362
[% END %]<!-- BIG_LOOP -->
732
363
733
[% UNLESS ( singletab ) %]
364
</div><!-- tabs -->
734
    </div>	
735
[% END %]
736
</div>
737
365
738
<div name="hidden" id="hidden" class="tab">
366
<div name="hidden" id="hidden" class="tab">
739
[% FOREACH hidden_loo IN hidden_loop %]
367
[% FOREACH hidden_loo IN hidden_loop %]
Lines 755-764 function searchauthority() { Link Here
755
    <input type="hidden" name="subfield" value="[% oldauthtypetagsubfield %]" />
383
    <input type="hidden" name="subfield" value="[% oldauthtypetagsubfield %]" />
756
    <input type="hidden" name="field_value" value="[% authtypecode %]" />
384
    <input type="hidden" name="field_value" value="[% authtypecode %]" />
757
[% END %]
385
[% END %]
386
758
<fieldset class="action">
387
<fieldset class="action">
759
        <input type="button" id="addauth2" value="Save" onclick="Check(this.form)" accesskey="w" />
388
        <input type="button" id="addauth2" value="Save" onclick="Check(this.form)" accesskey="w" />
760
</fieldset>
389
</fieldset>
390
761
</form>
391
</form>
392
393
</div>
762
</div>
394
</div>
763
</div>
395
</div>
764
396
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt (-1 / +1 lines)
Lines 49-55 Link Here
49
            // Try to add as many clones as needed
49
            // Try to add as many clones as needed
50
            try {
50
            try {
51
                for(var i=0; i<nb-subfields.length; i++) {
51
                for(var i=0; i<nb-subfields.length; i++) {
52
                    window.opener.opener.CloneSubfield(subfields[0].getAttribute('id'));
52
                    window.opener.opener.CloneSubfield(subfields[0].getAttribute('id'),'[% advancedMARCEditor %]');
53
                }
53
                }
54
            }
54
            }
55
            catch(err) {
55
            catch(err) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-467 / +132 lines)
Lines 3-32 Link Here
3
[% INCLUDE 'doc-head-close.inc' %]
3
[% INCLUDE 'doc-head-close.inc' %]
4
<script type="text/javascript" src="[% themelang %]/lib/yui/plugins/bubbling-min.js"></script>
4
<script type="text/javascript" src="[% themelang %]/lib/yui/plugins/bubbling-min.js"></script>
5
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
5
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
6
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
6
<script type="text/javascript">
7
<script type="text/javascript">
7
//<![CDATA[
8
//<![CDATA[
8
9
9
     var fields_in_use = {};
10
	 $(document).ready(function() {
10
	 $(document).ready(function() {
11
        $('#addbibliotabs').tabs().bind('show.ui-tabs', function(e, ui) {
11
        $('#addbibliotabs').tabs().bind('show.ui-tabs', function(e, ui) {
12
			$("#"+ui.panel.id+" input:eq(0)").focus();
12
			$("#"+ui.panel.id+" input:eq(0)").focus();
13
		});
13
		});
14
        $('.tag').each(function() {
14
        
15
            var field_id = this.getAttribute('id').substring(0, 7);
16
            if (field_id in fields_in_use) {
17
                fields_in_use[field_id]++;
18
            } else {
19
                fields_in_use[field_id] = 1;
20
            }
21
        });
22
        $('.subfield_line').each(function() {
23
            var field_id = this.getAttribute('id').substring(0, 12);
24
            if (field_id in fields_in_use) {
25
                fields_in_use[field_id]++;
26
            } else {
27
                fields_in_use[field_id] = 1;
28
            }
29
        });
30
		/* check cookie to hide/show marcdocs*/
15
		/* check cookie to hide/show marcdocs*/
31
		if($.cookie("marcdocs_[% borrowernumber %]") == 'false'){
16
		if($.cookie("marcdocs_[% borrowernumber %]") == 'false'){
32
			hideMARCdocLinks();
17
			hideMARCdocLinks();
Lines 48-68 function confirmnotdup(redirect){ Link Here
48
	Check();
33
	Check();
49
}
34
}
50
35
51
/**
52
 * 
53
 * 
54
 */
55
function Check(){
56
    var StrAlert = AreMandatoriesNotOk();
57
    if( ! StrAlert ){
58
        document.f.submit();
59
        return true;
60
    } else {
61
        alert(StrAlert);
62
        return false;
63
    }
64
}
65
66
function Dopop(link,i) {
36
function Dopop(link,i) {
67
    defaultvalue = document.getElementById(i).value;
37
    defaultvalue = document.getElementById(i).value;
68
    window.open(link+"&result="+defaultvalue,"valuebuilder",'width=700,height=550,toolbar=false,scrollbars=yes');
38
    window.open(link+"&result="+defaultvalue,"valuebuilder",'width=700,height=550,toolbar=false,scrollbars=yes');
Lines 235-240 function AreMandatoriesNotOk(){ Link Here
235
	}
205
	}
236
}
206
}
237
207
208
/**
209
 * 
210
 * 
211
 */
212
function Check(){
213
    var StrAlert = AreMandatoriesNotOk();
214
    if( ! StrAlert ){
215
        document.f.submit();
216
        return true;
217
    } else {
218
        alert(StrAlert);
219
        return false;
220
    }
221
}
222
238
/** 
223
/** 
239
 * check if z3950 mandatories are set or not
224
 * check if z3950 mandatories are set or not
240
 */
225
 */
Lines 260-640 function Changefwk(FwkList) { Link Here
260
    f.submit();
245
    f.submit();
261
}
246
}
262
247
263
// returns the subfieldcode based upon subfieldid writing
264
function getSubfieldcode(tagsubfieldid){
265
    // 3 : tag +3 : tagnumber +4 : number of _ +8 subfield -1 begins at 0  
266
    return tagsubfieldid.substr(3+3+4+8-1,1);
267
}
268
269
// Take the base of tagsubfield information (removing the subfieldcodes and subfieldindexes)
270
// returns the filter
271
function getTagInputnameFilter(tagsubfieldid){
272
    var tagsubfield=tagsubfieldid.substr(0,tagsubfieldid.lastIndexOf("_"));  
273
    var tagcode=tagsubfield.substr(tagsubfield.lastIndexOf("_"));
274
    tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
275
    tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
276
    tagsubfield=tagsubfield+"_."+tagcode;
277
    return tagsubfield;  
278
}
279
280
function openAuth(tagsubfieldid,authtype) {
281
    // let's take the base of tagsubfield information (removing the indexes and the codes
282
    var element=document.getElementById(tagsubfieldid);
283
    var tagsubfield=getTagInputnameFilter(tagsubfieldid);
284
    var elementsubfcode=getSubfieldcode(element.name);
285
    var mainmainstring=element.value;
286
    var mainstring="";  
287
    var inputs = element.parentNode.parentNode.getElementsByTagName("input");
288
289
    for (var myindex =0; myindex<inputs.length;myindex++){
290
        if (inputs[myindex].name && inputs[myindex].name.match(tagsubfield)){
291
            var subfieldcode=getSubfieldcode(inputs[myindex].name);
292
            if (isNaN(parseInt(subfieldcode)) && inputs[myindex].value != "" && subfieldcode!=elementsubfcode){
293
                mainstring=inputs[myindex].value+" "+mainstring;
294
            }      
295
        }
296
    }           
297
	newin=window.open("../authorities/auth_finder.pl?authtypecode="+  authtype+ "&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes');
298
}
299
300
301
function ExpandField(index) {
302
    var original = document.getElementById(index); //original <div>
303
    var divs = original.getElementsByTagName('div');
304
    for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div
305
        if(divs[i].getAttribute('id').match(/^subfield/)){  // if it s a subfield
306
            if (divs[i].style.display == 'block') {
307
                divs[i].style.display = 'none';
308
            } else {
309
                divs[i].style.display = 'block';
310
            }
311
        }
312
    }
313
}
314
315
/**
316
 * To clone a field or a subfield by clicking on '+' button
317
 */ 
318
function CloneField(index) {
319
    var original = document.getElementById(index); //original <div>
320
    fields_in_use[index.substr(0, 7)]++;
321
    var clone = original.cloneNode(true);
322
    var new_key = CreateKey();
323
    var new_id  = original.getAttribute('id')+new_key;
324
    
325
    clone.setAttribute('id',new_id); // setting a new id for the parent div
326
    
327
    var divs = clone.getElementsByTagName('div');
328
    
329
    [% UNLESS ( hide_marc ) %] // No indicator if hide_marc
330
        // setting a new name for the new indicator
331
        for(var i=0; i < 2; i++) {
332
            var indicator = clone.getElementsByTagName('input')[i];
333
            indicator.setAttribute('name',indicator.getAttribute('name')+new_key);
334
        }
335
    [% END %]
336
        
337
    // settings all subfields
338
    for(var i=0,divslen = divs.length ; i<divslen ; i++){      // foreach div
339
        if(divs[i].getAttribute("id").match(/^subfield/)){  // if it s a subfield
340
            
341
            // set the attribute for the new 'div' subfields
342
            divs[i].setAttribute('id',divs[i].getAttribute('id')+new_key);
343
            
344
            var inputs   = divs[i].getElementsByTagName('input');
345
            var id_input = "";
346
            
347
            for( j = 0 ; j < inputs.length ; j++ ) {
348
            	if(inputs[j].getAttribute("id") && inputs[j].getAttribute("id").match(/^tag_/) ){
349
            		inputs[j].value = "";
350
            	}
351
            }
352
            
353
            inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
354
            inputs[0].setAttribute('name',inputs[0].getAttribute('name')+new_key);
355
            var id_input;
356
            try {
357
            	id_input = inputs[1].getAttribute('id')+new_key;
358
                inputs[1].setAttribute('id',id_input);
359
                inputs[1].setAttribute('name',inputs[1].getAttribute('name')+new_key);
360
            } catch(e) {
361
            	try{ // it s a select if it is not an input
362
                    var selects = divs[i].getElementsByTagName('select');
363
                    id_input = selects[0].getAttribute('id')+new_key;
364
                    selects[0].setAttribute('id',id_input);
365
                    selects[0].setAttribute('name',selects[0].getAttribute('name')+new_key);
366
                }catch(e2){ // it is a textarea if it s not a select or an input
367
                	var textaeras = divs[i].getElementsByTagName('textarea');
368
                	id_input = textaeras[0].getAttribute('id')+new_key;
369
                	textaeras[0].setAttribute('id',id_input);
370
                    textaeras[0].setAttribute('name',textaeras[0].getAttribute('name')+new_key);
371
                }
372
            }
373
            
374
            [% UNLESS ( advancedMARCEditor ) %]
375
            // when cloning a subfield, re set its label too.
376
            var labels = divs[i].getElementsByTagName('label');
377
            labels[0].setAttribute('for',id_input);
378
            [% END %]
379
            
380
            [% UNLESS ( hide_marc ) %]
381
                // updating javascript parameters on button up
382
                var imgs = divs[i].getElementsByTagName('img');
383
                imgs[0].setAttribute('onclick',"upSubfield(\'"+divs[i].getAttribute('id')+"\');");
384
            [% END %]
385
            
386
            // setting its '+' and '-' buttons
387
            try {
388
                var anchors = divs[i].getElementsByTagName('a');
389
                for (var j = 0; j < anchors.length; j++) {
390
                    if(anchors[j].getAttribute('class') == 'buttonPlus'){
391
                        anchors[j].setAttribute('onclick',"CloneSubfield('" + divs[i].getAttribute('id') + "')");
392
                    } else if (anchors[j].getAttribute('class') == 'buttonMinus') {
393
                        anchors[j].setAttribute('onclick',"UnCloneField('" + divs[i].getAttribute('id') + "')");
394
                    }
395
                }
396
            }
397
            catch(e){
398
                // do nothig if ButtonPlus & CloneButtonPlus don t exist.
399
            }
400
            
401
            // button ...
402
            var spans=0;
403
            try {
404
                spans = divs[i].getElementsByTagName('a');
405
            } catch(e) {
406
                // no spans
407
            }
408
            if(spans){
409
                var buttonDot;
410
                if(!CloneButtonPlus){ // it s impossible to have  + ... (buttonDot AND buttonPlus)
411
                    buttonDot = spans[0];
412
                    if(buttonDot){
413
                        // 2 possibilities :
414
                        try{
415
                            var buttonDotOnClick = buttonDot.getAttribute('onclick');
416
                            if(buttonDotOnClick.match('Clictag')){   // -1- It s a plugin
417
                                var re = /\('.*'\)/i;
418
                                buttonDotOnClick = buttonDotOnClick.replace(re,"('"+inputs[1].getAttribute('id')+"')");
419
                                if(buttonDotOnClick){
420
                                    buttonDot.setAttribute('onclick',buttonDotOnClick);
421
                                }
422
                            } else {
423
                                if(buttonDotOnClick.match('Dopop')) {  // -2- It's a auth value
424
                                    var re1 = /&index=.*',/;
425
                                    var re2 = /,.*\)/;
426
427
                                    buttonDotOnClick = buttonDotOnClick.replace(re1,"&index="+inputs[1].getAttribute('id')+"',");
428
                                    buttonDotOnClick = buttonDotOnClick.replace(re2,",'"+inputs[1].getAttribute('id')+"')");
429
                                    
430
                                    if(buttonDotOnClick){
431
                                            buttonDot.setAttribute('onclick',buttonDotOnClick);
432
                                    }
433
                                }
434
                            }
435
                            try {
436
                            	// do not copy the script section.
437
                            	var script = spans[0].getElementsByTagName('script')[0];
438
                            	spans[0].removeChild(script);
439
                            } catch(e) {
440
                            	// do nothing if there is no script
441
                            }
442
                    	}catch(e){}
443
                	}
444
                }
445
            }
446
            [% UNLESS ( hide_marc ) %]
447
                var buttonUp = divs[i].getElementsByTagName('img')[0];
448
                buttonUp.setAttribute('onclick',"upSubfield('" + divs[i].getAttribute('id') + "')");
449
            [% END %]
450
            
451
        } else { // it's a indicator div
452
            if(divs[i].getAttribute('id').match(/^div_indicator/)){
453
                var inputs = divs[i].getElementsByTagName('input');
454
                inputs[0].setAttribute('id',inputs[0].getAttribute('id')+new_key);
455
                inputs[1].setAttribute('id',inputs[1].getAttribute('id')+new_key);
456
                
457
                var CloneButtonPlus;
458
                try {
459
                    var anchors = divs[i].getElementsByTagName('a');
460
                    for (var j = 0; j < anchors.length; j++) {
461
                        if (anchors[j].getAttribute('class') == 'buttonPlus') {
462
                            anchors[j].setAttribute('onclick',"CloneField('" + new_id + "')");
463
                        } else if (anchors[j].getAttribute('class') == 'buttonMinus') {
464
                            anchors[j].setAttribute('onclick',"UnCloneField('" + new_id + "')");
465
                        } else if (anchors[j].getAttribute('class') == 'expandfield') {
466
                            anchors[j].setAttribute('onclick',"ExpandField('" + new_id + "')");
467
                        }
468
                    }
469
                }
470
                catch(e){
471
                    // do nothig CloneButtonPlus doesn't exist.
472
                }
473
474
            }
475
        }
476
    }
477
    
478
    // insert this line on the page
479
    original.parentNode.insertBefore(clone,original.nextSibling);
480
}
481
482
function CloneSubfield(index){
483
    var original = document.getElementById(index); //original <div>
484
    fields_in_use[index.substr(0, 12)]++;
485
    var clone = original.cloneNode(true);
486
    var new_key = CreateKey();
487
    var new_id  = original.getAttribute('id')+new_key;
488
    // set the attribute for the new 'div' subfields
489
    var inputs     = clone.getElementsByTagName('input');
490
    var selects    = clone.getElementsByTagName('select');
491
    var textareas  = clone.getElementsByTagName('textarea');
492
    var linkid;
493
494
    // input
495
    var id_input = "";
496
    for(var i=0,len=inputs.length; i<len ; i++ ){
497
        id_input = inputs[i].getAttribute('id')+new_key;
498
        inputs[i].setAttribute('id',id_input);
499
        inputs[i].setAttribute('name',inputs[i].getAttribute('name')+new_key);
500
	linkid = id_input;
501
    }
502
    
503
    // select 
504
    for(var i=0,len=selects.length; i<len ; i++ ){
505
        id_input = selects[i].getAttribute('id')+new_key;
506
        selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
507
        selects[i].setAttribute('name',selects[i].getAttribute('name')+new_key);
508
    }
509
    
510
    // textarea
511
    for(var i=0,len=textareas.length; i<len ; i++ ){
512
        id_input = textareas[i].getAttribute('id')+new_key;
513
        textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
514
        textareas[i].setAttribute('name',textareas[i].getAttribute('name')+new_key);
515
    }
516
517
    // Changing the "..." link's onclick attribute for plugin callback
518
    var links  = clone.getElementsByTagName('a');
519
    var link = links[0];
520
    var buttonDotOnClick = link.getAttribute('onclick');
521
    if(buttonDotOnClick.match('Clictag')){   // -1- It s a plugin
522
	var re = /\('.*'\)/i;
523
        buttonDotOnClick = buttonDotOnClick.replace(re,"('"+linkid+"')");
524
        if(buttonDotOnClick){
525
	    link.setAttribute('onclick',buttonDotOnClick);
526
        }
527
    }
528
529
530
    [% UNLESS ( advancedMARCEditor ) %]
531
    // when cloning a subfield, reset its label too.
532
    var label = clone.getElementsByTagName('label')[0];
533
    label.setAttribute('for',id_input);
534
    [% END %]
535
    
536
    // setting a new id for the parent div
537
    clone.setAttribute('id',new_id);
538
    
539
    try {
540
        var buttonUp = clone.getElementsByTagName('img')[0];
541
        buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
542
        var anchors = clone.getElementsByTagName('a');
543
        if(anchors.length){
544
            for(var i = 0 ,lenanchors = anchors.length ; i < lenanchors ; i++){
545
                if(anchors[i].getAttribute('class') == 'buttonPlus'){
546
                    anchors[i].setAttribute('onclick',"CloneSubfield('" + new_id + "')");
547
                } else if (anchors[i].getAttribute('class') == 'buttonMinus') {
548
                    anchors[i].setAttribute('onclick',"UnCloneField('" + new_id + "')");
549
                }
550
            }
551
        }
552
    }
553
    catch(e){
554
        // do nothig if ButtonPlus & CloneButtonPlus don't exist.
555
    }
556
    // insert this line on the page
557
    original.parentNode.insertBefore(clone,original.nextSibling);
558
}
559
560
 /**
561
 * This function removes or clears unwanted subfields
562
 */
563
function UnCloneField(index) {
564
    var original = document.getElementById(index);
565
    var field_id;
566
    if (index.match("tag")) {
567
        field_id = index.substr(0, 7);
568
    } else {
569
        field_id = index.substr(0, 12);
570
    }
571
    if (1 == fields_in_use[field_id]) {
572
        // clear inputs, but don't delete
573
        $(":input.input_marceditor", original).each(function(){
574
            // thanks to http://www.learningjquery.com/2007/08/clearing-form-data for
575
            // hint about clearing selects correctly
576
            var type = this.type;
577
            var tag = this.tagName.toLowerCase();
578
            if (type == 'text' || type == 'password' || tag == 'textarea') {
579
                this.value = "";
580
            } else if (type == 'checkbox' || type == 'radio') {
581
                this.checked = false;
582
            } else if (tag == 'select') {
583
                this.selectedIndex = -1;
584
            }
585
        });
586
        $(":input.indicator", original).val("");
587
    } else {
588
        original.parentNode.removeChild(original);
589
        fields_in_use[field_id]--;
590
    }
591
}
592
593
/**
594
 * This function create a random number
595
 */
596
function CreateKey(){
597
    return parseInt(Math.random() * 100000);
598
}
599
600
/**
601
 * This function allows to move a subfield up by clickink on the 'up' button .
602
 */
603
function upSubfield(index) {
604
    try{
605
        var line = document.getElementById(index); // get the line where the user has clicked.
606
    } catch(e) {
607
        return; // this line doesn't exist...
608
    }
609
    var tag = line.parentNode; // get the dad of this line. (should be "<div id='tag_...'>")
610
    
611
    // getting all subfields for this tag
612
    var subfields = tag.getElementsByTagName('div');
613
    var subfieldsLength = subfields.length;
614
    
615
    if(subfieldsLength<=1) return; // nothing to do if there is just one subfield.
616
    
617
    // among all subfields 
618
    for(var i=0;i<subfieldsLength;i++){ 
619
        if(subfields[i].getAttribute('id') == index){ //looking for the subfield which is clicked :
620
            if(i==1){ // if the clicked subfield is on the top
621
                tag.appendChild(subfields[1]);
622
                return;
623
            } else {
624
                var lineAbove = subfields[i-1];
625
                tag.insertBefore(line,lineAbove);
626
                return;
627
            }
628
        }
629
    }
630
}
631
632
function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
633
    subfield = document.getElementById(index);
634
    subfield.style.display = 'block';
635
    label = document.getElementById(labelindex);
636
    label.style.display='none';	
637
}
638
//]]>
248
//]]>
639
</script>
249
</script>
640
<link type="text/css" rel="stylesheet" href="[% themelang %]/css/addbiblio.css" />
250
<link type="text/css" rel="stylesheet" href="[% themelang %]/css/addbiblio.css" />
Lines 657-662 function unHideSubfield(index,labelindex) { // FIXME :: is it used ? Link Here
657
//]]>
267
//]]>
658
</script>
268
</script>
659
[% INCLUDE 'header.inc' %]
269
[% INCLUDE 'header.inc' %]
270
660
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>  &rsaquo; [% IF ( biblionumber ) %]Editing <em>[% title |html %]</em> (Record number [% biblionumber %])[% ELSE %]Add MARC record[% END %]</div>
271
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>  &rsaquo; [% IF ( biblionumber ) %]Editing <em>[% title |html %]</em> (Record number [% biblionumber %])[% ELSE %]Add MARC record[% END %]</div>
661
272
662
<div id="doc" class="yui-t7">
273
<div id="doc" class="yui-t7">
Lines 802-884 function unHideSubfield(index,labelindex) { // FIXME :: is it used ? Link Here
802
        <input type="hidden" name="breedingid" value="[% breedingid %]" />
413
        <input type="hidden" name="breedingid" value="[% breedingid %]" />
803
414
804
<div id="addbibliotabs" class="toptabs numbered">
415
<div id="addbibliotabs" class="toptabs numbered">
805
	<ul>[% FOREACH BIG_LOO IN BIG_LOOP %]
416
    <ul>
806
          <li>  [% IF ( BIG_LOO.number ) %]
417
        [% FOREACH BIG_LOO IN BIG_LOOP %]
807
                <a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>
418
        <li><a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a></li>
808
            [% ELSE %]
419
        [% END %]
809
                <a href="#tab[% BIG_LOO.number %]XX">[% BIG_LOO.number %]</a>
420
    </ul>
810
            [% END %]</li>
811
        [% END %]</ul>
812
421
813
[% FOREACH BIG_LOO IN BIG_LOOP %]
422
[% FOREACH BIG_LOO IN BIG_LOOP %]
814
<!-- hide every tab except the 1st -->
815
[% IF ( BIG_LOO.number ) %]
816
    <div id="tab[% BIG_LOO.number %]XX">
817
[% ELSE %]
818
    <div id="tab[% BIG_LOO.number %]XX">
423
    <div id="tab[% BIG_LOO.number %]XX">
819
[% END %]
820
821
    
424
    
822
    [% FOREACH innerloo IN BIG_LOO.innerloop %]
425
    [% FOREACH innerloo IN BIG_LOO.innerloop %]
823
        [% IF ( innerloo.tag ) %]
426
    [% IF ( innerloo.tag ) %]
824
	<div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
427
    <div class="tag" id="tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
825
        <div class="tag_title" id="div_indicator_tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
428
        <div class="tag_title" id="div_indicator_tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]">
826
            [% UNLESS hide_marc %]
429
        [% UNLESS hide_marc %]
827
            	[% IF advancedMARCEditor %]
430
            [% IF advancedMARCEditor %]
828
		<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>
431
                <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>
829
		[% ELSE %]
432
            [% ELSE %]
830
                 <span class="tagnum" title="[% innerloo.tag_lib %]">[% innerloo.tag %]
433
                <span class="tagnum" title="[% innerloo.tag_lib %]">[% innerloo.tag %]
831
                 [% IF marcflavour != 'NORMARC' %]<a class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag %]', [% BIG_LOO.number %]); return false;">&nbsp;?</a>[% END %]
434
                [% IF marcflavour != 'NORMARC' %]<a class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag %]', [% BIG_LOO.number %]); return false;">&nbsp;?</a>[% END %]
832
                 </span>
435
                </span>
833
		[% END %]
436
            [% END %]
834
                [% IF ( innerloo.fixedfield ) %]
437
                [% IF ( innerloo.fixedfield ) %]
835
	                <input tabindex="1" class="indicator flat" type="text" style="display:none;" name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]" size="1" maxlength="1" value="[% innerloo.indicator1 %]" />
438
                    <input type="text"
836
	                <input tabindex="1" class="indicator flat" type="text" style="display:none;" name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]" size="1" maxlength="1" value="[% innerloo.indicator2 %]" />
439
                        tabindex="1"
440
                        class="indicator flat"
441
                        style="display:none;"
442
                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
443
                        size="1"
444
                        maxlength="1"
445
                        value="[% innerloo.indicator1 %]" />
446
                    <input type="text"
447
                        tabindex="1"
448
                        class="indicator flat"
449
                        style="display:none;"
450
                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
451
                        size="1"
452
                        maxlength="1"
453
                        value="[% innerloo.indicator2 %]" />
837
                [% ELSE %]
454
                [% ELSE %]
838
        	        <input tabindex="1" class="indicator flat" type="text" name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]" size="1" maxlength="1" value="[% innerloo.indicator1 %]" />
455
                    <input type="text"
839
        	        <input tabindex="1" class="indicator flat" type="text" name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]" size="1" maxlength="1" value="[% innerloo.indicator2 %]" />
456
                        tabindex="1"
457
                        class="indicator flat"
458
                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
459
                        size="1"
460
                        maxlength="1"
461
                        value="[% innerloo.indicator1 %]" />
462
                    <input type="text"
463
                        tabindex="1"
464
                        class="indicator flat"
465
                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
466
                        size="1"
467
                        maxlength="1"
468
                        value="[% innerloo.indicator2 %]" />
840
                [% END %] -
469
                [% END %] -
841
            [% ELSE %]
470
        [% ELSE %]
842
                [% IF ( innerloo.fixedfield ) %]
471
                [% IF ( innerloo.fixedfield ) %]
843
                    <input tabindex="1" type="hidden" name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]" value="[% innerloo.indicator1 %]" />
472
                    <input type="hidden"
844
                    <input tabindex="1" type="hidden" name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]" value="[% innerloo.indicator2 %]" />
473
                        tabindex="1"
474
                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
475
                        value="[% innerloo.indicator1 %]" />
476
                    <input type="hidden"
477
                        tabindex="1"
478
                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
479
                        value="[% innerloo.indicator2 %]" />
845
                [% ELSE %]
480
                [% ELSE %]
846
                    <input tabindex="1" type="hidden" name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]" value="[% innerloo.indicator1 %]" />
481
                    <input type="hidden"
847
                    <input tabindex="1" type="hidden" name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]" value="[% innerloo.indicator2 %]" />
482
                        tabindex="1"
483
                        name="tag_[% innerloo.tag %]_indicator1_[% innerloo.index %][% innerloo.random %]"
484
                        value="[% innerloo.indicator1 %]" />
485
                    <input type="hidden"
486
                        tabindex="1"
487
                        name="tag_[% innerloo.tag %]_indicator2_[% innerloo.index %][% innerloo.random %]"
488
                        value="[% innerloo.indicator2 %]" />
848
                [% END %]
489
                [% END %]
849
            [% END %]
490
        [% END %]
850
491
851
            [% UNLESS advancedMARCEditor %]
492
            [% UNLESS advancedMARCEditor %]
852
	            <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>
493
                <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>
853
            [% END %]
494
            [% END %]
854
            [% IF ( innerloo.repeatable ) %]
495
                <span class="field_controls">
855
                <span class="subfield_controls"><a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Repeat this Tag"><img src="/intranet-tmpl/prog/img/repeat-tag.png" alt="Repeat this Tag" /></a>
496
                [% IF ( innerloo.repeatable ) %]
856
            [% END %]
497
                    <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]','[% hide_marc %]','[% advancedMARCEditor %]'); return false;" title="Repeat this Tag">
857
                <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Delete this Tag"><img src="/intranet-tmpl/prog/img/delete-tag.png" alt="Delete this Tag" /></a></span>
498
                        <img src="/intranet-tmpl/prog/img/repeat-tag.png" alt="Repeat this Tag" />
858
499
                    </a>
859
            
500
                [% END %]
501
                    <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag %]_[% innerloo.index %][% innerloo.random %]'); return false;" title="Delete this Tag">
502
                        <img src="/intranet-tmpl/prog/img/delete-tag.png" alt="Delete this Tag" />
503
                    </a>
504
                </span>
505
        
860
        </div>
506
        </div>
861
	
507
        
862
        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
508
        [% FOREACH subfield_loo IN innerloo.subfield_loop %]
863
            <!--  One line on the marc editor -->
509
            <!--  One line on the marc editor -->
864
            <div class="subfield_line" style="[% subfield_loo.visibility %]; float: left; clear: left; width: 100%;" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]">
510
            <div class="subfield_line" style="[% subfield_loo.visibility %]" id="subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]">
865
            
511
            
866
                [% UNLESS advancedMARCEditor %]
512
                [% UNLESS advancedMARCEditor %]
867
                    [% 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">
513
                    [% 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">
868
                    [% ELSE %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield">[% END %]
514
                    [% ELSE %]<label for="tag_[% subfield_loo.tag %]_subfield_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" class="labelsubfield">
869
                [% END %] 
515
                    [% END %]
516
                [% END %]
870
                
517
                
871
                [% UNLESS hide_marc %]
518
                [% UNLESS hide_marc %]
872
                <span class="subfieldcode">[% IF ( subfield_loo.fixedfield ) %] 
519
                <span class="subfieldcode">
873
                        <img class="buttonUp" style="display:none;" src="[% themelang %]/../img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
520
                    [% IF ( subfield_loo.fixedfield ) %]
521
                        <img class="buttonUp" style="display:none;" src="/intranet-tmpl/prog/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
874
                    [% ELSE %]
522
                    [% ELSE %]
875
                        <img class="buttonUp" src="[% themelang %]/../img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
523
                        <img class="buttonUp" src="/intranet-tmpl/prog/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]')" alt="Move Up" title="Move Up" />
876
                    [% END %]
524
                    [% END %]
877
                        <input title="[% subfield_loo.marc_lib_plain %]" style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;" type="text" tabindex="0" name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" value="[% subfield_loo.subfield %]" size="1" maxlength="1" class="flat" />
525
                        <input type="text"
878
 </span>
526
                            title="[% subfield_loo.marc_lib_plain %]"
527
                            style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"
528
                            name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
529
                            value="[% subfield_loo.subfield %]"
530
                            size="1"
531
                            maxlength="1"
532
                            class="flat"
533
                            tabindex="0" />
534
                </span>
879
                [% ELSE %]
535
                [% ELSE %]
880
                    <input type="hidden" name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]" value="[% subfield_loo.subfield %]" />
536
                    <input type="hidden"
881
 </span>
537
                        name="tag_[% subfield_loo.tag %]_code_[% subfield_loo.subfield %]_[% subfield_loo.index %]_[% subfield_loo.index_subfield %]"
538
                        value="[% subfield_loo.subfield %]" />
882
                [% END %]
539
                [% END %]
883
            
540
            
884
                [% UNLESS advancedMARCEditor %]
541
                [% UNLESS advancedMARCEditor %]
Lines 891-912 function unHideSubfield(index,labelindex) { // FIXME :: is it used ? Link Here
891
                
548
                
892
                [% subfield_loo.marc_value %]
549
                [% subfield_loo.marc_value %]
893
                
550
                
551
                <span class="subfield_controls">
894
                [% IF ( subfield_loo.repeatable ) %]
552
                [% IF ( subfield_loo.repeatable ) %]
895
                    <span class="subfield_controls"><a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;"><img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /></a>
553
                    <a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]','[% advancedMARCEditor %]'); return false;">
896
                                        <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;"><img src="/intranet-tmpl/prog/img/delete-subfield.png" alt="Delete" title="Delete this subfield" /></a></span>
554
                        <img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
555
                    </a>
556
                    <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag %][% subfield_loo.subfield %][% subfield_loo.random %]'); return false;">
557
                        <img src="/intranet-tmpl/prog/img/delete-subfield.png" alt="Delete" title="Delete this subfield" />
558
                    </a>
897
                [% END %]
559
                [% END %]
898
560
                </span>
899
                
561
                
900
            </div>
562
            </div>
901
            <!-- End of the line -->
563
            <!-- End of the line -->
902
            
903
        [% END %]
564
        [% END %]
904
        </div>
565
    
905
        [% END %]<!-- tag -->
906
    [% END %]
907
    </div>
566
    </div>
908
[% END %]
567
    [% END %]<!-- if innerloo.tag -->
909
</div>
568
    [% END %]<!-- BIG_LOO.innerloop -->
569
    </div>
570
[% END %]<!-- BIG_LOOP -->
571
572
</div><!-- tabs -->
573
910
<!-- Fields for fast add cataloguing -->
574
<!-- Fields for fast add cataloguing -->
911
<input type="hidden" name="barcode" value="[% barcode %]" />
575
<input type="hidden" name="barcode" value="[% barcode %]" />
912
<input type="hidden" name="branch" value="[% branch %]" />
576
<input type="hidden" name="branch" value="[% branch %]" />
Lines 914-919 function unHideSubfield(index,labelindex) { // FIXME :: is it used ? Link Here
914
<input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
578
<input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
915
<input type="hidden" name="duedatespec" value="[% duedatespec %]" />
579
<input type="hidden" name="duedatespec" value="[% duedatespec %]" />
916
<!-- /End of fast add fields -->
580
<!-- /End of fast add fields -->
581
917
</form>
582
</form>
918
583
919
</div>
584
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-73 / +4 lines)
Lines 1-6 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Cataloging &rsaquo; [% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %]) &rsaquo; Items</title>
2
<title>Koha &rsaquo; Cataloging &rsaquo; [% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %]) &rsaquo; Items</title>
3
[% INCLUDE 'doc-head-close.inc' %]
3
[% INCLUDE 'doc-head-close.inc' %]
4
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
4
<script type="text/javascript">
5
<script type="text/javascript">
5
//<![CDATA[
6
//<![CDATA[
6
$(document).ready(function(){
7
$(document).ready(function(){
Lines 84-161 function confirm_deletion(biblionumber,itemnumber) { Link Here
84
    }
85
    }
85
}
86
}
86
87
87
function CloneSubfield(index){
88
    var original = document.getElementById(index); //original <div>
89
    var clone = original.cloneNode(true);
90
    var new_key = CreateKey();
91
    var old_id =  original.getAttribute('id');
92
    old_id=old_id.substr(12);
93
    var new_id  = old_id+new_key;
94
95
    // set the attribute for the new 'div' subfields
96
    var inputs     = clone.getElementsByTagName('input');
97
    var selects    = clone.getElementsByTagName('select');
98
    var textareas  = clone.getElementsByTagName('textarea');
99
100
    // input
101
    var id_input = "";
102
    for(var i=0,len=inputs.length; i<len ; i++ ){
103
        id_input = inputs[i].getAttribute('id')+new_key;
104
        inputs[i].setAttribute('id',id_input);
105
        inputs[i].setAttribute('name',inputs[i].getAttribute('name'));
106
    }
107
108
    // select
109
    for(var i=0,len=selects.length; i<len ; i++ ){
110
        id_input = selects[i].getAttribute('id')+new_key;
111
        selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
112
        selects[i].setAttribute('name',selects[i].getAttribute('name'));
113
    }
114
115
    // textarea
116
    for(var i=0,len=textareas.length; i<len ; i++ ){
117
        id_input = textareas[i].getAttribute('id')+new_key;
118
        textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
119
        textareas[i].setAttribute('name',textareas[i].getAttribute('name'));
120
    }
121
122
    [% UNLESS ( advancedMARCEditor ) %]
123
    // when cloning a subfield, reset its label too.
124
    var label = clone.getElementsByTagName('label')[0];
125
    label.setAttribute('for',id_input);
126
    [% END %]
127
128
    // setting a new if for the parent div
129
    clone.setAttribute('id',new_id);
130
131
    var CloneButtonPlus;
132
    try {
133
      var spans = clone.getElementsByTagName('span');
134
      if(spans.length){
135
          for(var i = 0 ,lenspans = spans.length ; i < lenspans ; i++){
136
            if(spans[i].getAttribute('class') == 'buttonPlus'){
137
                    CloneButtonPlus = spans[i];
138
                    CloneButtonPlus.setAttribute('onclick',"CloneSubfield('" + new_id + "')");
139
                    var buttonUp = clone.getElementsByTagName('img')[0];
140
                    buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
141
                }
142
            }
143
        }
144
    }
145
    catch(e){
146
        // do nothing if ButtonPlus & CloneButtonPlus don't exist.
147
    }
148
    // insert this line on the page
149
    original.parentNode.insertBefore(clone,original.nextSibling);
150
}
151
152
/**
153
 * This function creates a random number
154
 */
155
function CreateKey(){
156
    return parseInt(Math.random() * 100000);
157
}
158
159
$(document).ready(function() {
88
$(document).ready(function() {
160
    $("#cataloguing_additem_itemlist  tr").hover(
89
    $("#cataloguing_additem_itemlist  tr").hover(
161
        function () {$(this).attr("class","highlight");},
90
        function () {$(this).attr("class","highlight");},
Lines 247-253 $(document).ready(function() { Link Here
247
                <input type="hidden" name="subfield"  value="[% ite.subfield %]" />
176
                <input type="hidden" name="subfield"  value="[% ite.subfield %]" />
248
                <input type="hidden" name="mandatory" value="[% ite.mandatory %]" />
177
                <input type="hidden" name="mandatory" value="[% ite.mandatory %]" />
249
                [% IF ( ite.repeatable ) %]
178
                [% IF ( ite.repeatable ) %]
250
                    <span class="buttonPlus" onclick="CloneSubfield('subfield[% ite.tag %][% ite.subfield %][% ite.random %]')">+</span>
179
                    <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
180
                        <img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
181
                    </a>
251
                [% END %]
182
                [% END %]
252
                [% IF ( ite.mandatory ) %] <span class="required">Required</span>[% END %]
183
                [% IF ( ite.mandatory ) %] <span class="required">Required</span>[% END %]
253
            </div></li>
184
            </div></li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt (-70 / +12 lines)
Lines 1-6 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Serials &rsaquo; Serial edition [% bibliotitle %]</title>
2
<title>Koha &rsaquo; Serials &rsaquo; Serial edition [% bibliotitle %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
3
[% INCLUDE 'doc-head-close.inc' %]
4
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
4
<script language="JavaScript" type="text/javascript">
5
<script language="JavaScript" type="text/javascript">
5
//<![CDATA[
6
//<![CDATA[
6
function popup(subscriptionid) {
7
function popup(subscriptionid) {
Lines 68-137 function changeDate2(adate) { Link Here
68
   var elem = document.getElementById("supexpecteddate");
69
   var elem = document.getElementById("supexpecteddate");
69
    elem.value = adate;
70
    elem.value = adate;
70
}
71
}
71
function CloneSubfield(index){
72
72
    var original = document.getElementById(index); //original <div>
73
    var clone = original.cloneNode(true);
74
    var new_key = CreateKey();
75
    var old_id =  original.getAttribute('id');
76
    old_id=old_id.substr(12);
77
    var new_id  = old_id+new_key;
78
    
79
    // set the attribute for the new 'div' subfields
80
    var inputs     = clone.getElementsByTagName('input');
81
    var selects    = clone.getElementsByTagName('select');
82
    var textareas  = clone.getElementsByTagName('textarea');
83
        
84
    // input
85
    var id_input = "";
86
    for(var i=0,len=inputs.length; i<len ; i++ ){
87
        id_input = inputs[i].getAttribute('id')+new_key;
88
        inputs[i].setAttribute('id',id_input);
89
        inputs[i].setAttribute('name',inputs[i].getAttribute('name'));
90
    }
91
    
92
    // select 
93
    for(var i=0,len=selects.length; i<len ; i++ ){
94
        id_input = selects[i].getAttribute('id')+new_key;
95
        selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
96
        selects[i].setAttribute('name',selects[i].getAttribute('name'));
97
    }
98
    
99
    // textarea
100
    for(var i=0,len=textareas.length; i<len ; i++ ){
101
        id_input = textareas[i].getAttribute('id')+new_key;
102
        textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
103
        textareas[i].setAttribute('name',textareas[i].getAttribute('name'));
104
    }
105
    
106
    [% UNLESS ( advancedMARCEditor ) %]
107
    // when cloning a subfield, reset its label too.
108
    var label = clone.getElementsByTagName('label')[0];
109
    label.setAttribute('for',id_input);
110
    [% END %]
111
    
112
    // setting a new if for the parent div
113
    clone.setAttribute('id',new_id);
114
    
115
    var CloneButtonPlus;
116
    try {
117
      var spans = clone.getElementsByTagName('span');
118
      if(spans.length){
119
          for(var i = 0 ,lenspans = spans.length ; i < lenspans ; i++){
120
            if(spans[i].getAttribute('class') == 'buttonPlus'){
121
                    CloneButtonPlus = spans[i];
122
                    CloneButtonPlus.setAttribute('onclick',"CloneSubfield('" + new_id + "')");
123
                    var buttonUp = clone.getElementsByTagName('img')[0];
124
                    buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
125
                }
126
            }
127
        }
128
    }
129
    catch(e){
130
        // do nothig if ButtonPlus & CloneButtonPlus don't exist.
131
    }
132
    // insert this line on the page
133
    original.parentNode.insertBefore(clone,original.nextSibling);
134
}
135
$(document).ready(function() {
73
$(document).ready(function() {
136
	$("form#serials_edit").submit(function() {
74
	$("form#serials_edit").submit(function() {
137
	    var total_errors = 0;
75
	    var total_errors = 0;
Lines 286-292 $(document).ready(function() { Link Here
286
        [% FOREACH item IN serialslis.items %]
224
        [% FOREACH item IN serialslis.items %]
287
        <div id="item[% item.serialid %][% item.countitems %]" class="items">
225
        <div id="item[% item.serialid %][% item.countitems %]" class="items">
288
        <ol>[% FOREACH iteminformatio IN item.iteminformation %]<li>
226
        <ol>[% FOREACH iteminformatio IN item.iteminformation %]<li>
289
               <div class="subfield_line" style="[% iteminformatio.hidden %];" id="subfield[% item.serialid %][% item.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
227
               <div class="subfield_line" style="[% iteminformatio.hidden %]" id="subfield[% item.serialid %][% item.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
290
                              
228
                              
291
                <label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
229
                <label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
292
                [% iteminformatio.marc_value %]
230
                [% iteminformatio.marc_value %]
Lines 295-302 $(document).ready(function() { Link Here
295
                <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
233
                <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
296
                <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
234
                <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
297
                <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
235
                <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
298
                [% IF ( iteminformatio.ITEM_SUBFIELDS_ARE_NOT_REPEATABLE ) %]
236
                [% IF ( iteminformatio.repeatable ) %]
299
                    <span class="buttonPlus" onclick="CloneSubfield('subfield[% item.serialid %][% item.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]')">+</span>
237
                    <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
238
                        <img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
239
                    </a>
300
                [% END %]
240
                [% END %]
301
        
241
        
302
            </div></li>
242
            </div></li>
Lines 389-395 $(document).ready(function() { Link Here
389
          <div class="cataloguing_additem_itemlist">
329
          <div class="cataloguing_additem_itemlist">
390
        <div id="item[% newserialloo.serialid %][% newserialloo.countitems %]" class="items">
330
        <div id="item[% newserialloo.serialid %][% newserialloo.countitems %]" class="items">
391
        <ol>[% FOREACH iteminformatio IN newserialloo.iteminformation %]<li>
331
        <ol>[% FOREACH iteminformatio IN newserialloo.iteminformation %]<li>
392
               <div class="subfield_line" style="[% iteminformatio.hidden %];" id="subfield[% newserialloo.serialid %][% newserialloo.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
332
               <div class="subfield_line" style="[% iteminformatio.hidden %]" id="subfield[% newserialloo.serialid %][% newserialloo.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
393
   
333
   
394
                <label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
334
                <label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
395
                [% iteminformatio.marc_value %]
335
                [% iteminformatio.marc_value %]
Lines 398-405 $(document).ready(function() { Link Here
398
                <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
338
                <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
399
                <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
339
                <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
400
                <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
340
                <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
401
                [% IF ( iteminformatio.ITEM_SUBFIELDS_ARE_NOT_REPEATABLE ) %]
341
                [% IF ( iteminformatio.repeatable ) %]
402
                    <span class="buttonPlus" onclick="CloneSubfield('subfield[% newserialloo.serialid %][% newserialloo.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]')">+</span>
342
                    <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
343
                        <img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
344
                    </a>
403
                [% END %]
345
                [% END %]
404
        </div>
346
        </div>
405
       </li>[% END %]</ol>
347
       </li>[% END %]</ol>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt (-1 / +4 lines)
Lines 2-7 Link Here
2
<title>Koha &rsaquo; Tools &rsaquo; Batch item modification</title>
2
<title>Koha &rsaquo; Tools &rsaquo; Batch item modification</title>
3
[% INCLUDE 'doc-head-close.inc' %]
3
[% INCLUDE 'doc-head-close.inc' %]
4
<script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
4
<script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
5
<script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/pages/batchMod.css" />
6
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/pages/batchMod.css" />
6
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
7
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
7
<script src="[% themelang %]/lib/yui/cookie/cookie-min.js"></script>
8
<script src="[% themelang %]/lib/yui/cookie/cookie-min.js"></script>
Lines 156-162 $("input[name='disable_input']").click(function() { Link Here
156
                <input type="hidden" name="subfield"       value="[% ite.subfield %]" />
157
                <input type="hidden" name="subfield"       value="[% ite.subfield %]" />
157
                <input type="hidden" name="mandatory"       value="[% ite.mandatory %]" />
158
                <input type="hidden" name="mandatory"       value="[% ite.mandatory %]" />
158
                [% IF ( ite.repeatable ) %]
159
                [% IF ( ite.repeatable ) %]
159
                    <span class="buttonPlus" onclick="CloneSubfield('subfield[% ite.tag %][% ite.subfield %][% ite.random %]')">+</span>
160
                    <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
161
                        <img src="/intranet-tmpl/prog/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
162
                    </a>
160
                [% END %]
163
                [% END %]
161
   
164
   
162
            </div></li>
165
            </div></li>
(-)a/tools/batchMod.pl (-4 / +3 lines)
Lines 393-406 foreach my $tag (sort keys %{$tagslib}) { Link Here
393
			my $temp;
393
			my $temp;
394
            my $extended_param = plugin_parameters( $dbh, $temp, $tagslib, $subfield_data{id}, \@loop_data );
394
            my $extended_param = plugin_parameters( $dbh, $temp, $tagslib, $subfield_data{id}, \@loop_data );
395
            my ( $function_name, $javascript ) = plugin_javascript( $dbh, $temp, $tagslib, $subfield_data{id}, \@loop_data );
395
            my ( $function_name, $javascript ) = plugin_javascript( $dbh, $temp, $tagslib, $subfield_data{id}, \@loop_data );
396
            $subfield_data{marc_value} = qq[<input $attributes
396
            $subfield_data{marc_value} = qq[<input type="text" $attributes
397
                onfocus="Focus$function_name($subfield_data{random}, '$subfield_data{id}');"
397
                onfocus="Focus$function_name($subfield_data{random}, '$subfield_data{id}');"
398
                 onblur=" Blur$function_name($subfield_data{random}, '$subfield_data{id}');" />
398
                 onblur=" Blur$function_name($subfield_data{random}, '$subfield_data{id}');" />
399
                <a href="#" class="buttonDot" onclick="Clic$function_name('$subfield_data{id}'); return false;" title="Tag Editor">...</a>
399
                <a href="#" class="buttonDot" onclick="Clic$function_name('$subfield_data{id}'); return false;" title="Tag Editor">...</a>
400
                $javascript];
400
                $javascript];
401
        } else {
401
        } else {
402
            warn "Plugin Failed: $plugin";
402
            warn "Plugin Failed: $plugin";
403
            $subfield_data{marc_value} = "<input $attributes />"; # supply default input form
403
            $subfield_data{marc_value} = "<input type=\"text\" $attributes />"; # supply default input form
404
        }
404
        }
405
    }
405
    }
406
    elsif ( $tag eq '' ) {       # it's an hidden field
406
    elsif ( $tag eq '' ) {       # it's an hidden field
Lines 419-425 foreach my $tag (sort keys %{$tagslib}) { Link Here
419
        $subfield_data{marc_value} = "<textarea $attributes_no_value>$value</textarea>\n";
419
        $subfield_data{marc_value} = "<textarea $attributes_no_value>$value</textarea>\n";
420
    } else {
420
    } else {
421
        # it's a standard field
421
        # it's a standard field
422
         $subfield_data{marc_value} = "<input $attributes />";
422
         $subfield_data{marc_value} = "<input type=\"text\" $attributes />";
423
    }
423
    }
424
#   $subfield_data{marc_value}="<input type=\"text\" name=\"field_value\">";
424
#   $subfield_data{marc_value}="<input type=\"text\" name=\"field_value\">";
425
    push (@loop_data, \%subfield_data);
425
    push (@loop_data, \%subfield_data);
426
- 

Return to bug 7455