Remove warnings
This commit is contained in:
parent
f5931aa6f0
commit
51cf79a123
@ -71,7 +71,7 @@ class box_actions extends ModeleBoxes {
|
|||||||
|
|
||||||
if ($user->rights->agenda->myactions->read)
|
if ($user->rights->agenda->myactions->read)
|
||||||
{
|
{
|
||||||
$sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp , a.percent as percentage,";
|
$sql = "SELECT a.id, a.label, a.datep as dp , a.percent as percentage,";
|
||||||
$sql.= " ta.code,";
|
$sql.= " ta.code,";
|
||||||
$sql.= " s.nom, s.rowid as socid";
|
$sql.= " s.nom, s.rowid as socid";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
@ -99,8 +99,9 @@ class box_actions extends ModeleBoxes {
|
|||||||
{
|
{
|
||||||
$late = '';
|
$late = '';
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
$datelimite=$db->jdate($obj->dp);
|
||||||
|
|
||||||
if (date("U",$objp->dp) < (time() - $conf->global->MAIN_DELAY_ACTIONS_TODO)) $late=img_warning($langs->trans("Late"));
|
if ($datelimite < (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);
|
$label=($langs->transnoentities("Action".$objp->code)!=("Action".$objp->code) ? $langs->transnoentities("Action".$objp->code) : $objp->label);
|
||||||
|
|
||||||
@ -118,7 +119,7 @@ class box_actions extends ModeleBoxes {
|
|||||||
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
|
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
|
||||||
|
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
|
$this->info_box_contents[$i][3] = array('td' => 'align="left"',
|
||||||
'text' => dolibarr_print_date($objp->dp, "dayhour"));
|
'text' => dolibarr_print_date($datelimite, "dayhour"));
|
||||||
|
|
||||||
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
|
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
|
||||||
'text' => $objp->percentage. "%");
|
'text' => $objp->percentage. "%");
|
||||||
|
|||||||
@ -67,7 +67,7 @@ class box_clients extends ModeleBoxes {
|
|||||||
|
|
||||||
if ($user->rights->societe->lire)
|
if ($user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT s.nom, s.rowid as socid, ".$db->pdate("s.datec")." as dc";
|
$sql = "SELECT s.nom, s.rowid as socid, s.datec as dc";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$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";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -85,12 +85,14 @@ class box_clients extends ModeleBoxes {
|
|||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
|
$datec=$db->jdate($objp->dc);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
//$customerstatic=new Client($db);
|
//$customerstatic=new Client($db);
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
$datec=$db->jdate($objp->dc);
|
||||||
|
|
||||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||||
'logo' => $this->boximg,
|
'logo' => $this->boximg,
|
||||||
@ -101,7 +103,7 @@ class box_clients extends ModeleBoxes {
|
|||||||
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
|
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
|
||||||
|
|
||||||
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
|
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
|
||||||
'text' => dolibarr_print_date($objp->dc, "day"));
|
'text' => dolibarr_print_date($datec, "day"));
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -89,7 +89,8 @@ class box_commandes extends ModeleBoxes {
|
|||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows($result);
|
||||||
|
$datem=$db->jdate($objp->tms);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
@ -110,7 +111,7 @@ class box_commandes extends ModeleBoxes {
|
|||||||
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
|
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
|
||||||
|
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
||||||
'text' => dolibarr_print_date($objp->tms,'day'),
|
'text' => dolibarr_print_date($datem,'day'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
|
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
|
||||||
|
|||||||
@ -62,9 +62,9 @@ class box_energie_releve extends ModeleBoxes {
|
|||||||
$this->info_box_head = array('text' => $text,$max);
|
$this->info_box_head = array('text' => $text,$max);
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT ec.libelle, ".$db->pdate("date_releve")." as date_releve, ecr.valeur, ec.rowid";
|
$sql = "SELECT ec.libelle, ecr.valeur, ec.rowid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."energie_compteur_releve as ecr";
|
$sql .= " FROM ".MAIN_DB_PREFIX."energie_compteur_releve as ecr,";
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."energie_compteur as ec";
|
$sql .= " ".MAIN_DB_PREFIX."energie_compteur as ec";
|
||||||
$sql .= " WHERE ecr.fk_compteur = ec.rowid";
|
$sql .= " WHERE ecr.fk_compteur = ec.rowid";
|
||||||
$sql .= " ORDER BY ecr.date_releve DESC LIMIT 5";
|
$sql .= " ORDER BY ecr.date_releve DESC LIMIT 5";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|||||||
@ -16,16 +16,14 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
* $Source$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/includes/boxes/box_factures.php
|
\file htdocs/includes/boxes/box_factures.php
|
||||||
\ingroup factures
|
\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$
|
||||||
|
*/
|
||||||
|
|
||||||
include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php");
|
include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php");
|
||||||
|
|
||||||
@ -75,10 +73,10 @@ class box_factures extends ModeleBoxes {
|
|||||||
|
|
||||||
if ($user->rights->facture->lire)
|
if ($user->rights->facture->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT f.rowid as facid, f.facnumber, f.type, f.amount, ".$db->pdate("f.datef")." as df,";
|
$sql = "SELECT f.rowid as facid, f.facnumber, f.type, f.amount, f.datef as df,";
|
||||||
$sql.= " f.paye, f.fk_statut, f.datec,";
|
$sql.= " f.paye, f.fk_statut, f.datec,";
|
||||||
$sql.= " s.nom, s.rowid as socid, ";
|
$sql.= " s.nom, s.rowid as socid,";
|
||||||
$sql.= $db->pdate('f.date_lim_reglement')." as datelimite ";
|
$sql.= " f.date_lim_reglement as datelimite ";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
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."facture as f";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -92,10 +90,9 @@ class box_factures extends ModeleBoxes {
|
|||||||
$sql.= $db->plimit($max, 0);
|
$sql.= $db->plimit($max, 0);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)';
|
$l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)';
|
||||||
@ -103,12 +100,14 @@ class box_factures extends ModeleBoxes {
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
$datelimite=$db->jdate($objp->datelimite);
|
||||||
|
$datec=$db->jdate($objp->datec);
|
||||||
|
|
||||||
$picto='bill';
|
$picto='bill';
|
||||||
if ($objp->type == 1) $picto.='r';
|
if ($objp->type == 1) $picto.='r';
|
||||||
if ($objp->type == 2) $picto.='a';
|
if ($objp->type == 2) $picto.='a';
|
||||||
$late = '';
|
$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')));}
|
if($objp->paye == 0 && $datelimite < (time() - $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"',
|
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||||
'logo' => $picto,
|
'logo' => $picto,
|
||||||
@ -125,7 +124,7 @@ class box_factures extends ModeleBoxes {
|
|||||||
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
|
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
|
||||||
|
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
||||||
'text' => dolibarr_print_date($objp->datec,'day'),
|
'text' => dolibarr_print_date($datec,'day'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
|
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -18,11 +18,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/includes/boxes/box_factures_fourn.php
|
* \file htdocs/includes/boxes/box_factures_fourn.php
|
||||||
\ingroup fournisseur
|
* \ingroup supplier
|
||||||
\brief Fichier de gestion d'une box des factures fournisseurs
|
* \brief Fichier de gestion d'une box des factures fournisseurs
|
||||||
\version $Id$
|
* \version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php");
|
include_once(DOL_DOCUMENT_ROOT."/includes/boxes/modules_boxes.php");
|
||||||
|
|
||||||
@ -71,9 +71,11 @@ class box_factures_fourn extends ModeleBoxes {
|
|||||||
if ($user->rights->fournisseur->facture->lire)
|
if ($user->rights->fournisseur->facture->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT s.nom, s.rowid as socid,";
|
$sql = "SELECT s.nom, s.rowid as socid,";
|
||||||
$sql.= " f.rowid as facid, f.facnumber, f.amount,".$db->pdate("f.datef")." as df,";
|
$sql.= " f.rowid as facid, f.facnumber, f.amount,";
|
||||||
$sql.= " f.paye, f.fk_statut, f.datec,";
|
$sql.= " f.paye, f.fk_statut,";
|
||||||
$sql.= ' '.$db->pdate('f.date_lim_reglement').' as datelimite ';
|
$sql.= ' f.datef as df,';
|
||||||
|
$sql.= ' f.datec as datec,';
|
||||||
|
$sql.= ' f.date_lim_reglement as datelimite ';
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
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."facture_fourn as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_fourn as f";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -87,7 +89,6 @@ class box_factures_fourn extends ModeleBoxes {
|
|||||||
$sql .= $db->plimit($max, 0);
|
$sql .= $db->plimit($max, 0);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
@ -98,8 +99,11 @@ class box_factures_fourn extends ModeleBoxes {
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
$datelimite=$db->jdate($obj->datelimite);
|
||||||
|
$datec=$db->jdate($objp->datec);
|
||||||
|
|
||||||
$late = '';
|
$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')));
|
if ($objp->paye == 0 && $datelimite < (time() - $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"',
|
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||||
'logo' => $this->boximg,
|
'logo' => $this->boximg,
|
||||||
@ -115,7 +119,7 @@ class box_factures_fourn extends ModeleBoxes {
|
|||||||
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
|
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
|
||||||
|
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
||||||
'text' => dolibarr_print_date($objp->datec,'day'));
|
'text' => dolibarr_print_date($datec,'day'));
|
||||||
|
|
||||||
$this->info_box_contents[$i][4] = array('td' => '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));
|
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3));
|
||||||
|
|||||||
@ -68,10 +68,9 @@ class box_factures_fourn_imp extends ModeleBoxes {
|
|||||||
|
|
||||||
if ($user->rights->fournisseur->facture->lire)
|
if ($user->rights->fournisseur->facture->lire)
|
||||||
{
|
{
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.rowid as socid,";
|
$sql = "SELECT s.nom, s.rowid as socid,";
|
||||||
$sql.= " f.facnumber,".$db->pdate("f.date_lim_reglement")." as datelimite,";
|
$sql.= " f.facnumber, f.date_lim_reglement as datelimite,";
|
||||||
$sql.= " f.amount,".$db->pdate("f.datef")." as df,";
|
$sql.= " f.amount, f.datef as df,";
|
||||||
$sql.= " f.paye, f.fk_statut, f.rowid as facid";
|
$sql.= " f.paye, f.fk_statut, f.rowid as facid";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
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."facture_fourn as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_fourn as f";
|
||||||
@ -96,9 +95,10 @@ class box_factures_fourn_imp extends ModeleBoxes {
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
$datelimite=$db->jdate($objp->datelimite);
|
||||||
|
|
||||||
$late='';
|
$late='';
|
||||||
if ($objp->datelimite < (time() - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date,dolibarr_print_date($objp->datelimite,'day')));
|
if ($datelimite < (time() - $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"',
|
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||||
'logo' => $this->boximg,
|
'logo' => $this->boximg,
|
||||||
@ -114,7 +114,7 @@ class box_factures_fourn_imp extends ModeleBoxes {
|
|||||||
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
|
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
|
||||||
|
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
||||||
'text' => dolibarr_print_date($objp->datelimite,'day'));
|
'text' => dolibarr_print_date($datelimite,'day'));
|
||||||
|
|
||||||
$this->info_box_contents[$i][4] = array('td' => '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));
|
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3));
|
||||||
|
|||||||
@ -72,8 +72,8 @@ class box_factures_imp extends ModeleBoxes {
|
|||||||
if ($user->rights->facture->lire)
|
if ($user->rights->facture->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT s.nom, s.rowid as socid,";
|
$sql = "SELECT s.nom, s.rowid as socid,";
|
||||||
$sql.= " f.facnumber,".$db->pdate("f.date_lim_reglement")." as datelimite,";
|
$sql.= " f.facnumber, f.date_lim_reglement as datelimite,";
|
||||||
$sql.= " f.amount,".$db->pdate("f.datef")." as df,";
|
$sql.= " f.amount, f.datef as df,";
|
||||||
$sql.= " f.paye, f.fk_statut, f.rowid as facid";
|
$sql.= " f.paye, f.fk_statut, f.rowid as facid";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
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."facture as f";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
||||||
@ -99,9 +99,10 @@ class box_factures_imp extends ModeleBoxes {
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
$datelimite=$db->jdate($objp->datelimite);
|
||||||
|
|
||||||
$late='';
|
$late='';
|
||||||
if ($objp->datelimite < (time() - $conf->facture->warning_delay)) $late = img_warning(sprintf($l_due_date,dolibarr_print_date($objp->datelimite,'day')));
|
if ($datelimite < (time() - $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"',
|
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||||
'logo' => $this->boximg,
|
'logo' => $this->boximg,
|
||||||
@ -118,10 +119,10 @@ class box_factures_imp extends ModeleBoxes {
|
|||||||
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
|
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
|
||||||
|
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
||||||
'text' => dolibarr_print_date($objp->datelimite,'day'),
|
'text' => dolibarr_print_date($datelimite,'day'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->info_box_contents[$i][3] = array('td' => '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));
|
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3));
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -66,7 +66,7 @@ class box_fournisseurs extends ModeleBoxes {
|
|||||||
|
|
||||||
if ($user->rights->societe->lire)
|
if ($user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT s.nom, s.rowid as socid, ".$db->pdate("s.datec")." as dc";
|
$sql = "SELECT s.nom, s.rowid as socid, s.datec as dc";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$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";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -80,7 +80,6 @@ class box_fournisseurs extends ModeleBoxes {
|
|||||||
$sql .= $db->plimit($max, 0);
|
$sql .= $db->plimit($max, 0);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
@ -90,6 +89,7 @@ class box_fournisseurs extends ModeleBoxes {
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
$datec=$db->jdate($objp->dc);
|
||||||
|
|
||||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||||
'logo' => $this->boximg,
|
'logo' => $this->boximg,
|
||||||
@ -100,7 +100,7 @@ class box_fournisseurs extends ModeleBoxes {
|
|||||||
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
|
'url' => DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid);
|
||||||
|
|
||||||
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
|
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
|
||||||
'text' => dolibarr_print_date($objp->dc, "day"));
|
'text' => dolibarr_print_date($datec, "day"));
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -89,6 +89,7 @@ class box_produits extends ModeleBoxes {
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
$datem=$db->jdate($obj->tms);
|
||||||
|
|
||||||
// Multilangs
|
// Multilangs
|
||||||
if ($conf->global->MAIN_MULTILANGS) // si l'option est active
|
if ($conf->global->MAIN_MULTILANGS) // si l'option est active
|
||||||
@ -130,7 +131,7 @@ class box_produits extends ModeleBoxes {
|
|||||||
'text' => $price_base_type);
|
'text' => $price_base_type);
|
||||||
|
|
||||||
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
|
$this->info_box_contents[$i][4] = array('td' => 'align="right"',
|
||||||
'text' => dolibarr_print_date($objp->tms,'day'));
|
'text' => dolibarr_print_date($datem,'day'));
|
||||||
|
|
||||||
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
|
$this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
|
||||||
'text' => $productstatic->LibStatut($objp->envente,3));
|
'text' => $productstatic->LibStatut($objp->envente,3));
|
||||||
|
|||||||
@ -73,7 +73,7 @@ class box_propales extends ModeleBoxes {
|
|||||||
{
|
{
|
||||||
|
|
||||||
$sql = "SELECT s.nom, s.rowid as socid,";
|
$sql = "SELECT s.nom, s.rowid as socid,";
|
||||||
$sql.= " p.rowid, p.ref, p.fk_statut, ".$db->pdate("p.datep")." as dp, p.datec";
|
$sql.= " p.rowid, p.ref, p.fk_statut, p.datep as dp, p.datec";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
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";
|
$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";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -90,13 +90,14 @@ class box_propales extends ModeleBoxes {
|
|||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows();
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
$datec=$db->jdate($objp->datec);
|
||||||
|
|
||||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||||
'logo' => $this->boximg,
|
'logo' => $this->boximg,
|
||||||
@ -111,7 +112,7 @@ class box_propales extends ModeleBoxes {
|
|||||||
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
|
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
|
||||||
|
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
||||||
'text' => dolibarr_print_date($objp->datec,'day'));
|
'text' => dolibarr_print_date($datec,'day'));
|
||||||
|
|
||||||
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
|
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
|
||||||
'text' => $propalstatic->LibStatut($objp->fk_statut,3));
|
'text' => $propalstatic->LibStatut($objp->fk_statut,3));
|
||||||
|
|||||||
@ -71,7 +71,7 @@ class box_prospect extends ModeleBoxes {
|
|||||||
|
|
||||||
if ($user->rights->societe->lire)
|
if ($user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT s.nom, s.rowid as socid, s.fk_stcomm, ".$db->pdate("s.datec")." as dc";
|
$sql = "SELECT s.nom, s.rowid as socid, s.fk_stcomm, s.datec as dc";
|
||||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$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";
|
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -95,6 +95,7 @@ class box_prospect extends ModeleBoxes {
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
|
$datec=$db->jdate($objp->dc);
|
||||||
|
|
||||||
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
|
||||||
'logo' => $this->boximg,
|
'logo' => $this->boximg,
|
||||||
@ -105,7 +106,7 @@ class box_prospect extends ModeleBoxes {
|
|||||||
'url' => DOL_URL_ROOT."/comm/prospect/fiche.php?socid=".$objp->socid);
|
'url' => DOL_URL_ROOT."/comm/prospect/fiche.php?socid=".$objp->socid);
|
||||||
|
|
||||||
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
|
$this->info_box_contents[$i][2] = array('td' => 'align="right"',
|
||||||
'text' => dolibarr_print_date($objp->dc, "day"));
|
'text' => dolibarr_print_date($datec, "day"));
|
||||||
|
|
||||||
$this->info_box_contents[$i][3] = array('td' => '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)));
|
'text' => eregi_replace('img ','img height="14px" ',$prospectstatic->LibStatut($objp->fk_stcomm,3)));
|
||||||
|
|||||||
@ -104,6 +104,7 @@ class box_services_vendus extends ModeleBoxes {
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
|
$datem=$db->jdate($objp->datem);
|
||||||
|
|
||||||
// Multilangs
|
// Multilangs
|
||||||
if ($conf->global->MAIN_MULTILANGS) // si l'option est active
|
if ($conf->global->MAIN_MULTILANGS) // si l'option est active
|
||||||
@ -135,7 +136,7 @@ class box_services_vendus extends ModeleBoxes {
|
|||||||
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
|
'url' => DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->socid);
|
||||||
|
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
$this->info_box_contents[$i][3] = array('td' => 'align="right"',
|
||||||
'text' => dolibarr_print_date($objp->datem,'day'));
|
'text' => dolibarr_print_date($datem,'day'));
|
||||||
|
|
||||||
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
|
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
|
||||||
'text' => $contratlignestatic->LibStatut($objp->statut,3)
|
'text' => $contratlignestatic->LibStatut($objp->statut,3)
|
||||||
|
|||||||
@ -103,6 +103,8 @@ class ModeleBoxes
|
|||||||
$bcx[1] = 'class="box_impair"';
|
$bcx[1] = 'class="box_impair"';
|
||||||
$var = true;
|
$var = true;
|
||||||
|
|
||||||
|
dolibarr_syslog("modules_box::showBox ".get_Class($this));
|
||||||
|
|
||||||
// Define nbcol and nblines of the box to show
|
// Define nbcol and nblines of the box to show
|
||||||
$nbcol=0;
|
$nbcol=0;
|
||||||
if (isset($contents[0])) $nbcol=sizeof($contents[0]);
|
if (isset($contents[0])) $nbcol=sizeof($contents[0]);
|
||||||
|
|||||||
@ -533,24 +533,37 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Formatage (par PHP) d'une date vers format texte pour insertion dans champ date.
|
* \brief Formatage (par PHP) d'une date vers format texte pour insertion dans champ date.
|
||||||
Fonction <EFBFBD> utiliser pour g<EFBFBD>n<EFBFBD>rer les INSERT.
|
* Fonction a utiliser pour generer les INSERT.
|
||||||
\param param Date TMS <EFBFBD> convertir
|
* \param param Date TMS a convertir
|
||||||
\return date Date au format texte YYYYMMDDHHMMSS.
|
* \return date Date au format texte YYYYMMDDHHMMSS.
|
||||||
*/
|
*/
|
||||||
function idate($param)
|
function idate($param)
|
||||||
{
|
{
|
||||||
//return "dbo.from_unixtime(".$param.")";
|
//return "dbo.from_unixtime(".$param.")";
|
||||||
return adodb_strftime("%d/%m/%Y %H:%M:%S",$param);
|
return adodb_strftime("%Y-%m-%d %H:%M:%S",$param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Convert a GM string date into a GM Timestamps date
|
||||||
|
* \param string Date in a string (YYYYMMDD, YYYYMMDDHHMMSS, YYYY-MM-DD HH:MM:SS)
|
||||||
|
* \return date Date
|
||||||
|
* \example 19700101020000 -> 7200
|
||||||
|
*/
|
||||||
|
function jdate($string)
|
||||||
|
{
|
||||||
|
$string=eregi_replace('[^0-9]','',$string);
|
||||||
|
$tmp=$string.'000000';
|
||||||
|
$date=dolibarr_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),1);
|
||||||
|
return $date;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Formatage d'un if SQL
|
* \brief Formatage d'un if SQL
|
||||||
\param test chaine test
|
* \param test chaine test
|
||||||
\param resok resultat si test egal
|
* \param resok resultat si test egal
|
||||||
\param resko resultat si test non egal
|
* \param resko resultat si test non egal
|
||||||
\return string chaine format<EFBFBD> SQL
|
* \return string chaine format<EFBFBD> SQL
|
||||||
*/
|
*/
|
||||||
function ifsql($test,$resok,$resko)
|
function ifsql($test,$resok,$resko)
|
||||||
{
|
{
|
||||||
@ -559,8 +572,8 @@ class DoliDb
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoie la derniere requete soumise par la methode query()
|
* \brief Renvoie la derniere requete soumise par la methode query()
|
||||||
\return lastquery
|
* \return lastquery
|
||||||
*/
|
*/
|
||||||
function lastquery()
|
function lastquery()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -519,7 +519,7 @@ class DoliDb
|
|||||||
* Fonction <EFBFBD> utiliser pour g<EFBFBD>n<EFBFBD>rer les SELECT.
|
* Fonction <EFBFBD> utiliser pour g<EFBFBD>n<EFBFBD>rer les SELECT.
|
||||||
* \param param Nom champ base de type date ou chaine 'YYYY-MM-DD HH:MM:SS'
|
* \param param Nom champ base de type date ou chaine 'YYYY-MM-DD HH:MM:SS'
|
||||||
* \return date Date au format TMS.
|
* \return date Date au format TMS.
|
||||||
* \TODO Remove unix_timestamp functions
|
* \TODO Remove unix_timestamp functions so use jdate instead
|
||||||
*/
|
*/
|
||||||
function pdate($param)
|
function pdate($param)
|
||||||
{
|
{
|
||||||
@ -527,23 +527,37 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Formatage (par PHP) d'une date vers format texte pour insertion dans champ date.
|
* \brief Convert (by PHP) a GM Timestamp date into a GM string date to insert into a date field.
|
||||||
* Fonction <EFBFBD> utiliser pour g<EFBFBD>n<EFBFBD>rer les INSERT, UPDATE ou les clauses WHERE
|
* Function to use to build INSERT, UPDATE or WHERE predica
|
||||||
* \param param Date TMS <EFBFBD> convertir
|
* \param param Date TMS to convert
|
||||||
* \return date Date au format texte YYYYMMDDHHMMSS.
|
* \return string Date in a string YYYYMMDDHHMMSS
|
||||||
*/
|
*/
|
||||||
function idate($param)
|
function idate($param)
|
||||||
{
|
{
|
||||||
return adodb_strftime("%Y%m%d%H%M%S",$param);
|
return adodb_strftime("%Y%m%d%H%M%S",$param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Convert (by PHP) a GM string date into a GM Timestamps date
|
||||||
|
* \param string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS)
|
||||||
|
* \return date Date TMS
|
||||||
|
* \example 19700101020000 -> 7200
|
||||||
|
*/
|
||||||
|
function jdate($string)
|
||||||
|
{
|
||||||
|
$string=eregi_replace('[^0-9]','',$string);
|
||||||
|
$tmp=$string.'000000';
|
||||||
|
$date=dolibarr_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),1);
|
||||||
|
return $date;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Formatage d'un if SQL
|
* \brief Formatage d'un if SQL
|
||||||
\param test chaine test
|
* \param test chaine test
|
||||||
\param resok resultat si test egal
|
* \param resok resultat si test egal
|
||||||
\param resko resultat si test non egal
|
* \param resko resultat si test non egal
|
||||||
\return string chaine format<EFBFBD> SQL
|
* \return string chaine format<EFBFBD> SQL
|
||||||
*/
|
*/
|
||||||
function ifsql($test,$resok,$resko)
|
function ifsql($test,$resok,$resko)
|
||||||
{
|
{
|
||||||
@ -552,8 +566,8 @@ class DoliDb
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoie la derniere requete soumise par la methode query()
|
* \brief Renvoie la derniere requete soumise par la methode query()
|
||||||
\return lastquery
|
* \return lastquery
|
||||||
*/
|
*/
|
||||||
function lastquery()
|
function lastquery()
|
||||||
{
|
{
|
||||||
@ -561,8 +575,8 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoie la derniere requete en erreur
|
* \brief Renvoie la derniere requete en erreur
|
||||||
\return string lastqueryerror
|
* \return string lastqueryerror
|
||||||
*/
|
*/
|
||||||
function lastqueryerror()
|
function lastqueryerror()
|
||||||
{
|
{
|
||||||
@ -570,8 +584,8 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoie le libelle derniere erreur
|
* \brief Renvoie le libelle derniere erreur
|
||||||
\return string lasterror
|
* \return string lasterror
|
||||||
*/
|
*/
|
||||||
function lasterror()
|
function lasterror()
|
||||||
{
|
{
|
||||||
@ -579,8 +593,8 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoie le code derniere erreur
|
* \brief Renvoie le code derniere erreur
|
||||||
\return string lasterrno
|
* \return string lasterrno
|
||||||
*/
|
*/
|
||||||
function lasterrno()
|
function lasterrno()
|
||||||
{
|
{
|
||||||
@ -588,8 +602,8 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoie le code erreur generique de l'operation precedente.
|
* \brief Renvoie le code erreur generique de l'operation precedente.
|
||||||
\return error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...)
|
* \return error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...)
|
||||||
*/
|
*/
|
||||||
function errno()
|
function errno()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -533,7 +533,7 @@ class DoliDb
|
|||||||
* Fonction a utiliser pour generer les SELECT.
|
* Fonction a utiliser pour generer les SELECT.
|
||||||
* \param param Nom champ base de type date ou chaine 'YYYY-MM-DD HH:MM:SS'
|
* \param param Nom champ base de type date ou chaine 'YYYY-MM-DD HH:MM:SS'
|
||||||
* \return date Date au format TMS.
|
* \return date Date au format TMS.
|
||||||
* \TODO Remove unix_timestamp functions
|
* \TODO Remove unix_timestamp functions so use jdate instead
|
||||||
*/
|
*/
|
||||||
function pdate($param)
|
function pdate($param)
|
||||||
{
|
{
|
||||||
@ -541,23 +541,37 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Formatage (par PHP) d'une date vers format texte pour insertion dans champ date.
|
* \brief Convert (by PHP) a GM Timestamp date into a GM string date to insert into a date field.
|
||||||
* Fonction a utiliser pour generer les INSERT, UPDATE ou les clauses WHERE
|
* Function to use to build INSERT, UPDATE or WHERE predica
|
||||||
* \param param Date TMS to convert
|
* \param param Date TMS to convert
|
||||||
* \return date Date au format texte YYYYMMDDHHMMSS.
|
* \return string Date in a string YYYYMMDDHHMMSS
|
||||||
*/
|
*/
|
||||||
function idate($param)
|
function idate($param)
|
||||||
{
|
{
|
||||||
return adodb_strftime("%Y%m%d%H%M%S",$param);
|
return adodb_strftime("%Y%m%d%H%M%S",$param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Convert (by PHP) a GM string date into a GM Timestamps date
|
||||||
|
* \param string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS)
|
||||||
|
* \return date Date TMS
|
||||||
|
* \example 19700101020000 -> 7200
|
||||||
|
*/
|
||||||
|
function jdate($string)
|
||||||
|
{
|
||||||
|
$string=eregi_replace('[^0-9]','',$string);
|
||||||
|
$tmp=$string.'000000';
|
||||||
|
$date=dolibarr_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),1);
|
||||||
|
return $date;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Formatage d'un if SQL
|
* \brief Formatage d'un if SQL
|
||||||
\param test chaine test
|
* \param test chaine test
|
||||||
\param resok resultat si test egal
|
* \param resok resultat si test egal
|
||||||
\param resko resultat si test non egal
|
* \param resko resultat si test non egal
|
||||||
\return string chaine format<EFBFBD> SQL
|
* \return string chaine formatee SQL
|
||||||
*/
|
*/
|
||||||
function ifsql($test,$resok,$resko)
|
function ifsql($test,$resok,$resko)
|
||||||
{
|
{
|
||||||
@ -566,8 +580,8 @@ class DoliDb
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoie la derniere requete soumise par la methode query()
|
* \brief Renvoie la derniere requete soumise par la methode query()
|
||||||
\return lastquery
|
* \return lastquery
|
||||||
*/
|
*/
|
||||||
function lastquery()
|
function lastquery()
|
||||||
{
|
{
|
||||||
@ -575,8 +589,8 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoie la derniere requete en erreur
|
* \brief Renvoie la derniere requete en erreur
|
||||||
\return string lastqueryerror
|
* \return string lastqueryerror
|
||||||
*/
|
*/
|
||||||
function lastqueryerror()
|
function lastqueryerror()
|
||||||
{
|
{
|
||||||
@ -584,8 +598,8 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoie le libelle derniere erreur
|
* \brief Renvoie le libelle derniere erreur
|
||||||
\return string lasterror
|
* \return string lasterror
|
||||||
*/
|
*/
|
||||||
function lasterror()
|
function lasterror()
|
||||||
{
|
{
|
||||||
@ -593,8 +607,8 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoie le code derniere erreur
|
* \brief Renvoie le code derniere erreur
|
||||||
\return string lasterrno
|
* \return string lasterrno
|
||||||
*/
|
*/
|
||||||
function lasterrno()
|
function lasterrno()
|
||||||
{
|
{
|
||||||
@ -602,8 +616,8 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoie le code erreur generique de l'operation precedente.
|
* \brief Renvoie le code erreur generique de l'operation precedente.
|
||||||
\return error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...)
|
* \return error_num (Exemples: DB_ERROR_TABLE_ALREADY_EXISTS, DB_ERROR_RECORD_ALREADY_EXISTS...)
|
||||||
*/
|
*/
|
||||||
function errno()
|
function errno()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -659,23 +659,36 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Formatage (par PHP) de la date en texte qui s'insere dans champ date.
|
* \brief Convert (by PHP) a GM Timestamp date into a GM string date to insert into a date field.
|
||||||
Fonction <EFBFBD> utiliser pour g<EFBFBD>n<EFBFBD>rer les INSERT.
|
* Function to use to build INSERT, UPDATE or WHERE predica
|
||||||
\param param Date tms <EFBFBD> convertir
|
* \param param Date TMS to convert
|
||||||
\return date Date au format text YYYYMMDDHHMMSS.
|
* \return string Date in a string YYYYMMDDHHMMSS
|
||||||
*/
|
*/
|
||||||
function idate($param)
|
function idate($param)
|
||||||
{
|
{
|
||||||
return adodb_strftime("%Y%m%d%H%M%S",$param);
|
return adodb_strftime("%Y%m%d%H%M%S",$param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Convert (by PHP) a GM string date into a GM Timestamps date
|
||||||
|
* \param string Date in a string (YYYYMMDDHHMMSS, YYYYMMDD, YYYY-MM-DD HH:MM:SS)
|
||||||
|
* \return date Date TMS
|
||||||
|
* \example 19700101020000 -> 7200
|
||||||
|
*/
|
||||||
|
function jdate($string)
|
||||||
|
{
|
||||||
|
$string=eregi_replace('[^0-9]','',$string);
|
||||||
|
$tmp=$string.'000000';
|
||||||
|
$date=dolibarr_mktime(substr($tmp,8,2),substr($tmp,10,2),substr($tmp,12,2),substr($tmp,4,2),substr($tmp,6,2),substr($tmp,0,4),1);
|
||||||
|
return $date;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Formatage d'un if SQL
|
* \brief Formatage d'un if SQL
|
||||||
\param test chaine test
|
* \param test chaine test
|
||||||
\param resok resultat si test egal
|
* \param resok resultat si test egal
|
||||||
\param resko resultat si test non egal
|
* \param resko resultat si test non egal
|
||||||
\return string chaine format<EFBFBD> SQL
|
* \return string chaine format<EFBFBD> SQL
|
||||||
*/
|
*/
|
||||||
function ifsql($test,$resok,$resko)
|
function ifsql($test,$resok,$resko)
|
||||||
{
|
{
|
||||||
@ -684,8 +697,8 @@ class DoliDb
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoie la derniere requete soumise par la methode query()
|
* \brief Renvoie la derniere requete soumise par la methode query()
|
||||||
\return lastquery
|
* \return lastquery
|
||||||
*/
|
*/
|
||||||
function lastquery()
|
function lastquery()
|
||||||
{
|
{
|
||||||
@ -693,8 +706,8 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoie la derniere requete en erreur
|
* \brief Renvoie la derniere requete en erreur
|
||||||
\return string lastqueryerror
|
* \return string lastqueryerror
|
||||||
*/
|
*/
|
||||||
function lastqueryerror()
|
function lastqueryerror()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -475,7 +475,7 @@ function dolibarr_print_date($time,$format='',$to_gmt=false,$outputlangs='')
|
|||||||
if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?',$time,$reg))
|
if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?',$time,$reg))
|
||||||
{
|
{
|
||||||
// This part of code should not be used.
|
// This part of code should not be used.
|
||||||
dolibarr_syslog("Functions.lib::dolibarr_print_date function call with deprecated parameter", LOG_WARNING);
|
dolibarr_syslog("Functions.lib::dolibarr_print_date function call with deprecated parameter in page ".$_SERVER["PHP_SELF"], LOG_WARNING);
|
||||||
// Date est au format 'YYYY-MM-DD' ou 'YYYY-MM-DD HH:MM:SS'
|
// Date est au format 'YYYY-MM-DD' ou 'YYYY-MM-DD HH:MM:SS'
|
||||||
$syear = $reg[1];
|
$syear = $reg[1];
|
||||||
$smonth = $reg[2];
|
$smonth = $reg[2];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user