Browse Source

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>
3.0.x
Chris Cormack 17 years ago
committed by Joshua Ferraro
parent
commit
052861306b
  1. 13
      circ/branchtransfers.pl
  2. 10
      circ/circulation.pl
  3. 12
      circ/returns.pl

13
circ/branchtransfers.pl

@ -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 );

10
circ/circulation.pl

@ -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 (
{

12
circ/returns.pl

@ -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(
{

Loading…
Cancel
Save