New: Boxes contains status of record.

This commit is contained in:
Laurent Destailleur 2011-05-21 15:18:04 +00:00
parent 9f23ca6b03
commit 9155baae9b
5 changed files with 36 additions and 10 deletions

View File

@ -89,7 +89,7 @@ class box_actions extends ModeleBoxes {
$result = $db->query($sql);
if ($result)
{
$now=gmmktime();
$now=dol_now();
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
$num = $db->num_rows($result);

View File

@ -63,11 +63,14 @@ class box_clients extends ModeleBoxes {
$this->max=$max;
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedCustomers",$max));
include_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
$thirdpartystatic=new Societe($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedCustomers",$max));
if ($user->rights->societe->lire)
{
$sql = "SELECT s.nom, s.rowid as socid, s.datec, s.tms";
$sql = "SELECT s.nom, s.rowid as socid, s.datec, s.tms, s.status";
$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)";
@ -101,6 +104,9 @@ class box_clients extends ModeleBoxes {
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
'text' => dol_print_date($datem, "day"));
$this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"',
'text' => $thirdpartystatic->LibStatut($objp->status,3));
$i++;
}

View File

@ -62,11 +62,14 @@ class box_fournisseurs extends ModeleBoxes {
$this->max=$max;
include_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
$thirdpartystatic=new Societe($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedSuppliers",$max));
if ($user->rights->societe->lire)
{
$sql = "SELECT s.nom, s.rowid as socid, s.datec, s.tms";
$sql = "SELECT s.nom, s.rowid as socid, s.datec, s.tms, s.status";
$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";
@ -100,6 +103,9 @@ class box_fournisseurs extends ModeleBoxes {
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
'text' => dol_print_date($datem, "day"));
$this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"',
'text' => $thirdpartystatic->LibStatut($objp->status,3));
$i++;
}

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -19,7 +19,7 @@
*/
/**
* \file htdocs/includes/boxes/box_clients.php
* \file htdocs/includes/boxes/box_members.php
* \ingroup societes
* \brief Module de generation de l'affichage de la box clients
* \version $Id$
@ -63,13 +63,18 @@ class box_members extends ModeleBoxes {
$this->max=$max;
include_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php");
$memberstatic=new Adherent($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedMembers",$max));
if ($user->rights->societe->lire)
{
$sql = "SELECT s.rowid, s.nom, s.prenom, s.datec, s.tms";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as s";
$sql = "SELECT s.rowid, s.nom, s.prenom, s.datec, s.tms, s.statut as status, s.datefin as date_end_subscription,";
$sql.= " t.cotisation";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as s, ".MAIN_DB_PREFIX."adherent_type as t";
$sql.= " WHERE s.entity = ".$conf->entity;
$sql.= " AND s.fk_adherent_type = t.rowid";
$sql.= " ORDER BY s.tms DESC";
$sql.= $db->plimit($max, 0);
@ -97,6 +102,9 @@ class box_members extends ModeleBoxes {
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
'text' => dol_print_date($datem, "day"));
$this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"',
'text' => $memberstatic->LibStatut($objp->status,$objp->cotisation,$db->jdate($objp->date_end_subscription),3));
$i++;
}

View File

@ -67,11 +67,14 @@ class box_prospect extends ModeleBoxes {
$this->max=$max;
include_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
$thirdpartystatic=new Societe($db);
$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.datec, s.tms";
$sql = "SELECT s.nom, s.rowid as socid, s.fk_stcomm, s.datec, s.tms, s.status";
$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)";
@ -109,7 +112,10 @@ class box_prospect extends ModeleBoxes {
$this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"',
'text' => str_replace('img ','img height="14" ',$prospectstatic->LibProspStatut($objp->fk_stcomm,3)));
$i++;
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
'text' => $thirdpartystatic->LibStatut($objp->status,3));
$i++;
}
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProspects"));