From 449d44419d28735572e25f5d871e99fa78d3f7a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Feb 2016 11:17:47 +0100 Subject: [PATCH] Fix: When module shipment is on, a contact of order is also contact of shipment --- htdocs/contact/card.php | 27 ++++++++++++-------------- htdocs/contact/class/contact.class.php | 6 +++--- htdocs/langs/en_US/companies.lang | 2 ++ 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 6fe648b375f..fca007bfd1f 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1124,14 +1124,6 @@ else print '
'; print ''; - // Statut - /*print ''; - print ''; - print ''."\n"; - */ - // Categories if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { print ''; @@ -1151,13 +1143,6 @@ else $object->load_ref_elements(); - if (! empty($conf->commande->enabled)) - { - print ''; - } - if (! empty($conf->propal->enabled)) { print ''; } + if (! empty($conf->commande->enabled) || ! empty($conf->expedition->enabled)) + { + print ''; + } + if (! empty($conf->contrat->enabled)) { print '
'.$langs->trans("Status").''; - print $object->getLibStatut(4); - print '
' . $langs->trans( "Categories" ) . '
'.$langs->trans("ContactForOrders").''; - print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder"); - print '
'.$langs->trans("ContactForProposals").''; @@ -1165,6 +1150,18 @@ else print '
'; + if (! empty($conf->expedition->enabled)) { print $langs->trans("ContactForOrdersOrShipments"); } + else print $langs->trans("ContactForOrders"); + print ''; + $none=$langs->trans("NoContactForAnyOrder"); + if (! empty($conf->expedition->enabled)) { $none=$langs->trans("NoContactForAnyOrderOrShipments"); } + print $object->ref_commande?$object->ref_commande:$none; + print '
'.$langs->trans("ContactForContracts").''; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 723784d9a5d..2feb3f73b05 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -664,10 +664,10 @@ class Contact extends CommonObject /** - * Charge le nombre d'elements auquel est lie ce contact + * Load number of elements the contact is used as a link for * ref_facturation * ref_contrat - * ref_commande + * ref_commande (for order and/or shipments) * ref_propale * * @return int <0 if KO, >=0 if OK @@ -701,7 +701,7 @@ class Contact extends CommonObject } else { - $this->error=$this->db->error()." - ".$sql; + $this->error=$this->db->lasterror(); return -1; } } diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 05348d7d26a..2559aa8bafb 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -317,10 +317,12 @@ ShowContact=Show contact ContactsAllShort=All (No filter) ContactType=Contact type ContactForOrders=Order's contact +ContactForOrdersOrShipments=Order's or shipment's contact ContactForProposals=Proposal's contact ContactForContracts=Contract's contact ContactForInvoices=Invoice's contact NoContactForAnyOrder=This contact is not a contact for any order +NoContactForAnyOrderOrShipment=This contact is not a contact for any order or shipment NoContactForAnyProposal=This contact is not a contact for any commercial proposal NoContactForAnyContract=This contact is not a contact for any contract NoContactForAnyInvoice=This contact is not a contact for any invoice