|
Lines 164-182
sub get_template_and_user {
Link Here
|
| 164 |
$template->param( loggedinusername => $user ); |
164 |
$template->param( loggedinusername => $user ); |
| 165 |
$template->param( sessionID => $sessionID ); |
165 |
$template->param( sessionID => $sessionID ); |
| 166 |
|
166 |
|
| 167 |
my ($total, $pubshelves, $barshelves) = C4::Context->get_shelves_userenv(); |
167 |
my ($total, $pubshelves, $barshelves) = C4::Context->get_shelves_userenv(); |
| 168 |
if (defined($pubshelves)) { |
168 |
if (defined($pubshelves)) { |
| 169 |
$template->param( pubshelves => scalar (@$pubshelves), |
169 |
$template->param( pubshelves => scalar @{$pubshelves}, |
| 170 |
pubshelvesloop => $pubshelves, |
170 |
pubshelvesloop => $pubshelves, |
| 171 |
); |
171 |
); |
| 172 |
$template->param( pubtotal => $total->{'pubtotal'}, ) if ($total->{'pubtotal'} > scalar (@$pubshelves)); |
172 |
$template->param( pubtotal => $total->{'pubtotal'}, ) if ($total->{'pubtotal'} > scalar @{$pubshelves}); |
| 173 |
} |
173 |
} |
| 174 |
if (defined($barshelves)) { |
174 |
if (defined($barshelves)) { |
| 175 |
$template->param( barshelves => scalar (@$barshelves), |
175 |
$template->param( barshelves => scalar @{$barshelves}, |
| 176 |
barshelvesloop => $barshelves, |
176 |
barshelvesloop => $barshelves, |
| 177 |
); |
177 |
); |
| 178 |
$template->param( bartotal => $total->{'bartotal'}, ) if ($total->{'bartotal'} > scalar (@$barshelves)); |
178 |
$template->param( bartotal => $total->{'bartotal'}, ) if ($total->{'bartotal'} > scalar @{$barshelves}); |
| 179 |
} |
179 |
} |
| 180 |
|
180 |
|
| 181 |
$borrowernumber = getborrowernumber($user) if defined($user); |
181 |
$borrowernumber = getborrowernumber($user) if defined($user); |
| 182 |
|
182 |
|
|
Lines 297-307
sub get_template_and_user {
Link Here
|
| 297 |
$template->param( sessionID => $sessionID ); |
297 |
$template->param( sessionID => $sessionID ); |
| 298 |
|
298 |
|
| 299 |
my ($total, $pubshelves) = C4::Context->get_shelves_userenv(); # an anonymous user has no 'barshelves'... |
299 |
my ($total, $pubshelves) = C4::Context->get_shelves_userenv(); # an anonymous user has no 'barshelves'... |
| 300 |
if (defined(($pubshelves))) { |
300 |
if (defined $pubshelves) { |
| 301 |
$template->param( pubshelves => scalar (@$pubshelves), |
301 |
$template->param( pubshelves => scalar @{$pubshelves}, |
| 302 |
pubshelvesloop => $pubshelves, |
302 |
pubshelvesloop => $pubshelves, |
| 303 |
); |
303 |
); |
| 304 |
$template->param( pubtotal => $total->{'pubtotal'}, ) if ($total->{'pubtotal'} > scalar (@$pubshelves)); |
304 |
$template->param( pubtotal => $total->{'pubtotal'}, ) if ($total->{'pubtotal'} > scalar @{$pubshelves}); |
| 305 |
} |
305 |
} |
| 306 |
|
306 |
|
| 307 |
} |
307 |
} |
|
Lines 852-863
sub checkauth {
Link Here
|
| 852 |
$total->{'bartotal'} = $totshelves; |
852 |
$total->{'bartotal'} = $totshelves; |
| 853 |
($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef); |
853 |
($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef); |
| 854 |
$total->{'pubtotal'} = $totshelves; |
854 |
$total->{'pubtotal'} = $totshelves; |
| 855 |
$session->param('barshelves', $barshelves->[0]); |
855 |
$session->param('barshelves', $barshelves); |
| 856 |
$session->param('pubshelves', $pubshelves->[0]); |
856 |
$session->param('pubshelves', $pubshelves); |
| 857 |
$session->param('totshelves', $total); |
857 |
$session->param('totshelves', $total); |
| 858 |
|
858 |
|
| 859 |
C4::Context::set_shelves_userenv('bar',$barshelves->[0]); |
859 |
C4::Context::set_shelves_userenv('bar',$barshelves); |
| 860 |
C4::Context::set_shelves_userenv('pub',$pubshelves->[0]); |
860 |
C4::Context::set_shelves_userenv('pub',$pubshelves); |
| 861 |
C4::Context::set_shelves_userenv('tot',$total); |
861 |
C4::Context::set_shelves_userenv('tot',$total); |
| 862 |
} |
862 |
} |
| 863 |
else { |
863 |
else { |
|
Lines 877-885
sub checkauth {
Link Here
|
| 877 |
my ($total, $totshelves, $pubshelves); |
877 |
my ($total, $totshelves, $pubshelves); |
| 878 |
($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef); |
878 |
($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef); |
| 879 |
$total->{'pubtotal'} = $totshelves; |
879 |
$total->{'pubtotal'} = $totshelves; |
| 880 |
$session->param('pubshelves', $pubshelves->[0]); |
880 |
$session->param('pubshelves', $pubshelves); |
| 881 |
$session->param('totshelves', $total); |
881 |
$session->param('totshelves', $total); |
| 882 |
C4::Context::set_shelves_userenv('pub',$pubshelves->[0]); |
882 |
C4::Context::set_shelves_userenv('pub',$pubshelves); |
| 883 |
C4::Context::set_shelves_userenv('tot',$total); |
883 |
C4::Context::set_shelves_userenv('tot',$total); |
| 884 |
|
884 |
|
| 885 |
# setting a couple of other session vars... |
885 |
# setting a couple of other session vars... |