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

(-)a/installer/data/mysql/atomicupdate/bug_5087_-_add_opac_option_field_to_export_formats.perl (+9 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    unless( column_exists( 'export_format', 'opac_option' ) ) {
4
        $dbh->do(q|ALTER TABLE export_format ADD opac_option TINYINT(1) NOT NULL DEFAULT 0 AFTER used_for|);
5
    }
6
7
    SetVersion( $DBversion );
8
    print "Upgrade to $DBversion done (Bug 5087: Add export_format.opac_option)\n";
9
}
(-)a/installer/data/mysql/kohastructure.sql (-1 / +2 lines)
Lines 673-679 CREATE TABLE `export_format` ( Link Here
673
  `encoding` varchar(255) NOT NULL DEFAULT 'utf8',
673
  `encoding` varchar(255) NOT NULL DEFAULT 'utf8',
674
  `type` varchar(255) DEFAULT 'marc',
674
  `type` varchar(255) DEFAULT 'marc',
675
  `used_for` varchar(255) DEFAULT 'export_records',
675
  `used_for` varchar(255) DEFAULT 'export_records',
676
  PRIMARY KEY  (`export_format_id`)
676
  `opac_option` TINYINT(1) NOT NULL DEFAULT 0,
677
  PRIMARY KEY (`export_format_id`)
677
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Used for CSV export';
678
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Used for CSV export';
678
679
679
--
680
--
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt (+9 lines)
Lines 192-197 Link Here
192
                </li>
192
                </li>
193
193
194
                <li class="marc_specific">
194
                <li class="marc_specific">
195
                    <label for="opac_option">Show option in OPAC: </label>
196
                    [% IF csv_profile.opac_option %]
197
                        <input type="checkbox" name="opac_option" id="opac_option" value="1" checked="checked">
198
                    [% ELSE %]
199
                        <input type="checkbox" name="opac_option" id="opac_option" value="1">
200
                    [% END %]
201
                </li>
202
203
                <li class="marc_specific">
195
                    <label for="marc_content" class="required">Profile MARC fields: </label>
204
                    <label for="marc_content" class="required">Profile MARC fields: </label>
196
                    <textarea cols="50" rows="2" name="marc_content" id="marc_content">[% csv_profile.content | html %]</textarea>
205
                    <textarea cols="50" rows="2" name="marc_content" id="marc_content">[% csv_profile.content | html %]</textarea>
197
                    <span class="required">Required</span>
206
                    <span class="required">Required</span>
(-)a/opac/opac-downloadcart.pl (-1 / +1 lines)
Lines 122-128 if ($bib_list && $format) { Link Here
122
    print $output;
122
    print $output;
123
123
124
} else { 
124
} else { 
125
    $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' }) ]);
125
    $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records', opac_option => 1 }) ]);
126
    $template->param(bib_list => $bib_list); 
126
    $template->param(bib_list => $bib_list); 
127
    output_html_with_http_headers $query, $cookie, $template->output;
127
    output_html_with_http_headers $query, $cookie, $template->output;
128
}
128
}
(-)a/tools/csv-profiles.pl (-1 / +3 lines)
Lines 84-89 if ( $op eq 'add_form' ) { Link Here
84
    my $field_separator    = $input->param("field_separator");
84
    my $field_separator    = $input->param("field_separator");
85
    my $subfield_separator = $input->param("subfield_separator");
85
    my $subfield_separator = $input->param("subfield_separator");
86
    my $encoding           = $input->param("encoding");
86
    my $encoding           = $input->param("encoding");
87
    my $opac_option        = $input->param("opac_option");
87
88
88
    if ($export_format_id) {
89
    if ($export_format_id) {
89
        my $csv_profile = Koha::CsvProfiles->find($export_format_id)
90
        my $csv_profile = Koha::CsvProfiles->find($export_format_id)
Lines 97-102 if ( $op eq 'add_form' ) { Link Here
97
        $csv_profile->encoding($encoding);
98
        $csv_profile->encoding($encoding);
98
        $csv_profile->type($type);
99
        $csv_profile->type($type);
99
        $csv_profile->used_for($used_for);
100
        $csv_profile->used_for($used_for);
101
        $csv_profile->opac_option($opac_option);
100
        eval { $csv_profile->store; };
102
        eval { $csv_profile->store; };
101
103
102
        if ($@) {
104
        if ($@) {
Lines 115-120 if ( $op eq 'add_form' ) { Link Here
115
                encoding           => $encoding,
117
                encoding           => $encoding,
116
                type               => $type,
118
                type               => $type,
117
                used_for           => $used_for,
119
                used_for           => $used_for,
120
                opac_option        => $opac_option
118
            }
121
            }
119
        );
122
        );
120
        eval { $csv_profile->store; };
123
        eval { $csv_profile->store; };
121
- 

Return to bug 5087