Trad: Traduction des statuts de prospect et des libellés 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 <?php
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* 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$ * $Id$
* $Source$ * $Source$
@ -39,6 +39,7 @@ class ActionComm
var $db; var $db;
var $date; var $date;
var $type_code;
var $type; var $type;
var $priority; var $priority;
var $user; var $user;
@ -131,17 +132,24 @@ class ActionComm
*/ */
function fetch($id) 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 "; global $langs;
$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;";
if ($this->db->query($sql) ) $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;";
$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->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->libelle = $obj->label;
$this->date = $obj->da; $this->date = $obj->da;
$this->note =$obj->note; $this->note =$obj->note;
@ -152,11 +160,11 @@ class ActionComm
$this->fk_facture = $obj->fk_facture; $this->fk_facture = $obj->fk_facture;
if ($this->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 else
{ {

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* 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 * 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 * 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 \ingroup commercial
\brief Fichier de la classe des types d'actions commerciales \brief Fichier de la classe des types d'actions commerciales
\version $Revision$ \version $Revision$
@ -33,120 +34,147 @@
*/ */
class CActioncomm { class CActioncomm {
var $db;
var $id; var $id;
var $libelle; var $libelle;
var $error;
var $type_actions=array();
/** /**
* \brief Constructeur * \brief Constructeur
* \param DB Handler d'accès base de donnée * \param DB Handler d'accès base de donnée
*/ */
function CActioncomm($DB=0) function CActioncomm($DB)
{ {
$this->db = $DB; $this->db = $DB;
} }
/** /**
* \brief Charge l'objet type d'action depuis la base * \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 * \param id id du type d'action à récupérer
* \return int 1=ok, 0=aucune action, -1=erreur * \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;"; $sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."c_actioncomm WHERE id=$id;";
if ($db->query($sql) ) $resql=$this->db->query($sql);
if ($resql)
{ {
if ($db->num_rows()) if ($this->db->num_rows($resql))
{ {
$obj = $db->fetch_object(); $obj = $this->db->fetch_object($resql);
$this->id = $id; $this->id = $id;
$this->libelle = $obj->libelle; $this->libelle = $obj->libelle;
$db->free();
return 1; return 1;
} }
else else
{ {
return 0; return 0;
} }
$this->db->free($resql);
} }
else else
{ {
print $db->error(); $this->error=$this->db->error();
return -1; return -1;
} }
} }
/* /*
* \brief Renvoi la liste des type d'actions existant * \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) * \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 * \return array tableau des types d'actions actifs si ok, <0 si erreur
*/ */
function liste_array($active='') function liste_array($active='')
{ {
global $langs;
$langs->load("commercial");
$ga = array(); $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 != '') { if ($active != '') {
$sql.=" WHERE active=$active"; $sql.=" WHERE active=$active";
} }
$sql .= " ORDER BY id"; $sql .= " ORDER BY id";
if ($this->db->query($sql) ) $resql=$this->db->query($sql);
if ($resql)
{ {
$nump = $this->db->num_rows(); $nump = $this->db->num_rows($resql);
if ($nump) if ($nump)
{ {
$i = 0; $i = 0;
while ($i < $nump) while ($i < $nump)
{ {
$obj = $this->db->fetch_object(); $obj = $this->db->fetch_object($resql);
$ga[$obj->id] = $obj->libelle; $transcode=$langs->trans("Action".$obj->code);
$ga[$obj->id] = ($transcode!="Action".$obj->code?$transcode:$obj->libelle);
$i++; $i++;
} }
} }
$this->liste_array=$ga;
return $ga; return $ga;
} }
else 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 * \param id id du type d'action
* \return string libelle du type d'action * \return string libelle du type d'action
*/ */
function get_nom($id) function get_nom($id)
{ {
global $langs;
$sql = "SELECT libelle nom FROM ".MAIN_DB_PREFIX."c_actioncomm WHERE id='$id';"; if (! isset($this->type_actions[$id]))
{
// 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); $result = $this->db->query($sql);
if ($result) if ($result)
{ {
if ($this->db->num_rows()) if ($this->db->num_rows($result))
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
return $obj->nom;
$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(); $this->db->free($result);
} }
else { else {
dolibarr_print_error($db); 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 />"; print "<p />";
/* /*
*
* Listes des actions a faire * Listes des actions a faire
*
*/ */
print '<table width="100%" class="noborder">'; print '<table width="100%" class="noborder">';
print '<tr class="liste_titre"><td colspan="8">'.$langs->trans("ActionsToDo").'</td></tr>'; 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 .= " 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 .= " WHERE a.fk_soc = $societe->id ";
$sql .= " AND u.rowid = a.fk_user_author"; $sql .= " AND u.rowid = a.fk_user_author";
@ -372,12 +370,19 @@ if ($socid > 0)
print '<td width="40%">'; print '<td width="40%">';
if ($obj->propalrowid) 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 else
{ {
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id.'">'.img_object($langs->trans("ShowAction"),"task").' '; 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>'; print '</td>';
@ -422,9 +427,7 @@ if ($socid > 0)
} }
/* /*
*
* Listes des actions effectuees * 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 = "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 "; $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); $obj = $db->fetch_object($resql);
$var=!$var; $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++; $i++;
} }
print "</table><br>"; print "</table><br>";
@ -149,7 +152,7 @@ if ($conf->propal->enabled)
*/ */
print '</td><td valign="top" width="70%">'; 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 .= " 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 .= " 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"; $sql .= " ORDER BY a.datea DESC";
@ -171,9 +174,13 @@ if ($resql)
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$var=!$var; $var=!$var;
print "<tr $bc[$var]><td>".strftime("%d %b %Y",$obj->da)."</td>"; print "<tr $bc[$var]><td>".dolibarr_print_date($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>'; $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++; $i++;
} }
print "</table><br>"; 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 "<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 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 "<td align=\"right\">";
print dolibarr_print_date($obj->dp)."</td>\n"; print dolibarr_print_date($obj->dp)."</td>\n";
print "<td align=\"right\">".price($obj->price)."</td></tr>\n"; print "<td align=\"right\">".price($obj->price)."</td></tr>\n";

View File

@ -6,7 +6,8 @@ Customers=Customers
Prospect=Prospect Prospect=Prospect
Prospects=Prospects Prospects=Prospects
DeleteAction=Delete a task DeleteAction=Delete a task
AddAction=Add a task AddAction=Add task
AddAnAction=Add a task
AddActionRendezVous=Add a Rendez-Vous task AddActionRendezVous=Add a Rendez-Vous task
ConfirmDeleteAction=Are you sure you want to delete this task ? ConfirmDeleteAction=Are you sure you want to delete this task ?
CardAction=Task card CardAction=Task card
@ -17,6 +18,7 @@ TaskRDV=Rendez-vous
TaskRDVWith=Rendez-vous with %s TaskRDVWith=Rendez-vous with %s
ShowTask=Show task ShowTask=Show task
SalesRepresentative=Sales representative SalesRepresentative=Sales representative
SalesRepresentatives=Sales representatives
ErrorWrongCode=Wrong code ErrorWrongCode=Wrong code
NoSalesRepresentativeAffected=No particular sales representative affected NoSalesRepresentativeAffected=No particular sales representative affected
ShowCustomer=Show customer ShowCustomer=Show customer
@ -28,3 +30,14 @@ LastRecordedTasks=Last recorded tasks
DoneAndToDoTasksFor=Done and To do tasks for DoneAndToDoTasksFor=Done and To do tasks for
DoneAndToDoTasks=Done and To do tasks 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_MEDIUM=Small or medium company
TE_ADMIN=Governemental TE_ADMIN=Governemental
TE_OTHER=Other 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' ChangeDoNotContact=Change status to 'Do not contact'
ChangeNeverContacted=Change status to 'Never contacted' ChangeNeverContacted=Change status to 'Never contacted'
ChangeToContact=Change status to 'To contact' ChangeToContact=Change status to 'To contact'

View File

@ -7,6 +7,7 @@ Prospect=Prospect
Prospects=Prospects Prospects=Prospects
DeleteAction=Effacer une action DeleteAction=Effacer une action
AddAction=Créer action AddAction=Créer action
AddAnAction=Créer une action
AddActionRendezVous=Créer une action Rendez-Vous AddActionRendezVous=Créer une action Rendez-Vous
ConfirmDeleteAction=Etes-vous sûr de vouloir effacer cet action ? ConfirmDeleteAction=Etes-vous sûr de vouloir effacer cet action ?
CardAction=Fiche action CardAction=Fiche action
@ -17,6 +18,7 @@ TaskRDV=Rendez-vous
TaskRDVWith=Rendez-vous avec %s TaskRDVWith=Rendez-vous avec %s
ShowTask=Afficher action ShowTask=Afficher action
SalesRepresentative=Commercial SalesRepresentative=Commercial
SalesRepresentatives=Commerciaux
ErrorWrongCode=Code incorrect ErrorWrongCode=Code incorrect
NoSalesRepresentativeAffected=Aucun commercial particulier affecté NoSalesRepresentativeAffected=Aucun commercial particulier affecté
ShowCustomer=Show customer ShowCustomer=Show customer
@ -28,3 +30,14 @@ LastRecordedTasks=Derni
DoneAndToDoTasksFor=Liste des actions commerciales réalisées ou à faire pour DoneAndToDoTasksFor=Liste des actions commerciales réalisées ou à faire pour
DoneAndToDoTasks=Liste des actions commerciales réalisées ou à faire 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_MEDIUM=PME/PMI
TE_ADMIN=Administration TE_ADMIN=Administration
TE_OTHER=Autre 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' ChangeDoNotContact=Changer statut à 'Ne pas contacter'
ChangeNeverContacted=Changer statut à 'Jamais contacté' ChangeNeverContacted=Changer statut à 'Jamais contacté'
ChangeToContact=Changer statut à 'A contacter' ChangeToContact=Changer statut à 'A contacter'