diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index 3f4b7dd71ae..8898c8a6dfb 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -19,10 +19,10 @@
*/
/**
- \file htdocs/comm/index.php
- \ingroup commercial
- \brief Page acceuil de la zone commercial cliente
- \version $Id$
+ * \file htdocs/comm/index.php
+ * \ingroup commercial
+ * \brief Page acceuil de la zone commercial cliente
+ * \version $Id$
*/
require("./pre.inc.php");
@@ -84,6 +84,8 @@ if (isset($_GET["action"]) && $_GET["action"] == 'del_bookmark')
* View
*/
+$now=gmmktime();
+
$html = new Form($db);
$formfile = new FormFile($db);
$companystatic=new Societe($db);
@@ -253,28 +255,89 @@ if ($conf->commande->enabled && $user->rights->commande->lire)
print '
';
+
+$NBMAX=3;
+$max=3;
+
+
/*
- * Actions to do
+ * Last modified proposals
*/
-if ($user->rights->agenda->myactions->read)
+
+if ($conf->propal->enabled && $user->rights->propale->lire)
{
- show_array_actions_to_do(10);
+
+ $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total_ht, p.ref, p.fk_statut, ".$db->pdate("p.datep")." as dp";
+ if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
+ $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
+ if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ $sql .= " WHERE p.fk_soc = s.rowid";
+ //$sql .= " AND p.fk_statut > 1";
+ if ($socid)
+ {
+ $sql .= " AND s.rowid = ".$socid;
+ }
+ if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
+ $sql .= " ORDER BY p.datec DESC";
+ $sql .= $db->plimit($NBMAX, 0);
+
+ if ( $db->query($sql) )
+ {
+ $num = $db->num_rows();
+
+ $i = 0;
+ print '';
+ print '| '.$langs->trans("LastModifiedProposals",$NBMAX).' | ';
+ $var=False;
+ while ($i < $num)
+ {
+ $objp = $db->fetch_object();
+ print "";
+
+ // Ref
+ print '';
+
+ $propalstatic->id=$objp->propalid;
+ $propalstatic->ref=$objp->ref;
+
+ print '';
+ print '| ';
+ print $propalstatic->getNomUrl(1);
+ print ' | ';
+ print '';
+ if (($objp->fk_statut <= 1) && $objp->dp < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
+ print ' | ';
+ print '';
+ $filename=sanitizeFileName($objp->ref);
+ $filedir=$conf->propal->dir_output . '/' . sanitizeFileName($objp->ref);
+ $urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
+ $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
+ print ' | ';
+
+ print ' | ';
+
+ print ''.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).' | ';
+ print "";
+ print dol_print_date($objp->dp,'day')." | \n";
+ print "".price($objp->total_ht)." | \n";
+ print "".$propalstatic->LibStatut($objp->fk_statut,3)." | \n";
+ print " \n";
+ $i++;
+ $var=!$var;
+
+ }
+
+ print " ";
+ $db->free();
+ }
}
/*
- * Last actions
- */
-if ($user->rights->agenda->myactions->read)
-{
- show_array_last_actions_done($max);
-}
-
-/*
- * Derniers clients enregistres
+ * Last modified prospects
*/
if ($user->rights->societe->lire)
{
- $sql = "SELECT s.rowid,s.nom,s.client,".$db->pdate("datec")." as datec";
+ $sql = "SELECT s.rowid,s.nom,s.client,s.tms";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -287,7 +350,7 @@ if ($user->rights->societe->lire)
{
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
}
- $sql .= " ORDER BY s.datec DESC";
+ $sql .= " ORDER BY s.tms DESC";
$sql .= $db->plimit($max, 0);
$resql = $db->query($sql);
@@ -315,7 +378,7 @@ if ($user->rights->societe->lire)
if ($objp->client == 1) print $langs->trans("Customer");
if ($objp->client == 2) print $langs->trans("Prospect");
print " | ";
- print ''.dol_print_date($objp->datec,'day')." | ";
+ print ''.dol_print_date($db->jdate($objp->tms),'day')." | ";
print '';
$i++;
$var=!$var;
@@ -329,6 +392,24 @@ if ($user->rights->societe->lire)
}
+/*
+ * Last actions
+ */
+if ($user->rights->agenda->myactions->read)
+{
+ show_array_last_actions_done($max);
+}
+
+
+/*
+ * Actions to do
+ */
+if ($user->rights->agenda->myactions->read)
+{
+ show_array_actions_to_do(10);
+}
+
+
/*
* Derniers contrats
*
@@ -359,23 +440,23 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // \todo A REF
if ($num > 0)
{
- print '
";
}
}
else
@@ -392,8 +473,6 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
{
$langs->load("propal");
- $now=gmmktime();
-
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, ".$db->pdate("p.datep")." as dp";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
@@ -464,78 +543,6 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
}
}
-/*
- * Last closed proposals
- */
-
-if ($conf->propal->enabled && $user->rights->propale->lire)
-{
- $NBMAX=5;
-
- $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total_ht, p.ref, p.fk_statut, ".$db->pdate("p.datep")." as dp";
- if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
- $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
- if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
- $sql .= " WHERE p.fk_soc = s.rowid AND p.fk_statut > 1";
- if ($socid)
- {
- $sql .= " AND s.rowid = ".$socid;
- }
- if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
- $sql .= " ORDER BY p.rowid DESC";
- $sql .= $db->plimit($NBMAX, 0);
-
- if ( $db->query($sql) )
- {
- $num = $db->num_rows();
-
- $i = 0;
- print '';
- print '| '.$langs->trans("LastClosedProposals",$NBMAX).' |
';
- $var=False;
- while ($i < $num)
- {
- $objp = $db->fetch_object();
- print "";
-
- // Ref
- print '';
-
- $propalstatic->id=$objp->propalid;
- $propalstatic->ref=$objp->ref;
-
- print '';
- print '| ';
- print $propalstatic->getNomUrl(1);
- print ' | ';
- print '';
- print ' ';
- print ' | ';
- print '';
- $filename=sanitizeFileName($objp->ref);
- $filedir=$conf->propal->dir_output . '/' . sanitizeFileName($objp->ref);
- $urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
- $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
- print ' | ';
-
- print ' | ';
-
- print ''.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).' | ';
- print "";
- print dol_print_date($objp->dp,'day')." | \n";
- print "".price($objp->total_ht)." | \n";
- print "".$propalstatic->LibStatut($objp->fk_statut,3)." | \n";
- print "
\n";
- $i++;
- $var=!$var;
-
- }
-
- print "
";
- $db->free();
- }
-}
-
print '';
print '';
diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang
index bac546ea53f..9515709c945 100644
--- a/htdocs/langs/en_US/boxes.lang
+++ b/htdocs/langs/en_US/boxes.lang
@@ -25,7 +25,7 @@ BoxTitleLastProducts=Last %s modified products/services
BoxTitleLastCustomerOrders=Last %s modified customer orders
BoxTitleLastSuppliers=Last %s recorded suppliers
BoxTitleLastCustomers=Last %s recorded customers
-BoxTitleLastCustomersOrProspects=Last %s recorded customers or prospects
+BoxTitleLastCustomersOrProspects=Last %s modified customers or prospects
BoxTitleLastPropals=Last %s recorded proposals
BoxTitleLastCustomerBills=Last %s customer's invoices
BoxTitleLastSupplierBills=Last %s supplier's invoices
diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang
index 357a5982cc8..95804979f6f 100644
--- a/htdocs/langs/en_US/propal.lang
+++ b/htdocs/langs/en_US/propal.lang
@@ -21,6 +21,7 @@ ConfirmDeleteProp=Are you sure you want to delete this commercial proposal ?
ConfirmValidateProp=Are you sure you want to validate this commercial proposal ?
LastPropals=Last %s proposals
LastClosedProposals=Last %s closed proposals
+LastModifiedProposals=Last %s modified proposals
AllPropals=All proposals
LastProposals=Last proposals
SearchAProposal=Search a proposal
diff --git a/htdocs/langs/fr_FR/boxes.lang b/htdocs/langs/fr_FR/boxes.lang
index d3d0093da1a..6e1f4a7a223 100644
--- a/htdocs/langs/fr_FR/boxes.lang
+++ b/htdocs/langs/fr_FR/boxes.lang
@@ -25,7 +25,7 @@ BoxTitleLastProducts=Les %s derniers produits/services enregistrés
BoxTitleLastCustomerOrders=Les %s dernières commandes clients modifiées
BoxTitleLastSuppliers=Les %s derniers fournisseurs modifiées
BoxTitleLastCustomers=Les %s derniers clients modifiées
-BoxTitleLastCustomersOrProspects=Les %s derniers clients ou prospects enregistrés
+BoxTitleLastCustomersOrProspects=Les %s derniers clients ou prospects modifiés
BoxTitleLastPropals=Les %s dernières propositions enregistrés
BoxTitleLastCustomerBills=Les %s dernières factures clients enregistrées
BoxTitleLastSupplierBills=Les %s dernières factures fournisseurs enregistrées
diff --git a/htdocs/langs/fr_FR/propal.lang b/htdocs/langs/fr_FR/propal.lang
index 0b4fc5ece26..d075ae4563f 100644
--- a/htdocs/langs/fr_FR/propal.lang
+++ b/htdocs/langs/fr_FR/propal.lang
@@ -21,6 +21,7 @@ ConfirmDeleteProp=Êtes-vous sûr de vouloir effacer cette proposition commercia
ConfirmValidateProp=Êtes-vous sûr de vouloir valider cette proposition commerciale ?
LastPropals=Les %s dernières propales
LastClosedProposals=Les %s dernières propositions commerciales fermées
+LastModifiedProposals=Les %s dernières propositions commerciales modifiées
AllPropals=Toutes les propales
LastProposals=Dernières propositions
SearchAProposal=Rechercher une propale