From 1295c8d27bcd82586240087f0f60cbd4c4aa4218 Mon Sep 17 00:00:00 2001 From: lalaina rasamoelina Date: Thu, 18 Jul 2013 09:41:37 +0200 Subject: [PATCH] Put the status of contact in the list of contact --- htdocs/contact/class/contact.class.php | 11 ++++++----- htdocs/core/class/html.form.class.php | 5 +++-- htdocs/core/lib/company.lib.php | 10 +++++++--- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 01d8fda91f5..b488949538d 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -901,9 +901,9 @@ class Contact extends CommonObject return $this->LibStatut($this->statut,$mode); } - function getLibStatutcontact($mode) + function getLibStatutcontact() { - return $this->LibStatutcontact($this->statut,$mode); + return $this->LibStatutcontact($this->statut); } /** @@ -962,10 +962,11 @@ class Contact extends CommonObject } - function LibStatutcontact($mode) + function LibStatutcontact($statut) { - if ($statut==1) return img_picto($langs->trans('StatusContactDraft'),'statut0').' '.$langs->trans('Disabled'); - else return img_picto($langs->trans('StatusContactValidated'),'statut1').' '.$langs->trans('Enabled'); + global $langs; + if ($statut==1) return ''.$langs->trans('Disabled').' '.img_picto($langs->trans('StatusContactDraftShort'),'statut0'); + else return ''.$langs->trans('Enabled').' '.img_picto($langs->trans('StatusContactValidatedShort'),'statut1'); } /** * Return translated label of Public or Private diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b63703d5785..5267ad3520b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -951,7 +951,7 @@ class Form $out=''; // On recherche les societes - $sql = "SELECT sp.rowid, sp.lastname, sp.firstname, sp.poste"; + $sql = "SELECT sp.rowid, sp.lastname, sp.statut, sp.firstname, sp.poste"; if ($showsoc > 0) { $sql.= " , s.nom as company"; } @@ -991,7 +991,7 @@ class Form $contactstatic->id=$obj->rowid; $contactstatic->lastname=$obj->lastname; $contactstatic->firstname=$obj->firstname; - + if ($obj->statut == 0){ if ($htmlname != 'none') { $disabled=0; @@ -1027,6 +1027,7 @@ class Form if (($showsoc > 0) && $obj->company) $out.= ' - ('.$obj->company.')'; } } + } $i++; } } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index ecb8413f810..2d100529a69 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -544,6 +544,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ''.$langs->trans("PhoneMobile").''; print ''.$langs->trans("Fax").''; print ''.$langs->trans("EMail").''; + print ''.$langs->trans("Status").''; print " "; if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { @@ -569,8 +570,6 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') while ($i < $num) { $obj = $db->fetch_object($result); - if($obj->statut == 0) - { $var = !$var; print ""; @@ -599,6 +598,8 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL'); print ''; + if ($obj->statut==1) print ''.$langs->trans('Disabled').' '.img_picto($langs->trans('StatusContactDraftShort'),'statut0').''; + elseif ($obj->statut==0) print ''.$langs->trans('Enabled').' '.img_picto($langs->trans('StatusContactValidatedShort'),'statut1').''; if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { print ''; @@ -613,6 +614,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ''; } + if ($user->rights->societe->contact->creer) { print ''; @@ -620,8 +622,10 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print img_edit(); print ''; } + + + print "\n"; - } $i++; } }