+# new op dev the branch and the printer are now defined by the userenv
+# but first we have to check if someone has tried to change them
+
+my $branch = $query->param('branch');
+if ($branch){
+ # update our session so the userenv is updated
+ my $dbh=C4::Context->dbh;
+ my $sessionID = $query->cookie("CGISESSID") ;
+ my $session = get_session($sessionID);
+ $session->param('branch',$branch);
+ my $branchname = GetBranchName($branch);
+ $session->param('branchname',$branchname);
+}
+
+my $printer = $query->param('printer');
+if ($printer){
+ # update our session so the userenv is updated
+ my $dbh=C4::Context->dbh;
+ my $sessionID = $query->cookie("CGISESSID") ;
+ my $session = get_session($sessionID);
+ $session->param('branchprinter',$printer);
+
+}
+
+