From e9a9ffb36e3c50641d4a04f4d28dd22576dddb06 Mon Sep 17 00:00:00 2001 From: tipaul Date: Tue, 9 May 2006 13:28:08 +0000 Subject: [PATCH] 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. --- C4/Auth.pm | 13 ++++++++----- C4/Context.pm | 8 +++++++- koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc | 6 +++++- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index b8aa3d0a43..568d84090a 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -198,6 +198,7 @@ sub get_template_and_user { } $template->param( LibraryName => C4::Context->preference("LibraryName"), + branchname => C4::Context->userenv->{'branchname'}, ); return ($template, $borrowernumber, $cookie); } @@ -303,6 +304,7 @@ sub checkauth { $hash{firstname}, $hash{surname}, $hash{branch}, + $hash{branchname}, $hash{flags}, $hash{emailaddress}, ); @@ -389,15 +391,15 @@ sub checkauth { 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 @@ sub checkauth { $firstname, $surname, $branchcode, + $branchname, $userflags, $emailaddress, ); diff --git a/C4/Context.pm b/C4/Context.pm index f67ee05cdf..b920da0c1d 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -745,7 +745,7 @@ set_userenv is called in Auth.pm =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 @@ sub set_userenv{ # "surname" => $usersurname, #possibly a law problem "branch" => $userbranch, + "branchname" => $branchname, "flags" => $userflags, "emailaddress" => $emailaddress, }; @@ -825,6 +826,11 @@ Andrew Arensburger =cut # $Log$ +# 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 # diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc index e1d84588d1..8cf034d940 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc @@ -15,4 +15,8 @@ function Help() { Tools About Help -

\ No newline at end of file +

+ +
+

, from

+
\ No newline at end of file -- 2.39.5