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

(-)a/authorities/authorities.pl (-1 / +1 lines)
Lines 199-205 sub create_input { Link Here
199
            class=\"input_marceditor\"
199
            class=\"input_marceditor\"
200
            tabindex=\"1\" \/>
200
            tabindex=\"1\" \/>
201
        <a href=\"#\" class=\"buttonDot\"
201
        <a href=\"#\" class=\"buttonDot\"
202
        onclick=\"openAuth(this.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."'); return false;\" tabindex=\"1\" title=\"Tag Editor\">...</a>
202
        onclick=\"openAuth(this.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."','auth'); return false;\" tabindex=\"1\" title=\"Tag Editor\">...</a>
203
    ";
203
    ";
204
    # it's a plugin field
204
    # it's a plugin field
205
    }
205
    }
(-)a/cataloguing/addbiblio.pl (-19 / +6 lines)
Lines 372-378 sub create_input { Link Here
372
    # it's a thesaurus / authority field
372
    # it's a thesaurus / authority field
373
    }
373
    }
374
    elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) {
374
    elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) {
375
     if (C4::Context->preference("BiblioAddsAuthorities")) {
375
        # when authorities auto-creation is allowed, do not set readonly
376
        my $is_readonly = !C4::Context->preference("BiblioAddsAuthorities");
376
        $subfield_data{marc_value} =
377
        $subfield_data{marc_value} =
377
            "<input type=\"text\"
378
            "<input type=\"text\"
378
                    id=\"".$subfield_data{id}."\"
379
                    id=\"".$subfield_data{id}."\"
Lines 381-406 sub create_input { Link Here
381
                    class=\"input_marceditor readonly\"
382
                    class=\"input_marceditor readonly\"
382
                    tabindex=\"1\"
383
                    tabindex=\"1\"
383
                    size=\"67\"
384
                    size=\"67\"
384
                    maxlength=\"".$subfield_data{maxlength}."\"
385
                    maxlength=\"".$subfield_data{maxlength}."\"".
385
                    \/>
386
                    ($is_readonly ? "readonly=\"readonly\"" : "").
387
                    "\/>
386
                    <span class=\"subfield_controls\"><a href=\"#\" class=\"buttonDot\"
388
                    <span class=\"subfield_controls\"><a href=\"#\" class=\"buttonDot\"
387
                       onclick=\"openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."'); return false;\" tabindex=\"1\" title=\"Tag Editor\"><img src=\"/intranet-tmpl/prog/img/edit-tag.png\" alt=\"Tag Editor\" /></a></span>
389
                       onclick=\"openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."','biblio'); return false;\" tabindex=\"1\" title=\"Tag Editor\"><img src=\"/intranet-tmpl/prog/img/edit-tag.png\" alt=\"Tag Editor\" /></a></span>
388
            ";
389
      } else {
390
        $subfield_data{marc_value} =
391
            "<input type=\"text\"
392
                    id=\"".$subfield_data{id}."\"
393
                    name=\"".$subfield_data{id}."\"
394
                    value=\"$value\"
395
                    class=\"input_marceditor readonly\"
396
                    tabindex=\"1\"
397
                    size=\"67\"
398
                    maxlength=\"".$subfield_data{maxlength}."\"
399
                    readonly=\"readonly\"
400
                    \/><span class=\"subfield_controls\"><a href=\"#\" class=\"buttonDot\"
401
                        onclick=\"openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."'); return false;\" tabindex=\"1\" title=\"Tag Editor\"><img src=\"/intranet-tmpl/prog/img/edit-tag.png\" alt=\"Tag Editor\" /></a></span>
402
            ";
390
            ";
403
      }
404
    # it's a plugin field
391
    # it's a plugin field
405
    }
392
    }
406
    elsif ( $tagslib->{$tag}->{$subfield}->{'value_builder'} ) {
393
    elsif ( $tagslib->{$tag}->{$subfield}->{'value_builder'} ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/cataloging.js (-2 / +3 lines)
Lines 33-39 function getTagInputnameFilter(tagsubfieldid){ Link Here
33
    return tagsubfield;
33
    return tagsubfield;
34
}
34
}
35
35
36
function openAuth(tagsubfieldid,authtype) {
36
// if source is "auth", we are editing an authority otherwise it is a biblio
37
function openAuth(tagsubfieldid,authtype,source) {
37
    // let's take the base of tagsubfield information (removing the indexes and the codes
38
    // let's take the base of tagsubfield information (removing the indexes and the codes
38
    var element=document.getElementById(tagsubfieldid);
39
    var element=document.getElementById(tagsubfieldid);
39
    var tagsubfield=getTagInputnameFilter(tagsubfieldid);
40
    var tagsubfield=getTagInputnameFilter(tagsubfieldid);
Lines 50-56 function openAuth(tagsubfieldid,authtype) { Link Here
50
            }
51
            }
51
        }
52
        }
52
    }
53
    }
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
    newin=window.open("../authorities/auth_finder.pl?source="+source+"&authtypecode="+authtype+"&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes');
54
}
55
}
55
56
56
function ExpandField(index) {
57
function ExpandField(index) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt (-39 lines)
Lines 102-145 function Check(){ Link Here
102
    }
102
    }
103
}
103
}
104
104
105
106
// returns the subfieldcode based upon subfieldid writing
107
function getSubfieldcode(tagsubfieldid){
108
    // 3 : tag +3 : tagnumber +4 : number of _ +8 subfield -1 begins at 0  
109
    return tagsubfieldid.substr(3+3+4+8-1,1);
110
}
111
112
// Take the base of tagsubfield information (removing the subfieldcodes and subfieldindexes)
113
// returns the filter
114
function getTagInputnameFilter(tagsubfieldid){
115
    var tagsubfield=tagsubfieldid.substr(0,tagsubfieldid.lastIndexOf("_"));  
116
    var tagcode=tagsubfield.substr(tagsubfield.lastIndexOf("_"));
117
    tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
118
    tagsubfield=tagsubfield.substr(0,tagsubfield.lastIndexOf("_"));
119
    tagsubfield=tagsubfield+"_."+tagcode;
120
    return tagsubfield;  
121
}
122
123
function openAuth(tagsubfieldid,authtype) {
124
    // let's take the base of tagsubfield information (removing the indexes and the codes
125
    var element=document.getElementById(tagsubfieldid);
126
    var tagsubfield=getTagInputnameFilter(tagsubfieldid);
127
    var elementsubfcode=getSubfieldcode(element.name);
128
    var mainmainstring=element.value;
129
    var mainstring="";  
130
    var inputs = element.parentNode.parentNode.getElementsByTagName("input");
131
132
    for (var myindex =0; myindex<inputs.length;myindex++){
133
        if (inputs[myindex].name && inputs[myindex].name.match(tagsubfield)){
134
            var subfieldcode=getSubfieldcode(inputs[myindex].name);
135
            if (isNaN(parseInt(subfieldcode)) && inputs[myindex].value != "" && subfieldcode!=elementsubfcode){
136
                mainstring=inputs[myindex].value+" "+mainstring;
137
            }      
138
        }
139
    }           
140
    newin=window.open("../authorities/auth_finder.pl?source=auth&authtypecode="+  authtype+ "&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes');
141
}
142
143
function AddField(field,cntrepeatfield) {
105
function AddField(field,cntrepeatfield) {
144
    document.forms['f'].op.value = "addfield";
106
    document.forms['f'].op.value = "addfield";
145
    document.forms['f'].addfield_field.value=field;
107
    document.forms['f'].addfield_field.value=field;
146
- 

Return to bug 7455