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 994-999 CREATE TABLE `auth_types` ( Link Here
994
  `authtypecode` varchar(10) NOT NULL DEFAULT '',
994
  `authtypecode` varchar(10) NOT NULL DEFAULT '',
995
  `authtypetext` varchar(255) NOT NULL DEFAULT '',
995
  `authtypetext` varchar(255) NOT NULL DEFAULT '',
996
  `auth_tag_to_report` varchar(3) NOT NULL DEFAULT '',
996
  `auth_tag_to_report` varchar(3) NOT NULL DEFAULT '',
997
  `subfield_to_report_in_1` varchar(5) NOT NULL DEFAULT '' COMMENT 'Authority subfield to report in biblio $1',
997
  `summary` longtext NOT NULL,
998
  `summary` longtext NOT NULL,
998
  PRIMARY KEY (`authtypecode`)
999
  PRIMARY KEY (`authtypecode`)
999
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1000
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authtypes.tt (-1 / +5 lines)
Lines 152-157 Link Here
152
                        <input type="hidden" name="is_a_modif" value="1" />
152
                        <input type="hidden" name="is_a_modif" value="1" />
153
                    [% END %]
153
                    [% END %]
154
                </li>
154
                </li>
155
                <li>
156
                    <label for="subfield_to_report_in_1">Authority subfield to copy in $1: </label>
157
                    <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" />
158
                    <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>
159
                </li>
155
            </ol>
160
            </ol>
156
        </fieldset>
161
        </fieldset>
157
        <fieldset class="action">
162
        <fieldset class="action">
158
- 

Return to bug 22972