Bugzilla – Attachment 18557 Details for
Bug 8956
Split serials enumeration data into separate fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8956 - Split serials enumeration data into separate fields - Part 4 - Add saving/editing of published end date for bound volumes
Bug-8956---Split-serials-enumeration-data-into-sep.patch (text/plain), 8.57 KB, created by
Kyle M Hall (khall)
on 2013-05-31 16:24:49 UTC
(
hide
)
Description:
Bug 8956 - Split serials enumeration data into separate fields - Part 4 - Add saving/editing of published end date for bound volumes
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-05-31 16:24:49 UTC
Size:
8.57 KB
patch
obsolete
>From 5937cf6ae5f517467509d3d43ad19c07b1dadd88 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 6 Mar 2013 13:42:11 -0500 >Subject: [PATCH] Bug 8956 - Split serials enumeration data into separate fields - Part 4 - Add saving/editing of published end date for bound volumes > >--- > C4/Serials.pm | 17 ++++++++--------- > .../prog/en/modules/serials/serials-edit.tt | 7 +++++++ > serials/serials-collection.pl | 2 +- > serials/serials-edit.pl | 11 +++++++++-- > 4 files changed, 25 insertions(+), 12 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index b76d3c1..3df72d6 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -1108,7 +1108,7 @@ Note : if we change from "waited" to something else,then we will have to create > =cut > > sub ModSerialStatus { >- my ( $serialid, $serialseq, $planneddate, $publisheddate, $status, $notes ) = @_; >+ my ( $serialid, $serialseq, $planneddate, $publisheddate, $published_end_date, $status, $notes ) = @_; > > #It is a usual serial > # 1st, get previous status : >@@ -1125,9 +1125,9 @@ sub ModSerialStatus { > } > else { > my $query = >-'UPDATE serial SET serialseq=?,publisheddate=?,planneddate=?,status=?,notes=? WHERE serialid = ?'; >+'UPDATE serial SET serialseq=?,publisheddate=?,published_end_date=?,planneddate=?,status=?,notes=? WHERE serialid = ?'; > $sth = $dbh->prepare($query); >- $sth->execute( $serialseq, $publisheddate, $planneddate, $status, $notes, $serialid ); >+ $sth->execute( $serialseq, $publisheddate, $published_end_date, $planneddate, $status, $notes, $serialid ); > $query = "SELECT * FROM subscription WHERE subscriptionid = ?"; > $sth = $dbh->prepare($query); > $sth->execute($subscriptionid); >@@ -1173,7 +1173,7 @@ sub ModSerialStatus { > > # next date (calculated from actual date & frequency parameters) > my $nextpublisheddate = GetNextDate( $publisheddate, $val ); >- NewIssue( $newserialseq, $subscriptionid, $val->{'biblionumber'}, 1, $nextpublisheddate, $nextpublisheddate, undef, $newlastvalue1, $newlastvalue2, $newlastvalue3 ); >+ NewIssue( $newserialseq, $subscriptionid, $val->{'biblionumber'}, 1, $nextpublisheddate, $nextpublisheddate, $published_end_date, undef, $newlastvalue1, $newlastvalue2, $newlastvalue3 ); > $query = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=? > WHERE subscriptionid = ?"; > $sth = $dbh->prepare($query); >@@ -1483,18 +1483,17 @@ returns the serial id > =cut > > sub NewIssue { >- my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $notes, $x, $y, $z ) = @_; >- warn "NewIssue( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $notes, $x, $y, $z )"; >+ my ( $serialseq, $subscriptionid, $biblionumber, $status, $planneddate, $publisheddate, $published_end_date, $notes, $x, $y, $z ) = @_; > ### FIXME biblionumber CAN be provided by subscriptionid. So Do we STILL NEED IT ? > > my $dbh = C4::Context->dbh; > my $query = qq| > INSERT INTO serial >- (serialseq,subscriptionid,biblionumber,status,publisheddate,planneddate,notes,serialseq_x,serialseq_y,serialseq_z) >- VALUES (?,?,?,?,?,?,?,?,?,?) >+ (serialseq,subscriptionid,biblionumber,status,publisheddate,published_end_date,planneddate,notes,serialseq_x,serialseq_y,serialseq_z) >+ VALUES (?,?,?,?,?,?,?,?,?,?,?) > |; > my $sth = $dbh->prepare($query); >- $sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, $publisheddate, $planneddate, $notes, $x, $y, $z ); >+ $sth->execute( $serialseq, $subscriptionid, $biblionumber, $status, $publisheddate, $published_end_date, $planneddate, $notes, $x, $y, $z ); > my $serialid = $dbh->{'mysql_insertid'}; > $query = qq| > SELECT missinglist,recievedlist >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >index 32b1932..c671ebc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >@@ -150,6 +150,7 @@ $(document).ready(function() { > <th>Expected on</th> > <th>Status</th> > <th>Notes</th> >+ <th>Bound volumes<br/>Ending published on</th> > </tr> > [% FOREACH serialslis IN serialslist %] > [% UNLESS ( loop.odd ) %] >@@ -225,6 +226,9 @@ $(document).ready(function() { > <td> > <input type="text" name="notes" value="[% serialslis.sernotes %]" size="20" maxlength="255" /> > </td> >+ <td> >+ <input type="text" name="published_end_date" value="[% serialslis.published_end_date %]" size="10" maxlength="15" class="datepicker" readonly="readonly"/> >+ </td> > </tr> > [% UNLESS ( serialslis.subscriptionexpired ) %] > [% IF ( serialslis.serialsadditems ) %] >@@ -335,6 +339,9 @@ $(document).ready(function() { > <td> > <input type="text" name="notes" value="" size="20" maxlength="255" /> > </td> >+ <td> >+ <input type="text" name="published_end_date" value="[% newserialloo.published_end_date %]" size="10" maxlength="15" class="datepicker" readonly="readonly"/> >+ </td> > </tr> > [% IF ( newserialloo.serialsadditems ) %] > <tr> >diff --git a/serials/serials-collection.pl b/serials/serials-collection.pl >index 500ebfa..0494096 100755 >--- a/serials/serials-collection.pl >+++ b/serials/serials-collection.pl >@@ -79,7 +79,7 @@ if($op eq 'gennext' && @subscriptionid){ > my $nextpublisheddate = GetNextDate( $expected->{planneddate}->output('iso'), $subscription ); > ## Creating the new issue > NewIssue( $newserialseq, $subscriptionid, $subscription->{'biblionumber'}, >- 1, $nextpublisheddate, $nextpublisheddate, undef, $newlastvalue1, $newlastvalue2, $newlastvalue3 ); >+ 1, $nextpublisheddate, $nextpublisheddate, undef, undef, $newlastvalue1, $newlastvalue2, $newlastvalue3 ); > > ## Updating the subscription seq status > my $squery = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=? >diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl >index 66d3a4e..5c68b23 100755 >--- a/serials/serials-edit.pl >+++ b/serials/serials-edit.pl >@@ -81,6 +81,7 @@ my @serialids = $query->param('serialid'); > my @serialseqs = $query->param('serialseq'); > my @planneddates = $query->param('planneddate'); > my @publisheddates = $query->param('publisheddate'); >+my @published_end_dates = $query->param('published_end_date'); > my @status = $query->param('status'); > my @notes = $query->param('notes'); > my @subscriptionids = $query->param('subscriptionid'); >@@ -134,7 +135,7 @@ foreach my $serialid (@serialids) { > && !$processedserialid{$serialid} ) > { > my $serinfo = GetSerialInformation($serialid); #TODO duplicates work done by GetSerials2 above >- for my $d ( qw( publisheddate planneddate )){ >+ for my $d ( qw( publisheddate planneddate published_end_date )){ > if ( $serinfo->{$d} =~m/^00/ ) { > $serinfo->{$d} = q{}; > } >@@ -206,7 +207,7 @@ if ( $op and $op eq 'serialchangestatus' ) { > > my $newserial; > for ( my $i = 0 ; $i <= $#serialids ; $i++ ) { >- my ($plan_date, $pub_date); >+ my ($plan_date, $pub_date, $pub_end_date); > > if (defined $planneddates[$i] && $planneddates[$i] ne 'XXX') { > $plan_date = format_date_in_iso( $planneddates[$i] ); >@@ -215,6 +216,10 @@ if ( $op and $op eq 'serialchangestatus' ) { > $pub_date = format_date_in_iso( $publisheddates[$i] ); > } > >+ if (defined $published_end_dates[$i] && $published_end_dates[$i] ne 'XXX') { >+ $pub_end_date = format_date_in_iso( $published_end_dates[$i] ); >+ } >+ > if ( $serialids[$i] && $serialids[$i] eq 'NEW' ) { > if ( $serialseqs[$i] ) { > >@@ -227,6 +232,7 @@ if ( $op and $op eq 'serialchangestatus' ) { > $status[$i], > $plan_date, > $pub_date, >+ $pub_end_date, > $notes[$i] > ); > } >@@ -237,6 +243,7 @@ if ( $op and $op eq 'serialchangestatus' ) { > $serialseqs[$i], > $plan_date, > $pub_date, >+ $pub_end_date, > $status[$i], > $notes[$i] > ); >-- >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 8956
:
13041
|
13042
|
13043
|
13044
|
13045
|
13046
|
13047
|
15914
|
15915
|
15916
|
15917
|
15918
|
15919
|
15920
|
16346
|
16347
|
16348
|
16349
|
16350
|
16351
|
16352
|
16353
|
18554
|
18555
|
18556
|
18557
|
18558
|
18559
|
18560
|
18561
|
18568
|
18569
|
18570
|
18571
|
18572
|
18573
|
18574
|
18575
|
18576
|
18577
|
18578
|
18579
|
18580
|
18581
|
18582
|
18583
|
18679