@@ -, +, @@
once
- Selecting one report for deletion by checking the box.
- Selecting more than one report for deletion by checking boxes.
- Clicking the old "Delete" link
---
C4/Reports/Guided.pm | 18 +++++++++++-------
.../en/modules/reports/guided_reports_start.tt | 19 +++++++++++++++++--
reports/guided_reports.pl | 12 ++++++++++--
3 files changed, 38 insertions(+), 11 deletions(-)
--- a/C4/Reports/Guided.pm
+++ a/C4/Reports/Guided.pm
@@ -607,13 +607,17 @@ sub format_results {
}
sub delete_report {
- my ($id) = @_;
- my $dbh = C4::Context->dbh();
- my $query = "DELETE FROM saved_sql WHERE id = ?";
- my $sth = $dbh->prepare($query);
- $sth->execute($id);
-}
-
+ my ($ids) = @_;
+ if ($ids) {
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("DELETE FROM saved_sql WHERE id IN ($ids)");
+ $sth->execute();
+ $sth->finish;
+ return 1;
+ } else {
+ return 0;
+ }
+}
my $SAVED_REPORTS_BASE_QRY = <