Look: Ajout picto sur actions et sur les boites
This commit is contained in:
parent
810f8c66ea
commit
261429d086
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
|
||||
@ -457,7 +457,7 @@ if ($_GET["id"])
|
||||
// Date fin real
|
||||
print '<tr><td>'.$langs->trans("DateActionDone").'</td><td colspan="3">'.dolibarr_print_date($act->date,'%d %B %Y %H:%M').'</td></tr>';
|
||||
|
||||
print '<tr><td nowrap>'.$langs->trans("PercentDone").'</td><td colspan="3"><input name="percent" value="'.$act->percent.'" size="4">%</td></tr>';
|
||||
print '<tr><td nowrap>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="3"><input name="percent" value="'.$act->percent.'" size="4">%</td></tr>';
|
||||
if ($act->objet_url)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LinkedObject").'</td>';
|
||||
@ -500,7 +500,12 @@ if ($_GET["id"])
|
||||
// Date fin real
|
||||
print '<tr><td>'.$langs->trans("DateActionDone").'</td><td colspan="3">'.dolibarr_print_date($act->date,'%d %B %Y %H:%M').'</td></tr>';
|
||||
|
||||
print '<tr><td nowrap>'.$langs->trans("PercentDone").'</td><td colspan="3">'.$act->percent.' %</td></tr>';
|
||||
// Statut
|
||||
print '<tr><td nowrap>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="3">';
|
||||
print $act->getLibStatut(4);
|
||||
print ' ('.$act->percent.' %)</td></tr>';
|
||||
|
||||
// Objet lié
|
||||
if ($act->objet_url)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LinkedObject").'</td>';
|
||||
|
||||
@ -438,11 +438,13 @@ if ($socidp > 0)
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
$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 '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$objp->cid.'">'.img_object($langs->trans("ShowOrder"),"order").' '.$objp->ref."</a>\n";
|
||||
print '</td><td align="right" width="80">'.dolibarr_print_date($objp->dc)."</td>\n";
|
||||
print '<td align="right" width="120">'.price($objp->total_ht).'</td>';
|
||||
print '<td align="right" width="100">'.$commande_static->LibStatut($objp->fk_statut,5).'</td></tr>';
|
||||
print '<td align="right" width="100">'.$commande_static->LibStatut($objp->fk_statut,$objp->facture,5).'</td></tr>';
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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()
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
|
||||
*
|
||||
* 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++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user