From 731b933d51367489422b90fa7021cfc42c747584 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 30 Mar 2011 15:34:25 +0200 Subject: [PATCH] Fix for Bug 3523 - Menu of existing lists limited to 10 - adding "more" option to the search results dropdown - offering a scrolling list on the add-to-list popup - lists add popup shows the full list of all the patron's lists, divided into groups of private and public lists. Can be improved by a fix for Bug 5529 Signed-off-by: Julian Maurice Signed-off-by: Chris Cormack --- C4/VirtualShelves.pm | 25 +++++++++- .../opac-tmpl/prog/en/includes/masthead.inc | 2 +- .../en/modules/opac-addbybiblionumber.tmpl | 15 +++++- .../prog/en/modules/opac-results.tmpl | 13 +++-- opac/opac-addbybiblionumber.pl | 48 ++++++++----------- 5 files changed, 67 insertions(+), 36 deletions(-) diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm index 77ae394b11..72571490ec 100644 --- a/C4/VirtualShelves.pm +++ b/C4/VirtualShelves.pm @@ -47,7 +47,7 @@ BEGIN { &GetBibliosShelves ); @EXPORT_OK = qw( - &GetShelvesSummary &GetRecentShelves + &GetShelvesSummary &GetRecentShelves &GetAllShelves &RefreshShelvesSummary &SetShelvesLimit ); } @@ -212,6 +212,29 @@ sub GetRecentShelves ($$$) { return ( \@shelflist, $total ); } +=head2 GetAllShelves + + ($shelflist) = GetAllShelves($owner) + +This function returns a references to an array of hashrefs containing all shelves sorted +by the shelf name. + +This function is intended to return a dataset reflecting all the shelves for +the submitted parameters. + +=cut + +sub GetAllShelves ($$) { + my ($category,$owner) = @_; + my (@shelflist); + my @params = ($category,$owner); + my $query = "SELECT * FROM virtualshelves WHERE category = ? AND owner = ? ORDER BY shelfname ASC"; + my $sth = $dbh->prepare($query); + $sth->execute(@params); + @shelflist = $sth->fetchall_arrayref({}); + return ( \@shelflist ); +} + =head2 GetShelf (shelfnumber,shelfname,owner,category,sortfield) = &GetShelf($shelfnumber); diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc index 3a3d4b94d2..df0b413663 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc @@ -159,7 +159,7 @@
    diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-addbybiblionumber.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-addbybiblionumber.tmpl index 745d19d1c2..4df208d55e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-addbybiblionumber.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-addbybiblionumber.tmpl @@ -22,10 +22,21 @@
- +
Select a List -
+
" />
Cancel
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl index d7aff2eb61..0938dd52ed 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl @@ -105,9 +105,11 @@ $(document).ready(function(){ param1 += ""; param1 += ""+""+"