From 261429d086f560a6b0f6ede011292ecff22d266e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 May 2006 12:16:18 +0000 Subject: [PATCH] Look: Ajout picto sur actions et sur les boites --- htdocs/actioncomm.class.php | 61 +++++++- htdocs/admin/boxes.php | 2 +- htdocs/comm/action/fiche.php | 9 +- htdocs/comm/fiche.php | 14 +- htdocs/commande/commande.class.php | 3 +- htdocs/includes/boxes/box_actions.php | 130 ++++++++++-------- htdocs/includes/boxes/box_commandes.php | 22 ++- htdocs/includes/boxes/box_factures.php | 22 +-- htdocs/includes/boxes/box_factures_fourn.php | 15 +- .../includes/boxes/box_factures_fourn_imp.php | 17 ++- htdocs/includes/boxes/box_factures_imp.php | 13 +- htdocs/includes/boxes/box_propales.php | 22 +-- htdocs/includes/modules/modFacture.class.php | 23 ++-- .../includes/modules/modFournisseur.class.php | 15 +- 14 files changed, 247 insertions(+), 121 deletions(-) diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php index 5945d3eac93..9bdd78274de 100644 --- a/htdocs/actioncomm.class.php +++ b/htdocs/actioncomm.class.php @@ -298,6 +298,65 @@ class ActionComm dolibarr_print_error($this->db); } } - + + + /** + * \brief Retourne le libellé du statut de la commande + * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Picto + * \return string Libellé + */ + function getLibStatut($mode) + { + return $this->LibStatut($this->percent,$mode); + } + + /** + * \brief Renvoi le libellé d'un statut donné + * \param percent Pourcentage avancement + * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Picto + * \return string Libellé + */ + function LibStatut($percent,$mode) + { + global $langs; + + if ($mode == 0) + { + if ($percent==0) return $langs->trans('StatusActionToDo'); + if ($percent > 0 && $percent < 100) return $langs->trans('StatusActionInProcess'); + if ($percent >= 100) return $langs->trans('StatusActionDone'); + } + if ($mode == 1) + { + if ($percent==0) return $langs->trans('StatusActionToDo'); + if ($percent > 0 && $percent < 100) return $langs->trans('StatusActionInProcess'); + if ($percent >= 100) return $langs->trans('StatusActionDone'); + } + if ($mode == 2) + { + if ($percent==0) return img_picto($langs->trans('StatusActionToDo'),'statut1').' '.$langs->trans('StatusActionToDo'); + if ($percent > 0 && $percent < 100) return img_picto($langs->trans('StatusActionInProcess'),'statut3').' '.$langs->trans('StatusActionInProcess'); + if ($percent >= 100) return img_picto($langs->trans('StatusActionDone'),'statut5').' '.$langs->trans('StatusActionDone'); + } + if ($mode == 3) + { + if ($percent==0) return img_picto($langs->trans('StatusActionToDo'),'statut1'); + if ($percent > 0 && $percent < 100) return img_picto($langs->trans('StatusActionInProcess'),'statut3'); + if ($percent >= 100) return img_picto($langs->trans('StatusActionDone'),'statut5'); + } + if ($mode == 4) + { + if ($percent==0) return img_picto($langs->trans('StatusActionToDo'),'statut1').' '.$langs->trans('StatusActionToDo'); + if ($percent > 0 && $percent < 100) return img_picto($langs->trans('StatusActionInProcess'),'statut3').' '.$langs->trans('StatusActionInProcess'); + if ($percent >= 100) return img_picto($langs->trans('StatusActionDone'),'statut5').' '.$langs->trans('StatusActionDone'); + } + if ($mode == 5) + { + if ($percent==0) return $langs->trans('StatusActionToDo').' '.img_picto($langs->trans('StatusActionToDo'),'statut1'); + if ($percent > 0 && $percent < 100) return $langs->trans('StatusActionInProcess').' '.img_picto($langs->trans('StatusActionInProcess'),'statut3'); + if ($percent >= 100) return $langs->trans('StatusActionDone').' '.img_picto($langs->trans('StatusActionDone'),'statut5'); + } + } + } ?> diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 7f83d2595c7..889d111ffab 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2006 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 diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 372a0570ac6..6a0061151a1 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -457,7 +457,7 @@ if ($_GET["id"]) // Date fin real print ''.$langs->trans("DateActionDone").''.dolibarr_print_date($act->date,'%d %B %Y %H:%M').''; - print ''.$langs->trans("PercentDone").'%'; + print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").'%'; if ($act->objet_url) { print ''.$langs->trans("LinkedObject").''; @@ -500,7 +500,12 @@ if ($_GET["id"]) // Date fin real print ''.$langs->trans("DateActionDone").''.dolibarr_print_date($act->date,'%d %B %Y %H:%M').''; - print ''.$langs->trans("PercentDone").''.$act->percent.' %'; + // Statut + print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + print $act->getLibStatut(4); + print ' ('.$act->percent.' %)'; + + // Objet lié if ($act->objet_url) { print ''.$langs->trans("LinkedObject").''; diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 450a31c7ad5..694bfc15ee6 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -438,11 +438,13 @@ if ($socidp > 0) print ''; - $sql = "SELECT s.nom, s.idp, c.rowid as cid, c.total_ht, c.ref, c.fk_statut, ".$db->pdate("c.date_commande")." as dc"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; - $sql .= " WHERE c.fk_soc = s.idp "; - $sql .= " AND s.idp = $objsoc->id"; - $sql .= " ORDER BY c.date_commande DESC"; + $sql = "SELECT s.nom, s.idp,"; + $sql.= " c.rowid as cid, c.total_ht, c.ref, c.fk_statut, c.facture,"; + $sql.= " ".$db->pdate("c.date_commande")." as dc"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; + $sql.= " WHERE c.fk_soc = s.idp "; + $sql.= " AND s.idp = $objsoc->id"; + $sql.= " ORDER BY c.date_commande DESC"; $resql=$db->query($sql); if ($resql) @@ -464,7 +466,7 @@ if ($socidp > 0) print '\n"; print ''; - print ''; + print ''; $i++; } $db->free($resql); diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 27f94ec03b9..530ff9c83c2 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -1707,10 +1707,11 @@ class Commande /** * \brief Renvoi le libellé d'un statut donné * \param statut Id statut + * \param facturee Si facturee * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Picto * \return string Libellé */ - function LibStatut($statut,$facture,$mode) + function LibStatut($statut,$facturee,$mode) { global $langs; diff --git a/htdocs/includes/boxes/box_actions.php b/htdocs/includes/boxes/box_actions.php index 2580a82d2b8..4bcaac19d96 100644 --- a/htdocs/includes/boxes/box_actions.php +++ b/htdocs/includes/boxes/box_actions.php @@ -18,8 +18,8 @@ * * $Id$ * $Source$ - * */ + /** \file htdocs/includes/boxes/box_actions.php \ingroup actions @@ -57,67 +57,75 @@ class box_actions extends ModeleBoxes { * \param $max Nombre maximum d'enregistrements à charger */ function loadBox($max=5) - { - global $user, $langs, $db, $conf; - $langs->load("boxes"); + { + global $user, $langs, $db, $conf; + + include_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php"); + $actionstatic=new ActionComm($db); - $this->info_box_head = array('text' =>$langs->trans("ActionsToDo")); - if ($user->rights->commercial->main->lire) - { - $sql = "SELECT a.label, a.id, ".$db->pdate("a.datea")." as da , a.percent, s.nom, s.idp"; - if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; - $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm AS a "; - if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.idp"; - $sql .= " WHERE percent <> 100 "; - if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= " AND s.idp = sc.fk_soc AND sc.fk_user = " .$user->id; - if($user->societe_id) - { - $sql .= " AND s.idp = $user->societe_id"; - } - $sql .= " ORDER BY a.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); - - if (date("U",$objp->da) < (time() - $conf->global->MAIN_DELAY_ACTIONS_TODO)) $late=img_warning($langs->trans("Late")); - - - $this->info_box_contents[$i][0] = array('align' => 'left', - 'logo' => ("task"), - 'text' => $objp->label, - 'text2'=> $late, - 'url' => DOL_URL_ROOT."/comm/action/fiche.php?id=".$objp->id); - - $this->info_box_contents[$i][1] = array('align' => 'left', - 'text' => $objp->nom, - 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->idp); - - $this->info_box_contents[$i][2] = array('align' => 'right', - 'text' => dolibarr_print_date($objp->da)); - - $this->info_box_contents[$i][3] = array('align' => 'right', - 'text' => $objp->percent. "%"); - - $i++; - } - } - else { - dolibarr_print_error($db); - } - } - else { - $this->info_box_contents[0][0] = array('align' => 'left', - 'text' => $langs->trans("ReadPermissionNotAllowed")); - } - } + $this->info_box_head = array('text' =>$langs->trans("ActionsToDo")); + + if ($user->rights->commercial->main->lire) + { + $sql = "SELECT a.label, a.id, ".$db->pdate("a.datea")." as da , a.percent,"; + $sql.= " s.nom, s.idp"; + if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; + $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm AS a "; + if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.idp"; + $sql.= " WHERE percent <> 100 "; + if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= " AND s.idp = sc.fk_soc AND sc.fk_user = " .$user->id; + if($user->societe_id) + { + $sql .= " AND s.idp = $user->societe_id"; + } + $sql.= " ORDER BY a.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); + + if (date("U",$objp->da) < (time() - $conf->global->MAIN_DELAY_ACTIONS_TODO)) $late=img_warning($langs->trans("Late")); + + + $this->info_box_contents[$i][0] = array('align' => 'left', + 'logo' => ("task"), + 'text' => $objp->label, + 'text2'=> $late, + 'url' => DOL_URL_ROOT."/comm/action/fiche.php?id=".$objp->id); + + $this->info_box_contents[$i][1] = array('align' => 'left', + 'text' => $objp->nom, + 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->idp); + + $this->info_box_contents[$i][2] = array('align' => 'right', + 'text' => dolibarr_print_date($objp->da)); + + $this->info_box_contents[$i][3] = array('align' => 'right', + 'text' => $objp->percent. "%"); + + $this->info_box_contents[$i][4] = array( + 'align' => 'right', + 'text' => $actionstatic->LibStatut($objp->percent,3)); + + $i++; + } + } + else { + dolibarr_print_error($db); + } + } + else { + $this->info_box_contents[0][0] = array('align' => 'left', + 'text' => $langs->trans("ReadPermissionNotAllowed")); + } + } function showBox() { diff --git a/htdocs/includes/boxes/box_commandes.php b/htdocs/includes/boxes/box_commandes.php index f858f4fef91..885e751ed4e 100644 --- a/htdocs/includes/boxes/box_commandes.php +++ b/htdocs/includes/boxes/box_commandes.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2006 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 @@ -18,13 +18,12 @@ * * $Id$ * $Source$ - * */ /** - \file htdocs/includes/boxes/box_commandes.php - \ingroup commande - \brief Module de génération de l'affichage de la box commandes + \file htdocs/includes/boxes/box_commandes.php + \ingroup commande + \brief Module de génération de l'affichage de la box commandes */ include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php"); @@ -58,14 +57,18 @@ class box_commandes extends ModeleBoxes { function loadBox($max=5) { global $user, $langs, $db; - $langs->load("boxes"); + include_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php"); + $commandestatic=new Commande($db); + $this->info_box_head = array('text' => $langs->trans("BoxTitleLastCustomerOrders",$max)); if ($user->rights->commande->lire) { - $sql = "SELECT s.nom,s.idp,p.ref,".$db->pdate("p.date_commande")." as dp,p.rowid"; + $sql = "SELECT s.nom, s.idp,"; + $sql.= " p.ref, ".$db->pdate("p.date_commande")." as dp, p.rowid,"; + $sql.= " p.fk_statut, p.facture"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as p"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -98,6 +101,11 @@ class box_commandes extends ModeleBoxes { $this->info_box_contents[$i][1] = array('align' => 'left', 'text' => $objp->nom, 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->idp); + + $this->info_box_contents[$i][2] = array( + 'align' => 'right', + 'text' => $commandestatic->LibStatut($objp->fk_statut,$objp->facturee,3)); + $i++; } } diff --git a/htdocs/includes/boxes/box_factures.php b/htdocs/includes/boxes/box_factures.php index e3e4a729ae0..92791dc7ccb 100644 --- a/htdocs/includes/boxes/box_factures.php +++ b/htdocs/includes/boxes/box_factures.php @@ -58,25 +58,26 @@ class box_factures extends ModeleBoxes { function loadBox($max=5) { global $user, $langs, $db; - - $langs->load("boxes"); + + $facturestatic=new Facture($db); $this->info_box_head = array('text' => $langs->trans("BoxTitleLastCustomerBills",$max)); if ($user->rights->facture->lire) { - $sql = "SELECT s.nom,s.idp,f.facnumber,f.amount,".$db->pdate("f.datef")." as df,f.paye,f.rowid as facid"; + $sql = "SELECT s.nom,s.idp,f.facnumber,f.amount,".$db->pdate("f.datef")." as df,"; + $sql.= " f.paye, f.fk_statut, f.rowid as facid"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE f.fk_soc = s.idp"; + $sql.= " WHERE f.fk_soc = s.idp"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= " AND s.idp = sc.fk_soc AND sc.fk_user = " .$user->id; if($user->societe_id) { - $sql .= " AND s.idp = $user->societe_id"; + $sql.= " AND s.idp = $user->societe_id"; } - $sql .= " ORDER BY f.datef DESC, f.facnumber DESC "; - $sql .= $db->plimit($max, 0); + $sql.= " ORDER BY f.datef DESC, f.facnumber DESC "; + $sql.= $db->plimit($max, 0); $result = $db->query($sql); @@ -99,6 +100,11 @@ class box_factures extends ModeleBoxes { 'text' => $objp->nom, 'maxlength'=>44, 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->idp); + + $this->info_box_contents[$i][2] = array( + 'align' => 'right', + 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3)); + $i++; } } diff --git a/htdocs/includes/boxes/box_factures_fourn.php b/htdocs/includes/boxes/box_factures_fourn.php index 78b1927ec8d..bea33db2880 100644 --- a/htdocs/includes/boxes/box_factures_fourn.php +++ b/htdocs/includes/boxes/box_factures_fourn.php @@ -59,13 +59,17 @@ class box_factures_fourn extends ModeleBoxes { function loadBox($max=5) { global $user, $langs, $db; - $langs->load("boxes"); + + include_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php"); + $facturestatic=new FactureFournisseur($db); $this->info_box_head = array('text' => $langs->trans("BoxTitleLastSupplierBills",$max)); - if ($user->rights->facture->lire) + if ($user->rights->fournisseur->facture->lire) { - $sql = "SELECT s.nom,s.idp,f.facnumber,f.amount,".$db->pdate("f.datef")." as df,f.paye,f.rowid as facid"; + $sql = "SELECT s.nom, s.idp,"; + $sql.= " f.facnumber, f.amount,".$db->pdate("f.datef")." as df,"; + $sql.= " f.paye, f.fk_statut, f.rowid as facid"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_fourn as f"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -98,6 +102,11 @@ class box_factures_fourn extends ModeleBoxes { $this->info_box_contents[$i][1] = array('align' => 'left', 'text' => $objp->nom, 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->idp); + + $this->info_box_contents[$i][2] = array( + 'align' => 'right', + 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3)); + $i++; } } diff --git a/htdocs/includes/boxes/box_factures_fourn_imp.php b/htdocs/includes/boxes/box_factures_fourn_imp.php index f0475ae9ee5..3cb1e617508 100644 --- a/htdocs/includes/boxes/box_factures_fourn_imp.php +++ b/htdocs/includes/boxes/box_factures_fourn_imp.php @@ -17,7 +17,6 @@ * * $Id$ * $Source$ - * */ /** @@ -58,14 +57,18 @@ class box_factures_fourn_imp extends ModeleBoxes { function loadBox($max=5) { global $user, $langs, $db; - $langs->load("boxes"); - + + include_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php"); + $facturestatic=new FactureFournisseur($db); + $this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpayedSupplierBills",$max)); - if ($user->rights->facture->lire) + if ($user->rights->fournisseur->facture->lire) { - $sql = "SELECT s.nom,s.idp,f.facnumber,f.amount,".$db->pdate("f.datef")." as df,f.paye,f.rowid as facid"; + $sql = "SELECT s.nom, s.idp,"; + $sql.= " f.facnumber,f.amount,".$db->pdate("f.datef")." as df,"; + $sql.= " f.paye, f.fk_statut, f.rowid as facid"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_fourn as f"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -98,6 +101,10 @@ class box_factures_fourn_imp extends ModeleBoxes { 'text' => $objp->nom, 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->idp); + $this->info_box_contents[$i][2] = array( + 'align' => 'right', + 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3)); + $i++; } } diff --git a/htdocs/includes/boxes/box_factures_imp.php b/htdocs/includes/boxes/box_factures_imp.php index e00967b3e02..d943053a932 100644 --- a/htdocs/includes/boxes/box_factures_imp.php +++ b/htdocs/includes/boxes/box_factures_imp.php @@ -19,7 +19,6 @@ * * $Id$ * $Source$ - * */ /** @@ -60,13 +59,17 @@ class box_factures_imp extends ModeleBoxes { function loadBox($max=5) { global $user, $langs, $db; - $langs->load("boxes"); + + $facturestatic=new Facture($db); $this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpayedCustomerBills",$max)); if ($user->rights->facture->lire) { - $sql = "SELECT s.nom,s.idp,f.facnumber,".$db->pdate("f.date_lim_reglement")." as datelimite, f.amount,".$db->pdate("f.datef")." as df,f.paye,f.rowid as facid"; + $sql = "SELECT s.nom, s.idp,"; + $sql.= " f.facnumber,".$db->pdate("f.date_lim_reglement")." as datelimite,"; + $sql.= " f.amount,".$db->pdate("f.datef")." as df,"; + $sql.= " f.paye, f.fk_statut, f.rowid as facid"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -105,6 +108,10 @@ class box_factures_imp extends ModeleBoxes { 'maxlength'=>44, 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->idp); + $this->info_box_contents[$i][2] = array( + 'align' => 'right', + 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3)); + $i++; } } diff --git a/htdocs/includes/boxes/box_propales.php b/htdocs/includes/boxes/box_propales.php index 3b2714a5545..7c25308b805 100644 --- a/htdocs/includes/boxes/box_propales.php +++ b/htdocs/includes/boxes/box_propales.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005 Laurent Destailleur + * Copyright (C) 2005-2006 Laurent Destailleur * Copyright (C) 2005-2006 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -19,13 +19,12 @@ * * $Id$ * $Source$ - * */ /** - \file htdocs/includes/boxes/box_propales.php - \ingroup propales - \brief Module de génération de l'affichage de la box propales + \file htdocs/includes/boxes/box_propales.php + \ingroup propales + \brief Module de génération de l'affichage de la box propales */ include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php"); @@ -62,14 +61,16 @@ class box_propales extends ModeleBoxes { global $user, $langs, $db; - $langs->load("boxes"); - + 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) { - $sql = "SELECT s.nom,s.idp,p.ref,".$db->pdate("p.datep")." as dp,p.rowid"; + $sql = "SELECT s.nom, s.idp,"; + $sql.= " p.ref, p.fk_statut, ".$db->pdate("p.datep")." as dp, p.rowid"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."propal as p"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -102,6 +103,11 @@ class box_propales extends ModeleBoxes { $this->info_box_contents[$i][1] = array('align' => 'left', 'text' => $objp->nom, 'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->idp); + + $this->info_box_contents[$i][2] = array( + 'align' => 'right', + 'text' => $propalstatic->LibStatut($objp->fk_statut,3)); + $i++; } } diff --git a/htdocs/includes/modules/modFacture.class.php b/htdocs/includes/modules/modFacture.class.php index fdafdd6a753..ef339693a9f 100644 --- a/htdocs/includes/modules/modFacture.class.php +++ b/htdocs/includes/modules/modFacture.class.php @@ -130,19 +130,16 @@ class modFacture extends DolibarrModules // Boites $this->boxes = array(); - - $this->boxes[0][0] = "Factures clients récentes impayées"; - $this->boxes[0][1] = "box_factures_imp.php"; - - $this->boxes[1][0] = "Factures fournisseurs récentes impayées"; - $this->boxes[1][1] = "box_factures_fourn_imp.php"; - - $this->boxes[2][0] = "Dernières factures clients saisies"; - $this->boxes[2][1] = "box_factures.php"; - - $this->boxes[3][0] = "Dernières factures fournisseurs saisies"; - $this->boxes[3][1] = "box_factures_fourn.php"; - + $r=0; + + $this->boxes[$r][0] = "Factures clients récentes impayées"; + $this->boxes[$r][1] = "box_factures_imp.php"; + $r++; + + $this->boxes[$r][0] = "Dernières factures clients saisies"; + $this->boxes[$r][1] = "box_factures.php"; + $r++; + // Permissions $this->rights = array(); $this->rights_class = 'facture'; diff --git a/htdocs/includes/modules/modFournisseur.class.php b/htdocs/includes/modules/modFournisseur.class.php index b012e97bfd3..4d26ec39bcf 100644 --- a/htdocs/includes/modules/modFournisseur.class.php +++ b/htdocs/includes/modules/modFournisseur.class.php @@ -86,8 +86,19 @@ class modFournisseur extends DolibarrModules // Boxes $this->boxes = array(); - $this->boxes[0][0] = "Derniers founisseurs"; - $this->boxes[0][1] = "box_fournisseurs.php"; + $r=0; + + $this->boxes[$r][0] = "Derniers founisseurs"; + $this->boxes[$r][1] = "box_fournisseurs.php"; + $r++; + + $this->boxes[$r][0] = "Factures fournisseurs récentes impayées"; + $this->boxes[$r][1] = "box_factures_fourn_imp.php"; + $r++; + + $this->boxes[$r][0] = "Dernières factures fournisseurs saisies"; + $this->boxes[$r][1] = "box_factures_fourn.php"; + $r++; // Permissions $this->rights = array();
'.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."\n"; print ''.dolibarr_print_date($objp->dc)."'.price($objp->total_ht).''.$commande_static->LibStatut($objp->fk_statut,5).'
'.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).'