From 9269ffb3b6e99bf64037d271e4539f9b3798d86b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 May 2006 03:12:01 +0000 Subject: [PATCH] Ajout picto statut propal --- htdocs/includes/boxes/box_clients.php | 7 +++--- htdocs/includes/boxes/box_fournisseurs.php | 2 +- htdocs/includes/boxes/box_prospect.php | 13 ++++++---- htdocs/lib/functions.inc.php | 1 + htdocs/prospect.class.php | 28 ++++++++++++++-------- 5 files changed, 32 insertions(+), 19 deletions(-) diff --git a/htdocs/includes/boxes/box_clients.php b/htdocs/includes/boxes/box_clients.php index 37454657f9e..50739a1bf67 100644 --- a/htdocs/includes/boxes/box_clients.php +++ b/htdocs/includes/boxes/box_clients.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005 Laurent Destailleur +/* Copyright (C) 2003 Rodolphe Quiedeville + * Copyright (C) 2005-2006 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,6 @@ * * $Id$ * $Source$ - * */ /** @@ -93,7 +92,7 @@ class box_clients extends ModeleBoxes { 'logo' => $this->boximg, 'text' => stripslashes($objp->nom), 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->idp); - + $i++; } } diff --git a/htdocs/includes/boxes/box_fournisseurs.php b/htdocs/includes/boxes/box_fournisseurs.php index 041e5b47a52..f6e5d6cc665 100644 --- a/htdocs/includes/boxes/box_fournisseurs.php +++ b/htdocs/includes/boxes/box_fournisseurs.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2006 Destailleur Laurent * Copyright (C) 2005-2006 Regis Houssin * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/includes/boxes/box_prospect.php b/htdocs/includes/boxes/box_prospect.php index 157154aa187..7fad15bac5a 100644 --- a/htdocs/includes/boxes/box_prospect.php +++ b/htdocs/includes/boxes/box_prospect.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005 Laurent Destailleur + * Copyright (C) 2005-2006 Laurent Destailleur * Copyright (C) 2005-2006 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -19,7 +19,6 @@ * * $Id$ * $Source$ - * */ /** @@ -30,6 +29,7 @@ include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php"); +include_once(DOL_DOCUMENT_ROOT."/prospect.class.php"); class box_prospect extends ModeleBoxes { @@ -66,7 +66,7 @@ class box_prospect extends ModeleBoxes { if ($user->rights->societe->lire) { - $sql = "SELECT s.nom,s.idp"; + $sql = "SELECT s.nom, s.idp, s.fk_stcomm"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -86,7 +86,7 @@ class box_prospect extends ModeleBoxes { $num = $db->num_rows($result); $i = 0; - + $prospectstatic=new Prospect($db); while ($i < $num) { $objp = $db->fetch_object($result); @@ -95,6 +95,9 @@ class box_prospect extends ModeleBoxes { 'logo' => $this->boximg, 'text' => stripslashes($objp->nom), 'url' => DOL_URL_ROOT."/comm/prospect/fiche.php?id=".$objp->idp); + + $this->info_box_contents[$i][1] = array('align' => 'right', + 'text' => $prospectstatic->LibStatut($objp->fk_stcomm,3)); $i++; } @@ -106,9 +109,11 @@ class box_prospect extends ModeleBoxes { { $this->info_box_contents[$i][0] = array('align' => 'center','text'=>$langs->trans("NoRecordedProspects")); $this->info_box_contents[$i][1] = array('text'=>' '); + $this->info_box_contents[$i][2] = array('text'=>' '); } else { $this->info_box_contents[$i][0] = array('text'=>' '); $this->info_box_contents[$i][1] = array('text'=>' '); + $this->info_box_contents[$i][2] = array('text'=>' '); } $i++; } diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index 62f9edf9ab8..afbce94e52e 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -578,6 +578,7 @@ function img_action($alt = "default", $numaction) \param num Numéro statut \param alt Texte a afficher sur alt \return string Retourne tag img + \todo A virer et remplacer par entitestatic->LibStatut */ function img_statut($num,$alt = "default") { diff --git a/htdocs/prospect.class.php b/htdocs/prospect.class.php index f7b9603f5c2..e65ed804c8e 100644 --- a/htdocs/prospect.class.php +++ b/htdocs/prospect.class.php @@ -116,19 +116,27 @@ class Prospect extends Societe if ($mode == 2) { - if ($statut == -1) return img_action(0,-1).' '.$langs->trans("StatusProspect-1"); - if ($statut == 0) return img_action(0, 0).' '.$langs->trans("StatusProspect0"); - if ($statut == 1) return img_action(0, 1).' '.$langs->trans("StatusProspect1"); - if ($statut == 2) return img_action(0, 2).' '.$langs->trans("StatusProspect2"); - if ($statut == 3) return img_action(0, 3).' '.$langs->trans("StatusProspect3"); + if ($statut == -1) return img_action($langs->trans("StatusProspect-1"),-1).' '.$langs->trans("StatusProspect-1"); + if ($statut == 0) return img_action($langs->trans("StatusProspect0"), 0).' '.$langs->trans("StatusProspect0"); + if ($statut == 1) return img_action($langs->trans("StatusProspect1"), 1).' '.$langs->trans("StatusProspect1"); + if ($statut == 2) return img_action($langs->trans("StatusProspect2"), 2).' '.$langs->trans("StatusProspect2"); + if ($statut == 3) return img_action($langs->trans("StatusProspect3"), 3).' '.$langs->trans("StatusProspect3"); + } + if ($mode == 3) + { + if ($statut == -1) return img_action($langs->trans("StatusProspect-1"),-1); + if ($statut == 0) return img_action($langs->trans("StatusProspect0"), 0); + if ($statut == 1) return img_action($langs->trans("StatusProspect1"), 1); + if ($statut == 2) return img_action($langs->trans("StatusProspect2"), 2); + if ($statut == 3) return img_action($langs->trans("StatusProspect3"), 3); } if ($mode == 4) { - if ($statut == -1) return img_action(0,-1).' '.$langs->trans("StatusProspect-1"); - if ($statut == 0) return img_action(0, 0).' '.$langs->trans("StatusProspect0"); - if ($statut == 1) return img_action(0, 1).' '.$langs->trans("StatusProspect1"); - if ($statut == 2) return img_action(0, 2).' '.$langs->trans("StatusProspect2"); - if ($statut == 3) return img_action(0, 3).' '.$langs->trans("StatusProspect3"); + if ($statut == -1) return img_action($langs->trans("StatusProspect-1"),-1).' '.$langs->trans("StatusProspect-1"); + if ($statut == 0) return img_action($langs->trans("StatusProspect0"), 0).' '.$langs->trans("StatusProspect0"); + if ($statut == 1) return img_action($langs->trans("StatusProspect1"), 1).' '.$langs->trans("StatusProspect1"); + if ($statut == 2) return img_action($langs->trans("StatusProspect2"), 2).' '.$langs->trans("StatusProspect2"); + if ($statut == 3) return img_action($langs->trans("StatusProspect3"), 3).' '.$langs->trans("StatusProspect3"); } return "Error, mode/status not found";