diff --git a/ChangeLog b/ChangeLog index 285efc6f481..2c00bda48f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -265,9 +265,9 @@ Following changes may create regressions for some external modules, but were nec * Function showStripePaymentUrl, getStripePaymentUrl, showPaypalPaymentUrl and getPaypalPaymentUrl has been removed. The generic one showOnlinePaymentUrl and getOnlinePaymentUrl are always used. * Context for hook showSocinfoOnPrint has been moved from "showsocinfoonprint" to "main" * Library htdocs/includes/phpoffice/phpexcel as been removed (replaced with htdocs/includes/phpoffice/PhpSpreadsheet) -* Databse transaction in your triggers must be correctly balanced (one close for one open). If not, an error will be returned by the trigger, even if trigger did return error code. +* Database transaction in your triggers must be correctly balanced (one close for one open). If not, an error will be returned by the trigger, even if trigger did return error code. * Dolibarr v13 is still compatible with any PHP version between 5.6.0 and 7.4.*; Unit tests are OK with PHP 8.0 but some warnings or troubles may appears with PHP 8.0. - +* All your Ajax services must contains such a line at begin of file: if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Disables token renewal ***** ChangeLog for 12.0.4 compared to 12.0.3 ***** FIX: make formConfirm an addreplace-type hook diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 712b0b51ef5..e4c3acb85ed 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5428,6 +5428,7 @@ abstract class CommonObject $mandatorypb = false; if ($attributeType == 'link' && $this->array_options[$key] == '-1') $mandatorypb = true; if ($this->array_options[$key] === '') $mandatorypb = true; + if ($attributeType == 'sellist' && $this->array_options[$key] == '0') $mandatorypb = true; if ($mandatorypb) { dol_syslog("Mandatory extra field ".$key." is empty"); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 23b5c47e474..156c29d7a13 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2030,9 +2030,12 @@ class ExtraFields if ($this->attributes[$object->table_element]['required'][$key]) // Value is required { - // Check if empty without using GETPOST, value can be alpha, int, array, etc... - if ((!is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] != 'select' && $_POST["options_".$key] != '0') - || (!is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'select') + // Check if functionally empty without using GETPOST (depending on the type of extrafield, a + // technically non-empty value may be treated as empty functionally). + // value can be alpha, int, array, etc... + if ((!is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] != 'select' && $_POST["options_".$key] != '0') + || (!is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'select') + || (!is_array($_POST["options_".$key]) && isset($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'sellist' && $_POST['options_'.$key] == '0') || (is_array($_POST["options_".$key]) && empty($_POST["options_".$key]))) { //print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key]; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index ee8fa746107..f4d2dd2f7de 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3132,13 +3132,12 @@ class CommandeFournisseur extends CommonOrder } $ret = $supplierorderdispatch->fetchAll('', '', 0, 0, $filter); - if ($ret < 0) - { + if ($ret < 0) { $this->error = $supplierorderdispatch->error; $this->errors = $supplierorderdispatch->errors; return $ret; } else { - if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines) > 0) - { + if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines) > 0) { + require_once DOL_DOCUMENT_ROOT.'/htdocs/product/class/product.class.php'; $date_liv = dol_now(); // Build array with quantity deliverd by product @@ -3146,13 +3145,17 @@ class CommandeFournisseur extends CommonOrder $qtydelivered[$line->fk_product] += $line->qty; } foreach ($this->lines as $line) { + // Exclude lines not qualified for shipment, similar code is found into interface_20_modWrokflow for customers + if (empty($conf->global->STOCK_SUPPORTS_SERVICES) && $line->product_type > 0) continue; $qtywished[$line->fk_product] += $line->qty; } + //Compare array $diff_array = array_diff_assoc($qtydelivered, $qtywished); // Warning: $diff_array is done only on common keys. $keysinwishednotindelivered = array_diff(array_keys($qtywished), array_keys($qtydelivered)); // To check we also have same number of keys $keysindeliverednotinwished = array_diff(array_keys($qtydelivered), array_keys($qtywished)); // To check we also have same number of keys /*var_dump(array_keys($qtydelivered)); + var_dump(array_keys($qtywished)); var_dump($diff_array); var_dump($keysinwishednotindelivered); diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index aa01ef5d3ef..6802d0e84a9 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -1361,7 +1361,6 @@ if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; $comboenhancement = ajax_combobox('.elementselect'); - $out .= $comboenhancement; print $comboenhancement; }