diff --git a/ChangeLog b/ChangeLog index 7a815b66dcd..b468ebcc931 100644 --- a/ChangeLog +++ b/ChangeLog @@ -41,6 +41,105 @@ Following changes may create regressions for some external modules, but were nec * Method fetch_all of DolResource has been renamed into fetchAll() to match naming conventions. * The hook 'upgrade' and 'doUpgrade2" has been renamed 'doUpgradeBefore' and 'doUpgradeAfterDB'. A new trigger 'doUpgradeAfterFiles' has been introduced. + + +***** ChangeLog for 15.0.2 compared to 15.0.1 ***** + +FIX: #19777 #20281 +FIX: #20140 #20301 +FIX: #20279 Accountancy - PostGreSQL - Error on mass update lines already binded +FIX: #20476 migration postgresql 14.0.x to 15.0.x packaging type +FIX: #20733 Inventory: Do not use batch qty even if present if batch module is disabled. +FIX: action comm list: holiday last day not included + handle duration with halfdays +FIX: Add missing entity on salary's payment +FIX: Add 'recruitment' into check array +FIX: add tools to fix bad bank amount in accounting with multicurrency +FIX: assign member cateogry to a member +FIX: backport +FIX: bad bank amount in accounting with multicurrency +FIX: Bad condition on remx +FIX: Bad filter on date on salary list +FIX: bad link to add a customer price (token duplicated) +FIX: bad status of member on widget by type and status +FIX: better error management at product selling price update +FIX: Can't edit bank record +FIX: check mandatory thirdparty fields for mass action +FIX: check thirdparty object loaded and properties exist +FIX: comment +FIX: compatibility for ticket number sharing +FIX: compatibility with multicompany sharings +FIX: contact card: single extrafield update failed +FIX: country not visible into list of states +FIX: Delete an extrafield where type is double +FIX: deprecated module are not more viewed as external modules +FIX: Disable customer type by default if type prospect/customer is disabled +FIX: each time we create a supplier order, we need to give it a ref_supplier +FIX: Error management +FIX: fatal error for $db usage in tpl +FIX: filter into the list of product lots +FIX: Filter on Object Referent page give CRSF page +FIX: Fix default options ($hidedetails, $hidedesc, $hideref) with globales when generate PDF in mass actions +FIX: Fix search by filters +FIX: Fix the adding of lines in the create invoice functions +FIX: forgotten form confirm before various payment delete +FIX: holiday/leave requests: write status change emails in HTML +FIX: include discount price for PMP after a reception (Issue #20029) +FIX: incrementation +FIX: in salary stats and payment list, we must check right perms as well as salary list +FIX: intervention entity missing +FIX: label tax cat trad +FIX: Mass action ship orders +FIX: missing advanced perms +FIX: missing call to executeHooks() +FIX: Missing entity on adding new VAT +FIX: missing hook for row ordering +FIX: missing hook parameter ($possiblelinks) +FIX: missing parenthesis +FIX: missing picto in combo of mass actions of thirdparties. +FIX: missing signature library when ODT model is used +FIX: Missing unset fields after updateline expensereport +FIX: ModuileBuilder - Fix getLinesArray() error reporting +FIX: Move delete task time trigger position +FIX: Navigation between invoices +FIX: No empty line inserted into accounting_bookkeeping +FIX: Numbering of sepa files +FIX: object cloning: set unique extrafield values to null to prevent duplicates +FIX: on update with action reminder in future there is user key error +FIX: originproductline array td identification data-id +FIX: out of memory when more than 100 000 invoices. +FIX: permit access to medias when logged in a different entity +FIX: phpcs +FIX: project creation prevented if PROJECTLEADER contact role renamed, de-activated or deleted +FIX: project timesheet by week: cleanup unused code +FIX: project timesheet: public holidays offset by 1 day +FIX: project timesheets: assume Saturday and Sunday as default weekend days when working days conf is empty or badly formed +FIX: propal list: bad error management when setting "not signed" mass action +FIX: propal list mass action translations and error management (v14 edition) +FIX: propal list: missing not signed massaction translation keys for transifex +FIX: PR returns +FIX: ref_client doesn't exists on supplier invoice, then ref_fourn needs to have a default value when we want to bill several supplier orders +FIX: replenish and manage product stock by warhouse +FIX: sending email on payment of registration of event +FIX: SEPA ICS is not mandatory for bank transfer +FIX: Set datec when add time spent on a project task +FIX: status filter on supplierOrder stats doesn't work +FIX: stickler-ci +FIX: still prevent project creation if PROJECTLEADER role unavailable, but with a specific error message +FIX: Supplier order stats +FIX: Tabulation must be allowed for HTML content +FIX: tool to fix bank account not in main currency for vendor invoice +FIX: translations +FIX: Travis + Update dev +FIX: truncate Customer Reference too long on PDF header (PR #20718) +FIX: uniformize code +FIX: Update of sale price (log not correctly updated) +FIX: user actions rights when mulit-company transverse mode is enabled +FIX: user employee tab: offset in open days messes up holiday length calculation +FIX: We need to have a different default_ref_supplier for each new fourn invoice +FIX: "WHERE" clause missing on resource export +FIX: #yogosha9754 + + ***** ChangeLog for 15.0.1 compared to 15.0.0 ***** FIX: #19777 #20281 FIX: bad position of extrafields for interventions diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 72efffc2b49..28c35016054 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -748,6 +748,7 @@ class AccountingAccount extends CommonObject $reshook = $hookmanager->executeHooks('accoutancyBindingCalculation', $parameters); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { + $const_name = ''; if ($type == 'customer') { $const_name = "SOLD"; } elseif ($type == 'supplier') { diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 81caaa05358..405a630942e 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -699,6 +699,8 @@ class Lettering extends BookKeeping return $grouped_payments; } + $save_payment_by_element = null; + $save_element_by_payment = null; if ($element_id == 0) { // Save list when is the begin of recursive function $save_payment_by_element = $payment_by_element; diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 32b55d0a612..35c483f33e6 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -420,7 +420,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table diff --git a/htdocs/admin/expensereport_ik.php b/htdocs/admin/expensereport_ik.php index 900754ef4b4..10b14f8ee99 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -36,10 +36,10 @@ $langs->loadLangs(array("admin", "trips", "errors", "other", "dict")); $error = 0; $action = GETPOST('action', 'aZ09'); + $id = GETPOST('id', 'int'); $ikoffset = GETPOST('ikoffset', 'int'); $coef = GETPOST('coef', 'int'); - $fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat'); $fk_range = GETPOST('fk_range', 'int'); @@ -62,9 +62,16 @@ if ($action == 'updateik') { } } - $expIk->setValues($_POST); - $result = $expIk->create($user); + $expIk->coef = $coef; + $expIk->ikoffset = $ikoffset; + $expIk->fk_c_exp_tax_cat = $fk_c_exp_tax_cat; + $expIk->fk_range = $fk_range; + if ($expIk->id > 0) { + $result = $expIk->update($user); + } else { + $result = $expIk->create($user); + } if ($result > 0) { setEventMessages('SetupSaved', null, 'mesgs'); diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index 62fb097841b..7c27ee6e408 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -34,13 +34,19 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_rule.class.ph // Load translation files required by the page $langs->loadLangs(array("admin", "other", "trips", "errors", "dict")); +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('admin', 'dictionaryadmin','expensereport_rules')); + +$object = new ExpenseReportRule($db); + if (!$user->admin) { accessforbidden(); } -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('admin', 'dictionaryadmin','expensereport_rules')); +/* + * Action + */ $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -51,7 +57,6 @@ if ($reshook < 0) { if (empty($reshook)) { //Init error $error = false; - $message = false; $action = GETPOST('action', 'aZ09'); $id = GETPOST('id', 'int'); @@ -59,21 +64,20 @@ if (empty($reshook)) { $apply_to = GETPOST('apply_to'); $fk_user = GETPOST('fk_user', 'int'); $fk_usergroup = GETPOST('fk_usergroup', 'int'); - - $fk_c_type_fees = GETPOST('fk_c_type_fees'); + $restrictive = GETPOST('restrictive', 'int'); + $fk_c_type_fees = GETPOST('fk_c_type_fees', 'int'); $code_expense_rules_type = GETPOST('code_expense_rules_type'); $dates = dol_mktime(12, 0, 0, GETPOST('startmonth'), GETPOST('startday'), GETPOST('startyear')); $datee = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); - $amount = GETPOST('amount'); + $amount = price2num(GETPOST('amount'), 'MT', 2); - $object = new ExpenseReportRule($db); if (!empty($id)) { $result = $object->fetch($id); if ($result < 0) { dol_print_error('', $object->error, $object->errors); } } - // TODO do action + if ($action == 'save') { $error = 0; @@ -104,8 +108,6 @@ if (empty($reshook)) { } if (empty($error)) { - $object->setValues($_POST); - if ($apply_to == 'U') { $object->fk_user = (int) $fk_user; $object->fk_usergroup = 0; @@ -122,18 +124,30 @@ if (empty($reshook)) { $object->dates = $dates; $object->datee = $datee; - + $object->restrictive = $restrictive; + $object->fk_c_type_fees = $fk_c_type_fees; + $object->code_expense_rules_type = $code_expense_rules_type; + $object->amount = $amount; $object->entity = $conf->entity; - $res = $object->create($user); + if ($object->id > 0) { + $res = $object->update($user); + } else { + $res = $object->create($user); + } if ($res > 0) { setEventMessages($langs->trans('ExpenseReportRuleSave'), null); } else { dol_print_error($object->db); + $error++; } - header('Location: ' . $_SERVER['PHP_SELF']); - exit; + if (!$error) { + header('Location: ' . $_SERVER['PHP_SELF']); + exit; + } else { + $action = ''; + } } } elseif ($action == 'delete') { // TODO add confirm @@ -207,7 +221,7 @@ if ($action != 'edit') { echo '' . $form->selectarray('code_expense_rules_type', $tab_rules_type, '', 0) . ''; echo '' . $form->selectDate(strtotime(date('Y-m-01', dol_now())), 'start', '', '', 0, '', 1, 0) . ''; echo ' ' . $conf->currency . ''; + echo ''; echo '' . $form->selectyesno('restrictive', 0, 1) . ''; echo ''; echo ''; @@ -304,10 +318,10 @@ foreach ($rules as $rule) { } echo ''; - + // Amount echo ''; if ($action == 'edit' && $object->id == $rule->id) { - echo '' . $conf->currency; + echo ''; } else { echo price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency); } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index f22cea8d04e..aeb20e6c7b4 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1621,7 +1621,7 @@ class ActionComm extends CommonObject $label = $langs->trans("ShowAction"); $linkclose .= ' alt="'.dol_escape_htmltag($tooltip, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($tooltip, 1, 0, 0, '', 1).'"'; + $linkclose .= ' title="'.dol_escape_htmltag($tooltip, 1, 0, '', 1).'"'; $linkclose .= ' class="'.$classname.' classfortooltip"'; /* $hookmanager->initHooks(array('actiondao')); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 920fe69025d..f5bbeb6467d 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -110,7 +110,7 @@ $week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W"); $day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d"); $pid = GETPOST("search_projectid", "int", 3) ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); $status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo' -$type = GETPOSTISSET("search_type", 'aZ09') ? GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09'); +$type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09'); $maxprint = GETPOSTISSET("maxprint") ? GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW; $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index dafc1e7ee16..5903b7e4bdb 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -634,7 +634,11 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) { print $s; print ''; - print ''.dol_print_date($db->jdate($objp->tms), 'day').''; + + $datem = $db->jdate($objp->tms); + print ''; + print dol_print_date($datem, 'day', 'tzuserrel'); + print ''; print ''; $i++; @@ -725,7 +729,11 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S print $s; print ''; - print ''.dol_print_date($db->jdate($objp->dm), 'day').''; + + $datem = $db->jdate($objp->dm); + print ''; + print dol_print_date($datem, 'day', 'tzuserrel'); + print ''; print ''; $i++; @@ -922,7 +930,10 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { print ''; print ''.$companystatic->getNomUrl(1, 'customer', 44).''; - print ''.dol_print_date($db->jdate($obj->dp), 'day').''; + $datem = $db->jdate($obj->dp); + print ''; + print dol_print_date($datem, 'day', 'tzserver'); + print ''; print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; print ''.$propalstatic->LibStatut($obj->fk_statut, 3).''; @@ -1039,7 +1050,11 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { print ''; print ''.$companystatic->getNomUrl(1, 'customer', 44).''; - print ''.dol_print_date($db->jdate($obj->dv), 'day').''; + $datem = $db->jdate($obj->dv); + print ''; + print dol_print_date($datem, 'day', 'tzserver'); + print ''; + print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; print ''.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).''; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index c989cd34d39..51869825600 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -765,12 +765,12 @@ if ($resql) { if ($socid > 0) { $soc = new Societe($db); $soc->fetch($socid); - $title = $langs->trans('ListOfProposals').' - '.$soc->name; + $title = $langs->trans('Proposals').' - '.$soc->name; if (empty($search_societe)) { $search_societe = $soc->name; } } else { - $title = $langs->trans('ListOfProposals'); + $title = $langs->trans('Proposals'); } $num = $db->num_rows($resql); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index b1d0cdb9223..f1423ffa12b 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1733,10 +1733,10 @@ if ($action == 'create' && $usercancreate) { $form->selectAvailabilityDelay($availability_id, 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx'); print ''; - // Terms of the settlement + // Terms of payment print ''.$langs->trans('PaymentConditionsShort').''; - print img_picto('', 'paiment', 'class="pictofixedwidth"'); - $form->select_conditions_paiements($cond_reglement_id, 'cond_reglement_id', 1, 1, 0, '', $deposit_percent); + print img_picto('', 'payment', 'class="pictofixedwidth"'); + $form->select_conditions_paiements($cond_reglement_id, 'cond_reglement_id', 1, 1, 0, 'maxwidth200 widthcentpercentminusx', $deposit_percent); print ''; // Payment mode @@ -1836,7 +1836,7 @@ if ($action == 'create' && $usercancreate) { print ''; print ''.$form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0).''; print ''; - print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency($currency_code, 'multicurrency_code'); + print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency($currency_code, 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx'); print ''; } diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index b2bf9615d17..5d4dce6872d 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1015,12 +1015,12 @@ if ($resql) { if ($socid > 0) { $soc = new Societe($db); $soc->fetch($socid); - $title = $langs->trans('ListOfOrders').' - '.$soc->name; + $title = $langs->trans('CustomersOrders').' - '.$soc->name; if (empty($search_company)) { $search_company = $soc->name; } } else { - $title = $langs->trans('ListOfOrders'); + $title = $langs->trans('CustomersOrders'); } if (strval($search_status) == '0') { $title .= ' - '.$langs->trans('StatusOrderDraftShort'); diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index cdcd26490a3..77aded9c594 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -165,7 +165,7 @@ class PaymentVarious extends CommonObject * * @param DoliDB $db Database handler */ - public function __construct($db) + public function __construct(DoliDB $db) { $this->db = $db; $this->element = 'payment_various'; diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 19b47430fad..90bc79483bf 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -534,7 +534,7 @@ foreach ($accounts as $key => $type) { // Ref if (!empty($arrayfields['b.ref']['checked'])) { - print ''.$objecttmp->getNomUrl(1).''; + print ''.$objecttmp->getNomUrl(1).''; if (!$i) { $totalarray['nbfield']++; } @@ -586,7 +586,7 @@ foreach ($accounts as $key => $type) { // Accountancy journal if (!empty($arrayfields['b.fk_accountancy_journal']['checked'])) { - print ''; + print ''; if (!empty($conf->accounting->enabled)) { if (empty($objecttmp->fk_accountancy_journal)) { print img_warning($langs->trans("Mandatory")); @@ -606,7 +606,7 @@ foreach ($accounts as $key => $type) { // Currency if (!empty($arrayfields['b.currency_code']['checked'])) { - print ''; + print ''; print $objecttmp->currency_code; print ''; if (!$i) { @@ -616,7 +616,7 @@ foreach ($accounts as $key => $type) { // Transactions to reconcile if (!empty($arrayfields['toreconcile']['checked'])) { - print ''; + print ''; $conciliate = $objecttmp->canBeConciliated(); if ($conciliate == -2) { @@ -663,7 +663,7 @@ foreach ($accounts as $key => $type) { print $hookmanager->resPrint; // Date creation if (!empty($arrayfields['b.datec']['checked'])) { - print ''; + print ''; print dol_print_date($objecttmp->date_creation, 'dayhour'); print ''; if (!$i) { @@ -672,7 +672,7 @@ foreach ($accounts as $key => $type) { } // Date modification if (!empty($arrayfields['b.tms']['checked'])) { - print ''; + print ''; print dol_print_date($objecttmp->date_update, 'dayhour'); print ''; if (!$i) { diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 92d38d95274..98cb0e27804 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -539,7 +539,7 @@ if ($resql) { $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center '); print ''; @@ -656,7 +656,7 @@ if ($resql) { if ($arrayfields['account']['checked']) { $accountingaccount->fetch('', $obj->accountancy_code, 1); - print ''.$accountingaccount->getNomUrl(0, 1, 1, '', 1).''; + print ''.$accountingaccount->getNomUrl(0, 1, 1, '', 1).''; if (!$i) { $totalarray['nbfield']++; } @@ -664,7 +664,7 @@ if ($resql) { // Accounting subledger account if ($arrayfields['subledger']['checked']) { - print ''.length_accounta($obj->subledger_account).''; + print ''.length_accounta($obj->subledger_account).''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index e05750918da..c09943540bc 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -121,7 +121,7 @@ class Deplacement extends CommonObject * * @param DoliDB $db Database handler */ - public function __construct($db) + public function __construct(DoliDB $db) { $this->db = $db; diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index 9f92cecc4a7..2aa03441e9b 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -158,7 +158,7 @@ if ($resql) { print ''; } print ''; - $formother->select_year($year ? $year : -1, 'year', 1, 20, 5); + print $formother->selectyear($year ? $year : -1, 'year', 1, 20, 5); print ''; print ''; print ''; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index a406a48c7f6..af6d4dc606b 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -222,7 +222,7 @@ class FactureRec extends CommonInvoice * * @param DoliDB $db Database handler */ - public function __construct($db) + public function __construct(DoliDB $db) { $this->db = $db; } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index a5cb99c2260..3dde8ce2638 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -428,7 +428,7 @@ class Facture extends CommonInvoice * * @param DoliDB $db Database handler */ - public function __construct($db) + public function __construct(DoliDB $db) { $this->db = $db; } @@ -1652,13 +1652,13 @@ class Facture extends CommonInvoice 0, // date_start 0, // date_end 0, - $lines[$i]->info_bits, // info_bits + 0, // info_bits 0, 'HT', 0, 0, // product_type 1, - $lines[$i]->special_code, + 0, // special_code $deposit->origin, 0, 0, @@ -5503,6 +5503,7 @@ class Facture extends CommonInvoice $sendContent = make_substitutions($content, $substitutionarray, $outputlangs, 1); // Recipient + $to = ''; $res = $tmpinvoice->fetch_thirdparty(); $recipient = $tmpinvoice->thirdparty; if ($res > 0) { @@ -5524,7 +5525,7 @@ class Facture extends CommonInvoice $error++; } - if (!$error) { + if (!$error && $to) { // Errors Recipient $errors_to = $conf->global->MAIN_MAIL_ERRORS_TO; diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index a54cd1a6668..522fe9aa2e2 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -57,7 +57,7 @@ class FactureStats extends Stats * @param int $typentid Id typent of thirdpary for filter * @param int $categid Id category of thirdpary for filter */ - public function __construct($db, $socid, $mode, $userid = 0, $typentid = 0, $categid = 0) + public function __construct(DoliDB $db, $socid, $mode, $userid = 0, $typentid = 0, $categid = 0) { global $user, $conf; diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index f94ad573a81..a4441804570 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -68,7 +68,7 @@ class PaymentTerm // extends CommonObject * * @param DoliDB $db Database handler */ - public function __construct($db) + public function __construct(DoliDB $db) { $this->db = $db; } diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index d12caf36bbe..1c3abfe87bd 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -172,7 +172,7 @@ if ($resql) { print ''; } print ''; - $formother->select_year($year ? $year : -1, 'year', 1, 20, 5); + print $formother->selectyear($year ? $year : -1, 'year', 1, 20, 5); print ''; print ''; $form->select_comptes($search_account, 'search_account', 0, '', 1); diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index cf02c2aeb74..326be7144a8 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -102,7 +102,7 @@ $syear = GETPOST("reyear") ?GETPOST("reyear") : date("Y", time()); print $formother->select_month($cmonth, 'remonth'); -print $formother->select_year($syear, 'reyear'); +print $formother->selectyear($syear, 'reyear'); print ''; print ''; diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 6996c689922..70d8da4c27b 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -123,7 +123,7 @@ class ChargeSociales extends CommonObject * * @param DoliDB $db Database handler */ - public function __construct($db) + public function __construct(DoliDB $db) { $this->db = $db; } diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 9a4b50e3474..b6a611a47ee 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -105,7 +105,7 @@ class PaymentSocialContribution extends CommonObject * * @param DoliDB $db Database handler */ - public function __construct($db) + public function __construct(DoliDB $db) { $this->db = $db; } diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 02813cee469..7f1d9bdc64b 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -410,7 +410,7 @@ if ($sql_select) { print ''; print ''; // date print $formother->select_month($month ? $month : -1, 'month', 1, 0, 'valignmiddle'); - $formother->select_year($year ? $year : -1, 'year', 1, 20, 1); + print $formother->selectyear($year ? $year : -1, 'year', 1, 20, 1); print ''; print ''; print ''; diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index db0f515273c..1b9ab289774 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -361,7 +361,8 @@ if ($result) { print img_warning($langs->trans("Late")); } print ''; - print ''; + + print ''; print $staticcompany->getNomUrl(1, '', 20); print ''; print ''; @@ -444,7 +445,7 @@ if ($resql) { } } print ''; - print ''; + print ''; $staticcompany->id = $obj->fk_soc; $staticcompany->name = $obj->name; print $staticcompany->getNomUrl(1, '', 20); @@ -526,7 +527,7 @@ if ($resql) { } } print ''; - print ''; + print ''; $staticcompany->id = $obj->fk_soc; $staticcompany->name = $obj->name; print $staticcompany->getNomUrl(1, '', 20); @@ -609,7 +610,7 @@ if ($resql) { } } print ''; - print ''; + print ''; $staticcompany->id = $obj->fk_soc; $staticcompany->name = $obj->name; print $staticcompany->getNomUrl(1, '', 20); diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 57b4657eab4..e76261010da 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -693,7 +693,7 @@ if (!empty($arrayfields['lower_planned_end_date']['checked'])) { print '
'; print $formother->select_month($search_dfmonth, 'search_dfmonth', 1, 0); print ' '; - $formother->select_year($search_dfyear, 'search_dfyear', 1, 20, 5, 0, 0, ''); + print $formother->selectyear($search_dfyear, 'search_dfyear', 1, 20, 5, 0, 0, ''); print ''; } // Status diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index a9536f410ca..e80eaa52b14 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -65,6 +65,26 @@ abstract class CommonDocGenerator */ public $scandir; + public $page_hauteur; + public $page_largeur; + public $marge_gauche; + public $marge_droite; + public $marge_haute; + public $marge_basse; + + public $option_logo; + public $option_tva; + public $option_multilang; + public $option_freetext; + public $option_draft_watermark; + + public $option_modereg; + public $option_condreg; + public $option_escompte; + public $option_credit_note; + + public $emetteur; + /** * Constructor diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 6466754f241..e1c2bf662df 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -115,6 +115,11 @@ abstract class CommonObject */ public $array_languages = null; // Value is array() when load already tried + /** + * @var mixed Array of linked objects, set and used when calling ->create() to be able to create links during the creation of object + */ + public $linked_objects; + /** * @var int[][] Array of linked objects ids. Loaded by ->fetchObjectLinked */ @@ -201,7 +206,7 @@ abstract class CommonObject public $user; /** - * @var string The type of originating object ('commande', 'facture', ...) + * @var string The type of originating object ('commande', 'facture', ...). Note: on some object this field is called $origin_type * @see fetch_origin() */ public $origin; diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 74bab57c605..8d577d94ca2 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -61,6 +61,19 @@ abstract class CommonObjectLine extends CommonObject public $date_fin_prevue; public $date_fin_reel; + public $weight; + public $weight_units; + public $width; + public $width_units; + public $height; + public $height_units; + public $length; + public $length_units; + public $surface; + public $surface_units; + public $volume; + public $volume_units; + /** * Constructor diff --git a/htdocs/core/class/coreobject.class.php b/htdocs/core/class/coreobject.class.php deleted file mode 100644 index 1bb4e92a0c9..00000000000 --- a/htdocs/core/class/coreobject.class.php +++ /dev/null @@ -1,413 +0,0 @@ - - * - * 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 - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/core/class/coreobject.class.php - * \ingroup core - * \brief File of class to manage all object. Might be replace or merge into commonobject - */ - -require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; - -// TODO Remove this class (used in Expensereportik and ExpenseReportRule -/** - * CoreObject - */ -class CoreObject extends CommonObject -{ - public $withChild = true; - - /** - * @var Array $_fields Fields to synchronize with Database - */ - protected $fields = array(); - - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - public function __construct(DoliDB &$db) - { - $this->db = $db; - } - - /** - * Function to init fields - * - * @return bool - */ - protected function init() - { - $this->id = 0; - $this->datec = 0; - $this->tms = 0; - - if (!empty($this->fields)) { - foreach ($this->fields as $field => $info) { - if ($this->isDate($info)) { - $this->{$field} = time(); - } elseif ($this->isArray($info)) { - $this->{$field} = array(); - } elseif ($this->isInt($info)) { - $this->{$field} = (int) 0; - } elseif ($this->isFloat($info)) { - $this->{$field} = (double) 0; - } else { - $this->{$field} = ''; - } - } - - $this->to_delete = false; - $this->is_clone = false; - - return true; - } else { - return false; - } - } - - /** - * Test type of field - * - * @param string $field name of field - * @param string $type type of field to test - * @return boolean value of field or false - */ - private function checkFieldType($field, $type) - { - if (isset($this->fields[$field]) && method_exists($this, 'is_'.$type)) { - return $this->{'is_'.$type}($this->fields[$field]); - } else { - return false; - } - } - - /** - * Get object and children from database - * - * @param int $id Id of object to load - * @param bool $loadChild used to load children from database - * @return int >0 if OK, <0 if KO, 0 if not found - */ - public function fetch($id, $loadChild = true) - { - $res = $this->fetchCommon($id); - if ($res > 0) { - if ($loadChild) { - $this->fetchChild(); - } - } - - return $res; - } - - - /** - * Function to instantiate a new child - * - * @param string $tabName Table name of child - * @param int $id If id is given, we try to return his key if exist or load if we try_to_load - * @param string $key Attribute name of the object id - * @param bool $try_to_load Force the fetch if an id is given - * @return int - */ - public function addChild($tabName, $id = 0, $key = 'id', $try_to_load = false) - { - if (!empty($id)) { - foreach ($this->{$tabName} as $k => &$object) { - if ($object->{$key} === $id) { - return $k; - } - } - } - - $k = count($this->{$tabName}); - - $className = ucfirst($tabName); - $this->{$tabName}[$k] = new $className($this->db); - if ($id > 0 && $key === 'id' && $try_to_load) { - $this->{$tabName}[$k]->fetch($id); - } - - return $k; - } - - - /** - * Function to set a child as to delete - * - * @param string $tabName Table name of child - * @param int $id Id of child to set as to delete - * @param string $key Attribute name of the object id - * @return bool - */ - public function removeChild($tabName, $id, $key = 'id') - { - foreach ($this->{$tabName} as &$object) { - if ($object->{$key} == $id) { - $object->to_delete = true; - return true; - } - } - return false; - } - - - /** - * Function to fetch children objects - * - * @return void - */ - public function fetchChild() - { - if ($this->withChild && !empty($this->childtables) && !empty($this->fk_element)) { - foreach ($this->childtables as &$childTable) { - $className = ucfirst($childTable); - - $this->{$className} = array(); - - $sql = "SELECT rowid FROM ".$this->db->prefix().$childTable." WHERE ".$this->fk_element." = ".((int) $this->id); - $res = $this->db->query($sql); - - if ($res) { - while ($obj = $this->db->fetch_object($res)) { - $o = new $className($this->db); - $o->fetch($obj->rowid); - - $this->{$className}[] = $o; - } - } else { - $this->errors[] = $this->db->lasterror(); - } - } - } - } - - /** - * Function to update children data - * - * @param User $user user object - * @return void - */ - public function saveChild(User &$user) - { - if ($this->withChild && !empty($this->childtables) && !empty($this->fk_element)) { - foreach ($this->childtables as &$childTable) { - $className = ucfirst($childTable); - if (!empty($this->{$className})) { - foreach ($this->{$className} as $i => &$object) { - $object->{$this->fk_element} = $this->id; - - $object->update($user); - if ($this->unsetChildDeleted && isset($object->to_delete) && $object->to_delete == true) { - unset($this->{$className}[$i]); - } - } - } - } - } - } - - - /** - * Function to update object or create or delete if needed - * - * @param User $user User object - * @return int < 0 if KO, > 0 if OK - */ - public function update(User &$user) - { - if (empty($this->id)) { - return $this->create($user); // To test, with that, no need to test on high level object, the core decide it, update just needed - } elseif (isset($this->to_delete) && $this->to_delete == true) { - return $this->delete($user); - } - - $error = 0; - $this->db->begin(); - - $res = $this->updateCommon($user); - if ($res) { - $result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user); - if ($result < 0) { - $error++; - } else { - $this->saveChild($user); - } - } else { - $error++; - $this->error = $this->db->lasterror(); - $this->errors[] = $this->error; - } - - if (empty($error)) { - $this->db->commit(); - return $this->id; - } else { - $this->db->rollback(); - return -1; - } - } - - /** - * Function to create object in database - * - * @param User $user User object - * @return int < 0 if KO, > 0 if OK - */ - public function create(User $user) - { - if ($this->id > 0) { - return $this->update($user); - } - - $error = 0; - $this->db->begin(); - - $res = $this->createCommon($user); - if ($res) { - $this->id = $this->db->last_insert_id($this->table_element); - - $result = $this->call_trigger(strtoupper($this->element).'_CREATE', $user); - if ($result < 0) { - $error++; - } else { - $this->saveChild($user); - } - } else { - $error++; - $this->error = $this->db->lasterror(); - $this->errors[] = $this->error; - } - - if (empty($error)) { - $this->db->commit(); - return $this->id; - } else { - $this->db->rollback(); - return -1; - } - } - - /** - * Function to delete object in database - * - * @param User $user user object - * @return int < 0 if KO, > 0 if OK - */ - public function delete(User &$user) - { - if ($this->id <= 0) { - return 0; - } - - $error = 0; - $this->db->begin(); - - $result = $this->call_trigger(strtoupper($this->element).'_DELETE', $user); - if ($result < 0) { - $error++; - } - - if (!$error) { - $this->deleteCommon($user); - if ($this->withChild && !empty($this->childtables)) { - foreach ($this->childtables as &$childTable) { - $className = ucfirst($childTable); - if (!empty($this->{$className})) { - foreach ($this->{$className} as &$object) { - $object->delete($user); - } - } - } - } - } - - if (empty($error)) { - $this->db->commit(); - return 1; - } else { - $this->error = $this->db->lasterror(); - $this->errors[] = $this->error; - $this->db->rollback(); - return -1; - } - } - - - /** - * Function to get a formatted date - * - * @param string $field Attribute to return - * @param string $format Output date format - * @return string - */ - public function getDate($field, $format = '') - { - if (empty($this->{$field})) { - return ''; - } else { - return dol_print_date($this->{$field}, $format); - } - } - - /** - * Function to set date in field - * - * @param string $field field to set - * @param string $date formatted date to convert - * @return mixed - */ - public function setDate($field, $date) - { - if (empty($date)) { - $this->{$field} = 0; - } else { - require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - $this->{$field} = dol_stringtotime($date); - } - - return $this->{$field}; - } - - - /** - * Function to update current object - * - * @param array $Tab Array of values - * @return int - */ - public function setValues(&$Tab) - { - foreach ($Tab as $key => $value) { - if ($this->checkFieldType($key, 'date')) { - $this->setDate($key, $value); - } elseif ($this->checkFieldType($key, 'float')) { - $this->{$key} = (double) price2num($value); - } elseif ($this->checkFieldType($key, 'int')) { - $this->{$key} = (int) price2num($value); - } else { - $this->{$key} = dol_string_nohtmltag($value); - } - } - - return 1; - } -} diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f1a93868809..e96b042beae 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -466,6 +466,8 @@ class Form $ext_element = false; $button_only = false; $inputOption = ''; + $rows = ''; + $cols = ''; if (is_object($object)) { $element = $object->element; @@ -1001,9 +1003,10 @@ class Form * @param string $htmloption Options html on select object * @param int $forcecombo Force to load all values and output a standard combobox (with no beautification) * @param array $events Event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) + * @param array $disableautocomplete Disable autocomplete * @return string HTML string with select and input */ - public function select_incoterms($selected = '', $location_incoterms = '', $page = '', $htmlname = 'incoterm_id', $htmloption = '', $forcecombo = 1, $events = array()) + public function select_incoterms($selected = '', $location_incoterms = '', $page = '', $htmlname = 'incoterm_id', $htmloption = '', $forcecombo = 1, $events = array(), $disableautocomplete = 0) { // phpcs:enable global $conf, $langs; @@ -1038,8 +1041,6 @@ class Form $num = $this->db->num_rows($resql); $i = 0; if ($num) { - $foundselected = false; - while ($i < $num) { $obj = $this->db->fetch_object($resql); $incotermArray[$i]['rowid'] = $obj->rowid; @@ -1901,6 +1902,7 @@ class Form { // phpcs:enable global $conf, $user, $langs, $hookmanager; + global $action; // If no preselected user defined, we take current user if ((is_numeric($selected) && ($selected < -2 || empty($selected))) && empty($conf->global->SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE)) { @@ -2414,6 +2416,7 @@ class Form if (!$forcecombo) { include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; + $events = array(); $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); } @@ -4192,6 +4195,7 @@ class Form } } $out .= '>'; + $value = ''; if ($format == 0) { $value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']); } elseif ($format == 1) { @@ -5883,14 +5887,16 @@ class Form /** * Return array of currencies in user language * - * @param string $selected preselected currency code - * @param string $htmlname name of HTML select list - * @param integer $useempty 1=Add empty line - * @param string $filter Optional filters criteras (example: 'code <> x', ' in (1,3)') - * @param bool $excludeConfCurrency false = If company current currency not in table, we add it into list. Should always be available. true = we are in currency_rate update , we don't want to see conf->currency in select + * @param string $selected Preselected currency code + * @param string $htmlname Name of HTML select list + * @param integer $useempty 1=Add empty line + * @param string $filter Optional filters criteras (example: 'code <> x', ' in (1,3)') + * @param bool $excludeConfCurrency false = If company current currency not in table, we add it into list. Should always be available. + * true = we are in currency_rate update , we don't want to see conf->currency in select + * @param string $morecss More css * @return string */ - public function selectMultiCurrency($selected = '', $htmlname = 'multicurrency_code', $useempty = 0, $filter = '', $excludeConfCurrency = false) + public function selectMultiCurrency($selected = '', $htmlname = 'multicurrency_code', $useempty = 0, $filter = '', $excludeConfCurrency = false, $morecss = '') { global $conf, $langs; @@ -5911,7 +5917,7 @@ class Form } $out = ''; - $out .= ''; if ($useempty) { $out .= ''; } @@ -6331,6 +6337,9 @@ class Form // Analysis of the pre-selection date $reg = array(); + $shour = ''; + $smin = ''; + $ssec = ''; if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?/', $set_time, $reg)) { // deprecated usage // Date format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' $syear = (!empty($reg[1]) ? $reg[1] : ''); @@ -6347,10 +6356,6 @@ class Form $shour = dol_print_date($set_time, "%H", $gm); $smin = dol_print_date($set_time, "%M", $gm); $ssec = dol_print_date($set_time, "%S", $gm); - } else { - $shour = ''; - $smin = ''; - $ssec = ''; } } else { // Date est '' ou vaut -1 @@ -6876,6 +6881,7 @@ class Form unset($tickettmpselect); } + $urloption = ''; $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : '; @@ -7018,16 +7024,11 @@ class Form protected function constructTicketListOption(&$objp, &$opt, &$optJson, $selected, $filterkey = '') { $outkey = ''; - $outval = ''; $outref = ''; - $outlabel = ''; $outtype = ''; - $label = $objp->label; - $outkey = $objp->rowid; $outref = $objp->ref; - $outlabel = $objp->label; $outtype = $objp->fk_product_type; $opt = '\n"; - $optJson = array('key'=>$outkey, 'value'=>$outref, 'type'=>$outtypem); + $optJson = array('key'=>$outkey, 'value'=>$outref, 'type'=>$outtype); } /** @@ -7619,7 +7619,7 @@ class Form if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) $tmpfieldstoshow = ''; foreach ($objecttmp->fields as $key => $val) { - if (!dol_eval($val['enabled'], 1, 1, 1, '1')) { + if (!dol_eval($val['enabled'], 1, 1, '1')) { continue; } if (!empty($val['showoncombobox'])) { @@ -7646,6 +7646,7 @@ class Form $out = ''; $outarray = array(); + $tmparray = array(); $num = 0; @@ -8284,7 +8285,7 @@ class Form * @param string $htmlname Name of HTML field * @param array $array Array with array of fields we could show. This array may be modified according to setup of user. * @param string $varpage Id of context for page. Can be set by caller with $varpage=(empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage); - * @param string $pos position colon on liste value left or right + * @param string $pos Position colon on liste value 'left' or '' (meaning 'right'). * @return string HTML multiselect string * @see selectarray() */ @@ -9351,10 +9352,12 @@ class Form global $conf, $user, $langs; // Permettre l'exclusion de groupes + $excludeGroups = null; if (is_array($exclude)) { $excludeGroups = implode(",", $exclude); } // Permettre l'inclusion de groupes + $includeGroups = null; if (is_array($include)) { $includeGroups = implode(",", $include); } @@ -9918,7 +9921,7 @@ class Form //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled $out .= '>' . $labeltoshow . ''; } else { - if ($hideunselectables && $disabled && ($selected != $obj->rowid)) { + if ($disabled && ($selected != $obj->rowid)) { $resultat = ''; } else { $resultat = '