diff --git a/htdocs/comm/clients.php b/htdocs/comm/clients.php
index 540bd05b8f0..a66a6e892eb 100644
--- a/htdocs/comm/clients.php
+++ b/htdocs/comm/clients.php
@@ -87,7 +87,7 @@ $thirdpartystatic=new Societe($db);
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('',$langs->trans("ThirdParty"),$help_url);
-$sql = "SELECT s.rowid, s.nom as name, s.client, s.ville, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta,";
+$sql = "SELECT s.rowid, s.nom as name, s.client, s.ville, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,";
$sql.= " s.datec, s.datea, s.canvas";
// We'll need these fields in order to filter by sale (including the case where the user can only see his prospects)
if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user";
@@ -171,7 +171,7 @@ if ($result)
if ($moreforfilter)
{
print '
\n";
$i++;
}
diff --git a/htdocs/includes/boxes/box_actions.php b/htdocs/includes/boxes/box_actions.php
index 039d227fd59..130589ab936 100644
--- a/htdocs/includes/boxes/box_actions.php
+++ b/htdocs/includes/boxes/box_actions.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2009 Laurent Destailleur
+ * Copyright (C) 2004-2011 Laurent Destailleur
* Copyright (C) 2005-2011 Regis Houssin
*
* This program is free software; you can redistribute it and/or modify
@@ -43,7 +43,7 @@ class box_actions extends ModeleBoxes {
/**
- * \brief Constructeur de la classe
+ * Constructor
*/
function box_actions()
{
@@ -54,8 +54,8 @@ class box_actions extends ModeleBoxes {
}
/**
- * \brief Charge les donnees en memoire pour affichage ulterieur
- * \param $max Nombre maximum d'enregistrements a charger
+ * Charge les donnees en memoire pour affichage ulterieur
+ * @param $max Nombre maximum d'enregistrements a charger
*/
function loadBox($max=5)
{
@@ -125,7 +125,7 @@ class box_actions extends ModeleBoxes {
'text' => dol_print_date($datelimite, "dayhour"));
$this->info_box_contents[$i][5] = array('td' => 'align="right"',
- 'text' => $objp->percentage. "%");
+ 'text' => ($objp->percentage>= 0?$objp->percentage.'%':''));
$this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"',
'text' => $actionstatic->LibStatut($objp->percentage,3));
diff --git a/htdocs/includes/boxes/box_prospect.php b/htdocs/includes/boxes/box_prospect.php
index 41bb33645db..c971be0848d 100644
--- a/htdocs/includes/boxes/box_prospect.php
+++ b/htdocs/includes/boxes/box_prospect.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2008 Laurent Destailleur
+ * Copyright (C) 2004-2011 Laurent Destailleur
* Copyright (C) 2005-2009 Regis Houssin
*
* This program is free software; you can redistribute it and/or modify
@@ -107,7 +107,7 @@ class box_prospect extends ModeleBoxes {
'text' => dol_print_date($datem, "day"));
$this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"',
- 'text' => str_replace('img ','img height="14" ',$prospectstatic->LibStatut($objp->fk_stcomm,3)));
+ 'text' => str_replace('img ','img height="14" ',$prospectstatic->LibProspStatut($objp->fk_stcomm,3)));
$i++;
}
diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang
index 2cdb40a7af9..77e43725df6 100644
--- a/htdocs/langs/en_US/commercial.lang
+++ b/htdocs/langs/en_US/commercial.lang
@@ -78,4 +78,5 @@ ActionAC_EMAILING=Send mass email
ActionAC_COM=Send customer order by mail
ActionAC_SUP_ORD=Send supplier order by mail
ActionAC_SUP_INV=Send supplier invoice by mail
-ActionAC_OTH=Other
\ No newline at end of file
+ActionAC_OTH=Other
+StatusProsp=Prospect status
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/commercial.lang b/htdocs/langs/fr_FR/commercial.lang
index 702e8ba3821..8f17cdc48f3 100644
--- a/htdocs/langs/fr_FR/commercial.lang
+++ b/htdocs/langs/fr_FR/commercial.lang
@@ -84,4 +84,5 @@ CAOrder=Chiffre d'affaire (Commandes validées)
FromTo=du %s au %s
MargeOrder=Marge réalisée (Commandes validées)
RecapAnnee=Récapitulatif de l'année
-NoData=Aucune donnée
\ No newline at end of file
+NoData=Aucune donnée
+StatusProsp=Status prospection
\ No newline at end of file
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index aaaf6c880b2..48569f43ee1 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -1405,6 +1405,58 @@ class Societe extends CommonObject
return $result;
}
+ /**
+ * Return label of status (activity, closed)
+ * @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
+ * @return string Libelle
+ */
+ function getLibStatut($mode=0)
+ {
+ return $this->LibStatut($this->status,$mode);
+ }
+
+ /**
+ * Renvoi le libelle d'un statut donne
+ * @param statut Id statut
+ * @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
+ * @return string Libelle du statut
+ */
+ function LibStatut($statut,$mode=0)
+ {
+ global $langs;
+ $langs->load('companies');
+
+ if ($mode == 0)
+ {
+ if ($statut==0) return $langs->trans("ActivityCeased");
+ if ($statut==1) return $langs->trans("InActivity");
+ }
+ if ($mode == 1)
+ {
+ if ($statut==0) return $langs->trans("ActivityCeased");
+ if ($statut==1) return $langs->trans("InActivity");
+ }
+ if ($mode == 2)
+ {
+ if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut9').' '.$langs->trans("ActivityCeased");
+ if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4').' '.$langs->trans("InActivity");
+ }
+ if ($mode == 3)
+ {
+ if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut9');
+ if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4');
+ }
+ if ($mode == 4)
+ {
+ if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut9').' '.$langs->trans("ActivityCeased");
+ if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4').' '.$langs->trans("InActivity");
+ }
+ if ($mode == 5)
+ {
+ if ($statut==0) return $langs->trans("ActivityCeased").' '.img_picto($langs->trans("ActivityCeased"),'statut9');
+ if ($statut==1) return $langs->trans("InActivity").' '.img_picto($langs->trans("InActivity"),'statut4');
+ }
+ }
/**
* Return full address of third party
diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php
index 0463737be9a..bc29ec5294a 100644
--- a/htdocs/societe/index.php
+++ b/htdocs/societe/index.php
@@ -144,7 +144,7 @@ print '
';
* Last third parties modified
*/
$max=15;
-$sql = "SELECT s.rowid, s.nom as name, s.client, s.fournisseur, s.canvas, s.tms as datem";
+$sql = "SELECT s.rowid, s.nom as name, s.client, s.fournisseur, s.canvas, s.tms as datem, s.status as status";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.entity = ".$conf->entity;
@@ -170,7 +170,10 @@ if ($result)
print '
'.$langs->trans("CompanyDeleted
$title=$langs->trans("ListOfThirdParties");
$sql = "SELECT s.rowid, s.nom as name, s.ville, s.datec, s.datea,";
-$sql.= " st.libelle as stcomm, s.prefix_comm, s.client, s.fournisseur, s.canvas,";
+$sql.= " st.libelle as stcomm, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,";
$sql.= " s.siren as idprof1, s.siret as idprof2, ape as idprof3, idprof4 as idprof4";
// We'll need these fields in order to filter by sale (including the case where the user can only see his prospects)
if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user";
@@ -333,6 +333,7 @@ if ($resql)
print_liste_field_titre($form->textwithpicto($langs->trans("ProfId3Short"),$textprofid[3],1,0),$_SERVER["PHP_SELF"],"s.ape","",$params,'nowrap="nowrap"',$sortfield,$sortorder);
print_liste_field_titre($form->textwithpicto($langs->trans("ProfId4Short"),$textprofid[4],1,0),$_SERVER["PHP_SELF"],"s.idprof4","",$params,'nowrap="nowrap"',$sortfield,$sortorder);
print '
';
+ print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$params,'align="right"',$sortfield,$sortorder);
print "\n";
// Lignes des champs de filtre
@@ -362,7 +363,7 @@ if ($resql)
print '';
print '';
// Type (customer/prospect/supplier)
- print '