diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index f2c76c270a31e..624fa795b3991 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -11,8 +11,8 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Charlie Benke * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2023 Benjamin Falière - * Copyright (C) 2024 MDW + * Copyright (C) 2023-2024 Benjamin Falière + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1167,6 +1167,7 @@ public function get_full_arbo($type, $markafterid = 0, $include = 0) } $this->cats = array(); + $nbcateg = 0; // Init this->motherof that is array(id_son=>id_parent, ...) $this->load_motherof(); @@ -1188,6 +1189,8 @@ public function get_full_arbo($type, $markafterid = 0, $include = 0) $resql = $this->db->query($sql); if ($resql) { $i = 0; + $nbcateg = $this->db->num_rows($resql); + while ($obj = $this->db->fetch_object($resql)) { $this->cats[$obj->rowid]['rowid'] = $obj->rowid; $this->cats[$obj->rowid]['id'] = $obj->rowid; @@ -1210,7 +1213,7 @@ public function get_full_arbo($type, $markafterid = 0, $include = 0) dol_syslog(get_class($this)."::get_full_arbo call to buildPathFromId", LOG_DEBUG); foreach ($this->cats as $key => $val) { //print 'key='.$key.'
'."\n"; - $this->buildPathFromId($key, 0); // Process a branch from the root category key (this category has no parent) + $this->buildPathFromId($key, $nbcateg); // Process a branch from the root category key (this category has no parent) } // Include or exclude leaf including $markafterid from tree diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 64857afa53588..dc631fa8a2758 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -300,7 +300,7 @@ } $object->$key = $value; - if ($val['notnull'] > 0 && $object->$key == '' && is_null($val['default'])) { + if ($val['notnull'] > 0 && $object->$key == '' && (!isset($val['default']) || is_null($val['default']))) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv($val['label'])), null, 'errors'); } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 2a45604b5cd85..a8ea6513f528e 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -593,6 +593,7 @@ public function update($attrname, $label, $type, $length, $elementtype, $unique $lengthdb = '255'; } elseif ($type == 'html') { $typedb = 'text'; + $lengthdb = $length; } elseif ($type == 'link') { $typedb = 'int'; $lengthdb = '11'; diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php index 407befd5aacf0..2569cd7ebef01 100644 --- a/htdocs/core/class/html.formwebsite.class.php +++ b/htdocs/core/class/html.formwebsite.class.php @@ -131,6 +131,7 @@ public function selectTypeOfContainer($htmlname, $selected = '', $useempty = 0, while ($i < $num) { $obj = $this->db->fetch_object($result); + if ($selected == $obj->rowid || $selected == $obj->code) { print ''; + + $conf->cache['type_of_container'][$obj->code] = $obj->label; + $i++; } print ""; @@ -170,7 +174,7 @@ public function selectTypeOfContainer($htmlname, $selected = '', $useempty = 0, */ public function selectSampleOfContainer($htmlname, $selected = '', $useempty = 0, $moreattrib = '', $addjscombo = 0, $morecss = 'minwidth200') { - global $langs, $conf, $user; + global $langs, $user; $langs->load("admin"); diff --git a/htdocs/langs/zh_CN/other.lang b/htdocs/langs/zh_CN/other.lang index cf686f5893319..268d88f3694e8 100644 --- a/htdocs/langs/zh_CN/other.lang +++ b/htdocs/langs/zh_CN/other.lang @@ -118,7 +118,7 @@ DemoCompanyManufacturing=Company manufacturing products DemoCompanyAll=公司有多项活动(所有主要模块) CreatedBy=创建者 %s ModifiedBy=修改者 %s -ValidatedBy=由%验证s +ValidatedBy=由%s验证 SignedBy=Signed by %s ClosedBy=由%闭s CreatedById=创建的用户ID号 diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 65035f02da57f..67886881b328e 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2576,8 +2576,8 @@ function top_menu_user($hideloginname = 0, $urllogout = '') if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { $btnUser = '