View | Details | Raw Unified | Return to bug 6096
Collapse All | Expand All

(-)a/C4/VirtualShelves.pm (-10 / +7 lines)
Lines 220-228 sub GetRecentShelves { Link Here
220
220
221
=head2 GetAllShelves
221
=head2 GetAllShelves
222
222
223
    ($shelflist) = GetAllShelves($owner)
223
    $shelflist = GetAllShelves($owner)
224
224
225
This function returns a references to an array of hashrefs containing all shelves sorted
225
This function returns a reference to an array of hashrefs containing all shelves sorted
226
by the shelf name.
226
by the shelf name.
227
227
228
This function is intended to return a dataset reflecting all the shelves for
228
This function is intended to return a dataset reflecting all the shelves for
Lines 230-244 the submitted parameters. Link Here
230
230
231
=cut
231
=cut
232
232
233
sub GetAllShelves ($$) {
233
sub GetAllShelves {
234
    my ($category,$owner) = @_;
234
    my ($category,$owner) = @_;
235
    my (@shelflist);
235
    my $query = 'SELECT * FROM virtualshelves WHERE category = ? AND owner = ? ORDER BY shelfname ASC';
236
    my @params = ($category,$owner);
236
    my $sth = $dbh->prepare( $query );
237
    my $query = "SELECT * FROM virtualshelves WHERE category = ? AND owner = ? ORDER BY shelfname ASC";
237
    $sth->execute( $category, $owner );
238
    my $sth = $dbh->prepare($query);
238
    return $sth->fetchall_arrayref({});
239
    $sth->execute(@params);
240
    @shelflist = $sth->fetchall_arrayref({});
241
    return ( \@shelflist );
242
}
239
}
243
240
244
=head2 GetShelf
241
=head2 GetShelf
(-)a/opac/opac-addbybiblionumber.pl (-8 / +4 lines)
Lines 98-116 else { Link Here
98
	} else {
98
	} else {
99
99
100
        my $privateshelves = GetAllShelves(1,$loggedinuser);
100
        my $privateshelves = GetAllShelves(1,$loggedinuser);
101
        my @privateshelves = @{$privateshelves};
101
        if(@{$privateshelves}){
102
        warn scalar($privateshelves);
103
        if(@privateshelves){
104
			$template->param (
102
			$template->param (
105
				privatevirtualshelves          => @privateshelves,
103
				privatevirtualshelves          => $privateshelves,
106
				existingshelves => 1
104
				existingshelves => 1
107
			);
105
			);
108
		}
106
		}
109
        my $publicshelves = GetAllShelves(2,$loggedinuser);
107
        my $publicshelves = GetAllShelves(2,$loggedinuser);
110
        my @publicshelves = @{$publicshelves};
108
        if(@{$publicshelves}){
111
        if(@publicshelves){
112
			$template->param (
109
			$template->param (
113
				publicvirtualshelves          => @publicshelves,
110
				publicvirtualshelves          => $publicshelves,
114
				existingshelves => 1
111
				existingshelves => 1
115
			);
112
			);
116
        }
113
        }
117
- 

Return to bug 6096