[Koha-cvs] koha C4/Auth.pm C4/Context.pm koha-tmpl/intrane...

paul poulain paul at koha-fr.org
Tue May 9 15:28:08 CEST 2006


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch: 	
Changes by:	paul poulain <tipaul at savannah.gnu.org>	06/05/09 13:28:08

Modified files:
	C4             : Auth.pm Context.pm 
	koha-tmpl/intranet-tmpl/prog/en/includes: menus.inc 

Log message:
	adding the branchname and the librarian name in every page :
	- modified userenv to add branchname
	- modifier menus.inc to have the librarian name & userenv displayed on every page. they are in a librarian_information div.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/C4/Auth.pm.diff?tr1=1.48&tr2=1.49&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/C4/Context.pm.diff?tr1=1.35&tr2=1.36&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/koha/koha/koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: koha/C4/Auth.pm
diff -u koha/C4/Auth.pm:1.48 koha/C4/Auth.pm:1.49
--- koha/C4/Auth.pm:1.48	Wed Oct 26 09:12:33 2005
+++ koha/C4/Auth.pm	Tue May  9 13:28:08 2006
@@ -198,6 +198,7 @@
 	}
 	$template->param(
 			     LibraryName => C4::Context->preference("LibraryName"),
+			     branchname => C4::Context->userenv->{'branchname'},
 		);
 	return ($template, $borrowernumber, $cookie);
 }
@@ -303,6 +304,7 @@
 					$hash{firstname},
 					$hash{surname},
 					$hash{branch},
+					$hash{branchname},
 					$hash{flags},
 					$hash{emailaddress},
 				);
@@ -389,15 +391,15 @@
 					C4::Context->_unset_userenv($sessionID);
 			}
 			if ($return == 1){
-				my ($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress);
-				my $sth=$dbh->prepare("select borrowernumber,firstname,surname,flags,branchcode,emailaddress from borrowers where userid=?");
+				my ($bornum,$firstname,$surname,$userflags,$branchcode,$branchname,$emailaddress);
+				my $sth=$dbh->prepare("select borrowernumber, firstname, surname, flags, borrowers.branchcode, branches.branchname as branchname, email from borrowers left join branches on borrowers.branchcode=branches.branchcode where userid=?");
 				$sth->execute($userid);
-				($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress) = $sth->fetchrow if ($sth->rows);
+				($bornum,$firstname,$surname,$userflags,$branchcode,$branchname,$emailaddress) = $sth->fetchrow if ($sth->rows);
 # 				warn "$cardnumber,$bornum,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress";
 				unless ($sth->rows){
-					my $sth=$dbh->prepare("select borrowernumber,firstname,surname,flags,branchcode,emailaddress from borrowers where cardnumber=?");
+					my $sth=$dbh->prepare("select borrowernumber, firstname, surname, flags, borrowers.branchcode, branches.branchname as branchname, email from borrowers left join branches on borrowers.branchcode=branches.branchcode where cardnumber=?");
 					$sth->execute($cardnumber);
-					($bornum,$firstname,$surname,$userflags,$branchcode,$emailaddress) = $sth->fetchrow if ($sth->rows);
+					($bornum,$firstname,$surname,$userflags,$branchcode,$branchcode,$emailaddress) = $sth->fetchrow if ($sth->rows);
 # 					warn "$cardnumber,$bornum,$userid,$firstname,$surname,$userflags,$branchcode,$emailaddress";
 					unless ($sth->rows){
 						$sth->execute($userid);
@@ -412,6 +414,7 @@
 					$firstname,
 					$surname,
 					$branchcode,
+					$branchname,
 					$userflags,
 					$emailaddress,
 				);
Index: koha/C4/Context.pm
diff -u koha/C4/Context.pm:1.35 koha/C4/Context.pm:1.36
--- koha/C4/Context.pm:1.35	Thu Apr 13 08:40:11 2006
+++ koha/C4/Context.pm	Tue May  9 13:28:08 2006
@@ -15,7 +15,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Context.pm,v 1.35 2006/04/13 08:40:11 plg Exp $
+# $Id: Context.pm,v 1.36 2006/05/09 13:28:08 tipaul Exp $
 
 package C4::Context;
 use strict;
@@ -26,7 +26,7 @@
 	qw($context),
 	qw(@context_stack);
 
-$VERSION = do { my @v = '$Revision: 1.35 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.36 $' =~ /\d+/g;
 		shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
 
 =head1 NAME
@@ -745,7 +745,7 @@
 =cut
 #'
 sub set_userenv{
-	my ($usernum, $userid, $usercnum, $userfirstname, $usersurname, $userbranch, $userflags, $emailaddress)= @_;
+	my ($usernum, $userid, $usercnum, $userfirstname, $usersurname, $userbranch, $branchname, $userflags, $emailaddress)= @_;
 	my $var=$context->{"activeuser"};
 	my $cell = {
 		"number"     => $usernum,
@@ -755,6 +755,7 @@
 #		"surname"    => $usersurname,
 #possibly a law problem
 		"branch"     => $userbranch,
+		"branchname" => $branchname,
 		"flags"      => $userflags,
 		"emailaddress"	=> $emailaddress,
 	};
@@ -825,6 +826,11 @@
 
 =cut
 # $Log: Context.pm,v $
+# Revision 1.36  2006/05/09 13:28:08  tipaul
+# adding the branchname and the librarian name in every page :
+# - modified userenv to add branchname
+# - modifier menus.inc to have the librarian name & userenv displayed on every page. they are in a librarian_information div.
+#
 # Revision 1.35  2006/04/13 08:40:11  plg
 # bug fixed: typo on Zconnauth name
 #
Index: koha/koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc
diff -u koha/koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc:1.2 koha/koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc:1.3
--- koha/koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc:1.2	Fri Apr 14 09:36:51 2006
+++ koha/koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc	Tue May  9 13:28:08 2006
@@ -15,4 +15,8 @@
 	<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
 	<a href="/cgi-bin/koha/about.pl">About</a>
 	<a href="/cgi-bin/koha/help.pl" onclick="Help(); return false;">Help</a>
-</p>
\ No newline at end of file
+</p>
+
+<div id="librarian_information">
+<p><!-- TMPL_VAR name="loggedinusername" -->, from <!-- TMPL_VAR name="branchname" --></p>
+</div>
\ No newline at end of file





More information about the Koha-cvs mailing list