diff --git a/ChangeLog b/ChangeLog index ac01ad98197691301c80e0831971a6761d734204..ac96682f558af3c73edd3e939b0a6b4131f04856 100644 --- a/ChangeLog +++ b/ChangeLog @@ -61,17 +61,20 @@ For developers: - New: Make some changes to allow usage of several alternative $dolibarr_main_url_root variables. Fix also several bugs with old code. - Qual: All nowrap properties are now using CSS class nowrap. +- New: Into POST forms, if you can add a parameter DOL_AUTOSET_COOKIE with a vlue that is list name, + separated by a coma, of other POST parameters, Dolibarr will automatically save this parameters + into user cookies. -WARNING: This may create regression for some external modules, but was necessary to make + +WARNING: Following change may create regression for some external modules, but was necessary to make Dolibarr better: 1) We started to clean hooks code. -If your hook want to modify value of $actions, it's role -of your hook to modify it. Dolibarr hook code will not decide this for your module anymore. -If your action class for hook was returning a string or an array, instead your module must -set $actionclassinstance->results (to return array) -or $actionclassinstance->resprints (to return string) -to return same thing. The return value must be replaced by a "return 0"; +If your hook want to modify value of $actions, it's role of your hook to modify it. Dolibarr +hook code will no more decide this for your module. If your action class for hook was returning +a string or an array, instead your module must set $actionclassinstance->results (to return array) +or $actionclassinstance->resprints (to return string) to return same thing. The return value must +be replaced by a "return 0"; Goal is to fix old compatibility code that does not match hook specifications: http://wiki.dolibarr.org/index.php/Hooks_system @@ -80,7 +83,7 @@ All content added must be tagged by a '<div>' with css class="login_block_elem" 3) Some methods object->addline used a first parameter that was object->id, some not. Of course this was not a good pratice, since object->id is already known so no need to provide it as -parameter. All methods addline in this case were modified to remove this information. +parameter. All methods addline in this case were modified to remove this parameter. ***** ChangeLog for 3.4 compared to 3.3.* ***** diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 026a0b9da80e14ea899c0715c7a9657368a6eebb..38ec8204984a566d750de7a4795a0a2201ef36b5 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -77,18 +77,23 @@ class box_graph_invoices_permonth extends ModeleBoxes 'sublink'=>'', 'subtext'=>$langs->trans("Filter"), 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', 'target'=>'none' // Set '' to get target="_blank" ); if ($user->rights->facture->lire) { + $param_year='DOLUSERCOOKIE_param'.$this->boxcode.'year'; + $param_shownb='DOLUSERCOOKIE_param'.$this->boxcode.'shownb'; + $param_showtot='DOLUSERCOOKIE_param'.$this->boxcode.'showtot'; + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; - - $shownb=(! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_NB)); - $showtot=(! isset($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT)); + $shownb=GETPOST($param_shownb,'alpha',4); + $showtot=GETPOST($param_showtot,'alpha',4); + if (empty($shownb) && empty($showtot)) $showtot=1; $nowarray=dol_getdate(dol_now(),true); - $endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']); + $endyear=(GETPOST($param_year,'',4)?GETPOST($param_year,'int',4):$nowarray['year']); $startyear=$endyear-1; $mode='customer'; $userid=0; @@ -183,11 +188,17 @@ class box_graph_invoices_permonth extends ModeleBoxes }); }); </script>'; - $stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; - $stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" value="'.$endyear.'">'; - $stringtoshow.='<a href="'.$_SERVER["PHP_SELF"].'?action='.$refreshaction.'">'; - $stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png'); - $stringtoshow.='</a>'; + $stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden + $stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; + $stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">'; + $stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="'.$param_year.','.$param_shownb.','.$param_showtot.'">'; + $stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'"> '.$langs->trans("NumberOfBillsByMonth"); + $stringtoshow.=' '; + $stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'"> '.$langs->trans("AmountOfBillsByMonthHT"); + $stringtoshow.='<br>'; + $stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">'; + $stringtoshow.='<input type="image" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">'; + $stringtoshow.='</form>'; $stringtoshow.='</div>'; if ($shownb && $showtot) { diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index a435a9cfdc717c02ea9dc9173894c976c950664c..a6e64c10c3e4c3a2d8bab2257c41167369b65cb0 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -76,18 +76,23 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes 'sublink'=>'', 'subtext'=>$langs->trans("Filter"), 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', 'target'=>'none' // Set '' to get target="_blank" ); if ($user->rights->fournisseur->facture->lire) { + $param_year='DOLUSERCOOKIE_param'.$this->boxcode.'year'; + $param_shownb='DOLUSERCOOKIE_param'.$this->boxcode.'shownb'; + $param_showtot='DOLUSERCOOKIE_param'.$this->boxcode.'showtot'; + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; - - $shownb=(! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_NB)); - $showtot=(! isset($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->FACTURE_BOX_GRAPH_SHOW_TOT)); + $shownb=GETPOST($param_shownb,'alpha',4); + $showtot=GETPOST($param_showtot,'alpha',4); + if (empty($shownb) && empty($showtot)) $showtot=1; $nowarray=dol_getdate(dol_now(),true); - $endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']); + $endyear=(GETPOST($param_year,'',4)?GETPOST($param_year,'int',4):$nowarray['year']); $startyear=$endyear-1; $mode='supplier'; $userid=0; @@ -182,11 +187,17 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes }); }); </script>'; - $stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; - $stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" value="'.$endyear.'">'; - $stringtoshow.='<a href="'.$_SERVER["PHP_SELF"].'?action='.$refreshaction.'">'; - $stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png'); - $stringtoshow.='</a>'; + $stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden + $stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; + $stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">'; + $stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="'.$param_year.','.$param_shownb.','.$param_showtot.'">'; + $stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'"> '.$langs->trans("NumberOfBillsByMonth"); + $stringtoshow.=' '; + $stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'"> '.$langs->trans("AmountOfBillsByMonthHT"); + $stringtoshow.='<br>'; + $stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">'; + $stringtoshow.='<input type="image" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">'; + $stringtoshow.='</form>'; $stringtoshow.='</div>'; if ($shownb && $showtot) { diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index cc4310a266e74a2169c6a75eb99d128a42f20207..67463f336370965763e0221587cf372f7baf6f40 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -77,18 +77,23 @@ class box_graph_orders_permonth extends ModeleBoxes 'sublink'=>'', 'subtext'=>$langs->trans("Filter"), 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', 'target'=>'none' // Set '' to get target="_blank" ); if ($user->rights->commande->lire) { + $param_year='DOLUSERCOOKIE_param'.$this->boxcode.'year'; + $param_shownb='DOLUSERCOOKIE_param'.$this->boxcode.'shownb'; + $param_showtot='DOLUSERCOOKIE_param'.$this->boxcode.'showtot'; + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; - - $shownb=(! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_NB)); - $showtot=(! isset($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT)); + $shownb=GETPOST($param_shownb,'alpha',4); + $showtot=GETPOST($param_showtot,'alpha',4); + if (empty($shownb) && empty($showtot)) $showtot=1; $nowarray=dol_getdate(dol_now(),true); - $endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']); + $endyear=(GETPOST($param_year,'',4)?GETPOST($param_year,'int',4):$nowarray['year']); $startyear=$endyear-1; $mode='customer'; $userid=0; @@ -183,11 +188,17 @@ class box_graph_orders_permonth extends ModeleBoxes }); }); </script>'; - $stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; - $stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" value="'.$endyear.'">'; - $stringtoshow.='<a href="'.$_SERVER["PHP_SELF"].'?action='.$refreshaction.'">'; - $stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png'); - $stringtoshow.='</a>'; + $stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden + $stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; + $stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">'; + $stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="'.$param_year.','.$param_shownb.','.$param_showtot.'">'; + $stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'"> '.$langs->trans("NumberOfOrdersByMonth"); + $stringtoshow.=' '; + $stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'"> '.$langs->trans("AmountOfOrdersByMonthHT"); + $stringtoshow.='<br>'; + $stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">'; + $stringtoshow.='<input type="image" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">'; + $stringtoshow.='</form>'; $stringtoshow.='</div>'; if ($shownb && $showtot) { diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 75b4f26bbc4b85b28a4303188a526cab58c76395..52cd0d6832bdf7671de945b35e2e4ff3d7573043 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -76,18 +76,23 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes 'sublink'=>'', 'subtext'=>$langs->trans("Filter"), 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', 'target'=>'none' // Set '' to get target="_blank" ); if ($user->rights->fournisseur->commande->lire) { + $param_year='DOLUSERCOOKIE_param'.$this->boxcode.'year'; + $param_shownb='DOLUSERCOOKIE_param'.$this->boxcode.'shownb'; + $param_showtot='DOLUSERCOOKIE_param'.$this->boxcode.'showtot'; + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; - - $shownb=(! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_NB)); - $showtot=(! isset($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->COMMANDE_BOX_GRAPH_SHOW_TOT)); + $shownb=GETPOST($param_shownb,'alpha',4); + $showtot=GETPOST($param_showtot,'alpha',4); + if (empty($shownb) && empty($showtot)) $showtot=1; $nowarray=dol_getdate(dol_now(),true); - $endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']); + $endyear=(GETPOST($param_year,'',4)?GETPOST($param_year,'int',4):$nowarray['year']); $startyear=$endyear-1; $mode='supplier'; $userid=0; @@ -182,11 +187,17 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes }); }); </script>'; - $stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; - $stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" value="'.$endyear.'">'; - $stringtoshow.='<a href="'.$_SERVER["PHP_SELF"].'?action='.$refreshaction.'">'; - $stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png'); - $stringtoshow.='</a>'; + $stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden + $stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; + $stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">'; + $stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="'.$param_year.','.$param_shownb.','.$param_showtot.'">'; + $stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'"> '.$langs->trans("NumberOfOrdersByMonth"); + $stringtoshow.=' '; + $stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'"> '.$langs->trans("AmountOfOrdersByMonthHT"); + $stringtoshow.='<br>'; + $stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">'; + $stringtoshow.='<input type="image" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">'; + $stringtoshow.='</form>'; $stringtoshow.='</div>'; if ($shownb && $showtot) { diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index d27d4385d8fa499922233f189372aa8f0a9dedd1..fab6b49d83525178bff0176aaa44b8ba0bebd868 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -73,22 +73,27 @@ class box_graph_propales_permonth extends ModeleBoxes $this->info_box_head = array( 'text' => $text, 'limit'=> dol_strlen($text), - 'graph'=> 1, + 'graph'=> 1, // Set to 1 if it's a box graph 'sublink'=>'', 'subtext'=>$langs->trans("Filter"), 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', 'target'=>'none' // Set '' to get target="_blank" ); if ($user->rights->commande->lire) { + $param_year='DOLUSERCOOKIE_param'.$this->boxcode.'year'; + $param_shownb='DOLUSERCOOKIE_param'.$this->boxcode.'shownb'; + $param_showtot='DOLUSERCOOKIE_param'.$this->boxcode.'showtot'; + include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php'; - - $shownb=(! empty($conf->global->PROPAL_BOX_GRAPH_SHOW_NB)); - $showtot=(! isset($conf->global->PROPAL_BOX_GRAPH_SHOW_TOT) || ! empty($conf->global->PROPAL_BOX_GRAPH_SHOW_TOT)); + $shownb=GETPOST($param_shownb,'alpha',4); + $showtot=GETPOST($param_showtot,'alpha',4); + if (empty($shownb) && empty($showtot)) $showtot=1; $nowarray=dol_getdate(dol_now(),true); - $endyear=(GETPOST('param'.$this->boxcode.'year')?GETPOST('param'.$this->boxcode.'year','int'):$nowarray['year']); + $endyear=(GETPOST($param_year,'',4)?GETPOST($param_year,'int',4):$nowarray['year']); $startyear=$endyear-1; $mode='customer'; $userid=0; @@ -188,11 +193,17 @@ class box_graph_propales_permonth extends ModeleBoxes }); }); </script>'; - $stringtoshow.='<div class="center hideobject" id="idfilter'.$this->boxcode.'">'; - $stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" value="'.$endyear.'">'; - $stringtoshow.='<a href="'.$_SERVER["PHP_SELF"].'?action='.$refreshaction.'">'; - $stringtoshow.=img_picto($langs->trans("Refresh"),'refresh.png'); - $stringtoshow.='</a>'; + $stringtoshow.='<div class="center hideobject divboxfilter" id="idfilter'.$this->boxcode.'">'; // hideobject is to start hidden + $stringtoshow.='<form class="flat formboxfilter" method="POST" action="'.$_SERVER["PHP_SELF"].'">'; + $stringtoshow.='<input type="hidden" name="action" value="'.$refreshaction.'">'; + $stringtoshow.='<input type="hidden" name="DOL_AUTOSET_COOKIE" value="'.$param_year.','.$param_shownb.','.$param_showtot.'">'; + $stringtoshow.='<input type="checkbox" name="'.$param_shownb.'"'.($shownb?' checked="true"':'').'"> '.$langs->trans("NumberOfProposalsByMonth"); + $stringtoshow.=' '; + $stringtoshow.='<input type="checkbox" name="'.$param_showtot.'"'.($showtot?' checked="true"':'').'"> '.$langs->trans("AmountOfProposalsByMonthHT"); + $stringtoshow.='<br>'; + $stringtoshow.=$langs->trans("Year").' <input class="flat" size="4" type="text" name="'.$param_year.'" value="'.$endyear.'">'; + $stringtoshow.='<input type="image" src="'.img_picto($langs->trans("Refresh"),'refresh.png','','',1).'">'; + $stringtoshow.='</form>'; $stringtoshow.='</div>'; if ($shownb && $showtot) { diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 2d83e26a870740bd80750cbcf4e913b869611b88..d29b16da73403b8b84d7cb051c735b06597e63e6 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -110,7 +110,7 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" /** - * Standard method to show a box (usage by boxes not mandatory, a box can still use its own function) + * Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function) * * @param array $head Array with properties of box title * @param array $contents Array with properties of box lines @@ -160,7 +160,7 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty" } print ' '; if (! empty($head['sublink'])) print '<a href="'.$head['sublink'].'"'.(empty($head['target'])?' target="_blank"':'').'>'; - if (! empty($head['subpicto'])) print img_picto($head['subtext'], $head['subpicto'], 'class="" id="idsubimg'.$this->boxcode.'"'); + if (! empty($head['subpicto'])) print img_picto($head['subtext'], $head['subpicto'], 'class="'.(empty($head['subclass'])?'':$head['subclass']).'" id="idsubimg'.$this->boxcode.'"'); if (! empty($head['sublink'])) '</a>'; if ($conf->use_javascript_ajax) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5f147017bbd27af669535058162cc91d3cd18078..5b2fd338b9574df586cd7cd72b438babb8171581 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -171,8 +171,8 @@ function dol_shutdown() * * @param string $paramname Name of parameter to found * @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's alpha only, 'array'=check it's array) - * @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get) - * @return string Value found or '' if check fails + * @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie) + * @return string Value found, or '' if check fails */ function GETPOST($paramname,$check='',$method=0) { @@ -180,16 +180,13 @@ function GETPOST($paramname,$check='',$method=0) elseif ($method==1) $out = isset($_GET[$paramname])?$_GET[$paramname]:''; elseif ($method==2) $out = isset($_POST[$paramname])?$_POST[$paramname]:''; elseif ($method==3) $out = isset($_POST[$paramname])?$_POST[$paramname]:(isset($_GET[$paramname])?$_GET[$paramname]:''); - else return 'BadParameter'; + elseif ($method==4) $out = isset($_POST[$paramname])?$_POST[$paramname]:(isset($_GET[$paramname])?$_GET[$paramname]:(isset($_COOKIE[$paramname])?$_COOKIE[$paramname]:'')); + else return 'BadThirdParameterForGETPOST'; if (! empty($check)) { // Check if numeric - if ($check == 'int' && ! preg_match('/^[-\.,0-9]+$/i',$out)) - { - $out=trim($out); - $out=''; - } + if ($check == 'int' && ! is_numeric($out)) $out=''; // Check if alpha elseif ($check == 'alpha') { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index aba63ed674dda880a614579ec171c7e832b96f78..da48e4eadcb882084d39b8a596b16fdf1bfc34ba 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -162,10 +162,17 @@ if (! empty($_SERVER['DOCUMENT_ROOT'])) set_include_path($_SERVER['DOCUMENT_ROOT // Include the conf.php and functions.lib.php require_once 'filefunc.inc.php'; -/*var_dump("Define dolgetprefix ".$_SERVER["SERVER_NAME"]." - ".$_SERVER["DOCUMENT_ROOT"]." - ".DOL_DOCUMENT_ROOT." - ".DOL_URL_ROOT); -var_dump("Cookie ".join($_COOKIE,',')); -var_dump("Cookie ".$_SERVER["HTTP_COOKIE"]); -var_dump("Cookie ".$_SERVER["HTTP_USER_AGENT"]);*/ +// If there is a POST parameter to tell to save automatically some POST params into a cookies, we do it +if (! empty($_POST["DOL_AUTOSET_COOKIE"])) +{ + $tmplist=explode(',',$_POST["DOL_AUTOSET_COOKIE"]); + foreach ($tmplist as $value) + { + //var_dump('setcookie key='.$value.' value='.$_POST[$value]); + setcookie($value, empty($_POST[$value])?'':$_POST[$value], empty($_POST[$value])?0:(time()+(86400*354)), '/'); // keep cookie 1 year + if (empty($_POST[$value])) unset($_COOKIE[$value]); + } +} // Init session. Name of session is specific to Dolibarr instance. $prefix=dol_getprefix(); diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 8dba7f6241f2dbdea7e3b156f82f8cf7c8117ea7..f5e900c0eeea6faa9eba55c7caeba6fdcc17cbd8 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -1354,9 +1354,15 @@ tr.box_pair { font-family:<?php print $fontlist ?>; } -tr.fiche { - font-family:<?php print $fontlist ?>; +.formboxfilter { + vertical-align: middle; } +.formboxfilter input[type=image] +{ + top: 5px; + position: relative; +} + /* * Ok, Warning, Error diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 229d26b0c9add3e83236d554e413689664069b34..5ae45bc19fb6df1822850dc9ca79df63192ad8ac 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -1521,10 +1521,14 @@ tr.box_pair td, tr.box_impair td, td.box_pair, td.box_impair /*border-bottom: 1px solid white;*/ } -tr.fiche { -font-family: <?php print $fontlist ?>; +.formboxfilter { + vertical-align: middle; +} +.formboxfilter input[type=image] +{ + top: 3px; + position: relative; } - diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index aa6e7c02e780e75e445cd1f212c89dc2d4b0ff25..f93f38b1a570120fd112c19cbea555e7043cba65 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -1648,10 +1648,14 @@ background: #f4f4f4; font-family: <?php print $fontlist ?>; } -tr.fiche { -font-family: <?php print $fontlist ?>; +.formboxfilter { + vertical-align: middle; +} +.formboxfilter input[type=image] +{ + top: 3px; + position: relative; } - diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index cbfafd964210b27cab5a5d921499bd913e1e80a1..a54115d164b9053fb81d65ca60c2bff76dbae4c9 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -1654,10 +1654,14 @@ background: #c0c4c7; border: 0px; } -tr.fiche { -font-family: <?php print $fontlist ?>; +.formboxfilter { + vertical-align: middle; +} +.formboxfilter input[type=image] +{ + top: 4px; + position: relative; } - diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 271b0975ecc91ddcb3a4e6a35834fab1061218e7..f2a7e6a4607f7a48a360977b89f53f2df54e0cd0 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1557,7 +1557,6 @@ span.butAction, span.butActionDelete { } #undertopmenu { - /* background-image: url("<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/gradient.gif',1) ?>"); */ background-repeat: repeat-x; margin-top: <?php echo ($dol_hide_topmenu?'6':'0'); ?>px; } @@ -1941,9 +1940,15 @@ tr.box_pair { font-family: <?php print $fontlist ?>; } -tr.fiche { - font-family: <?php print $fontlist ?>; +.formboxfilter { + vertical-align: middle; } +.formboxfilter input[type=image] +{ + top: 5px; + position: relative; +} +