diff --git a/ChangeLog b/ChangeLog
index 2527864a862..4e35ff9e6a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,17 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
+***** ChangeLog for 13.0.0 compared to 12.0.0 *****
+For users:
+
+
+
+WARNING:
+
+Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
+* Properties ->contactid has been renamed into ->contact_id
+
+
***** ChangeLog for 12.0.0 compared to 11.0.0 *****
For users:
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 90dec733bc8..ec112b7d779 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -2747,7 +2747,7 @@ class Adherent extends CommonObject
$actioncomm->datef = $now;
$actioncomm->percentage = -1; // Not applicable
$actioncomm->socid = $adherent->thirdparty->id;
- $actioncomm->contactid = 0;
+ $actioncomm->contact_id = 0;
$actioncomm->authorid = $user->id; // User saving action
$actioncomm->userownerid = $user->id; // Owner of action
// Fields when action is en email (content should be added into note)
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 55cca00d7d7..ff368c5a759 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -177,7 +177,7 @@ if (empty($reshook) && $action == 'confirm_clone' && $confirm == 'yes')
//$object->fetch($id);
if (!empty($object->socpeopleassigned)) {
reset($object->socpeopleassigned);
- $object->contactid = key($object->socpeopleassigned);
+ $object->contact_id = key($object->socpeopleassigned);
}
$result = $object->createFromClone($user, GETPOST('socid', 'int'));
if ($result > 0) {
@@ -350,7 +350,7 @@ if (empty($reshook) && $action == 'add')
if (!empty($object->socpeopleassigned))
{
reset($object->socpeopleassigned);
- $object->contactid = key($object->socpeopleassigned);
+ $object->contact_id = key($object->socpeopleassigned);
}
// Fill array 'array_options' with data from add form
@@ -445,10 +445,10 @@ if (empty($reshook) && $action == 'update')
$socpeopleassigned = GETPOST("socpeopleassigned", 'array');
$object->socpeopleassigned = array();
foreach ($socpeopleassigned as $cid) $object->socpeopleassigned[$cid] = array('id' => $cid);
- $object->contactid = GETPOST("contactid", 'int');
- if (empty($object->contactid) && !empty($object->socpeopleassigned)) {
+ $object->contact_id = GETPOST("contactid", 'int');
+ if (empty($object->contact_id) && !empty($object->socpeopleassigned)) {
reset($object->socpeopleassigned);
- $object->contactid = key($object->socpeopleassigned);
+ $object->contact_id = key($object->socpeopleassigned);
}
$object->fk_project = GETPOST("projectid", 'int');
$object->note_private = GETPOST("note", "none");
@@ -1156,7 +1156,7 @@ if ($id > 0)
$object->socid = GETPOST("socid", "int");
$socpeopleassigned = GETPOST("socpeopleassigned", 'array');
foreach ($socpeopleassigned as $tmpid) $object->socpeopleassigned[$id] = array('id' => $tmpid);
- $object->contactid = GETPOST("contactid", 'int');
+ $object->contact_id = GETPOST("contactid", 'int');
$object->fk_project = GETPOST("projectid", 'int');
$object_private = GETPOST("note", 'none');
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 2cda34a494b..dd20325c194 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -492,7 +492,7 @@ class ActionComm extends CommonObject
$sql .= ((isset($this->socid) && $this->socid > 0) ? $this->socid : "null").", ";
$sql .= ((isset($this->fk_project) && $this->fk_project > 0) ? $this->fk_project : "null").", ";
$sql .= " '".$this->db->escape($this->note_private)."', ";
- $sql .= ((isset($this->contactid) && $this->contactid > 0) ? $this->contactid : "null").", ";
+ $sql .= ((isset($this->contact_id) && $this->contact_id > 0) ? $this->contact_id : "null").", ";
$sql .= (isset($user->id) && $user->id > 0 ? $user->id : "null").", ";
$sql .= ($userownerid > 0 ? $userownerid : "null").", ";
$sql .= ($userdoneid > 0 ? $userdoneid : "null").", ";
@@ -758,7 +758,7 @@ class ActionComm extends CommonObject
$this->transparency = $obj->transparency;
$this->socid = $obj->fk_soc; // To have fetch_thirdparty method working
- $this->contactid = $obj->fk_contact; // To have fetch_contact method working
+ $this->contact_id = $obj->fk_contact; // To have fetch_contact method working
$this->fk_project = $obj->fk_project; // To have fetch_projet method working
//$this->societe->id = $obj->fk_soc; // deprecated
@@ -999,7 +999,7 @@ class ActionComm extends CommonObject
}
$socid = (($this->socid > 0) ? $this->socid : 0);
- $contactid = (($this->contactid > 0) ? $this->contactid : 0);
+ $contactid = (($this->contact_id > 0) ? $this->contact_id : 0);
$userownerid = ($this->userownerid ? $this->userownerid : 0);
$userdoneid = ($this->userdoneid ? $this->userdoneid : 0);
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index 17b1307fb89..dd04e5f757c 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -1642,7 +1642,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if ($event->type_code == 'ICALEVENT') print '
('.dol_trunc($event->icalname, $maxnbofchar).')';
$thirdparty_id = ($event->thirdparty_id > 0 ? $event->thirdparty_id : ((is_object($event->societe) && $event->societe->id > 0) ? $event->societe->id : 0));
- $contact_id = ($event->contact_id > 0 ? $event->contact_id : ((is_object($event->contact) && $event->cotact->id > 0) ? $event->contact->id : 0));
+ $contact_id = ($event->contact_id > 0 ? $event->contact_id : ((is_object($event->contact) && $event->contact->id > 0) ? $event->contact->id : 0));
// If action related to company / contact
$linerelatedto = '';
diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php
index a769d709c4d..5b91dcd8c7c 100644
--- a/htdocs/comm/action/pertype.php
+++ b/htdocs/comm/action/pertype.php
@@ -469,7 +469,7 @@ if ($resql)
$event->fk_project = $obj->fk_project;
$event->socid = $obj->fk_soc;
- $event->contactid = $obj->fk_contact;
+ $event->contact_id = $obj->fk_contact;
$event->fk_element = $obj->fk_element;
$event->elementtype = $obj->elementtype;
@@ -880,15 +880,15 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
}
$cases1[$h][$event->id]['string'] .= ', '.$cachethirdparties[$event->socid]->name;
}
- if ($event->contactid > 0)
+ if ($event->contact_id > 0)
{
- if (empty($cachecontacts[$event->contactid]))
+ if (empty($cachecontacts[$event->contact_id]))
{
$tmpcontact = new Contact($db);
- $tmpcontact->fetch($event->contactid);
- $cachecontacts[$event->contactid] = $tmpcontact;
+ $tmpcontact->fetch($event->contact_id);
+ $cachecontacts[$event->contact_id] = $tmpcontact;
}
- $cases1[$h][$event->id]['string'] .= ', '.$cachecontacts[$event->contactid]->getFullName($langs);
+ $cases1[$h][$event->id]['string'] .= ', '.$cachecontacts[$event->contact_id]->getFullName($langs);
}
}
if ($event->date_start_in_calendar < $c && $dateendtouse > $b)
@@ -926,15 +926,15 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
}
$cases2[$h][$event->id]['string'] .= ', '.$cachethirdparties[$event->socid]->name;
}
- if ($event->contactid > 0)
+ if ($event->contact_id > 0)
{
- if (empty($cachecontacts[$event->contactid]))
+ if (empty($cachecontacts[$event->contact_id]))
{
$tmpcontact = new Contact($db);
- $tmpcontact->fetch($event->contactid);
- $cachecontacts[$event->contactid] = $tmpcontact;
+ $tmpcontact->fetch($event->contact_id);
+ $cachecontacts[$event->contact_id] = $tmpcontact;
}
- $cases2[$h][$event->id]['string'] .= ', '.$cachecontacts[$event->contactid]->getFullName($langs);
+ $cases2[$h][$event->id]['string'] .= ', '.$cachecontacts[$event->contact_id]->getFullName($langs);
}
}
} else {
diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php
index ef2c60e5ae6..81028796dc2 100644
--- a/htdocs/comm/action/peruser.php
+++ b/htdocs/comm/action/peruser.php
@@ -534,7 +534,7 @@ if ($resql)
$event->fk_project = $obj->fk_project;
$event->socid = $obj->fk_soc;
- $event->contactid = $obj->fk_contact;
+ $event->contact_id = $obj->fk_contact;
$event->fk_element = $obj->fk_element;
$event->elementtype = $obj->elementtype;
@@ -1071,15 +1071,15 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
}
$cases1[$h][$event->id]['string'] .= ', '.$cachethirdparties[$event->socid]->name;
}
- if ($event->contactid > 0)
+ if ($event->contact_id > 0)
{
- if (empty($cachecontacts[$event->contactid]))
+ if (empty($cachecontacts[$event->contact_id]))
{
$tmpcontact = new Contact($db);
- $tmpcontact->fetch($event->contactid);
- $cachecontacts[$event->contactid] = $tmpcontact;
+ $tmpcontact->fetch($event->contact_id);
+ $cachecontacts[$event->contact_id] = $tmpcontact;
}
- $cases1[$h][$event->id]['string'] .= ', '.$cachecontacts[$event->contactid]->getFullName($langs);
+ $cases1[$h][$event->id]['string'] .= ', '.$cachecontacts[$event->contact_id]->getFullName($langs);
}
}
if ($event->date_start_in_calendar < $c && $dateendtouse > $b)
@@ -1117,15 +1117,15 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
}
$cases2[$h][$event->id]['string'] .= ', '.$cachethirdparties[$event->socid]->name;
}
- if ($event->contactid > 0)
+ if ($event->contact_id > 0)
{
- if (empty($cachecontacts[$event->contactid]))
+ if (empty($cachecontacts[$event->contact_id]))
{
$tmpcontact = new Contact($db);
- $tmpcontact->fetch($event->contactid);
- $cachecontacts[$event->contactid] = $tmpcontact;
+ $tmpcontact->fetch($event->contact_id);
+ $cachecontacts[$event->contact_id] = $tmpcontact;
}
- $cases2[$h][$event->id]['string'] .= ', '.$cachecontacts[$event->contactid]->getFullName($langs);
+ $cases2[$h][$event->id]['string'] .= ', '.$cachecontacts[$event->contact_id]->getFullName($langs);
}
}
} else {
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index e737aa1d8c3..00c311d7209 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -347,7 +347,7 @@ if (empty($reshook))
$object->remise_percent = GETPOST('remise_percent');
$object->remise_absolue = GETPOST('remise_absolue');
$object->socid = GETPOST('socid', 'int');
- $object->contactid = GETPOST('contactid', 'int');
+ $object->contact_id = GETPOST('contactid', 'int');
$object->fk_project = GETPOST('projectid', 'int');
$object->modelpdf = GETPOST('model');
$object->author = $user->id; // deprecated
@@ -375,7 +375,7 @@ if (empty($reshook))
$object->cond_reglement_id = GETPOST('cond_reglement_id');
$object->mode_reglement_id = GETPOST('mode_reglement_id');
$object->fk_account = GETPOST('fk_account', 'int');
- $object->contactid = GETPOST('contactid', 'int');
+ $object->contact_id = GETPOST('contactid', 'int');
$object->fk_project = GETPOST('projectid', 'int');
$object->modelpdf = GETPOST('model');
$object->author = $user->id; // deprecated
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index d7f7b659492..f9288f49d20 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -278,7 +278,7 @@ if (empty($reshook))
$object->shipping_method_id = GETPOST('shipping_method_id', 'int');
$object->warehouse_id = GETPOST('warehouse_id', 'int');
$object->fk_delivery_address = GETPOST('fk_address');
- $object->contactid = GETPOST('contactid');
+ $object->contact_id = GETPOST('contactid');
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 1c3c44dce93..28d2170e49a 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -1338,7 +1338,7 @@ class Commande extends CommonOrder
$this->shipping_method_id = $object->shipping_method_id;
$this->warehouse_id = $object->warehouse_id;
$this->fk_delivery_address = $object->fk_delivery_address;
- $this->contact_id = $object->contactid;
+ $this->contact_id = $object->contact_id;
$this->ref_client = $object->ref_client;
if (empty($conf->global->MAIN_DISABLE_PROPAGATE_NOTES_FROM_ORIGIN))
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 369f4f0ee25..784c4e3f39d 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -1311,7 +1311,7 @@ class Facture extends CommonInvoice
$this->demand_reason_id = $object->demand_reason_id;
$this->date_livraison = $object->date_livraison;
$this->fk_delivery_address = $object->fk_delivery_address; // deprecated
- $this->contact_id = $object->contactid;
+ $this->contact_id = $object->contact_id;
$this->ref_client = $object->ref_client;
if (empty($conf->global->MAIN_DISABLE_PROPAGATE_NOTES_FROM_ORIGIN))
diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php
index 4e496408f1d..4f1959d2707 100644
--- a/htdocs/core/class/CSMSFile.class.php
+++ b/htdocs/core/class/CSMSFile.class.php
@@ -131,7 +131,7 @@ class CSMSFile
$sms->nostop = $this->nostop;
$sms->socid = $this->socid;
- $sms->contactid = $this->contactid;
+ $sms->contact_id = $this->contact_id;
$sms->project = $this->fk_project;
$res = $sms->SmsSend();
@@ -162,7 +162,7 @@ class CSMSFile
$sms->nostop = $this->nostop;
$sms->socid = $this->socid;
- $sms->contactid = $this->contactid;
+ $sms->contact_id = $this->contact_id;
$sms->fk_project = $this->fk_project;
$res = $sms->SmsSend();
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 91ffaeffc4c..703460a8053 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -1424,15 +1424,15 @@ abstract class CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
- * Load object contact with id=$this->contactid into $this->contact
+ * Load object contact with id=$this->contact_id into $this->contact
*
- * @param int $contactid Id du contact. Use this->contactid if empty.
+ * @param int $contactid Id du contact. Use this->contact_id if empty.
* @return int <0 if KO, >0 if OK
*/
public function fetch_contact($contactid = null)
{
// phpcs:enable
- if (empty($contactid)) $contactid = $this->contactid;
+ if (empty($contactid)) $contactid = $this->contact_id;
if (empty($contactid)) return 0;
diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php
index 8dcd4965c65..d2e709c69a3 100644
--- a/htdocs/core/class/html.formticket.class.php
+++ b/htdocs/core/class/html.formticket.class.php
@@ -338,7 +338,7 @@ class FormTicket
print '';
} else {
print '