Bugzilla – Attachment 18794 Details for
Bug 7688
Change subscriptions numbering pattern and frequencies
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 7688: Set firstacquidate in updatedatabase if it's not set
Bug-7688-Set-firstacquidate-in-updatedatabase-if-i.patch (text/plain), 3.71 KB, created by
Julian Maurice
on 2013-06-10 06:58:42 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 7688: Set firstacquidate in updatedatabase if it's not set
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2013-06-10 06:58:42 UTC
Size:
3.71 KB
patch
obsolete
>From 3ae84b4ed8a2c2462dfdf5a7a151d1aa30181489 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 22 Mar 2013 09:53:51 +0000 >Subject: [PATCH] Bug 7688: Set firstacquidate in updatedatabase if it's not set > >firstacquidate is now a mandatory field, so it must be set. >The updatedatabase process set firstacquidate value to one of: >- the planned date of the first serial for this subscription, or if not > found, >- the subscription start date. > >+ auto-select the numbering pattern when modifying a subscription. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >--- > installer/data/mysql/updatedatabase.pl | 32 ++++++++++++++++++++ > .../prog/en/modules/serials/subscription-add.tt | 2 +- > 2 files changed, 33 insertions(+), 1 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 0a276be..8c79014 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7207,6 +7207,38 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > ADD CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id) ON DELETE SET NULL ON UPDATE CASCADE > |); > >+ # Set firstacquidate if not already set (firstacquidate is now mandatory) >+ my $get_first_planneddate_sth = $dbh->prepare(qq| >+ SELECT planneddate >+ FROM serial >+ WHERE subscriptionid = ? >+ ORDER BY serialid >+ LIMIT 1 >+ |); >+ my $update_firstacquidate_sth = $dbh->prepare(qq| >+ UPDATE subscription >+ SET firstacquidate = ? >+ WHERE subscriptionid = ? >+ |); >+ my $get_subscriptions_sth = $dbh->prepare(qq| >+ SELECT subscriptionid, startdate >+ FROM subscription >+ WHERE firstacquidate IS NULL >+ OR firstacquidate = '0000-00-00' >+ |); >+ $get_subscriptions_sth->execute; >+ while ( my ($subscriptionid, $startdate) = $get_subscriptions_sth->fetchrow ) { >+ # Try to get the planned date of the first serial >+ $get_first_planneddate_sth->execute($subscriptionid); >+ my ($first_planneddate) = $get_first_planneddate_sth->fetchrow; >+ if ($first_planneddate and $first_planneddate =~ /^\d{4}-\d{2}-\d{2}$/) { >+ $update_firstacquidate_sth->execute($first_planneddate, $subscriptionid); >+ } else { >+ # Defaults to subscription start date >+ $update_firstacquidate_sth->execute($startdate, $subscriptionid); >+ } >+ } >+ > print "Upgrade to $DBversion done (Add subscription_frequencies and subscription_numberpatterns tables)\n"; > SetVersion($DBversion); > } >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 d98f0b6..b0d84ee 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 >@@ -693,7 +693,7 @@ $(document).ready(function() { > <option value="">-- please choose --</option> > [% FOREACH numberpattern IN numberpatterns %] > [% IF (numberpattern.selected) %] >- <option value="[% numberpattern.id %]"> >+ <option value="[% numberpattern.id %]" selected="selected"> > [% ELSE %] > <option value="[% numberpattern.id %]"> > [% END %] >-- >1.7.2.5
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 7688
:
8110
|
8941
|
8942
|
8943
|
10145
|
10146
|
10468
|
10469
|
10470
|
10739
|
10740
|
10742
|
10743
|
10903
|
10920
|
10985
|
11299
|
11300
|
11489
|
11490
|
12268
|
12269
|
13193
|
13194
|
13195
|
13196
|
14122
|
14123
|
14124
|
14125
|
14996
|
15492
|
15493
|
15494
|
15495
|
15496
|
15534
|
15536
|
15537
|
15538
|
15539
|
15540
|
15541
|
16679
|
16680
|
16681
|
16682
|
16683
|
16684
|
16744
|
17283
|
17284
|
17285
|
17855
|
17856
|
17857
|
18298
|
18299
|
18300
|
18793
| 18794 |
18795
|
19368
|
19369
|
19370
|
19393
|
19395