diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index ed62891c119..ee0588d6f08 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -291,14 +291,14 @@ if ($_socid > 0) { $objp = $db->fetch_object(); print ""; - print "propalid\">".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."\n"; + print "propalid\">".img_object($langs->trans("ShowPropal"),"propal")." ".$objp->ref."\n"; if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 ) { print " > 15 jours"; } - print "".strftime("%d %B %Y",$objp->dp)."\n"; - print ''.price($objp->price).''; - print ''.$objp->statut.''; + print "".dolibarr_print_date($objp->dp)."\n"; + print ''.price($objp->price).''; + print ''.$objp->statut.''; $var=!$var; $i++; } @@ -344,7 +344,7 @@ if ($_socid > 0) { print " > 15 jours"; } - print "".strftime("%d %B %Y",$objp->dp)."\n"; + print "".dolibarr_print_date($objp->dp)."\n"; print ''.price($objp->total_ht).''; print ''.$objp->statut.''; $i++; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index eeae20e86ea..6371d8e3efe 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -91,11 +91,11 @@ print ''; */ if ($conf->propal->enabled && $user->rights->propale->lire) { $var=false; - print '
'; + print ''; print ''; print ''; print ''; + print $langs->trans("Ref").' :  '; print "
'.$langs->trans("SearchAProposal").'
'; - print $langs->trans("Ref").' :  

\n"; } @@ -108,7 +108,7 @@ if ($conf->contrat->enabled) { print ''; print ''; print ''; + print $langs->trans("Ref").' :  '; print "
'.$langs->trans("SearchAContract").'
'; - print $langs->trans("Ref").' :  

\n"; } @@ -404,7 +404,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) { while ($i < $num) { $obj = $db->fetch_object($result); - print "propalid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref.""; + print "propalid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref.""; print "idp\">".img_object($langs->trans("ShowCompany"),"company")." ".$obj->nom."\n"; print ""; print strftime("%d %b %Y",$obj->dp)."\n"; @@ -452,7 +452,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) { { $objp = $db->fetch_object(); print ""; - print ''; + print ''; print ''.img_file().''; print ' '.$objp->ref.''; print "idp\">$objp->nom\n"; diff --git a/htdocs/comm/pre.inc.php b/htdocs/comm/pre.inc.php index da0d12160a8..0bcbab44571 100644 --- a/htdocs/comm/pre.inc.php +++ b/htdocs/comm/pre.inc.php @@ -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) { diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index a24e18f2477..05b19e4a87a 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur + * Copyright (C) 2004-2005 Laurent Destailleur * * 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 ''; @@ -56,35 +69,38 @@ print '"; print "'; + print ''; print "\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 ""; $sts = array(-1,0,1,2); + print ''; - } - else - { - print ''; + print ''; + print img_action(0,$value); + print ' '; } } + print ''; print "\n"; $i++; diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index b9c69069eec..e3cbb36a6cd 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -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 \ No newline at end of file +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 \ No newline at end of file diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang index a34eebe6ef7..31749c874b0 100644 --- a/htdocs/langs/en_US/trips.lang +++ b/htdocs/langs/en_US/trips.lang @@ -1,3 +1,4 @@ # Dolibarr language file - en_US - trips Trip=Trip Trips=Trips +AddTrip=Add trip \ No newline at end of file diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index 99c6b881dd4..58fa85ec9de 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -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 \ No newline at end of file +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 \ No newline at end of file diff --git a/htdocs/langs/fr_FR/trips.lang b/htdocs/langs/fr_FR/trips.lang index c5b56c5ee7e..56b2d9ae7a5 100644 --- a/htdocs/langs/fr_FR/trips.lang +++ b/htdocs/langs/fr_FR/trips.lang @@ -1,3 +1,4 @@ # Dolibarr language file - fr_FR - trips Trip=Déplacement Trips=Déplacements +AddTrip=Ajouter déplacement
'; if ($conf->propal->enabled) { - print '
'; - print ''; + print ''; + print '
'; print ''; print "'; + print $langs->trans("Ref").' :  '; print "
'.$langs->trans("SearchAProposal").'
"; - print $langs->trans("Ref").' :

\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 ''; + print '
'; print ''; - print ''; + print ''; while ($i < $num) { - $obj = $db->fetch_object(); + $obj = $db->fetch_object($resql); $var=!$var; print ""; $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 '
Prospects par statut
'.$langs->trans("ProspectsByStatus").'
id."\">".$obj->libelle."".$obj->cc."
'; - print ""; - print ""; + print '
Propositions commerciales brouillons
'; + print ""; + print ""; while ($i < $num) { - $obj = $db->fetch_object(); + $obj = $db->fetch_object($resql); $var=!$var; - print ""; + print ""; $i++; } print "
".$langs->trans("ProposalsDraft")."
rowid."\">".$obj->ref."
"; + print "rowid."\">".img_object($langs->trans("ShowPropal"),"propal").' '.$obj->ref.""; + print "

"; } + $db->free($resql); } } + /* * Actions commerciales a faire * - * */ print '
'; @@ -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 ''; - print ''; - print ''; - print "\n"; + print '
Actions à faire
'; + print ''; + print ''; + print "\n"; $i = 0; while ($i < $num ) { - $obj = $db->fetch_object(); + $obj = $db->fetch_object($resql); $var=!$var; print ""; - print '"; + print '"; print ''; $i++; } print "
'.$langs->trans("ActionsToDo").'
".strftime("%d %b %Y",$obj->da)."$obj->libelle $obj->label".img_object($langs->trans("ShowAction"),"task").' '."$obj->libelle $obj->label'.$obj->sname.'

"; } - $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 ''; - print ''; + print '
Propositions commerciales ouvertes
'; + print ''; while ($i < $num) { $obj = $db->fetch_object(); $var=!$var; print "'; + print img_object($langs->trans("ShowPropal"),"propal").' '.$obj->ref.''; print "\n"; print "\n"; + print dolibarr_print_date($obj->dp)."\n"; print "\n"; $i++; } print "
'.$langs->trans("ProposalsOpened").'
rowid."\">"; - print img_file(); - print ' '.$obj->ref.'idp\">$obj->nom"; - print strftime("%d %B %Y",$obj->dp)."".price($obj->price)."

"; } } + /* * 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 ''; - print ''; + print '
Sociétés à contacter
'; + print ''; while ($i < $num) { $obj = $db->fetch_object(); $var=!$var; - print "'; + print "'; $i++; } print "
'.$langs->trans("ProspectToContact").'
rowid."\">"; - print img_file(); - print ' '.$obj->nom.'
idp."\">"; + print img_object($langs->trans("ShowContact"),"contact"); + print ' '.$obj->nom.'

"; diff --git a/htdocs/comm/prospect/prospects.php b/htdocs/comm/prospect/prospects.php index 5fd83a938b2..eabf4b53979 100644 --- a/htdocs/comm/prospect/prospects.php +++ b/htdocs/comm/prospect/prospects.php @@ -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 ''; print '
'; - print ''; + print ''; print ""; - print '  
".dolibarr_print_date($obj->datec)."'; foreach ($sts as $key => $value) { if ($value <> $obj->fk_stcomm) { - print ''; - print ''.$alt.''; - print '