diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 6344bcec5d2..69c7ec4312c 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -1642,13 +1642,13 @@ if ($resql) {
// Amount/Total (TTC / gross) in foreign currency
if (!empty($arrayfields['c.multicurrency_total_ttc']['checked'])) {
print '
';
- print '';
+ print '';
print ' | ';
}
// Author
if (!empty($arrayfields['u.login']['checked'])) {
- print '';
- print '';
+ print ' | ';
+ print '';
print ' | ';
}
// Sales Representative
@@ -1843,7 +1843,7 @@ if ($resql) {
print_liste_field_titre($arrayfields['c.multicurrency_total_ttc']['label'], $_SERVER['PHP_SELF'], 'c.multicurrency_total_ttc', '', $param, 'class="right"', $sortfield, $sortorder);
}
if (!empty($arrayfields['u.login']['checked'])) {
- print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder);
+ print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, '', $sortfield, $sortorder);
}
if (!empty($arrayfields['sale_representative']['checked'])) {
print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", "$param", '', $sortfield, $sortorder);
diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php
index 2904f5afd66..938829fc577 100644
--- a/htdocs/core/modules/modSociete.class.php
+++ b/htdocs/core/modules/modSociete.class.php
@@ -318,9 +318,9 @@ class modSociete extends DolibarrModules
's.status'=>"Numeric", 's.client'=>"Numeric", 's.fournisseur'=>"Boolean", 's.datec'=>"Date", 's.tms'=>"Date",
's.code_client'=>"Text", 's.code_fournisseur'=>"Text", 's.code_compta'=>"Text", 's.code_compta_fournisseur'=>"Text",
's.address'=>"Text", 's.zip'=>"Text", 's.town'=>"Text",
- 'd.nom'=>'Text', 'r.nom'=>'Text', 'c.label'=>"List:c_country:label:label", 'c.code'=>"Text",
+ 'd.nom'=>'Text', 'r.nom'=>'Text', 'c.label'=>'List:c_country:label:label', 'c.code'=>'Text',
's.phone'=>"Text", 's.fax'=>"Text",
- 's.url'=>"Text", 's.email'=>"Text", 's.default_lang'=>"Text", 's.canvas' => "Canvas",
+ 's.url'=>"Text", 's.email'=>"Text", 's.default_lang'=>"Text", 's.canvas' => "Text",
's.siret'=>"Text", 's.siren'=>"Text", 's.ape'=>"Text", 's.idprof4'=>"Text", 's.idprof5'=>"Text", 's.idprof6'=>"Text",
's.tva_intra'=>"Text", 's.capital'=>"Numeric", 's.note_private'=>"Text", 's.note_public'=>"Text",
't.libelle'=>"Text", 'ce.code'=>"List:c_effectif:libelle:code", "cfj.libelle"=>"Text", 's.fk_prospectlevel'=>'List:c_prospectlevel:label:code',
diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
index 6bdaeb1aca6..5290b2eb085 100644
--- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
+++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
@@ -120,6 +120,10 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->actionmsg2 = $langs->transnoentities("COMPANY_MODIFYInDolibarr", $object->name);
}
$object->actionmsg = $langs->transnoentities("COMPANY_MODIFYInDolibarr", $object->name);
+ // For merge event, we add a mention
+ if (!empty($object->context['mergefromname'])) {
+ $object->actionmsg = dol_concatdesc($object->actionmsg, $langs->trans("DataFromWasMerged", $object->context['mergefromname']));
+ }
$object->sendtoid = 0;
$object->socid = $object->id;
@@ -1077,8 +1081,8 @@ class InterfaceActionsAuto extends DolibarrTriggers
$actioncomm = new ActionComm($this->db);
$actioncomm->type_code = $object->actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
$actioncomm->code = 'AC_'.$action;
- $actioncomm->label = $object->actionmsg2;
- $actioncomm->note_private = $object->actionmsg;
+ $actioncomm->label = $object->actionmsg2; // Label of event
+ $actioncomm->note_private = $object->actionmsg; // Description
$actioncomm->fk_project = $projectid;
$actioncomm->datep = $now;
$actioncomm->datef = $now;
diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang
index 43718271919..abdbdbed6a1 100644
--- a/htdocs/langs/en_US/agenda.lang
+++ b/htdocs/langs/en_US/agenda.lang
@@ -180,3 +180,4 @@ BrowserPush=Browser Popup Notification
Reminders=Reminders
ActiveByDefault=Enabled by default
Until=until
+DataFromWasMerged=Data from %s was merged
\ No newline at end of file
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 1d1ba6308f9..30977576010 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -191,7 +191,7 @@ if (empty($reshook)) {
if ($action == 'confirm_merge' && $confirm == 'yes' && $user->hasRight('societe', 'creer')) {
$error = 0;
$soc_origin_id = GETPOST('soc_origin', 'int');
- $soc_origin = new Societe($db);
+ $soc_origin = new Societe($db); // The thirdparty that we will delete
if ($soc_origin_id <= 0) {
$langs->load('errors');
@@ -241,6 +241,11 @@ if (empty($reshook)) {
}
}
+ // If alias name is not defined on target thirdparty, we can store in it the old name of company.
+ if (empty($object->name_bis) && $object->name != $soc_origin->name) {
+ $object->name_bis = $soc_origin->name;
+ }
+
// Merge categories
$static_cat = new Categorie($db);
@@ -331,7 +336,7 @@ if (empty($reshook)) {
if (!$error) {
- $object->context = array('merge'=>1, 'mergefromid'=>$soc_origin->id);
+ $object->context = array('merge'=>1, 'mergefromid'=>$soc_origin->id, 'mergefromname'=>$soc_origin->name);
// Call trigger
$result = $object->call_trigger('COMPANY_MODIFY', $user);
@@ -343,7 +348,7 @@ if (empty($reshook)) {
}
if (!$error) {
- //We finally remove the old thirdparty
+ // We finally remove the old thirdparty
if ($soc_origin->delete($soc_origin->id, $user) < 1) {
setEventMessages($soc_origin->error, $soc_origin->errors, 'errors');
$error++;
@@ -616,10 +621,10 @@ if (empty($reshook)) {
$result = $object->create($user);
- if (empty($error) && isModEnabled('mailing') && !empty($object->email) && $object->no_email == 1) {
+ if ($result >= 0 && isModEnabled('mailing') && !empty($object->email) && $object->no_email == 1) {
// Add mass emailing flag into table mailing_unsubscribe
- $result = $object->setNoEmail($object->no_email);
- if ($result < 0) {
+ $resultnoemail = $object->setNoEmail($object->no_email);
+ if ($resultnoemail < 0) {
$error++;
$errors = array_merge($errors, ($object->error ? array($object->error) : $object->errors));
$action = 'create';