Skip to content
Snippets Groups Projects
Commit 9269ffb3 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Ajout picto statut propal

parent 17b6a4c5
Branches
Tags
No related merge requests found
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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$
*
*/
/**
......
<?php
/* Copyright (C) 2004-2005 Destailleur Laurent <eldy@users.sourceforge.net>
/* Copyright (C) 2004-2006 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
*
* This program is free software; you can redistribute it and/or modify
......
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
*
* 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);
......@@ -96,6 +96,9 @@ class box_prospect extends ModeleBoxes {
'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'=>'&nbsp;');
$this->info_box_contents[$i][2] = array('text'=>'&nbsp;');
} else {
$this->info_box_contents[$i][0] = array('text'=>'&nbsp;');
$this->info_box_contents[$i][1] = array('text'=>'&nbsp;');
$this->info_box_contents[$i][2] = array('text'=>'&nbsp;');
}
$i++;
}
......
......@@ -578,6 +578,7 @@ function img_action($alt = "default", $numaction)
\param num Numro 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")
{
......
......@@ -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";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment