Trad: Traduction des statuts de prospect et des libells des actions

This commit is contained in:
Laurent Destailleur 2005-04-09 13:33:39 +00:00
parent 13be2726fe
commit 675077d055
8 changed files with 181 additions and 99 deletions

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
*
* $Id$
* $Source$
@ -39,6 +39,7 @@ class ActionComm
var $db;
var $date;
var $type_code;
var $type;
var $priority;
var $user;
@ -131,17 +132,24 @@ class ActionComm
*/
function fetch($id)
{
$sql = "SELECT ".$this->db->pdate("a.datea")." as da, a.note, a.label, c.libelle, fk_soc, fk_user_author, fk_contact, fk_facture, a.percent ";
$sql .= "FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c WHERE a.id=$id AND a.fk_action=c.id;";
global $langs;
$sql = "SELECT ".$this->db->pdate("a.datea")." as da, a.note, a.label, c.code, c.libelle, fk_soc, fk_user_author, fk_contact, fk_facture, a.percent";
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c";
$sql.= " WHERE a.id=$id AND a.fk_action=c.id;";
if ($this->db->query($sql) )
$resql=$this->db->query($sql);
if ($resql)
{
if ($this->db->num_rows())
if ($this->db->num_rows($resql))
{
$obj = $this->db->fetch_object();
$obj = $this->db->fetch_object($resql);
$this->id = $id;
$this->type = $obj->libelle;
$this->type_code = $obj->code;
$transcode=$langs->trans("Action".$obj->code);
$type_libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle);
$this->type = $type_libelle;
$this->libelle = $obj->label;
$this->date = $obj->da;
$this->note =$obj->note;
@ -152,11 +160,11 @@ class ActionComm
$this->fk_facture = $obj->fk_facture;
if ($this->fk_facture)
{
$this->objet_url = '<a href="'. DOL_URL_ROOT . '/compta/facture.php?facid='.$this->fk_facture.'">Facture</a>';
$this->objet_url = '<a href="'. DOL_URL_ROOT . '/compta/facture.php?facid='.$this->fk_facture.'">'.$langs->trans("Bill").'</a>';
}
$this->db->free();
}
$this->db->free($resql);
}
else
{

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2005 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
@ -21,7 +21,8 @@
*
*/
/** \file htdocs/cactioncomm.class.php
/**
\file htdocs/cactioncomm.class.php
\ingroup commercial
\brief Fichier de la classe des types d'actions commerciales
\version $Revision$
@ -33,120 +34,147 @@
*/
class CActioncomm {
var $db;
var $id;
var $libelle;
var $error;
var $type_actions=array();
/**
* \brief Constructeur
* \param DB Handler d'accès base de donnée
*/
function CActioncomm($DB=0)
function CActioncomm($DB)
{
$this->db = $DB;
}
/**
* \brief Charge l'objet type d'action depuis la base
* \param db handle d'accès base
* \param id id du type d'action à récupérer
* \return int 1=ok, 0=aucune action, -1=erreur
*/
function fetch($db, $id)
function fetch($id)
{
$sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."c_actioncomm WHERE id=$id;";
$resql=$this->db->query($sql);
if ($resql)
{
if ($this->db->num_rows($resql))
{
$obj = $this->db->fetch_object($resql);
$this->id = $id;
$this->libelle = $obj->libelle;
return 1;
}
else
{
return 0;
}
$sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."c_actioncomm WHERE id=$id;";
if ($db->query($sql) )
{
if ($db->num_rows())
{
$obj = $db->fetch_object();
$this->id = $id;
$this->libelle = $obj->libelle;
$db->free();
return 1;
}
else
{
return 0;
}
}
else
{
print $db->error();
return -1;
}
$this->db->free($resql);
}
else
{
$this->error=$this->db->error();
return -1;
}
}
/*
* \brief Renvoi la liste des type d'actions existant
* \param active 1 ou 0 pour un filtre sur l'etat actif ou non ('' par defaut)
* \return array tableau des types d'actions actifs
* \brief Renvoi la liste des types d'actions existant
* \param active 1 ou 0 pour un filtre sur l'etat actif ou non ('' par defaut = pas de filtre)
* \return array tableau des types d'actions actifs si ok, <0 si erreur
*/
function liste_array($active='')
{
global $langs;
$langs->load("commercial");
$ga = array();
$sql = "SELECT id, libelle FROM ".MAIN_DB_PREFIX."c_actioncomm";
$sql = "SELECT id, code, libelle";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
if ($active != '') {
$sql.=" WHERE active=$active";
}
$sql .= " ORDER BY id";
if ($this->db->query($sql) )
{
$nump = $this->db->num_rows();
if ($nump)
{
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object();
$ga[$obj->id] = $obj->libelle;
$i++;
}
}
return $ga;
}
$resql=$this->db->query($sql);
if ($resql)
{
$nump = $this->db->num_rows($resql);
if ($nump)
{
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object($resql);
$transcode=$langs->trans("Action".$obj->code);
$ga[$obj->id] = ($transcode!="Action".$obj->code?$transcode:$obj->libelle);
$i++;
}
}
$this->liste_array=$ga;
return $ga;
}
else
{
dolibarr_print_error($this->db);
}
{
return -1;
}
}
/*
* \brief Renvoie le nom d'un type d'action
* \brief Renvoie le nom sous forme d'un libellé traduit d'un type d'action
* \param id id du type d'action
* \return string libelle du type d'action
*/
function get_nom($id)
{
$sql = "SELECT libelle nom FROM ".MAIN_DB_PREFIX."c_actioncomm WHERE id='$id';";
global $langs;
$result = $this->db->query($sql);
if ($result)
if (! isset($this->type_actions[$id]))
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object($result);
return $obj->nom;
}
$this->db->free();
}
else {
dolibarr_print_error($db);
}
}
// Si valeur non disponible en cache
$sql = 'SELECT code, libelle';
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm';
$sql.= " WHERE id='".$id."'";
$result = $this->db->query($sql);
if ($result)
{
if ($this->db->num_rows($result))
{
$obj = $this->db->fetch_object($result);
$transcode=$langs->trans("Action".$obj->code);
$libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle);
$this->type_actions[$id]=$libelle; // Met en cache
return $libelle;
}
$this->db->free($result);
}
else {
dolibarr_print_error($db);
}
}
else {
// Si valeur disponible en cache
return $this->type_actions[$id];
}
}
}
?>

View File

@ -317,13 +317,11 @@ if ($socid > 0)
print "<p />";
/*
*
* Listes des actions a faire
*
*/
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre"><td colspan="8">'.$langs->trans("ActionsToDo").'</td></tr>';
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid, a.note ";
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.code as acode, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid, a.note ";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u ";
$sql .= " WHERE a.fk_soc = $societe->id ";
$sql .= " AND u.rowid = a.fk_user_author";
@ -372,12 +370,19 @@ if ($socid > 0)
print '<td width="40%">';
if ($obj->propalrowid)
{
print '<a href="../propal.php?propalid='.$obj->propalrowid.'">'.$obj->libelle.'</a>';
print '<a href="../propal.php?propalid='.$obj->propalrowid.'">';
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
print '</a>';
}
else
{
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id.'">'.img_object($langs->trans("ShowAction"),"task").' ';
print $obj->libelle.'</a>';
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
print '</a>';
}
print '</td>';
@ -422,9 +427,7 @@ if ($socid > 0)
}
/*
*
* Listes des actions effectuees
*
*/
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid, a.note ";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u ";

View File

@ -102,7 +102,10 @@ if ($resql)
{
$obj = $db->fetch_object($resql);
$var=!$var;
print "<tr $bc[$var]><td><a href=\"prospects.php?page=0&amp;stcomm=".$obj->id."\">".$obj->libelle."</a></td><td>".$obj->cc."</td></tr>";
print "<tr $bc[$var]><td><a href=\"prospects.php?page=0&amp;stcomm=".$obj->id."\">";
print img_action($langs->trans("Show"),$obj->id).' ';
print $langs->trans("StatusProspect".$obj->id);
print "</a></td><td>".$obj->cc."</td></tr>";
$i++;
}
print "</table><br>";
@ -149,7 +152,7 @@ if ($conf->propal->enabled)
*/
print '</td><td valign="top" width="70%">';
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, a.fk_user_author, s.nom as sname, s.idp";
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.code, c.libelle, a.fk_user_author, s.nom as sname, s.idp";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE c.id=a.fk_action AND a.percent < 100 AND s.idp = a.fk_soc AND a.fk_user_action = $user->id";
$sql .= " ORDER BY a.datea DESC";
@ -171,9 +174,13 @@ if ($resql)
$obj = $db->fetch_object($resql);
$var=!$var;
print "<tr $bc[$var]><td>".strftime("%d %b %Y",$obj->da)."</td>";
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id."\">".img_object($langs->trans("ShowAction"),"task").' '."$obj->libelle $obj->label</a></td>";
print '<td><a href="fiche.php?id='.$obj->idp.'">'.$obj->sname.'</a></td>';
print "<tr $bc[$var]><td>".dolibarr_print_date($obj->da)."</td>";
$transcode=$langs->trans("Action".$obj->code);
$libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle);
print '<td><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id."\">".img_object($langs->trans("ShowAction"),"task").' '.$libelle.'</a></td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$obj->idp.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->sname.'</a></td>';
$i++;
}
print "</table><br>";
@ -212,7 +219,7 @@ if ( $db->query($sql) )
print "<tr $bc[$var]><td width=\"20%\"><a href=\"../propal.php?propalid=".$obj->rowid."\">";
print img_object($langs->trans("ShowPropal"),"propal").' '.$obj->ref.'</a></td>';
print "<td width=\"30%\"><a href=\"fiche.php?id=$obj->idp\">$obj->nom</a></td>\n";
print "<td width=\"30%\"><a href=\"fiche.php?id=$obj->idp\">".img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom."</a></td>\n";
print "<td align=\"right\">";
print dolibarr_print_date($obj->dp)."</td>\n";
print "<td align=\"right\">".price($obj->price)."</td></tr>\n";

View File

@ -6,7 +6,8 @@ Customers=Customers
Prospect=Prospect
Prospects=Prospects
DeleteAction=Delete a task
AddAction=Add a task
AddAction=Add task
AddAnAction=Add a task
AddActionRendezVous=Add a Rendez-Vous task
ConfirmDeleteAction=Are you sure you want to delete this task ?
CardAction=Task card
@ -17,6 +18,7 @@ TaskRDV=Rendez-vous
TaskRDVWith=Rendez-vous with %s
ShowTask=Show task
SalesRepresentative=Sales representative
SalesRepresentatives=Sales representatives
ErrorWrongCode=Wrong code
NoSalesRepresentativeAffected=No particular sales representative affected
ShowCustomer=Show customer
@ -27,4 +29,15 @@ LastDoneTasks=Last done tasks
LastRecordedTasks=Last recorded tasks
DoneAndToDoTasksFor=Done and To do tasks for
DoneAndToDoTasks=Done and To do tasks
SendPropalRef=Send commercial proposal %s
SendPropalRef=Send commercial proposal %s
StatusActionToDo=To do
StatusActionDone=Done
StatusActionInProcess=In process
ActionAC_TEL=Phone call
ActionAC_FAX=Send fax
ActionAC_PROP=Send proposal
ActionAC_EMAIL=Send Email
ActionAC_RDV=Take a date
ActionAC_FAC=Send billing
ActionAC_REL=Send billing (reminder)
ActionAC_CLO=Clôture

View File

@ -73,6 +73,11 @@ TE_GROUP=Large company
TE_MEDIUM=Small or medium company
TE_ADMIN=Governemental
TE_OTHER=Other
StatusProspect-1=Do not contact
StatusProspect0=Never contacted
StatusProspect1=To contact
StatusProspect2=Contact in process
StatusProspect3=Contact done
ChangeDoNotContact=Change status to 'Do not contact'
ChangeNeverContacted=Change status to 'Never contacted'
ChangeToContact=Change status to 'To contact'

View File

@ -7,6 +7,7 @@ Prospect=Prospect
Prospects=Prospects
DeleteAction=Effacer une action
AddAction=Créer action
AddAnAction=Créer une action
AddActionRendezVous=Créer une action Rendez-Vous
ConfirmDeleteAction=Etes-vous sûr de vouloir effacer cet action ?
CardAction=Fiche action
@ -17,6 +18,7 @@ TaskRDV=Rendez-vous
TaskRDVWith=Rendez-vous avec %s
ShowTask=Afficher action
SalesRepresentative=Commercial
SalesRepresentatives=Commerciaux
ErrorWrongCode=Code incorrect
NoSalesRepresentativeAffected=Aucun commercial particulier affecté
ShowCustomer=Show customer
@ -27,4 +29,15 @@ LastDoneTasks=Derni
LastRecordedTasks=Dernières actions enregistrées
DoneAndToDoTasksFor=Liste des actions commerciales réalisées ou à faire pour
DoneAndToDoTasks=Liste des actions commerciales réalisées ou à faire
SendPropalRef=Envoi proposition commerciale %s
SendPropalRef=Envoi proposition commerciale %s
StatusActionToDo=A faire
StatusActionDone=Réalisé
StatusActionInProcess=En cours
ActionAC_TEL=Appel téléphonique
ActionAC_FAX=Envoi fax
ActionAC_PROP=Envoi proposition
ActionAC_EMAIL=Envoi EMail
ActionAC_RDV=Prendre Rendez-vous
ActionAC_FAC=Envoi facturation
ActionAC_REL=Relance facturation
ActionAC_CLO=Close

View File

@ -73,6 +73,11 @@ TE_GROUP=Grande soci
TE_MEDIUM=PME/PMI
TE_ADMIN=Administration
TE_OTHER=Autre
StatusProspect-1=Ne pas contacter
StatusProspect0=Jamais contacté
StatusProspect1=A contacter
StatusProspect2=Contact en cours
StatusProspect3=Contact réalisé
ChangeDoNotContact=Changer statut à 'Ne pas contacter'
ChangeNeverContacted=Changer statut à 'Jamais contacté'
ChangeToContact=Changer statut à 'A contacter'