Bugzilla – Attachment 90990 Details for
Bug 22566
Stock rotation cronjob reporting has issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22566: Fix some more issues
Bug-22566-Fix-some-more-issues.patch (text/plain), 3.98 KB, created by
Nick Clemens (kidclamp)
on 2019-06-25 12:41:43 UTC
(
hide
)
Description:
Bug 22566: Fix some more issues
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-06-25 12:41:43 UTC
Size:
3.98 KB
patch
obsolete
>From e4902a4d295f4311029c9f81d2d0db31adacbc65 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 7 Jun 2019 12:50:32 +0100 >Subject: [PATCH] Bug 22566: Fix some more issues > >1) Fix warning for undefined value in sprintf when no items have the >indemand flag set. >2) Corrections to report_full for bad ternary in string construction >3) Perldoc corrections > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/StockRotationRotas.pm | 1 + > misc/cronjobs/stockrotation.pl | 29 +++++++++++++++++------------ > 2 files changed, 18 insertions(+), 12 deletions(-) > >diff --git a/Koha/StockRotationRotas.pm b/Koha/StockRotationRotas.pm >index ba905ff2ed..0350707c16 100644 >--- a/Koha/StockRotationRotas.pm >+++ b/Koha/StockRotationRotas.pm >@@ -61,6 +61,7 @@ sub investigate { > actionable => 0, > advanceable => 0, > initiable => 0, >+ indemand => 0, > items_inactive => 0, > repatriable => 0, > rotas_active => 0, >diff --git a/misc/cronjobs/stockrotation.pl b/misc/cronjobs/stockrotation.pl >index 4df9d17117..f3c6b91f41 100755 >--- a/misc/cronjobs/stockrotation.pl >+++ b/misc/cronjobs/stockrotation.pl >@@ -220,7 +220,7 @@ sub report_full { > # Summary > $header .= "STOCKROTATION REPORT\n"; > $header .= "--------------------\n"; >- $body .= sprintf " >+ $body .= sprintf " > Total number of rotas: %5u > Inactive rotas: %5u > Active rotas: %5u >@@ -275,15 +275,19 @@ sub report_full { > > =head3 report_email > >- my $email_report = report_email($report); >+ my $email_report = report_email($report, [$branch]); > > Returns an arrayref containing a header string, with basic report information, > and any number of 'per_branch' strings, containing a detailed report about the > current state of the stockrotation subsystem, from the perspective of those > individual branches. > >-$REPORT should be the return value of `investigate`, and $BRANCH should be >-either 0 (to indicate 'all'), or a specific Koha::Library object. >+=over 2 >+ >+=item $report should be the return value of `investigate` >+=item $branch is optional and should be either 0 (to indicate 'all'), or a specific Koha::Library object. >+ >+=back > > No data in the database is manipulated by this procedure. > >@@ -323,7 +327,7 @@ sub report_email { > > =head3 _report_per_branch > >- my $branch_string = _report_per_branch($branch_details, $branchcode, $branchname); >+ my $branch_string = _report_per_branch($branch_details); > > return a string containing details about the stockrotation items and their > status for the branch identified by $BRANCHCODE. >@@ -346,6 +350,7 @@ sub _report_per_branch { > my $letter = C4::Letters::GetPreparedLetter( > module => 'circulation', > letter_code => "SR_SLIP", >+ branchcode => $branch->{code}, > message_transport_type => 'email', > substitute => $branch > ) >@@ -470,14 +475,14 @@ sub emit { > } > } > else { >- $addressee ||= q{}; >- $params->{admin_email} ||= q{}; >+ $addressee ||= >+ defined( $params->{admin_email} ) >+ ? $params->{admin_email} . "\n" >+ : 'No recipient found' . "\n"; > my $email = >- "-------- Email message --------" . "\n\n" . "To: " >- . defined($addressee) ? $addressee >- : defined( $params->{admin_email} ) ? $params->{admin_email} >- : '' . "\n" >- . "Subject: " >+ "-------- Email message --------" . "\n\n"; >+ $email .= "To: $addressee\n"; >+ $email .= "Subject: " > . $part->{letter}->{title} . "\n\n" > . $part->{letter}->{content}; > push @emails, $email; >-- >2.11.0
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 22566
:
86923
|
90421
|
90422
|
90423
|
90433
|
90434
|
90435
|
90742
|
90743
|
90744
|
90745
|
90746
|
90747
|
90748
|
90749
|
90750
|
90751
|
90752
|
90753
|
90989
| 90990 |
90991
|
90992
|
90993
|
90994
|
90995