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 '
';
}
// 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 .= '