Bug 23673: Set updated_on=time_queued on DB update
[koha-ffzg.git] / circ / selectbranchprinter.pl
index 935cb4e..0febd0f 100755 (executable)
@@ -27,7 +27,6 @@ use C4::Print;  # GetPrinters
 use C4::Koha;
 use Koha::BiblioFrameworks;
 use Koha::Libraries;
-use Koha::Checkouts;
 
 # this will be the script that chooses branch and printer settings....
 
@@ -63,6 +62,7 @@ if ( $branch and my $library = Koha::Libraries->find($branch) ) {
         $template->param(LoginBranchcode => $branch);       # update template for new branch
         $session->param('branchname', $branchname);         # update sesssion in DB
         $session->param('branch', $branch);                 # update sesssion in DB
+        $session->flush();
         push @updated, {
             updated_branch => 1,
                 old_branch => $userenv_branch,
@@ -80,6 +80,7 @@ if ( $branch and my $library = Koha::Libraries->find($branch) ) {
 if ($printer) {
     if (! $userenv_printer or $userenv_printer ne $printer ) {
         $session->param('branchprinter', $printer);         # update sesssion in DB
+        $session->flush();
         $template->param('new_printer', $printer);          # update template
         push @updated, {
             updated_printer => 1,
@@ -127,14 +128,11 @@ if (scalar @updated and not scalar @recycle_loop) {
     print $query->redirect($referer || '/cgi-bin/koha/circ/circulation.pl');
 }
 
-my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count;
-
 $template->param(
     referer     => $referer,
     printerloop => \@printerloop,
     branch      => $branch,
     recycle_loop=> \@recycle_loop,
-    pending_checkout_notes => $pending_checkout_notes,
 );
 
 # Checking if there is a Fast Cataloging Framework