From c3c75cee800642af109f8dc7d399bbfaa046c832 Mon Sep 17 00:00:00 2001 From: Michael Hafen Date: Mon, 11 May 2009 14:52:35 -0600 Subject: [PATCH] Make stickyduedate remember for session a little more permanent Store the stickyduedate in the session. So "Remember for Session" means for session rather than "while on this page". Includes some updates since initial submission of patch. Signed-off-by: Galen Charlton Signed-off-by: Henri-Damien LAURENT --- circ/circulation.pl | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index fc5d4e500d..6f88ff25e1 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -115,8 +115,8 @@ my $barcode = $query->param('barcode') || ''; $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace $barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter')); -my $stickyduedate = $query->param('stickyduedate'); -my $duedatespec = $query->param('duedatespec'); +my $stickyduedate = $query->param('stickyduedate') || $session->param( 'stickyduedate' ); +my $duedatespec = $query->param('duedatespec') || $session->param( 'stickyduedate' ); my $issueconfirmed = $query->param('issueconfirmed'); my $cancelreserve = $query->param('cancelreserve'); my $organisation = $query->param('organisations'); @@ -124,6 +124,16 @@ my $print = $query->param('print'); my $newexpiry = $query->param('dateexpiry'); my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt error dialog twice +# Check if stickyduedate is turned off +if ( $barcode ) { + # was stickyduedate loaded from session? + if ( $stickyduedate && ! $query->param("stickyduedate") ) { + $session->clear( 'stickyduedate' ); + $stickyduedate = $query->param('stickyduedate'); + $duedatespec = $query->param('duedatespec'); + } +} + #set up cookie..... # my $branchcookie; # my $printercookie; @@ -700,11 +710,9 @@ $template->param( circview => 1, ); -# set return date if stickyduedate +# save stickyduedate to session if ($stickyduedate) { - $template->param( - duedatespec => $duedatespec, - ); + $session->param( 'stickyduedate', $duedatespec ); } #if ($branchcookie) { -- 2.39.5