[Koha-cvs] CVS: koha/C4 Acquisition.pm,1.9.2.7,1.9.2.8 Context.pm,1.18.2.3,1.18.2.4
Henri-Damien LAURENT
hdl at users.sourceforge.net
Thu Sep 1 14:26:22 CEST 2005
Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18974
Modified Files:
Tag: rel_2_2
Acquisition.pm Context.pm
Log Message:
Fixing Bug when no user logged in
Index: Acquisition.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Acquisition.pm,v
retrieving revision 1.9.2.7
retrieving revision 1.9.2.8
diff -C2 -r1.9.2.7 -r1.9.2.8
*** Acquisition.pm 26 Aug 2005 12:21:49 -0000 1.9.2.7
--- Acquisition.pm 1 Sep 2005 12:26:19 -0000 1.9.2.8
***************
*** 404,408 ****
if (C4::Context->preference("IndependantBranches")) {
my $userenv = C4::Context->userenv;
! unless ($userenv->{flags} == 1){
$strsth .= " and (borrowers.branchcode = '".$userenv->{branch}."' or borrowers.branchcode ='')";
}
--- 404,408 ----
if (C4::Context->preference("IndependantBranches")) {
my $userenv = C4::Context->userenv;
! if (($userenv)&&($userenv->{flags} != 1)){
$strsth .= " and (borrowers.branchcode = '".$userenv->{branch}."' or borrowers.branchcode ='')";
}
***************
*** 501,505 ****
if (C4::Context->preference("IndependantBranches")) {
my $userenv = C4::Context->userenv;
! unless ($userenv->{flags} == 1){
$strsth .= " and (borrowers.branchcode = '".$userenv->{branch}."' or borrowers.branchcode ='')";
}
--- 501,505 ----
if (C4::Context->preference("IndependantBranches")) {
my $userenv = C4::Context->userenv;
! if (($userenv) &&($userenv->{flags} != 1)){
$strsth .= " and (borrowers.branchcode = '".$userenv->{branch}."' or borrowers.branchcode ='')";
}
***************
*** 590,594 ****
$strsth .= " AND aqbasket.booksellerid = $supplierid " if ($supplierid);
$strsth .= " AND borrowers.branchcode like \'".$branch."\'" if ($branch);
! $strsth .= " AND borrowers.branchcode like \'".C4::Context->userenv->{branch}."\'" if (C4::Context->preference("IndependantBranches") && C4::Context->userenv->{flags}!=1);
$strsth .= " ORDER BY latesince,basketno,borrowers.branchcode, supplier";
} else {
--- 590,594 ----
$strsth .= " AND aqbasket.booksellerid = $supplierid " if ($supplierid);
$strsth .= " AND borrowers.branchcode like \'".$branch."\'" if ($branch);
! $strsth .= " AND borrowers.branchcode like \'".C4::Context->userenv->{branch}."\'" if (C4::Context->preference("IndependantBranches") && C4::Context->userenv && C4::Context->userenv->{flags}!=1);
$strsth .= " ORDER BY latesince,basketno,borrowers.branchcode, supplier";
} else {
***************
*** 741,745 ****
if (C4::Context->preference("IndependantBranches")) {
my $userenv = C4::Context->userenv;
! unless ($userenv->{flags} == 1){
$query .= " and (borrowers.branchcode = '".$userenv->{branch}."' or borrowers.branchcode ='')";
}
--- 741,745 ----
if (C4::Context->preference("IndependantBranches")) {
my $userenv = C4::Context->userenv;
! if (($userenv) &&($userenv->{flags} != 1)){
$query .= " and (borrowers.branchcode = '".$userenv->{branch}."' or borrowers.branchcode ='')";
}
***************
*** 1003,1007 ****
my $dbh = C4::Context->dbh;
my $sth;
! if (C4::Context->preference("IndependantBranches") && (C4::Context->userenv->{flags}!=1)){
my $strsth ="Select * from branches ";
$strsth.= " WHERE branchcode = ".$dbh->quote(C4::Context->userenv->{branch});
--- 1003,1007 ----
my $dbh = C4::Context->dbh;
my $sth;
! if (C4::Context->preference("IndependantBranches") && (C4::Context->userenv) && (C4::Context->userenv->{flags} != 1)){
my $strsth ="Select * from branches ";
$strsth.= " WHERE branchcode = ".$dbh->quote(C4::Context->userenv->{branch});
Index: Context.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Context.pm,v
retrieving revision 1.18.2.3
retrieving revision 1.18.2.4
diff -C2 -r1.18.2.3 -r1.18.2.4
*** Context.pm 26 Aug 2005 12:21:49 -0000 1.18.2.3
--- Context.pm 1 Sep 2005 12:26:19 -0000 1.18.2.4
***************
*** 618,621 ****
--- 618,622 ----
my $var = $context->{"activeuser"};
return $context->{"userenv"}->{$var} if (defined $context->{"userenv"}->{$var});
+ return 0;
warn "NO CONTEXT for $var";
}
More information about the Koha-cvs
mailing list