[Koha-cvs] CVS: koha/acqui acquire.pl,1.19,1.20 basket.pl,1.27,1.28

Henri-Damien LAURENT hdl at users.sourceforge.net
Thu Jul 28 09:52:05 CEST 2005


Update of /cvsroot/koha/koha/acqui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18438/acqui

Modified Files:
	acquire.pl basket.pl 
Log Message:
Implementing Independancy Branches management :
- Trying to get a basket not owned by so of his own branch leads to mainpage.
- Lists onlys ths baskets owned by someon of user's brach.

Auth.pm now sends a cookie with userenv informations.


Index: acquire.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui/acquire.pl,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** acquire.pl	14 Jul 2005 09:13:24 -0000	1.19
--- acquire.pl	28 Jul 2005 07:52:02 -0000	1.20
***************
*** 61,65 ****
  $template->param($count);
  my $sthtemp = $dbh->prepare("Select flags, branchcode from borrowers where borrowernumber = ?");
! $sthtemp->execute($borrowernumber);
  my ($flags, $homebranch)=$sthtemp->fetchrow;
  
--- 61,65 ----
  $template->param($count);
  my $sthtemp = $dbh->prepare("Select flags, branchcode from borrowers where borrowernumber = ?");
! $sthtemp->execute($loggedinuser);
  my ($flags, $homebranch)=$sthtemp->fetchrow;
  

Index: basket.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui/basket.pl,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** basket.pl	29 Jun 2005 01:16:37 -0000	1.27
--- basket.pl	28 Jul 2005 07:52:02 -0000	1.28
***************
*** 36,40 ****
  
  my $query =new CGI;
! my $basketno = $query ->param('basket');
  my $booksellerid = $query->param('supplierid');
  my $order = $query->param('order');
--- 36,40 ----
  
  my $query =new CGI;
! my $basketno = $query->param('basket');
  my $booksellerid = $query->param('supplierid');
  my $order = $query->param('order');
***************
*** 49,52 ****
--- 49,53 ----
  my ($count, at results);
  
+ 
  my $basket = getbasket($basketno);
  # FIXME : the query->param('supplierid') below is probably useless. The bookseller is always known from the basket
***************
*** 57,60 ****
--- 58,74 ----
  
  # get librarian branch...
+ if (C4::Context->preference("IndependantBranches")) {
+ 	my $userenv = C4::Context->userenv;
+ 	unless ($userenv->{flags} == 1){
+ 		my $validtest = ($basket->{creationdate} = "") 
+ 					|| ($userenv->{branch} eq $basket->{branch})
+ 					|| ($userenv->{branch} = '')
+ 					|| ($basket->{branch} = '');
+ 		unless ($validtest) {
+ 			print $query->redirect("../mainpage.pl");
+ 			exit 1;
+ 		}
+ 	}
+ }
  
  # if new basket, pre-fill infos





More information about the Koha-cvs mailing list