Fix bug #30384
This commit is contained in:
parent
478c3a5b5c
commit
8c1cf894d0
@ -286,12 +286,13 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||
//$sql.= " AND p.fk_statut > 1";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
$sql.= " ORDER BY p.datec DESC";
|
||||
$sql.= " ORDER BY p.datep DESC";
|
||||
$sql.= $db->plimit($NBMAX, 0);
|
||||
|
||||
if ( $db->query($sql) )
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$i = 0;
|
||||
print '<table class="noborder" width="100%">';
|
||||
@ -299,7 +300,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||
$var=False;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object();
|
||||
$objp = $db->fetch_object($resql);
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
// Ref
|
||||
@ -326,17 +327,20 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||
|
||||
print '<td align="left"><a href="fiche.php?socid='.$objp->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
|
||||
print "<td align=\"right\">";
|
||||
print dol_print_date($objp->dp,'day')."</td>\n";
|
||||
print dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
|
||||
print "<td align=\"right\">".price($objp->total_ht)."</td>\n";
|
||||
print "<td align=\"center\" width=\"14\">".$propalstatic->LibStatut($objp->fk_statut,3)."</td>\n";
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
$var=!$var;
|
||||
|
||||
}
|
||||
|
||||
print "</table><br>";
|
||||
$db->free();
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db,'');
|
||||
}
|
||||
}
|
||||
|
||||
@ -347,7 +351,7 @@ if ($conf->societe->enabled && $user->rights->societe->lire)
|
||||
{
|
||||
$langs->load("boxes");
|
||||
|
||||
$sql = "SELECT s.rowid,s.nom,s.client,s.tms";
|
||||
$sql = "SELECT s.rowid,s.nom,s.client,s.datec,s.tms";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.client IN (1, 2, 3)";
|
||||
@ -407,7 +411,7 @@ if ($conf->fournisseur->enabled && $user->rights->societe->lire)
|
||||
{
|
||||
$langs->load("boxes");
|
||||
|
||||
$sql = "SELECT s.nom, s.rowid, s.datec as dc";
|
||||
$sql = "SELECT s.nom, s.rowid, s.datec as dc, s.tms as dm";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.fournisseur = 1";
|
||||
@ -425,7 +429,7 @@ if ($conf->fournisseur->enabled && $user->rights->societe->lire)
|
||||
$i = 0;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("BoxTitleLastSuppliers",min($max,$num)).'</td>';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("BoxTitleLastModifiedSuppliers",min($max,$num)).'</td>';
|
||||
print '<td align="right">'.$langs->trans("DateModificationShort").'</td>';
|
||||
print '</tr>';
|
||||
if ($num)
|
||||
@ -438,7 +442,7 @@ if ($conf->fournisseur->enabled && $user->rights->societe->lire)
|
||||
$company->nom=$objp->nom;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td nowrap="nowrap">'.$company->getNomUrl(1,'supplier',48).'</td>';
|
||||
print '<td align="right">'.dol_print_date($db->jdate($objp->dc),'day').'</td>';
|
||||
print '<td align="right">'.dol_print_date($db->jdate($objp->dm),'day').'</td>';
|
||||
print '</tr>';
|
||||
$var=!$var;
|
||||
$i++;
|
||||
|
||||
@ -470,18 +470,17 @@ if ($conf->societe->enabled && $user->rights->societe->lire)
|
||||
|
||||
$langs->load("boxes");
|
||||
|
||||
$sql = "SELECT s.nom, s.rowid, s.datec as dc";
|
||||
$sql = "SELECT s.nom, s.rowid, s.datec as dc, s.tms as dm";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.client IN (1, 3)";
|
||||
$sql.= " AND s.entity = ".$conf->entity;
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
$sql.= " ORDER BY s.datec DESC ";
|
||||
$sql.= $db->order("s.tms","DESC");
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
$var=false;
|
||||
@ -490,7 +489,7 @@ if ($conf->societe->enabled && $user->rights->societe->lire)
|
||||
$i = 0;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("BoxTitleLastCustomers",min($max,$num)).'</td>';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("BoxTitleLastModifiedCustomers",min($max,$num)).'</td>';
|
||||
print '<td align="right">'.$langs->trans("DateModificationShort").'</td>';
|
||||
print '</tr>';
|
||||
if ($num)
|
||||
@ -508,7 +507,7 @@ if ($conf->societe->enabled && $user->rights->societe->lire)
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$customerstatic->getNomUrl(1).'</td>';
|
||||
print '<td align="right">'.dol_print_date($db->jdate($objp->dc),'day').'</td>';
|
||||
print '<td align="right">'.dol_print_date($db->jdate($objp->dm),'day').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$i++;
|
||||
@ -529,14 +528,14 @@ if ($conf->fournisseur->enabled && $user->rights->societe->lire)
|
||||
{
|
||||
$langs->load("boxes");
|
||||
|
||||
$sql = "SELECT s.nom, s.rowid, s.datec as dc";
|
||||
$sql = "SELECT s.nom, s.rowid, s.datec as dc, s.tms as dm";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.fournisseur = 1";
|
||||
$sql.= " AND s.entity = ".$conf->entity;
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
$sql.= $db->order("s.datec","DESC");
|
||||
$sql.= $db->order("s.tms","DESC");
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
@ -548,7 +547,7 @@ if ($conf->fournisseur->enabled && $user->rights->societe->lire)
|
||||
$i = 0;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("BoxTitleLastSuppliers",min($max,$num)).'</td>';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("BoxTitleLastModifiedSuppliers",min($max,$num)).'</td>';
|
||||
print '<td align="right">'.$langs->trans("DateModificationShort").'</td>';
|
||||
print '</tr>';
|
||||
if ($num)
|
||||
@ -563,7 +562,7 @@ if ($conf->fournisseur->enabled && $user->rights->societe->lire)
|
||||
$customerstatic->nom=$objp->nom;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$customerstatic->getNomUrl(1).'</td>';
|
||||
print '<td align="right">'.dol_print_date($db->jdate($objp->dc),'day').'</td>';
|
||||
print '<td align="right">'.dol_print_date($db->jdate($objp->dm),'day').'</td>';
|
||||
print '</tr>';
|
||||
$var=!$var;
|
||||
$i++;
|
||||
|
||||
@ -49,7 +49,7 @@ class box_clients extends ModeleBoxes {
|
||||
global $langs;
|
||||
$langs->load("boxes");
|
||||
|
||||
$this->boxlabel=$langs->trans("BoxLastCustomers");
|
||||
$this->boxlabel=$langs->trans("BoxLastModifiedCustomers");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -63,18 +63,18 @@ class box_clients extends ModeleBoxes {
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastCustomers",$max));
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedCustomers",$max));
|
||||
|
||||
if ($user->rights->societe->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom, s.rowid as socid, s.tms";
|
||||
$sql = "SELECT s.nom, s.rowid as socid, s.datec, s.tms";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.client IN (1, 3)";
|
||||
$sql.= " AND s.entity = ".$conf->entity;
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($user->societe_id) $sql.= " AND s.rowid = $user->societe_id";
|
||||
$sql.= " ORDER BY s.datec DESC";
|
||||
$sql.= " ORDER BY s.tms DESC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
@ -87,7 +87,8 @@ class box_clients extends ModeleBoxes {
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$datem=$objp->tms;
|
||||
$datec=$db->jdate($objp->datec);
|
||||
$datem=$db->jdate($objp->tms);
|
||||
|
||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||
'logo' => $this->boximg,
|
||||
|
||||
@ -62,18 +62,18 @@ class box_fournisseurs extends ModeleBoxes {
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastSuppliers",$max));
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedSuppliers",$max));
|
||||
|
||||
if ($user->rights->societe->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom, s.rowid as socid, s.tms";
|
||||
$sql = "SELECT s.nom, s.rowid as socid, s.datec, s.tms";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.fournisseur = 1";
|
||||
$sql.= " AND s.entity = ".$conf->entity;
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
$sql.= " ORDER BY s.datec DESC ";
|
||||
$sql.= " ORDER BY s.tms DESC ";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
$result = $db->query($sql);
|
||||
@ -86,7 +86,8 @@ class box_fournisseurs extends ModeleBoxes {
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$datem=$objp->tms;
|
||||
$datec=$db->jdate($objp->datec);
|
||||
$datem=$db->jdate($objp->tms);
|
||||
|
||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||
'logo' => $this->boximg,
|
||||
|
||||
@ -67,18 +67,18 @@ class box_prospect extends ModeleBoxes {
|
||||
|
||||
$this->max=$max;
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastProspects",$max));
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedProspects",$max));
|
||||
|
||||
if ($user->rights->societe->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom, s.rowid as socid, s.fk_stcomm, s.tms";
|
||||
$sql = "SELECT s.nom, s.rowid as socid, s.fk_stcomm, s.datec, s.tms";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.client IN (2, 3)";
|
||||
$sql.= " AND s.entity = ".$conf->entity;
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
|
||||
$sql.= " ORDER BY s.datec DESC";
|
||||
$sql.= " ORDER BY s.tms DESC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
dol_syslog("box_prospect::loadBox sql=".$sql,LOG_DEBUG);
|
||||
@ -92,7 +92,8 @@ class box_prospect extends ModeleBoxes {
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$datem=$objp->tms;
|
||||
$datec=$db->jdate($objp->datec);
|
||||
$datem=$db->jdate($objp->tms);
|
||||
|
||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||
'logo' => $this->boximg,
|
||||
|
||||
@ -33,6 +33,7 @@ BoxTitleLastPropals=Last %s recorded proposals
|
||||
BoxTitleLastCustomerBills=Last %s customer's invoices
|
||||
BoxTitleLastSupplierBills=Last %s supplier's invoices
|
||||
BoxTitleLastProspects=Last %s recorded prospects
|
||||
BoxTitleLastModifiedProspects=Last %s modified prospects
|
||||
BoxTitleLastProductsInContract=Last %s products/services in a contract
|
||||
BoxTitleOldestUnpaidCustomerBills=Oldest %s unpaid customer's invoices
|
||||
BoxTitleOldestUnpaidSupplierBills=Oldest %s unpaid supplier's invoices
|
||||
|
||||
@ -33,6 +33,7 @@ BoxTitleLastPropals=Les %s dernières propositions enregistrées
|
||||
BoxTitleLastCustomerBills=Les %s dernières factures clients modifiées
|
||||
BoxTitleLastSupplierBills=Les %s dernières factures fournisseurs modifiées
|
||||
BoxTitleLastProspects=Les %s derniers prospects enregistrés
|
||||
BoxTitleLastModifiedProspects=Les %s derniers prospects modifiés
|
||||
BoxTitleLastProductsInContract=Les %s derniers produits/services contractés
|
||||
BoxTitleOldestUnpaidCustomerBills=Les %s plus anciennes factures clients impayées
|
||||
BoxTitleOldestUnpaidSupplierBills=Les %s plus anciennes factures fournisseurs impayées
|
||||
|
||||
Loading…
Reference in New Issue
Block a user