From ba569c3cfa6f8e9c383b47b0f204e2a6d810b533 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Wed, 3 Oct 2007 19:01:04 +0200 Subject: [PATCH] Revert "Adding IndependantBranches Filter + adding some ordering on member list display." This reverts commit 0dee069f30f05f0d63d3b5e5047cdd3986aa373c. Signed-off-by: Chris Cormack --- C4/Members.pm | 38 +++++-------------- .../prog/en/modules/circ/circulation.tmpl | 31 ++------------- .../prog/en/modules/members/member.tmpl | 8 ++-- 3 files changed, 16 insertions(+), 61 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index b2f57c98c0..8ba07a4ed9 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -122,7 +122,7 @@ push @EXPORT, qw( =item SearchMember - ($count, $borrowers) = &SearchMember($searchstring, $type,$category_type,$filter,$showallbranches); + ($count, $borrowers) = &SearchMember($searchstring, $type,$category_type); Looks up patrons (borrowers) by name. @@ -137,10 +137,6 @@ C<$searchstring> is a space-separated list of search terms. Each term must match the beginning a borrower's surname, first name, or other name. -C<$filter> is assumed to be a list of elements to filter results on - -C<$showallbranches> is used in IndependantBranches Context to display all branches results. - C<&SearchMember> returns a two-element list. C<$borrowers> is a reference-to-array; each element is a reference-to-hash, whose keys are the fields of the C table in the Koha database. @@ -152,7 +148,7 @@ C<$count> is the number of elements in C<$borrowers>. #used by member enquiries from the intranet #called by member.pl sub SearchMember { - my ($searchstring, $orderby, $type,$category_type,$filter,$showallbranches ) = @_; + my ($searchstring, $orderby, $type,$category_type ) = @_; my $dbh = C4::Context->dbh; my $query = ""; my $count; @@ -162,18 +158,10 @@ sub SearchMember { if ( $type eq "simple" ) # simple search for one letter only { $query = - "SELECT * - FROM borrowers - LEFT JOIN categories ON borrowers.categorycode=categories.categorycode ". - ($category_type?" AND category_type = ".$dbh->quote($category_type):""); - $query .= - " WHERE (surname LIKE ? OR cardnumber like ?) "; - if (C4::Context->preference("IndependantBranches") && !$showallbranches){ - if (C4::Context->userenv && C4::Context->userenv->{flags}!=1 && C4::Context->userenv->{'branch'}){ - $query.=" AND borrowers.branchcode =".$dbh->quote(C4::Context->userenv->{'branch'}) unless (C4::Context->userenv->{'branch'} eq "insecure"); - } - } - $query.=" ORDER BY $orderby"; + "SELECT * FROM borrowers + LEFT JOIN categories ON borrowers.categorycode=categories.categorycode ". + ($category_type?" AND category_type = ".$dbh->quote($category_type):""). + " WHERE surname LIKE ? OR cardnumber like ? ORDER BY $orderby"; @bind = ("$searchstring%","$searchstring"); } else # advanced search looking in surname, firstname and othernames @@ -182,15 +170,9 @@ sub SearchMember { $count = @data; $query = "SELECT * FROM borrowers LEFT JOIN categories ON borrowers.categorycode=categories.categorycode - WHERE "; - if (C4::Context->preference("IndependantBranches") && !$showallbranches){ - if (C4::Context->userenv && C4::Context->userenv->{flags}!=1 && C4::Context->userenv->{'branch'}){ - $query.=" borrowers.branchcode =".$dbh->quote(C4::Context->userenv->{'branch'})." AND " unless (C4::Context->userenv->{'branch'} eq "insecure"); - } - } - $query.="((surname LIKE ? OR surname LIKE ? - OR firstname LIKE ? OR firstname LIKE ? - OR othernames LIKE ? OR othernames LIKE ?) + WHERE ((surname LIKE ? OR surname LIKE ? + OR firstname LIKE ? OR firstname LIKE ? + OR othernames LIKE ? OR othernames LIKE ?) ". ($category_type?" AND category_type = ".$dbh->quote($category_type):""); @bind = ( @@ -216,7 +198,7 @@ sub SearchMember { my $sth = $dbh->prepare($query); -# warn "Q $orderby : $query"; + # warn "Q $orderby : $query"; $sth->execute(@bind); my @results; my $data = $sth->fetchall_arrayref({}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl index 6bfb40253e..363a183798 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -39,34 +39,9 @@
-
- - - ">details - / &op=modify&destination=circ&categorycode=">edit -

-

Patron card expires on .

- - , - - No address stored for patron. - - - - - No city stored. - - - - - No phone stored. - -

- - "> - -

Category:

-
+ + + This borrower has overdue(s) items diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tmpl index ee99887c0e..e58e51387d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tmpl @@ -58,10 +58,9 @@
- - - - + + + @@ -81,7 +80,6 @@ - -- 2.39.5
&orderby=cardnumber">Card&orderby=surname">Name&orderby=borrowers.categorycode">Cat&orderby=branchcode">BranchCardNameCat OD/Issues Fines Notes ()