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

(-)a/C4/AuthoritiesMarc.pm (-1 / +1 lines)
Lines 1362-1368 sub merge { Link Here
1362
                if ($auth_number==$mergefrom) {
1362
                if ($auth_number==$mergefrom) {
1363
                my $field_to=MARC::Field->new(($tag_to?$tag_to:$tag),$field->indicator(1),$field->indicator(2),"9"=>$mergeto);
1363
                my $field_to=MARC::Field->new(($tag_to?$tag_to:$tag),$field->indicator(1),$field->indicator(2),"9"=>$mergeto);
1364
		my $exclude='9';
1364
		my $exclude='9';
1365
                foreach my $subfield (@record_to) {
1365
                foreach my $subfield (grep {$_->[0] ne 9} @record_to) {
1366
                    $field_to->add_subfields($subfield->[0] =>$subfield->[1]);
1366
                    $field_to->add_subfields($subfield->[0] =>$subfield->[1]);
1367
		    $exclude.= $subfield->[0];
1367
		    $exclude.= $subfield->[0];
1368
                }
1368
                }
(-)a/C4/Biblio.pm (-5 / +13 lines)
Lines 1721-1730 sub GetMarcSubjects { Link Here
1721
            if ( $counter != 0 ) {
1721
            if ( $counter != 0 ) {
1722
                $operator = ' and ';
1722
                $operator = ' and ';
1723
            }
1723
            }
1724
            if ( $code eq 9 ) {
1724
            if ( $code eq 9 and $linkvalue ne " 0 ") {
1725
                $found9 = 1;
1725
                $found9 = 1;
1726
                @link_loop = ( { 'limit' => 'an', link => "$linkvalue" } );
1726
                @link_loop = ( { 'limit' => 'an', link => "$linkvalue" } );
1727
            }
1727
            }
1728
            if ( $code eq 9 and $linkvalue eq " 0 ") {
1729
                next;
1730
            }
1728
            if ( not $found9 ) {
1731
            if ( not $found9 ) {
1729
                push @link_loop, { 'limit' => $subject_limit, link => $linkvalue, operator => $operator };
1732
                push @link_loop, { 'limit' => $subject_limit, link => $linkvalue, operator => $operator };
1730
            }
1733
            }
Lines 1780-1786 sub GetMarcAuthors { Link Here
1780
        my $count_auth = 0;
1783
        my $count_auth = 0;
1781
1784
1782
        # if there is an authority link, build the link with Koha-Auth-Number: subfield9
1785
        # if there is an authority link, build the link with Koha-Auth-Number: subfield9
1783
        my $subfield9 = $field->subfield('9');
1786
        my $found9 ;
1784
        for my $authors_subfield (@subfields) {
1787
        for my $authors_subfield (@subfields) {
1785
1788
1786
            # don't load unimarc subfields 3, 5
1789
            # don't load unimarc subfields 3, 5
Lines 1795-1803 sub GetMarcAuthors { Link Here
1795
            }
1798
            }
1796
1799
1797
            # if we have an authority link, use that as the link, otherwise use standard searching
1800
            # if we have an authority link, use that as the link, otherwise use standard searching
1798
            if ($subfield9) {
1801
            if ( $subfieldcode eq 9 and $linkvalue ne " 0 ") {
1799
                @link_loop = ( { 'limit' => 'an', link => "$subfield9" } );
1802
                $found9 = 1;
1800
            } else {
1803
                @link_loop = ( { 'limit' => 'an', link => "$linkvalue" } );
1804
            }
1805
            if ( not $found9 ) {
1806
                push @link_loop, { 'limit' => 'au', link => $linkvalue, operator => $operator };
1807
            }
1808
            unless ($found9){
1801
1809
1802
                # reset $linkvalue if UNIMARC author responsibility
1810
                # reset $linkvalue if UNIMARC author responsibility
1803
                if ( $marcflavour eq 'UNIMARC' and ( $authors_subfield->[0] eq "4" ) ) {
1811
                if ( $marcflavour eq 'UNIMARC' and ( $authors_subfield->[0] eq "4" ) ) {
(-)a/authorities/blinddetail-biblio-search.pl (+1 lines)
Lines 84-89 if ($authid) { Link Here
84
    # Get all values for each distinct subfield
84
    # Get all values for each distinct subfield
85
    my %subfields;
85
    my %subfields;
86
    for ( $field->subfields ) {
86
    for ( $field->subfields ) {
87
        next if $_->[0] == "9";
87
        my $letter = $_->[0];
88
        my $letter = $_->[0];
88
        next if defined $subfields{$letter};
89
        next if defined $subfields{$letter};
89
        my @values = $field->subfield($letter);
90
        my @values = $field->subfield($letter);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt (-19 / +20 lines)
Lines 13-36 Link Here
13
        }
13
        }
14
14
15
        var field_start = whichfield.parentNode.parentNode;
15
        var field_start = whichfield.parentNode.parentNode;
16
      
17
        // browse all its subfields (clear and $9)
18
        var subfields = field_start.getElementsByTagName('input');
19
        var re = /^tag_\d*_code_/;
20
        for(var i=0, len = subfields.length ; i< len ; i++) { // browse all subfields
21
            if(subfields[i].getAttribute('name').match(re)){ // it s a subfield
22
                var code     = subfields[i];   // code is the first input 
23
                var subfield = subfields[i+1]; // subfield the second
24
25
            [% IF ( clear ) %]
26
                if (subfield){subfield.value="" ;}
27
            [% ELSE %]
28
                if(code.value=='9'){
29
                    subfield.value = "[% authid |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
30
                }
31
            [% END %]
32
            }
33
        }
34
16
35
        // Sets the good number of form fields for the specified subfield
17
        // Sets the good number of form fields for the specified subfield
36
        // Returns false if the cloning failed
18
        // Returns false if the cloning failed
Lines 90-95 Link Here
90
            });
72
            });
91
        }
73
        }
92
74
75
        [% UNLESS ( clear ) %]
93
        [% FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP %]
76
        [% FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP %]
94
            SetSubfieldValues(
77
            SetSubfieldValues(
95
                "[% tag_number |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %][% SUBFIELD_LOO.marc_subfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
78
                "[% tag_number |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %][% SUBFIELD_LOO.marc_subfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
Lines 98-103 Link Here
98
            [% END %]
81
            [% END %]
99
            );
82
            );
100
        [% END %]
83
        [% END %]
84
        [% END %]
85
        
86
        // browse all its subfields (clear and $9)
87
        var subfields = field_start.getElementsByTagName('input');
88
        var re = /^tag_\d*_code_/;
89
        for(var i=0, len = subfields.length ; i< len ; i++) { // browse all subfields
90
            if(subfields[i].getAttribute('name').match(re)){ // it s a subfield
91
                var code     = subfields[i];   // code is the first input 
92
                var subfield = subfields[i+1]; // subfield the second
93
94
            [% IF ( clear ) %]
95
                if (subfield){subfield.value="" ;}
96
            [% ELSE %]
97
                if(code.value=='9'){
98
                    subfield.value = "[% authid |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
99
                }
100
            [% END %]
101
            }
102
        }
101
103
102
      	opener.close();
104
      	opener.close();
103
       	window.close();
105
       	window.close();
104
- 

Return to bug 8071