diff --git a/ChangeLog b/ChangeLog index 2c00bda48f3..e84bef00e83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,58 @@ Following changes may create regressions for some external modules, but were nec +***** ChangeLog for 13.0.1 compared to 13.0.0 ***** + +FIX: 10.0 before crediting a withdrawal receipt, check whether it has been credited already. +FIX: 11.0 when a mandatory extrafield of type sellist contains '0' it should be considered empty and trigger an error message upon insertion +FIX: 11.0 when a new intervention is created from an object, a new $extrafields object is instantiated but not initialized +FIX: create MO, Column 'tms' cannot be null +FIX: #14290 #15900 +FIX: #16076 +FIX: #16077 +FIX: #16079 +FIX: #16080 +FIX: 16084 +FIX: #16107 +FIX: #16118 Timezone problem on some fields +FIX: #16131 +FIX: #16135 +FIX: #16143 +FIX: #16156 +FIX: #16160 +FIX: #16185 +FIX: #16189, fix download/see check deposit PDF +FIX: #16215 +FIX: Accountancy - label_operation is used instead of label_compte +FIX: Add critical price patch +FIX: Assignement of actors on tasks +FIX: Bad dates on info tabs +FIX: cash fence for takepos with multientity +FIX: CSRF errors on margin forms +FIX: encoding status in graph of vendor proposals +FIX: Fix detect dispached product and set to received completely when the supplier order have services (support STOCK_SUPPORTS_SERVICES) +FIX: Hide/Unhide external ICSS calendars +FIX: link to create event when task is in a project with a thirdparty +FIX: Localtax must be converted with price2num +FIX: manage price min for PRODUIT_CUSTOMER_PRICES +FIX: Missing language ico +FIX: Must not be able to edit vat of all lines if not draft +FIX: Bad "htdocs" found into a path +FIX: removed no more used proc update_modified_column_date_m on pgsql (its presence triggered errors) +FIX: Vulnerability report by Ricardo Matias +FIX: select default mail template +FIX: Select transport mode function when creating a supplier invoice and add unique key to the table llx_c_transport_mode in migrate sql +FIX: Merge of thirdparties : "unknow column fk_soc" + "Delivery" label +FIX: SQL Error in group by with postgres or mysql strict mode +FIX: takepos : load date function +FIX: Timeout during import +FIX: Trigger on expense report was not fired +FIX: User creation of expense report not visible +FIX: warning when adding a line if $remise_percent is an empty string +FIX: status late on purchase orders +FIX: ODT generation very slow + + ***** ChangeLog for 13.0.0 compared to 12.0.0 ***** For users: diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index e823ec95cdc..da97b627858 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -12,7 +12,7 @@ * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Ferran Marcet * Copyright (C) 2016 Marcos García - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2020 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify @@ -1557,12 +1557,11 @@ if ($action == 'create') } print ''."\n"; - if ($socid > 0) - { + if ($socid > 0) { // Contacts (ask contact only if thirdparty already defined). print "".$langs->trans("DefaultContact").''; print img_picto('', 'contact'); - $form->select_contacts($soc->id, $contactid, 'contactid', 1, $srccontactslist); + print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, $srccontactslist); print ''; // Third party discounts info line @@ -1612,8 +1611,9 @@ if ($action == 'create') // Delivery delay print ''.$langs->trans('AvailabilityPeriod'); - if (!empty($conf->commande->enabled)) + if (!empty($conf->commande->enabled)) { print ' ('.$langs->trans('AfterOrder').')'; + } print ''; print img_picto('', 'clock').' '; $form->selectAvailabilityDelay('', 'availability_id', '', 1); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 059adb95685..cc296e4472a 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -1381,7 +1381,7 @@ if ($resql) $userstatic->job = $val['job']; $userstatic->gender = $val['gender']; //print '
': - print ($nbofsalesrepresentative < 3) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2); + print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2); $j++; if ($j < $nbofsalesrepresentative) { print ' '; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index f6b3a1b3fa4..f7cc3e7af47 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -12,7 +12,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Ferran Marcet * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * * 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 @@ -1603,7 +1603,7 @@ if ($action == 'create' && $usercancreate) // Contacts (ask contact only if thirdparty already defined). print "".$langs->trans("DefaultContact").''; print img_picto('', 'contact'); - $form->select_contacts($soc->id, $contactid, 'contactid', 1, $srccontactslist, '', 1); + print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, $srccontactslist, '', 1); print ''; // Ligne info remises tiers @@ -1644,8 +1644,7 @@ if ($action == 'create' && $usercancreate) print ''; // Bank Account - if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && !empty($conf->banque->enabled)) - { + if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && !empty($conf->banque->enabled)) { print ''.$langs->trans('BankAccount').''; print img_picto('', 'bank_account'); $form->select_comptes($fk_account, 'fk_account', 0, '', 1); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index d810a1a7272..4c2f643df1c 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -11,6 +11,7 @@ * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2016-2018 Ferran Marcet + * Copyright (C) 2021 Frédéric France * * 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 @@ -126,6 +127,10 @@ class Commande extends CommonOrder * @var int Draft Status of the order */ public $brouillon; + + /** + * @var string Condition payment code + */ public $cond_reglement_code; /** @@ -166,8 +171,16 @@ class Commande extends CommonOrder */ public $availability; - public $demand_reason_id; // Source reason. Why we receive order (after a phone campaign, ...) + /** + * @var int Source demand reason Id + */ + public $demand_reason_id; + + /** + * @var string Source reason code. Why we receive order (after a phone campaign, ...) + */ public $demand_reason_code; + /** * @var int Date of order */ @@ -182,11 +195,15 @@ class Commande extends CommonOrder /** * @var int Date expected for delivery + * @see delivery_date * @deprecated */ - public $date_livraison; // deprecated; Use delivery_date instead. + public $date_livraison; - public $delivery_date; // Date expected of shipment (date starting shipment, not the reception that occurs some days after) + /** + * @var int Date expected of shipment (date starting shipment, not the reception that occurs some days after) + */ + public $delivery_date; /** * @var int ID @@ -200,6 +217,9 @@ class Commande extends CommonOrder public $special_code; public $source; // Order mode. How we received order (by phone, by email, ...) + /** + * @var int Warehouse Id + */ public $warehouse_id; public $extraparams = array(); @@ -227,6 +247,9 @@ class Commande extends CommonOrder */ public $fk_multicurrency; + /** + * @var string multicurrency code + */ public $multicurrency_code; public $multicurrency_tx; public $multicurrency_total_ht; @@ -739,11 +762,11 @@ class Commande extends CommonOrder if ($usercanclose) { - $this->db->begin(); if ($this->statut == self::STATUS_CLOSED) { return 0; } + $this->db->begin(); $now = dol_now(); diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index a4fea62133c..1226d578f2f 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -33,6 +33,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -740,7 +741,7 @@ while ($i < min($num, $limit)) $userstatic->gender = $val['gender']; //print '
': - print ($nbofsalesrepresentative < 3) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2); + print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2); $j++; if ($j < $nbofsalesrepresentative) { print ' '; diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 41e23819266..9575208f485 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -201,6 +201,13 @@ if ($type == 'directory') 'mrp-mo' ); + $parameters = array('modulepart'=>$module); + $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); + if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray)>0) + { + $automodules[]=$hookmanager->resArray['module']; + } + // TODO change for multicompany sharing if ($module == 'company') $upload_dir = $conf->societe->dir_output; elseif ($module == 'invoice') $upload_dir = $conf->facture->dir_output; @@ -220,6 +227,13 @@ if ($type == 'directory') elseif ($module == 'recruitment-recruitmentcandidature') $upload_dir = $conf->recruitment->dir_output.'/recruitmentcandidature'; elseif ($module == 'banque') $upload_dir = $conf->bank->dir_output; elseif ($module == 'mrp-mo') $upload_dir = $conf->mrp->dir_output.'/mo'; + else { + $parameters = array('modulepart'=>$module); + $reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters); + if ($reshook > 0 && is_array($hookmanager->resArray) && count($hookmanager->resArray) > 0) { + $upload_dir = $hookmanager->resArray['directory']; + } + } // Automatic list if (in_array($module, $automodules)) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4ada3c368d0..cc67030ccf6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -970,7 +970,7 @@ abstract class CommonObject * @param int|string $type_contact Type of contact (code or id). Must be id or code found into table llx_c_type_contact. For example: SALESREPFOLL * @param string $source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user) * @param int $notrigger Disable all triggers - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, 0 if already added, >0 if OK */ public function add_contact($fk_socpeople, $type_contact, $source = 'external', $notrigger = 0) { @@ -1075,7 +1075,9 @@ abstract class CommonObject return -1; } } - } else return 0; + } else { + return 0; + } } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index d610203b3ad..9ecd6a659a1 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -161,6 +161,7 @@ class HookManager 'addMoreMassActions', 'addSearchEntry', 'addStatisticLine', + 'addSectionECMAuto', 'createDictionaryFieldlist', 'editDictionaryFieldlist', 'getFormMail', diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7fbff101859..f97ca3ca95b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1479,7 +1479,7 @@ class Form if (!empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) $sql .= " AND sp.statut <> 0"; $sql .= " ORDER BY sp.lastname ASC"; - dol_syslog(get_class($this)."::select_contacts", LOG_DEBUG); + dol_syslog(get_class($this)."::selectcontacts", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -4308,7 +4308,7 @@ class Form * @param string $question Question * @param string $action Action * @param array|string $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , 'size'=>, 'morecss'=>, 'moreattr'=>)) - * type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', 'morecss', ... + * type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', 'morecss', 'other' or 'onecolumn'... * @param string $selectedchoice '' or 'no', or 'yes' or '1' or '0' * @param int|string $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx * @param int|string $height Force height of box (0 = auto) @@ -4422,6 +4422,8 @@ class Form $moreonecolumn .= '
'; $moreonecolumn .= $input['value']; $moreonecolumn .= '
'."\n"; + } else { + $more .= 'Error type '.$input['type'].' for the confirm box is not a supported type'; } } } @@ -4449,16 +4451,24 @@ class Form } $pageyes = $page.(preg_match('/\?/', $page) ? '&' : '?').'action='.$action.'&confirm=yes'; $pageno = ($useajax == 2 ? $page.(preg_match('/\?/', $page) ? '&' : '?').'confirm=no' : ''); + // Add input fields into list of fields to read during submit (inputok and inputko) - if (is_array($formquestion)) - { - foreach ($formquestion as $key => $input) - { + if (is_array($formquestion)) { + foreach ($formquestion as $key => $input) { //print "xx ".$key." rr ".is_array($input)."
\n"; - if (is_array($input) && isset($input['name'])) array_push($inputok, $input['name']); + // Add name of fields to propagate with the GET when submitting the form with button OK. + if (is_array($input) && isset($input['name'])) { + if (strpos($input['name'], ',') > 0) { + $inputok = array_merge($inputok, explode(',', $input['name'])); + } else { + array_push($inputok, $input['name']); + } + } + // Add name of fields to propagate with the GET when submitting the form with button KO. if (isset($input['inputko']) && $input['inputko'] == 1) array_push($inputko, $input['name']); } } + // Show JQuery confirm box. $formconfirm .= '