diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index f9137a06acf..17c8bcae048 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -445,6 +445,7 @@ if ($id == 11) $langs->load("interventions"); $elementList = array( '' => '', + 'societe' => $langs->trans('ThirdParty'), // 'proposal' => $langs->trans('Proposal'), // 'order' => $langs->trans('Order'), // 'invoice' => $langs->trans('Bill'), diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index bd76ec1646d..1d418ac295c 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1165,8 +1165,10 @@ if (empty($reshook)) - if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer) { - if ($action == 'addcontact') { + if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->commande->creer) + { + if ($action == 'addcontact') + { if ($object->id > 0) { $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); $result = $object->add_contact($contactid, GETPOST('type'), GETPOST('source')); @@ -1186,7 +1188,8 @@ if (empty($reshook)) } // bascule du statut d'un contact - else if ($action == 'swapstatut') { + else if ($action == 'swapstatut') + { if ($object->id > 0) { $result = $object->swapContactStatus(GETPOST('ligne')); } else { @@ -1195,7 +1198,8 @@ if (empty($reshook)) } // Efface un contact - else if ($action == 'deletecontact') { + else if ($action == 'deletecontact') + { $result = $object->delete_contact($lineid); if ($result >= 0) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 65ece020ac8..16ebb0e77e9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -452,13 +452,15 @@ abstract class CommonObject // Check parameters if ($fk_socpeople <= 0) { - $this->error=$langs->trans("ErrorWrongValueForParameter","1"); + $langs->load("errors"); + $this->error=$langs->trans("ErrorWrongValueForParameterX","1"); dol_syslog(get_class($this)."::add_contact ".$this->error,LOG_ERR); return -1; } if (! $type_contact) { - $this->error=$langs->trans("ErrorWrongValueForParameter","2"); + $langs->load("errors"); + $this->error=$langs->trans("ErrorWrongValueForParameterX","2"); dol_syslog(get_class($this)."::add_contact ".$this->error,LOG_ERR); return -2; } @@ -486,7 +488,7 @@ abstract class CommonObject } $datecreate = dol_now(); - + $this->db->begin(); // Insertion dans la base @@ -504,7 +506,11 @@ abstract class CommonObject if (! $notrigger) { $result=$this->call_trigger(strtoupper($this->element).'_ADD_CONTACT', $user); - if ($result < 0) { $this->db->rollback(); return -1; } + if ($result < 0) + { + $this->db->rollback(); + return -1; + } } $this->db->commit(); diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 382abbe81c0..5abdfc124e4 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -72,7 +72,12 @@ $userstatic=new User($db);