@@ -, +, @@ --- installer/data/mysql/sysprefs.sql | 2 ++ installer/data/mysql/updatedatabase.pl | 9 +++++++++ .../prog/en/modules/admin/preferences/serials.pref | 3 +++ serials/subscription-add.pl | 6 ++++++ 4 files changed, 20 insertions(+), 0 deletions(-) --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -358,3 +358,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('Babeltheque_url_js','','Url for Babeltheque javascript (e.g. http://www.babeltheque.com/bw_XX.js)','','Free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('Babeltheque_url_update', '', 'Url for Babeltheque update (E.G. http://www.babeltheque.com/.../file.csv.bz2)', '', 'Free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('SocialNetworks','1','Enable/Disable social networks links in opac detail pages','','YesNo'); +INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('SubscriptionDuplicateDroppedInput','','','List of fields which must not be rewritten when a subscription is duplicated (Separated by pipe |)','Free'); + --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -5086,6 +5086,15 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } + + +$DBversion = "3.07.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('SubscriptionDuplicateDroppedInput','','','List of fields which must not be rewritten when a subscription is duplicated (Separated by pipe |)','Free')"); + print "Upgrade to $DBversion done (Add System Preferences SubscriptionDuplicateDroppedInput)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref @@ -47,3 +47,6 @@ Serials: simplified: a summary full: a full list - of the serial issues. + - + - List of fields which must not be rewritten when a subscription is duplicated (Separated by pipe |) + - pref: SubscriptionDuplicateDroppedInput --- a/serials/subscription-add.pl +++ a/serials/subscription-add.pl @@ -113,6 +113,12 @@ if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') { firstacquiyear => substr($firstissuedate,0,4), ); } + + if ( $op eq 'dup' ) { + my $dont_copy_fields = C4::Context->preference('SubscriptionDuplicateDroppedInput'); + my @fields_id = map { fieldid => $_ }, split '|', $dont_copy_fields; + $template->param( dont_export_field_loop => \@fields_id ); + } } my $onlymine=C4::Context->preference('IndependantBranches') && --