From df829177bc676808f5e7f3bec451ddad1ab25573 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Mar 2014 17:45:40 +0100 Subject: [PATCH] Fix: Submit form of graph box was reseting params of others. --- htdocs/core/boxes/box_graph_invoices_permonth.php | 5 +++-- htdocs/core/boxes/box_graph_invoices_supplier_permonth.php | 5 +++-- htdocs/core/boxes/box_graph_orders_permonth.php | 5 +++-- htdocs/core/boxes/box_graph_orders_supplier_permonth.php | 5 +++-- htdocs/core/boxes/box_graph_product_distribution.php | 3 ++- htdocs/core/boxes/box_graph_propales_permonth.php | 5 +++-- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index f87cf169757..f9647c4e4ca 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -86,7 +86,7 @@ class box_graph_invoices_permonth extends ModeleBoxes $socid=0; if ($user->societe_id) $socid=$user->societe_id; if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user - + if ($user->rights->facture->lire) { $param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; @@ -95,7 +95,8 @@ class box_graph_invoices_permonth extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; - if (GETPOST('DOL_AUTOSET_COOKIE')) + $autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE')); + if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray)) { $endyear=GETPOST($param_year,'int'); $shownb=GETPOST($param_shownb,'alpha'); diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index e732270c044..e985ca62912 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -85,7 +85,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $socid=0; if ($user->societe_id) $socid=$user->societe_id; if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user - + if ($user->rights->fournisseur->facture->lire) { $param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; @@ -94,7 +94,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; - if (GETPOST('DOL_AUTOSET_COOKIE')) + $autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE')); + if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray)) { $endyear=GETPOST($param_year,'int'); $shownb=GETPOST($param_shownb,'alpha'); diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 704117834c4..ce4008761b7 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -86,7 +86,7 @@ class box_graph_orders_permonth extends ModeleBoxes $socid=0; if ($user->societe_id) $socid=$user->societe_id; if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user - + if ($user->rights->commande->lire) { $param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; @@ -95,7 +95,8 @@ class box_graph_orders_permonth extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; - if (GETPOST('DOL_AUTOSET_COOKIE')) + $autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE')); + if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray)) { $endyear=GETPOST($param_year,'int'); $shownb=GETPOST($param_shownb,'alpha'); diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 5267bf3ffb5..7abdd742d23 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -85,7 +85,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes $socid=0; if ($user->societe_id) $socid=$user->societe_id; if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user - + if ($user->rights->fournisseur->commande->lire) { $param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; @@ -94,7 +94,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; - if (GETPOST('DOL_AUTOSET_COOKIE')) + $autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE')); + if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray)) { $endyear=GETPOST($param_year,'int'); $shownb=GETPOST($param_shownb,'alpha'); diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 725ef300125..dd8f7512eb1 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -86,7 +86,8 @@ class box_graph_product_distribution extends ModeleBoxes $param_showinvoicenb='DOLUSERCOOKIE_box_'.$this->boxcode.'_showinvoicenb'; $param_showpropalnb='DOLUSERCOOKIE_box_'.$this->boxcode.'_showpropalnb'; $param_showordernb='DOLUSERCOOKIE_box_'.$this->boxcode.'_showordernb'; - if (GETPOST('DOL_AUTOSET_COOKIE')) + $autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE')); + if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray)) { $year=GETPOST($param_year,'int'); $showinvoicenb=GETPOST($param_showinvoicenb,'alpha'); diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 58d00ce97fe..a934fb8e377 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -86,7 +86,7 @@ class box_graph_propales_permonth extends ModeleBoxes $socid=0; if ($user->societe_id) $socid=$user->societe_id; if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user - + if ($user->rights->propal->lire) { $param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; @@ -95,7 +95,8 @@ class box_graph_propales_permonth extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php'; - if (GETPOST('DOL_AUTOSET_COOKIE')) + $autosetarray=preg_split("/[,;:]+/",GETPOST('DOL_AUTOSET_COOKIE')); + if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode,$autosetarray)) { $endyear=GETPOST($param_year,'int'); $shownb=GETPOST($param_shownb,'alpha');