@@ -, +, @@ --- Koha/Schema/Result/ExportFormat.pm | 16 ++++++++++++++-- ...g_5087_-_add_opac_option_field_to_export_formats.perl | 8 ++++++++ installer/data/mysql/kohastructure.sql | 3 ++- .../intranet-tmpl/prog/en/modules/tools/csv-profiles.tt | 9 +++++++++ opac/opac-downloadcart.pl | 2 +- tools/csv-profiles.pl | 3 +++ 6 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_5087_-_add_opac_option_field_to_export_formats.perl --- a/Koha/Schema/Result/ExportFormat.pm +++ a/Koha/Schema/Result/ExportFormat.pm @@ -85,6 +85,12 @@ __PACKAGE__->table("export_format"); is_nullable: 1 size: 255 +=head2 opac_option + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + =cut __PACKAGE__->add_columns( @@ -123,6 +129,8 @@ __PACKAGE__->add_columns( is_nullable => 1, size => 255, }, + "opac_option", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, ); =head1 PRIMARY KEY @@ -138,8 +146,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("export_format_id"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:53 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YSQshI3mJfO0LsOlwvdIdg +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-20 20:08:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:J2VDj9yI8uanFR9EGv2sXw sub koha_object_class { 'Koha::CsvProfile'; @@ -148,4 +156,8 @@ sub koha_objects_class { 'Koha::CsvProfiles'; } +PACKAGE__->add_columns( + '+opac_option' => { is_boolean => 1 }, +); + 1; --- a/installer/data/mysql/atomicupdate/bug_5087_-_add_opac_option_field_to_export_formats.perl +++ a/installer/data/mysql/atomicupdate/bug_5087_-_add_opac_option_field_to_export_formats.perl @@ -0,0 +1,8 @@ +$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|); + } + + NewVersion( $DBversion, 5087, "Add export_format.opac_option" ); +} --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -688,7 +688,8 @@ CREATE TABLE `export_format` ( `encoding` varchar(255) NOT NULL DEFAULT 'utf8', `type` varchar(255) DEFAULT 'marc', `used_for` varchar(255) DEFAULT 'export_records', - PRIMARY KEY (`export_format_id`) + `opac_option` TINYINT(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`export_format_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Used for CSV export'; -- --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt @@ -192,6 +192,15 @@