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

(-)a/admin/authtypes.pl (+3 lines)
Lines 51-56 if ( $op eq 'add_form' ) { Link Here
51
    my $authtypecode       = $input->param('authtypecode');
51
    my $authtypecode       = $input->param('authtypecode');
52
    my $authtypetext       = $input->param('authtypetext');
52
    my $authtypetext       = $input->param('authtypetext');
53
    my $auth_tag_to_report = $input->param('auth_tag_to_report');
53
    my $auth_tag_to_report = $input->param('auth_tag_to_report');
54
    my $subfield_to_report_in_1 = $input->param('subfield_to_report_in_1');
54
    my $summary            = $input->param('summary');
55
    my $summary            = $input->param('summary');
55
    my $is_a_modif         = $input->param('is_a_modif');
56
    my $is_a_modif         = $input->param('is_a_modif');
56
57
Lines 58-63 if ( $op eq 'add_form' ) { Link Here
58
        my $authority_type = Koha::Authority::Types->find($authtypecode);
59
        my $authority_type = Koha::Authority::Types->find($authtypecode);
59
        $authority_type->authtypetext($authtypetext);
60
        $authority_type->authtypetext($authtypetext);
60
        $authority_type->auth_tag_to_report($auth_tag_to_report);
61
        $authority_type->auth_tag_to_report($auth_tag_to_report);
62
        $authority_type->subfield_to_report_in_1($subfield_to_report_in_1);
61
        $authority_type->summary($summary);
63
        $authority_type->summary($summary);
62
        eval { $authority_type->store; };
64
        eval { $authority_type->store; };
63
        if ($@) {
65
        if ($@) {
Lines 70-75 if ( $op eq 'add_form' ) { Link Here
70
            {   authtypecode       => $authtypecode,
72
            {   authtypecode       => $authtypecode,
71
                authtypetext       => $authtypetext,
73
                authtypetext       => $authtypetext,
72
                auth_tag_to_report => $auth_tag_to_report,
74
                auth_tag_to_report => $auth_tag_to_report,
75
                subfield_to_report_in_1 => $subfield_to_report_in_1,
73
                summary            => $summary,
76
                summary            => $summary,
74
            }
77
            }
75
        );
78
        );
(-)a/authorities/blinddetail-biblio-search.pl (+13 lines)
Lines 94-99 if ($authid) { Link Here
94
        $done_subfields{$letter} = 1;
94
        $done_subfields{$letter} = 1;
95
    }
95
    }
96
96
97
    if (my $subfield_to_report_in_1 = $auth_type->subfield_to_report_in_1) {
98
        my ($tag, $code) = split /\$/, $subfield_to_report_in_1;
99
        my @marc_values;
100
        foreach my $field ($record->field($tag)) {
101
            foreach my $subfield ($field->subfield($code)) {
102
                push @marc_values, $subfield;
103
            }
104
        }
105
        if (@marc_values) {
106
            push @subfield_loop, { marc_subfield => '1', marc_values => \@marc_values };
107
        }
108
    }
109
97
    push( @subfield_loop, { marc_subfield => 'w', marc_values => $relationship } ) if ( $relationship );
110
    push( @subfield_loop, { marc_subfield => 'w', marc_values => $relationship } ) if ( $relationship );
98
111
99
    my $controlled_ind = $auth->controlled_indicators({ record => $record, biblio_tag => $tag_number });
112
    my $controlled_ind = $auth->controlled_indicators({ record => $record, biblio_tag => $tag_number });
(-)a/installer/data/mysql/atomicupdate/bug-22972.pl (+17 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "22972",
5
    description => "Add auth_types.subfield_to_report_in_1",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        unless (column_exists('auth_types', 'subfield_to_report_in_1')) {
10
            $dbh->do(q{
11
                ALTER TABLE auth_types
12
                ADD COLUMN subfield_to_report_in_1 varchar(5) NOT NULL DEFAULT ''
13
                COMMENT 'Authority subfield to report in biblio $1'
14
            });
15
        }
16
    },
17
};
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 975-980 CREATE TABLE `auth_types` ( Link Here
975
  `authtypecode` varchar(10) NOT NULL DEFAULT '',
975
  `authtypecode` varchar(10) NOT NULL DEFAULT '',
976
  `authtypetext` varchar(255) NOT NULL DEFAULT '',
976
  `authtypetext` varchar(255) NOT NULL DEFAULT '',
977
  `auth_tag_to_report` varchar(3) NOT NULL DEFAULT '',
977
  `auth_tag_to_report` varchar(3) NOT NULL DEFAULT '',
978
  `subfield_to_report_in_1` varchar(5) NOT NULL DEFAULT '' COMMENT 'Authority subfield to report in biblio $1',
978
  `summary` longtext NOT NULL,
979
  `summary` longtext NOT NULL,
979
  PRIMARY KEY (`authtypecode`)
980
  PRIMARY KEY (`authtypecode`)
980
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
981
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt (-2 / +7 lines)
Lines 123-136 Link Here
123
                    <textarea id="summary" name="summary" cols="55" rows="7">[% authority_type.summary | html %]</textarea>
123
                    <textarea id="summary" name="summary" cols="55" rows="7">[% authority_type.summary | html %]</textarea>
124
                </li>
124
                </li>
125
                <li>
125
                <li>
126
                    <div class="hint">Note: for 'Authority field to copy', enter the authority field that should be copied from the authority record to the bibliographic record. E.g., in MARC21, field 100 in the authority record should be copied to field 100 in the bibliographic record</div>
127
                    <label for="auth_tag_to_report">Authority field to copy: </label>
126
                    <label for="auth_tag_to_report">Authority field to copy: </label>
128
                    <input type="text" id="auth_tag_to_report" name="auth_tag_to_report" size="5" maxlength="3" value="[% authority_type.auth_tag_to_report | html %]" />
127
                    <input type="text" id="auth_tag_to_report" name="auth_tag_to_report" size="5" maxlength="3" value="[% authority_type.auth_tag_to_report | html %]" />
128
                    <div class="hint">Note: for 'Authority field to copy', enter the authority field that should be copied from the authority record to the bibliographic record. E.g., in MARC21, field 100 in the authority record should be copied to field 100 in the bibliographic record</div>
129
129
                    <input type="hidden" name="op" value="add_validate" />
130
                    <input type="hidden" name="op" value="add_validate" />
130
                    [% IF authority_type.authtypecode.defined %]
131
                    [% IF authority_type.authtypecode.defined %]
131
                        <input type="hidden" name="is_a_modif" value="1" />
132
                        <input type="hidden" name="is_a_modif" value="1" />
132
                    [% END %]
133
                    [% END %]
133
                </li>
134
                </li>
135
                <li>
136
                    <label for="subfield_to_report_in_1">Authority subfield to copy in $1: </label>
137
                    <input type="text" id="subfield_to_report_in_1" name="subfield_to_report_in_1" size="7" maxlength="5" value="[% authority_type.subfield_to_report_in_1 | html %]" placeholder="024$a" />
138
                    <div class="hint">Enter the authority subfield that should be copied from the authority record to the bibliographic record in $1. E.g., in MARC21, field 024$1 in the authority record should be copied to field 700$1 in the bibliographic record</div>
139
                </li>
134
            </ol>
140
            </ol>
135
        </fieldset>
141
        </fieldset>
136
        <fieldset class="action">
142
        <fieldset class="action">
137
- 

Return to bug 22972