mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
QUAL Standardize name of user cookies
This commit is contained in:
parent
5f21a3a4e3
commit
f086d9ee3e
|
|
@ -100,19 +100,19 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||
if ($user->hasRight('facture', 'lire')) {
|
||||
$mesg = '';
|
||||
|
||||
$param_year = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
||||
$param_shownb = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb';
|
||||
$param_showtot = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot';
|
||||
$param_year = 'DOLUSER_box_'.$this->boxcode.'_year';
|
||||
$param_shownb = 'DOLUSER_box_'.$this->boxcode.'_shownb';
|
||||
$param_showtot = 'DOLUSER_box_'.$this->boxcode.'_showtot';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php';
|
||||
$autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE'));
|
||||
if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) {
|
||||
if (in_array('DOLUSER_box_'.$this->boxcode, $autosetarray)) {
|
||||
$endyear = GETPOSTINT($param_year);
|
||||
$shownb = GETPOST($param_shownb, 'alpha');
|
||||
$showtot = GETPOST($param_showtot, 'alpha');
|
||||
} else {
|
||||
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||
$tmparray = (!empty($_COOKIE['DOLUSER_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSER_box_'.$this->boxcode], true) : array());
|
||||
$endyear = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||
$shownb = (!empty($tmparray['shownb']) ? $tmparray['shownb'] : '');
|
||||
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
|
||||
|
|
@ -234,7 +234,7 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||
$stringtoshow .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$stringtoshow .= '<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow .= '<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSER_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow .= '<input type="checkbox" name="'.$param_shownb.'"'.($shownb ? ' checked' : '').'> '.$langs->trans("NumberOfBillsByMonth");
|
||||
$stringtoshow .= ' ';
|
||||
$stringtoshow .= '<input type="checkbox" name="'.$param_showtot.'"'.($showtot ? ' checked' : '').'> '.$langs->trans("AmountOfBillsByMonthHT");
|
||||
|
|
|
|||
|
|
@ -97,17 +97,17 @@ class box_graph_invoices_peryear extends ModeleBoxes
|
|||
if ($user->hasRight('facture', 'lire')) {
|
||||
$mesg = '';
|
||||
|
||||
$param_year = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
||||
$param_showtot = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot';
|
||||
$param_year = 'DOLUSER_box_'.$this->boxcode.'_year';
|
||||
$param_showtot = 'DOLUSER_box_'.$this->boxcode.'_showtot';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php';
|
||||
$autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE'));
|
||||
if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) {
|
||||
if (in_array('DOLUSER_box_'.$this->boxcode, $autosetarray)) {
|
||||
$endyear = GETPOSTINT($param_year);
|
||||
$showtot = GETPOST($param_showtot, 'alpha');
|
||||
} else {
|
||||
$tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true);
|
||||
$tmparray = json_decode($_COOKIE['DOLUSER_box_'.$this->boxcode], true);
|
||||
$endyear = $tmparray['year'];
|
||||
$showtot = $tmparray['showtot'];
|
||||
}
|
||||
|
|
@ -188,7 +188,7 @@ class box_graph_invoices_peryear extends ModeleBoxes
|
|||
$stringtoshow .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$stringtoshow .= '<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow .= '<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,showtot">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSER_box_'.$this->boxcode.':year,showtot">';
|
||||
$stringtoshow .= $langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">';
|
||||
$stringtoshow .= '<input class="reposition inline-block valigntextbottom" type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"), 'refresh.png', '', 0, 1).'">';
|
||||
$stringtoshow .= '</form>';
|
||||
|
|
|
|||
|
|
@ -96,19 +96,19 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||
}
|
||||
|
||||
if ($user->hasRight('fournisseur', 'facture', 'lire')) {
|
||||
$param_year = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
||||
$param_shownb = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb';
|
||||
$param_showtot = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot';
|
||||
$param_year = 'DOLUSER_box_'.$this->boxcode.'_year';
|
||||
$param_shownb = 'DOLUSER_box_'.$this->boxcode.'_shownb';
|
||||
$param_showtot = 'DOLUSER_box_'.$this->boxcode.'_showtot';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php';
|
||||
$autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE'));
|
||||
if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) {
|
||||
if (in_array('DOLUSER_box_'.$this->boxcode, $autosetarray)) {
|
||||
$endyear = GETPOSTINT($param_year);
|
||||
$shownb = GETPOST($param_shownb, 'alpha');
|
||||
$showtot = GETPOST($param_showtot, 'alpha');
|
||||
} else {
|
||||
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||
$tmparray = (!empty($_COOKIE['DOLUSER_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSER_box_'.$this->boxcode], true) : array());
|
||||
$endyear = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||
$shownb = (!empty($tmparray['shownb']) ? $tmparray['shownb'] : '');
|
||||
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
|
||||
|
|
@ -229,7 +229,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||
$stringtoshow .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$stringtoshow .= '<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow .= '<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSER_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow .= '<input type="checkbox" name="'.$param_shownb.'"'.($shownb ? ' checked' : '').'> '.$langs->trans("NumberOfBillsByMonth");
|
||||
$stringtoshow .= ' ';
|
||||
$stringtoshow .= '<input type="checkbox" name="'.$param_showtot.'"'.($showtot ? ' checked' : '').'> '.$langs->trans("AmountOfBillsByMonthHT");
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
|
|||
$this->max = $max;
|
||||
|
||||
|
||||
$param_day = 'DOLUSERCOOKIE_ticket_last_days';
|
||||
$param_day = 'DOLUSER_ticket_last_days';
|
||||
if (GETPOST($param_day)) {
|
||||
if (GETPOST($param_day) >= 15) {
|
||||
$days = 14;
|
||||
|
|
@ -93,7 +93,7 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
|
|||
$days = 7;
|
||||
}
|
||||
require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php";
|
||||
$text = $langs->trans("BoxTicketLastXDays", $days).' '.img_picto('', 'filter.png', 'id="idsubimgDOLUSERCOOKIE_ticket_last_days" class="linkobject"');
|
||||
$text = $langs->trans("BoxTicketLastXDays", $days).' '.img_picto('', 'filter.png', 'id="idsubimgDOLUSER_ticket_last_days" class="linkobject"');
|
||||
$this->info_box_head = array(
|
||||
'text' => $text,
|
||||
'limit' => dol_strlen($text)
|
||||
|
|
@ -137,16 +137,16 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
|
|||
$stringtoshow = '<div class="div-table-responsive-no-min">';
|
||||
$stringtoshow .= '<script nonce="'.getNonce().'" type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
jQuery("#idsubimgDOLUSERCOOKIE_ticket_last_days").click(function() {
|
||||
jQuery("#idfilterDOLUSERCOOKIE_ticket_last_days").toggle();
|
||||
jQuery("#idsubimgDOLUSER_ticket_last_days").click(function() {
|
||||
jQuery("#idfilterDOLUSER_ticket_last_days").toggle();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
$stringtoshow .= '<div class="center hideobject" id="idfilterDOLUSERCOOKIE_ticket_last_days">'; // hideobject is to start hidden
|
||||
$stringtoshow .= '<div class="center hideobject" id="idfilterDOLUSER_ticket_last_days">'; // hideobject is to start hidden
|
||||
$stringtoshow .= '<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
$stringtoshow .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$stringtoshow .= '<input type="hidden" name="action" value="refresh">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_ticket_last_days:days">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSER_ticket_last_days:days">';
|
||||
$stringtoshow .= ' <input class="flat" size="4" type="text" name="'.$param_day.'" value="'.$days.'">'.$langs->trans("Days");
|
||||
$stringtoshow .= '<input type="image" alt="'.$langs->trans("Refresh").'" src="'.img_picto($langs->trans("Refresh"), 'refresh.png', '', 0, 1).'">';
|
||||
$stringtoshow .= '</form>';
|
||||
|
|
|
|||
|
|
@ -99,19 +99,19 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||
if ($user->hasRight('commande', 'lire')) {
|
||||
$langs->load("orders");
|
||||
|
||||
$param_year = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
||||
$param_shownb = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb';
|
||||
$param_showtot = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot';
|
||||
$param_year = 'DOLUSER_box_'.$this->boxcode.'_year';
|
||||
$param_shownb = 'DOLUSER_box_'.$this->boxcode.'_shownb';
|
||||
$param_showtot = 'DOLUSER_box_'.$this->boxcode.'_showtot';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php';
|
||||
$autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE'));
|
||||
if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) {
|
||||
if (in_array('DOLUSER_box_'.$this->boxcode, $autosetarray)) {
|
||||
$endyear = GETPOSTINT($param_year);
|
||||
$shownb = GETPOST($param_shownb, 'alpha');
|
||||
$showtot = GETPOST($param_showtot, 'alpha');
|
||||
} else {
|
||||
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||
$tmparray = (!empty($_COOKIE['DOLUSER_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSER_box_'.$this->boxcode], true) : array());
|
||||
$endyear = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||
$shownb = (!empty($tmparray['shownb']) ? $tmparray['shownb'] : '');
|
||||
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
|
||||
|
|
@ -233,7 +233,7 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||
$stringtoshow .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$stringtoshow .= '<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow .= '<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSER_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow .= '<input type="checkbox" name="'.$param_shownb.'"'.($shownb ? ' checked' : '').'> '.$langs->trans("NumberOfOrdersByMonth");
|
||||
$stringtoshow .= ' ';
|
||||
$stringtoshow .= '<input type="checkbox" name="'.$param_showtot.'"'.($showtot ? ' checked' : '').'> '.$langs->trans("AmountOfOrdersByMonthHT");
|
||||
|
|
|
|||
|
|
@ -98,19 +98,19 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||
if ($user->hasRight('fournisseur', 'commande', 'lire')) {
|
||||
$langs->load("orders");
|
||||
|
||||
$param_year = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
||||
$param_shownb = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb';
|
||||
$param_showtot = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot';
|
||||
$param_year = 'DOLUSER_box_'.$this->boxcode.'_year';
|
||||
$param_shownb = 'DOLUSER_box_'.$this->boxcode.'_shownb';
|
||||
$param_showtot = 'DOLUSER_box_'.$this->boxcode.'_showtot';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php';
|
||||
$autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE'));
|
||||
if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) {
|
||||
if (in_array('DOLUSER_box_'.$this->boxcode, $autosetarray)) {
|
||||
$endyear = GETPOSTINT($param_year);
|
||||
$shownb = GETPOST($param_shownb, 'alpha');
|
||||
$showtot = GETPOST($param_showtot, 'alpha');
|
||||
} else {
|
||||
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||
$tmparray = (!empty($_COOKIE['DOLUSER_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSER_box_'.$this->boxcode], true) : array());
|
||||
$endyear = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||
$shownb = (!empty($tmparray['shownb']) ? $tmparray['shownb'] : '');
|
||||
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
|
||||
|
|
@ -232,7 +232,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||
$stringtoshow .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$stringtoshow .= '<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow .= '<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSER_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow .= '<input type="checkbox" name="'.$param_shownb.'"'.($shownb ? ' checked' : '').'> '.$langs->trans("NumberOfOrdersByMonth");
|
||||
$stringtoshow .= ' ';
|
||||
$stringtoshow .= '<input type="checkbox" name="'.$param_showtot.'"'.($showtot ? ' checked' : '').'> '.$langs->trans("AmountOfOrdersByMonthHT");
|
||||
|
|
|
|||
|
|
@ -75,18 +75,18 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
|
||||
$param_year = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
||||
$param_showinvoicenb = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showinvoicenb';
|
||||
$param_showpropalnb = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showpropalnb';
|
||||
$param_showordernb = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showordernb';
|
||||
$param_year = 'DOLUSER_box_'.$this->boxcode.'_year';
|
||||
$param_showinvoicenb = 'DOLUSER_box_'.$this->boxcode.'_showinvoicenb';
|
||||
$param_showpropalnb = 'DOLUSER_box_'.$this->boxcode.'_showpropalnb';
|
||||
$param_showordernb = 'DOLUSER_box_'.$this->boxcode.'_showordernb';
|
||||
$autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE'));
|
||||
if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) {
|
||||
if (in_array('DOLUSER_box_'.$this->boxcode, $autosetarray)) {
|
||||
$year = GETPOSTINT($param_year);
|
||||
$showinvoicenb = GETPOST($param_showinvoicenb, 'alpha');
|
||||
$showpropalnb = GETPOST($param_showpropalnb, 'alpha');
|
||||
$showordernb = GETPOST($param_showordernb, 'alpha');
|
||||
} else {
|
||||
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||
$tmparray = (!empty($_COOKIE['DOLUSER_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSER_box_'.$this->boxcode], true) : array());
|
||||
$year = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||
$showinvoicenb = (!empty($tmparray['showinvoicenb']) ? $tmparray['showinvoicenb'] : '');
|
||||
$showpropalnb = (!empty($tmparray['showpropalnb']) ? $tmparray['showpropalnb'] : '');
|
||||
|
|
@ -354,7 +354,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||
$stringtoshow .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$stringtoshow .= '<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow .= '<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,showinvoicenb,showpropalnb,showordernb">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSER_box_'.$this->boxcode.':year,showinvoicenb,showpropalnb,showordernb">';
|
||||
if (isModEnabled("propal") || $user->hasRight('propal', 'lire')) {
|
||||
$stringtoshow .= '<input type="checkbox" name="'.$param_showpropalnb.'"'.($showpropalnb ? ' checked' : '').'> '.$langs->trans("ForProposals");
|
||||
$stringtoshow .= ' ';
|
||||
|
|
|
|||
|
|
@ -99,19 +99,19 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||
}
|
||||
|
||||
if ($user->hasRight('propal', 'lire')) {
|
||||
$param_year = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
||||
$param_shownb = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb';
|
||||
$param_showtot = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot';
|
||||
$param_year = 'DOLUSER_box_'.$this->boxcode.'_year';
|
||||
$param_shownb = 'DOLUSER_box_'.$this->boxcode.'_shownb';
|
||||
$param_showtot = 'DOLUSER_box_'.$this->boxcode.'_showtot';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php';
|
||||
$autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE'));
|
||||
if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) {
|
||||
if (in_array('DOLUSER_box_'.$this->boxcode, $autosetarray)) {
|
||||
$endyear = GETPOSTINT($param_year);
|
||||
$shownb = GETPOST($param_shownb, 'alpha');
|
||||
$showtot = GETPOST($param_showtot, 'alpha');
|
||||
} else {
|
||||
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||
$tmparray = (!empty($_COOKIE['DOLUSER_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSER_box_'.$this->boxcode], true) : array());
|
||||
$endyear = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||
$shownb = (!empty($tmparray['shownb']) ? $tmparray['shownb'] : '');
|
||||
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
|
||||
|
|
@ -229,7 +229,7 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||
$stringtoshow .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$stringtoshow .= '<input type="hidden" name="action" value="'.$refreshaction.'">';
|
||||
$stringtoshow .= '<input type="hidden" name="page_y" value="">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSER_box_'.$this->boxcode.':year,shownb,showtot">';
|
||||
$stringtoshow .= '<input type="checkbox" name="'.$param_shownb.'"'.($shownb ? ' checked' : '').'> '.$langs->trans("NumberOfProposalsByMonth");
|
||||
$stringtoshow .= ' ';
|
||||
$stringtoshow .= '<input type="checkbox" name="'.$param_showtot.'"'.($showtot ? ' checked' : '').'> '.$langs->trans("AmountOfProposalsByMonthHT");
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class box_task extends ModeleBoxes
|
|||
$projectstatic = new Project($this->db);
|
||||
$taskstatic = new Task($this->db);
|
||||
$form = new Form($this->db);
|
||||
$cookie_name = 'DOLUSERCOOKIE_boxfilter_task';
|
||||
$cookie_name = 'DOLUSER_boxfilter_task';
|
||||
$boxcontent = '';
|
||||
$socid = $user->socid;
|
||||
|
||||
|
|
|
|||
|
|
@ -2338,7 +2338,7 @@ class ExtraFields
|
|||
$expand_display = false;
|
||||
if (is_array($extrafield_param_list) && count($extrafield_param_list) > 0) {
|
||||
$extrafield_collapse_display_value = intval($extrafield_param_list[0]);
|
||||
$expand_display = ((isset($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key]) || GETPOSTINT('ignorecollapsesetup')) ? (!empty($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key])) : !($extrafield_collapse_display_value == 2));
|
||||
$expand_display = ((isset($_COOKIE['DOLUSER_COLLAPSE_'.$object->table_element.'_extrafields_'.$key]) || GETPOSTINT('ignorecollapsesetup')) ? (!empty($_COOKIE['DOLUSER_COLLAPSE_'.$object->table_element.'_extrafields_'.$key])) : !($extrafield_collapse_display_value == 2));
|
||||
}
|
||||
$disabledcookiewrite = 0;
|
||||
if ($mode == 'create') {
|
||||
|
|
@ -2377,7 +2377,7 @@ class ExtraFields
|
|||
$out .= ' jQuery(".trextrafields_collapse'.$collapse_group.'").hide();'."\n";
|
||||
} else {
|
||||
$out .= ' console.log("Inject js for collapsing of extrafield '.$key.' - keep visible and set cookie");'."\n";
|
||||
$out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n";
|
||||
$out .= ' document.cookie = "DOLUSER_COLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n";
|
||||
}
|
||||
}
|
||||
$out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'").click(function(){'."\n";
|
||||
|
|
@ -2385,10 +2385,10 @@ class ExtraFields
|
|||
$out .= ' jQuery(".trextrafields_collapse'.$collapse_group.'").toggle(100, function(){'."\n";
|
||||
$out .= ' if (jQuery(".trextrafields_collapse'.$collapse_group.'").is(":hidden")) {'."\n";
|
||||
$out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n";
|
||||
$out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=0; path='.$_SERVER["PHP_SELF"].'"'."\n";
|
||||
$out .= ' document.cookie = "DOLUSER_COLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=0; path='.$_SERVER["PHP_SELF"].'"'."\n";
|
||||
$out .= ' } else {'."\n";
|
||||
$out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n";
|
||||
$out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n";
|
||||
$out .= ' document.cookie = "DOLUSER_COLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n";
|
||||
$out .= ' }'."\n";
|
||||
$out .= ' });'."\n";
|
||||
$out .= ' });'."\n";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user