Bugzilla – Attachment 74868 Details for
Bug 20495
Refactor C4::Reports.Guided - remove get_saved_report
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20495: Follow up to refactor tools/scheduler
Bug-20495-Follow-up-to-refactor-toolsscheduler.patch (text/plain), 2.14 KB, created by
Mark Tompsett
on 2018-04-26 00:02:59 UTC
(
hide
)
Description:
Bug 20495: Follow up to refactor tools/scheduler
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2018-04-26 00:02:59 UTC
Size:
2.14 KB
patch
obsolete
>From c1a0f5b1edbdcf349ea5cab1c75821094c6ebf69 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Wed, 25 Apr 2018 23:34:11 +0000 >Subject: [PATCH] Bug 20495: Follow up to refactor tools/scheduler > >TEST PLAN >--------- >This doesn't require the other patch applied. > >-- Make sure you have at least 2 saved reports. > If you create them from an empty DB, they are 1 and 2 > otherwise, you'll need to know their ID numbers. > >Home -> Tools -> Task Scheduler >-- The Report Dropdown has content! > >localhost:8081/cgi-bin/koha/tools/scheduler.pl?id=1 >-- The Report Dropdown is non-empty and correctly selected >-- Attempt with id=2, different report selected. > >apply this patch >restart_all > >Home -> Tools -> Task Scheduler >-- Report dropdown has same content! > >localhost:8081/cgi-bin/koha/tools/scheduler.pl?id=1 >-- The Report Dropdown is non-empty and correctly selected >-- Attempt with id=2, different report selected. >-- effectively no change. > >run koha qa test tools >--- > tools/scheduler.pl | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) > >diff --git a/tools/scheduler.pl b/tools/scheduler.pl >index 3cf6b7e..6b8fb50 100755 >--- a/tools/scheduler.pl >+++ b/tools/scheduler.pl >@@ -25,6 +25,7 @@ use C4::Auth; > use CGI qw ( -utf8 ); > use C4::Output; > use Koha::DateUtils;; >+use Koha::Reports; > > use vars qw($debug); > >@@ -106,14 +107,18 @@ foreach my $job ( values %$jobs ) { > > @jobloop = sort { $a->{TIME} cmp $b->{TIME} } @jobloop; > >-my $reports = get_saved_reports(); >-if ( defined $id ) { >- foreach my $report (@$reports) { >- $report->{'selected'} = 1 if $report->{'id'} eq $id; >- } >+my @reports = Koha::Reports->search({}); >+my @savedreports; >+foreach my $report (@reports) { >+ my $is_selected = defined $id ? $report->id eq $id : 0; >+ push @savedreports, { >+ 'id' => $report->id, >+ 'report_name' => $report->report_name, >+ 'selected' => $is_selected, >+ }; > } > >-$template->param( 'savedreports' => $reports ); >+$template->param( 'savedreports' => \@savedreports ); > $template->param( JOBS => \@jobloop ); > my $time = localtime(time); > $template->param( 'time' => $time ); >-- >2.1.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 20495
:
73423
|
74868
|
74869
|
74870
|
75653
|
75654
|
75716
|
75717