From 8806aedc32a8648829acc1552fb0946b7ad7237f Mon Sep 17 00:00:00 2001 From: Claire Hernandez Date: Thu, 7 Apr 2011 16:59:15 +0200 Subject: [PATCH 3/3] Bug 5904 - Follow up : .pref and fix - adds parenthesis to query - modify patron.pref file --- circ/ysearch.pl | 6 +++--- .../prog/en/modules/admin/preferences/patrons.pref | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/circ/ysearch.pl b/circ/ysearch.pl index 5d4442b..210c7c2 100755 --- a/circ/ysearch.pl +++ b/circ/ysearch.pl @@ -44,12 +44,12 @@ if ($auth_status ne "ok") { my $dbh = C4::Context->dbh; my $sql = qq(SELECT surname, firstname, cardnumber, address, city, zipcode, country FROM borrowers - WHERE surname LIKE ? + WHERE (surname LIKE ? OR firstname LIKE ? - OR cardnumber LIKE ?); + OR cardnumber LIKE ?) ); if (C4::Context->preference("IndependentBranchPatron")){ if (C4::Context->userenv && (C4::Context->userenv->{flags} % 2) !=1 && C4::Context->userenv->{'branch'}){ - $sql.=" AND borrowers.branchcode =".$dbh->quote(C4::Context->userenv->{'branch'}) unless (C4::Context->userenv->{'branch'} eq "insecure"); + $sql .=" AND borrowers.branchcode =".$dbh->quote(C4::Context->userenv->{'branch'}) unless (C4::Context->userenv->{'branch'} eq "insecure"); } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index 9b5d540..3f24680 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -107,3 +107,9 @@ Patrons: yes: Do no: "Don't" - store and display surnames in upper case. + - + - pref: IndependentBranchPatron + choices: + yes: Allow + no: "Don't allow" + - limit to the librarian branch in circ member auto completion. -- 1.7.1