Fix to redirect the user ot the select branch page if they try to use

circulation without a branch set

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Chris Cormack 2008-01-01 19:25:25 -06:00 committed by Joshua Ferraro
parent 31ddb16fa2
commit 052861306b
3 changed files with 32 additions and 3 deletions

View File

@ -27,7 +27,7 @@ use C4::Circulation;
use C4::Output;
use C4::Reserves;
use C4::Biblio;
use C4::Auth;
use C4::Auth qw/:DEFAULT get_session/;
use C4::Branch; # GetBranches
use C4::Koha;
@ -36,6 +36,17 @@ use C4::Koha;
my $query = new CGI;
if (!C4::Context->userenv){
my $sessionID = $query->cookie("CGISESSID");
my $session = get_session($sessionID);
if ($session->param('branch') eq 'NO_LIBRARY_SET'){
# no branch set we can't transfer
print $query->redirect("/cgi-bin/koha/circ/selectbranchprinter.pl");
exit;
}
}
#######################################################################################
# Make the page .....
my ( $template, $cookie );

View File

@ -74,7 +74,15 @@ if ($printer){
$session->param('branchprinter',$printer);
}
if (!C4::Context->userenv && !$branch){
my $sessionID = $query->cookie("CGISESSID") ;
my $session = get_session($sessionID);
if ($session->param('branch') eq 'NO_LIBRARY_SET'){
# no branch set we can't issue
print $query->redirect("/cgi-bin/koha/circ/selectbranchprinter.pl");
exit;
}
}
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
{

View File

@ -28,7 +28,7 @@ script to execute returns of books
use strict;
use CGI;
use C4::Context;
use C4::Auth;
use C4::Auth qw/:DEFAULT get_session/;
use C4::Output;
use C4::Circulation;
use C4::Dates qw/format_date/;
@ -41,6 +41,16 @@ use C4::Koha; # FIXME : is it still useful ?
my $query = new CGI;
if (!C4::Context->userenv){
my $sessionID = $query->cookie("CGISESSID");
my $session = get_session($sessionID);
if ($session->param('branch') eq 'NO_LIBRARY_SET'){
# no branch set we can't return
print $query->redirect("/cgi-bin/koha/circ/selectbranchprinter.pl");
exit;
}
}
#getting the template
my ( $template, $librarian, $cookie ) = get_template_and_user(
{