Look: Logo company before each company on boxes

This commit is contained in:
Laurent Destailleur 2009-09-05 00:04:09 +00:00
parent 6fda68b62d
commit 12b909060e
8 changed files with 98 additions and 67 deletions

View File

@ -19,13 +19,12 @@
*/
/**
\file htdocs/includes/boxes/box_actions.php
\ingroup actions
\brief Module de generation de l'affichage de la box actions
\version $Id$
* \file htdocs/includes/boxes/box_actions.php
* \ingroup actions
* \brief Module de generation de l'affichage de la box actions
* \version $Id$
*/
include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php");
@ -114,17 +113,21 @@ class box_actions extends ModeleBoxes {
'text2'=> $late,
'url' => DOL_URL_ROOT."/comm/action/fiche.php?id=".$objp->id);
$this->info_box_contents[$i][2] = array('td' => 'align="left"',
'text' => dol_trunc($objp->nom,20),
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
'logo' => 'company',
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => dol_trunc($objp->nom,12),
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][4] = array('td' => 'align="left" nowrap="nowrap"',
'text' => dol_print_date($datelimite, "dayhour"));
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
$this->info_box_contents[$i][5] = array('td' => 'align="right"',
'text' => $objp->percentage. "%");
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
$this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"',
'text' => $actionstatic->LibStatut($objp->percentage,3));
$i++;

View File

@ -59,9 +59,9 @@ class box_commandes extends ModeleBoxes {
function loadBox($max=5)
{
global $user, $langs, $db, $conf;
$this->max=$max;
include_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
$commandestatic=new Commande($db);
@ -88,36 +88,40 @@ class box_commandes extends ModeleBoxes {
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
while ($i < $num)
{
$objp = $db->fetch_object($result);
$datem=$db->jdate($objp->tms);
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
'logo' => $this->boximg,
'url' => DOL_URL_ROOT."/commande/fiche.php?id=".$objp->rowid);
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' => $objp->ref,
'url' => DOL_URL_ROOT."/commande/fiche.php?id=".$objp->rowid);
$this->info_box_contents[$i][2] = array('td' => 'align="left"',
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
'logo' => 'company',
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => $objp->nom,
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
'text' => dol_print_date($datem,'day'),
);
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
'text' => $commandestatic->LibStatut($objp->fk_statut,$objp->facture,3));
$i++;
}
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedOrders"));
}
else {

View File

@ -116,16 +116,20 @@ class box_factures extends ModeleBoxes {
'text2'=> $late,
'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid);
$this->info_box_contents[$i][2] = array('td' => 'align="left"',
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
'logo' => 'company',
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => $objp->nom,
'maxlength'=>40,
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
'text' => dol_print_date($datec,'day'),
);
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3));
$i++;

View File

@ -113,17 +113,21 @@ class box_factures_fourn extends ModeleBoxes {
'text2'=> $late,
'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid);
$this->info_box_contents[$i][2] = array('td' => 'align="left"',
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
'logo' => 'company',
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => $objp->nom,
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
'text' => dol_print_date($datec,'day'));
$fac = new FactureFournisseur($db);
$fac->fetch($objp->facid);
$alreadypaid=$fac->getSommePaiement();
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3,$alreadypaid,$objp->type));
$i++;

View File

@ -110,17 +110,21 @@ class box_factures_fourn_imp extends ModeleBoxes {
'text2'=> $late,
'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid);
$this->info_box_contents[$i][2] = array('td' => 'align="left"',
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
'logo' => 'company',
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => $objp->nom,
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
'text' => dol_print_date($datelimite,'day'));
$fac = new FactureFournisseur($db);
$fac->fetch($objp->facid);
$alreadypaid=$fac->getSommePaiement();
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3,$alreadypaid,$objp->type));
$i++;

View File

@ -35,7 +35,7 @@ class box_factures_imp extends ModeleBoxes {
var $boximg="object_bill";
var $boxlabel;
var $depends = array("facture");
var $db;
var $param;
@ -61,12 +61,12 @@ class box_factures_imp extends ModeleBoxes {
function loadBox($max=5)
{
global $conf, $user, $langs, $db;
$this->max=$max;
include_once(DOL_DOCUMENT_ROOT."/facture.class.php");
$facturestatic=new Facture($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpaidCustomerBills",$max));
if ($user->rights->facture->lire)
@ -92,7 +92,7 @@ class box_factures_imp extends ModeleBoxes {
{
$num = $db->num_rows($result);
$now=gmmktime();
$i = 0;
$l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)';
@ -100,7 +100,7 @@ class box_factures_imp extends ModeleBoxes {
{
$objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->datelimite);
$late='';
if ($datelimite < ($now - $conf->facture->warning_delay)) $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));
@ -112,22 +112,26 @@ class box_factures_imp extends ModeleBoxes {
'text' => $objp->facnumber,
'text2'=> $late,
'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid);
$this->info_box_contents[$i][2] = array('td' => 'align="left"',
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
'logo' => 'company',
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => $objp->nom,
'maxlength'=>44,
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
'text' => dol_print_date($datelimite,'day'),
);
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3));
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3));
$i++;
}
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpaidCustomerBills"));
}
else

View File

@ -34,13 +34,13 @@ class box_propales extends ModeleBoxes {
var $boximg="object_propal";
var $boxlabel;
var $depends = array("propal"); // conf->propal->enabled
var $db;
var $param;
var $info_box_head = array();
var $info_box_contents = array();
/**
* \brief Constructeur de la classe
@ -49,7 +49,7 @@ class box_propales extends ModeleBoxes {
{
global $langs;
$langs->load("boxes");
$this->boxlabel=$langs->trans("BoxLastProposals");
}
@ -60,12 +60,12 @@ class box_propales extends ModeleBoxes {
function loadBox($max=5)
{
global $user, $langs, $db, $conf;
$this->max=$max;
include_once(DOL_DOCUMENT_ROOT."/propal.class.php");
$propalstatic=new Propal($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastPropals",$max));
if ($user->rights->propale->lire)
@ -81,51 +81,55 @@ class box_propales extends ModeleBoxes {
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
$sql.= " ORDER BY p.datep DESC, p.ref DESC ";
$sql.= $db->plimit($max, 0);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$now=gmmktime();
$i = 0;
while ($i < $num)
{
$objp = $db->fetch_object($result);
$datec=$db->jdate($objp->datec);
$dateterm=$db->jdate($objp->fin_validite);
$dateclose=$db->jdate($objp->date_cloture);
$late = '';
if ($objp->fk_statut == 1 && $dateterm < ($now - $conf->propal->cloture->warning_delay)) { $late = img_warning($langs->trans("Late")); }
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
'logo' => $this->boximg,
'url' => DOL_URL_ROOT."/comm/propal.php?propalid=".$objp->rowid);
$this->info_box_contents[$i][1] = array('td' => 'align="left"',
'text' => $objp->ref,
'text2'=> $late,
'url' => DOL_URL_ROOT."/comm/propal.php?propalid=".$objp->rowid);
$this->info_box_contents[$i][2] = array('td' => 'align="left"',
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
'logo' => 'company',
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => dol_trunc($objp->nom,40),
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
'text' => dol_print_date($datec,'day'));
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
'text' => $propalstatic->LibStatut($objp->fk_statut,3));
$i++;
}
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProposals"));
}
else
else
{
dol_print_error($db);
}
@ -136,7 +140,7 @@ class box_propales extends ModeleBoxes {
'text' => $langs->trans("ReadPermissionNotAllowed"));
}
}
function showBox()
{
parent::showBox($this->info_box_head, $this->info_box_contents);

View File

@ -133,15 +133,19 @@ class box_services_vendus extends ModeleBoxes {
'maxlength' => 16,
'url' => DOL_URL_ROOT."/contrat/fiche.php?id=".$objp->rowid);
$this->info_box_contents[$i][2] = array('td' => 'align="left"',
$this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
'logo' => 'company',
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
'text' => $objp->nom,
'maxlength' => 28,
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
'text' => dol_print_date($datem,'day'));
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
'text' => $contratlignestatic->LibStatut($objp->statut,3)
);