is_nullable: 1
size: 255
-=head2 opac_option
+=head2 staff_only
data_type: 'tinyint'
default_value: 0
is_nullable => 1,
size => 255,
},
- "opac_option",
+ "staff_only",
{ data_type => "tinyint", default_value => 0, is_nullable => 0 },
);
__PACKAGE__->set_primary_key("export_format_id");
-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-20 20:08:25
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:J2VDj9yI8uanFR9EGv2sXw
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-07-20 14:15:46
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:O8kM+dd6GTS2qS39lnDG1g
sub koha_object_class {
'Koha::CsvProfile';
}
__PACKAGE__->add_columns(
- '+opac_option' => { is_boolean => 1 },
+ '+staff_only' => { is_boolean => 1 },
);
1;
$DBversion = 'XXX';
if( CheckVersion( $DBversion ) ) {
- unless( column_exists( 'export_format', 'opac_option' ) ) {
- $dbh->do(q|ALTER TABLE export_format ADD opac_option TINYINT(1) NOT NULL DEFAULT 0 AFTER used_for|);
+ unless( column_exists( 'export_format', 'staff_only' ) ) {
+ $dbh->do(q|
+ ALTER TABLE export_format
+ ADD staff_only TINYINT(1) NOT NULL DEFAULT 0 AFTER used_for,
+ ADD KEY `staff_only_idx` (`staff_only`);
+ |);
}
- NewVersion( $DBversion, 5087, "Add export_format.opac_option" );
+ NewVersion( $DBversion, 5087, "Add export_format.staff_only" );
}
`encoding` varchar(255) NOT NULL DEFAULT 'utf8',
`type` varchar(255) DEFAULT 'marc',
`used_for` varchar(255) DEFAULT 'export_records',
- `opac_option` TINYINT(1) NOT NULL DEFAULT 0,
- PRIMARY KEY (`export_format_id`)
+ `staff_only` TINYINT(1) NOT NULL DEFAULT 0,
+ PRIMARY KEY (`export_format_id`),
+ KEY `staff_only_idx` (`staff_only`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Used for CSV export';
--
</li>
<li class="marc_specific">
- <label for="opac_option">Show option in OPAC: </label>
- [% IF csv_profile.opac_option %]
- <input type="checkbox" name="opac_option" id="opac_option" value="1" checked="checked">
+ <label for="staff_only">Only available on the staff interface: </label>
+ [% IF csv_profile.staff_only %]
+ <input type="checkbox" name="staff_only" id="staff_only" value="1" checked="checked">
[% ELSE %]
- <input type="checkbox" name="opac_option" id="opac_option" value="1">
+ <input type="checkbox" name="staff_only" id="staff_only" value="1">
[% END %]
</li>
# my $itemsarray=\@items;
$template->param(
- csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records' }) ],
+ csv_profiles => [
+ Koha::CsvProfiles->search(
+ { type => 'marc', used_for => 'export_records', staff_only => 0 }
+ )
+ ],
bib_list => $bib_list,
BIBLIO_RESULTS => $resultsarray,
);
print $output;
} else {
- $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc', used_for => 'export_records', opac_option => 1 }) ]);
+ $template->param(
+ csv_profiles => [
+ Koha::CsvProfiles->search(
+ {
+ type => 'marc',
+ used_for => 'export_records',
+ staff_only => 0
+ }
+ )
+ ]
+ );
$template->param(bib_list => $bib_list);
output_html_with_http_headers $query, $cookie, $template->output;
}
my $field_separator = $input->param("field_separator");
my $subfield_separator = $input->param("subfield_separator");
my $encoding = $input->param("encoding");
- my $opac_option = $input->param("opac_option");
+ my $staff_only = $input->param("staff_only") ? 1 : 0;
if ($export_format_id) {
my $csv_profile = Koha::CsvProfiles->find($export_format_id)
$csv_profile->encoding($encoding);
$csv_profile->type($type);
$csv_profile->used_for($used_for);
- $csv_profile->opac_option($opac_option);
+ $csv_profile->staff_only($staff_only);
eval { $csv_profile->store; };
if ($@) {
encoding => $encoding,
type => $type,
used_for => $used_for,
- opac_option => $opac_option
+ staff_only => $staff_only
}
);
eval { $csv_profile->store; };