diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 13251cef4b6..e83c7ea01b4 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -581,7 +581,7 @@ if (isModEnabled('category') && ($user->hasRight('produit', 'lire') || $user->ha } // alert on late date $moreforfilter .= '
'; -$moreforfilter .= $langs->trans('Alert').' '; +$moreforfilter .= ' '; $moreforfilter .= '
'; $parameters = array(); diff --git a/htdocs/core/ajax/fetchCategories.php b/htdocs/core/ajax/fetchCategories.php index 1d95a34b603..cb380b5a239 100644 --- a/htdocs/core/ajax/fetchCategories.php +++ b/htdocs/core/ajax/fetchCategories.php @@ -49,6 +49,7 @@ if (!defined('NOBROWSERNOTIF')) { define('NOBROWSERNOTIF', '1'); } include '../../main.inc.php'; +include_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; /** * @var Conf $conf @@ -80,10 +81,16 @@ if (!defined("NOLOGIN")) { // No need of restrictedArea if not logged: Later the * View */ +$form = new Form($db); + top_httphead('application/json'); if ($action == "getCategories") { - $response = ''; + $response = array(); + + $cate_arbo = $form->select_all_categories($type, '', '', 64, 0, 2); + + /* $sql = "SELECT c.rowid, c.label, c.color"; $sql .= " FROM ".MAIN_DB_PREFIX."categorie as c "; $sql .= " WHERE c.type = '".$db->escape($type)."'"; @@ -95,12 +102,16 @@ if ($action == "getCategories") { $response = array(); while ($i < $num) { $obj = $db->fetch_object($resql); - $response[] = array('id' => $obj->rowid, 'label' => $obj->label, 'data-html' => 'TODO', 'color' => $obj->color); + $response[] = array('id' => $obj->rowid, 'label' => $obj->label, 'html' => img_picto('', 'tag', 'class="pictofixedwidth"'.($obj->color ? ' style="color: #'.$obj->color.'"' : '')).$obj->label, 'color' => $obj->color); $i++; } } else { dol_print_error($db); } + */ + foreach ($cate_arbo as $categ) { + $response[] = array('id' => $categ['id'], 'label' => $categ['label'], 'fulllabel' => $categ['fulllabel'], 'htmlforoption' => dolPrintHTML($categ['fulllabel']), 'htmlforattribute' => dolPrintHTMLForAttribute($categ['data-html']), 'color' => $categ['color']); + } $response =json_encode($response); echo $response; diff --git a/htdocs/core/ajax/fetchKnowledgeRecord.php b/htdocs/core/ajax/fetchKnowledgeRecord.php index 1bb9dd925c2..7e38adc8f32 100644 --- a/htdocs/core/ajax/fetchKnowledgeRecord.php +++ b/htdocs/core/ajax/fetchKnowledgeRecord.php @@ -102,7 +102,7 @@ if ($action == "getKnowledgeRecord") { $response = array(); while ($i < $num) { $obj = $db->fetch_object($resql); - $response[] = array('title'=>$obj->question,'ref'=>$obj->ref,'answer'=>dol_escape_htmltag(preg_replace('/\\r|\\r\\n|\\n/', "", $obj->answer)),'url'=>$obj->url); + $response[] = array('title' => dol_escape_htmltag($obj->question), 'ref' => dol_escape_htmltag($obj->ref), 'answer' => dol_escape_htmltag(preg_replace('/\\r|\\r\\n|\\n/', "", $obj->answer)), 'url' => $obj->url); $i++; } } else { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f6bf37f03dc..9c22ca7429b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5690,7 +5690,7 @@ class Form $add = ''; } - $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth" style="color: #' . $cate_arbo[$key]['color'] . '"'); + $labeltoshow = img_picto('', 'category', 'class="pictofixedwidth"'.(empty($cate_arbo[$key]['color']) ? '' : ' style="color: #' . $cate_arbo[$key]['color'] . '"')); $labeltoshow .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle'); $outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel']; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index bed3591c922..a58e8e4edce 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2790,11 +2790,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio dataType: \'json\', success: function (data) { var $select = $(\'#'.dol_escape_js($htmlname).'\'); + var selectedValues = $select.val(); // This is an array of selected values + console.log(selectedValues); $select.empty(); - $.each(data, function (index, item) { - $select.append(\'\'); + $select.append(\'\'); }); + $select.val(selectedValues); }, error: function (xhr, status, error) { alert("Error when loading ajax page : " + error); @@ -2966,7 +2968,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio ) ); - $formconfirm .= $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("MergeThirdparties"), $langs->trans("ConfirmMergeThirdparties"), "confirm_merge", $formquestion, 'no', 1, 250); + $formconfirm .= $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("MergeThirdparties"), $langs->trans("ConfirmMergeThirdparties"), "confirm_merge", $formquestion, 'no', 1, 300); } // Clone confirmation diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index bfd98ef77db..a7f94b0da3b 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5811,6 +5811,21 @@ div#card-errors { padding-top: 5px; padding-bottom: 5px; } +.ui-widget-header { + padding: 8px !important; + background: unset; + border: unset; + border-bottom: 1px solid #AAA; + margin-bottom: 12px; +} +button.ui-button-icon-only.ui-dialog-titlebar-close { + padding: 12px; + margin-top: -15px; +} +.ui-dialog.ui-corner-all.ui-widget.ui-widget-content.ui-front.ui-dialog-buttons.ui-draggable { + box-shadow: 5px 5px 20px #AAA; +} + /* ============================================================================== */ /* For content of image preview */