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

(-)a/C4/Breeding.pm (-2 / +36 lines)
Lines 342-351 sub _do_xslt_proc { Link Here
342
    }
342
    }
343
}
343
}
344
344
345
sub _add_rowdata {
346
    my ($row, $record)=@_;
347
    my %fetch= (
348
        title => 'biblio.title',
349
        author => 'biblio.author',
350
        isbn =>'biblioitems.isbn',
351
        lccn =>'biblioitems.lccn', #LC control number (not call number)
352
        edition =>'biblioitems.editionstatement'
353
    );
354
    $fetch{date} = C4::Context->preference('marcflavour') eq "MARC21" ? 'biblio.copyrightdate' : 'biblioitems.publicationyear';
355
356
    #foreach my $k (keys %fetch) {
357
    #    $row->{$k} = C4::Biblio::TransformMarcToKohaOneField( $fetch{$k}, $record );
358
    #}
359
    $row->{date}//= $row->{date2};
360
    $row->{isbn}=_isbn_replace($row->{isbn});
361
362
    $row = _add_custom_field_rowdata(
363
            $row,
364
            $record,
365
            C4::Context->preference('AdditionalFieldsInZ3950ResultSearch'))
366
        if C4::Context->preference('AdditionalFieldsInZ3950ResultSearch');
367
    return $row;
368
}
369
345
sub _add_custom_field_rowdata
370
sub _add_custom_field_rowdata
346
{
371
{
347
    my ( $row, $record ) = @_;
372
    # my ( $row, $record ) = @_;
348
    my $pref_newtags = C4::Context->preference('AdditionalFieldsInZ3950ResultSearch');
373
    # my $pref_newtags = C4::Context->preference('AdditionalFieldsInZ3950ResultSearch');
374
    # hks3
375
    my ( $row, $record, $pref_newtags ) = @_;
349
    my $pref_flavour = C4::Context->preference('MarcFlavour');
376
    my $pref_flavour = C4::Context->preference('MarcFlavour');
350
377
351
    $pref_newtags =~ s/^\s+|\s+$//g;
378
    $pref_newtags =~ s/^\s+|\s+$//g;
Lines 602-607 sub Z3950SearchAuth { Link Here
602
                            $row_data{heading}      = $heading;
629
                            $row_data{heading}      = $heading;
603
                            $row_data{authid}       = $authid;
630
                            $row_data{authid}       = $authid;
604
                            $row_data{heading_code}      = $heading_authtype_code;
631
                            $row_data{heading_code}      = $heading_authtype_code;
632
                            my $pref_newtags =
633
                                C4::Context->preference('AdditionalFieldsInZ3950ResultAuthSearch');
634
                            if ($pref_newtags) {
635
                                my $row = {};
636
                                $row = _add_custom_field_rowdata($row, $marcrecord, $pref_newtags);
637
                                $row_data{row} = $row;
638
                            }
605
                            push( @breeding_loop, \%row_data );
639
                            push( @breeding_loop, \%row_data );
606
                        }
640
                        }
607
                        else {
641
                        else {
(-)a/installer/data/mysql/atomicupdate/bug_28166.pl (+18 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "28166",
5
    description => "Add system preference for additional columns for Z39.50 authority search results",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        # Do you stuffs here
10
        $dbh->do(q{INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
11
('AdditionalFieldsInZ3950ResultAuthSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of an authority Z39.50 search', 'Free')
12
});
13
        # Print useful stuff here
14
        # sysprefs
15
        say $out "Added new system preference 'AdditionalFieldsInZ3950ResultAuthSearch'";
16
    },
17
};
18
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 11-16 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
11
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
11
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
12
('ActionLogsTraceDepth', '0', '', 'Sets the maximum depth of the action logs stack trace', 'Integer'),
12
('ActionLogsTraceDepth', '0', '', 'Sets the maximum depth of the action logs stack trace', 'Integer'),
13
('AdditionalContentsEditor','tinymce','tinymce|codemirror','Choose tool for editing News.', 'Choice'),
13
('AdditionalContentsEditor','tinymce','tinymce|codemirror','Choose tool for editing News.', 'Choice'),
14
('AdditionalFieldsInZ3950ResultAuthSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of an authority Z39.50 search', 'Free'),
14
('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'),
15
('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'),
15
('AddressForFailedOverdueNotices', '', NULL, 'Destination email for failed overdue notices. If left empty then it will fallback to the first defined address in the following list: Library ReplyTo, Library Email, ReplytoDefault and KohaAdminEmailAddress', 'free'),
16
('AddressForFailedOverdueNotices', '', NULL, 'Destination email for failed overdue notices. If left empty then it will fallback to the first defined address in the following list: Library ReplyTo, Library Email, ReplytoDefault and KohaAdminEmailAddress', 'free'),
16
('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'),
17
('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref (+4 lines)
Lines 75-80 Authorities: Link Here
75
              default: "Work cat."
75
              default: "Work cat."
76
              type: textarea
76
              type: textarea
77
              class: code
77
              class: code
78
        -
79
            - Display the MARC field/subfields
80
            - pref: AdditionalFieldsInZ3950ResultAuthSearch
81
            - " in the 'Additional fields' column of Z39.50 search results (use comma as delimiter e.g.: \"<code>001, 035$a</code>\")"
78
82
79
    Linker:
83
    Linker:
80
        -
84
        -
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt (-1 / +16 lines)
Lines 1-5 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Koha %]
3
[% SET footerjs = 1 %]
4
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
[% IF ( opsearch ) %]
6
[% IF ( opsearch ) %]
Lines 80-85 Link Here
80
        <th>Server</th>
81
        <th>Server</th>
81
        <th>Heading</th>
82
        <th>Heading</th>
82
        <th>Authority type</th>
83
        <th>Authority type</th>
84
        [% IF Koha.Preference('AdditionalFieldsInZ3950ResultAuthSearch') %]
85
            <th>Additional fields</th>
86
        [% END %]
83
        <th class="noExport">Actions</th>
87
        <th class="noExport">Actions</th>
84
    </tr></thead>
88
    </tr></thead>
85
    <tbody>[% FOREACH breeding_loo IN breeding_loop %]
89
    <tbody>[% FOREACH breeding_loo IN breeding_loop %]
Lines 88-93 Link Here
88
            <td>[% breeding_loo.server | html %]</td>
92
            <td>[% breeding_loo.server | html %]</td>
89
            <td>[% breeding_loo.heading | html %]</td>
93
            <td>[% breeding_loo.heading | html %]</td>
90
            <td>[% breeding_loo.heading_code | html %]</td>
94
            <td>[% breeding_loo.heading_code | html %]</td>
95
            [% IF Koha.Preference('AdditionalFieldsInZ3950ResultAuthSearch') != '' %]
96
                <td>
97
                   <dl>
98
                      [% FOREACH addnumberfield IN breeding_loo.row.addnumberfields %]
99
                        [% FOREACH string IN breeding_loo.row.$addnumberfield %]
100
                            <dt>[% addnumberfield | html %]:</dt>
101
                            <dd>[% string | html %]</dd>
102
                        [% END %]
103
                      [% END %]
104
                   </dl>
105
                </td>
106
            [% END %]
91
            <td class="actions">
107
            <td class="actions">
92
                <div class="btn-group dropup">
108
                <div class="btn-group dropup">
93
                    <a class="btn btn-default btn-xs z3950actions" href="#">MARC</a><button class="btn-xs dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
109
                    <a class="btn btn-default btn-xs z3950actions" href="#">MARC</a><button class="btn-xs dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
94
- 

Return to bug 28166