diff --git a/htdocs/accountancy/class/accountancyaccount.class.php b/htdocs/accountancy/class/accountancyaccount.class.php index dfd591ae6cd..3d5814d143a 100644 --- a/htdocs/accountancy/class/accountancyaccount.class.php +++ b/htdocs/accountancy/class/accountancyaccount.class.php @@ -59,9 +59,11 @@ class AccountancyAccount */ function create($user) { + $now=dol_now(); + $sql = "INSERT INTO ".MAIN_DB_PREFIX."accountingaccount"; $sql.= " (date_creation, fk_user_author, numero,intitule)"; - $sql.= " VALUES (".$this->db->idate(gmmktime()).",".$user->id.",'".$this->numero."','".$this->intitule."')"; + $sql.= " VALUES (".$this->db->idate($now).",".$user->id.",'".$this->numero."','".$this->intitule."')"; $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index dc3d8f3c689..924aa8e100d 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -87,14 +87,15 @@ if ($result) $db->free($result); } +$now=dol_now(); // List members up to date // current rule: uptodate = the end date is in future whatever is type // old rule: uptodate = if type does not need payment, that end date is null, if type need payment that end date is in future) $sql = "SELECT count(*) as somme , d.fk_adherent_type"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t"; -//$sql.= " WHERE d.statut = 1 AND ((t.cotisation = 0 AND d.datefin IS NULL) OR d.datefin >= ".$db->idate(gmmktime()).')'; -$sql.= " WHERE d.statut = 1 AND d.datefin >= ".$db->idate(gmmktime()); +//$sql.= " WHERE d.statut = 1 AND ((t.cotisation = 0 AND d.datefin IS NULL) OR d.datefin >= ".$db->idate($now).')'; +$sql.= " WHERE d.statut = 1 AND d.datefin >= ".$db->idate($now); $sql.= " AND t.rowid = d.fk_adherent_type"; $sql.= " GROUP BY d.fk_adherent_type"; @@ -321,7 +322,7 @@ foreach ($AdherentType as $key => $adhtype) print ''.img_object($langs->trans("ShowType"),"group").' '.$adhtype->getNomUrl(0,dol_size(16)).''; print ''.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0?$MemberToValidate[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->cotisation,0,3).''; print ''.(isset($MembersValidated[$key]) && ($MembersValidated[$key]-$MemberUpToDate[$key] > 0) ? $MembersValidated[$key]-$MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,0,3).''; - print ''.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,gmmktime(),3).''; + print ''.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,$now,3).''; print ''.(isset($MembersResiliated[$key]) && $MembersResiliated[$key]> 0 ?$MembersResiliated[$key]:'').' '.$staticmember->LibStatut(0,$adhtype->cotisation,0,3).''; print "\n"; } @@ -329,7 +330,7 @@ print ''; print ''.$langs->trans("Total").''; print ''.$SommeA.' '.$staticmember->LibStatut(-1,$adhtype->cotisation,0,3).''; print ''.$SommeB.' '.$staticmember->LibStatut(1,$adhtype->cotisation,0,3).''; -print ''.$SommeC.' '.$staticmember->LibStatut(1,$adhtype->cotisation,gmmktime(),3).''; +print ''.$SommeC.' '.$staticmember->LibStatut(1,$adhtype->cotisation,$now,3).''; print ''.$SommeD.' '.$staticmember->LibStatut(0,$adhtype->cotisation,0,3).''; print ''; diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index a92d43ed23f..d3d30d7c723 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -101,6 +101,8 @@ class Bookmark $this->url=trim($this->url); $this->title=trim($this->title); if (empty($this->position)) $this->position=0; + + $now=dol_now(); $this->db->begin(); @@ -109,7 +111,7 @@ class Bookmark if ($this->fk_soc) $sql.=",fk_soc"; $sql.= ") VALUES ("; $sql.= ($this->fk_user > 0?"'".$this->fk_user."'":"0").","; - $sql.= " ".$this->db->idate(gmmktime()).","; + $sql.= " ".$this->db->idate($now).","; $sql.= " '".$this->url."', '".$this->target."',"; $sql.= " '".$this->db->escape($this->title)."', '".$this->favicon."', '".$this->position."'"; if ($this->fk_soc) $sql.=",".$this->fk_soc; diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 0dd7b00c318..397c5df77e5 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -314,8 +314,10 @@ class Mailing extends CommonObject */ function valid($user) { + $now=dol_now(); + $sql = "UPDATE ".MAIN_DB_PREFIX."mailing "; - $sql .= " SET statut = 1, date_valid = ".$this->db->idate(gmmktime()).", fk_user_valid=".$user->id; + $sql .= " SET statut = 1, date_valid = ".$this->db->idate($now).", fk_user_valid=".$user->id; $sql .= " WHERE rowid = ".$this->id; dol_syslog("Mailing::valid sql=".$sql, LOG_DEBUG); diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 736a46e7036..0b5425241f2 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -154,9 +154,11 @@ if ($_REQUEST["action"] == 'sendallconfirmed' && $_REQUEST['confirm'] == 'yes') if ($num) { dol_syslog("comm/mailing/fiche.php: nb of targets = ".$num, LOG_DEBUG); + + $now=dol_now(); // Positionne date debut envoi - $sql="UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi=".$db->idate(gmmktime())." WHERE rowid=".$id; + $sql="UPDATE ".MAIN_DB_PREFIX."mailing SET date_envoi=".$db->idate($now)." WHERE rowid=".$id; $resql2=$db->query($sql); if (! $resql2) { @@ -245,7 +247,7 @@ if ($_REQUEST["action"] == 'sendallconfirmed' && $_REQUEST['confirm'] == 'yes') dol_syslog("comm/mailing/fiche.php: ok for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG); $sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; - $sql.=" SET statut=1, date_envoi=".$db->idate(gmmktime())." WHERE rowid=".$obj->rowid; + $sql.=" SET statut=1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj->rowid; $resql2=$db->query($sql); if (! $resql2) { @@ -260,7 +262,7 @@ if ($_REQUEST["action"] == 'sendallconfirmed' && $_REQUEST['confirm'] == 'yes') dol_syslog("comm/mailing/fiche.php: error for #".$i.($mail->error?' - '.$mail->error:''), LOG_WARNING); $sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; - $sql.=" SET statut=-1, date_envoi=".$db->idate(gmmktime())." WHERE rowid=".$obj->rowid; + $sql.=" SET statut=-1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj->rowid; $resql2=$db->query($sql); if (! $resql2) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 0b7d018136c..9d20775a287 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2072,7 +2072,7 @@ class Propal extends CommonObject { global $conf, $user; - $now=gmmktime(); + $now=dol_now(); $this->nbtodo=$this->nbtodolate=0; $clause = " WHERE"; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 961112151ac..fde8d2411d3 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -74,7 +74,7 @@ if ($id > 0 || ! empty($ref)) { if ($mesg) print $mesg; - $now=gmmktime(); + $now=dol_now(); if ($object->fetch($id, $ref)) { diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 8c4a8b6f06e..252200cf6df 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -620,7 +620,8 @@ class Commande extends CommonObject // $date_commande is deprecated $date = ($this->date_commande ? $this->date_commande : $this->date); - + + $now=dol_now(); $this->db->begin(); @@ -630,7 +631,7 @@ class Commande extends CommonObject $sql.= ", remise_absolue, remise_percent"; $sql.= ", entity"; $sql.= ")"; - $sql.= " VALUES ('(PROV)',".$this->socid.", ".$this->db->idate(gmmktime()).", ".$user->id; + $sql.= " VALUES ('(PROV)',".$this->socid.", ".$this->db->idate($now).", ".$user->id; $sql.= ", ".($this->fk_project?$this->fk_project:"null"); $sql.= ", ".$this->db->idate($date); $sql.= ", ".($this->source>=0 && $this->source != '' ?$this->source:'null'); @@ -2348,7 +2349,7 @@ class Commande extends CommonObject { global $conf, $user; - $now=gmmktime(); + $now=dol_now(); $this->nbtodo=$this->nbtodolate=0; $clause = " WHERE"; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 7771520978d..de54bcdd128 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1323,7 +1323,7 @@ class Contrat extends CommonObject { global $conf, $user; - $now=gmmktime(); + $now=dol_now(); $this->nbtodo=$this->nbtodolate=0; diff --git a/htdocs/contrat/liste.php b/htdocs/contrat/liste.php index 177e27f2598..e72774e3dac 100644 --- a/htdocs/contrat/liste.php +++ b/htdocs/contrat/liste.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2012 Regis Houssin * * 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 @@ -59,7 +59,7 @@ $staticcontratligne=new ContratLigne($db); * View */ -$now=gmmktime(); +$now=dol_now(); llxHeader(); diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 72901e87a18..259a31ea998 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -87,7 +87,7 @@ class box_contracts extends ModeleBoxes if ($resql) { $num = $db->num_rows($resql); - $now=gmmktime(); + $now=dol_now(); $i = 0; diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index fc18d2ee453..736c13ce88a 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -93,7 +93,7 @@ class box_factures extends ModeleBoxes if ($result) { $num = $db->num_rows($result); - $now=gmmktime(); + $now=dol_now(); $i = 0; $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 394934438fd..45cccf95a97 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -93,7 +93,7 @@ class box_factures_fourn extends ModeleBoxes if ($result) { $num = $db->num_rows($result); - $now=gmmktime(); + $now=dol_now(); $i = 0; $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index ebbba5def70..571d3c3e558 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -91,7 +91,7 @@ class box_factures_fourn_imp extends ModeleBoxes if ($result) { $num = $db->num_rows($result); - $now=gmmktime(); + $now=dol_now(); $i = 0; $l_due_date = $langs->trans('Late').' ('.$langs->trans('DateEcheance').': %s)'; diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index a98ec274bfc..70487fca5ad 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -94,7 +94,7 @@ class box_factures_imp extends ModeleBoxes if ($result) { $num = $db->num_rows($result); - $now=gmmktime(); + $now=dol_now(); $i = 0; $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index dee694e72f6..9f818bc63f7 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -90,7 +90,7 @@ class box_propales extends ModeleBoxes if ($result) { $num = $db->num_rows($result); - $now=gmmktime(); + $now=dol_now(); $i = 0; diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index a706254ee0b..646be1ca90c 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -95,7 +95,7 @@ class box_services_contracts extends ModeleBoxes if ($result) { $num = $db->num_rows($result); - $now=gmmktime(); + $now=dol_now(); $i = 0; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2d9c8b9d029..a077743dc92 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1102,6 +1102,7 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1) function dol_now($mode='gmt') { // Note that gmmktime and mktime return same value (GMT) whithout parameters + //if ($mode == 'gmt') $ret=gmmktime(); // Strict Standards: gmmktime(): You should be using the time() function instead if ($mode == 'gmt') $ret=time(); // Time for now at greenwich. else if ($mode == 'tzserver') // Time for now with PHP server timezone added { diff --git a/htdocs/core/modules/cheque/pdf/modules_chequereceipts.php b/htdocs/core/modules/cheque/pdf/modules_chequereceipts.php index 64f3ad48635..5943e534ca3 100644 --- a/htdocs/core/modules/cheque/pdf/modules_chequereceipts.php +++ b/htdocs/core/modules/cheque/pdf/modules_chequereceipts.php @@ -45,7 +45,7 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator * @param string $maxfilenamelength Max length of value to show * @return array List of templates */ - function liste_modeles($db,$maxfilenamelength=0) + static function liste_modeles($db,$maxfilenamelength=0) { global $conf; diff --git a/htdocs/core/modules/commande/modules_commande.php b/htdocs/core/modules/commande/modules_commande.php index a70c1a8d97f..e327b84bab9 100644 --- a/htdocs/core/modules/commande/modules_commande.php +++ b/htdocs/core/modules/commande/modules_commande.php @@ -48,7 +48,7 @@ abstract class ModelePDFCommandes extends CommonDocGenerator * @param string $maxfilenamelength Max length of value to show * @return array List of templates */ - function liste_modeles($db,$maxfilenamelength=0) + static function liste_modeles($db,$maxfilenamelength=0) { global $conf; diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index 0b9bdaaa778..afb971642fc 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -71,7 +71,7 @@ class html_cerfafr extends ModeleDon { global $user,$conf,$langs,$mysoc; - $now=gmmktime(); + $now=dol_now(); if (! is_object($outputlangs)) $outputlangs=$langs; diff --git a/htdocs/core/modules/dons/modules_don.php b/htdocs/core/modules/dons/modules_don.php index 079c22afa92..e651320de34 100644 --- a/htdocs/core/modules/dons/modules_don.php +++ b/htdocs/core/modules/dons/modules_don.php @@ -43,7 +43,7 @@ abstract class ModeleDon extends CommonDocGenerator * @param string $maxfilenamelength Max length of value to show * @return array List of templates */ - function liste_modeles($db,$maxfilenamelength=0) + static function liste_modeles($db,$maxfilenamelength=0) { global $conf; diff --git a/htdocs/core/modules/expedition/methode_expedition.modules.php b/htdocs/core/modules/expedition/methode_expedition.modules.php index 19a7ce6296f..1ad8bc4bbba 100644 --- a/htdocs/core/modules/expedition/methode_expedition.modules.php +++ b/htdocs/core/modules/expedition/methode_expedition.modules.php @@ -51,7 +51,7 @@ class ModeleShippingMethod * @param string $maxfilenamelength Max length of value to show * @return array List of templates */ - function liste_modeles($db,$maxfilenamelength=0) + static function liste_modeles($db,$maxfilenamelength=0) { global $conf; diff --git a/htdocs/core/modules/expedition/modules_expedition.php b/htdocs/core/modules/expedition/modules_expedition.php index 9c69070e0c7..8215ca19aaa 100644 --- a/htdocs/core/modules/expedition/modules_expedition.php +++ b/htdocs/core/modules/expedition/modules_expedition.php @@ -45,7 +45,7 @@ abstract class ModelePdfExpedition extends CommonDocGenerator * @param string $maxfilenamelength Max length of value to show * @return array List of templates */ - function liste_modeles($db,$maxfilenamelength=0) + static function liste_modeles($db,$maxfilenamelength=0) { global $conf; diff --git a/htdocs/core/modules/facture/modules_facture.php b/htdocs/core/modules/facture/modules_facture.php index c8b2b8a12e9..43b0dae3c33 100644 --- a/htdocs/core/modules/facture/modules_facture.php +++ b/htdocs/core/modules/facture/modules_facture.php @@ -46,7 +46,7 @@ abstract class ModelePDFFactures extends CommonDocGenerator * @param string $maxfilenamelength Max length of value to show * @return array List of templates */ - function liste_modeles($db,$maxfilenamelength=0) + static function liste_modeles($db,$maxfilenamelength=0) { global $conf; diff --git a/htdocs/core/modules/fichinter/modules_fichinter.php b/htdocs/core/modules/fichinter/modules_fichinter.php index f286717caf5..389d2b6facb 100644 --- a/htdocs/core/modules/fichinter/modules_fichinter.php +++ b/htdocs/core/modules/fichinter/modules_fichinter.php @@ -44,7 +44,7 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator * @param string $maxfilenamelength Max length of value to show * @return array List of templates */ - function liste_modeles($db,$maxfilenamelength=0) + static function liste_modeles($db,$maxfilenamelength=0) { global $conf; diff --git a/htdocs/core/modules/livraison/modules_livraison.php b/htdocs/core/modules/livraison/modules_livraison.php index b0ae1760ef9..906b26d1e94 100644 --- a/htdocs/core/modules/livraison/modules_livraison.php +++ b/htdocs/core/modules/livraison/modules_livraison.php @@ -44,7 +44,7 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator * @param string $maxfilenamelength Max length of value to show * @return array List of templates */ - function liste_modeles($db,$maxfilenamelength=0) + static function liste_modeles($db,$maxfilenamelength=0) { global $conf; diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php index 59a44ae3907..03885e85a16 100644 --- a/htdocs/core/modules/project/modules_project.php +++ b/htdocs/core/modules/project/modules_project.php @@ -40,7 +40,7 @@ abstract class ModelePDFProjects extends CommonDocGenerator * @param string $maxfilenamelength Max length of value to show * @return array List of templates */ - function liste_modeles($db,$maxfilenamelength=0) + static function liste_modeles($db,$maxfilenamelength=0) { global $conf; diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index 92ecc83cbd6..dd67007f789 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -45,7 +45,7 @@ abstract class ModelePDFPropales extends CommonDocGenerator * @param string $maxfilenamelength Max length of value to show * @return array List of templates */ - function liste_modeles($db,$maxfilenamelength=0) + static function liste_modeles($db,$maxfilenamelength=0) { global $conf; diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index 1420d8b53e9..582368b6695 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -144,7 +144,7 @@ abstract class ModeleThirdPartyCode * @param string $maxfilenamelength Max length of value to show * @return array List of numbers */ - function liste_modeles($db,$maxfilenamelength=0) + static function liste_modeles($db,$maxfilenamelength=0) { $liste=array(); $sql =""; diff --git a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php index 64f2f7dbe31..72d6658801b 100755 --- a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php +++ b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php @@ -41,7 +41,7 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator * @param string $maxfilenamelength Max length of value to show * @return array List of numbers */ - function liste_modeles($db,$maxfilenamelength=0) + static function liste_modeles($db,$maxfilenamelength=0) { global $conf; diff --git a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php index 537bd1b31c4..9ce56d8e186 100644 --- a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php +++ b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php @@ -47,7 +47,7 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator * @param string $maxfilenamelength Max length of value to show * @return array List of numbers */ - function liste_modeles($db,$maxfilenamelength=0) + static function liste_modeles($db,$maxfilenamelength=0) { global $conf; diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php index a41ea6f0f66..425b1d2983c 100755 --- a/htdocs/core/triggers/interface_20_all_Logevents.class.php +++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php @@ -111,7 +111,7 @@ class InterfaceLogevents if (empty($conf->entity)) $conf->entity = $entity; // forcing of the entity if it's not defined (ex: in login form) - $this->date=gmmktime(); + $this->date=dol_now(); $this->duree=0; // Actions diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index dd34f0ae8ac..b34c255f61b 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -155,6 +155,8 @@ class Expedition extends CommonObject function create($user) { global $conf, $langs; + + $now=dol_now(); require_once DOL_DOCUMENT_ROOT ."/product/stock/class/mouvementstock.class.php"; $error = 0; @@ -192,7 +194,7 @@ class Expedition extends CommonObject $sql.= ", ".$conf->entity; $sql.= ", ".($this->ref_customer?"'".$this->ref_customer."'":"null"); $sql.= ", ".($this->ref_int?"'".$this->ref_int."'":"null"); - $sql.= ", '".$this->db->idate(gmmktime())."'"; + $sql.= ", '".$this->db->idate($now)."'"; $sql.= ", ".$user->id; $sql.= ", ".($this->date_expedition>0?"'".$this->db->idate($this->date_expedition)."'":"null"); $sql.= ", ".($this->date_delivery>0?"'".$this->db->idate($this->date_delivery)."'":"null"); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index bedafa87fdd..96525557ced 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1665,7 +1665,7 @@ class CommandeFournisseur extends Commande { global $conf, $user; - $now=gmmktime(); + $now=dol_now(); $this->nbtodo=$this->nbtodolate=0; $clause = " WHERE"; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index e6941ab7a33..23b3b703d0a 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1166,7 +1166,7 @@ class FactureFournisseur extends Facture { global $conf, $user; - $now=gmmktime(); + $now=dol_now(); $this->nbtodo=$this->nbtodolate=0; $sql = 'SELECT ff.rowid, ff.date_lim_reglement as datefin'; diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 7e7b638571d..ae043472587 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -926,7 +926,7 @@ if ($id > 0 || ! empty($ref)) */ if ($action == 'valid') { - $object->date_commande=gmmktime(); + $object->date_commande=dol_now(); // We check if number is temporary number if (preg_match('/^[\(]?PROV/i',$object->ref)) $newref = $object->getNextNumRef($soc); diff --git a/htdocs/fourn/commande/history.php b/htdocs/fourn/commande/history.php index 46c95b95aa4..1dcd927f2ae 100644 --- a/htdocs/fourn/commande/history.php +++ b/htdocs/fourn/commande/history.php @@ -44,7 +44,7 @@ $result = restrictedArea($user, 'commande_fournisseur', $id,''); $form = new Form($db); -$now=gmmktime(); +$now=dol_now(); $ref= $_GET['ref']; diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index 194bb318da4..01b8f7453cb 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -49,7 +49,7 @@ if ($user->societe_id > 0) * View */ -$now=gmmktime(); +$now=dol_now(); llxHeader('',$langs->trans("BillsSuppliersUnpaid")); diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index eabafefda14..9b6ff5cb080 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -94,7 +94,7 @@ if ($mode == 'search') * View */ -$now=gmmktime(); +$now=dol_now(); $form=new Form($db); $htmlother=new FormOther($db); diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index f3923ed0567..97376e2a7db 100644 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -119,6 +119,7 @@ if ($resql) while ($i < $num) { $res=1; + $now=dol_now(); $obj = $db->fetch_object($resql); @@ -192,7 +193,7 @@ if ($resql) dol_syslog("ok for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG); $sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; - $sql.=" SET statut=1, date_envoi=".$db->idate(gmmktime())." WHERE rowid=".$obj->rowid; + $sql.=" SET statut=1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj->rowid; $resql2=$db->query($sql); if (! $resql2) { @@ -207,7 +208,7 @@ if ($resql) dol_syslog("error for #".$i.($mail->error?' - '.$mail->error:''), LOG_DEBUG); $sql="UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; - $sql.=" SET statut=-1, date_envoi=".$db->idate(gmmktime())." WHERE rowid=".$obj->rowid; + $sql.=" SET statut=-1, date_envoi=".$db->idate($now)." WHERE rowid=".$obj->rowid; $resql2=$db->query($sql); if (! $resql2) {