From e8e632f8dbabd20fdeba66c8b49c50c4d768a5cc 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 --- circ/circulation.pl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 982cc722df..41ad694607 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; @@ -694,6 +704,10 @@ $template->param( circview => 1, ); +# save stickyduedate to session +if ($stickyduedate) { + $session->param( 'stickyduedate', $duedatespec ); +} #if ($branchcookie) { #$cookie=[$cookie, $branchcookie, $printercookie]; -- 2.39.5