From 055fff46621c67e4702bbbee4745fa8f644f2ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Carretero?= <frederic.carretero@veremes.com> Date: Tue, 27 Nov 2018 14:26:51 +0100 Subject: [PATCH] =?UTF-8?q?Correction=20du=20param=C3=A8tre=20"length=5Fse?= =?UTF-8?q?c"=20dans=20les=20templates=20de=20mail.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../class/gtf_lib/gtf_object/Order.class.inc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/module_gtf/web_service/class/gtf_lib/gtf_object/Order.class.inc b/src/module_gtf/web_service/class/gtf_lib/gtf_object/Order.class.inc index 41d43324..2908f6a3 100644 --- a/src/module_gtf/web_service/class/gtf_lib/gtf_object/Order.class.inc +++ b/src/module_gtf/web_service/class/gtf_lib/gtf_object/Order.class.inc @@ -10,7 +10,7 @@ require_once("vmlib/error.inc"); class orderLib extends GtfLib{ var $sPkField = "order_id"; var $sTable = "v_user_order"; - + /** * Class constructor * \param $oBd Connection object. @@ -37,7 +37,7 @@ class orderLib extends GtfLib{ $this->aFields['order_id']=$iOrderId; $this->sMessage = $this->oBd->getBDMessage(); }else{ - $this->aFields = $this->oBd->ligneSuivante ($oPDOresult); + $this->aFields = $this->oBd->ligneSuivante ($oPDOresult); // result_file (chemin du fichier de résultat), log_file (chemin du fichier de log) if (!empty($this->aFields['result_url'])) $this->aFields['result_file'] = $aProperties['dir_export'] . '/gtf/' . $this->aFields['result_url']; @@ -53,7 +53,7 @@ class orderLib extends GtfLib{ $this->aFields['order_id']=$iOrderId; $this->bEnErreur= -1; $this->iErrorCode=3; - $this->sMessage ="The order_id #".$iOrderId." doesn't exist"; + $this->sMessage ="The order_id #".$iOrderId." doesn't exist"; }else{ $this->bEnErreur= 0; } @@ -84,7 +84,7 @@ class orderLib extends GtfLib{ while($oEnginesId = $this->oBd->objetSuivant ($resultat)) $aEnginesId[] = $oEnginesId->gtf_engine_id; $this->oBd->fermeResultat(); - + if(count($aEnginesId)==0){ // Le tag correspondant n'a pas été trouvé, nous allons cherché la liste des moteur ayant comme tag |default| $sSql = $aSql['getEnginesDefaultTag']; @@ -113,7 +113,7 @@ class orderLib extends GtfLib{ writeToErrorLog(str_replace('[iOrderId]', $iOrderId, ERROR_0008)); $this->aFields['gtf_engine_id'] = 1; }else{ - $this->aFields['gtf_engine_id'] = $iEngine; + $this->aFields['gtf_engine_id'] = $iEngine; } } @@ -179,8 +179,7 @@ class orderLib extends GtfLib{ function formatOrderEmail() { // Calcule la date et heure de fin list($iHours, $iMinutes, $iSeconds) = explode(':', $this->aFields['length_sec']); - $oLengthSec = new DateInterval('PT' . intval($iHours) . 'H' . intval($iMinutes) . 'M' . intval($iSeconds) . 'S'); - $this->aFields['length_sec'] = $oLengthSec->format('%s'); + $this->aFields['length_sec'] = (intval($iHours) * 3600) + (intval($iMinutes) * 60) + intval($iSeconds); if (!empty($this->aFields['execution_date']) && !empty($this->aFields['length_sec'])) $this->aFields['process_date'] = date_add(date_create($this->aFields['execution_date']), new DateInterval('PT' . intval($this->aFields['length_sec']) . 'S')); // Format des dates @@ -199,4 +198,4 @@ class orderLib extends GtfLib{ } } } -?> \ No newline at end of file +?> -- GitLab