Bugzilla – Attachment 8386 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.91 KB, created by
Jonathan Druart
on 2012-03-21 09:39:14 UTC
(
hide
)
Description:
Bug 5354 Partial duplication of a subscription
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-03-21 09:39:14 UTC
Size:
4.91 KB
patch
obsolete
>From d9a772b6a34531d96f84895ca787a87b813d7ef2 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 | 9 +++++++++ > .../prog/en/modules/admin/preferences/serials.pref | 3 +++ > .../prog/en/modules/serials/subscription-add.tt | 12 +++++++++++- > serials/subscription-add.pl | 6 ++++++ > 4 files changed, 29 insertions(+), 1 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 4f21435..b8a78f8 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -4944,6 +4944,15 @@ if ( C4::Context->preference("Version") < TransformToNum($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 1950ba6..7de32d9 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 >@@ -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 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..b0698e0 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> >@@ -1333,7 +1343,7 @@ $(document).ready(function() { > [% IF ( subtype_numberlength ) %]<option value="numberlength" selected="selected">[% ELSE %]<option value="numberlength">[% END %] Number of issues</option> > [% IF ( subtype_weeklength ) %]<option value="weeklength" selected="selected">[% ELSE %]<option value="weeklength">[% END %] Number of weeks</option> > </select> >- <input type="text" name="sublength" value="[% sublength %]" size="3" onkeypress="return check_input(event)" /> (enter amount in numerals) >+ <input type="text" id="numberlength" name="sublength" value="[% sublength %]" size="3" onkeypress="return check_input(event)" /> (enter amount in numerals) > <span class="required">Required</span> > </li> > <li> >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