diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index aaa946fd2fe..27af9dc5149 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -547,7 +547,7 @@ if (empty($reshook)) { $object->title = (string) GETPOST("title"); $object->sujet = (string) GETPOST("sujet"); $object->body = (string) GETPOST("bodyemail", 'restricthtml'); - $object->bgcolor = (string) GETPOST("bgcolor"); + $object->bgcolor = preg_replace('/^#/', '', (string) GETPOST("bgcolor")); $object->bgimage = (string) GETPOST("bgimage"); if (!$object->title) { @@ -641,7 +641,7 @@ if (empty($reshook)) { $mesgs = array(); $object->sujet = (string) GETPOST("sujet"); $object->body = (string) GETPOST("bodyemail", 'restricthtml'); - $object->bgcolor = (string) GETPOST("bgcolor"); + $object->bgcolor = preg_replace('/^#/', '', (string) GETPOST("bgcolor")); $object->bgimage = (string) GETPOST("bgimage"); if (!$object->sujet) { diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 05da688d2f8..84ba1d772c3 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1889,7 +1889,7 @@ if ($action == 'create') { $thirdparty = $soc; $discount_type = 0; - $backtopage = urlencode($_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.GETPOST('origin').'&originid='.GETPOST('originid')); + $backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode(GETPOST('origin')).'&originid='.urlencode(GETPOSTINT('originid')); include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; print ''; } @@ -2473,7 +2473,7 @@ if ($action == 'create') { $thirdparty = $soc; $discount_type = 0; - $backtopage = urlencode($_SERVER["PHP_SELF"].'?id='.$object->id); + $backtopage = $_SERVER["PHP_SELF"].'?id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; print ''; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index afe3818bab1..36be4ee5a1d 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1852,7 +1852,7 @@ if ($action == 'create' && $usercancreate) { $thirdparty = $soc; $discount_type = 0; - $backtopage = urlencode($_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.GETPOST('origin').'&originid='.GETPOST('originid')); + $backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode(GETPOST('origin')).'&originid='.urlencode(GETPOSTINT('originid')); include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; print ''; @@ -2470,7 +2470,7 @@ if ($action == 'create' && $usercancreate) { $thirdparty = $soc; $discount_type = 0; - $backtopage = urlencode($_SERVER["PHP_SELF"].'?id='.$object->id); + $backtopage = $_SERVER["PHP_SELF"].'?id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index a8789854566..e3c2f8f6c5c 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2029,6 +2029,8 @@ if (empty($reshook)) { $price_ht_devise = ''; $price_ttc = ''; $price_ttc_devise = ''; + $price_min = ''; + $price_min_ttc = ''; if (GETPOST('price_ht') !== '') { $price_ht = price2num(GETPOST('price_ht'), 'MU', 2); @@ -3167,7 +3169,6 @@ if ($action == 'create') { print ''."\n"; } print ''; - print ''; print ''; print ''; print ''; @@ -3668,7 +3669,7 @@ if ($action == 'create') { $thirdparty = $soc; $discount_type = 0; - $backtopage = urlencode($_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.GETPOST('origin', 'alpha').'&originid='.GETPOST('originid', 'int')); + $backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode(GETPOST('origin')).'&originid='.urlencode(GETPOSTINT('originid')); include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; print ''; @@ -4502,7 +4503,7 @@ if ($action == 'create') { print ''; $thirdparty = $soc; $discount_type = 0; - $backtopage = urlencode($_SERVER["PHP_SELF"].'?facid='.$object->id); + $backtopage = $_SERVER["PHP_SELF"].'?facid='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php'; print ''; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 8800d5a59fc..e1356fb5dec 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -825,11 +825,11 @@ class FormOther /** * Output a HTML code to select a color. Field will return an hexa color like '334455'. * - * @param string $set_color Pre-selected color + * @param string $set_color Pre-selected color with format '#......' * @param string $prefix Name of HTML field * @param string $form_name Deprecated. Not used. * @param int $showcolorbox 1=Show color code and color box, 0=Show only color code - * @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') + * @param array $arrayofcolors Array of possible colors to choose in the selector. All colors are possible if empty. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') * @param string $morecss Add css style into input field * @param string $setpropertyonselect Set this property after selecting a color * @param string $default Default color @@ -917,7 +917,8 @@ class FormOther '; $out .= ''; } else { - $out .= ''; + $color = ($set_color !== '' ? $set_color : ($default !== '' ? $default : 'FFFFFF')); + $out .= ''; $out .= '