Bugzilla – Attachment 8077 Details for
Bug 5354
Partial duplication of a subscription
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 5354: Partial duplication of a subscription
0001-Bug-5354-Partial-duplication-of-a-subscription.patch (text/plain), 4.13 KB, created by
Jonathan Druart
on 2012-03-08 10:04:38 UTC
(
hide
)
Description:
Bug 5354: Partial duplication of a subscription
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-03-08 10:04:38 UTC
Size:
4.13 KB
patch
obsolete
>From 88abedcba0e57837bcdf735d3335cd625d3aff2b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 8 Mar 2012 10:45:32 +0100 >Subject: [PATCH 1/1] Bug 5354: Partial duplication of a subscription > >A new syspref (SubscriptionDuplicateDroppedInput) contains the list of fields to >duplicate when duplicating a subscription. The library will be able to >define that, for example, the internal note should not be duplicated > >Test plan: >On the detail subscription page, click Edit > Edit as New (Duplicate): >All the information must be copied from the original subscription. > >Fill the syspref SubscriptionDuplicateDroppedInput with a list of fields >you don't want to be duplicated (e.g. location;notes;branchcode). > >Repeat the duplicate action. Normally, information for these fields are >not copied. >--- > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../prog/en/modules/admin/preferences/serials.pref | 3 +++ > .../prog/en/modules/serials/subscription-add.tt | 10 ++++++++++ > serials/subscription-add.pl | 6 ++++++ > 4 files changed, 26 insertions(+), 0 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 33a3df6..4689129 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -4765,6 +4765,13 @@ 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 semicolon)','Free')"); >+ print "Upgrade to $DBversion done (Add System Preferences SubscriptionDuplicateDroppedInput)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 DropAllForeignKeys($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref >index 58db404..c696714 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref >@@ -42,3 +42,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 semicolon) >+ - pref: SubscriptionDuplicateDroppedInput >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >index 5301ce3..b9803ab 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >@@ -944,6 +944,16 @@ $(document).ready(function() { > $('#numberpattern').change( function() { > reset_num_pattern(); > }); >+ >+ var node; >+ [% FOREACH field IN dont_export_field_loop %] >+ node = $("#[% field.fieldid %]"); >+ if ( $(node).is('input') || $(node).is('textarea') ) { >+ $(node).val(""); >+ } else if ( $(node).is('select') ) { >+ $(node).find("option:first").attr('selected','selected'); >+ } >+ [% END %] > }); > //]]> > </script> >diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl >index 9acee7b..e0a60a5 100755 >--- a/serials/subscription-add.pl >+++ b/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') && >-- >1.7.7.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5354
:
8077
|
8255
|
8360
|
8386
|
8461
|
8629
|
8634