Bugzilla – Attachment 90745 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: Accept 'all' in the branch params
Bug-22566-Accept-all-in-the-branch-params.patch (text/plain), 1.94 KB, created by
Martin Renvoize (ashimema)
on 2019-06-18 13:27:58 UTC
(
hide
)
Description:
Bug 22566: Accept 'all' in the branch params
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-06-18 13:27:58 UTC
Size:
1.94 KB
patch
obsolete
>From b6802a9ca7eacc7a2a7f3b35663ad773c31c92a2 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 18 Jun 2019 12:57:07 +0100 >Subject: [PATCH] Bug 22566: Accept 'all' in the branch params > >--- > misc/cronjobs/stockrotation.pl | 27 ++++++++++++++++----------- > 1 file changed, 16 insertions(+), 11 deletions(-) > >diff --git a/misc/cronjobs/stockrotation.pl b/misc/cronjobs/stockrotation.pl >index f3c6b91f41..3143839c06 100755 >--- a/misc/cronjobs/stockrotation.pl >+++ b/misc/cronjobs/stockrotation.pl >@@ -126,20 +126,25 @@ my $ok = GetOptions( > 'admin-email|a=s' => \$admin_email, > 'branchcode|b=s' => sub { > my ( $opt_name, $opt_value ) = @_; >- my $branches = Koha::Libraries->search( {}, >- { order_by => { -asc => 'branchname' } } ); >- my $brnch = $branches->find($opt_value); >- if ($brnch) { >- $branch = $brnch; >- return $brnch; >+ if ( $opt_value eq 'all' ) { >+ $branch = 0; > } > else { >- printf("Option $opt_name should be one of (name -> code):\n"); >- while ( my $candidate = $branches->next ) { >- printf( " %-40s -> %s\n", >- $candidate->branchname, $candidate->branchcode ); >+ my $branches = Koha::Libraries->search( {}, >+ { order_by => { -asc => 'branchname' } } ); >+ my $brnch = $branches->find($opt_value); >+ if ($brnch) { >+ $branch = $brnch; >+ return $brnch; >+ } >+ else { >+ printf("Option $opt_name should be one of (name -> code):\n"); >+ while ( my $candidate = $branches->next ) { >+ printf( " %-40s -> %s\n", >+ $candidate->branchname, $candidate->branchcode ); >+ } >+ exit 1; > } >- exit 1; > } > }, > 'execute|x' => \$execute, >-- >2.20.1
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