Lines 173-185
sub shelfpage ($$$$$) {
Link Here
|
173 |
last SWITCH; |
173 |
last SWITCH; |
174 |
} |
174 |
} |
175 |
if ( $shelfnumber = $query->param('viewshelf') ) { |
175 |
if ( $shelfnumber = $query->param('viewshelf') ) { |
|
|
176 |
# explicitly fetch this shelf |
177 |
my ($shelfnumber2,$shelfname,$owner,$category,$sorton) = GetShelf($shelfnumber); |
176 |
|
178 |
|
177 |
#check that the user can view the shelf |
179 |
#check that the user can view the shelf |
178 |
if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'view' ) ) { |
180 |
if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'view' ) ) { |
179 |
my $items; |
181 |
my $items; |
180 |
my $authorsort; |
182 |
my $authorsort; |
181 |
my $yearsort; |
183 |
my $yearsort; |
182 |
my $sortfield = ( $query->param('sortfield') ? $query->param('sortfield') : 'title' ); |
184 |
my $sortfield; |
|
|
185 |
if ( $query->param('sortfield')) { |
186 |
$sortfield = $query->param('sortfield'); |
187 |
} elsif ($sorton) { |
188 |
$sortfield = $sorton; |
189 |
} else { |
190 |
$sortfield = 'title'; |
191 |
} |
183 |
if ( $sortfield eq 'author' ) { |
192 |
if ( $sortfield eq 'author' ) { |
184 |
$authorsort = 'author'; |
193 |
$authorsort = 'author'; |
185 |
} |
194 |
} |
Lines 209-215
sub shelfpage ($$$$$) {
Link Here
|
209 |
my $i = 0; |
218 |
my $i = 0; |
210 |
my $manageshelf = ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ); |
219 |
my $manageshelf = ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ); |
211 |
$template->param( |
220 |
$template->param( |
212 |
shelfname => $shelflist->{$shelfnumber}->{'shelfname'} || $privshelflist->{$shelfnumber}->{'shelfname'}, |
221 |
shelfname => $shelfname, |
213 |
shelfnumber => $shelfnumber, |
222 |
shelfnumber => $shelfnumber, |
214 |
viewshelf => $shelfnumber, |
223 |
viewshelf => $shelfnumber, |
215 |
authorsort => $authorsort, |
224 |
authorsort => $authorsort, |
Lines 426-429
__END__
Link Here
|
426 |
|
435 |
|
427 |
=back |
436 |
=back |
428 |
|
437 |
|
429 |
=cut |
438 |
=cut |
430 |
- |
|
|