Bugzilla – Attachment 18059 Details for
Bug 9739
more options for serialsUpdate.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch (followup)
0002-Bug-9739-more-options-for-serialsUpdate.pl-followup.patch (text/plain), 3.89 KB, created by
Fridolin Somers
on 2013-05-10 07:55:16 UTC
(
hide
)
Description:
Proposed patch (followup)
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2013-05-10 07:55:16 UTC
Size:
3.89 KB
patch
obsolete
>From 47e08f590682ad52afe4d63eb0f05ad29e354b39 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Fri, 1 Mar 2013 14:36:14 +0100 >Subject: [PATCH 2/2] Bug 9739: more options for serialsUpdate.pl (followup) > >cosmetic changes : >perltidy >q{} for query >list of columns is query instead of SELECT * >--- > misc/cronjobs/serialsUpdate.pl | 50 +++++++++++++++++++++++++--------------- > 1 file changed, 31 insertions(+), 19 deletions(-) > >diff --git a/misc/cronjobs/serialsUpdate.pl b/misc/cronjobs/serialsUpdate.pl >index 2680d4a..d82a0bb 100755 >--- a/misc/cronjobs/serialsUpdate.pl >+++ b/misc/cronjobs/serialsUpdate.pl >@@ -79,17 +79,23 @@ pod2usage( -verbose => 2 ) if $man; > > $verbose and !$confirm and print "### Database will not be modified ###\n"; > >-if ($note && $nonote) { >+if ( $note && $nonote ) { > $note = ''; > } >-if (!$note && !$nonote) { >+if ( !$note && !$nonote ) { > $note = 'Automatically set to late'; > } > $verbose and print $note ? "Note : $note\n" : "No note\n"; > > # select all serials with not "irregular" periodicity that are late >-my $sth = $dbh->prepare(" >- SELECT * >+my $sth = $dbh->prepare( >+ q{ >+ SELECT >+ serial.serialid, >+ serial.serialseq, >+ serial.planneddate, >+ serial.publisheddate >+ subscription.subscriptionid > FROM serial > LEFT JOIN subscription > ON (subscription.subscriptionid=serial.subscriptionid) >@@ -97,19 +103,20 @@ my $sth = $dbh->prepare(" > AND periodicity <> 32 > AND DATE_ADD(planneddate, INTERVAL CAST(graceperiod AS SIGNED) DAY) < NOW() > AND subscription.closed = 0 >- "); >+ } >+); > $sth->execute(); > > while ( my $issue = $sth->fetchrow_hashref ) { > >- my $subscription = &GetSubscription( $issue->{subscriptionid} ); >- my $planneddate = $issue->{planneddate}; >+ my $subscription = &GetSubscription( $issue->{subscriptionid} ); >+ my $planneddate = $issue->{planneddate}; > >- if( $subscription && $planneddate && $planneddate ne "0000-00-00" ){ >+ if ( $subscription && $planneddate && $planneddate ne "0000-00-00" ) { > my $nextpublisheddate = GetNextDate( $planneddate, $subscription ); >- my $today = format_date_in_iso( C4::Dates->new()->output() ); >+ my $today = format_date_in_iso( C4::Dates->new()->output() ); > >- if ($nextpublisheddate && $today){ >+ if ( $nextpublisheddate && $today ) { > my ( $year, $month, $day ) = split( /-/, $nextpublisheddate ); > my ( $tyear, $tmonth, $tday ) = split( /-/, $today ); > if ( check_date( $year, $month, $day ) >@@ -117,16 +124,21 @@ while ( my $issue = $sth->fetchrow_hashref ) { > && Date_to_Days( $year, $month, $day ) < > Date_to_Days( $tyear, $tmonth, $tday ) ) > { >- $confirm and >- ModSerialStatus( $issue->{serialid}, $issue->{serialseq}, >- $issue->{planneddate}, $issue->{publisheddate}, >- 3, $note ); >- $verbose and print "Serial id=" . $issue->{serialid}." update\n"; >+ $confirm >+ and ModSerialStatus( $issue->{serialid}, $issue->{serialseq}, >+ $issue->{planneddate}, $issue->{publisheddate}, >+ 3, $note ); >+ $verbose >+ and print "Serial id=" . $issue->{serialid} . " update\n"; > } >- }else{ >- $verbose and print "Error with serial(".$issue->{serialid}.") has no existent >- subscription(".$issue->{subscriptionid}.") attached >- or planneddate is wrong\n"; >+ } >+ else { >+ $verbose >+ and print "Error with serial(" >+ . $issue->{serialid} >+ . ") has no existent subscription(" >+ . $issue->{subscriptionid} >+ . ") attached or planneddate is wrong\n"; > } > } > } >-- >1.7.10.4 >
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 9739
:
15800
|
15801
|
18058
|
18059
|
20871
|
20872
|
20873
|
21588
|
21589
|
21590
|
21592