From 49a74c2b3b23845107bd6388dd5e46d42be97ade Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Mon, 19 Jul 2021 10:42:11 +0200 Subject: [PATCH] Update index.php --- htdocs/ticket/index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index c3027e5044b..756f8e10879 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -50,6 +50,7 @@ $socid = 0; if ($user->socid) { $socid = $user->socid; } +$userid = $user->id; // Security check $result = restrictedArea($user, 'ticket', 0, '', '', '', ''); @@ -96,7 +97,7 @@ if (in_array('DOLUSERCOOKIE_ticket_by_status', $autosetarray)) { $endyear = GETPOST($param_year, 'int'); $shownb = GETPOST($param_shownb, 'alpha'); $showtot = GETPOST($param_showtot, 'alpha'); -} else { +} elseif (!empty($_COOKIE['DOLUSERCOOKIE_ticket_by_status'])) { $tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_ticket_by_status'], true); $endyear = $tmparray['year']; $shownb = $tmparray['shownb']; @@ -104,6 +105,7 @@ if (in_array('DOLUSERCOOKIE_ticket_by_status', $autosetarray)) { } if (empty($shownb) && empty($showtot)) { $showtot = 1; + $shownb = 0; } $nowarray = dol_getdate(dol_now(), true);