Ajout picto statut propal

This commit is contained in:
Laurent Destailleur 2006-05-14 03:12:01 +00:00
parent 17b6a4c588
commit 9269ffb3b6
5 changed files with 32 additions and 19 deletions

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* 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$
*
*/
/**
@ -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++;
}
}

View File

@ -1,5 +1,5 @@
<?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

View File

@ -1,6 +1,6 @@
<?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);
@ -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'=>'&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++;
}

View File

@ -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")
{

View File

@ -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";