diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php index d7c493b613a..65b4dbb4df2 100644 --- a/htdocs/actioncomm.class.php +++ b/htdocs/actioncomm.class.php @@ -386,6 +386,8 @@ class ActionComm { global $conf, $user; + $now=gmmktime(); // gmmktime(0,0,0,1,1,1970) -> 0, mktime(0,0,0,1,1,1970) -> -3600; + $this->nbtodo=$this->nbtodolate=0; $sql = "SELECT a.id, a.datep as dp"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; @@ -400,7 +402,7 @@ class ActionComm while ($obj=$this->db->fetch_object($resql)) { $this->nbtodo++; - if ($this->db->jdate($obj->dp) < (time() - $conf->actions->warning_delay)) $this->nbtodolate++; + if (isset($obj->dp) && $this->db->jdate($obj->dp) < ($now - $conf->actions->warning_delay)) $this->nbtodolate++; } return 1; } diff --git a/htdocs/adherents/adherent.class.php b/htdocs/adherents/adherent.class.php index c372224af6a..d4ee294eac9 100644 --- a/htdocs/adherents/adherent.class.php +++ b/htdocs/adherents/adherent.class.php @@ -1699,10 +1699,12 @@ class Adherent extends CommonObject { global $conf; + $now=gmmktime(); + if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe $this->nbtodo=$this->nbtodolate=0; - $sql = "SELECT a.rowid,".$this->db->pdate("a.datefin")." as datefin"; + $sql = "SELECT a.rowid, a.datefin"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a"; $sql.= " WHERE a.statut=1"; $resql=$this->db->query($sql); @@ -1711,7 +1713,7 @@ class Adherent extends CommonObject while ($obj=$this->db->fetch_object($resql)) { $this->nbtodo++; - if ($obj->datefin < (time() - $conf->adherent->cotisation->warning_delay)) $this->nbtodolate++; + if ($this->db->jdate($obj->datefin) < ($now - $conf->adherent->cotisation->warning_delay)) $this->nbtodolate++; } return 1; } diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index cae63b638ad..6935a41ac56 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -636,7 +636,9 @@ if ($_GET["id"]) dolibarr_fiche_head($head, $hselected, $langs->trans("Action")); - + $now=gmmktime(); + $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60; + // Confirmation suppression action if ($_GET["action"] == 'delete') { @@ -700,14 +702,12 @@ if ($_GET["id"]) if ($_REQUEST["afaire"] == 1) $html->select_date($act->datep,'ap',1,1,0,"action",1,1); else if ($_REQUEST["afaire"] == 2) $html->select_date($act->datep,'ap',1,1,1,"action",1,1); else $html->select_date($act->datep,'ap',1,1,1,"action",1,1); - if ($act->percentage == 0 && $act->datep && $act->datep < (time() - $conf->global->MAIN_DELAY_ACTIONS_TODO)) print img_warning($langs->trans("Late")); print ''; // Date end print '
| '; - if ($obj->datelimite < (time() - $conf->facture->client->warning_delay)) print img_warning($langs->trans("Late")); + if ($obj->datelimite < ($now - $conf->facture->client->warning_delay)) print img_warning($langs->trans("Late")); print ' | '; print ''; $filename=sanitizeFileName($obj->facnumber); diff --git a/htdocs/compta/paiement/cheque/remisecheque.class.php b/htdocs/compta/paiement/cheque/remisecheque.class.php index ecdd27068a0..fec22a33ba5 100644 --- a/htdocs/compta/paiement/cheque/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/remisecheque.class.php @@ -376,8 +376,10 @@ class RemiseCheque extends CommonObject if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe + $now=gmmktime(); + $this->nbtodo=$this->nbtodolate=0; - $sql = "SELECT b.rowid,".$this->db->pdate("b.datev")." as datefin"; + $sql = "SELECT b.rowid, b.datev as datefin"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql.= " WHERE b.fk_type = 'CHQ' AND b.fk_bordereau = 0"; $sql.= " AND b.amount > 0"; @@ -388,7 +390,7 @@ class RemiseCheque extends CommonObject while ($obj=$this->db->fetch_object($resql)) { $this->nbtodo++; - if ($obj->datefin < (time() - $conf->bank->cheque->warning_delay)) $this->nbtodolate++; + if ($this->db->jdate($obj->datefin) < ($now - $conf->bank->cheque->warning_delay)) $this->nbtodolate++; } return 1; } diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index 53461ea3144..f4b365e527d 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -110,6 +110,11 @@ if ( $action == 'delete' ) } +/* + * View + */ + +$now=gmmktime(); llxHeader(); @@ -195,7 +200,7 @@ if ($_GET["propalid"] > 0) if ($propal->fin_validite) { print dolibarr_print_date($propal->fin_validite,'daytext'); - if ($propal->statut == 1 && $propal->fin_validite < (time() - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); + if ($propal->statut == 1 && $propal->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); } else { @@ -641,6 +646,7 @@ else * */ + $now=gmmktime(); $limit = $conf->liste_limit; $offset = $limit * $page ; @@ -753,7 +759,7 @@ else print ' | '; print ''; - if ($objp->fk_statut == 1 && $objp->din < (time() - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); + if ($objp->fk_statut == 1 && $objp->din < ($now() - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); print ' | '; print ''; diff --git a/htdocs/contrat/contrat.class.php b/htdocs/contrat/contrat.class.php index 2e3bd7ccdb6..ec32bbde9cc 100644 --- a/htdocs/contrat/contrat.class.php +++ b/htdocs/contrat/contrat.class.php @@ -1225,10 +1225,12 @@ class Contrat extends CommonObject { global $conf, $user; + $now=gmmktime(); + $this->nbtodo=$this->nbtodolate=0; if ($mode == 'inactives') { - $sql = "SELECT cd.rowid,".$this->db->pdate("cd.date_ouverture_prevue")." as datefin"; + $sql = "SELECT cd.rowid, cd.date_ouverture_prevue as datefin"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."contratdet as cd"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -1237,7 +1239,7 @@ class Contrat extends CommonObject } if ($mode == 'expired') { - $sql = "SELECT cd.rowid,".$this->db->pdate("cd.date_fin_validite")." as datefin"; + $sql = "SELECT cd.rowid, cd.date_fin_validite as datefin"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."contratdet as cd"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -1254,9 +1256,9 @@ class Contrat extends CommonObject { $this->nbtodo++; if ($mode == 'inactives') - if ($obj->datefin && $obj->datefin < (time() - $conf->contrat->services->inactifs->warning_delay)) $this->nbtodolate++; + if ($obj->datefin && $this->db->jdate($obj->datefin) < ($now - $conf->contrat->services->inactifs->warning_delay)) $this->nbtodolate++; if ($mode == 'expired') - if ($obj->datefin && $obj->datefin < (time() - $conf->contrat->services->expires->warning_delay)) $this->nbtodolate++; + if ($obj->datefin && $this->db->jdate($obj->datefin) < ($now - $conf->contrat->services->expires->warning_delay)) $this->nbtodolate++; } return 1; } diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index b4decc30b95..23042510f05 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -605,6 +605,8 @@ else /* */ /* *************************************************************************** */ { + $now=gmmktime(); + $id = $_GET["id"]; if ($id > 0) { @@ -867,14 +869,14 @@ else if ($objp->date_debut) { print dolibarr_print_date($objp->date_debut); // Warning si date prevu passee et pas en service - if ($objp->statut == 0 && $objp->date_debut < time() - $conf->contrat->warning_delay) { print " ".img_warning($langs->trans("Late")); } + if ($objp->statut == 0 && $objp->date_debut < ($now - $conf->contrat->warning_delay)) { print " ".img_warning($langs->trans("Late")); } } else print $langs->trans("Unknown"); print ' - '; print $langs->trans("DateEndPlanned").': '; if ($objp->date_fin) { print dolibarr_print_date($objp->date_fin); - if ($objp->statut == 4 && $objp->date_fin < time() - $conf->contrat->services->inactifs->warning_delay) { print " ".img_warning($langs->trans("Late")); } + if ($objp->statut == 4 && $objp->date_fin < ($now - $conf->contrat->services->inactifs->warning_delay)) { print " ".img_warning($langs->trans("Late")); } } else print $langs->trans("Unknown"); diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index 70a50962716..4aef1df762a 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -2506,10 +2506,12 @@ class Facture extends CommonObject { global $conf, $user; + $now=gmmktime(); + $this->nbtodo=$this->nbtodolate=0; $clause = "WHERE"; - $sql = 'SELECT f.rowid,'.$this->db->pdate('f.date_lim_reglement').' as datefin'; + $sql = 'SELECT f.rowid, f.date_lim_reglement as datefin'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f'; if (!$user->rights->societe->client->voir && !$user->societe_id) { @@ -2525,7 +2527,7 @@ class Facture extends CommonObject while ($obj=$this->db->fetch_object($resql)) { $this->nbtodo++; - if ($obj->datefin < (time() - $conf->facture->client->warning_delay)) $this->nbtodolate++; + if ($this->db->jdate($obj->datefin) < ($now - $conf->facture->client->warning_delay)) $this->nbtodolate++; } return 1; } diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index b6936c5d7e6..a6ab51319f8 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -439,6 +439,8 @@ else /* */ /* *************************************************************************** */ + $now=gmmktime(); + $productstatic = new Product($db); $fac = new FactureFournisseur($db); @@ -482,7 +484,7 @@ else print ' | ||
| '.$langs->trans('DateEcheance').' | '; $html->select_date($fac->date_echeance,'ech','','','',"update"); - if (($fac->paye == 0) && ($fac->statut > 0) && $fac->date_echeance < (time() - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning"); + if (($fac->paye == 0) && ($fac->statut > 0) && $fac->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning"); print ' | ||||
| '.$langs->trans('AmountHT').' | '.price($fac->total_ht).' | ||||
| '.$langs->trans('DateEcheance').' | '; print dolibarr_print_date($fac->date_echeance,'daytext'); - if (($fac->paye == 0) && ($fac->statut > 0) && $fac->date_echeance < (time() - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning"); + if (($fac->paye == 0) && ($fac->statut > 0) && $fac->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning"); print ' | '.img_object($langs->trans("ShowBill"),"bill")." "; print ''.$objp->ref.''; - if ($objp->datelimite < (time() - $conf->facture->fournisseur->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late")); + if ($objp->datelimite < ($now - $conf->facture->fournisseur->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late")); print " | \n"; print "".dolibarr_trunc($objp->facnumber,12)." | \n"; diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index e4f308b4f72..86bbfceb386 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -83,6 +83,8 @@ if ($_POST["mode"] == 'search') * View */ +$now=gmmktime(); + llxHeader(); $sql = "SELECT s.rowid as socid, s.nom, "; @@ -206,7 +208,7 @@ if ($resql) $facturestatic->id=$obj->facid; $facturestatic->ref=$obj->ref; print $facturestatic->getNomUrl(1); - if (($obj->paye == 0) && ($obj->fk_statut > 0) && $obj->date_echeance < (time() - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning"); + if (($obj->paye == 0) && ($obj->fk_statut > 0) && $obj->date_echeance < ($now - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning"); print "\n"; print ''.dolibarr_trunc($obj->facnumber,10)." | "; print ''.dolibarr_print_date($obj->datef,'day').' | '; diff --git a/htdocs/fourn/fournisseur.facture.class.php b/htdocs/fourn/fournisseur.facture.class.php index f4283471d17..2eb5ba53a6e 100644 --- a/htdocs/fourn/fournisseur.facture.class.php +++ b/htdocs/fourn/fournisseur.facture.class.php @@ -647,8 +647,10 @@ class FactureFournisseur extends Facture { global $conf, $user; + $now=gmmktime(); + $this->nbtodo=$this->nbtodolate=0; - $sql = 'SELECT ff.rowid,'.$this->db->pdate('ff.date_lim_reglement').' as datefin'; + $sql = 'SELECT ff.rowid, ff.date_lim_reglement as datefin'; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user"; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as ff'; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -661,7 +663,7 @@ class FactureFournisseur extends Facture while ($obj=$this->db->fetch_object($resql)) { $this->nbtodo++; - if ($obj->datefin < (time() - $conf->facture->fournisseur->warning_delay)) $this->nbtodolate++; + if ($this->db->jdate($obj->datefin) < ($now - $conf->facture->fournisseur->warning_delay)) $this->nbtodolate++; } $this->db->free($resql); return 1; diff --git a/htdocs/includes/boxes/box_actions.php b/htdocs/includes/boxes/box_actions.php index fd0bc76d08f..7a57b192b55 100644 --- a/htdocs/includes/boxes/box_actions.php +++ b/htdocs/includes/boxes/box_actions.php @@ -93,6 +93,9 @@ class box_actions extends ModeleBoxes { $result = $db->query($sql); if ($result) { + $now=gmmktime(); + $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60; + $num = $db->num_rows($result); $i = 0; while ($i < $num) @@ -100,8 +103,8 @@ class box_actions extends ModeleBoxes { $late = ''; $objp = $db->fetch_object($result); $datelimite=$db->jdate($objp->dp); - - if ($datelimite < (time() - $conf->global->MAIN_DELAY_ACTIONS_TODO)) $late=img_warning($langs->trans("Late")); + + if ($datelimite < ($now - $delay_warning)) $late=img_warning($langs->trans("Late")); $label=($langs->transnoentities("Action".$objp->code)!=("Action".$objp->code) ? $langs->transnoentities("Action".$objp->code) : $objp->label); diff --git a/htdocs/includes/boxes/box_clients.php b/htdocs/includes/boxes/box_clients.php index 23f56090f1d..b98cd9cb285 100644 --- a/htdocs/includes/boxes/box_clients.php +++ b/htdocs/includes/boxes/box_clients.php @@ -21,7 +21,7 @@ /** \file htdocs/includes/boxes/box_clients.php \ingroup societes - \brief Module de génération de l'affichage de la box clients + \brief Module de g�n�ration de l'affichage de la box clients \version $Id$ */ @@ -53,8 +53,8 @@ class box_clients extends ModeleBoxes { } /** - * \brief Charge les données en mémoire pour affichage ultérieur - * \param $max Nombre maximum d'enregistrements à charger + * \brief Charge les donn�es en m�moire pour affichage ult�rieur + * \param $max Nombre maximum d'enregistrements � charger */ function loadBox($max=5) { @@ -85,7 +85,6 @@ class box_clients extends ModeleBoxes { if ($result) { $num = $db->num_rows($result); - $datec=$db->jdate($objp->dc); $i = 0; //$customerstatic=new Client($db); diff --git a/htdocs/includes/boxes/box_commandes.php b/htdocs/includes/boxes/box_commandes.php index e8221fea5df..4a41e852626 100644 --- a/htdocs/includes/boxes/box_commandes.php +++ b/htdocs/includes/boxes/box_commandes.php @@ -90,14 +90,14 @@ class box_commandes extends ModeleBoxes { if ($result) { $num = $db->num_rows($result); - $datem=$db->jdate($objp->tms); $i = 0; while ($i < $num) { $objp = $db->fetch_object($result); - + $datem=$db->jdate($objp->tms); + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => DOL_URL_ROOT."/commande/fiche.php?id=".$objp->rowid); diff --git a/htdocs/includes/boxes/box_factures.php b/htdocs/includes/boxes/box_factures.php index 26a37d5a4d4..77d7ae7b952 100644 --- a/htdocs/includes/boxes/box_factures.php +++ b/htdocs/includes/boxes/box_factures.php @@ -21,7 +21,7 @@ /** \file htdocs/includes/boxes/box_factures.php \ingroup factures - \brief Module de génération de l'affichage de la box factures + \brief Module de g�n�ration de l'affichage de la box factures \version $Id$ */ @@ -53,8 +53,8 @@ class box_factures extends ModeleBoxes { } /** - * \brief Charge les données en mémoire pour affichage ultérieur - * \param $max Nombre maximum d'enregistrements à charger + * \brief Charge les donn�es en m�moire pour affichage ult�rieur + * \param $max Nombre maximum d'enregistrements � charger */ function loadBox($max=5) { @@ -93,7 +93,8 @@ class box_factures extends ModeleBoxes { if ($result) { $num = $db->num_rows($result); - + $now=gmmktime(); + $i = 0; $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; @@ -107,7 +108,7 @@ class box_factures extends ModeleBoxes { if ($objp->type == 1) $picto.='r'; if ($objp->type == 2) $picto.='a'; $late = ''; - if($objp->paye == 0 && $datelimite < (time() - $conf->facture->warning_delay)) { $late = img_warning(sprintf($l_due_date,dolibarr_print_date($datelimite,'day')));} + if($objp->paye == 0 && $datelimite < ($now - $conf->facture->warning_delay)) { $late = img_warning(sprintf($l_due_date,dolibarr_print_date($datelimite,'day')));} $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $picto, diff --git a/htdocs/includes/boxes/box_factures_fourn.php b/htdocs/includes/boxes/box_factures_fourn.php index c05be17953a..ab2e584b51c 100644 --- a/htdocs/includes/boxes/box_factures_fourn.php +++ b/htdocs/includes/boxes/box_factures_fourn.php @@ -92,7 +92,8 @@ class box_factures_fourn extends ModeleBoxes { if ($result) { $num = $db->num_rows($result); - + $now=gmmktime(); + $i = 0; $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; @@ -103,7 +104,7 @@ class box_factures_fourn extends ModeleBoxes { $datec=$db->jdate($objp->datec); $late = ''; - if ($objp->paye == 0 && $datelimite < (time() - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dolibarr_print_date($datelimite,'day'))); + if ($objp->paye == 0 && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dolibarr_print_date($datelimite,'day'))); $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, diff --git a/htdocs/includes/boxes/box_factures_fourn_imp.php b/htdocs/includes/boxes/box_factures_fourn_imp.php index 39c44df026a..9e2661bf0e4 100644 --- a/htdocs/includes/boxes/box_factures_fourn_imp.php +++ b/htdocs/includes/boxes/box_factures_fourn_imp.php @@ -87,8 +87,9 @@ class box_factures_fourn_imp extends ModeleBoxes { $result = $db->query($sql); if ($result) { - $num = $db->num_rows(); - + $num = $db->num_rows($result); + $now=gmmktime(); + $i = 0; $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; @@ -98,7 +99,7 @@ class box_factures_fourn_imp extends ModeleBoxes { $datelimite=$db->jdate($objp->datelimite); $late=''; - if ($datelimite < (time() - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date,dolibarr_print_date($datelimite,'day'))); + if ($datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date,dolibarr_print_date($datelimite,'day'))); $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, diff --git a/htdocs/includes/boxes/box_factures_imp.php b/htdocs/includes/boxes/box_factures_imp.php index b9f92ad121d..ff4c81f753d 100644 --- a/htdocs/includes/boxes/box_factures_imp.php +++ b/htdocs/includes/boxes/box_factures_imp.php @@ -21,7 +21,7 @@ /** \file htdocs/includes/boxes/box_factures_imp.php \ingroup factures - \brief Module de génération de l'affichage de la box factures impayees + \brief Module de g�n�ration de l'affichage de la box factures impayees \version $Id$ */ @@ -55,8 +55,8 @@ class box_factures_imp extends ModeleBoxes { } /** - * \brief Charge les données en mémoire pour affichage ultérieur - * \param $max Nombre maximum d'enregistrements à charger + * \brief Charge les donn�es en m�moire pour affichage ult�rieur + * \param $max Nombre maximum d'enregistrements � charger */ function loadBox($max=5) { @@ -92,7 +92,8 @@ class box_factures_imp extends ModeleBoxes { if ($result) { $num = $db->num_rows($result); - + $now=gmmktime(); + $i = 0; $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; @@ -102,7 +103,7 @@ class box_factures_imp extends ModeleBoxes { $datelimite=$db->jdate($objp->datelimite); $late=''; - if ($datelimite < (time() - $conf->facture->warning_delay)) $late = img_warning(sprintf($l_due_date,dolibarr_print_date($datelimite,'day'))); + if ($datelimite < ($now - $conf->facture->warning_delay)) $late = img_warning(sprintf($l_due_date,dolibarr_print_date($datelimite,'day'))); $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, diff --git a/htdocs/includes/boxes/box_propales.php b/htdocs/includes/boxes/box_propales.php index 07e723cbffe..61d79d686db 100644 --- a/htdocs/includes/boxes/box_propales.php +++ b/htdocs/includes/boxes/box_propales.php @@ -21,7 +21,7 @@ /** \file htdocs/includes/boxes/box_propales.php \ingroup propales - \brief Module de génération de l'affichage de la box propales + \brief Module de g�n�ration de l'affichage de la box propales \version $Id$ */ @@ -54,13 +54,13 @@ class box_propales extends ModeleBoxes { } /** - * \brief Charge les données en mémoire pour affichage ultérieur - * \param $max Nombre maximum d'enregistrements à charger + * \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; + global $user, $langs, $db, $conf; $this->max=$max; @@ -73,7 +73,7 @@ class box_propales extends ModeleBoxes { { $sql = "SELECT s.nom, s.rowid as socid,"; - $sql.= " p.rowid, p.ref, p.fk_statut, p.datep as dp, p.datec"; + $sql.= " p.rowid, p.ref, p.fk_statut, p.datep as dp, p.datec, p.fin_validite, p.date_cloture"; if (!$user->rights->societe->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->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -91,13 +91,19 @@ class box_propales extends ModeleBoxes { if ($result) { $num = $db->num_rows($result); - + $now=gmmktime(); + $i = 0; while ($i < $num) { $objp = $db->fetch_object($result); $datec=$db->jdate($objp->datec); + $dateterm=$db->jdate($objp->fin_validite); + $dateclose=$db->jdate($objp->date_cloture); + + $late = ''; + if ($objp->fk_statut == 1 && $dateterm < ($now - $conf->propal->cloture->warning_delay)) { $late = img_warning($langs->trans("Late")); } $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, @@ -105,6 +111,7 @@ class box_propales extends ModeleBoxes { $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $objp->ref, + 'text2'=> $late, 'url' => DOL_URL_ROOT."/comm/propal.php?propalid=".$objp->rowid); $this->info_box_contents[$i][2] = array('td' => 'align="left"', diff --git a/htdocs/includes/boxes/box_services_vendus.php b/htdocs/includes/boxes/box_services_vendus.php index 87d9c399948..9f9b68da3c2 100644 --- a/htdocs/includes/boxes/box_services_vendus.php +++ b/htdocs/includes/boxes/box_services_vendus.php @@ -21,7 +21,7 @@ /** * \file htdocs/includes/boxes/box_services_vendus.php * \ingroup produits,services - * \brief Module de génération de l'affichage de la box services_vendus + * \brief Module de g�n�ration de l'affichage de la box services_vendus * \version $Id$ */ @@ -53,8 +53,8 @@ class box_services_vendus extends ModeleBoxes { } /** - * \brief Charge les données en mémoire pour affichage ultérieur - * \param $max Nombre maximum d'enregistrements à charger + * \brief Charge les donn�es en m�moire pour affichage ult�rieur + * \param $max Nombre maximum d'enregistrements � charger */ function loadBox($max=5) { @@ -98,7 +98,8 @@ class box_services_vendus extends ModeleBoxes { if ($result) { $num = $db->num_rows($result); - + $now=gmmktime(); + $i = 0; while ($i < $num) diff --git a/htdocs/index.php b/htdocs/index.php index e381335fceb..112a47d07e7 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -287,9 +287,9 @@ if ($conf->agenda->enabled && $user->rights->agenda->myactions->read) $var=!$var; print '
| '.img_object($langs->trans("Actions"),"task").' | '.$board->label.' | '; - print ''.$board->nbtodo.' | '; + print ''.$board->nbtodo.' | '; print ''; - print ''; + print ''; print $board->nbtodolate; print ' | ';
print ' (>'.ceil($board->warning_delay).' '.$langs->trans("days").')';
diff --git a/htdocs/install/check.php b/htdocs/install/check.php
index a3ecb437c57..aeb8bed0c28 100644
--- a/htdocs/install/check.php
+++ b/htdocs/install/check.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2008 Laurent Destailleur |