diff --git a/htdocs/boxes.php b/htdocs/boxes.php index abb4213fd3c..ca80d5c5281 100644 --- a/htdocs/boxes.php +++ b/htdocs/boxes.php @@ -64,7 +64,7 @@ class InfoBox $confuserzone='MAIN_BOXES_'.$zone; if ($user->id && $user->conf->$confuserzone) { - // Recupere liste des boites d'un user si ce dernier a sa propre liste + // Get list of boxes of a particular user (if this one has its own list) $sql = "SELECT b.rowid, b.box_id, b.position, b.box_order, b.fk_user,"; $sql.= " d.file, d.note"; $sql.= " FROM ".MAIN_DB_PREFIX."boxes as b, ".MAIN_DB_PREFIX."boxes_def as d"; @@ -73,7 +73,7 @@ class InfoBox $sql.= " AND b.fk_user = ".$user->id; $sql.= " ORDER BY b.box_order"; - dolibarr_syslog("InfoBox::listBoxes get user box list sql=$sql"); + dolibarr_syslog("InfoBox::listBoxes get user box list sql=".$sql, LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -120,7 +120,7 @@ class InfoBox $sql.= " AND b.fk_user = 0"; $sql.= " ORDER BY b.box_order"; - dolibarr_syslog("InfoBox::listBoxes get default box list sql=$sql"); + dolibarr_syslog("InfoBox::listBoxes get default box list sql=".$sql, LOG_DEBUG); $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/includes/boxes/box_actions.php b/htdocs/includes/boxes/box_actions.php index 18ae2164b47..aecbc203b7d 100644 --- a/htdocs/includes/boxes/box_actions.php +++ b/htdocs/includes/boxes/box_actions.php @@ -17,13 +17,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - - /** - \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"); @@ -31,42 +31,44 @@ include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php"); class box_actions extends ModeleBoxes { - var $boxcode="lastactions"; - var $boximg="object_action"; - var $boxlabel; - var $depends = array("agenda"); + var $boxcode="lastactions"; + var $boximg="object_action"; + var $boxlabel; + var $depends = array("agenda"); var $db; var $param; - - var $info_box_head = array(); - var $info_box_contents = array(); + + var $info_box_head = array(); + var $info_box_contents = array(); - /** - * \brief Constructeur de la classe - */ - function box_actions() - { - global $langs; - $langs->load("boxes"); + /** + * \brief Constructeur de la classe + */ + function box_actions() + { + global $langs; + $langs->load("boxes"); - $this->boxlabel=$langs->trans("BoxLastActions"); - } - - /** - * \brief Charge les donn�es en m�moire pour affichage ult�rieur - * \param $max Nombre maximum d'enregistrements � charger - */ - function loadBox($max=5) + $this->boxlabel=$langs->trans("BoxLastActions"); + } + + /** + * \brief Charge les donn�es en m�moire pour affichage ult�rieur + * \param $max Nombre maximum d'enregistrements � charger + */ + function loadBox($max=5) { global $user, $langs, $db, $conf; - + + $this->max=$max; + include_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php"); - $actionstatic=new ActionComm($db); + $actionstatic=new ActionComm($db); $this->info_box_head = array('text' => $langs->trans("BoxTitleLastActionsToDo",$max)); - + if ($user->rights->agenda->myactions->read) { $sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp , a.percent as percentage,"; @@ -86,7 +88,7 @@ class box_actions extends ModeleBoxes { } $sql.= " ORDER BY a.datec DESC"; $sql.= $db->plimit($max, 0); - + dolibarr_syslog("Box_actions::loadBox boxcode=".$boxcode." sql=".$sql); $result = $db->query($sql); if ($result) @@ -97,57 +99,37 @@ class box_actions extends ModeleBoxes { { $late = ''; $objp = $db->fetch_object($result); - + if (date("U",$objp->dp) < (time() - $conf->global->MAIN_DELAY_ACTIONS_TODO)) $late=img_warning($langs->trans("Late")); - + $label=($langs->transnoentities("Action".$objp->code)!=("Action".$objp->code) ? $langs->transnoentities("Action".$objp->code) : $objp->label); - - $this->info_box_contents[$i][0] = array('align' => 'left', - 'nowrap' => 1, + + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => ("task"), + 'url' => DOL_URL_ROOT."/comm/action/fiche.php?id=".$objp->id); + + $this->info_box_contents[$i][1] = array('td' => 'align="left" nowrap="1"', 'text' => dolibarr_trunc($label,12), 'text2'=> $late, 'url' => DOL_URL_ROOT."/comm/action/fiche.php?id=".$objp->id); - - $this->info_box_contents[$i][1] = array('align' => 'left', + + $this->info_box_contents[$i][2] = array('td' => 'align="left"', 'text' => dolibarr_trunc($objp->nom,20), 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid); - - $this->info_box_contents[$i][2] = array('align' => 'right', + + $this->info_box_contents[$i][3] = array('td' => 'align="left"', 'text' => dolibarr_print_date($objp->dp, "dayhour")); - - $this->info_box_contents[$i][3] = array('align' => 'right', + + $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => $objp->percentage. "%"); - - $this->info_box_contents[$i][4] = array( - 'align' => 'right', - 'text' => $actionstatic->LibStatut($objp->percentage,3)); + + $this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', + 'text' => $actionstatic->LibStatut($objp->percentage,3)); $i++; - } + } - $i=$num; - while ($i < $max) - { - if ($num==0 && $i==$num) - { - $this->info_box_contents[$i][0] = array('align' => 'center','text'=>$langs->trans("NoActionsToDo")); - $this->info_box_contents[$i][1] = array('text'=>' '); - $this->info_box_contents[$i][2] = array('text'=>' '); - $this->info_box_contents[$i][3] = array('text'=>' '); - $this->info_box_contents[$i][4] = array('text'=>' '); - $this->info_box_contents[$i][5] = array('text'=>' '); - - } else { - //$this->info_box_contents[$i][0] = array('text'=>' '); - //$this->info_box_contents[$i][1] = array('text'=>' '); - //$this->info_box_contents[$i][2] = array('text'=>' '); - //$this->info_box_contents[$i][3] = array('text'=>' '); - //$this->info_box_contents[$i][4] = array('text'=>' '); - //$this->info_box_contents[$i][5] = array('text'=>' '); - } - $i++; - } + if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoActionsToDo")); } else { dolibarr_print_error($db); @@ -158,12 +140,12 @@ class box_actions extends ModeleBoxes { 'text' => $langs->trans("ReadPermissionNotAllowed")); } } - - function showBox() - { - parent::showBox($this->info_box_head, $this->info_box_contents); - } - + + function showBox() + { + parent::showBox($this->info_box_head, $this->info_box_contents); + } + } ?> \ No newline at end of file diff --git a/htdocs/includes/boxes/box_bookmarks.php b/htdocs/includes/boxes/box_bookmarks.php index cc1b8fb8580..52093ba5a6c 100644 --- a/htdocs/includes/boxes/box_bookmarks.php +++ b/htdocs/includes/boxes/box_bookmarks.php @@ -59,7 +59,9 @@ class box_bookmarks extends ModeleBoxes { { global $user, $langs, $db; $langs->load("boxes"); - + + $this->max=$max; + $this->info_box_head = array('text' => $langs->trans("BoxMyLastBookmarks",$max), 'sublink' => DOL_URL_ROOT.'/bookmarks/liste.php'); if ($user->rights->bookmark->creer) @@ -93,29 +95,19 @@ class box_bookmarks extends ModeleBoxes { { $objp = $db->fetch_object($result); - $this->info_box_contents[$i][0] = array('align' => 'left', + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, - 'text' => stripslashes($objp->title), + 'url' => $objp->url, + 'target' => $objp->target?'newtab':''); + $this->info_box_contents[$i][1] = array('td' => 'align="left"', + 'text' => $objp->title, 'url' => $objp->url, 'target' => $objp->target?'newtab':''); $i++; } - $i=$num; - while ($i < $max) - { - if ($num==0 && $i==$num) - { - $this->info_box_contents[$i][0] = array('align' => 'center', 'url'=> DOL_URL_ROOT.'/bookmarks/liste.php', 'text'=>$langs->trans("NoRecordedBookmarks")); - $this->info_box_contents[$i][1] = array('text'=>' '); - } else { - $this->info_box_contents[$i][0] = array('text'=>' '); - $this->info_box_contents[$i][1] = array('text'=>' '); - } - $i++; - } - + if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center" colspan="2"', 'url'=> DOL_URL_ROOT.'/bookmarks/liste.php', 'text'=>$langs->trans("NoRecordedBookmarks")); } else { diff --git a/htdocs/includes/boxes/box_clients.php b/htdocs/includes/boxes/box_clients.php index 4f5759804fb..4969c3e3b25 100644 --- a/htdocs/includes/boxes/box_clients.php +++ b/htdocs/includes/boxes/box_clients.php @@ -19,120 +19,110 @@ */ /** - \file htdocs/includes/boxes/box_clients.php - \ingroup societes - \brief Module de génération de l'affichage de la box clients - \version $Id$ -*/ + \file htdocs/includes/boxes/box_clients.php + \ingroup societes + \brief Module de génération de l'affichage de la box clients + \version $Id$ + */ include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php"); class box_clients extends ModeleBoxes { - var $boxcode="lastcustomers"; - var $boximg="object_company"; - var $boxlabel; - var $depends = array("societe"); + var $boxcode="lastcustomers"; + var $boximg="object_company"; + var $boxlabel; + var $depends = array("societe"); var $db; var $param; - var $info_box_head = array(); - var $info_box_contents = array(); + var $info_box_head = array(); + var $info_box_contents = array(); - /** - * \brief Constructeur de la classe - */ - function box_clients() - { - global $langs; - $langs->load("boxes"); + /** + * \brief Constructeur de la classe + */ + function box_clients() + { + global $langs; + $langs->load("boxes"); - $this->boxlabel=$langs->trans("BoxLastCustomers"); - } + $this->boxlabel=$langs->trans("BoxLastCustomers"); + } - /** - * \brief Charge les données en mémoire pour affichage ultérieur - * \param $max Nombre maximum d'enregistrements à charger - */ - function loadBox($max=5) - { - global $user, $langs, $db; - $langs->load("boxes"); + /** + * \brief Charge les données en mémoire pour affichage ultérieur + * \param $max Nombre maximum d'enregistrements à charger + */ + function loadBox($max=5) + { + global $user, $langs, $db; + $langs->load("boxes"); - $this->info_box_head = array('text' => $langs->trans("BoxTitleLastCustomers",$max)); + $this->max=$max; + + $this->info_box_head = array('text' => $langs->trans("BoxTitleLastCustomers",$max)); - if ($user->rights->societe->lire) - { - $sql = "SELECT s.nom, s.rowid as socid, ".$db->pdate("s.datec")." as dc"; - if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; - $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 = 1"; - 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 > 0) - { - $sql .= " AND s.rowid = $user->societe_id"; - } - $sql .= " ORDER BY s.datec DESC "; - $sql .= $db->plimit($max, 0); - - $result = $db->query($sql); - - if ($result) - { - $num = $db->num_rows($result); - - $i = 0; - //$customerstatic=new Client($db); - while ($i < $num) - { - $objp = $db->fetch_object($result); - - $this->info_box_contents[$i][0] = array('align' => 'left', + if ($user->rights->societe->lire) + { + $sql = "SELECT s.nom, s.rowid as socid, ".$db->pdate("s.datec")." as dc"; + if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; + $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 = 1"; + 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 > 0) + { + $sql .= " AND s.rowid = $user->societe_id"; + } + $sql .= " ORDER BY s.datec DESC "; + $sql .= $db->plimit($max, 0); + + $result = $db->query($sql); + + if ($result) + { + $num = $db->num_rows($result); + + $i = 0; + //$customerstatic=new Client($db); + while ($i < $num) + { + $objp = $db->fetch_object($result); + + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, - 'text' => stripslashes($objp->nom), + 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid); + + $this->info_box_contents[$i][1] = array('td' => 'align="left"', + 'text' => $objp->nom, 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid); - $this->info_box_contents[$i][1] = array('align' => 'right', - 'text' => dolibarr_print_date($objp->dc, "day")); + $this->info_box_contents[$i][2] = array('td' => 'align="right"', + 'text' => dolibarr_print_date($objp->dc, "day")); - $i++; - } + $i++; + } - $i=$num; - while ($i < $max) - { - if ($num==0 && $i==$num) - { - $this->info_box_contents[$i][0] = array('align' => 'center','text'=>$langs->trans("NoRecordedCustomers")); - $this->info_box_contents[$i][1] = array('text'=>' '); - $this->info_box_contents[$i][2] = array('text'=>' '); - } else { - $this->info_box_contents[$i][0] = array('text'=>' '); - $this->info_box_contents[$i][1] = array('text'=>' '); - $this->info_box_contents[$i][2] = array('text'=>' '); - } - $i++; - } - - } - else { - dolibarr_print_error($db); - } - } - else { - $this->info_box_contents[0][0] = array('align' => 'left', + if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedCustomers")); + } + else { + dolibarr_print_error($db); + } + } + else { + $this->info_box_contents[0][0] = array('align' => 'left', 'text' => $langs->trans("ReadPermissionNotAllowed")); - } + } - } + } - function showBox() - { - parent::showBox($this->info_box_head, $this->info_box_contents); - } + function showBox() + { + parent::showBox($this->info_box_head, $this->info_box_contents); + } } diff --git a/htdocs/includes/boxes/box_commandes.php b/htdocs/includes/boxes/box_commandes.php index 621192b9f8f..0160abd7077 100644 --- a/htdocs/includes/boxes/box_commandes.php +++ b/htdocs/includes/boxes/box_commandes.php @@ -60,6 +60,8 @@ class box_commandes extends ModeleBoxes { { global $user, $langs, $db; + $this->max=$max; + include_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php"); $commandestatic=new Commande($db); @@ -95,46 +97,29 @@ class box_commandes extends ModeleBoxes { { $objp = $db->fetch_object($result); - $this->info_box_contents[$i][0] = array('align' => 'left', + $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][1] = array('align' => 'left', + $this->info_box_contents[$i][2] = array('td' => 'align="left"', 'text' => $objp->nom, 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid); - $this->info_box_contents[$i][2] = array('align' => 'right', + $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => dolibarr_print_date($objp->tms,'day'), ); - $this->info_box_contents[$i][3] = array( - 'align' => 'right', - 'width' => 18, + $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $commandestatic->LibStatut($objp->fk_statut,$objp->facturee,3)); $i++; } - $i=$num; - while ($i < $max) - { - if ($num==0 && $i==$num) - { - $this->info_box_contents[$i][0] = array('align' => 'center','text'=>$langs->trans("NoRecordedOrders")); - $this->info_box_contents[$i][1] = array('text'=>' '); - $this->info_box_contents[$i][2] = array('text'=>' '); - $this->info_box_contents[$i][3] = array('text'=>' '); - $this->info_box_contents[$i][4] = array('text'=>' '); - } else { - $this->info_box_contents[$i][0] = array('text'=>' '); - $this->info_box_contents[$i][1] = array('text'=>' '); - $this->info_box_contents[$i][2] = array('text'=>' '); - $this->info_box_contents[$i][3] = array('text'=>' '); - $this->info_box_contents[$i][4] = array('text'=>' '); - } - $i++; - } + if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedOrders")); } else { dolibarr_print_error($db); diff --git a/htdocs/includes/boxes/box_comptes.php b/htdocs/includes/boxes/box_comptes.php index 4cfabe23061..1e190d83101 100644 --- a/htdocs/includes/boxes/box_comptes.php +++ b/htdocs/includes/boxes/box_comptes.php @@ -1,6 +1,6 @@ + * Copyright (C) 2005-2008 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 @@ -61,6 +61,8 @@ class box_comptes extends ModeleBoxes { { global $user, $langs, $db, $conf; + $this->max=$max; + $this->info_box_head = array('text' => $langs->trans("BoxTitleCurrentAccounts")); if ($user->rights->banque->lire) @@ -94,22 +96,19 @@ class box_comptes extends ModeleBoxes { $solde_total += $solde; - $this->info_box_contents[$i][0] = array('align' => 'left', + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, + 'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid); + + $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $objp->label, 'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid); - /* - $this->info_box_contents[$i][1] = array('align' => 'left', - 'text' => $objp->bank - ); - */ - - $this->info_box_contents[$i][1] = array('align' => 'left', + $this->info_box_contents[$i][2] = array('td' => 'align="left"', 'text' => $objp->number ); - $this->info_box_contents[$i][2] = array('align' => 'right', + $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => price($solde).' '.$langs->trans("Currency".$objp->currency_code) ); @@ -117,17 +116,10 @@ class box_comptes extends ModeleBoxes { } // Total - $this->info_box_contents[$i][-1] = array('class' => 'liste_total'); - - $this->info_box_contents[$i][0] = array('align' => 'right', - //'width' => '75%', - 'colspan' => '3', - 'class' => 'liste_total', + $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="right" colspan="3" class="liste_total"', 'text' => $langs->trans('Total') ); - - $this->info_box_contents[$i][1] = array('align' => 'right', - 'class' => 'liste_total', + $this->info_box_contents[$i][1] = array('td' => 'align="right" class="liste_total"', 'text' => price($solde_total).' '.$langs->trans("Currency".$conf->monnaie) ); @@ -137,7 +129,7 @@ class box_comptes extends ModeleBoxes { } } else { - $this->info_box_contents[0][0] = array('align' => 'left', + $this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed")); } diff --git a/htdocs/includes/boxes/box_energie_graph.php b/htdocs/includes/boxes/box_energie_graph.php index 43d550cc979..6f01046a92b 100644 --- a/htdocs/includes/boxes/box_energie_graph.php +++ b/htdocs/includes/boxes/box_energie_graph.php @@ -30,53 +30,57 @@ class box_energie_graph extends ModeleBoxes { var $db; var $param; - + var $box_multiple = 1; - + var $info_box_head = array(); var $info_box_contents = array(); - - /** - * \brief Constructeur de la classe - */ - function box_energie_graph() - { - global $langs; - $langs->load("boxes"); - - $this->boxlabel=$langs->trans("EnergieGraph"); - } - - /** - * \brief Charge les données en mémoire pour affichage ultérieur - * \param $max Nombre maximum d'enregistrements à charger - */ - function loadBox($max=5) - { - global $user, $langs, $db; - $langs->load("boxes"); - - $text = ''.$langs->trans("Energie").''; - $this->info_box_head = array('text' => $text,$max); - + /** + * \brief Constructeur de la classe + */ + function box_energie_graph() + { + global $langs; + $langs->load("boxes"); - $file = "small-all.1.png"; - $libelle = ''; + $this->boxlabel=$langs->trans("EnergieGraph"); + } - - $this->info_box_contents[0][0] = array('align' => 'left', + /** + * \brief Charge les données en mémoire pour affichage ultérieur + * \param $max Nombre maximum d'enregistrements à charger + */ + function loadBox($max=5) + { + global $user, $langs, $db; + $langs->load("boxes"); + + $this->max=$max; + + $text = ''.$langs->trans("Energie").''; + + $this->info_box_head = array('text' => $text,$max); + + + $file = "small-all.1.png"; + $libelle = ''; + + + $this->info_box_contents[0][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, + 'url' => DOL_URL_ROOT."/energie/compteur.php?id=".$objp->rowid); + $this->info_box_contents[0][1] = array('td' => 'align="left"', 'text' => $libelle, 'url' => DOL_URL_ROOT."/energie/compteur.php?id=".$objp->rowid); - - - } - - function showBox() - { - parent::showBox($this->info_box_head, $this->info_box_contents); - } + + + } + + function showBox() + { + parent::showBox($this->info_box_head, $this->info_box_contents); + } } ?> diff --git a/htdocs/includes/boxes/box_energie_releve.php b/htdocs/includes/boxes/box_energie_releve.php index 28036980412..ff62e885d03 100644 --- a/htdocs/includes/boxes/box_energie_releve.php +++ b/htdocs/includes/boxes/box_energie_releve.php @@ -24,75 +24,80 @@ include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php"); class box_energie_releve extends ModeleBoxes { - var $boxcode="energie"; - var $boximg="object_energie"; - var $boxlabel; - var $depends = array("energie"); + var $boxcode="energie"; + var $boximg="object_energie"; + var $boxlabel; + var $depends = array("energie"); var $db; var $param; - - var $info_box_head = array(); - var $info_box_contents = array(); - /** - * \brief Constructeur de la classe - */ - function box_energie_releve() - { - global $langs; - $langs->load("boxes"); + var $info_box_head = array(); + var $info_box_contents = array(); - $this->boxlabel=$langs->trans("Energie"); - } - - /** - * \brief Charge les données en mémoire pour affichage ultérieur - * \param $max Nombre maximum d'enregistrements à charger - */ - function loadBox($max=5) - { - global $user, $langs, $db; - $langs->load("boxes"); - - $text = ''.$langs->trans("Energie").''; - - $this->info_box_head = array('text' => $text,$max); - - - $sql = "SELECT ec.libelle, ".$db->pdate("date_releve")." as date_releve, ecr.valeur, ec.rowid"; - $sql .= " FROM ".MAIN_DB_PREFIX."energie_compteur_releve as ecr"; - $sql .= " , ".MAIN_DB_PREFIX."energie_compteur as ec"; - $sql .= " WHERE ecr.fk_compteur = ec.rowid"; - $sql .= " ORDER BY ecr.date_releve DESC LIMIT 5"; - $resql = $db->query($sql); - if ($resql) + /** + * \brief Constructeur de la classe + */ + function box_energie_releve() { + global $langs; + $langs->load("boxes"); + + $this->boxlabel=$langs->trans("Energie"); + } + + /** + * \brief Charge les données en mémoire pour affichage ultérieur + * \param $max Nombre maximum d'enregistrements à charger + */ + function loadBox($max=5) + { + global $user, $langs, $db; + $langs->load("boxes"); + + $this->max=$max; + + $text = ''.$langs->trans("Energie").''; + + $this->info_box_head = array('text' => $text,$max); + + + $sql = "SELECT ec.libelle, ".$db->pdate("date_releve")." as date_releve, ecr.valeur, ec.rowid"; + $sql .= " FROM ".MAIN_DB_PREFIX."energie_compteur_releve as ecr"; + $sql .= " , ".MAIN_DB_PREFIX."energie_compteur as ec"; + $sql .= " WHERE ecr.fk_compteur = ec.rowid"; + $sql .= " ORDER BY ecr.date_releve DESC LIMIT 5"; + $resql = $db->query($sql); + if ($resql) + { $num = $db->num_rows($resql); $i = 0; $var=True; while ($i < $num) - { - $objp = $db->fetch_object($resql); - - $this->info_box_contents[$i][0] = array('align' => 'left', + { + $objp = $db->fetch_object($resql); + + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, + 'url' => DOL_URL_ROOT."/energie/compteur.php?id=".$objp->rowid); + + $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $objp->libelle, 'url' => DOL_URL_ROOT."/energie/compteur.php?id=".$objp->rowid); - - $this->info_box_contents[$i][1] = array('align' => 'left', + + $this->info_box_contents[$i][2] = array('td' => 'align="right"', 'text' => $objp->valeur); - - - $i++; - } - } - } - - function showBox() - { - parent::showBox($this->info_box_head, $this->info_box_contents); - } + + + $i++; + } + } + } + + function showBox() + { + parent::showBox($this->info_box_head, $this->info_box_contents); + } } ?> diff --git a/htdocs/includes/boxes/box_external_rss.php b/htdocs/includes/boxes/box_external_rss.php index b45e1be015b..daeac626045 100644 --- a/htdocs/includes/boxes/box_external_rss.php +++ b/htdocs/includes/boxes/box_external_rss.php @@ -66,6 +66,8 @@ class box_external_rss extends ModeleBoxes { global $user, $langs, $conf; $langs->load("boxes"); + $this->max=$max; + // On recupere numero de param de la boite ereg('^([0-9]+) ',$this->param,$reg); $site=$reg[1]; @@ -136,15 +138,20 @@ class box_external_rss extends ModeleBoxes { $title=ereg_replace("([[:alnum:]])\?([[:alnum:]])","\\1'\\2",$title); // Gère problème des apostrophes mal codée/décodée par utf8 $title=ereg_replace("^\s+","",$title); // Supprime espaces de début $this->info_box_contents["$href"]="$title"; - $this->info_box_contents[$i][0] = array('align' => 'left', + + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, + 'url' => $href, + 'target' => 'newrss'); + + $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $title, 'url' => $href, 'maxlength' => 64, 'target' => 'newrss'); - $this->info_box_contents[$i][1] = array('align' => 'right', - 'text' => $date, - 'td' => 'nowrap="1"'); + + $this->info_box_contents[$i][2] = array('td' => 'align="right" nowrap="1"', + 'text' => $date); } } diff --git a/htdocs/includes/boxes/box_factures.php b/htdocs/includes/boxes/box_factures.php index 32d3ffe363c..dcd64f2a91e 100644 --- a/htdocs/includes/boxes/box_factures.php +++ b/htdocs/includes/boxes/box_factures.php @@ -62,7 +62,9 @@ class box_factures extends ModeleBoxes { { global $user, $langs, $db; - include_once(DOL_DOCUMENT_ROOT."/facture.class.php"); + $this->max=$max; + + include_once(DOL_DOCUMENT_ROOT."/facture.class.php"); $facturestatic=new Facture($db); $text = $langs->trans("BoxTitleLastCustomerBills",$max); @@ -108,59 +110,42 @@ class box_factures extends ModeleBoxes { $late = ''; if($objp->paye == 0 && $objp->datelimite < (time() - $conf->facture->warning_delay)) { $late = img_warning(sprintf($l_due_date,dolibarr_print_date($objp->datelimite,'day')));} - $this->info_box_contents[$i][0] = array('align' => 'left', + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $picto, + 'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid); + + $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $objp->facnumber, 'text2'=> $late, 'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid); - $this->info_box_contents[$i][1] = array('align' => 'left', + $this->info_box_contents[$i][2] = array('td' => 'align="left"', 'text' => $objp->nom, 'maxlength'=>40, 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid); - $this->info_box_contents[$i][2] = array('align' => 'right', + $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => dolibarr_print_date($objp->datec,'day'), ); - $this->info_box_contents[$i][3] = array( - 'align' => 'right', - 'width' => 18, + $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3)); $i++; } - $i=$num; - while ($i < $max) - { - if ($num==0 && $i==$num) - { - $this->info_box_contents[$i][0] = array('align' => 'center','text'=>$langs->trans("NoRecordedInvoices")); - $this->info_box_contents[$i][1] = array('text'=>' '); - $this->info_box_contents[$i][2] = array('text'=>' '); - $this->info_box_contents[$i][3] = array('text'=>' '); - $this->info_box_contents[$i][4] = array('text'=>' '); - } else { - $this->info_box_contents[$i][0] = array('text'=>' '); - $this->info_box_contents[$i][1] = array('text'=>' '); - $this->info_box_contents[$i][2] = array('text'=>' '); - $this->info_box_contents[$i][3] = array('text'=>' '); - $this->info_box_contents[$i][4] = array('text'=>' '); - } - $i++; - } + if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedInvoices")); } else { - $this->info_box_contents[0][0] = array( 'align' => 'left', + $this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql)); } } else { - $this->info_box_contents[0][0] = array('align' => 'left', + $this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed")); } } diff --git a/htdocs/includes/boxes/box_factures_fourn.php b/htdocs/includes/boxes/box_factures_fourn.php index 8d76a17e26c..e216bc49cce 100644 --- a/htdocs/includes/boxes/box_factures_fourn.php +++ b/htdocs/includes/boxes/box_factures_fourn.php @@ -59,6 +59,8 @@ class box_factures_fourn extends ModeleBoxes { { global $user, $langs, $db; + $this->max=$max; + include_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php"); $facturestatic=new FactureFournisseur($db); @@ -99,54 +101,36 @@ class box_factures_fourn extends ModeleBoxes { $late = ''; if ($objp->paye == 0 && $objp->datelimite < (time() - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dolibarr_print_date($objp->datelimite,'day'))); - $this->info_box_contents[$i][0] = array('align' => 'left', + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, + 'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid); + + $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $objp->facnumber, 'text2'=> $late, 'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid); - $this->info_box_contents[$i][1] = array('align' => 'left', + $this->info_box_contents[$i][2] = array('td' => 'align="left"', 'text' => $objp->nom, 'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid); - $this->info_box_contents[$i][2] = array( - 'align' => 'right', + $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => dolibarr_print_date($objp->datec,'day')); - $this->info_box_contents[$i][3] = array( - 'align' => 'right', - 'width' => 18, + $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3)); $i++; } - $i=$num; - while ($i < $max) - { - if ($num==0 && $i==$num) - { - $this->info_box_contents[$i][0] = array('align' => 'center','text'=>$langs->trans("NoUnpayedCustomerBills")); - $this->info_box_contents[$i][1] = array('text'=>' '); - $this->info_box_contents[$i][2] = array('text'=>' '); - $this->info_box_contents[$i][3] = array('text'=>' '); - $this->info_box_contents[$i][4] = array('text'=>' '); - } else { - $this->info_box_contents[$i][0] = array('text'=>' '); - $this->info_box_contents[$i][1] = array('text'=>' '); - $this->info_box_contents[$i][2] = array('text'=>' '); - $this->info_box_contents[$i][3] = array('text'=>' '); - $this->info_box_contents[$i][4] = array('text'=>' '); - } - $i++; - } + if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpayedCustomerBills")); } else { dolibarr_print_error($db); } } else { - $this->info_box_contents[0][0] = array('align' => 'left', + $this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->transnoentities("ReadPermissionNotAllowed")); } } diff --git a/htdocs/includes/boxes/box_factures_fourn_imp.php b/htdocs/includes/boxes/box_factures_fourn_imp.php index 56a2cb47448..57028e78873 100644 --- a/htdocs/includes/boxes/box_factures_fourn_imp.php +++ b/htdocs/includes/boxes/box_factures_fourn_imp.php @@ -59,6 +59,8 @@ class box_factures_fourn_imp extends ModeleBoxes { { global $conf, $user, $langs, $db; + $this->max=$max; + include_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php"); $facturestatic=new FactureFournisseur($db); @@ -98,49 +100,36 @@ class box_factures_fourn_imp extends ModeleBoxes { $late=''; if ($objp->datelimite < (time() - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date,dolibarr_print_date($objp->datelimite,'day'))); - $this->info_box_contents[$i][0] = array('align' => 'left', + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, + 'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid); + + $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $objp->facnumber, 'text2'=> $late, 'url' => DOL_URL_ROOT."/fourn/facture/fiche.php?facid=".$objp->facid); - $this->info_box_contents[$i][1] = array('align' => 'left', + $this->info_box_contents[$i][2] = array('td' => 'align="left"', 'text' => $objp->nom, 'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid); - $this->info_box_contents[$i][2] = array('align' => 'right', + $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => dolibarr_print_date($objp->datelimite,'day')); - $this->info_box_contents[$i][3] = array( - 'align' => 'right', - 'width' => 18, + $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3)); $i++; } - $i=$num; - while ($i < $max) - { - if ($num==0 && $i==$num) - { - $this->info_box_contents[$i][0] = array('align' => 'center','text'=>$langs->trans("NoUnpayedSupplierBills")); - } else { - $this->info_box_contents[$i][0] = array('text'=>' '); - } - $this->info_box_contents[$i][1] = array('text'=>' '); - $this->info_box_contents[$i][2] = array('text'=>' '); - $this->info_box_contents[$i][3] = array('text'=>' '); - $this->info_box_contents[$i][4] = array('text'=>' '); - $i++; - } + if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpayedSupplierBills")); } else { dolibarr_print_error($db); } } else { - $this->info_box_contents[0][0] = array('align' => 'left', + $this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed")); } diff --git a/htdocs/includes/boxes/box_factures_imp.php b/htdocs/includes/boxes/box_factures_imp.php index d2b02c114ff..c029cb5763a 100644 --- a/htdocs/includes/boxes/box_factures_imp.php +++ b/htdocs/includes/boxes/box_factures_imp.php @@ -62,7 +62,10 @@ class box_factures_imp extends ModeleBoxes { { global $conf, $user, $langs, $db; - $facturestatic=new Facture($db); + $this->max=$max; + + include_once(DOL_DOCUMENT_ROOT."/facture.class.php"); + $facturestatic=new Facture($db); $this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpayedCustomerBills",$max)); @@ -100,54 +103,41 @@ class box_factures_imp extends ModeleBoxes { $late=''; if ($objp->datelimite < (time() - $conf->facture->warning_delay)) $late = img_warning(sprintf($l_due_date,dolibarr_print_date($objp->datelimite,'day'))); - $this->info_box_contents[$i][0] = array('align' => 'left', + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, + 'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid); + + $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $objp->facnumber, 'text2'=> $late, 'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid); - - $this->info_box_contents[$i][1] = array('align' => 'left', + + $this->info_box_contents[$i][2] = array('td' => 'align="left"', 'text' => $objp->nom, 'maxlength'=>44, 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid); - $this->info_box_contents[$i][2] = array('align' => 'right', + $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => dolibarr_print_date($objp->datelimite,'day'), ); - $this->info_box_contents[$i][3] = array( - 'align' => 'right', - 'width' => 18, + $this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"', 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3)); $i++; } - $i=$num; - while ($i < $max) - { - if ($num==0 && $i==$num) - { - $this->info_box_contents[$i][0] = array('align' => 'center','text'=>$langs->trans("NoUnpayedCustomerBills")); - } else { - $this->info_box_contents[$i][0] = array('text'=>' '); - } - $this->info_box_contents[$i][1] = array('text'=>' '); - $this->info_box_contents[$i][2] = array('text'=>' '); - $this->info_box_contents[$i][3] = array('text'=>' '); - $this->info_box_contents[$i][4] = array('text'=>' '); - $i++; - } + if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpayedCustomerBills")); } else { - $this->info_box_contents[0][0] = array( 'align' => 'left', + $this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql)); } } else { - $this->info_box_contents[0][0] = array('align' => 'left', + $this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed")); } } diff --git a/htdocs/includes/boxes/box_fournisseurs.php b/htdocs/includes/boxes/box_fournisseurs.php index 220b1e542fe..fee084e7dad 100644 --- a/htdocs/includes/boxes/box_fournisseurs.php +++ b/htdocs/includes/boxes/box_fournisseurs.php @@ -60,7 +60,9 @@ class box_fournisseurs extends ModeleBoxes { global $user, $langs, $db; $langs->load("boxes"); - $this->info_box_head = array('text' => $langs->trans("BoxTitleLastSuppliers",$max)); + $this->max=$max; + + $this->info_box_head = array('text' => $langs->trans("BoxTitleLastSuppliers",$max)); if ($user->rights->societe->lire) { @@ -89,40 +91,28 @@ class box_fournisseurs extends ModeleBoxes { { $objp = $db->fetch_object($result); - $this->info_box_contents[$i][0] = array('align' => 'left', + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, - 'text' => $objp->nom, 'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid); - $this->info_box_contents[$i][1] = array('align' => 'right', + $this->info_box_contents[$i][1] = array('td' => 'align="left"', + 'text' => $objp->nom, + 'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid); + + $this->info_box_contents[$i][2] = array('td' => 'align="right"', 'text' => dolibarr_print_date($objp->dc, "day")); $i++; } - $i=$num; - while ($i < $max) - { - if ($num==0 && $i==$num) - { - $this->info_box_contents[$i][0] = array('align' => 'center','text'=>$langs->trans("NoRecordedSuppliers")); - $this->info_box_contents[$i][1] = array('text'=>' '); - $this->info_box_contents[$i][2] = array('text'=>' '); - } else { - $this->info_box_contents[$i][0] = array('text'=>' '); - $this->info_box_contents[$i][1] = array('text'=>' '); - $this->info_box_contents[$i][2] = array('text'=>' '); - } - $i++; - } - + if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedSuppliers")); } else { dolibarr_print_error($db); } } else { - $this->info_box_contents[0][0] = array('align' => 'left', + $this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed")); } diff --git a/htdocs/includes/boxes/box_osc_client.php b/htdocs/includes/boxes/box_osc_client.php index fd8fe688d40..b1dc3cb66ac 100644 --- a/htdocs/includes/boxes/box_osc_client.php +++ b/htdocs/includes/boxes/box_osc_client.php @@ -60,25 +60,29 @@ class box_osc_clients extends ModeleBoxes { global $user, $langs, $db; $langs->load("boxes"); - $this->info_box_head = array('text' => $langs->trans("BoxTitleNbOfCustomers",$max)); + $this->max=$max; + + $this->info_box_head = array('text' => $langs->trans("BoxTitleNbOfCustomers",$max)); if ($user->rights->boutique->lire) { $sql = "SELECT count(*) as cus FROM ".OSC_DB_NAME.".".OSC_DB_TABLE_PREFIX."customers"; - $result = $db->query($sql); - if ($result) + $resql = $db->query($sql); + if ($resql) { - $num = $db->num_rows(); + $num = $db->num_rows($resql); $i = 0; while ($i < $num) { - $objp = $db->fetch_object($result); + $objp = $db->fetch_object($resql); - $this->info_box_contents[$i][0] = array('align' => 'center', + $this->info_box_contents[$i][0] = array('td' => 'align="center" width="16"', 'logo' => $this->boximg, + 'url' => DOL_URL_ROOT."/boutique/client/index.php"); + $this->info_box_contents[$i][1] = array('td' => 'align="center"', 'text' => $objp->cus, 'url' => DOL_URL_ROOT."/boutique/client/index.php"); $i++; @@ -89,7 +93,7 @@ class box_osc_clients extends ModeleBoxes { } } else { - $this->info_box_contents[0][0] = array('align' => 'left', + $this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed")); } diff --git a/htdocs/includes/boxes/box_produits.php b/htdocs/includes/boxes/box_produits.php index 7dd3057134d..a1e75b46322 100644 --- a/htdocs/includes/boxes/box_produits.php +++ b/htdocs/includes/boxes/box_produits.php @@ -18,11 +18,11 @@ */ /** - \file htdocs/includes/boxes/box_produits.php - \ingroup produits,services - \brief Module de g�n�ration de l'affichage de la box produits - \version $Id$ -*/ + \file htdocs/includes/boxes/box_produits.php + \ingroup produits,services + \brief Module de g�n�ration de l'affichage de la box produits + \version $Id$ + */ include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php"); include_once(DOL_DOCUMENT_ROOT."/product.class.php"); @@ -30,84 +30,89 @@ include_once(DOL_DOCUMENT_ROOT."/product.class.php"); class box_produits extends ModeleBoxes { - var $boxcode="lastproducts"; - var $boximg="object_product"; - var $boxlabel; - var $depends = array("produit"); + var $boxcode="lastproducts"; + var $boximg="object_product"; + var $boxlabel; + var $depends = array("produit"); var $db; var $param; - - var $info_box_head = array(); - var $info_box_contents = array(); + + var $info_box_head = array(); + var $info_box_contents = array(); - /** - * \brief Constructeur de la classe - */ - function box_produits() - { - global $langs; - $langs->load("boxes"); + /** + * \brief Constructeur de la classe + */ + function box_produits() + { + global $langs; + $langs->load("boxes"); - $this->boxlabel=$langs->trans("BoxLastProducts"); - } - - /** - * \brief Charge les donn�es en m�moire pour affichage ult�rieur - * \param $max Nombre maximum d'enregistrements � charger - */ - function loadBox($max=5) - { - global $user, $langs, $db, $conf; + $this->boxlabel=$langs->trans("BoxLastProducts"); + } - $productstatic=new Product($db); + /** + * \brief Charge les donn�es en m�moire pour affichage ult�rieur + * \param $max Nombre maximum d'enregistrements � charger + */ + function loadBox($max=5) + { + global $user, $langs, $db, $conf; + + $this->max=$max; - $this->info_box_head = array('text' => $langs->trans("BoxTitleLastProducts",$max)); + include_once(DOL_DOCUMENT_ROOT."/product.class.php"); + $productstatic=new Product($db); - if ($user->rights->produit->lire) - { - $sql = "SELECT p.rowid, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.envente"; - $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; - if ($conf->categorie->enabled && !$user->rights->categorie->voir) - { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid"; - $sql.= " WHERE IFNULL(c.visible,1)=1"; - } - $sql .= " ORDER BY p.datec DESC"; - $sql .= $db->plimit($max, 0); - - $result = $db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - $i = 0; - while ($i < $num) - { - $objp = $db->fetch_object($result); - - // Multilangs - if ($conf->global->MAIN_MULTILANGS) // si l'option est active - { - $sqld = "SELECT label FROM ".MAIN_DB_PREFIX."product_det"; - $sqld.= " WHERE fk_product=".$objp->rowid." AND lang='". $langs->getDefaultLang() ."'"; - $sqld.= " LIMIT 1"; + $this->info_box_head = array('text' => $langs->trans("BoxTitleLastProducts",$max)); - $resultd = $db->query($sqld); - if ($resultd) - { - $objtp = $db->fetch_object($resultd); - if ($objtp->label != '') $objp->label = $objtp->label; - } - } - - $this->info_box_contents[$i][0] = array( - 'align' => 'left', + if ($user->rights->produit->lire) + { + $sql = "SELECT p.rowid, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.envente"; + $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; + if ($conf->categorie->enabled && !$user->rights->categorie->voir) + { + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid"; + $sql.= " WHERE IFNULL(c.visible,1)=1"; + } + $sql .= " ORDER BY p.datec DESC"; + $sql .= $db->plimit($max, 0); + + $result = $db->query($sql); + if ($result) + { + $num = $db->num_rows($result); + $i = 0; + while ($i < $num) + { + $objp = $db->fetch_object($result); + + // Multilangs + if ($conf->global->MAIN_MULTILANGS) // si l'option est active + { + $sqld = "SELECT label FROM ".MAIN_DB_PREFIX."product_det"; + $sqld.= " WHERE fk_product=".$objp->rowid." AND lang='". $langs->getDefaultLang() ."'"; + $sqld.= " LIMIT 1"; + + $resultd = $db->query($sqld); + if ($resultd) + { + $objtp = $db->fetch_object($resultd); + if ($objtp->label != '') $objp->label = $objtp->label; + } + } + + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => ($objp->fk_product_type==1?'object_service':'object_product'), + 'url' => DOL_URL_ROOT."/product/fiche.php?id=".$objp->rowid); + + $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $objp->label, 'url' => DOL_URL_ROOT."/product/fiche.php?id=".$objp->rowid); - + if ($objp->price_base_type == 'HT') { $price=price($objp->price); @@ -115,45 +120,39 @@ class box_produits extends ModeleBoxes { } else { - $price=price($objp->price_ttc); + $price=price($objp->price_ttc); $price_base_type=$langs->trans("TTC"); } - $this->info_box_contents[$i][1] = array( - 'align' => 'right', + $this->info_box_contents[$i][2] = array('td' => 'align="right"', 'text' => $price); - $this->info_box_contents[$i][2] = array( - 'align' => 'center', - 'width' => 20, + $this->info_box_contents[$i][3] = array('td' => 'align="center" width="20"', 'text' => $price_base_type); - $this->info_box_contents[$i][3] = array( - 'align' => 'right', + $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => dolibarr_print_date($objp->tms,'day')); - $this->info_box_contents[$i][4] = array( - 'align' => 'right', - 'width' => 18, + $this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', 'text' => $productstatic->LibStatut($objp->envente,3)); - $i++; - } - } - else { - dolibarr_print_error($db); - } - } - else { - $this->info_box_contents[0][0] = array('align' => 'left', + $i++; + } + } + else { + dolibarr_print_error($db); + } + } + else { + $this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed")); - } - } - - function showBox() - { - parent::showBox($this->info_box_head, $this->info_box_contents); - } - + } + } + + function showBox() + { + parent::showBox($this->info_box_head, $this->info_box_contents); + } + } ?> diff --git a/htdocs/includes/boxes/box_propales.php b/htdocs/includes/boxes/box_propales.php index 3322adad421..0186c7162a8 100644 --- a/htdocs/includes/boxes/box_propales.php +++ b/htdocs/includes/boxes/box_propales.php @@ -62,6 +62,8 @@ class box_propales extends ModeleBoxes { global $user, $langs, $db; + $this->max=$max; + include_once(DOL_DOCUMENT_ROOT."/propal.class.php"); $propalstatic=new Propal($db); @@ -96,53 +98,36 @@ class box_propales extends ModeleBoxes { { $objp = $db->fetch_object($result); - $this->info_box_contents[$i][0] = array('align' => 'left', + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, - 'text' => $objp->ref, 'url' => DOL_URL_ROOT."/comm/propal.php?propalid=".$objp->rowid); - $this->info_box_contents[$i][1] = array('align' => 'left', + $this->info_box_contents[$i][1] = array('td' => 'align="left"', + 'text' => $objp->ref, + 'url' => DOL_URL_ROOT."/comm/propal.php?propalid=".$objp->rowid); + + $this->info_box_contents[$i][2] = array('td' => 'align="left"', 'text' => dolibarr_trunc($objp->nom,40), 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid); - $this->info_box_contents[$i][2] = array( - 'align' => 'right', + $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => dolibarr_print_date($objp->datec,'day')); - $this->info_box_contents[$i][3] = array( - 'align' => 'right', - 'width' => 18, + $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $propalstatic->LibStatut($objp->fk_statut,3)); $i++; } - $i=$num; - while ($i < $max) - { - if ($num==0 && $i==$num) + if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProposals")); + } + else { - $this->info_box_contents[$i][0] = array('align' => 'center','text'=>$langs->trans("NoRecordedProposals")); - $this->info_box_contents[$i][1] = array('text'=>' '); - $this->info_box_contents[$i][2] = array('text'=>' '); - $this->info_box_contents[$i][3] = array('text'=>' '); - $this->info_box_contents[$i][4] = array('text'=>' '); - } else { - $this->info_box_contents[$i][0] = array('text'=>' '); - $this->info_box_contents[$i][1] = array('text'=>' '); - $this->info_box_contents[$i][2] = array('text'=>' '); - $this->info_box_contents[$i][3] = array('text'=>' '); - $this->info_box_contents[$i][4] = array('text'=>' '); - } - $i++; - } - } - else { dolibarr_print_error($db); } } else { - $this->info_box_contents[0][0] = array('align' => 'left', + $this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed")); } } diff --git a/htdocs/includes/boxes/box_prospect.php b/htdocs/includes/boxes/box_prospect.php index dd8d1e899fe..499cba97579 100644 --- a/htdocs/includes/boxes/box_prospect.php +++ b/htdocs/includes/boxes/box_prospect.php @@ -19,11 +19,11 @@ */ /** - \file htdocs/includes/boxes/box_prospect.php - \ingroup societe - \brief Module to generate the last prospects box. - \version $Id$ -*/ + * \file htdocs/includes/boxes/box_prospect.php + * \ingroup societe + * \brief Module to generate the last prospects box. + * \version $Id$ + */ include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php"); @@ -46,12 +46,15 @@ class box_prospect extends ModeleBoxes { /** * \brief Constructeur de la classe */ - function box_prospect() + function box_prospect($DB,$param) { global $langs; $langs->load("boxes"); - $this->boxlabel=$langs->trans("BoxLastProspects"); + $this->db=$DB; + $this->param=$param; + + $this->boxlabel=$langs->trans("BoxLastProspects"); } /** @@ -62,7 +65,9 @@ class box_prospect extends ModeleBoxes { { global $user, $langs, $db; - $this->info_box_head = array('text' => $langs->trans("BoxTitleLastProspects",$max)); + $this->max=$max; + + $this->info_box_head = array('text' => $langs->trans("BoxTitleLastProspects",$max)); if ($user->rights->societe->lire) { @@ -91,38 +96,24 @@ class box_prospect extends ModeleBoxes { { $objp = $db->fetch_object($resql); - $this->info_box_contents[$i][0] = array('align' => 'left', + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, - 'text' => stripslashes($objp->nom), 'url' => DOL_URL_ROOT."/comm/prospect/fiche.php?socid=".$objp->socid); - $this->info_box_contents[$i][1] = array('align' => 'right', + $this->info_box_contents[$i][1] = array('td' => 'align="left"', + 'text' => $objp->nom, + 'url' => DOL_URL_ROOT."/comm/prospect/fiche.php?socid=".$objp->socid); + + $this->info_box_contents[$i][2] = array('td' => 'align="right"', 'text' => dolibarr_print_date($objp->dc, "day")); - $this->info_box_contents[$i][2] = array('align' => 'right', - 'width' => 18, + $this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"', 'text' => eregi_replace('img ','img height="14px" ',$prospectstatic->LibStatut($objp->fk_stcomm,3))); $i++; } - $i=$num; - while ($i < $max) - { - if ($num==0 && $i==$num) - { - $this->info_box_contents[$i][0] = array('align' => 'center','text'=>$langs->trans("NoRecordedProspects")); - $this->info_box_contents[$i][1] = array('text'=>' '); - $this->info_box_contents[$i][2] = array('text'=>' '); - $this->info_box_contents[$i][3] = array('text'=>' '); - } else { - //$this->info_box_contents[$i][0] = array('text'=>' '); - //$this->info_box_contents[$i][1] = array('text'=>' '); - //$this->info_box_contents[$i][2] = array('text'=>' '); - //$this->info_box_contents[$i][3] = array('text'=>' '); - } - $i++; - } + if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProspects")); } else { @@ -131,7 +122,7 @@ class box_prospect extends ModeleBoxes { } else { dolibarr_syslog("box_prospect::loadBox not allowed de read this box content",LOG_ERR); - $this->info_box_contents[0][0] = array('align' => 'left', + $this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed")); } } diff --git a/htdocs/includes/boxes/box_services_vendus.php b/htdocs/includes/boxes/box_services_vendus.php index 8a505dadb8d..31057eac88a 100644 --- a/htdocs/includes/boxes/box_services_vendus.php +++ b/htdocs/includes/boxes/box_services_vendus.php @@ -60,6 +60,8 @@ class box_services_vendus extends ModeleBoxes { { global $user, $langs, $db, $conf; + $this->max=$max; + include_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php"); $contratlignestatic=new ContratLigne($db); @@ -118,34 +120,37 @@ class box_services_vendus extends ModeleBoxes { } } - $this->info_box_contents[$i][0] = array('align' => 'left', + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => ($objp->fk_product_type==1?'object_service':'object_product'), + 'url' => DOL_URL_ROOT."/contrat/fiche.php?id=".$objp->rowid); + + $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $objp->label, 'maxlength' => 16, 'url' => DOL_URL_ROOT."/contrat/fiche.php?id=".$objp->rowid); - - $this->info_box_contents[$i][1] = array('align' => 'left', + + $this->info_box_contents[$i][2] = array('td' => 'align="left"', 'text' => $objp->nom, 'maxlength' => 40, 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid); - $this->info_box_contents[$i][2] = array('align' => 'right', + $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => dolibarr_print_date($objp->datem,'day')); - $this->info_box_contents[$i][3] = array('align' => 'right', - 'text' => $contratlignestatic->LibStatut($objp->statut,3), - 'width' => 18 + $this->info_box_contents[$i][4] = array('td' => 'align="right width="18"', + 'text' => $contratlignestatic->LibStatut($objp->statut,3) ); $i++; } } - else { + else + { dolibarr_print_error($db); } } else { - $this->info_box_contents[0][0] = array('align' => 'left', + $this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed")); } diff --git a/htdocs/includes/boxes/modules_boxes.php b/htdocs/includes/boxes/modules_boxes.php index 7354a00d8df..534fc692163 100644 --- a/htdocs/includes/boxes/modules_boxes.php +++ b/htdocs/includes/boxes/modules_boxes.php @@ -31,44 +31,43 @@ */ class ModeleBoxes { - var $MAXLENGTHBOX=60; // Mettre 0 pour pas de limite - - var $db; - var $error=''; - + var $db; + var $error=''; + var $max=5; + /* - * \brief Constructeur - */ + * \brief Constructeur + */ function ModeleBoxes($DB) { $this->db=$DB; } - - - /** - \brief Renvoi le dernier message d'erreur de cr�ation de facture - */ - function error() - { - return $this->error; - } - /** - \brief Charge une ligne boxe depuis son rowid - */ - function fetch($rowid) - { + /** + * \brief Renvoi le dernier message d'erreur de creation de facture + */ + function error() + { + return $this->error; + } + + + /** + * \brief Charge une ligne boxe depuis son rowid + */ + function fetch($rowid) + { // Recupere liste des boites d'un user si ce dernier a sa propre liste $sql = "SELECT b.rowid, b.box_id, b.position, b.box_order, b.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."boxes as b"; $sql.= " WHERE b.rowid = ".$rowid; dolibarr_syslog("ModeleBoxes::fetch rowid=".$rowid); - $resql = $this->db->query($sql); - if ($resql) - { - $obj = $this->db->fetch_object($resql); + $resql = $this->db->query($sql); + if ($resql) + { + $obj = $this->db->fetch_object($resql); if ($obj) { $this->rowid=$obj->rowid; @@ -90,148 +89,146 @@ class ModeleBoxes } - /** - \brief Methode standard d'affichage des boites - \param $head tableau des caract�ristiques du titre - \param $contents tableau des lignes de contenu - */ - function showBox($head, $contents) - { - global $langs,$conf; + /** + * \brief Methode standard d'affichage des boites + * \param $head tableau des caracteristiques du titre + * \param $contents tableau des lignes de contenu + */ + function showBox($head, $contents) + { + global $langs,$conf; - $bcx[0] = 'class="box_pair"'; - $bcx[1] = 'class="box_impair"'; - $var = true; - - // Define nbcol and nblines - $nbcol=0; - if (isset($contents[0])) $nbcol=sizeof($contents[0])+1; - $nblines=sizeof($contents); + $MAXLENGTHBOX=60; // Mettre 0 pour pas de limite + $bcx[0] = 'class="box_pair"'; + $bcx[1] = 'class="box_impair"'; + $var = true; - print "\n\n\n"; + // Define nbcol and nblines of the box to show + $nbcol=0; + if (isset($contents[0])) $nbcol=sizeof($contents[0]); + $nblines=sizeof($contents); + + print "\n\n\n"; print '
'."\n"; - // Affiche titre de la boite + // Show box title if (! empty($head['text']) || ! empty($head['sublink'])) { print '
'."\n"; - print ''."\n"; - print ''; - print ' 0) { print ' colspan="'.$nbcol.'"'; } - print '>'; + print '
'."\n"; + print ''; + print ' 0) { print ' colspan="'.$nbcol.'"'; } + print '>'; if ($conf->use_javascript_ajax) { print '
'; } - if (! empty($head['text'])) + if (! empty($head['text'])) { - $s=dolibarr_trunc($head['text'],isset($head['limit'])?$head['limit']:$this->MAXLENGTHBOX); + $s=dolibarr_trunc($head['text'],isset($head['limit'])?$head['limit']:$MAXLENGTHBOX); print $s; } - if (! empty($head['sublink'])) - { - print ' '.img_picto($head['subtext'],$head['subpicto']).''; - } + if (! empty($head['sublink'])) + { + print ' '.img_picto($head['subtext'],$head['subpicto']).''; + } if ($conf->use_javascript_ajax) - { - print ''; - // The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object - print img_picto($langs->trans("MoveBox",$this->box_id),'uparrow','class="boxhandle" style="cursor:move;"'); + { + print ''; + // The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object + print img_picto($langs->trans("MoveBox",$this->box_id),'uparrow','class="boxhandle" style="cursor:move;"'); print '
'; } - print ''; - print "\n"; - print "\n"; + print ''; + print "\n"; + print "\n"; print "
\n"; } - - // Affiche chaque ligne de la boite - if ($nblines) + + // Show box lines + if ($nblines) { print ''."\n"; - for ($i=0, $n=$nblines; $i < $n; $i++) - { - if (isset($contents[$i])) - { - $var=!$var; - if (sizeof($contents[$i])) - { - if (isset($contents[$i][-1]['class'])) print ''; - else print ''; - } + // Loop on each record + for ($i=0, $n=$nblines; $i < $n; $i++) + { + if (isset($contents[$i])) + { + $var=!$var; + + // TR + if (isset($contents[$i][0]['tr'])) print ''; + else print ''; - // Affiche chaque cellule - for ($j=0, $m=isset($contents[$i][-1])?sizeof($contents[$i])-1:sizeof($contents[$i]); $j < $m; $j++) - { - $tdparam=""; - if (isset($contents[$i][$j]['align'])) $tdparam.=' align="'. $contents[$i][$j]['align'].'"'; - if (isset($contents[$i][$j]['nowrap'])) $tdparam.=' nowrap="'. $contents[$i][$j]['align'].'"'; - if (isset($contents[$i][$j]['width'])) $tdparam.=' width="'. $contents[$i][$j]['width'].'"'; - if (isset($contents[$i][$j]['colspan'])) $tdparam.=' colspan="'. $contents[$i][$j]['colspan'].'"'; - if (isset($contents[$i][$j]['class'])) $tdparam.=' class="'. $contents[$i][$j]['class'].'"'; - if (isset($contents[$i][$j]['td'])) $tdparam.=' '.$contents[$i][$j]['td']; + // Loop on each TD + $nbcolthisline=sizeof($contents[$i]); + for ($j=0; $j < $nbcolthisline; $j++) + { + // Define tdparam + $tdparam=''; + if (isset($contents[$i][$j]['td'])) $tdparam.=' '.$contents[$i][$j]['td']; - if (!$contents[$i][$j]['text']) $contents[$i][$j]['text']=""; - $texte=isset($contents[$i][$j]['text'])?$contents[$i][$j]['text']:''; - $textewithnotags=eregi_replace('<[^>]+>','',$texte); - $texte2=isset($contents[$i][$j]['text2'])?$contents[$i][$j]['text2']:''; - $texte2withnotags=eregi_replace('<[^>]+>','',$texte2); - //print "xxx $textewithnotags y"; + if (!$contents[$i][$j]['text']) $contents[$i][$j]['text']=""; + $texte=isset($contents[$i][$j]['text'])?$contents[$i][$j]['text']:''; + $textewithnotags=eregi_replace('<[^>]+>','',$texte); + $texte2=isset($contents[$i][$j]['text2'])?$contents[$i][$j]['text2']:''; + $texte2withnotags=eregi_replace('<[^>]+>','',$texte2); + //print "xxx $textewithnotags y"; - if (isset($contents[$i][$j]['logo']) && $contents[$i][$j]['logo']) print '"; + } - if (eregi('^"; - } - - if (sizeof($contents[$i])) print "\n"; - } - } - print "
'; - else print ''; + print ''; - // Picto - if (isset($contents[$i][$j]['url'])) { - print '" - print isset($contents[$i][$j]['target'])?' target="'.$contents[$i][$j]['target'].'"':''; - print '>'; - } + // Url + if (! empty($contents[$i][$j]['url'])) { + print '" + print isset($contents[$i][$j]['target'])?' target="'.$contents[$i][$j]['target'].'"':''; + print '>'; + } - // Texte - if (isset($contents[$i][$j]['logo']) && $contents[$i][$j]['logo']) - { - $logo=eregi_replace("^object_","",$contents[$i][$j]['logo']); - print img_object($langs->trans("Show"),$logo); - if (isset($contents[$i][$j]['url'])) print ''; - print ''; - if (isset($contents[$i][$j]['url'])) - { - print '" - print isset($contents[$i][$j]['target'])?' target="'.$contents[$i][$j]['target'].'"':''; - print '>'; - } - } - $maxlength=$this->MAXLENGTHBOX; - if (isset($contents[$i][$j]['maxlength'])) $maxlength=$contents[$i][$j]['maxlength']; + // Logo + if (! empty($contents[$i][$j]['logo'])) + { + $logo=eregi_replace("^object_","",$contents[$i][$j]['logo']); + print img_object($langs->trans("Show"),$logo); + } + + $maxlength=$MAXLENGTHBOX; + if (! empty($contents[$i][$j]['maxlength'])) $maxlength=$contents[$i][$j]['maxlength']; - if ($maxlength) $textewithnotags=dolibarr_trunc($textewithnotags,$maxlength); - if (eregi('^'; + + if (eregi('^'; + print "
\n"; + print "\n"; + } + } + + while ($i < $this->max) + { + $var=!$var; + print ' '; + $i++; + } + + print "\n"; } // If invisible box with no contents if (empty($head['text']) && empty($head['sublink']) && ! $nblines) print "

\n"; - + print "
\n"; - print "\n\n"; - } + print "\n\n"; + } } diff --git a/htdocs/index.php b/htdocs/index.php index 1608caea122..e381335fceb 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -20,7 +20,7 @@ /** * \file htdocs/index.php - * \brief Page accueil par defaut + * \brief Dolibarr home page * \version $Id$ */ @@ -28,16 +28,20 @@ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/boxes.php"); -// Simule le menu par défaut sur Home +// If not defined, we select menu "home" if (! isset($_GET["mainmenu"])) $_GET["mainmenu"]="home"; $infobox=new InfoBox($db); +/* + * Actions + */ +// No actions /* - * Affichage page + * View */ llxHeader(); @@ -76,7 +80,7 @@ print ''; /* - * Informations + * Informations area */ if (file_exists(DOL_DOCUMENT_ROOT.'/logo.png')) @@ -566,12 +570,12 @@ print ''; /* - * Affichage des boites - * + * Show boxes */ -$boxarray=$infobox->listboxes("0",$user); // 0=valeur pour la page accueil -$boxid_left = array(); -$boxid_right = array(); +$boxarray=$infobox->listboxes("0",$user); // 0=value for home page + +//$boxid_left = array(); +//$boxid_right = array(); if (sizeof($boxarray)) { @@ -580,28 +584,30 @@ if (sizeof($boxarray)) print ''; print '"; + print "
'."\n"; + print ''; + // Affichage colonne gauche - print "\n\n"; - print '
'; print "\n"; - print "\n"; + print "\n"; // Affichage colonne droite - print "\n\n"; print '
'."\n"; + print ''."\n"; + + print "\n\n"; print '
'."\n"; $ii=0; foreach ($boxarray as $key => $box) { - //print "xxx".$key."-".$value; if (eregi('^A',$box->box_order)) // colonne A { $ii++; //print 'box_id '.$boxarray[$ii]->box_id.' '; //print 'box_order '.$boxarray[$ii]->box_order.'
'; - $boxid_left[$key] = $boxarray[$key]->box_id; + //$boxid_left[$key] = $box->box_id; // Affichage boite key $box->loadBox($conf->box_max_lines); $box->showBox(); } } - // If no box on left, we show add an invisible empty box + // If no box on left, we add an invisible empty box if ($ii==0) { $box->box_id='A'; @@ -611,14 +617,13 @@ if (sizeof($boxarray)) } print "
\n"; - print '
'; - // print '
\n"; print "\n"; + print "
\n"; print "\n"; print "";