@@ -, +, @@ --- C4/Reports/Guided.pm | 57 ++-------------------- .../en/modules/reports/guided_reports_start.tt | 5 +- misc/cronjobs/runreport.pl | 4 -- reports/guided_reports.pl | 12 ----- 4 files changed, 5 insertions(+), 73 deletions(-) --- a/C4/Reports/Guided.pm +++ a/C4/Reports/Guided.pm @@ -43,7 +43,7 @@ BEGIN { get_report_types get_report_areas get_report_groups get_columns build_query get_criteria save_report get_saved_reports execute_query get_saved_report create_compound run_compound get_column_type get_distinct_values save_dictionary get_from_dictionary - delete_definition delete_report format_results get_sql + delete_definition delete_report get_sql nb_rows update_sql build_authorised_value_list GetReservedAuthorisedValues GetParametersFromSQL @@ -537,10 +537,6 @@ sub execute_query { $sth->execute(@$sql_params, $offset, $limit); return ( $sth, { queryerr => $sth->errstr } ) if ($sth->err); return ( $sth ); - # my @xmlarray = ... ; - # my $url = "/cgi-bin/koha/reports/guided_reports.pl?phase=retrieve%20results&id=$id"; - # my $xml = XML::Dumper->new()->pl2xml( \@xmlarray ); - # store_results($id,$xml); } =head2 save_report($sql,$name,$type,$notes) @@ -594,49 +590,6 @@ sub update_sql { $dbh->do($query, undef, $sql, $name, $group, $subgroup, $notes, $cache_expiry, $public, $id ); } -sub store_results { - my ($id,$xml)=@_; - my $dbh = C4::Context->dbh(); - my $query = "SELECT * FROM saved_reports WHERE report_id=?"; - my $sth = $dbh->prepare($query); - $sth->execute($id); - if (my $data=$sth->fetchrow_hashref()){ - my $query2 = "UPDATE saved_reports SET report=?,date_run=now() WHERE report_id=?"; - my $sth2 = $dbh->prepare($query2); - $sth2->execute($xml,$id); - } - else { - my $query2 = "INSERT INTO saved_reports (report_id,report,date_run) VALUES (?,?,now())"; - my $sth2 = $dbh->prepare($query2); - $sth2->execute($id,$xml); - } -} - -sub format_results { - my ($id) = @_; - my $dbh = C4::Context->dbh(); - my $query = "SELECT * FROM saved_reports WHERE report_id = ?"; - my $sth = $dbh->prepare($query); - $sth->execute($id); - my $data = $sth->fetchrow_hashref(); - my $dump = new XML::Dumper; - my $perl = $dump->xml2pl( $data->{'report'} ); - foreach my $row (@$perl) { - my $htmlrow=""; - foreach my $key (keys %$row){ - $htmlrow .= "$row->{$key}"; - } - $htmlrow .= ""; - $row->{'row'} = $htmlrow; - } - $sth->finish; - $query = "SELECT * FROM saved_sql WHERE id = ?"; - $sth = $dbh->prepare($query); - $sth->execute($id); - $data = $sth->fetchrow_hashref(); - return ($perl,$data->{'report_name'},$data->{'notes'}); -} - sub delete_report { my (@ids) = @_; return unless @ids; @@ -653,10 +606,9 @@ sub delete_report { sub get_saved_reports_base_query { my $area_name_sql_snippet = get_area_name_sql_snippet; return <{date}) { $date = format_date_in_iso($date); - push @cond, "DATE(date_run) = ? OR - DATE(date_created) = ? OR + push @cond, "DATE(date_created) = ? OR DATE(last_modified) = ? OR DATE(last_run) = ?"; - push @args, $date, $date, $date, $date; + push @args, $date, $date, $date; } if (my $author = $filter->{author}) { $author = "%$author%"; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -81,7 +81,7 @@ $(document).ready(function(){ { "aTargets": [ 1, 2 ], "sType": "natural" } ], "aoColumns": [ - null,null,null,null,null,null,null,null,{ "sType": "title-string" },null,[% IF (usecache) %]null,[% END %]null,null + null,null,null,null,null,null,null,null,{ "sType": "title-string" },null,[% IF (usecache) %]null,[% END %]null ], 'oLanguage': { 'sZeroRecords': _("No matching reports found") @@ -315,7 +315,6 @@ canned reports and writing custom SQL reports.

Creation date Public [% IF (usecache) %] Cache expiry (seconds) [% END %] - Saved results   @@ -343,8 +342,6 @@ canned reports and writing custom SQL reports.

No [% END %] [% IF (usecache) %] [% savedreport.cache_expiry %] [% END %] - [% IF ( savedreport.date_run ) %][% savedreport.date_run %][% END %] -