Qual: Mise au norme espace prospect

Trad: Traduction module commercial
Fix: Corrections diverses sur la gestion des prospects
This commit is contained in:
Laurent Destailleur 2005-04-08 19:45:41 +00:00
parent fb543f55da
commit a7abfca7ce
9 changed files with 111 additions and 79 deletions

View File

@ -291,14 +291,14 @@ if ($_socid > 0)
{
$objp = $db->fetch_object();
print "<tr $bc[$var]>";
print "<td><a href=\"propal.php?propalid=$objp->propalid\">".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."</a>\n";
print "<td nowrap><a href=\"propal.php?propalid=$objp->propalid\">".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."</a>\n";
if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 )
{
print " <b>&gt; 15 jours</b>";
}
print "</td><td align=\"right\">".strftime("%d %B %Y",$objp->dp)."</td>\n";
print '<td align="right" width="120">'.price($objp->price).'</td>';
print '<td width="100" align="center">'.$objp->statut.'</td></tr>';
print "</td><td align=\"right\">".dolibarr_print_date($objp->dp)."</td>\n";
print '<td align="right">'.price($objp->price).'</td>';
print '<td align="center">'.$objp->statut.'</td></tr>';
$var=!$var;
$i++;
}
@ -344,7 +344,7 @@ if ($_socid > 0)
{
print " <b>&gt; 15 jours</b>";
}
print "</td><td align=\"right\">".strftime("%d %B %Y",$objp->dp)."</td>\n";
print "</td><td align=\"right\">".dolibarr_print_date($objp->dp)."</td>\n";
print '<td align="right" width="120">'.price($objp->total_ht).'</td>';
print '<td align="center" width="100">'.$objp->statut.'</td></tr>';
$i++;

View File

@ -91,11 +91,11 @@ print '<tr><td valign="top" width="30%">';
*/
if ($conf->propal->enabled && $user->rights->propale->lire) {
$var=false;
print '<form method="post" action="propal.php">';
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal.php">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("SearchAProposal").'</td></tr>';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("Ref").' : <input type="text" name="sf_ref">&nbsp;<input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print $langs->trans("Ref").' : <input type="text" class="flat" name="sf_ref">&nbsp;<input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print "</table></form><br>\n";
}
@ -108,7 +108,7 @@ if ($conf->contrat->enabled) {
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("SearchAContract").'</td></tr>';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("Ref").' : <input type="text" name="search_contract">&nbsp;<input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print $langs->trans("Ref").' : <input type="text" class="flat" name="search_contract">&nbsp;<input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print "</table></form><br>\n";
}
@ -404,7 +404,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) {
while ($i < $num)
{
$obj = $db->fetch_object($result);
print "<tr $bc[$var]><td width=\"15%\"><a href=\"propal.php?propalid=".$obj->propalid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref."</a></td>";
print "<tr $bc[$var]><td width=\"15%\" nowrap><a href=\"propal.php?propalid=".$obj->propalid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref."</a></td>";
print "<td><a href=\"fiche.php?socid=$obj->idp\">".img_object($langs->trans("ShowCompany"),"company")." ".$obj->nom."</a></td>\n";
print "<td align=\"right\">";
print strftime("%d %b %Y",$obj->dp)."</td>\n";
@ -452,7 +452,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) {
{
$objp = $db->fetch_object();
print "<tr $bc[$var]>";
print '<td width="15%">';
print '<td width="15%" nowrap>';
print '<a href="propal.php?propalid='.$objp->propalid.'">'.img_file().'</a>';
print '&nbsp;<a href="propal.php?propalid='.$objp->propalid.'">'.$objp->ref.'</a></td>';
print "<td width=\"30%\"><a href=\"fiche.php?socid=$objp->idp\">$objp->nom</a></td>\n";

View File

@ -52,8 +52,9 @@ function llxHeader($head = "", $title = "")
$menu->add_submenu(DOL_URL_ROOT."/comm/contact.php?type=c", $langs->trans("Contacts"));
// Prospects
$menu->add(DOL_URL_ROOT."/comm/prospect/prospects.php", $langs->trans("Prospects"));
$menu->add(DOL_URL_ROOT."/comm/prospect/index.php", $langs->trans("Prospects"));
if ($user->rights->societe->creer)
{

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-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>
*
* 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
@ -20,15 +20,27 @@
* $Source$
*
*/
/**
\file htdocs/comm/prospect/index.php
\ingroup commercial
\brief Page acceuil de la zone prospection
\version $Revision$
*/
require("./pre.inc.php");
$langs->load("propal");
$user->getrights('propale');
if ($user->societe_id > 0)
{
$socidp = $user->societe_id;
}
llxHeader();
function valeur($sql)
@ -44,11 +56,12 @@ function valeur($sql)
}
return $valeur;
}
/*
*
*/
print_titre("Espace prospection");
print_titre($langs->trans("ProspectionArea"));
print '<table border="0" width="100%" cellspacing="0" cellpadding="4">';
@ -56,35 +69,38 @@ print '<tr><td valign="top" width="30%">';
if ($conf->propal->enabled)
{
print '<form method="post" action="propal.php">';
print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal.php">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("SearchAProposal").'</td></tr>';
print "<tr $bc[1]><td>";
print $langs->trans("Ref").' : <input type="text" name="sf_ref"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print $langs->trans("Ref").' : <input type="text" class="flat" name="sf_ref" size="16">&nbsp;<input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print "</table></form><br>\n";
}
/*
*
* Prospects par status
*
*/
$sql = "SELECT count(*) as cc, st.libelle, st.id";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st ";
$sql .= " WHERE s.fk_stcomm = st.id AND s.client=2 GROUP BY st.libelle, st.id";
$sql .= " WHERE s.fk_stcomm = st.id AND s.client=2";
$sql .= " GROUP BY st.id";
$sql .= " ORDER BY st.id";
if ( $db->query($sql) )
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows();
$num = $db->num_rows($resql);
$i = 0;
if ($num > 0 )
{
print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">Prospects par statut</td></tr>';
print '<td colspan="2">'.$langs->trans("ProspectsByStatus").'</td></tr>';
while ($i < $num)
{
$obj = $db->fetch_object();
$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>";
$i++;
@ -101,31 +117,35 @@ if ($conf->propal->enabled)
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
$sql .= " WHERE p.fk_statut = 0";
if ( $db->query($sql) )
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows();
$num = $db->num_rows($resql);
$i = 0;
if ($num > 0 )
{
print '<table border="0" cellspacing="0" cellpadding="3" width="100%">';
print "<TR class=\"liste_titre\">";
print "<td colspan=\"2\">Propositions commerciales brouillons</td></tr>";
print '<table class="noborder"" width="100%">';
print "<tr class=\"liste_titre\">";
print "<td colspan=\"2\">".$langs->trans("ProposalsDraft")."</td></tr>";
while ($i < $num)
{
$obj = $db->fetch_object();
$obj = $db->fetch_object($resql);
$var=!$var;
print "<tr $bc[$var]><td><a href=\"propal.php?propalid=".$obj->rowid."\">".$obj->ref."</a></td></tr>";
print "<tr $bc[$var]><td>";
print "<a href=\"propal.php?propalid=".$obj->rowid."\">".img_object($langs->trans("ShowPropal"),"propal").' '.$obj->ref."</a>";
print "</td></tr>";
$i++;
}
print "</table><br>";
}
$db->free($resql);
}
}
/*
* Actions commerciales a faire
*
*
*/
print '</td><td valign="top" width="70%">';
@ -134,36 +154,38 @@ $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm
$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";
if ( $db->query($sql) )
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows();
$num = $db->num_rows($resql);
if ($num > 0)
{
print '<TABLE border="0" cellspacing="0" cellpadding="3" width="100%">';
print '<TR class="liste_titre">';
print '<td colspan="4">Actions à faire</td>';
print "</TR>\n";
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="4">'.$langs->trans("ActionsToDo").'</td>';
print "</tr>\n";
$i = 0;
while ($i < $num )
{
$obj = $db->fetch_object();
$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."\">$obj->libelle $obj->label</a></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>';
$i++;
}
print "</table><br>";
}
$db->free();
$db->free($resql);
}
else
{
print $db->error();
dolibarr_print_error($db);
}
$sql = "SELECT s.nom, s.idp, p.rowid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut = 1";
if ($socidp)
@ -180,33 +202,33 @@ if ( $db->query($sql) )
$i = 0;
if ($num > 0 )
{
print '<table border="0" cellspacing="0" cellpadding="4" width="100%">';
print '<tr class="liste_titre"><td colspan="4">Propositions commerciales ouvertes</td></tr>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("ProposalsOpened").'</td></tr>';
while ($i < $num)
{
$obj = $db->fetch_object();
$var=!$var;
print "<tr $bc[$var]><td width=\"20%\"><a href=\"../propal.php?propalid=".$obj->rowid."\">";
print img_file();
print '</a>&nbsp;<a href="../propal.php?propalid='.$obj->rowid.'">'.$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 align=\"right\">";
print strftime("%d %B %Y",$obj->dp)."</td>\n";
print dolibarr_print_date($obj->dp)."</td>\n";
print "<td align=\"right\">".price($obj->price)."</td></tr>\n";
$i++;
}
print "</table><br>";
}
}
/*
* Sociétés à contacter
*
*/
$sql = "SELECT s.nom, s.idp";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE s.fk_stcomm = 1";
$sql .= " WHERE s.fk_stcomm = 1";
$sql .= " ORDER BY s.tms ASC";
$sql .= $db->plimit(15, 0);
@ -216,16 +238,16 @@ if ( $db->query($sql) )
$i = 0;
if ($num > 0 )
{
print '<table border="0" cellspacing="0" cellpadding="4" width="100%">';
print '<tr class="liste_titre"><td colspan="4">Sociétés à contacter</td></tr>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("ProspectToContact").'</td></tr>';
while ($i < $num)
{
$obj = $db->fetch_object();
$var=!$var;
print "<tr $bc[$var]><td width=\"12%\"><a href=\"../propal.php?propalid=".$obj->rowid."\">";
print img_file();
print '</a>&nbsp;<a href="fiche.php?id='.$obj->idp.'">'.$obj->nom.'</a></td></tr>';
print "<tr $bc[$var]><td width=\"12%\"><a href=\"".DOL_URL_ROOT."/comm/prospect/fiche.php?id=".$obj->idp."\">";
print img_object($langs->trans("ShowContact"),"contact");
print ' '.$obj->nom.'</a></td></tr>';
$i++;
}
print "</table><br>";

View File

@ -100,21 +100,16 @@ if ($socname)
$sortorder = "ASC";
}
if (! $sortorder)
{
$sortorder="ASC";
}
if (! $sortfield)
{
$sortfield="s.nom";
}
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="s.nom";
$sql .= " ORDER BY $sortfield $sortorder, s.nom ASC " . $db->plimit($conf->liste_limit, $offset);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows();
$num = $db->num_rows($result);
if ($num == 1 && $socname)
{
@ -148,10 +143,10 @@ if ($result)
print '<input type="text" class="flat" name="search_nom" value="'.$_GET["search_nom"].'">';
print '</td><td>';
print '<input type="text" name="search_ville" value="'.$_GET["search_ville"].'">';
print '<input type="text" class="flat" name="search_ville" value="'.$_GET["search_ville"].'">';
print "</td>";
print "<td>";
print '<input type="submit"></td><td colspan="6">&nbsp;</td>';
print '<input type="submit" class="button" value="'.$langs->trans("Search").'"></td><td colspan="3">&nbsp;</td>';
print "</tr>\n";
@ -159,7 +154,7 @@ if ($result)
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object();
$obj = $db->fetch_object($result);
$var=!$var;
@ -173,19 +168,17 @@ if ($result)
print "<td align=\"center\">".dolibarr_print_date($obj->datec)."</td>";
$sts = array(-1,0,1,2);
print '<td>';
foreach ($sts as $key => $value)
{
if ($value <> $obj->fk_stcomm)
{
print '<td><a href="prospects.php?pid='.$obj->idp.'&amp;pstcomm='.$value.'&amp;action=cstc&amp;'.$urladd.'">';
print '<img align="absmiddle" src="'.DOL_URL_ROOT.'/theme/'.MAIN_THEME.'/img/stcomm'.$value.'.png" border="0" alt="'.$alt.'">';
print '</a></td>';
}
else
{
print '<td></td>';
print '<a href="prospects.php?pid='.$obj->idp.'&amp;pstcomm='.$value.'&amp;action=cstc&amp;'.$urladd.'">';
print img_action(0,$value);
print '</a>&nbsp;';
}
}
print '</td>';
print "</tr>\n";
$i++;

View File

@ -3,13 +3,14 @@ ErrorBadEMail=EMail %s is wrong
ErrorCompanyNameAlreadyExists=Company name %s already exists. Choose another one.
ErrorPrefixAlreadyExists=Prefix %s already exists. Choose another one.
ConfirmDeleteCompany=Are you sure you want to delete this company and all inherited informations ?
MenuNewCompany=New company
MenuNewCompany=New company
MenuNewCustomer=New customer
MenuNewProspect=New prospect
MenuNewSupplier=New supplier
MenuNewProspect=New prospect
MenuNewSupplier=New supplier
MenuSocGroup=Groups
NewCompany=New company (prospect, customer, supplier)
NewSocGroup=Nouveau companies group
ProspectionArea=Prospection area
SocGroup=Group of companies
Company=Company
Companies=Companies
@ -45,7 +46,7 @@ Customer=Customer
CustomerDiscount=Customer Discount
Supplier=Supplier
CompanyList=Companies' list
AddContact=Add new contact
AddContact=Add contact
AddCompany=Add company
DeleteACompany=Delete a company
PersonalInformations=Personal data
@ -55,6 +56,7 @@ SupplierCode=Supplier code
CustomerAccount=Customer account
SupplierAccount=Supplier account
LastProspect=Last
ProspectToContact=Prospect to contact
CompanyDeleted=Company "%s" deleted from database.
ListOfContacts=List of contacts
ListOfCompanies=List of companies
@ -70,4 +72,9 @@ TE_STARTUP=Startup
TE_GROUP=Large company
TE_MEDIUM=Small or medium company
TE_ADMIN=Governemental
TE_OTHER=Other
TE_OTHER=Other
ChangeDoNotContact=Change status to 'Do not contact'
ChangeNeverContacted=Change status to 'Never contacted'
ChangeToContact=Change status to 'To contact'
ChangeContactDone=Change status to 'Contact done'
ProspectsByStatus=Prospects by status

View File

@ -1,3 +1,4 @@
# Dolibarr language file - en_US - trips
Trip=Trip
Trips=Trips
AddTrip=Add trip

View File

@ -5,11 +5,12 @@ ErrorPrefixAlreadyExists=Le prefix %s existe d
ConfirmDeleteCompany=Etes-vous sûr de vouloir supprimer cette société et toutes les informations qui en dépendent ?
MenuNewCompany=Nouvelle société
MenuNewCustomer=Nouveau client
MenuNewProspect=Nouveau prospect
MenuNewSupplier=Nouveau fournisseur
MenuNewProspect=Nouveau prospect
MenuNewSupplier=Nouveau fournisseur
MenuSocGroup=Groupes
NewCompany=Nouvelle société (prospect, client, fournisseur)
NewSocGroup=Nouveau groupement de sociétés
ProspectionArea=Espace prospection
SocGroup=Groupement de sociétés
Company=Société
Companies=Sociétés
@ -55,6 +56,7 @@ SupplierCode=Code fournisseur
CustomerAccount=Compte client
SupplierAccount=Compte fournisseur
LastProspect=Derniers
ProspectToContact=Prospect à contacter
CompanyDeleted=La société "%s" a été supprimée de la base.
ListOfContacts=Liste des contacts
ListOfCompanies=Liste des sociétés
@ -70,4 +72,9 @@ TE_STARTUP=Startup
TE_GROUP=Grande société
TE_MEDIUM=PME/PMI
TE_ADMIN=Administration
TE_OTHER=Autre
TE_OTHER=Autre
ChangeDoNotContact=Changer statut à 'Ne pas contacter'
ChangeNeverContacted=Changer statut à 'Jamais contacté'
ChangeToContact=Changer statut à 'A contacter'
ChangeContactDone=Changer statut à 'Contact réalisé
ProspectsByStatus=Prospects par statut

View File

@ -1,3 +1,4 @@
# Dolibarr language file - fr_FR - trips
Trip=Déplacement
Trips=Déplacements
AddTrip=Ajouter déplacement