Bug 10706: Search reports by id
authorJonathan Druart <jonathan.druart@biblibre.com>
Thu, 16 Apr 2015 15:23:37 +0000 (17:23 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 22 Apr 2015 19:27:27 +0000 (16:27 -0300)
This patch adds the ability to search reports by their id.

Test plan:
1/ Go on the saved report list (reports/guided_reports.pl?phase=Use saved)
2/ Search for a report id (refer to the ID column in the table)
3/ The result should be consistent

That the filters are not kept, already existed.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

C4/Reports/Guided.pm

index 133b1fd..1b27e9c 100644 (file)
@@ -678,12 +678,14 @@ sub get_saved_reports {
             push @args, $author, $author;
         }
         if (my $keyword = $filter->{keyword}) {
-            $keyword = "%$keyword%";
-            push @cond, "report LIKE ? OR
-                         report_name LIKE ? OR
-                         notes LIKE ? OR
-                         savedsql LIKE ?";
-            push @args, $keyword, $keyword, $keyword, $keyword;
+            push @cond, q|
+                       report LIKE ?
+                    OR report_name LIKE ?
+                    OR notes LIKE ?
+                    OR savedsql LIKE ?
+                    OR s.id = ?
+            |;
+            push @args, "%$keyword%", "%$keyword%", "%$keyword%", "%$keyword%", $keyword;
         }
         if ($filter->{group}) {
             push @cond, "report_group = ?";