'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php
index 31d96758fcc..9a36f881ae4 100644
--- a/htdocs/compta/tva/list.php
+++ b/htdocs/compta/tva/list.php
@@ -401,7 +401,7 @@ if (!empty($moreforfilter)) {
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
-$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
+$selectedfields = ($mode != 'kanban' ? $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 don't need reserved height for your table
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 7d5d3858601..6ad1a75ad81 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -1046,7 +1046,7 @@ print $hookmanager->resPrint;
print '
';
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
-$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // 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) && $contextpage != 'poslist') ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '
';
diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php
index a0d00d27442..4f92114505d 100644
--- a/htdocs/contrat/services_list.php
+++ b/htdocs/contrat/services_list.php
@@ -556,7 +556,7 @@ if (!empty($moreforfilter)) {
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
-$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
+$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 5cf411ade65..14fa0eb3565 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -583,11 +583,17 @@ abstract class CommonObject
*/
public $total_ttc;
+
/**
* @var CommonObjectLine[]
*/
public $lines;
+ /**
+ * @var string Action code to use to record auto event in agenda. For exemple 'AC_OTH_AUTO'
+ */
+ public $actiontypecode;
+
/**
* @var mixed Comments
* @see fetchComments()
@@ -692,6 +698,18 @@ abstract class CommonObject
*/
public $user_modification_id;
+ /**
+ * @var int ID
+ * @deprecated Use $user_creation_id
+ */
+ public $fk_user_creat;
+
+ /**
+ * @var int ID
+ * @deprecated Use $user_modification_id
+ */
+ public $fk_user_modif;
+
public $next_prev_filter;
@@ -9714,20 +9732,28 @@ abstract class CommonObject
$fieldvalues = $this->setSaveQuery();
+ // Note: Here, $fieldvalues contains same keys (or less) that are inside ->fields
+
if (array_key_exists('date_creation', $fieldvalues) && empty($fieldvalues['date_creation'])) {
$fieldvalues['date_creation'] = $this->db->idate($now);
}
if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) {
$fieldvalues['fk_user_creat'] = $user->id;
+ $this->fk_user_creat = $user->id;
+ }
+ if (array_key_exists('user_creation_id', $fieldvalues) && !($fieldvalues['user_creation_id'] > 0)) {
+ $fieldvalues['user_creation_id'] = $user->id;
+ $this->user_creation_id = $user->id;
}
if (array_key_exists('pass_crypted', $fieldvalues) && property_exists($this, 'pass')) {
$fieldvalues['pass_crypted'] = dol_hash($this->pass);
}
- unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert.
if (array_key_exists('ref', $fieldvalues)) {
$fieldvalues['ref'] = dol_string_nospecial($fieldvalues['ref']); // If field is a ref, we sanitize data
}
+ unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert.
+
$keys = array();
$values = array(); // Array to store string forged for SQL syntax
foreach ($fieldvalues as $k => $v) {
@@ -10011,17 +10037,23 @@ abstract class CommonObject
$fieldvalues = $this->setSaveQuery();
+ // Note: Here, $fieldvalues contains same keys (or less) that are inside ->fields
+
if (array_key_exists('date_modification', $fieldvalues) && empty($fieldvalues['date_modification'])) {
$fieldvalues['date_modification'] = $this->db->idate($now);
}
if (array_key_exists('fk_user_modif', $fieldvalues) && !($fieldvalues['fk_user_modif'] > 0)) {
$fieldvalues['fk_user_modif'] = $user->id;
}
- unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into update.
+ if (array_key_exists('user_modification_id', $fieldvalues) && !($fieldvalues['user_modification_id'] > 0)) {
+ $fieldvalues['user_modification_id'] = $user->id;
+ }
if (array_key_exists('ref', $fieldvalues)) {
$fieldvalues['ref'] = dol_string_nospecial($fieldvalues['ref']); // If field is a ref, we sanitize data
}
+ unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into update.
+
// Add quotes and escape on fields with type string
$keys = array();
$values = array();
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 33260bc65ff..c87e028e720 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -8924,18 +8924,18 @@ class Form
/**
- * Show a multiselect dropbox from an array. If a saved selection of fields exists for user (into $user->conf->MAIN_SELECTEDFIELDS_contextofpage), we use this one instead of default.
+ * Show a multiselect dropbox from an array. If a saved selection of fields exists for user (into $user->conf->MAIN_SELECTEDFIELDS_contextofpage), we use this one instead of default.
*
- * @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 '' (meaning 'right').
- * @return string HTML multiselect string
+ * @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 '' (meaning 'right').
+ * @return string HTML multiselect string
* @see selectarray()
*/
public static function multiSelectArrayWithCheckbox($htmlname, &$array, $varpage, $pos = '')
{
- global $conf, $langs, $user, $extrafields;
+ global $langs, $user;
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
return '';
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index f09dda32803..54b4400b333 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -679,7 +679,7 @@ function getState($id, $withcode = '', $dbtouse = 0, $withregion = 0, $outputlan
* @param Translate $outputlangs Output language
* @return string Label translated of currency
*/
-function currency_name($code_iso, $withcode = '', $outputlangs = null)
+function currency_name($code_iso, $withcode = 0, $outputlangs = null)
{
global $langs, $db;
@@ -1151,7 +1151,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
$mode = 'view';
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
- $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
+ $selectedfields = ($mode != 'kanban' ? $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 don't need reserved height for your table
@@ -1550,14 +1550,14 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
/**
* Show html area with actions to do
*
- * @param Conf $conf Object conf
- * @param Translate $langs Object langs
- * @param DoliDB $db Object db
- * @param Adherent|Societe $filterobj Object thirdparty or member
- * @param Contact $objcon Object contact
- * @param int $noprint Return string but does not output it
- * @param int $actioncode Filter on actioncode
- * @return string|void Return html part or void if noprint is 1
+ * @param Conf $conf Object conf
+ * @param Translate $langs Object langs
+ * @param DoliDB $db Object db
+ * @param Adherent|Societe $filterobj Object thirdparty or member
+ * @param Contact $objcon Object contact
+ * @param int $noprint Return string but does not output it
+ * @param string|string[] $actioncode Filter on actioncode
+ * @return string|void Return html part or void if noprint is 1
*/
function show_actions_todo($conf, $langs, $db, $filterobj, $objcon = '', $noprint = 0, $actioncode = '')
{
diff --git a/htdocs/core/modules/modWebServicesClient.class.php b/htdocs/core/modules/modWebServicesClient.class.php
index bdd2f222cf6..c88080cc605 100644
--- a/htdocs/core/modules/modWebServicesClient.class.php
+++ b/htdocs/core/modules/modWebServicesClient.class.php
@@ -76,7 +76,7 @@ class modWebServicesClient extends DolibarrModules
// Permissions
$this->rights = array();
- $this->rights_class = 'syncsupplierwebservices';
+ $this->rights_class = 'webservicesclient';
$r = 0;
}
}
diff --git a/htdocs/don/list.php b/htdocs/don/list.php
index 71bb09c41bc..9cba55f01d7 100644
--- a/htdocs/don/list.php
+++ b/htdocs/don/list.php
@@ -308,7 +308,7 @@ if ($search_all) {
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
-$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
+$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '
';
diff --git a/htdocs/don/paiement/list.php b/htdocs/don/paiement/list.php
index 32162646c27..70112d0b0f1 100644
--- a/htdocs/don/paiement/list.php
+++ b/htdocs/don/paiement/list.php
@@ -326,7 +326,7 @@ if ($search_all) {
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
-$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
+$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
$massactionbutton = '';
if ($massactionbutton) {
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php
index ce211834b8c..e648af10fb2 100644
--- a/htdocs/eventorganization/conferenceorbooth_list.php
+++ b/htdocs/eventorganization/conferenceorbooth_list.php
@@ -827,7 +827,7 @@ if (!empty($moreforfilter)) {
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
-$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
+$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php
index 0c9722c4b78..ae874c2fcd1 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_list.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_list.php
@@ -803,7 +803,7 @@ if (!empty($moreforfilter)) {
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
-$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
+$selectedfields = ($mode != 'kanban' ? $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 don't need reserved height for your table
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index de32d3fc972..ccfd824db35 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -686,7 +686,7 @@ if (!empty($moreforfilter)) {
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
-$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', ''));
+$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));
if ($massactionbutton) {
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1); // This also change content of $arrayfields
}
diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php
index 8034da0845a..1dc7e453e5f 100644
--- a/htdocs/expensereport/payment/list.php
+++ b/htdocs/expensereport/payment/list.php
@@ -355,7 +355,7 @@ if ($moreforfilter) {
$arrayofmassactions = array();
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
-$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
+$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '
';
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index ddc8d0c332b..177f8117d88 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -562,7 +562,7 @@ if (!empty($moreforfilter)) {
}
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
-$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
+$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
print '
';
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index b41024bbc26..f1b8dafbf38 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -1448,8 +1448,8 @@ if (empty($reshook)) {
);
// Is sync supplier web services module activated? and everything filled?
- if (isModEnabled('syncsupplierwebservices')) {
- setEventMessages($langs->trans("WarningModuleNotActive", $langs->transnoentities("Module2650Name")), null, 'mesgs');
+ if (isModEnabled('webservicesclient')) {
+ setEventMessages($langs->trans("WarningModuleNotActive", $langs->transnoentities("Module2660Name")), null, 'mesgs');
} elseif (empty($ws_url) || empty($ws_key)) {
setEventMessages($langs->trans("ErrorWebServicesFieldsRequired"), null, 'errors');
} elseif (empty($ws_user) || empty($ws_password) || empty($ws_thirdparty)) {
@@ -2654,7 +2654,7 @@ if ($action == 'create') {
}
// Create a remote order using WebService only if module is activated
- if (!empty($conf->syncsupplierwebservices->enabled) && $object->statut >= 2) { // 2 means accepted
+ if (isModEnabled('webservicesclient') && $object->statut >= 2) { // 2 means accepted
print '
id.'&action=webservice&token='.newToken().'&mode=init">'.$langs->trans('CreateRemoteOrder').'';
}
diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php
index d815eda212b..46c864aaa0c 100644
--- a/htdocs/fourn/facture/list-rec.php
+++ b/htdocs/fourn/facture/list-rec.php
@@ -527,7 +527,7 @@ $arrayofmassactions = array(
$massactionbutton = $form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
-$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
+$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields
//$selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
print '