From c7ca03cf57fea51b07a18b5e94134fdbf78e9cb9 Mon Sep 17 00:00:00 2001 From: Preprod mutu Date: Tue, 19 Sep 2017 16:48:02 +0200 Subject: [PATCH] tnt --- .../admin/AdminTNTOfficielController.php | 512 +++--- .../tntofficiel/controllers/front/carrier.php | 322 ++-- .../tntofficiel/log/TNT-errors-20170914.log | 6 + .../tntofficiel/log/TNT-errors-20170919.log | 17 + .../tntofficiel/log/TNT-request-20170912.log | 45 + .../tntofficiel/log/TNT-request-20170913.log | 3 + .../tntofficiel/log/TNT-request-20170914.log | 12 + .../tntofficiel/log/TNT-request-20170915.log | 2 + .../tntofficiel/log/TNT-request-20170918.log | 15 + .../tntofficiel/log/TNT-request-20170919.log | 347 ++++ www/modules/tntofficiel/log/install.log | 16 + www/modules/tntofficiel/log/uninstall.log | 16 + .../admin/AdminOrdersController.php | 997 ++++++------ .../tntofficiel/views/js/deliveryPointsBox.js | 976 ++++++------ .../templates/admin/AdminTNTOfficiel.tpl | 10 + .../admin/_configure/helpers/form/form.tpl | 44 + .../admin/_configure/helpers/form/index.php | 18 + .../admin/_configure/helpers/index.php | 18 + .../templates/admin/_configure/index.php | 18 + .../views/templates/admin/_print_bt_icon.tpl | 17 + .../views/templates/admin/index.php | 18 + .../manifest/custom_template_content.tpl | 91 ++ .../admin/manifest/custom_template_footer.tpl | 16 + .../admin/manifest/custom_template_header.tpl | 21 + .../views/templates/admin/manifest/index.php | 18 + .../override/controllers/admin/index.php | 18 + .../controllers/admin/templates/index.php | 18 + .../admin/templates/orders/helpers/index.php | 18 + .../templates/orders/helpers/view/index.php | 18 + .../templates/orders/helpers/view/view.tpl | 1400 +++++++++++++++++ .../admin/templates/orders/index.php | 18 + .../admin/override/controllers/index.php | 18 + .../views/templates/admin/override/index.php | 18 + .../templates/front/displayAjaxTracking.tpl | 66 + .../views/templates/front/index.php | 18 + ...rierList2.tpl => __displayCarrierList.tpl} | 12 +- .../templates/hook/displayCarrierList.tpl | 1276 ++++++++------- 37 files changed, 4427 insertions(+), 2046 deletions(-) create mode 100644 www/modules/tntofficiel/log/TNT-errors-20170914.log create mode 100644 www/modules/tntofficiel/log/TNT-errors-20170919.log create mode 100644 www/modules/tntofficiel/log/TNT-request-20170913.log create mode 100644 www/modules/tntofficiel/log/TNT-request-20170914.log create mode 100644 www/modules/tntofficiel/log/TNT-request-20170915.log create mode 100644 www/modules/tntofficiel/log/TNT-request-20170918.log create mode 100644 www/modules/tntofficiel/log/TNT-request-20170919.log create mode 100644 www/modules/tntofficiel/log/install.log create mode 100644 www/modules/tntofficiel/log/uninstall.log create mode 100644 www/modules/tntofficiel/views/templates/admin/AdminTNTOfficiel.tpl create mode 100644 www/modules/tntofficiel/views/templates/admin/_configure/helpers/form/form.tpl create mode 100644 www/modules/tntofficiel/views/templates/admin/_configure/helpers/form/index.php create mode 100644 www/modules/tntofficiel/views/templates/admin/_configure/helpers/index.php create mode 100644 www/modules/tntofficiel/views/templates/admin/_configure/index.php create mode 100644 www/modules/tntofficiel/views/templates/admin/_print_bt_icon.tpl create mode 100644 www/modules/tntofficiel/views/templates/admin/index.php create mode 100644 www/modules/tntofficiel/views/templates/admin/manifest/custom_template_content.tpl create mode 100644 www/modules/tntofficiel/views/templates/admin/manifest/custom_template_footer.tpl create mode 100644 www/modules/tntofficiel/views/templates/admin/manifest/custom_template_header.tpl create mode 100644 www/modules/tntofficiel/views/templates/admin/manifest/index.php create mode 100644 www/modules/tntofficiel/views/templates/admin/override/controllers/admin/index.php create mode 100644 www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/index.php create mode 100644 www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/orders/helpers/index.php create mode 100644 www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/orders/helpers/view/index.php create mode 100644 www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/orders/helpers/view/view.tpl create mode 100644 www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/orders/index.php create mode 100644 www/modules/tntofficiel/views/templates/admin/override/controllers/index.php create mode 100644 www/modules/tntofficiel/views/templates/admin/override/index.php create mode 100644 www/modules/tntofficiel/views/templates/front/displayAjaxTracking.tpl create mode 100644 www/modules/tntofficiel/views/templates/front/index.php rename www/modules/tntofficiel/views/templates/hook/{displayCarrierList2.tpl => __displayCarrierList.tpl} (96%) diff --git a/www/modules/tntofficiel/controllers/admin/AdminTNTOfficielController.php b/www/modules/tntofficiel/controllers/admin/AdminTNTOfficielController.php index 51c80c7e..28ca8595 100644 --- a/www/modules/tntofficiel/controllers/admin/AdminTNTOfficielController.php +++ b/www/modules/tntofficiel/controllers/admin/AdminTNTOfficielController.php @@ -1,256 +1,256 @@ - - * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT - * @license https://opensource.org/licenses/MIT MIT License - */ - -require_once _PS_MODULE_DIR_.'tntofficiel/tntofficiel.php'; -require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; -require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_PasswordManager.php'; -require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_ShipmentHelper.php'; -require_once _PS_MODULE_DIR_.'tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDF.php'; -require_once _PS_MODULE_DIR_.'tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDFGenerator.php'; -require_once _PS_MODULE_DIR_.'tntofficiel/libraries/pdf/manifest/HTMLTemplateTNTOfficielManifest.php'; -require_once _PS_MODULE_DIR_.'tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDFCreator.php'; -require_once _PS_MODULE_DIR_.'tntofficiel/libraries/exceptions/TNTOfficiel_MaxPackageWeightException.php'; - -// Controller -class AdminTNTOfficielController extends ModuleAdminController -{ - /** - * Constructor. - */ - public function __construct() - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - // _PS_MODULE_DIR_.$this->module->name.'/views/templates/admin/' - // default : 'content.tpl'; - $this->template = 'AdminTNTOfficiel.tpl'; - - parent::__construct(); - } - - /** - * Add css files. - */ - public function setMedia() - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - $this->addCSS(_MODULE_DIR_.$this->module->name.'/views/css/AdminTNTOfficiel.css', 'all'); - $this->addCSS(_MODULE_DIR_.$this->module->name.'/views/css/style.css'); - parent::setMedia(); - } - - /** - * {@inheritdoc} - */ - public function createTemplate($tpl_name) - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - $this->context->smarty->assign(array( - 'username' => Configuration::get('TNT_CARRIER_USERNAME'), - 'account' => Configuration::get('TNT_CARRIER_ACCOUNT'), - 'password' => TNTOfficiel_PasswordManager::getHash(), - 'middlewareUrl' => Configuration::get('TNT_CARRIER_MIDDLEWARE_SHORT_URL'), - )); - - if (file_exists($this->getTemplatePath().$tpl_name) && $this->viewAccess()) { - return $this->context->smarty->createTemplate($this->getTemplatePath().$tpl_name, $this->context->smarty); - } - - return parent::createTemplate($tpl_name); - } - - /** - * Generate the manifest for an order (download). - */ - public function processGetManifest() - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - $objManifestPDF = new TNTOfficiel_ManifestPDFCreator(); - $intOrderID = (int)Tools::getValue('id_order'); - $arrOrderIDList = array($intOrderID); - $objManifestPDF->createManifest($arrOrderIDList); - - // We want to be sure that displaying PDF is the last thing this controller will do. - exit; - } - - /** - * Downloads an archive containing all the logs files. - * /_admin/index.php?controller=AdminTNTOfficiel&action=downloadLogs - */ - public function processDownloadLogs() - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - $strLogPath = _PS_MODULE_DIR_.TNTOfficiel::MODULE_NAME.'/'.TNTOfficiel::LOG_DIR; - $zipName = 'logs.zip'; - // Remove Existing. - if (file_exists($strLogPath.$zipName)) { - unlink($strLogPath.$zipName); - } - // Create Zip file. - TNTOfficiel_Logger::getZip($strLogPath.$zipName); - // Download. - header('Content-Type: application/zip'); - header('Content-disposition: attachment; filename='.$zipName); - header('Content-Length: '.filesize($strLogPath.$zipName)); - // Get Content. - readfile($strLogPath.$zipName); - - // We want to be sure that displaying PDF is the last thing this controller will do. - exit; - } - - /** - * Add a parcel. - * - * @return array - */ - public function displayAjaxAddParcel() - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - $fltWeight = (float)Tools::getValue('weight'); - $intOderID = (int)Tools::getValue('orderId'); - - $arrResult = array(); - try { - $arrResult['parcel'] = TNTOfficiel_ParcelsHelper::getInstance()->addParcel($intOderID, $fltWeight, false); - $arrResult['result'] = true; - } catch (TNTOfficiel_MaxPackageWeightException $objException) { - $arrResult['result'] = false; - $arrResult['error'] = $objException->getMessage(); - } catch (Exception $objException) { - $objFileLogger = new FileLogger(); - $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); - $objFileLogger->logError($objException->getMessage()); - $arrResult['result'] = false; - } - - echo Tools::jsonEncode($arrResult); - - return true; - } - - /** - * Remove a parcel. - * - * @return array - */ - public function displayAjaxRemoveParcel() - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - $intParcelID = (int)Tools::getValue('parcelId'); - - $arrResult = array(); - try { - $arrResult['result'] = TNTOfficiel_ParcelsHelper::getInstance()->removeParcel($intParcelID); - } catch (Exception $objException) { - $objFileLogger = new FileLogger(); - $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); - $objFileLogger->logError($objException->getMessage()); - $arrResult['result'] = false; - } - - echo Tools::jsonEncode($arrResult); - - return true; - } - - /** - * Update a parcel. - * - * @return array - */ - public function displayAjaxUpdateParcel() - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - $intParcelID = (int)Tools::getValue('parcelId'); - $fltWeight = (float)Tools::getValue('weight'); - $intOderID = (int)Tools::getValue('orderId'); - - try { - $arrResult = TNTOfficiel_ParcelsHelper::getInstance()->updateParcel($intParcelID, $fltWeight, $intOderID); - } catch (TNTOfficiel_MaxPackageWeightException $objException) { - $arrResult['result'] = false; - $arrResult['error'] = $objException->getMessage(); - } catch (Exception $objException) { - $objFileLogger = new FileLogger(); - $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); - $objFileLogger->logError($objException->getMessage()); - $arrResult['result'] = false; - } - - echo Tools::jsonEncode($arrResult); - - return true; - } - - /** - * Checks the shipping. - */ - public function displayAjaxCheckShippingDateValid() - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - $intOrderID = (int)Tools::getValue('orderId'); - $strShippingDate = pSQL(Tools::getValue('shippingDate')); - - $arrPostDate = explode('/', $strShippingDate); - $strFormatedShippingDate = $arrPostDate[2].'-'.$arrPostDate[1].'-'.$arrPostDate[0]; - - $objTNTShipmentHelper = TNTOfficiel_ShipmentHelper::getInstance(); - $arrMDWShippingDate = $objTNTShipmentHelper->checkSaveShipmentDate($intOrderID, $strFormatedShippingDate); - if (!is_array($arrMDWShippingDate)) { - echo Tools::jsonEncode(array('error' => $arrMDWShippingDate)); - - return false; - } - if (array_key_exists('error', $arrMDWShippingDate)) { - if ($arrMDWShippingDate['error'] == 1) { - echo Tools::jsonEncode(array('error' => $arrMDWShippingDate['message'])); - - return false; - } else { - $arrMDWShippingDate['shippingDate'] = $strFormatedShippingDate; - /* $tntDate['dueDate'] = ""; */ - } - } - - $arrTNTOrder = TNTOfficiel_OrderHelper::getInstance()->getOrderData($intOrderID); - Db::getInstance()->update( - 'tntofficiel_order', - array( - 'shipping_date' => pSQL($arrMDWShippingDate['shippingDate']), - 'due_date' => pSQL($arrMDWShippingDate['dueDate']) - ), - 'id_tntofficiel_order = '.(int)$arrTNTOrder['id_tntofficiel_order'] - ); - - if (!$arrMDWShippingDate['dueDate']) { - $arrResult = array(); - } else { - $tempDate = explode('-', $arrMDWShippingDate['dueDate']); - $arrResult = array('dueDate' => $tempDate[2].'/'.$tempDate[1].'/'.$tempDate[0]); - } - - if (array_key_exists('message', $arrMDWShippingDate)) { - $arrResult['mdwMessage'] = $arrMDWShippingDate['message']; - } - - echo Tools::jsonEncode($arrResult); - - return true; - } -} + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/tntofficiel.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_PasswordManager.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_ShipmentHelper.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDF.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDFGenerator.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/pdf/manifest/HTMLTemplateTNTOfficielManifest.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDFCreator.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/exceptions/TNTOfficiel_MaxPackageWeightException.php'; + +// Controller +class AdminTNTOfficielController extends ModuleAdminController +{ + /** + * Constructor. + */ + public function __construct() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // _PS_MODULE_DIR_.$this->module->name.'/views/templates/admin/' + // default : 'content.tpl'; + $this->template = 'AdminTNTOfficiel.tpl'; + + parent::__construct(); + } + + /** + * Add css files. + */ + public function setMedia() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->addCSS(_MODULE_DIR_.$this->module->name.'/views/css/AdminTNTOfficiel.css', 'all'); + $this->addCSS(_MODULE_DIR_.$this->module->name.'/views/css/style.css'); + parent::setMedia(); + } + + /** + * {@inheritdoc} + */ + public function createTemplate($tpl_name) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->context->smarty->assign(array( + 'username' => Configuration::get('TNT_CARRIER_USERNAME'), + 'account' => Configuration::get('TNT_CARRIER_ACCOUNT'), + 'password' => TNTOfficiel_PasswordManager::getHash(), + 'middlewareUrl' => Configuration::get('TNT_CARRIER_MIDDLEWARE_SHORT_URL'), + )); + + if (file_exists($this->getTemplatePath().$tpl_name) && $this->viewAccess()) { + return $this->context->smarty->createTemplate($this->getTemplatePath().$tpl_name, $this->context->smarty); + } + + return parent::createTemplate($tpl_name); + } + + /** + * Generate the manifest for an order (download). + */ + public function processGetManifest() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $objManifestPDF = new TNTOfficiel_ManifestPDFCreator(); + $intOrderID = (int)Tools::getValue('id_order'); + $arrOrderIDList = array($intOrderID); + $objManifestPDF->createManifest($arrOrderIDList); + + // We want to be sure that displaying PDF is the last thing this controller will do. + exit; + } + + /** + * Downloads an archive containing all the logs files. + * /_admin/index.php?controller=AdminTNTOfficiel&action=downloadLogs + */ + public function processDownloadLogs() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $strLogPath = _PS_MODULE_DIR_.TNTOfficiel::MODULE_NAME.'/'.TNTOfficiel::LOG_DIR; + $zipName = 'logs.zip'; + // Remove Existing. + if (file_exists($strLogPath.$zipName)) { + unlink($strLogPath.$zipName); + } + // Create Zip file. + TNTOfficiel_Logger::getZip($strLogPath.$zipName); + // Download. + header('Content-Type: application/zip'); + header('Content-disposition: attachment; filename='.$zipName); + header('Content-Length: '.filesize($strLogPath.$zipName)); + // Get Content. + readfile($strLogPath.$zipName); + + // We want to be sure that displaying PDF is the last thing this controller will do. + exit; + } + + /** + * Add a parcel. + * + * @return array + */ + public function displayAjaxAddParcel() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $fltWeight = (float)Tools::getValue('weight'); + $intOderID = (int)Tools::getValue('orderId'); + + $arrResult = array(); + try { + $arrResult['parcel'] = TNTOfficiel_ParcelsHelper::getInstance()->addParcel($intOderID, $fltWeight, false); + $arrResult['result'] = true; + } catch (TNTOfficiel_MaxPackageWeightException $objException) { + $arrResult['result'] = false; + $arrResult['error'] = $objException->getMessage(); + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + $arrResult['result'] = false; + } + + echo Tools::jsonEncode($arrResult); + + return true; + } + + /** + * Remove a parcel. + * + * @return array + */ + public function displayAjaxRemoveParcel() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $intParcelID = (int)Tools::getValue('parcelId'); + + $arrResult = array(); + try { + $arrResult['result'] = TNTOfficiel_ParcelsHelper::getInstance()->removeParcel($intParcelID); + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + $arrResult['result'] = false; + } + + echo Tools::jsonEncode($arrResult); + + return true; + } + + /** + * Update a parcel. + * + * @return array + */ + public function displayAjaxUpdateParcel() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $intParcelID = (int)Tools::getValue('parcelId'); + $fltWeight = (float)Tools::getValue('weight'); + $intOderID = (int)Tools::getValue('orderId'); + + try { + $arrResult = TNTOfficiel_ParcelsHelper::getInstance()->updateParcel($intParcelID, $fltWeight, $intOderID); + } catch (TNTOfficiel_MaxPackageWeightException $objException) { + $arrResult['result'] = false; + $arrResult['error'] = $objException->getMessage(); + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + $arrResult['result'] = false; + } + + echo Tools::jsonEncode($arrResult); + + return true; + } + + /** + * Checks the shipping. + */ + public function displayAjaxCheckShippingDateValid() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $intOrderID = (int)Tools::getValue('orderId'); + $strShippingDate = pSQL(Tools::getValue('shippingDate')); + + $arrPostDate = explode('/', $strShippingDate); + $strFormatedShippingDate = $arrPostDate[2].'-'.$arrPostDate[1].'-'.$arrPostDate[0]; + + $objTNTShipmentHelper = TNTOfficiel_ShipmentHelper::getInstance(); + $arrMDWShippingDate = $objTNTShipmentHelper->checkSaveShipmentDate($intOrderID, $strFormatedShippingDate); + if (!is_array($arrMDWShippingDate)) { + echo Tools::jsonEncode(array('error' => $arrMDWShippingDate)); + + return false; + } + if (array_key_exists('error', $arrMDWShippingDate)) { + if ($arrMDWShippingDate['error'] == 1) { + echo Tools::jsonEncode(array('error' => $arrMDWShippingDate['message'])); + + return false; + } else { + $arrMDWShippingDate['shippingDate'] = $strFormatedShippingDate; + /* $tntDate['dueDate'] = ""; */ + } + } + + $arrTNTOrder = TNTOfficiel_OrderHelper::getInstance()->getOrderData($intOrderID); + Db::getInstance()->update( + 'tntofficiel_order', + array( + 'shipping_date' => pSQL($arrMDWShippingDate['shippingDate']), + 'due_date' => pSQL($arrMDWShippingDate['dueDate']) + ), + 'id_tntofficiel_order = '.(int)$arrTNTOrder['id_tntofficiel_order'] + ); + + if (!$arrMDWShippingDate['dueDate']) { + $arrResult = array(); + } else { + $tempDate = explode('-', $arrMDWShippingDate['dueDate']); + $arrResult = array('dueDate' => $tempDate[2].'/'.$tempDate[1].'/'.$tempDate[0]); + } + + if (array_key_exists('message', $arrMDWShippingDate)) { + $arrResult['mdwMessage'] = $arrMDWShippingDate['message']; + } + + echo Tools::jsonEncode($arrResult); + + return true; + } +} diff --git a/www/modules/tntofficiel/controllers/front/carrier.php b/www/modules/tntofficiel/controllers/front/carrier.php index bf231bd1..2ebdb937 100644 --- a/www/modules/tntofficiel/controllers/front/carrier.php +++ b/www/modules/tntofficiel/controllers/front/carrier.php @@ -1,160 +1,162 @@ - - * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT - * @license https://opensource.org/licenses/MIT MIT License - */ - -require_once _PS_MODULE_DIR_.'tntofficiel/tntofficiel.php'; -require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; -require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Carrier.php'; -require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_CarrierHelper.php'; -require_once _PS_MODULE_DIR_.'tntofficiel/classes/TNTOfficielCart.php'; - -class TNTOfficielCarrierModuleFrontController extends ModuleFrontController -{ - /** - * TNTOfficielCarrierModuleFrontController constructor. - * Controller always used for AJAX response. - */ - public function __construct() - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - parent::__construct(); - - // No header/footer. - $this->ajax = true; - } - - /** - * Store in session the tnt carrier name and store its price. - * - * @return string - */ - public function displayAjaxStoreProductPrice() - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - $objContext = $this->context; - $objCart = $objContext->cart; - $intCartID = (int)$objCart->id; - - $strProductCode = pSQL(Tools::getValue('productCode')); - - $objTNTCarrierHelper = TNTOfficiel_CarrierHelper::getInstance(); - $arrAvailableTNTCarriers = $objTNTCarrierHelper->getMDWTNTCarrierList($objContext->customer); - $boolCarrierIsValid = false; - $arrTNTCarrier = null; - - if (!empty($arrAvailableTNTCarriers) && !empty($arrAvailableTNTCarriers['products'])) { - foreach ($arrAvailableTNTCarriers['products'] as $arrTNTCarrier) { - $arrTNTCarrier['label'] = ''; - if (strpos($arrTNTCarrier['type'], 'ENTERPRISE') !== false) { - if (strpos($arrTNTCarrier['code'], 'A') !== false) { - $arrTNTCarrier['label'] = '09:00 Express en Entreprise'; - } elseif (strpos($arrTNTCarrier['code'], 'J') !== false) { - $arrTNTCarrier['label'] = 'En entreprise'; - } elseif (strpos($arrTNTCarrier['code'], 'M') !== false) { - $arrTNTCarrier['label'] = '12:00 Express en Entreprise'; - } elseif (strpos($arrTNTCarrier['code'], 'T') !== false) { - $arrTNTCarrier['label'] = '10:00 Express en Entreprise'; - } - } elseif (strpos($arrTNTCarrier['type'], 'INDIVIDUAL') !== false) { - if (strpos($arrTNTCarrier['code'], 'AZ') !== false) { - $arrTNTCarrier['label'] = '09:00 Express à domicile'; - } elseif (strpos($arrTNTCarrier['code'], 'JZ') !== false) { - $arrTNTCarrier['label'] = 'À domicile'; - } elseif (strpos($arrTNTCarrier['code'], 'MZ') !== false) { - $arrTNTCarrier['label'] = '12:00 Express à domicile'; - } elseif (strpos($arrTNTCarrier['code'], 'TZ') !== false) { - $arrTNTCarrier['label'] = '10:00 Express à domicile'; - } - } elseif (strpos($arrTNTCarrier['type'], 'DROPOFFPOINT') !== false) { - $arrTNTCarrier['label'] = 'En Relais Colis®'; - } elseif (strpos($arrTNTCarrier['type'], 'DEPOT') !== false) { - $arrTNTCarrier['label'] = 'Dépôt restant'; - } - - // Found current TNT carrier code. - if ($arrTNTCarrier['code'].'_'.$arrTNTCarrier['type'] == $strProductCode) { - // Load TNT cart info or create a new one for it's ID. - $objTNTCartModel = TNTOfficielCart::loadCartID($intCartID); - $boolResult = false; - if (Validate::isLoadedObject($objTNTCartModel)) { - $objTNTCartModel->hydrate(array( - 'carrier_code' => $strProductCode, - 'carrier_label' => pSQL($arrTNTCarrier['label']), - 'delivery_price' => pSQL($arrTNTCarrier['price']) - )); - $boolResult = $objTNTCartModel->save(); - } - $boolCarrierIsValid = true; - break; - } - } - } - - echo Tools::jsonEncode(array( - 'result' => $boolCarrierIsValid && $boolResult, - 'product' => $arrTNTCarrier, - )); - - return true; - } - - /** - * Check TNT data before payment process. - * - * @return array - */ - public function displayAjaxCheckProductCode() - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - $objContext = $this->context; - $objCart = $objContext->cart; - //$intCartID = (int)$objCart->id; - - //$strCarrierType = pSQL(Tools::getValue('product')); - $arrCarrierCode = (array)Tools::getValue('deliveryOptionTnt'); - - $strErrorMsg = null; - $arrResult = array( - 'error' => 0, - TNTOfficiel::MODULE_NAME => 1 - ); - - if (!$objCart) { - $strErrorMsg = 'No cart object'; - } elseif ($objCart->id_carrier == 0) { - $strErrorMsg = 'No carrier selected'; - } elseif (!$objCart->id_address_delivery) { - $strErrorMsg = 'No delivery address selected'; - } - - // If an error. - if ($strErrorMsg !== null) { - $arrResult = array('error' => 1, 'msg' => $strErrorMsg); - } else { - $boolIsTntCarrier = TNTOfficiel_Carrier::isTNTOfficielCarrierID($objCart->id_carrier); - - if (!$boolIsTntCarrier) { - // The preselected carrier is not TNT, don't handle. - $arrResult = array('error' => 0, TNTOfficiel::MODULE_NAME => 0); - } elseif (($boolIsTntCarrier && !Tools::getIsset('product')) - || !$arrCarrierCode - || !$objCart->delivery_option - ) { - // TNT is preselected and no service selected (individual, enterprise, dropoffpoint or depot) -> Error. - $arrResult = array('error' => 1); - } - } - - echo Tools::jsonEncode($arrResult); - - return true; - } -} + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/tntofficiel.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Carrier.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_CarrierHelper.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/classes/TNTOfficielCart.php'; + +class TNTOfficielCarrierModuleFrontController extends ModuleFrontController +{ + /** + * TNTOfficielCarrierModuleFrontController constructor. + * Controller always used for AJAX response. + */ + public function __construct() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + parent::__construct(); + + // No header/footer. + $this->ajax = true; + } + + /** + * Store in session the tnt carrier name and store its price. + * + * @return string + */ + public function displayAjaxStoreProductPrice() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $objContext = $this->context; + $objCart = $objContext->cart; + $intCartID = (int)$objCart->id; + + $strProductCode = pSQL(Tools::getValue('productCode')); + + $objTNTCarrierHelper = TNTOfficiel_CarrierHelper::getInstance(); + $arrAvailableTNTCarriers = $objTNTCarrierHelper->getMDWTNTCarrierList($objContext->customer); + $boolCarrierIsValid = false; + $arrTNTCarrier = null; + + if (!empty($arrAvailableTNTCarriers) && !empty($arrAvailableTNTCarriers['products'])) { + foreach ($arrAvailableTNTCarriers['products'] as $arrTNTCarrier) { + $arrTNTCarrier['label'] = ''; + if (strpos($arrTNTCarrier['type'], 'ENTERPRISE') !== false) { + if (strpos($arrTNTCarrier['code'], 'A') !== false) { + $arrTNTCarrier['label'] = '09:00 Express en Entreprise'; + } elseif (strpos($arrTNTCarrier['code'], 'J') !== false) { + $arrTNTCarrier['label'] = 'En entreprise'; + } elseif (strpos($arrTNTCarrier['code'], 'M') !== false) { + $arrTNTCarrier['label'] = '12:00 Express en Entreprise'; + } elseif (strpos($arrTNTCarrier['code'], 'T') !== false) { + $arrTNTCarrier['label'] = '10:00 Express en Entreprise'; + } + } elseif (strpos($arrTNTCarrier['type'], 'INDIVIDUAL') !== false) { + if (strpos($arrTNTCarrier['code'], 'AZ') !== false) { + $arrTNTCarrier['label'] = '09:00 Express à domicile'; + } elseif (strpos($arrTNTCarrier['code'], 'JZ') !== false) { + $arrTNTCarrier['label'] = 'À domicile'; + } elseif (strpos($arrTNTCarrier['code'], 'MZ') !== false) { + $arrTNTCarrier['label'] = '12:00 Express à domicile'; + } elseif (strpos($arrTNTCarrier['code'], 'TZ') !== false) { + $arrTNTCarrier['label'] = '10:00 Express à domicile'; + } + } elseif (strpos($arrTNTCarrier['type'], 'DROPOFFPOINT') !== false) { + $arrTNTCarrier['label'] = 'En Relais Colis®'; + } elseif (strpos($arrTNTCarrier['type'], 'DEPOT') !== false) { + $arrTNTCarrier['label'] = 'Dépôt restant'; + } + + // Found current TNT carrier code. + if ($arrTNTCarrier['code'].'_'.$arrTNTCarrier['type'] == $strProductCode) { + // Load TNT cart info or create a new one for it's ID. + $objTNTCartModel = TNTOfficielCart::loadCartID($intCartID); + $boolResult = false; + if (Validate::isLoadedObject($objTNTCartModel)) { + $objTNTCartModel->hydrate(array( + 'carrier_code' => $strProductCode, + 'carrier_label' => pSQL($arrTNTCarrier['label']), + 'delivery_price' => pSQL($arrTNTCarrier['price']) + )); + $boolResult = $objTNTCartModel->save(); + } + $boolCarrierIsValid = true; + break; + } + } + } + + echo Tools::jsonEncode(array( + 'result' => $boolCarrierIsValid && $boolResult, + 'product' => $arrTNTCarrier, + )); + + return true; + } + + /** + * Check TNT data before payment process. + * + * @return array + */ + public function displayAjaxCheckProductCode() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $objContext = $this->context; + $objCart = $objContext->cart; + //$intCartID = (int)$objCart->id; + + //$strCarrierType = pSQL(Tools::getValue('product')); + $arrCarrierCode = (array)Tools::getValue('deliveryOptionTnt'); + + p($arrCarrierCode); + + $strErrorMsg = null; + $arrResult = array( + 'error' => 0, + TNTOfficiel::MODULE_NAME => 1 + ); + + if (!$objCart) { + $strErrorMsg = 'No cart object'; + } elseif ($objCart->id_carrier == 0) { + $strErrorMsg = 'No carrier selected'; + } elseif (!$objCart->id_address_delivery) { + $strErrorMsg = 'No delivery address selected'; + } + + // If an error. + if ($strErrorMsg !== null) { + $arrResult = array('error' => 1, 'msg' => $strErrorMsg); + } else { + $boolIsTntCarrier = TNTOfficiel_Carrier::isTNTOfficielCarrierID($objCart->id_carrier); + + if (!$boolIsTntCarrier) { + // The preselected carrier is not TNT, don't handle. + $arrResult = array('error' => 0, TNTOfficiel::MODULE_NAME => 0); + } elseif (($boolIsTntCarrier && !Tools::getIsset('product')) + || !$arrCarrierCode + || !$objCart->delivery_option + ) { + // TNT is preselected and no service selected (individual, enterprise, dropoffpoint or depot) -> Error. + $arrResult = array('error' => 1); + } + } + + echo Tools::jsonEncode($arrResult); + + return true; + } +} diff --git a/www/modules/tntofficiel/log/TNT-errors-20170914.log b/www/modules/tntofficiel/log/TNT-errors-20170914.log new file mode 100644 index 00000000..2ca772e3 --- /dev/null +++ b/www/modules/tntofficiel/log/TNT-errors-20170914.log @@ -0,0 +1,6 @@ +20170914 12:08:38 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170914 12:08:38 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170914 12:10:24 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170914 12:10:24 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170914 12:10:43 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170914 12:10:43 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || diff --git a/www/modules/tntofficiel/log/TNT-errors-20170919.log b/www/modules/tntofficiel/log/TNT-errors-20170919.log new file mode 100644 index 00000000..5d62bcb1 --- /dev/null +++ b/www/modules/tntofficiel/log/TNT-errors-20170919.log @@ -0,0 +1,17 @@ +20170919 11:44:24 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170919 11:44:24 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170919 11:45:10 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170919 11:45:10 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170919 11:45:14 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170919 11:45:14 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170919 11:47:34 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170919 11:47:34 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170919 11:47:49 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170919 11:47:49 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170919 11:48:10 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170919 11:48:11 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170919 11:48:11 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170919 11:48:11 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170919 12:30:01 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170919 12:30:02 - 08949425 JSON:getCarrierQuote Error Invalid arguments: Invalid params - error city || +20170919 12:50:44 - 08949425 JSON:getRelayPoints Error Invalid request/response: City not found or not match with post code || diff --git a/www/modules/tntofficiel/log/TNT-request-20170912.log b/www/modules/tntofficiel/log/TNT-request-20170912.log index c6cb9298..78e9b9d6 100644 --- a/www/modules/tntofficiel/log/TNT-request-20170912.log +++ b/www/modules/tntofficiel/log/TNT-request-20170912.log @@ -212,3 +212,48 @@ 20170912 10:46:20 - 08949425 SUCCESS JSON:getCarrierQuote 20170912 10:47:05 - 08949425 SUCCESS JSON:getCarrierQuote 20170912 10:47:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:50:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:51:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:51:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:51:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:52:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:54:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:54:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 11:20:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 11:20:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 11:35:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 11:35:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 11:37:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 11:39:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 11:39:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 11:52:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 12:06:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 12:06:33 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 12:06:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 12:07:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 12:07:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 12:15:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 12:16:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 12:16:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 12:17:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 12:18:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 12:18:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 12:42:53 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 12:42:58 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 12:47:07 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 14:03:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 14:03:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 14:03:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 14:28:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 14:28:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 14:28:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 14:28:46 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 14:28:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 14:30:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 14:30:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 15:58:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 16:00:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 16:00:57 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 18:01:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 18:01:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 18:02:03 - 08949425 SUCCESS JSON:getCarrierQuote diff --git a/www/modules/tntofficiel/log/TNT-request-20170913.log b/www/modules/tntofficiel/log/TNT-request-20170913.log new file mode 100644 index 00000000..63c80cc4 --- /dev/null +++ b/www/modules/tntofficiel/log/TNT-request-20170913.log @@ -0,0 +1,3 @@ +20170913 13:57:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170913 14:07:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170913 14:46:40 - 08949425 SUCCESS JSON:getCarrierQuote diff --git a/www/modules/tntofficiel/log/TNT-request-20170914.log b/www/modules/tntofficiel/log/TNT-request-20170914.log new file mode 100644 index 00000000..e95e1c7f --- /dev/null +++ b/www/modules/tntofficiel/log/TNT-request-20170914.log @@ -0,0 +1,12 @@ +20170914 10:08:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170914 10:59:33 - 08949425 SUCCESS JSON:getCarrierQuote +20170914 14:27:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170914 14:33:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170914 14:33:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170914 14:34:00 - 08949425 SUCCESS JSON:getCarrierQuote +20170914 14:34:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170914 17:04:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170914 17:22:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170914 17:22:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170914 17:22:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170914 17:28:22 - 08949425 SUCCESS JSON:getCarrierQuote diff --git a/www/modules/tntofficiel/log/TNT-request-20170915.log b/www/modules/tntofficiel/log/TNT-request-20170915.log new file mode 100644 index 00000000..d4a7c851 --- /dev/null +++ b/www/modules/tntofficiel/log/TNT-request-20170915.log @@ -0,0 +1,2 @@ +20170915 10:13:51 - 08949425 SUCCESS JSON:getCarrierQuote +20170915 10:14:06 - 08949425 SUCCESS JSON:getCarrierQuote diff --git a/www/modules/tntofficiel/log/TNT-request-20170918.log b/www/modules/tntofficiel/log/TNT-request-20170918.log new file mode 100644 index 00000000..89323aaf --- /dev/null +++ b/www/modules/tntofficiel/log/TNT-request-20170918.log @@ -0,0 +1,15 @@ +20170918 09:13:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170918 09:51:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170918 09:52:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170918 09:52:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170918 09:53:06 - 08949425 SUCCESS JSON:getCarrierQuote +20170918 09:53:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170918 16:15:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170918 16:15:46 - 08949425 SUCCESS JSON:getCarrierQuote +20170918 16:15:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170918 16:48:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170918 16:48:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170918 16:49:08 - 08949425 SUCCESS JSON:getCarrierQuote +20170918 18:25:16 - 08949425 SUCCESS JSON:getCarrierQuote +20170918 18:25:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170918 18:25:30 - 08949425 SUCCESS JSON:getCarrierQuote diff --git a/www/modules/tntofficiel/log/TNT-request-20170919.log b/www/modules/tntofficiel/log/TNT-request-20170919.log new file mode 100644 index 00000000..70b707a3 --- /dev/null +++ b/www/modules/tntofficiel/log/TNT-request-20170919.log @@ -0,0 +1,347 @@ +20170919 08:40:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:40:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:42:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:42:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:42:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:43:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:47:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:48:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:48:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:49:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:52:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:52:57 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:53:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:54:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:54:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:54:33 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:54:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:54:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:55:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:55:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:55:07 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:55:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:55:15 - 08949425 SUCCESS JSON:testCity +20170919 08:55:16 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:55:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:55:24 - 08949425 SUCCESS JSON:getRelayPoints +20170919 08:55:24 - 08949425 SUCCESS JSON:getCities +20170919 08:55:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:55:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:56:07 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:56:08 - 08949425 SUCCESS JSON:testCity +20170919 08:56:08 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:56:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:56:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:56:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:56:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:56:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:56:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 08:56:42 - 08949425 SUCCESS JSON:getShippingDate +20170919 08:56:42 - 08949425 SUCCESS JSON:checkSaveShipment +20170919 08:56:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:05:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:05:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:05:43 - 08949425 SUCCESS JSON:testCity +20170919 09:05:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:06:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:07:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:07:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:14:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:14:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:14:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:16:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:16:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:16:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:16:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:18:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:20:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:20:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:22:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:24:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:25:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 09:33:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:16:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:16:37 - 08949425 SUCCESS JSON:testCity +20170919 10:16:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:16:57 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:17:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:17:27 - 08949425 SUCCESS JSON:testCity +20170919 10:17:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:17:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:17:40 - 08949425 SUCCESS JSON:getRelayPoints +20170919 10:17:40 - 08949425 SUCCESS JSON:getCities +20170919 10:17:53 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:17:54 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:18:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:18:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:19:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:19:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:19:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:19:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:22:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:23:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:23:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:23:58 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:24:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:26:58 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:27:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:27:06 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:27:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:29:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:36:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:36:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:38:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:38:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:38:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:39:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:39:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:39:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:40:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:40:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:41:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:44:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:44:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:47:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:49:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:50:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:50:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:50:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 10:52:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:05:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:07:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:07:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:12:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:12:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:12:58 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:13:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:13:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:14:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:14:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:16:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:16:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:16:54 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:18:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:18:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:18:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:21:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:42:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:43:00 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:43:00 - 08949425 SUCCESS JSON:testCity +20170919 11:43:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:43:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:43:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:43:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:43:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 11:48:11 - 08949425 SUCCESS JSON:testCity +20170919 11:53:21 - info@chocolatdevenement.com SUCCESS JSON:isCorrectAuthentication +20170919 11:53:35 - CHOCOLATS ou Chocolat d\'evenement OP SUCCESS JSON:isCorrectAuthentication +20170919 11:53:49 - 08949425 SUCCESS JSON:isCorrectAuthentication +20170919 12:29:03 - 08949425 SUCCESS JSON:isCorrectAuthentication +20170919 12:29:14 - info@chocolatdevenement.com SUCCESS JSON:isCorrectAuthentication +20170919 12:29:25 - 08949425 SUCCESS JSON:isCorrectAuthentication +20170919 12:30:36 - 08949425 SUCCESS JSON:testCity +20170919 12:35:40 - 08949425 SUCCESS JSON:getShippingDate +20170919 12:35:41 - 08949425 SUCCESS JSON:checkSaveShipment +20170919 12:36:02 - 08949425 SUCCESS JSON:checkSaveShipment +20170919 12:36:10 - 08949425 SUCCESS JSON:checkSaveShipment +20170919 12:36:12 - 08949425 SUCCESS JSON:getShippingDate +20170919 12:36:12 - 08949425 SUCCESS JSON:checkSaveShipment +20170919 12:39:09 - 08949425 SUCCESS JSON:testCity +20170919 12:39:35 - 08949425 SUCCESS JSON:testCity +20170919 12:39:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 12:40:42 - 08949425 SUCCESS JSON:testCity +20170919 12:40:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 12:41:19 - 08949425 SUCCESS JSON:testCity +20170919 12:41:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 12:41:24 - 08949425 SUCCESS JSON:getRelayPoints +20170919 12:41:24 - 08949425 SUCCESS JSON:getCities +20170919 12:41:40 - 08949425 SUCCESS JSON:testCity +20170919 12:41:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 12:42:26 - 08949425 SUCCESS JSON:testCity +20170919 12:42:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 12:44:11 - 08949425 SUCCESS JSON:testCity +20170919 12:44:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 12:44:20 - 08949425 SUCCESS JSON:getRelayPoints +20170919 12:44:20 - 08949425 SUCCESS JSON:getCities +20170919 12:44:29 - 08949425 SUCCESS JSON:getRelayPoints +20170919 12:44:29 - 08949425 SUCCESS JSON:getCities +20170919 12:45:27 - 08949425 SUCCESS JSON:testCity +20170919 12:45:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 12:45:33 - 08949425 SUCCESS JSON:getRelayPoints +20170919 12:45:33 - 08949425 SUCCESS JSON:getCities +20170919 12:46:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 12:47:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 12:47:14 - 08949425 SUCCESS JSON:getRelayPoints +20170919 12:47:14 - 08949425 SUCCESS JSON:getCities +20170919 12:47:44 - 08949425 SUCCESS JSON:getRelayPoints +20170919 12:47:44 - 08949425 SUCCESS JSON:getCities +20170919 12:47:55 - 08949425 SUCCESS JSON:getRelayPoints +20170919 12:47:55 - 08949425 SUCCESS JSON:getCities +20170919 12:50:12 - 08949425 SUCCESS JSON:testCity +20170919 12:50:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 12:50:20 - 08949425 SUCCESS JSON:getRelayPoints +20170919 12:50:20 - 08949425 SUCCESS JSON:getCities +20170919 12:50:31 - 08949425 SUCCESS JSON:getRelayPoints +20170919 12:50:32 - 08949425 SUCCESS JSON:getCities +20170919 12:50:33 - 08949425 SUCCESS JSON:getRelayPoints +20170919 12:50:33 - 08949425 SUCCESS JSON:getCities +20170919 12:50:37 - 08949425 SUCCESS JSON:getRelayPoints +20170919 12:50:37 - 08949425 SUCCESS JSON:getCities +20170919 12:50:44 - 08949425 SUCCESS JSON:getCities +20170919 12:50:47 - 08949425 SUCCESS JSON:getRelayPoints +20170919 12:50:47 - 08949425 SUCCESS JSON:getCities +20170919 12:50:58 - 08949425 SUCCESS JSON:getRelayPoints +20170919 12:50:58 - 08949425 SUCCESS JSON:getCities +20170919 12:55:05 - 08949425 SUCCESS JSON:testCity +20170919 12:55:06 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 12:55:38 - 08949425 SUCCESS JSON:testCity +20170919 12:55:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 12:55:44 - 08949425 SUCCESS JSON:getRelayPoints +20170919 12:55:44 - 08949425 SUCCESS JSON:getCities +20170919 12:56:05 - 08949425 SUCCESS JSON:testCity +20170919 12:56:06 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 12:56:13 - 08949425 SUCCESS JSON:getRelayPoints +20170919 12:56:13 - 08949425 SUCCESS JSON:getCities +20170919 12:56:36 - 08949425 SUCCESS JSON:testCity +20170919 12:56:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 12:57:36 - 08949425 SUCCESS JSON:isCorrectAuthentication +20170919 12:59:52 - 08949425 SUCCESS JSON:testCity +20170919 12:59:53 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 13:00:33 - 08949425 SUCCESS JSON:testCity +20170919 13:00:33 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 13:00:54 - 08949425 SUCCESS JSON:getShippingDate +20170919 13:00:54 - 08949425 SUCCESS JSON:checkSaveShipment +20170919 13:01:05 - 08949425 SUCCESS JSON:getShippingDate +20170919 13:01:06 - 08949425 SUCCESS JSON:checkSaveShipment +20170919 13:03:58 - 08949425 SUCCESS JSON:testCity +20170919 13:03:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 13:04:08 - 08949425 SUCCESS JSON:getRelayPoints +20170919 13:04:08 - 08949425 SUCCESS JSON:getCities +20170919 13:04:25 - 08949425 SUCCESS JSON:getShippingDate +20170919 13:04:25 - 08949425 SUCCESS JSON:checkSaveShipment +20170919 13:04:36 - 08949425 SUCCESS JSON:getShippingDate +20170919 13:04:37 - 08949425 SUCCESS JSON:checkSaveShipment +20170919 13:07:29 - 08949425 SUCCESS JSON:getShippingDate +20170919 13:07:29 - 08949425 SUCCESS JSON:checkSaveShipment +20170919 14:37:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:38:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:38:02 - 08949425 SUCCESS JSON:testCity +20170919 14:38:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:38:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:38:30 - 08949425 SUCCESS JSON:testCity +20170919 14:38:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:44:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:44:35 - 08949425 SUCCESS JSON:getRelayPoints +20170919 14:44:35 - 08949425 SUCCESS JSON:getCities +20170919 14:44:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:44:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:44:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:44:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:44:54 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:45:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:45:03 - 08949425 SUCCESS JSON:getRelayPoints +20170919 14:45:03 - 08949425 SUCCESS JSON:getCities +20170919 14:45:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:45:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:45:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:45:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:45:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:49:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:49:52 - 08949425 SUCCESS JSON:testCity +20170919 14:49:53 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:50:00 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:50:01 - 08949425 SUCCESS JSON:getRelayPoints +20170919 14:50:01 - 08949425 SUCCESS JSON:getCities +20170919 14:50:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:50:07 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:50:16 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:50:17 - 08949425 SUCCESS JSON:getRelayPoints +20170919 14:50:17 - 08949425 SUCCESS JSON:getCities +20170919 14:50:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:50:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:50:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:50:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:50:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:50:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:50:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:50:56 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:51:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:51:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:51:05 - 08949425 SUCCESS JSON:testCity +20170919 14:51:06 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:51:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:51:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:51:15 - 08949425 SUCCESS JSON:getRelayPoints +20170919 14:51:15 - 08949425 SUCCESS JSON:getCities +20170919 14:51:29 - 08949425 SUCCESS JSON:getShippingDate +20170919 14:51:30 - 08949425 SUCCESS JSON:checkSaveShipment +20170919 14:51:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:51:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:51:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:51:54 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:53:08 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:53:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:53:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 14:57:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:18:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:18:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:18:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:19:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:19:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:19:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:19:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:19:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:20:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:21:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:21:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:22:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:22:33 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:23:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:24:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:24:56 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:35:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:40:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:43:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:45:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:45:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:45:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:46:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:48:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:48:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:48:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:48:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:48:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:48:24 - 08949425 SUCCESS JSON:testCity +20170919 15:48:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:48:25 - 08949425 SUCCESS JSON:testCity +20170919 15:48:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:48:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:48:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:49:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:51:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:53:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:54:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:57:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:58:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 15:59:00 - 08949425 SUCCESS JSON:getShippingDate +20170919 15:59:02 - 08949425 SUCCESS JSON:checkSaveShipment +20170919 15:59:10 - 08949425 SUCCESS JSON:checkSaveShipment +20170919 16:02:00 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:02:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:02:57 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:31:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:31:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:31:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:35:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:35:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:35:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:35:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:37:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:37:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:39:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:41:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:44:57 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:45:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:46:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:46:33 - 08949425 SUCCESS JSON:getCarrierQuote +20170919 16:47:33 - 08949425 SUCCESS JSON:getCarrierQuote diff --git a/www/modules/tntofficiel/log/install.log b/www/modules/tntofficiel/log/install.log new file mode 100644 index 00000000..f8335dcc --- /dev/null +++ b/www/modules/tntofficiel/log/install.log @@ -0,0 +1,16 @@ +20170919 11:50:44 Starting TNT module install +20170919 11:50:45 parent::install OK +20170919 11:50:45 updateSettings OK +20170919 11:50:45 register hooks OK +20170919 11:50:45 create tab OK +20170919 11:50:45 create database tables OK +20170919 11:50:45 install carrier OK +20170919 11:50:45 override templates KO +20170919 12:27:32 Starting TNT module install +20170919 12:27:33 parent::install OK +20170919 12:27:33 updateSettings OK +20170919 12:27:33 register hooks OK +20170919 12:27:33 create tab OK +20170919 12:27:33 create database tables OK +20170919 12:27:33 install carrier OK +20170919 12:27:33 override templates KO diff --git a/www/modules/tntofficiel/log/uninstall.log b/www/modules/tntofficiel/log/uninstall.log new file mode 100644 index 00000000..cfc3b9f3 --- /dev/null +++ b/www/modules/tntofficiel/log/uninstall.log @@ -0,0 +1,16 @@ +20170919 11:50:41 Starting TNT module uninstall +20170919 11:50:41 unoverride templates OK +20170919 11:50:41 Unregister hooks OK +20170919 11:50:41 Delete tab OK +20170919 11:50:41 Delete TNT carrier OK +20170919 11:50:41 Delete settings OK +20170919 11:50:44 Parent::uninstall OK +20170919 11:50:44 TNT module uninstall complete +20170919 11:59:45 Starting TNT module uninstall +20170919 11:59:45 unoverride templates OK +20170919 11:59:45 Unregister hooks OK +20170919 11:59:45 Delete tab OK +20170919 11:59:45 Delete TNT carrier OK +20170919 11:59:45 Delete settings OK +20170919 11:59:45 Parent::uninstall OK +20170919 11:59:45 TNT module uninstall complete diff --git a/www/modules/tntofficiel/override/controllers/admin/AdminOrdersController.php b/www/modules/tntofficiel/override/controllers/admin/AdminOrdersController.php index c4f56250..ca267bd1 100644 --- a/www/modules/tntofficiel/override/controllers/admin/AdminOrdersController.php +++ b/www/modules/tntofficiel/override/controllers/admin/AdminOrdersController.php @@ -1,498 +1,499 @@ - - * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT - * @license https://opensource.org/licenses/MIT MIT License - */ - -class AdminOrdersController extends AdminOrdersControllerCore -{ - private $carriers_array = array(); - - public function __construct() - { - // Warning : Dependencies on construct implies to do not create static method using TNTOfficiel class ! - require_once _PS_MODULE_DIR_.'tntofficiel/tntofficiel.php'; - require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; - require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Carrier.php'; - require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_OrderHelper.php'; - require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_ShipmentHelper.php'; - require_once _PS_MODULE_DIR_.'tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDFCreator.php'; - - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - parent::__construct(); - $this->bootstrap = true; - $this->table = 'order'; - $this->className = 'Order'; - $this->lang = false; - $this->addRowAction('view'); - $this->explicitSelect = true; - $this->allow_export = true; - $this->deleted = false; - $this->context = Context::getContext(); - - $this->_select = ' - a.id_currency, - a.id_order AS id_pdf, - CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`, - osl.`name` AS `osname`, - os.`color`, - `to`.`bt_filename` AS `BT`, - `to`.`id_order` as `tntofficiel_id_order`, - `to`.`pickup_number` as `tntofficiel_pickup_number`, - IF((`to`.`carrier_label` IS NULL OR `to`.`carrier_label` = ""), - c1.`name`, - CONCAT(c1.`name` ,\' (\', `to`.`carrier_label`,\')\')) AS `carrier`, - c1.`id_carrier` as id_carrier, - IF((SELECT so.id_order - FROM `'._DB_PREFIX_.'orders` so - WHERE so.id_customer = a.id_customer AND so.id_order < a.id_order LIMIT 1) > 0, - 0, - 1) as new, - country_lang.name as cname, - IF(a.valid, 1, 0) badge_success'; - - $this->_join = ' - LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`) - LEFT JOIN `'._DB_PREFIX_.'tntofficiel_order` `to` ON (a.`id_order` = `to`.`id_order`) - INNER JOIN `'._DB_PREFIX_.'carrier` c1 ON (a.`id_carrier` = c1.`id_carrier`) - INNER JOIN `'._DB_PREFIX_.'address` address ON address.id_address = a.id_address_delivery - INNER JOIN `'._DB_PREFIX_.'country` country ON address.id_country = country.id_country - INNER JOIN `'._DB_PREFIX_.'country_lang` country_lang - ON (country.`id_country` = country_lang.`id_country` - AND country_lang.`id_lang` = '.(int)$this->context->language->id.') - LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = a.`current_state`) - LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl - ON (os.`id_order_state` = osl.`id_order_state` - AND osl.`id_lang` = '.(int)$this->context->language->id.')'; - $this->_orderBy = 'id_order'; - $this->_orderWay = 'DESC'; - - $statuses = OrderState::getOrderStates((int)$this->context->language->id); - foreach ($statuses as $status) { - $this->statuses_array[$status['id_order_state']] = $status['name']; - } - - $carriers = Carrier::getCarriers( - (int)$this->context->language->id, - false, - false, - false, - null, - Carrier::ALL_CARRIERS - ); - foreach ($carriers as $carrier) { - $this->carriers_array[$carrier['id_carrier']] = $carrier['name']; - } - - $this->fields_list = array( - 'id_order' => array( - 'title' => $this->l('ID'), - 'align' => 'text-center', - 'class' => 'fixed-width-xs', - ), - 'reference' => array( - 'title' => $this->l('Reference'), - ), - 'new' => array( - 'title' => $this->l('New client'), - 'align' => 'text-center', - 'type' => 'bool', - 'tmpTableFilter' => true, - 'orderby' => false, - 'callback' => 'printNewCustomer', - ), - 'customer' => array( - 'title' => $this->l('Customer'), - 'havingFilter' => true, - ), - 'carrier' => array( - 'title' => $this->l('Carrier'), - 'filter_key' => 'c1!id_carrier', - 'filter_type' => 'int', - 'order_key' => 'carrier', - 'havingFilter' => true, - 'type' => 'select', - 'list' => $this->carriers_array, - ), - ); - - if (Configuration::get('PS_B2B_ENABLE')) { - $this->fields_list = array_merge( - $this->fields_list, - array( - 'company' => array( - 'title' => $this->l('Company'), - 'filter_key' => 'c!company', - ), - ) - ); - } - - $this->fields_list = array_merge( - $this->fields_list, - array( - 'total_paid_tax_incl' => array( - 'title' => $this->l('Total'), - 'align' => 'text-right', - 'type' => 'price', - 'currency' => true, - 'callback' => 'setOrderCurrency', - 'badge_success' => true, - ), - 'payment' => array( - 'title' => $this->l('Payment'), - ), - 'osname' => array( - 'title' => $this->l('Status'), - 'type' => 'select', - 'color' => 'color', - 'list' => $this->statuses_array, - 'filter_key' => 'os!id_order_state', - 'filter_type' => 'int', - 'order_key' => 'osname', - ), - 'date_add' => array( - 'title' => $this->l('Date'), - 'align' => 'text-right', - 'type' => 'datetime', - 'filter_key' => 'a!date_add', - ), - 'id_pdf' => array( - 'title' => $this->l('PDF'), - 'align' => 'text-center', - 'callback' => 'printPDFIcons', - 'orderby' => false, - 'search' => false, - 'remove_onclick' => true, - ), - 'tntofficiel_id_order' => array( - 'title' => $this->l('TNT'), - 'align' => 'text-right', - 'orderby' => false, - 'search' => false, - 'callback' => 'printBtIcon', - 'remove_onclick' => true, - ) - ) - ); - - if (Configuration::get('TNT_CARRIER_PICKUP_NUMBER_SHOW')) { - $this->fields_list = array_merge( - $this->fields_list, - array( - 'tntofficiel_pickup_number' => array( - 'title' => $this->l('N° de Ramassage'), - 'align' => 'text-right', - 'orderby' => false, - 'search' => false, - ), - ) - ); - } - - if (Country::isCurrentlyUsed('country', true)) { - $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' - SELECT DISTINCT c.id_country, cl.`name` - FROM `'._DB_PREFIX_.'orders` o - '.Shop::addSqlAssociation('orders', 'o').' - INNER JOIN `'._DB_PREFIX_.'address` a ON a.id_address = o.id_address_delivery - INNER JOIN `'._DB_PREFIX_.'country` c ON a.id_country = c.id_country - INNER JOIN `'._DB_PREFIX_.'country_lang` cl - ON (c.`id_country` = cl.`id_country` - AND cl.`id_lang` = '.(int)$this->context->language->id.') - ORDER BY cl.name ASC'); - - $country_array = array(); - foreach ($result as $row) { - $country_array[$row['id_country']] = $row['name']; - } - - $part1 = array_slice($this->fields_list, 0, 3); - $part2 = array_slice($this->fields_list, 3); - $part1['cname'] = array( - 'title' => $this->l('Delivery'), - 'type' => 'select', - 'list' => $country_array, - 'filter_key' => 'country!id_country', - 'filter_type' => 'int', - 'order_key' => 'cname', - ); - $this->fields_list = array_merge($part1, $part2); - } - - $this->shopLinkType = 'shop'; - $this->shopShareDatas = Shop::SHARE_ORDER; - - if (Tools::isSubmit('id_order')) { - $intOrderID = (int)Tools::getValue('id_order'); - $objOrder = new Order($intOrderID); - $this->context->cart = new Cart($objOrder->id_cart); - $this->context->customer = new Customer($objOrder->id_customer); - } - - $this->bulk_actions = array( - 'updateOrderStatus' => array( - 'text' => $this->l('Change Order Status'), - 'icon' => 'icon-refresh', - ), - 'getBT' => array( - 'text' => $this->l('Bon de transport de TNT'), - 'icon' => 'icon-AdminTNTOfficiel', - ), - 'getManifest' => array( - 'text' => $this->l('Manifeste TNT'), - 'icon' => 'icon-file-text', - ), - ); - } - - /** - * @param $orderId - * - * @return mixed - */ - public function printBtIcon($orderId) - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - $arrTNTOrder = TNTOfficiel_OrderHelper::getInstance()->getOrderData($orderId); - $this->context->smarty->assign(array( - 'bt_filename' => $arrTNTOrder['bt_filename'], - 'getManifestUrl' => $this->context->link->getAdminLink('AdminTNTOfficiel').'&action=getManifest', - )); - - return $this->context->smarty->fetch(_PS_MODULE_DIR_.'tntofficiel/views/templates/admin/_print_bt_icon.tpl'); - } - - /** - * Return all the BT for the selected orders. - */ - public function processBulkGetBT() - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - if (Module::isInstalled(TNTOfficiel::MODULE_NAME)) { - $arrOrderID = (array)Tools::getValue('orderBox'); - $orderList = array(); - foreach ($arrOrderID as $strOrderID) { - $intOrderID = (int)$strOrderID; - $objOrder = new Order($intOrderID); - // Check if it's a tnt order. - if (TNTOfficiel_Carrier::isTNTOfficielCarrierID($objOrder->id_carrier)) { - $orderList[] = $intOrderID; - } - } - TNTOfficiel_OrderHelper::getInstance()->getBt($orderList); - } - } - - /** - * Return all the BT for the selected orders. - */ - public function processBulkGetManifest() - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - $arrOrderIDList = array(); - - if (!Tools::getIsset('orderBox')) { - return; - } - - $arrOrderID = (array)Tools::getValue('orderBox'); - foreach ($arrOrderID as $strOrderID) { - $intOrderID = (int)$strOrderID; - $arrOrderIDList[] = $intOrderID; - } - $manifest = new TNTOfficiel_ManifestPDFCreator(); - $manifest->createManifest($arrOrderIDList); - } - - public function processBulkUpdateOrderStatus() - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - $intOrderState = (int)Tools::getValue('id_order_state'); - - if (Tools::isSubmit('submitUpdateOrderStatus') && $intOrderState) { - if ($this->tabAccess['edit'] !== '1') { - $this->errors[] = Tools::displayError('You do not have permission to edit this.'); - } else { - $objOrderState = new OrderState($intOrderState); - - if (!Validate::isLoadedObject($objOrderState)) { - $this->errors[] = sprintf(Tools::displayError('Order status #%d cannot be loaded'), $intOrderState); - } else { - $arrOrderID = (array)Tools::getValue('orderBox'); - foreach ($arrOrderID as $strOrderID) { - $intOrderID = (int)$strOrderID; - $objOrder = new Order($intOrderID); - if (!Validate::isLoadedObject($objOrder)) { - $this->errors[] = sprintf(Tools::displayError('Order #%d cannot be loaded'), $intOrderID); - } else { - /* Override start */ - if (TNTOfficiel_Carrier::isTNTOfficielCarrierID($objOrder->id_carrier) - && $objOrderState->id == Configuration::get('PS_OS_SHIPPING') - ) { - $arrTNTOrder = TNTOfficiel_OrderHelper::getInstance()->getOrderData($objOrder->id); - if ($arrTNTOrder['shipping_date'] && !$arrTNTOrder['is_shipped']) { - $objTNTShipmentHelper = TNTOfficiel_ShipmentHelper::getInstance(); - $arrMDWShippingDate = $objTNTShipmentHelper->checkSaveShipmentDate( - $objOrder->id, - $arrTNTOrder['shipping_date'] - ); - if (array_key_exists('error', $arrMDWShippingDate) - && $arrMDWShippingDate['error'] == 1 - ) { - $arrMDWShippingDate = $objTNTShipmentHelper->getNewShippingDate($objOrder->id); - if (!$arrMDWShippingDate) { - $this->errors[] = sprintf( - Tools::displayError('Cannot change status for order #%d.'), - $intOrderID - ); - continue; - } - $tempDate = new DateTime('today'); - $startDate = $tempDate->format('Y-m-d'); - Db::getInstance()->update( - 'tntofficiel_order', - array( - 'shipping_date' => pSQL($arrMDWShippingDate['shippingDate']), - 'due_date' => pSQL($arrMDWShippingDate['dueDate']), - 'start_date' => pSQL($startDate), - ), - 'id_tntofficiel_order = '.(int)$arrTNTOrder['id_tntofficiel_order'] - ); - } - } elseif (!$arrTNTOrder['shipping_date'] && !$arrTNTOrder['is_shipped']) { - $this->errors[] = sprintf( - Tools::displayError('Cannot change status for order #%d.'), - $intOrderID - ); - continue; - } - } - /* Override end */ - - $current_order_state = $objOrder->getCurrentOrderState(); - if ($current_order_state->id == $objOrderState->id) { - $this->errors[] = $this->displayWarning( - sprintf('Order #%d has already been assigned this status.', $intOrderID) - ); - } else { - $history = new OrderHistory(); - $history->id_order = $objOrder->id; - $history->id_employee = (int)$this->context->employee->id; - - $use_existings_payment = !$objOrder->hasInvoice(); - $history->changeIdOrderState( - (int)$objOrderState->id, - $objOrder, - $use_existings_payment - ); - - $carrier = new Carrier($objOrder->id_carrier, $objOrder->id_lang); - $templateVars = array(); - if ($history->id_order_state == Configuration::get('PS_OS_SHIPPING') - && $objOrder->shipping_number - ) { - $templateVars = array( - '{followup}' => str_replace('@', $objOrder->shipping_number, $carrier->url) - ); - } - - if ($history->addWithemail(true, $templateVars)) { - if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { - foreach ($objOrder->getProducts() as $product) { - if (StockAvailable::dependsOnStock($product['product_id'])) { - StockAvailable::synchronize( - $product['product_id'], - (int)$product['id_shop'] - ); - } - } - } - } else { - $this->errors[] = sprintf( - Tools::displayError('Cannot change status for order #%d.'), - $intOrderID - ); - } - } - } - } - } - } - if (!count($this->errors)) { - Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token); - } - } - } - - /* public function printNewCustomer($tr) - { - return ($tr['new'] ? $this->l('Yes') : $this->l('No')); - } */ - public function postProcess() - { - TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); - - $objContext = Context::getContext(); - // See hookActionOrderStatusUpdate. - $objCookie = $objContext->cookie; - - $isTntInstalled = false; - if (Module::isInstalled(TNTOfficiel::MODULE_NAME)) { - $isTntInstalled = true; - $module = Module::getInstanceByName(TNTOfficiel::MODULE_NAME); - } - - if (Tools::isSubmit('id_order')) { - $intOrderID = (int)Tools::getValue('id_order'); - if ($intOrderID > 0) { - $objOrder = new Order($intOrderID); - if (!Validate::isLoadedObject($objOrder)) { - $this->errors[] = Tools::displayError('The order cannot be found within your database.'); - } - ShopUrl::cacheMainDomainForShop((int)$objOrder->id_shop); - - if (!Tools::isSubmit('submitState') && $isTntInstalled) { - if ($module->updateShippingDate($objOrder) === false) { - $objCookie->saveShippingError = $this->l('Impossible de récupérer une date de ramassage'); - } - } - } - } - - if (Tools::isSubmit('submitState') && isset($objOrder) && $isTntInstalled) { - if (TNTOfficiel_Carrier::isTNTOfficielCarrierID($objOrder->id_carrier)) { - $arrTNTOrder = TNTOfficiel_OrderHelper::getInstance()->getOrderData($objOrder->id); - if ($arrTNTOrder['shipping_date'] && !$arrTNTOrder['is_shipped']) { - $objTNTShipmentHelper = TNTOfficiel_ShipmentHelper::getInstance(); - $arrMDWShippingDate = $objTNTShipmentHelper->checkSaveShipmentDate( - $objOrder->id, - $arrTNTOrder['shipping_date'] - ); - if (array_key_exists('error', $arrMDWShippingDate)) { - if ($arrMDWShippingDate['error'] == 1) { - $objCookie->saveShippingError = $this->l('Erreur : '.$arrMDWShippingDate['message']); - - return; - } - $objCookie->saveShippingError = $this->l('Attention : '.$arrMDWShippingDate['message']); - } - } elseif (!$arrTNTOrder['shipping_date'] && !$arrTNTOrder['is_shipped']) { - $objCookie->saveShippingError = $this->l('Erreur : Choisir une date de ramassage'); - - return; - } - } - } - - parent::postProcess(); - } -} + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +class AdminOrdersController extends AdminOrdersControllerCore +{ + private $carriers_array = array(); + + public function __construct() + { + // Warning : Dependencies on construct implies to do not create static method using TNTOfficiel class ! + require_once _PS_MODULE_DIR_.'tntofficiel/tntofficiel.php'; + require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; + require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Carrier.php'; + require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_OrderHelper.php'; + require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_ShipmentHelper.php'; + require_once _PS_MODULE_DIR_.'tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDFCreator.php'; + + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + parent::__construct(); + $this->bootstrap = true; + $this->table = 'order'; + $this->className = 'Order'; + $this->lang = false; + $this->addRowAction('view'); + $this->explicitSelect = true; + $this->allow_export = true; + $this->deleted = false; + $this->context = Context::getContext(); + + $this->_select = ' + a.id_currency, + a.id_order AS id_pdf, + CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`, + osl.`name` AS `osname`, + os.`color`, + `to`.`bt_filename` AS `BT`, + `to`.`id_order` as `tntofficiel_id_order`, + `to`.`pickup_number` as `tntofficiel_pickup_number`, + IF((`to`.`carrier_label` IS NULL OR `to`.`carrier_label` = ""), + c1.`name`, + CONCAT(c1.`name` ,\' (\', `to`.`carrier_label`,\')\')) AS `carrier`, + c1.`id_carrier` as id_carrier, + IF((SELECT so.id_order + FROM `'._DB_PREFIX_.'orders` so + WHERE so.id_customer = a.id_customer AND so.id_order < a.id_order LIMIT 1) > 0, + 0, + 1) as new, + country_lang.name as cname, + IF(a.valid, 1, 0) badge_success'; + + $this->_join = ' + LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`) + LEFT JOIN `'._DB_PREFIX_.'tntofficiel_order` `to` ON (a.`id_order` = `to`.`id_order`) + INNER JOIN `'._DB_PREFIX_.'carrier` c1 ON (a.`id_carrier` = c1.`id_carrier`) + INNER JOIN `'._DB_PREFIX_.'address` address ON address.id_address = a.id_address_delivery + INNER JOIN `'._DB_PREFIX_.'country` country ON address.id_country = country.id_country + INNER JOIN `'._DB_PREFIX_.'country_lang` country_lang + ON (country.`id_country` = country_lang.`id_country` + AND country_lang.`id_lang` = '.(int)$this->context->language->id.') + LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = a.`current_state`) + LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl + ON (os.`id_order_state` = osl.`id_order_state` + AND osl.`id_lang` = '.(int)$this->context->language->id.')'; + $this->_orderBy = 'id_order'; + $this->_orderWay = 'DESC'; + + $statuses = OrderState::getOrderStates((int)$this->context->language->id); + foreach ($statuses as $status) { + $this->statuses_array[$status['id_order_state']] = $status['name']; + } + + $carriers = Carrier::getCarriers( + (int)$this->context->language->id, + false, + false, + false, + null, + Carrier::ALL_CARRIERS + ); + foreach ($carriers as $carrier) { + $this->carriers_array[$carrier['id_carrier']] = $carrier['name']; + } + + $this->fields_list = array( + 'id_order' => array( + 'title' => $this->l('ID'), + 'align' => 'text-center', + 'class' => 'fixed-width-xs', + ), + 'reference' => array( + 'title' => $this->l('Reference'), + ), + 'new' => array( + 'title' => $this->l('New client'), + 'align' => 'text-center', + 'type' => 'bool', + 'tmpTableFilter' => true, + 'orderby' => false, + 'callback' => 'printNewCustomer', + ), + 'customer' => array( + 'title' => $this->l('Customer'), + 'havingFilter' => true, + ), + 'carrier' => array( + 'title' => $this->l('Carrier'), + 'filter_key' => 'c1!id_carrier', + 'filter_type' => 'int', + 'order_key' => 'carrier', + 'havingFilter' => true, + 'type' => 'select', + 'list' => $this->carriers_array, + ), + ); + + if (Configuration::get('PS_B2B_ENABLE')) { + $this->fields_list = array_merge( + $this->fields_list, + array( + 'company' => array( + 'title' => $this->l('Company'), + 'filter_key' => 'c!company', + ), + ) + ); + } + + $this->fields_list = array_merge( + $this->fields_list, + array( + 'total_paid_tax_incl' => array( + 'title' => $this->l('Total'), + 'align' => 'text-right', + 'type' => 'price', + 'currency' => true, + 'callback' => 'setOrderCurrency', + 'badge_success' => true, + ), + 'payment' => array( + 'title' => $this->l('Payment'), + ), + 'osname' => array( + 'title' => $this->l('Status'), + 'type' => 'select', + 'color' => 'color', + 'list' => $this->statuses_array, + 'filter_key' => 'os!id_order_state', + 'filter_type' => 'int', + 'order_key' => 'osname', + ), + 'date_add' => array( + 'title' => $this->l('Date'), + 'align' => 'text-right', + 'type' => 'datetime', + 'filter_key' => 'a!date_add', + ), + 'id_pdf' => array( + 'title' => $this->l('PDF'), + 'align' => 'text-center', + 'callback' => 'printPDFIcons', + 'orderby' => false, + 'search' => false, + 'remove_onclick' => true, + ), + 'tntofficiel_id_order' => array( + 'title' => $this->l('TNT'), + 'align' => 'text-right', + 'orderby' => false, + 'search' => false, + 'callback' => 'printBtIcon', + 'remove_onclick' => true, + ) + ) + ); + + if (Configuration::get('TNT_CARRIER_PICKUP_NUMBER_SHOW')) { + $this->fields_list = array_merge( + $this->fields_list, + array( + 'tntofficiel_pickup_number' => array( + 'title' => $this->l('N° de Ramassage'), + 'align' => 'text-right', + 'orderby' => false, + 'search' => false, + ), + ) + ); + } + + if (Country::isCurrentlyUsed('country', true)) { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT DISTINCT c.id_country, cl.`name` + FROM `'._DB_PREFIX_.'orders` o + '.Shop::addSqlAssociation('orders', 'o').' + INNER JOIN `'._DB_PREFIX_.'address` a ON a.id_address = o.id_address_delivery + INNER JOIN `'._DB_PREFIX_.'country` c ON a.id_country = c.id_country + INNER JOIN `'._DB_PREFIX_.'country_lang` cl + ON (c.`id_country` = cl.`id_country` + AND cl.`id_lang` = '.(int)$this->context->language->id.') + ORDER BY cl.name ASC'); + + $country_array = array(); + foreach ($result as $row) { + $country_array[$row['id_country']] = $row['name']; + } + + $part1 = array_slice($this->fields_list, 0, 3); + $part2 = array_slice($this->fields_list, 3); + $part1['cname'] = array( + 'title' => $this->l('Delivery'), + 'type' => 'select', + 'list' => $country_array, + 'filter_key' => 'country!id_country', + 'filter_type' => 'int', + 'order_key' => 'cname', + ); + $this->fields_list = array_merge($part1, $part2); + } + + $this->shopLinkType = 'shop'; + $this->shopShareDatas = Shop::SHARE_ORDER; + + if (Tools::isSubmit('id_order')) { + $intOrderID = (int)Tools::getValue('id_order'); + $objOrder = new Order($intOrderID); + $this->context->cart = new Cart($objOrder->id_cart); + $this->context->customer = new Customer($objOrder->id_customer); + } + + $this->bulk_actions = array( + 'updateOrderStatus' => array( + 'text' => $this->l('Change Order Status'), + 'icon' => 'icon-refresh', + ), + 'getBT' => array( + 'text' => $this->l('Bon de transport de TNT'), + 'icon' => 'icon-AdminTNTOfficiel', + ), + 'getManifest' => array( + 'text' => $this->l('Manifeste TNT'), + 'icon' => 'icon-file-text', + ), + ); + } + + /** + * @param $orderId + * + * @return mixed + */ + public function printBtIcon($orderId) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $arrTNTOrder = TNTOfficiel_OrderHelper::getInstance()->getOrderData($orderId); + + $this->context->smarty->assign(array( + 'bt_filename' => $arrTNTOrder['bt_filename'], + 'getManifestUrl' => $this->context->link->getAdminLink('AdminTNTOfficiel').'&action=getManifest', + )); + + return $this->context->smarty->fetch(_PS_MODULE_DIR_.'tntofficiel/views/templates/admin/_print_bt_icon.tpl'); + } + + /** + * Return all the BT for the selected orders. + */ + public function processBulkGetBT() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + if (Module::isInstalled(TNTOfficiel::MODULE_NAME)) { + $arrOrderID = (array)Tools::getValue('orderBox'); + $orderList = array(); + foreach ($arrOrderID as $strOrderID) { + $intOrderID = (int)$strOrderID; + $objOrder = new Order($intOrderID); + // Check if it's a tnt order. + if (TNTOfficiel_Carrier::isTNTOfficielCarrierID($objOrder->id_carrier)) { + $orderList[] = $intOrderID; + } + } + TNTOfficiel_OrderHelper::getInstance()->getBt($orderList); + } + } + + /** + * Return all the BT for the selected orders. + */ + public function processBulkGetManifest() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $arrOrderIDList = array(); + + if (!Tools::getIsset('orderBox')) { + return; + } + + $arrOrderID = (array)Tools::getValue('orderBox'); + foreach ($arrOrderID as $strOrderID) { + $intOrderID = (int)$strOrderID; + $arrOrderIDList[] = $intOrderID; + } + $manifest = new TNTOfficiel_ManifestPDFCreator(); + $manifest->createManifest($arrOrderIDList); + } + + public function processBulkUpdateOrderStatus() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $intOrderState = (int)Tools::getValue('id_order_state'); + + if (Tools::isSubmit('submitUpdateOrderStatus') && $intOrderState) { + if ($this->tabAccess['edit'] !== '1') { + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); + } else { + $objOrderState = new OrderState($intOrderState); + + if (!Validate::isLoadedObject($objOrderState)) { + $this->errors[] = sprintf(Tools::displayError('Order status #%d cannot be loaded'), $intOrderState); + } else { + $arrOrderID = (array)Tools::getValue('orderBox'); + foreach ($arrOrderID as $strOrderID) { + $intOrderID = (int)$strOrderID; + $objOrder = new Order($intOrderID); + if (!Validate::isLoadedObject($objOrder)) { + $this->errors[] = sprintf(Tools::displayError('Order #%d cannot be loaded'), $intOrderID); + } else { + /* Override start */ + if (TNTOfficiel_Carrier::isTNTOfficielCarrierID($objOrder->id_carrier) + && $objOrderState->id == Configuration::get('PS_OS_SHIPPING') + ) { + $arrTNTOrder = TNTOfficiel_OrderHelper::getInstance()->getOrderData($objOrder->id); + if ($arrTNTOrder['shipping_date'] && !$arrTNTOrder['is_shipped']) { + $objTNTShipmentHelper = TNTOfficiel_ShipmentHelper::getInstance(); + $arrMDWShippingDate = $objTNTShipmentHelper->checkSaveShipmentDate( + $objOrder->id, + $arrTNTOrder['shipping_date'] + ); + if (array_key_exists('error', $arrMDWShippingDate) + && $arrMDWShippingDate['error'] == 1 + ) { + $arrMDWShippingDate = $objTNTShipmentHelper->getNewShippingDate($objOrder->id); + if (!$arrMDWShippingDate) { + $this->errors[] = sprintf( + Tools::displayError('Cannot change status for order #%d.'), + $intOrderID + ); + continue; + } + $tempDate = new DateTime('today'); + $startDate = $tempDate->format('Y-m-d'); + Db::getInstance()->update( + 'tntofficiel_order', + array( + 'shipping_date' => pSQL($arrMDWShippingDate['shippingDate']), + 'due_date' => pSQL($arrMDWShippingDate['dueDate']), + 'start_date' => pSQL($startDate), + ), + 'id_tntofficiel_order = '.(int)$arrTNTOrder['id_tntofficiel_order'] + ); + } + } elseif (!$arrTNTOrder['shipping_date'] && !$arrTNTOrder['is_shipped']) { + $this->errors[] = sprintf( + Tools::displayError('Cannot change status for order #%d.'), + $intOrderID + ); + continue; + } + } + /* Override end */ + + $current_order_state = $objOrder->getCurrentOrderState(); + if ($current_order_state->id == $objOrderState->id) { + $this->errors[] = $this->displayWarning( + sprintf('Order #%d has already been assigned this status.', $intOrderID) + ); + } else { + $history = new OrderHistory(); + $history->id_order = $objOrder->id; + $history->id_employee = (int)$this->context->employee->id; + + $use_existings_payment = !$objOrder->hasInvoice(); + $history->changeIdOrderState( + (int)$objOrderState->id, + $objOrder, + $use_existings_payment + ); + + $carrier = new Carrier($objOrder->id_carrier, $objOrder->id_lang); + $templateVars = array(); + if ($history->id_order_state == Configuration::get('PS_OS_SHIPPING') + && $objOrder->shipping_number + ) { + $templateVars = array( + '{followup}' => str_replace('@', $objOrder->shipping_number, $carrier->url) + ); + } + + if ($history->addWithemail(true, $templateVars)) { + if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { + foreach ($objOrder->getProducts() as $product) { + if (StockAvailable::dependsOnStock($product['product_id'])) { + StockAvailable::synchronize( + $product['product_id'], + (int)$product['id_shop'] + ); + } + } + } + } else { + $this->errors[] = sprintf( + Tools::displayError('Cannot change status for order #%d.'), + $intOrderID + ); + } + } + } + } + } + } + if (!count($this->errors)) { + Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token); + } + } + } + + /* public function printNewCustomer($tr) + { + return ($tr['new'] ? $this->l('Yes') : $this->l('No')); + } */ + public function postProcess() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $objContext = Context::getContext(); + // See hookActionOrderStatusUpdate. + $objCookie = $objContext->cookie; + + $isTntInstalled = false; + if (Module::isInstalled(TNTOfficiel::MODULE_NAME)) { + $isTntInstalled = true; + $module = Module::getInstanceByName(TNTOfficiel::MODULE_NAME); + } + + if (Tools::isSubmit('id_order')) { + $intOrderID = (int)Tools::getValue('id_order'); + if ($intOrderID > 0) { + $objOrder = new Order($intOrderID); + if (!Validate::isLoadedObject($objOrder)) { + $this->errors[] = Tools::displayError('The order cannot be found within your database.'); + } + ShopUrl::cacheMainDomainForShop((int)$objOrder->id_shop); + + if (!Tools::isSubmit('submitState') && $isTntInstalled) { + if ($module->updateShippingDate($objOrder) === false) { + $objCookie->saveShippingError = $this->l('Impossible de récupérer une date de ramassage'); + } + } + } + } + + if (Tools::isSubmit('submitState') && isset($objOrder) && $isTntInstalled) { + if (TNTOfficiel_Carrier::isTNTOfficielCarrierID($objOrder->id_carrier)) { + $arrTNTOrder = TNTOfficiel_OrderHelper::getInstance()->getOrderData($objOrder->id); + if ($arrTNTOrder['shipping_date'] && !$arrTNTOrder['is_shipped']) { + $objTNTShipmentHelper = TNTOfficiel_ShipmentHelper::getInstance(); + $arrMDWShippingDate = $objTNTShipmentHelper->checkSaveShipmentDate( + $objOrder->id, + $arrTNTOrder['shipping_date'] + ); + if (array_key_exists('error', $arrMDWShippingDate)) { + if ($arrMDWShippingDate['error'] == 1) { + $objCookie->saveShippingError = $this->l('Erreur : '.$arrMDWShippingDate['message']); + + return; + } + $objCookie->saveShippingError = $this->l('Attention : '.$arrMDWShippingDate['message']); + } + } elseif (!$arrTNTOrder['shipping_date'] && !$arrTNTOrder['is_shipped']) { + $objCookie->saveShippingError = $this->l('Erreur : Choisir une date de ramassage'); + + return; + } + } + } + + parent::postProcess(); + } +} diff --git a/www/modules/tntofficiel/views/js/deliveryPointsBox.js b/www/modules/tntofficiel/views/js/deliveryPointsBox.js index 8441cc63..dd18affc 100644 --- a/www/modules/tntofficiel/views/js/deliveryPointsBox.js +++ b/www/modules/tntofficiel/views/js/deliveryPointsBox.js @@ -1,488 +1,488 @@ -/** - * TNT OFFICIAL MODULE FOR PRESTASHOP - * - * @author GFI Informatique - * @copyright 2016 GFI Informatique, 2016 TNT - * @license https://opensource.org/licenses/MIT MIT License - */ - - -// On DOM Ready. -$(function () { - - if ( - // If Google Map API not loaded. - !(window.google && window.google.maps && window.google.maps.Map) - // and Google Map config exist. - && (window.TNTOfficiel && window.TNTOfficiel.config && window.TNTOfficiel.config.google && window.TNTOfficiel.config.google.map) - ) { - // Load Google Map API. - $.ajax({ - "url": window.TNTOfficiel.config.google.map.url, - "data": window.TNTOfficiel.config.google.map.data, - "dataType": 'script', - "cache": true - }) - .done(function () {}); - } - -}); - - -// Constructor -function TNTOfficielGMapMarkersConstrutor(elmtMapContainer, objGoogleMapsConfig) { - return this.init(elmtMapContainer, objGoogleMapsConfig); -}; - -// Prototype -TNTOfficielGMapMarkersConstrutor.prototype = { - - // Google Map Default Config. - objGMapsConfig: { - "lat": 46.227638, - "lng": 2.213749, - "zoom": 4 - }, - - // Google Map Object. - objGMapMap: null, - // Google Map Markers Area Boundaries. - objGMapMarkersBounds: null, - // Google Map Markers Collection. - arrGMapMarkersCollection: [], - // Google Map Markers Info Window (Bubble). - objGMapMarkersInfoWindow: null, - - /** - * Initialisation. - */ - init: function init(elmtMapContainer, objGoogleMapsConfig) { - // Extend Configuration. - jQuery.extend(this.objGMapsConfig, objGoogleMapsConfig); - - // Google Map Object. - this.objGMapMap = new window.google.maps.Map(elmtMapContainer, { - center: new window.google.maps.LatLng(this.objGMapsConfig.lat, this.objGMapsConfig.lng), - zoom: this.objGMapsConfig.zoom - }); - - // Init Markers. - this.objGMapMarkersBounds = new window.google.maps.LatLngBounds(); - this.arrGMapMarkersCollection = []; - this.objGMapMarkersInfoWindow = new window.google.maps.InfoWindow(); - - return this; - }, - /** - * - */ - addMarker: function addMarker(fltLatitude, fltLongitude, strURLIcon, strInfoWindowContent, objListeners) { - var _this = this; - - var objGMapLatLng = new window.google.maps.LatLng(fltLatitude, fltLongitude); - - // Create a new Google Map Marker. - var objGMapMarker = new window.google.maps.Marker({ - position: objGMapLatLng, - icon: strURLIcon - }); - // Add Marker to the Google Map. - objGMapMarker.setMap(this.objGMapMap); - // Extend Markers Area Boundaries. - this.objGMapMarkersBounds.extend(objGMapMarker.getPosition() /* objGMapLatLng */); - - //objGMapMarker.getMap(); - - // Bind Markers Events. - jQuery.each(objListeners, function (strEventType, evtCallback) { - // If callback is a function. - if (jQuery.type(evtCallback) === 'function') { - // Set Marker Event Listeners and Bind this to callback. - objGMapMarker.addListener(strEventType, $.proxy(function (objGMapEvent) { - // Default click action is to show InfoWindow (if any). - if (strEventType === 'click') { - this.objGMapMarkersInfoWindow.close(); - if (strInfoWindowContent) { - this.objGMapMarkersInfoWindow.setContent(strInfoWindowContent); - this.objGMapMarkersInfoWindow.open(this.objGMapMap /* objGMapMarker.getMap() */, objGMapMarker); - } - // Adjust zoom min/max range. - objGMapMarker.map.setZoom(Math.max(Math.min(17, objGMapMarker.map.getZoom()),10)); - // Update the Google Maps size. - this.trigger('resize', this.objGMapMap); - // Go to marker position. - objGMapMarker.map.panTo(objGMapMarker.getPosition()); - } - - return evtCallback.call(this, objGMapEvent); - }, _this)); - } - }); - - // Add Marker to collection. - this.arrGMapMarkersCollection.push(objGMapMarker); - - return objGMapMarker; - }, - /** - * - */ - fitBounds: function () { - // Fit Boundaries to display all markers. - if (this.arrGMapMarkersCollection.length > 0) { - this.objGMapMap.fitBounds(this.objGMapMarkersBounds); - } - - // Bind event to callback to execute only once. - window.google.maps.event.addListenerOnce(this.objGMapMap, 'bounds_changed', function () { - // this === this.objGMapMap - this.setZoom(Math.min(17, this.getZoom())); - }); - - // Update the Google Maps size. - this.trigger('resize', this.objGMapMap); - - return this; - }, - /** - * - */ - trigger: function (strEventType, objBind) { - window.google.maps.event.trigger(objBind, strEventType); - - return this; - } -}; - - -/** - * - * @param method - * @param strDataB64 - * @constructor - */ -var TNTOfficiel_deliveryPointsBox = function (method, strDataB64) { - var _this = this; - - // xett, pex - this.strRepoType = (method === 'relay_points') ? 'xett' : 'pex'; - // relay_points, repositories. - this.method = method; - // ClassName Plural Prefix. - this.strClassNameRepoPrefixPlural = (this.strRepoType === 'xett') ? 'relay-points' : 'repositories'; - // ClassName Prefix. - this.strClassNameRepoPrefix = (this.strRepoType === 'xett') ? 'relay-point' : 'repository'; - - this.strClassNameInfoBlocSelected = 'is-selected'; - - this.CSSSelectors = { - // Loading Mask and Progress indicator. - loading: '#loading', - // Popin Content Container. - // div#repositories.repositories - popInContentContainer: '#' + this.method, - // Popin Header Container. - // div.repositories-header - popInHeaderContainer: '.' + this.strClassNameRepoPrefixPlural + '-header', - - // Search form CP/Cities. - // form#repositories_form.repositories-form - formSearchRepo: 'form.' + this.strClassNameRepoPrefixPlural + '-form', - // Repo List Container. - // ul#repositories_list.repositories-list - infoBlocListContainer: '.' + this.strClassNameRepoPrefixPlural + '-list', - // Google Map Container. - // div#repositories_map.repositories-map - mapContainer: '.' + this.strClassNameRepoPrefixPlural + '-map', - - // All Repo Bloc Item Container. - // li#repositories_item_.repository-item - infoBlocItemContainerCollection: '.' + this.strClassNameRepoPrefix + '-item', - // Repo Selected Button Bloc Item. - // button.repository-item-select - infoBlocItemButtonSelected: '.' + this.strClassNameRepoPrefix + '-item-select' - - // One Repo Bloc Item Container. - // li#repositories_item_.repository-item - // '#' + this.method + '_item_' + id - }; - - // getRelayPoints, getRepositories List. - this.arrRepoList = JSON.parse(base64_decode(strDataB64)) || null; - - // If invalid repo list. - if ($.type(this.arrRepoList) !== 'array') { - // Set empty repo list. - this.arrRepoList = []; - } - - // On repo form search submit. - $(this.CSSSelectors.formSearchRepo).on('submit', function (objEvent) { - - $(_this.CSSSelectors.loading).show(); - - objEvent.preventDefault(); - - // If test is valid, get all data for postcode and city and update the list - var objJqXHR = $.ajax({ - "url": window.TNTOfficiel.link.front.module[_this.strRepoType === 'xett' ? 'boxRelayPoints' : 'boxDropOffPoints'], - "method": 'GET', - "data": $(objEvent.target).serialize(), - "dataType": 'html', - "cache": false, - "global": false - }); - - objJqXHR - .done(function (mxdData, strTextStatus, objJqXHR) { - // Update PopIn Content. - $(_this.CSSSelectors.popInContentContainer).parent().html(mxdData); - }) - .fail(function (objJqXHR, strTextStatus, strErrorThrown) { - // console.error( objJqXHR.status + ' ' + objJqXHR.statusText ); - alert('Une erreur de communication avec le serveur est survenue, le transporteur TNT est momentanément indisponible.'); - location.reload(); - }) - .always(function () { - $(_this.CSSSelectors.loading).hide(); - }); - - }); - - // TODO: remove or add unbinding on close. - /* - $(window).off('.'+window.TNTOfficiel.module.name) - .on('resize.'+window.TNTOfficiel.module.name, $.proxy(this.prepareScrollbar, this)); - // this.eventGoogleMaps(); - */ - - // On select button repo info bloc click. - $(this.CSSSelectors.infoBlocItemButtonSelected).off().on('click', function () { - var intMarkerIndex = $(this).parents(_this.CSSSelectors.infoBlocItemContainerCollection).attr('id').split('_').pop(); - - // Loading. - $(_this.CSSSelectors.loading).show(); - - var objJqXHR = $.ajax({ - "url": window.TNTOfficiel.link.front.module.saveProductInfo, - "method": 'GET', - "data": { - product: _this.arrRepoList[intMarkerIndex] - }, - "dataType": 'html', - "cache": false, - "global": false - }); - - objJqXHR - .done(function (mxdData, strTextStatus, objJqXHR) { - // Delete existing Repository Info. - $('.shipping-method-info').remove(); - // Add Repository Info in Carrier Bloc. - $('.tnt_carrier_radio:checked').parents('tr').find('td.delivery_option_info').append(mxdData); - - $.fancybox.close(); - - $(document).trigger('hook_extra_carrier_shipping_method_popup:close'); - }) - .fail(function (objJqXHR, strTextStatus, strErrorThrown) { - // console.error( objJqXHR.status + ' ' + objJqXHR.statusText ); - }) - .always(function () { - if ($('#opc_payment_methods').length > 0) { - $(_this.CSSSelectors.loading).hide(); - } - }); - }); - - - this.eventGoogleMaps = function () { - // If no Google library. - if (window.google && window.google.maps) { - var objTNTOfficielGMapMarkers = new TNTOfficielGMapMarkersConstrutor( - $(_this.CSSSelectors.mapContainer)[0], - window.TNTOfficiel.config.google.map.default - ); - - // Prepare and returns data marker to add on the map. - for (var intMarkerIndex = 0; intMarkerIndex < _this.arrRepoList.length; intMarkerIndex++) { - - var objRepoItem = _this.arrRepoList[intMarkerIndex]; - - // Set Marker InfoWindow Content. - var strInfoWindowContent = '\ -
    \ - ' + ( this.strRepoType == 'xett' ? '
  • Code: ' + objRepoItem[this.strRepoType] + '
  • ' : '') + '\ -
  • ' + objRepoItem.name + '
  • \ -
  • ' + ( objRepoItem.address ? objRepoItem.address : objRepoItem.address1 + '
    ' + objRepoItem.address2 ) + '
  • \ -
  • ' + objRepoItem.postcode + ' ' + objRepoItem.city + '
  • \ -
'; - - var strCSSSelectorRepoInfoBloc = '#' + _this.method + '_item_' + intMarkerIndex; - - var objGMapMarker = objTNTOfficielGMapMarkers.addMarker( - objRepoItem.latitude, - objRepoItem.longitude, - window.TNTOfficiel.link.front.shop + 'modules/' + window.TNTOfficiel.module.name + '/' + 'views/img/' + 'modal/marker/' + (intMarkerIndex + 1) + '.png', - strInfoWindowContent, - { - // On Marker Click. - "click": $.proxy(function (strCSSSelectorRepoInfoBloc, objGMapEvent) { - var strClassNameInfoBlocSelected = 'is-selected', - $elmtInfoBlocSelect = $(strCSSSelectorRepoInfoBloc); - - // Highlight Selected Marker Info. - $(_this.CSSSelectors.infoBlocItemContainerCollection + '.' + strClassNameInfoBlocSelected) - .removeClass(strClassNameInfoBlocSelected); - $elmtInfoBlocSelect.addClass(strClassNameInfoBlocSelected); - - // The event is the click on marker (not triggered from list). - if (objGMapEvent != null) { - // Scroll to item - _this.scrollY($elmtInfoBlocSelect); - } - }, null, strCSSSelectorRepoInfoBloc) - } - ); - - // On click on info bloc item, trigger click on marker. - $(strCSSSelectorRepoInfoBloc).off().on('click', $.proxy(function (objGMapMarker) { - objTNTOfficielGMapMarkers.trigger('click', objGMapMarker); - }, null, objGMapMarker)); - - } - - objTNTOfficielGMapMarkers.fitBounds(); - } - - }; - - /** - * Prepare scrollbar for list item - * @private - */ - this.prepareScrollbar = function () { - $('#list_scrollbar_container').nanoScroller({ - preventPageScrolling: true - }); - }; - - // Scroll to item. - this.scrollY = function ($elmtInfoBlocSelect) { - var $elmtContainer = $('#list_scrollbar_container'), - $elmtContent = $('#list_scrollbar_content'), - intPositionItem = parseInt($elmtInfoBlocSelect.offset().top + $elmtContent.scrollTop() - $elmtContainer.offset().top); - $elmtContent.scrollTop(intPositionItem); - }; - - this.prepareScrollbar(); - this.eventGoogleMaps(); - - return this; -}; - - -$(document).ready(function () { - - /* - * Global jQuery AJAX event, excepted for request with option "global":false. - */ - - // Triggered if an AJAX request is started and no other AJAX requests are currently running. - $(document).ajaxStart(function () { - $('#loading').show(); - }); - // Triggered if there are no more Ajax requests being processed. - $(document).ajaxStop(function () { - $('#loading').hide(); - }); - - /* - * Payment Choice. - */ - - if (window.TNTOfficiel.order.isOPC) { - // On payment mode choice with OPC. - $(document).on('click', '#opc_payment_methods a', XHRcheckProductCode); - } else { - // On payment mode choice. - $('#form').on('submit', XHRcheckProductCode); - } - -}); - -function XHRcheckProductCode (objEvent) { - - // result from async AJAX request. - var result = null; - - var objJqXHR = $.ajax({ - "url": window.TNTOfficiel.link.front.module.checkProductCode, - "method": 'POST', - "data": { - product: _getCurrentShippingMethod(), - deliveryOptionTnt: deliveryOptionTnt - }, - "async": false - }); - - objJqXHR - .done(function (mxdData, strTextStatus, objJqXHR) { - result = JSON.parse(mxdData); - }) - .fail(function (objJqXHR, strTextStatus, strErrorThrown) { - // console.error( objJqXHR.status + ' ' + objJqXHR.statusText ); - }) - .always(function () { - - }); - - // If no result or has error. - if (!result || result.error == 1) { - alert("Vous ne pouvez pas continuer votre commande car aucun mode de livraison n'est sélectionné."); - objEvent.preventDefault(); - - return false; - } - - if (!(window.TNTOfficiel.order.isOPC && result.error == 0 && result[ window.TNTOfficiel.module.name ] == 1 - || !window.TNTOfficiel.order.isOPC && result.error == 0) - ) { - return false; - } - - var $elmtForm = $(this); - - if (window.TNTOfficiel.order.isOPC) { - window.$elmtPaymentLink = $elmtForm; - } - var $elmtCurrentSpMethod = $('.tnt_carrier_radio:checked'); - var boolCGVDisplayed = $('#cgv').length > 0; - var boolCGVChecked = $('input#cgv:checked').length > 0; - var boolHasRepoAddressSelected = $($elmtCurrentSpMethod).closest('table').find('.shipping-method-info').length > 0; - var boolShowPopup = true; - - if (($elmtCurrentSpMethod.attr('product-type') == 'dropoffpoint'|$elmtCurrentSpMethod.attr('product-type') == 'depot')& !boolHasRepoAddressSelected) { - boolShowPopup = false; - } - - if ((boolCGVDisplayed&boolCGVChecked| !boolCGVDisplayed) && $elmtCurrentSpMethod.length && boolShowPopup) { - if (!$elmtForm.data('valid')) { - // Stop form submit - objEvent.preventDefault(); - - // Shows the modal popup - displayExtraAddressDataPopup($elmtCurrentSpMethod.attr('product-type')); - - // Save which tnt product was chosen - XHRStoreProductPrice($elmtCurrentSpMethod); - } else { - if (window.TNTOfficiel.order.isOPC) { - window.location = $elmtForm.attr('href'); - } else { - $elmtForm.submit(); - } - } - } -} - +/** + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + + +// On DOM Ready. +$(function () { + + if ( + // If Google Map API not loaded. + !(window.google && window.google.maps && window.google.maps.Map) + // and Google Map config exist. + && (window.TNTOfficiel && window.TNTOfficiel.config && window.TNTOfficiel.config.google && window.TNTOfficiel.config.google.map) + ) { + // Load Google Map API. + $.ajax({ + "url": window.TNTOfficiel.config.google.map.url, + "data": window.TNTOfficiel.config.google.map.data, + "dataType": 'script', + "cache": true + }) + .done(function () {}); + } + +}); + + +// Constructor +function TNTOfficielGMapMarkersConstrutor(elmtMapContainer, objGoogleMapsConfig) { + return this.init(elmtMapContainer, objGoogleMapsConfig); +}; + +// Prototype +TNTOfficielGMapMarkersConstrutor.prototype = { + + // Google Map Default Config. + objGMapsConfig: { + "lat": 46.227638, + "lng": 2.213749, + "zoom": 4 + }, + + // Google Map Object. + objGMapMap: null, + // Google Map Markers Area Boundaries. + objGMapMarkersBounds: null, + // Google Map Markers Collection. + arrGMapMarkersCollection: [], + // Google Map Markers Info Window (Bubble). + objGMapMarkersInfoWindow: null, + + /** + * Initialisation. + */ + init: function init(elmtMapContainer, objGoogleMapsConfig) { + // Extend Configuration. + jQuery.extend(this.objGMapsConfig, objGoogleMapsConfig); + + // Google Map Object. + this.objGMapMap = new window.google.maps.Map(elmtMapContainer, { + center: new window.google.maps.LatLng(this.objGMapsConfig.lat, this.objGMapsConfig.lng), + zoom: this.objGMapsConfig.zoom + }); + + // Init Markers. + this.objGMapMarkersBounds = new window.google.maps.LatLngBounds(); + this.arrGMapMarkersCollection = []; + this.objGMapMarkersInfoWindow = new window.google.maps.InfoWindow(); + + return this; + }, + /** + * + */ + addMarker: function addMarker(fltLatitude, fltLongitude, strURLIcon, strInfoWindowContent, objListeners) { + var _this = this; + + var objGMapLatLng = new window.google.maps.LatLng(fltLatitude, fltLongitude); + + // Create a new Google Map Marker. + var objGMapMarker = new window.google.maps.Marker({ + position: objGMapLatLng, + icon: strURLIcon + }); + // Add Marker to the Google Map. + objGMapMarker.setMap(this.objGMapMap); + // Extend Markers Area Boundaries. + this.objGMapMarkersBounds.extend(objGMapMarker.getPosition() /* objGMapLatLng */); + + //objGMapMarker.getMap(); + + // Bind Markers Events. + jQuery.each(objListeners, function (strEventType, evtCallback) { + // If callback is a function. + if (jQuery.type(evtCallback) === 'function') { + // Set Marker Event Listeners and Bind this to callback. + objGMapMarker.addListener(strEventType, $.proxy(function (objGMapEvent) { + // Default click action is to show InfoWindow (if any). + if (strEventType === 'click') { + this.objGMapMarkersInfoWindow.close(); + if (strInfoWindowContent) { + this.objGMapMarkersInfoWindow.setContent(strInfoWindowContent); + this.objGMapMarkersInfoWindow.open(this.objGMapMap /* objGMapMarker.getMap() */, objGMapMarker); + } + // Adjust zoom min/max range. + objGMapMarker.map.setZoom(Math.max(Math.min(17, objGMapMarker.map.getZoom()),10)); + // Update the Google Maps size. + this.trigger('resize', this.objGMapMap); + // Go to marker position. + objGMapMarker.map.panTo(objGMapMarker.getPosition()); + } + + return evtCallback.call(this, objGMapEvent); + }, _this)); + } + }); + + // Add Marker to collection. + this.arrGMapMarkersCollection.push(objGMapMarker); + + return objGMapMarker; + }, + /** + * + */ + fitBounds: function () { + // Fit Boundaries to display all markers. + if (this.arrGMapMarkersCollection.length > 0) { + this.objGMapMap.fitBounds(this.objGMapMarkersBounds); + } + + // Bind event to callback to execute only once. + window.google.maps.event.addListenerOnce(this.objGMapMap, 'bounds_changed', function () { + // this === this.objGMapMap + this.setZoom(Math.min(17, this.getZoom())); + }); + + // Update the Google Maps size. + this.trigger('resize', this.objGMapMap); + + return this; + }, + /** + * + */ + trigger: function (strEventType, objBind) { + window.google.maps.event.trigger(objBind, strEventType); + + return this; + } +}; + + +/** + * + * @param method + * @param strDataB64 + * @constructor + */ +var TNTOfficiel_deliveryPointsBox = function (method, strDataB64) { + var _this = this; + + // xett, pex + this.strRepoType = (method === 'relay_points') ? 'xett' : 'pex'; + // relay_points, repositories. + this.method = method; + // ClassName Plural Prefix. + this.strClassNameRepoPrefixPlural = (this.strRepoType === 'xett') ? 'relay-points' : 'repositories'; + // ClassName Prefix. + this.strClassNameRepoPrefix = (this.strRepoType === 'xett') ? 'relay-point' : 'repository'; + + this.strClassNameInfoBlocSelected = 'is-selected'; + + this.CSSSelectors = { + // Loading Mask and Progress indicator. + loading: '#loading', + // Popin Content Container. + // div#repositories.repositories + popInContentContainer: '#' + this.method, + // Popin Header Container. + // div.repositories-header + popInHeaderContainer: '.' + this.strClassNameRepoPrefixPlural + '-header', + + // Search form CP/Cities. + // form#repositories_form.repositories-form + formSearchRepo: 'form.' + this.strClassNameRepoPrefixPlural + '-form', + // Repo List Container. + // ul#repositories_list.repositories-list + infoBlocListContainer: '.' + this.strClassNameRepoPrefixPlural + '-list', + // Google Map Container. + // div#repositories_map.repositories-map + mapContainer: '.' + this.strClassNameRepoPrefixPlural + '-map', + + // All Repo Bloc Item Container. + // li#repositories_item_.repository-item + infoBlocItemContainerCollection: '.' + this.strClassNameRepoPrefix + '-item', + // Repo Selected Button Bloc Item. + // button.repository-item-select + infoBlocItemButtonSelected: '.' + this.strClassNameRepoPrefix + '-item-select' + + // One Repo Bloc Item Container. + // li#repositories_item_.repository-item + // '#' + this.method + '_item_' + id + }; + + // getRelayPoints, getRepositories List. + this.arrRepoList = JSON.parse(base64_decode(strDataB64)) || null; + + // If invalid repo list. + if ($.type(this.arrRepoList) !== 'array') { + // Set empty repo list. + this.arrRepoList = []; + } + + // On repo form search submit. + $(this.CSSSelectors.formSearchRepo).on('submit', function (objEvent) { + + $(_this.CSSSelectors.loading).show(); + + objEvent.preventDefault(); + + // If test is valid, get all data for postcode and city and update the list + var objJqXHR = $.ajax({ + "url": window.TNTOfficiel.link.front.module[_this.strRepoType === 'xett' ? 'boxRelayPoints' : 'boxDropOffPoints'], + "method": 'GET', + "data": $(objEvent.target).serialize(), + "dataType": 'html', + "cache": false, + "global": false + }); + + objJqXHR + .done(function (mxdData, strTextStatus, objJqXHR) { + // Update PopIn Content. + $(_this.CSSSelectors.popInContentContainer).parent().html(mxdData); + }) + .fail(function (objJqXHR, strTextStatus, strErrorThrown) { + // console.error( objJqXHR.status + ' ' + objJqXHR.statusText ); + alert('Une erreur de communication avec le serveur est survenue, le transporteur TNT est momentanément indisponible.'); + location.reload(); + }) + .always(function () { + $(_this.CSSSelectors.loading).hide(); + }); + + }); + + // TODO: remove or add unbinding on close. + /* + $(window).off('.'+window.TNTOfficiel.module.name) + .on('resize.'+window.TNTOfficiel.module.name, $.proxy(this.prepareScrollbar, this)); + // this.eventGoogleMaps(); + */ + + // On select button repo info bloc click. + $(this.CSSSelectors.infoBlocItemButtonSelected).off().on('click', function () { + var intMarkerIndex = $(this).parents(_this.CSSSelectors.infoBlocItemContainerCollection).attr('id').split('_').pop(); + + // Loading. + $(_this.CSSSelectors.loading).show(); + + var objJqXHR = $.ajax({ + "url": window.TNTOfficiel.link.front.module.saveProductInfo, + "method": 'GET', + "data": { + product: _this.arrRepoList[intMarkerIndex] + }, + "dataType": 'html', + "cache": false, + "global": false + }); + + objJqXHR + .done(function (mxdData, strTextStatus, objJqXHR) { + // Delete existing Repository Info. + $('.shipping-method-info').remove(); + // Add Repository Info in Carrier Bloc. + $('.tnt_carrier_radio:checked').parents('tr').find('td.delivery_option_info').append(mxdData); + + $.fancybox.close(); + + $(document).trigger('hook_extra_carrier_shipping_method_popup:close'); + }) + .fail(function (objJqXHR, strTextStatus, strErrorThrown) { + // console.error( objJqXHR.status + ' ' + objJqXHR.statusText ); + }) + .always(function () { + $(_this.CSSSelectors.loading).hide(); + // if ($('#opc_payment_methods').length > 0) { + // } + }); + }); + + + this.eventGoogleMaps = function () { + // If no Google library. + if (window.google && window.google.maps) { + var objTNTOfficielGMapMarkers = new TNTOfficielGMapMarkersConstrutor( + $(_this.CSSSelectors.mapContainer)[0], + window.TNTOfficiel.config.google.map.default + ); + + // Prepare and returns data marker to add on the map. + for (var intMarkerIndex = 0; intMarkerIndex < _this.arrRepoList.length; intMarkerIndex++) { + + var objRepoItem = _this.arrRepoList[intMarkerIndex]; + + // Set Marker InfoWindow Content. + var strInfoWindowContent = '\ +
    \ + ' + ( this.strRepoType == 'xett' ? '
  • Code: ' + objRepoItem[this.strRepoType] + '
  • ' : '') + '\ +
  • ' + objRepoItem.name + '
  • \ +
  • ' + ( objRepoItem.address ? objRepoItem.address : objRepoItem.address1 + '
    ' + objRepoItem.address2 ) + '
  • \ +
  • ' + objRepoItem.postcode + ' ' + objRepoItem.city + '
  • \ +
'; + + var strCSSSelectorRepoInfoBloc = '#' + _this.method + '_item_' + intMarkerIndex; + + var objGMapMarker = objTNTOfficielGMapMarkers.addMarker( + objRepoItem.latitude, + objRepoItem.longitude, + window.TNTOfficiel.link.front.shop + 'modules/' + window.TNTOfficiel.module.name + '/' + 'views/img/' + 'modal/marker/' + (intMarkerIndex + 1) + '.png', + strInfoWindowContent, + { + // On Marker Click. + "click": $.proxy(function (strCSSSelectorRepoInfoBloc, objGMapEvent) { + var strClassNameInfoBlocSelected = 'is-selected', + $elmtInfoBlocSelect = $(strCSSSelectorRepoInfoBloc); + + // Highlight Selected Marker Info. + $(_this.CSSSelectors.infoBlocItemContainerCollection + '.' + strClassNameInfoBlocSelected) + .removeClass(strClassNameInfoBlocSelected); + $elmtInfoBlocSelect.addClass(strClassNameInfoBlocSelected); + + // The event is the click on marker (not triggered from list). + if (objGMapEvent != null) { + // Scroll to item + _this.scrollY($elmtInfoBlocSelect); + } + }, null, strCSSSelectorRepoInfoBloc) + } + ); + + // On click on info bloc item, trigger click on marker. + $(strCSSSelectorRepoInfoBloc).off().on('click', $.proxy(function (objGMapMarker) { + objTNTOfficielGMapMarkers.trigger('click', objGMapMarker); + }, null, objGMapMarker)); + + } + + objTNTOfficielGMapMarkers.fitBounds(); + } + + }; + + /** + * Prepare scrollbar for list item + * @private + */ + this.prepareScrollbar = function () { + $('#list_scrollbar_container').nanoScroller({ + preventPageScrolling: true + }); + }; + + // Scroll to item. + this.scrollY = function ($elmtInfoBlocSelect) { + var $elmtContainer = $('#list_scrollbar_container'), + $elmtContent = $('#list_scrollbar_content'), + intPositionItem = parseInt($elmtInfoBlocSelect.offset().top + $elmtContent.scrollTop() - $elmtContainer.offset().top); + $elmtContent.scrollTop(intPositionItem); + }; + + this.prepareScrollbar(); + this.eventGoogleMaps(); + + return this; +}; + + +$(document).ready(function () { + + /* + * Global jQuery AJAX event, excepted for request with option "global":false. + */ + + // Triggered if an AJAX request is started and no other AJAX requests are currently running. + $(document).ajaxStart(function () { + $('#loading').show(); + }); + // Triggered if there are no more Ajax requests being processed. + $(document).ajaxStop(function () { + $('#loading').hide(); + }); + + /* + * Payment Choice. + */ + + if (window.TNTOfficiel.order.isOPC) { + // On payment mode choice with OPC. + $(document).on('click', '#opc_payment_methods a', XHRcheckProductCode); + } else { + // On payment mode choice. + $('#form').on('submit', XHRcheckProductCode); + } + +}); + +function XHRcheckProductCode (objEvent) { + + // result from async AJAX request. + var result = null; + + var objJqXHR = $.ajax({ + "url": window.TNTOfficiel.link.front.module.checkProductCode, + "method": 'POST', + "data": { + product: _getCurrentShippingMethod(), + deliveryOptionTnt: deliveryOptionTnt + }, + "async": false + }); + + objJqXHR + .done(function (mxdData, strTextStatus, objJqXHR) { + result = JSON.parse(mxdData); + }) + .fail(function (objJqXHR, strTextStatus, strErrorThrown) { + // console.error( objJqXHR.status + ' ' + objJqXHR.statusText ); + }) + .always(function () { + + }); + + // If no result or has error. + if (!result || result.error == 1) { + alert("Vous ne pouvez pas continuer votre commande car aucun mode de livraison n'est sélectionné."); + objEvent.preventDefault(); + + return false; + } + + if (!(window.TNTOfficiel.order.isOPC && result.error == 0 && result[ window.TNTOfficiel.module.name ] == 1 + || !window.TNTOfficiel.order.isOPC && result.error == 0) + ) { + return false; + } + + var $elmtForm = $(this); + + if (window.TNTOfficiel.order.isOPC) { + window.$elmtPaymentLink = $elmtForm; + } + var $elmtCurrentSpMethod = $('.tnt_carrier_radio:checked'); + var boolCGVDisplayed = $('#cgv').length > 0; + var boolCGVChecked = $('input#cgv:checked').length > 0; + var boolHasRepoAddressSelected = $($elmtCurrentSpMethod).closest('table').find('.shipping-method-info').length > 0; + var boolShowPopup = true; + + if (($elmtCurrentSpMethod.attr('product-type') == 'dropoffpoint'|$elmtCurrentSpMethod.attr('product-type') == 'depot')& !boolHasRepoAddressSelected) { + boolShowPopup = false; + } + + if ((boolCGVDisplayed&boolCGVChecked| !boolCGVDisplayed) && $elmtCurrentSpMethod.length && boolShowPopup) { + if (!$elmtForm.data('valid')) { + // Stop form submit + objEvent.preventDefault(); + + // Shows the modal popup + displayExtraAddressDataPopup($elmtCurrentSpMethod.attr('product-type')); + + // Save which tnt product was chosen + XHRStoreProductPrice($elmtCurrentSpMethod); + } else { + if (window.TNTOfficiel.order.isOPC) { + window.location = $elmtForm.attr('href'); + } else { + $elmtForm.submit(); + } + } + } +} + diff --git a/www/modules/tntofficiel/views/templates/admin/AdminTNTOfficiel.tpl b/www/modules/tntofficiel/views/templates/admin/AdminTNTOfficiel.tpl new file mode 100644 index 00000000..be6d3e30 --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/AdminTNTOfficiel.tpl @@ -0,0 +1,10 @@ +{* + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + *} +
+ +
\ No newline at end of file diff --git a/www/modules/tntofficiel/views/templates/admin/_configure/helpers/form/form.tpl b/www/modules/tntofficiel/views/templates/admin/_configure/helpers/form/form.tpl new file mode 100644 index 00000000..f192b9b6 --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/_configure/helpers/form/form.tpl @@ -0,0 +1,44 @@ +{* + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + *} + +{* extends //themes/default/template/helpers/form/form.tpl *} +{extends file="helpers/form/form.tpl"} + +{*block name="other_input"} +    {if isset($input.name) && $input.type == 'test1'} +    {/if} +{/block*} + +{block name="defaultForm" prepend} +

{$tntofficiel.TNTCarrierTrad|escape:'html':'UTF-8'}

+ +{/block} + +{*block name="after"} +{/block*} + +{block name="script"} + + $(document).ready(function () { + $('#TNT_CARRIER_PASSWORD').val("%p#c`Q9,6GSP?U4]e]Zst"); + var boolSomethingChanged = false; + $('#configuration_form').on('change', function () { + boolSomethingChanged = true; + }); + $('#configuration_form').on('submit', function (objEvent) { + if (boolSomethingChanged) { + //element.submit(); + } else { + objEvent.preventDefault(); + } + }); + }); + +{/block} diff --git a/www/modules/tntofficiel/views/templates/admin/_configure/helpers/form/index.php b/www/modules/tntofficiel/views/templates/admin/_configure/helpers/form/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/_configure/helpers/form/index.php @@ -0,0 +1,18 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/tntofficiel/views/templates/admin/_configure/helpers/index.php b/www/modules/tntofficiel/views/templates/admin/_configure/helpers/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/_configure/helpers/index.php @@ -0,0 +1,18 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/tntofficiel/views/templates/admin/_configure/index.php b/www/modules/tntofficiel/views/templates/admin/_configure/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/_configure/index.php @@ -0,0 +1,18 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/tntofficiel/views/templates/admin/_print_bt_icon.tpl b/www/modules/tntofficiel/views/templates/admin/_print_bt_icon.tpl new file mode 100644 index 00000000..7e95e40d --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/_print_bt_icon.tpl @@ -0,0 +1,17 @@ +{* + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + *} + + + + + + + + + + diff --git a/www/modules/tntofficiel/views/templates/admin/index.php b/www/modules/tntofficiel/views/templates/admin/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/index.php @@ -0,0 +1,18 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/tntofficiel/views/templates/admin/manifest/custom_template_content.tpl b/www/modules/tntofficiel/views/templates/admin/manifest/custom_template_content.tpl new file mode 100644 index 00000000..fd0996f2 --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/manifest/custom_template_content.tpl @@ -0,0 +1,91 @@ +{* + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + *} + + + + +
+
+ + + + + + + + + + + + + + + + +
Compte exp.:{$manifestData['carrierAccount']|escape:'htmlall':'UTF-8'} 
Nom exp.:{$manifestData['address']['name']|escape:'htmlall':'UTF-8'}
& Adresse: + {$manifestData['address']['address1']|escape:'htmlall':'UTF-8'}
+ {if ($manifestData['address']['address2'] != null)} + {$manifestData['address']['address2']|escape:'htmlall':'UTF-8'}
+ {/if} + {$manifestData['address']['city']|escape:'htmlall':'UTF-8'}{if ($manifestData['address']['city'] != null)}, {/if} + {$manifestData['address']['postcode']|escape:'htmlall':'UTF-8'}{if ($manifestData['address']['postcode'] != null)}, {/if} + {$manifestData['address']['country']|escape:'htmlall':'UTF-8'}
+
+
+
+
+ + + {foreach from=$manifestData['parcelsData'] item=parcel} + + + + + + + + + + {/foreach} +
Num BTPoids (Kgs)DestinataireCode PostalVilleService
 
{$parcel['parcel_number']|escape:'htmlall':'UTF-8'}{$parcel['weight']|escape:'htmlall':'UTF-8'}{$parcel['address']->firstname|escape:'htmlall':'UTF-8'} {$parcel['address']->lastname|escape:'htmlall':'UTF-8'}{$parcel['address']->postcode|escape:'htmlall':'UTF-8'}{$parcel['address']->city|escape:'htmlall':'UTF-8'}{$parcel['tntData']['carrier_label']|escape:'htmlall':'UTF-8'}
+
+ +
+
+ + + + + +
+ +
+
Compte {$manifestData['carrierAccount']|escape:'htmlall':'UTF-8'}Total
 
{$manifestData['totalWeight']|escape:'htmlall':'UTF-8'}{$manifestData['parcelsNumber']|escape:'htmlall':'UTF-8'}
 
 
+
+ +
+
+ + + + + + +
 
 
 
 
Signature de l'expéditeur_____________________Date ___/___/______
+
+


+

+
+ + + + +
Reçu par TNT_____________________Date ___/___/______Heure ____:____
+
+
+
diff --git a/www/modules/tntofficiel/views/templates/admin/manifest/custom_template_footer.tpl b/www/modules/tntofficiel/views/templates/admin/manifest/custom_template_footer.tpl new file mode 100644 index 00000000..8d093466 --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/manifest/custom_template_footer.tpl @@ -0,0 +1,16 @@ +{* + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + *} + + + + + +
diff --git a/www/modules/tntofficiel/views/templates/admin/manifest/custom_template_header.tpl b/www/modules/tntofficiel/views/templates/admin/manifest/custom_template_header.tpl new file mode 100644 index 00000000..3487291f --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/manifest/custom_template_header.tpl @@ -0,0 +1,21 @@ +{* + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + *} + + + + + + + + + + + +
DOCUMENT MANIFESTE + +
diff --git a/www/modules/tntofficiel/views/templates/admin/manifest/index.php b/www/modules/tntofficiel/views/templates/admin/manifest/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/manifest/index.php @@ -0,0 +1,18 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/index.php b/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/index.php @@ -0,0 +1,18 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/index.php b/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/index.php @@ -0,0 +1,18 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/orders/helpers/index.php b/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/orders/helpers/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/orders/helpers/index.php @@ -0,0 +1,18 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/orders/helpers/view/index.php b/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/orders/helpers/view/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/orders/helpers/view/index.php @@ -0,0 +1,18 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/orders/helpers/view/view.tpl b/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/orders/helpers/view/view.tpl new file mode 100644 index 00000000..7e91ab14 --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/orders/helpers/view/view.tpl @@ -0,0 +1,1400 @@ +{* + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + *} + +{* VALIDATOR: This file is a modified copy of view.tpl owned by Prestashop. *} +{extends file="helpers/view/view.tpl"} + +{block name="override_tpl"} + + + {assign var="hook_invoice" value={hook h="displayInvoice" id_order=$order->id}} + {if ($hook_invoice)} + {* VALIDATOR: $hook_invoice is a non escaped HTML string. *} +
{$hook_invoice}
+ {/if} + +
+
+
+
+ + {l s='Date' mod='tntofficiel'} + {dateFormat date=$order->date_add full=false} +
+
+
+
+ + {l s='Total' mod='tntofficiel'} + {displayPrice price=$order->total_paid_tax_incl currency=$currency->id} +
+
+
+
+ + {l s='Messages' mod='tntofficiel'} + {sizeof($customer_thread_message)} +
+
+ +
+
+
+
+
+
+ + {l s='Order' mod='tntofficiel'} + {$order->reference|escape:'htmlall':'UTF-8'} + {l s='#' mod='tntofficiel'}{$order->id|intval} +
+ +
+
+ +
+ + + {l s='Print order' mod='tntofficiel'} + +   +{* override start *} + {tnt_order_get_data orderId=$order->id assign='tntOrderData'} + {if $tntOrderData} + {if $tntOrderData.bt_filename} + + + {l s='Bon de Transport de TNT' mod='tntofficiel'} + +   + {assign var=tracking_action value=['action' => 'tracking']} + + + {l s='Suivi TNT' mod='tntofficiel'} + + {else} + + + {l s='Bon de Transport de TNT' mod='tntofficiel'} + +   + + + {l s='Suivi TNT' mod='tntofficiel'} + + {/if} +   + + + {l s='Manifeste TNT' mod='tntofficiel'} + +   + {/if} +{* override end *} + {if Configuration::get('PS_INVOICE') && count($invoices_collection) && $order->invoice_number} + + + {l s='View invoice' mod='tntofficiel'} + + {else} + + + {l s='No invoice' mod='tntofficiel'} + + {/if} +   + {if $order->delivery_number} + + + {l s='View delivery slip' mod='tntofficiel'} + + {else} + + + {l s='No delivery slip' mod='tntofficiel'} + + {/if} +   + {if Configuration::get('PS_ORDER_RETURN')} + + + {if $order->hasBeenShipped()} + {l s='Return products' mod='tntofficiel'} + {elseif $order->hasBeenPaid()} + {l s='Standard refund' mod='tntofficiel'} + {else} + {l s='Cancel products' mod='tntofficiel'} + {/if} + +   + {/if} + {if $order->hasInvoice()} + + + {l s='Partial refund' mod='tntofficiel'} + + {/if} +
+ + + +
+ {* VALIDATOR: $HOOK_CONTENT_ORDER is a non escaped HTML string. *} + {$HOOK_CONTENT_ORDER} + +
+

{l s='Status' mod='tntofficiel'} ({$history|@count|intval})

+ +
+ + + {foreach from=$history item=row key=key} + {if ($key == 0)} + + + + + + + {else} + + + + + + + {/if} + {/foreach} + +
{$row['ostate_name']|stripslashes|escape:'html':'UTF-8'}{$row['ostate_name']|stripslashes}{if $row['employee_lastname']}{$row['employee_firstname']|stripslashes|escape:'html':'UTF-8'} {$row['employee_lastname']|stripslashes|escape:'html':'UTF-8'}{/if}{dateFormat date=$row['date_add'] full=true}
{$row['ostate_name']|stripslashes|escape:'html':'UTF-8'}{if $row['employee_lastname']}{$row['employee_firstname']|stripslashes|escape:'html':'UTF-8'} {$row['employee_lastname']|stripslashes|escape:'html':'UTF-8'}{else} {/if}{dateFormat date=$row['date_add'] full=true}
+
+ + +
+
+
+ + +
+
+ +
+
+
+
+ +
+

{l s='Documents' mod='tntofficiel'} ({$order->getDocuments()|@count|intval})

+ {* Include document template *} + {include file='controllers/orders/_documents.tpl'} +
+
+ +
+ + + +
+ {* VALIDATOR: $HOOK_CONTENT_SHIP is a non escaped HTML string. *} + {$HOOK_CONTENT_SHIP} + +
+

{l s='Shipping' mod='tntofficiel'} ({$order->getShipping()|@count|intval})

+ + {if !$order->isVirtual()} +
+ {if $order->gift_message} +
+ +
+ {* VALIDATOR: $order->gift_message|nl2br is a non escaped HTML string. *} +

{$order->gift_message|nl2br}

+
+
+ {/if} + {include file='controllers/orders/_shipping.tpl'} + {if $carrierModuleCall} + {* VALIDATOR: $carrierModuleCall is a non escaped HTML string. *} + {$carrierModuleCall} + {/if} +
+ {if $order->recyclable} + {l s='Recycled packaging' mod='tntofficiel'} + {else} + {l s='Recycled packaging' mod='tntofficiel'} + {/if} + + {if $order->gift} + {l s='Gift wrapping' mod='tntofficiel'} + {else} + {l s='Gift wrapping' mod='tntofficiel'} + {/if} +
+ {/if} +
+ +
+

{l s='Merchandise Returns' mod='tntofficiel'} ({$order->getReturn()|@count|intval})

+ {if !$order->isVirtual()} + + {if $order->getReturn()|count > 0} +
+ + + + + + + + + + + {foreach from=$order->getReturn() item=line} + + + + + + + {/foreach} + +
DateTypeCarrierTracking number
{$line.date_add|escape:'htmlall':'UTF-8'}{$line.type|escape:'htmlall':'UTF-8'}{$line.state_name|escape:'htmlall':'UTF-8'} + {if isset($line.url) && isset($line.tracking_number)}{$line.tracking_number}{elseif isset($line.tracking_number)}{$line.tracking_number}{/if} + {if $line.can_edit} +
+ + + +
+ {/if} +
+
+ {else} +
+
+ + {l s='No merchandise returned yet' mod='tntofficiel'} +
+
+ {/if} + {if $carrierModuleCall} + {* VALIDATOR: $carrierModuleCall is a non escaped HTML string. *} + {$carrierModuleCall} + {/if} + {/if} +
+
+ +
+ +
+
+ + {l s='Payment' mod='tntofficiel'} {$order->getOrderPayments()|@count|intval} +
+ {if count($order->getOrderPayments()) > 0} +

id == 6)} style="display: none;"{/if}> + {l s='Warning' mod='tntofficiel'} + {displayPrice price=$total_paid currency=$currency->id} + {l s='paid instead of' mod='tntofficiel'} + {displayPrice price=$orders_total_paid_tax_incl currency=$currency->id} + {foreach $order->getBrother() as $brother_order} + {if $brother_order@first} + {if count($order->getBrother()) == 1} +
{l s='This warning also concerns order ' mod='tntofficiel'} + {else} +
{l s='This warning also concerns the next orders:' mod='tntofficiel'} + {/if} + {/if} + + #{'%06d'|sprintf:$brother_order->id|escape:'htmlall':'UTF-8'} + + {/foreach} +

+ {/if} +
+
+ + + + + + + + + + + + + {foreach from=$order->getOrderPaymentCollection() item=payment} + + + + + + + + + + + + {foreachelse} + + + + {/foreach} + + + + + + + + + +
{l s='Date' mod='tntofficiel'}{l s='Payment method' mod='tntofficiel'}{l s='Transaction ID' mod='tntofficiel'}{l s='Amount' mod='tntofficiel'}{l s='Invoice' mod='tntofficiel'}
{dateFormat date=$payment->date_add full=true}{$payment->payment_method|escape:'html':'UTF-8'}{$payment->transaction_id|escape:'html':'UTF-8'}{displayPrice price=$payment->amount currency=$payment->id_currency} + {if $invoice = $payment->getOrderInvoice($order->id)} + {$invoice->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)|escape:'htmlall':'UTF-8'} + {else} + {/if} + + +
+
+ + {l s='No payment methods are available' mod='tntofficiel'} +
+
+
+ +
+ +
+
+
+ + + {foreach from=$payment_methods item=payment_method} + + + + + + + + {if count($invoices_collection) > 0} + + {/if} + + +
+
+
+ {if (!$order->valid && sizeof($currencies) > 1)} +
+
+ +
+ +

{l s='Do not forget to update your exchange rate before making this change.' mod='tntofficiel'}

+
+
+ +
+
+
+ {/if} +
+ {hook h="displayAdminOrderLeft" id_order=$order->id} +
+
+ +
+ {if $customer->id} + +
+
+ {if ($customer->isGuest())} + {l s='This order has been placed by a guest.' mod='tntofficiel'} + {if (!Customer::customerExists($customer->email))} +
+ + +

{l s='This feature will generate a random password and send an email to the customer.' mod='tntofficiel'}

+
+ {else} +
+ {l s='A registered customer account has already claimed this email address' mod='tntofficiel'} +
+ {/if} + {else} +
+
{l s='Email' mod='tntofficiel'}
+
{$customer->email|escape:'htmlall':'UTF-8'}
+
{l s='Account registered' mod='tntofficiel'}
+
{dateFormat date=$customer->date_add full=true}
+
{l s='Valid orders placed' mod='tntofficiel'}
+
{$customerStats['nb_orders']|intval}
+
{l s='Total spent since registration' mod='tntofficiel'}
+
{displayPrice price=Tools::ps_round(Tools::convertPrice($customerStats['total_orders'], $currency), 2) currency=$currency->id}
+ {if Configuration::get('PS_B2B_ENABLE')} +
{l s='Siret' mod='tntofficiel'}
+
{$customer->siret|escape:'htmlall':'UTF-8'}
+
{l s='APE' mod='tntofficiel'}
+
{$customer->ape|escape:'htmlall':'UTF-8'}
+ {/if} +
+ {/if} +
+ +
+ +
+
+ + {l s='Private note' mod='tntofficiel'} +
+
+
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ {/if} + +
+ + +
+ +
+ +

{l s='Shipping address' mod='tntofficiel'}

+ {if !$order->isVirtual()} + + {if $can_edit} +
+
+
+ +
+
+ +
+
+
+ {/if} +
+
+
+ + + {l s='Edit' mod='tntofficiel'} + + {displayAddressDetail address=$addresses.delivery newLine='
'} + {if $addresses.delivery->other} +
{$addresses.delivery->other|escape:'htmlall':'UTF-8'}
+ {/if} +
+
+
+
+
+
+ {/if} +
+
+ +

{l s='Invoice address' mod='tntofficiel'}

+ {if $can_edit} +
+
+
+ +
+
+ +
+
+
+ {/if} +
+
+
+ + + {l s='Edit' mod='tntofficiel'} + + {displayAddressDetail address=$addresses.invoice newLine='
'} + {if $addresses.invoice->other} +
{$addresses.invoice->other|escape:'htmlall':'UTF-8'}
+ {/if} +
+
+
+
+
+
+
+
+
+ +
+
+
+ {l s='Messages' mod='tntofficiel'} {sizeof($customer_thread_message)|intval} +
+ {if (sizeof($messages))} +
+
+ {foreach from=$messages item=message} +
+
+ +
+
+
+ +   + {dateFormat date=$message['date_add']} - + +

+ {if ($message['elastname']|escape:'html':'UTF-8')}{$message['efirstname']|escape:'html':'UTF-8'} + {$message['elastname']|escape:'html':'UTF-8'}{else}{$message['cfirstname']|escape:'html':'UTF-8'} {$message['clastname']|escape:'html':'UTF-8'} + {/if} + {if ($message['private'] == 1)} + {l s='Private' mod='tntofficiel'} + {/if} +

+

+ {$message['message']|escape:'html':'UTF-8'|nl2br} +

+
+ {*if ($message['is_new_for_me'])} + + + + {/if*} + {/foreach} +
+
+ {/if} +
+
+
+
+ +
+ +

+ + {l s='Configure predefined messages' mod='tntofficiel'} + + +

+
+
+ +
+ +
+ + + + + + + +
+
+ +
+ +
+ +

+
+
+ + + + + + + {l s='Show all messages' mod='tntofficiel'} + + +
+
+
+
+ {hook h="displayAdminOrderRight" id_order=$order->id} +
+
+ {hook h="displayAdminOrder" id_order=$order->id} +
+
+
+ +
+ +
+ +
+
+ + {l s='Products' mod='tntofficiel'} {$products|@count|intval} +
+
+ +
+ + {capture "TaxMethod"} + {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)} + {l s='tax excluded.' mod='tntofficiel'} + {else} + {l s='tax included.' mod='tntofficiel'} + {/if} + {/capture} + {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)} + + {else} + + {/if} +
+ + + + + + + + {if $display_warehouse}{/if} + {if ($order->hasBeenPaid())}{/if} + {if ($order->hasBeenDelivered() || $order->hasProductReturned())} + + {/if} + {if $stock_management}{/if} + + + + + + {if !$order->hasBeenDelivered()} + + {/if} + + + + {foreach from=$products item=product key=k} + {* Include customized datas partial *} + {include file='controllers/orders/_customized_data.tpl'} + {* Include product line partial *} + {include file='controllers/orders/_product_line.tpl'} + {/foreach} + {if $can_edit} + {include file='controllers/orders/_new_product.tpl'} + {/if} + +
{l s='Product' mod='tntofficiel'} + {l s='Unit Price' mod='tntofficiel'} + {$smarty.capture.TaxMethod|escape:'htmlall':'UTF-8'} + {l s='Qty' mod='tntofficiel'}{l s='Warehouse' mod='tntofficiel'}{l s='Refunded' mod='tntofficiel'}{l s='Returned' mod='tntofficiel'}{l s='Available quantity' mod='tntofficiel'} + {l s='Total' mod='tntofficiel'} + {$smarty.capture.TaxMethod|escape:'htmlall':'UTF-8'} +
+
+ + {if $can_edit} +
+ {if !$order->hasBeenDelivered()} + + {/if} + +
+ {/if} +
 
+
+
+
+ {l s='For this customer group, prices are displayed as: [1]%s[/1]' mod='tntofficiel' sprintf=[$smarty.capture.TaxMethod] tags=['']} + {if !Configuration::get('PS_ORDER_RETURN')} +
{l s='Merchandise returns are disabled' mod='tntofficiel'} + {/if} +
+
+
+
+ {if (sizeof($discounts) || $can_edit)} +
+ + + + + + {if $can_edit} + + {/if} + + + + {foreach from=$discounts item=discount} + + + + {if $can_edit} + + {/if} + + {/foreach} + +
+ + {l s='Discount name' mod='tntofficiel'} + + + + {l s='Value' mod='tntofficiel'} + +
{$discount['name']|escape:'htmlall':'UTF-8'} + {if $discount['value'] != 0.00} + - + {/if} + {displayPrice price=$discount['value'] currency=$currency->id} + + + + {l s='Delete voucher' mod='tntofficiel'} + +
+
+ + {/if} +
+
+
+ + {* Assign order price *} + {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)} + {assign var=order_product_price value=($order->total_products)} + {assign var=order_discount_price value=$order->total_discounts_tax_excl} + {assign var=order_wrapping_price value=$order->total_wrapping_tax_excl} + {assign var=order_shipping_price value=$order->total_shipping_tax_excl} + {else} + {assign var=order_product_price value=$order->total_products_wt} + {assign var=order_discount_price value=$order->total_discounts_tax_incl} + {assign var=order_wrapping_price value=$order->total_wrapping_tax_incl} + {assign var=order_shipping_price value=$order->total_shipping_tax_incl} + {/if} + + + + + + total_discounts_tax_incl == 0}style="display: none;"{/if}> + + + + + total_wrapping_tax_incl == 0}style="display: none;"{/if}> + + + + + + + + + + {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)} + + + + + + {/if} + {assign var=order_total_price value=$order->total_paid_tax_incl} + + + + + +
{l s='Products:' mod='tntofficiel'} + {displayPrice price=$order_product_price currency=$currency->id} +
{l s='Discounts' mod='tntofficiel'} + -{displayPrice price=$order_discount_price currency=$currency->id} +
{l s='Wrapping' mod='tntofficiel'} + {displayPrice price=$order_wrapping_price currency=$currency->id} +
{l s='Shipping' mod='tntofficiel'} + {displayPrice price=$order_shipping_price currency=$currency->id} +
{l s='Taxes' mod='tntofficiel'}{displayPrice price=($order->total_paid_tax_incl-$order->total_paid_tax_excl) currency=$currency->id}
{l s='Total' mod='tntofficiel'} + {displayPrice price=$order_total_price currency=$currency->id} +
+
+
+
+
+ + +
+ +
+
+ +
+
+ + {if (sizeof($sources))} +
+
+ + {l s='Sources' mod='tntofficiel'} {$sources|@count|intval} +
+ +
+ {/if} + + + {if count($order->getBrother()) > 0} +
+
+ + {l s='Linked orders' mod='tntofficiel'} +
+
+ + + + + + + + + + + {foreach $order->getBrother() as $brother_order} + + + + + + + {/foreach} + +
+ {l s='Order no. ' mod='tntofficiel'} + + {l s='Status' mod='tntofficiel'} + + {l s='Amount' mod='tntofficiel'} +
+ #{$brother_order->id|escape:'htmlall':'UTF-8'} + + {$brother_order->getCurrentOrderState()->name[$current_id_lang]|escape:'htmlall':'UTF-8'} + + {displayPrice price=$brother_order->total_paid_tax_incl currency=$currency->id} + + + + {l s='See the order' mod='tntofficiel'} + +
+
+
+ {/if} +
+
+ + + +{/block} diff --git a/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/orders/index.php b/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/orders/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/override/controllers/admin/templates/orders/index.php @@ -0,0 +1,18 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/tntofficiel/views/templates/admin/override/controllers/index.php b/www/modules/tntofficiel/views/templates/admin/override/controllers/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/override/controllers/index.php @@ -0,0 +1,18 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/tntofficiel/views/templates/admin/override/index.php b/www/modules/tntofficiel/views/templates/admin/override/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/templates/admin/override/index.php @@ -0,0 +1,18 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/tntofficiel/views/templates/front/displayAjaxTracking.tpl b/www/modules/tntofficiel/views/templates/front/displayAjaxTracking.tpl new file mode 100644 index 00000000..e42e741e --- /dev/null +++ b/www/modules/tntofficiel/views/templates/front/displayAjaxTracking.tpl @@ -0,0 +1,66 @@ +{* + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + *} + + + {l s='shipping detail' mod='tntofficiel'} + + + + +
+ +
{l s='shipping detail' mod='tntofficiel'}
+ +
+ {foreach from=$parcels item=parcel} +
+
{l s='tracking number' mod='tntofficiel'}
+
{$parcel['parcel_number']|escape:'htmlall':'UTF-8'}
+ +
+
+

+ {if (isset($parcel['trackingData']['allStatus']) && count($parcel['trackingData']['allStatus']))} +
    + {foreach from=$parcel['trackingData']['allStatus'] item=label key=id} +
  • {$label|escape:'htmlall':'UTF-8'}
  • + {/foreach} +
+ {/if} + {if (isset($parcel['trackingData']['history']))} +
+
    + {foreach from=$parcel['trackingData']['history'] item=info key=idx} +
  • +
      +
    • {$idx|intval}
    • +
    • {$info['label']|escape:'htmlall':'UTF-8'} :
    • + {if (isset($info['date']) && strlen($info['date']))} +
    • {$info['date']|escape:'htmlall':'UTF-8'|date_format:"%d.%m.%Y - %R"}
    • + {/if} + {if (isset($info['center']) && strlen($info['center']))} +
    • - {$info['center']|escape:'htmlall':'UTF-8'}
    • + {/if} +
    +
  • + {/foreach} +
+
+

+ {/if} +
+ {/foreach} + + + \ No newline at end of file diff --git a/www/modules/tntofficiel/views/templates/front/index.php b/www/modules/tntofficiel/views/templates/front/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/templates/front/index.php @@ -0,0 +1,18 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/tntofficiel/views/templates/hook/displayCarrierList2.tpl b/www/modules/tntofficiel/views/templates/hook/__displayCarrierList.tpl similarity index 96% rename from www/modules/tntofficiel/views/templates/hook/displayCarrierList2.tpl rename to www/modules/tntofficiel/views/templates/hook/__displayCarrierList.tpl index d23b25f6..a58dea12 100644 --- a/www/modules/tntofficiel/views/templates/hook/displayCarrierList2.tpl +++ b/www/modules/tntofficiel/views/templates/hook/__displayCarrierList.tpl @@ -5,6 +5,7 @@ * @copyright 2016 GFI Informatique, 2016 TNT * @license https://opensource.org/licenses/MIT MIT License *} + {foreach $carriers.products as $tnt_index => $product} {foreach $current_delivery_option as $idAddressSelected => $idCarrierOptionSelected} @@ -81,13 +82,14 @@ {assign var='descript' value="Pour une livraisons dans une de nos agences TNT en France métropolitaine.
Mise à votre disposition sur présentation d'une pièce d'identité et contre signature dès 8 heures le lendemain de l'expédition de votre commande et ce pendant 10 Jours."} {/if} -
+ +
-
+ -
+
{if $product.total_price_with_tax && !$product.is_free && (!isset($free_shipping) || (isset($free_shipping) && !$free_shipping))} {if $use_taxes == 1} {if $priceDisplay == 1} @@ -175,7 +177,7 @@
-
+

{l s='TNT Additional Address' mod='tntofficiel'}

diff --git a/www/modules/tntofficiel/views/templates/hook/displayCarrierList.tpl b/www/modules/tntofficiel/views/templates/hook/displayCarrierList.tpl index a58dea12..73e677d0 100644 --- a/www/modules/tntofficiel/views/templates/hook/displayCarrierList.tpl +++ b/www/modules/tntofficiel/views/templates/hook/displayCarrierList.tpl @@ -1,639 +1,637 @@ -{* - * TNT OFFICIAL MODULE FOR PRESTASHOP - * - * @author GFI Informatique - * @copyright 2016 GFI Informatique, 2016 TNT - * @license https://opensource.org/licenses/MIT MIT License - *} - - -{foreach $carriers.products as $tnt_index => $product} - {foreach $current_delivery_option as $idAddressSelected => $idCarrierOptionSelected} - - {assign var='img_path' value='tntofficiel/views/img/carrier.jpg'} - {assign var='descript' value=""} - {assign var='label' value=$product.label} - - {if $product.id|strstr:"ENTERPRISE" } - {assign var='img_path' value='tntofficiel/views/img/carrier/delivery/option-Entreprise.png'} - - {* 9:00 Express (ENTERPRISE) *} - {if $product.id == "A_ENTERPRISE"} - {assign var='label' value="09:00 Express en Entreprise"} - {assign var='descript' value="Pour une livraison aux entreprises en France métropolitaine.
- Livraison en mains propres et contre signature dès le lendemain de l'expédition de votre commande, avant 9 heures."} - - {* Express (ENTERPRISE) *} - {elseif $product.id == "J_ENTERPRISE"} - {assign var='label' value="En entreprise"} - {assign var='descript' value="Pour une livraison aux entreprises ou sur votre lieu de travail en France métropolitaine.
- Livraison en mains propres et contre signature dès le lendemain de l'expédition de votre commande (1).
- (1) avant 13 heures ou en début d'après-midi en zone rurale."} - {* 12:00 Express (ENTERPRISE) *} - {elseif $product.id == "M_ENTERPRISE"} - {assign var='label' value="12:00 Express en Entreprise"} - {assign var='descript' value="Pour une livraison aux entreprises en France métropolitaine.
- Livraison en mains propres et contre signature dès le lendemain de l'expédition de votre commande, avant midi."} - - {* 10:00 Express (ENTERPRISE) *} - {elseif $product.id == "T_ENTERPRISE"} - {assign var='label' value="10:00 Express en Entreprise"} - {assign var='descript' value="Pour une livraison aux entreprises en France métropolitaine.
- Livraison en mains propres et contre signature dès le lendemain de l'expédition de votre commande, avant 10 heures."} - {/if} - - {elseif $product.id|strstr:"INDIVIDUAL" } - {assign var='img_path' value='tntofficiel/views/img/carrier/delivery/option-ChezVous.png'} - - {* 9:00 Express (INDIVIDUAL) *} - {if $product.id == "AZ_INDIVIDUAL"} - {assign var='label' value="09:00 Express à domicile"} - {assign var='descript' value="Pour une livraison à domicile en France métropolitaine.
- Livraison en mains propres et contre signature dès le lendemain de l'expédition de votre commande, avant 9 heures."} - - {* Express à domicile (INDIVIDUAL) *} - {elseif $product.id == "JZ_INDIVIDUAL"} - {assign var='label' value="À domicile"} - {assign var='descript' value="Pour une livraison à domicile en France métropolitaine.
- Livraison en mains propres et contre signature dès le lendemain de l'expédition de votre commande (1).
- (1) avant 13 heures ou en début d'après-midi en zone rurale."} - {* 12:00 Express à domicile (INDIVIDUAL) *} - {elseif $product.id == "MZ_INDIVIDUAL"} - {assign var='label' value="12:00 Express à domicile"} - {assign var='descript' value="Pour une livraison aux entreprises en France métropolitaine.
- Livraison en mains propres et contre signature dès le lendemain de l'expédition de votre commande, avant midi."} - - {* 10:00 Express à domicile (INDIVIDUAL) *} - {elseif $product.id == "TZ_INDIVIDUAL"} - {assign var='label' value="10:00 Express à domicile"} - {assign var='descript' value="Pour une livraison aux entreprises en France métropolitaine.
- Livraison en mains propres et contre signature dès le lendemain de l'expédition de votre commande, avant 10 heures."} - {/if} - - {elseif $product.id|strstr:"DROPOFFPOINT" } - {assign var='img_path' value='tntofficiel/views/img/carrier/delivery/option-RelaisColis.png'} - {assign var='label' value="En Relais Colis®"} - {assign var='descript' value="Mise à disposition dans l’un des 4200 Relais Colis® de France métropolitaine.
- Remise contre signature et présentation d’une pièce d’identité dès le lendemain de l'expédition de votre commande (1).
- (1) avant 13 heures ou en début d'après-midi en zone rurale."} - {elseif $product.id|strstr:"DEPOT" } - {assign var='img_path' value='tntofficiel/views/img/carrier/delivery/option-Entreprise.png'} - {assign var='label' value="Dépôt restant"} - {assign var='descript' value="Pour une livraisons dans une de nos agences TNT en France métropolitaine.
- Mise à votre disposition sur présentation d'une pièce d'identité et contre signature dès 8 heures le lendemain de l'expédition de votre commande et ce pendant 10 Jours."} - {/if} - -
-
- - - - - - - -
- - - {$label|escape:'htmlall':'UTF-8'} -
{$descript|escape:'htmlall':'UTF-8'|replace:'<':'<'|replace:">":">"} - {if !empty($product.due_date)} -
- Date prévisionnelle de livraison : {$product.due_date|escape:'htmlall':'UTF-8'} - {/if} - {if $deliveryOption === $product.id and $idCarrierOptionSelected === "{$idTntCarrier},"} - {assign var='item_info' value=''} - {if {$product.type|lower} == 'dropoffpoint' and isset($deliveryPoint.xett)} - {assign var='current_method_id' value='relay_point'} - {assign var='current_method_name' value='relay-point'} - {assign var='item_info' value=$deliveryPoint} - {elseif {$product.type|lower} == 'depot' and isset($deliveryPoint.pex)} - {assign var='current_method_id' value='repository'} - {assign var='current_method_name' value='repository'} - {assign var='item_info' value=$deliveryPoint} - {/if} - - {if isset($item_info) and $item_info != ''} - {include './displayCarrierList/deliveryPointSet.tpl' item=$item_info method_id=$current_method_id method_name=$current_method_name} - {/if} - {/if} -
-
- {if $product.total_price_with_tax && !$product.is_free && (!isset($free_shipping) || (isset($free_shipping) && !$free_shipping))} - {if $use_taxes == 1} - {if $priceDisplay == 1} - {convertPrice price=$product.total_price_without_tax}{if $display_tax_label} HT{/if} - {else} - {convertPrice price=$product.total_price_with_tax}{if $display_tax_label} TTC{/if} - {/if} - {else} - {convertPrice price=$product.total_price_without_tax} - {/if} - {else} - gratuit - {/if} -
-
-
-
- {/foreach} -{/foreach} - -{if $cityPostcodeIsValid == false} - -
-
-

{l s='Can not purchase the order' mod='tntofficiel'}

- {*COMMANDE IMPOSSIBLE*} - -
-

{l s='Entering city in the address is unknown for the postal code %s' sprintf=$postcode mod='tntofficiel'}

-
-
-
-{/if} - - - - - -
- -
-

{l s='TNT Additional Address' mod='tntofficiel'}

- -
-

-
- -
- - -
-
- - {*Téléphone portable*} - -
-
- - {*Numéro du bâtiment*} - -
-
- - {*Code interphone*} - -
-
- - {*Etage*} - -
-

- -

-

{l s='Required fields' mod='tntofficiel'}

-
-
- - +{* + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + *} + +{foreach $carriers.products as $tnt_index => $product} + {foreach $current_delivery_option as $idAddressSelected => $idCarrierOptionSelected} + + {assign var='img_path' value='tntofficiel/views/img/carrier.jpg'} + {assign var='descript' value=""} + {assign var='label' value=$product.label} + + {if $product.id|strstr:"ENTERPRISE" } + {assign var='img_path' value='tntofficiel/views/img/carrier/delivery/option-Entreprise.png'} + + {* 9:00 Express (ENTERPRISE) *} + {if $product.id == "A_ENTERPRISE"} + {assign var='label' value="09:00 Express en Entreprise"} + {assign var='descript' value="Pour une livraison aux entreprises en France métropolitaine.
+ Livraison en mains propres et contre signature dès le lendemain de l'expédition de votre commande, avant 9 heures."} + + {* Express (ENTERPRISE) *} + {elseif $product.id == "J_ENTERPRISE"} + {assign var='label' value="En entreprise"} + {assign var='descript' value="Pour une livraison aux entreprises ou sur votre lieu de travail en France métropolitaine.
+ Livraison en mains propres et contre signature dès le lendemain de l'expédition de votre commande (1).
+ (1) avant 13 heures ou en début d'après-midi en zone rurale."} + {* 12:00 Express (ENTERPRISE) *} + {elseif $product.id == "M_ENTERPRISE"} + {assign var='label' value="12:00 Express en Entreprise"} + {assign var='descript' value="Pour une livraison aux entreprises en France métropolitaine.
+ Livraison en mains propres et contre signature dès le lendemain de l'expédition de votre commande, avant midi."} + + {* 10:00 Express (ENTERPRISE) *} + {elseif $product.id == "T_ENTERPRISE"} + {assign var='label' value="10:00 Express en Entreprise"} + {assign var='descript' value="Pour une livraison aux entreprises en France métropolitaine.
+ Livraison en mains propres et contre signature dès le lendemain de l'expédition de votre commande, avant 10 heures."} + {/if} + + {elseif $product.id|strstr:"INDIVIDUAL" } + {assign var='img_path' value='tntofficiel/views/img/carrier/delivery/option-ChezVous.png'} + + {* 9:00 Express (INDIVIDUAL) *} + {if $product.id == "AZ_INDIVIDUAL"} + {assign var='label' value="09:00 Express à domicile"} + {assign var='descript' value="Pour une livraison à domicile en France métropolitaine.
+ Livraison en mains propres et contre signature dès le lendemain de l'expédition de votre commande, avant 9 heures."} + + {* Express à domicile (INDIVIDUAL) *} + {elseif $product.id == "JZ_INDIVIDUAL"} + {assign var='label' value="À domicile"} + {assign var='descript' value="Pour une livraison à domicile en France métropolitaine.
+ Livraison en mains propres et contre signature dès le lendemain de l'expédition de votre commande (1).
+ (1) avant 13 heures ou en début d'après-midi en zone rurale."} + {* 12:00 Express à domicile (INDIVIDUAL) *} + {elseif $product.id == "MZ_INDIVIDUAL"} + {assign var='label' value="12:00 Express à domicile"} + {assign var='descript' value="Pour une livraison aux entreprises en France métropolitaine.
+ Livraison en mains propres et contre signature dès le lendemain de l'expédition de votre commande, avant midi."} + + {* 10:00 Express à domicile (INDIVIDUAL) *} + {elseif $product.id == "TZ_INDIVIDUAL"} + {assign var='label' value="10:00 Express à domicile"} + {assign var='descript' value="Pour une livraison aux entreprises en France métropolitaine.
+ Livraison en mains propres et contre signature dès le lendemain de l'expédition de votre commande, avant 10 heures."} + {/if} + + {elseif $product.id|strstr:"DROPOFFPOINT" } + {assign var='img_path' value='tntofficiel/views/img/carrier/delivery/option-RelaisColis.png'} + {assign var='label' value="En Relais Colis®"} + {assign var='descript' value="Mise à disposition dans l’un des 4200 Relais Colis® de France métropolitaine.
+ Remise contre signature et présentation d’une pièce d’identité dès le lendemain de l'expédition de votre commande (1).
+ (1) avant 13 heures ou en début d'après-midi en zone rurale."} + {elseif $product.id|strstr:"DEPOT" } + {assign var='img_path' value='tntofficiel/views/img/carrier/delivery/option-Entreprise.png'} + {assign var='label' value="Dépôt restant"} + {assign var='descript' value="Pour une livraisons dans une de nos agences TNT en France métropolitaine.
+ Mise à votre disposition sur présentation d'une pièce d'identité et contre signature dès 8 heures le lendemain de l'expédition de votre commande et ce pendant 10 Jours."} + {/if} +
+
+ + + + + + + +
+ + + {$label|escape:'htmlall':'UTF-8'} +
{$descript|escape:'htmlall':'UTF-8'|replace:'<':'<'|replace:">":">"} + {if !empty($product.due_date)} +
+ Date prévisionnelle de livraison : {$product.due_date|escape:'htmlall':'UTF-8'} + {/if} + {if $deliveryOption === $product.id and $idCarrierOptionSelected === "{$idTntCarrier},"} + {assign var='item_info' value=''} + {if {$product.type|lower} == 'dropoffpoint' and isset($deliveryPoint.xett)} + {assign var='current_method_id' value='relay_point'} + {assign var='current_method_name' value='relay-point'} + {assign var='item_info' value=$deliveryPoint} + {elseif {$product.type|lower} == 'depot' and isset($deliveryPoint.pex)} + {assign var='current_method_id' value='repository'} + {assign var='current_method_name' value='repository'} + {assign var='item_info' value=$deliveryPoint} + {/if} + + {if isset($item_info) and $item_info != ''} + {include './displayCarrierList/deliveryPointSet.tpl' item=$item_info method_id=$current_method_id method_name=$current_method_name} + {/if} + {/if} +
+
+ {if $product.total_price_with_tax && !$product.is_free && (!isset($free_shipping) || (isset($free_shipping) && !$free_shipping))} + {if $use_taxes == 1} + {if $priceDisplay == 1} + {convertPrice price=$product.total_price_without_tax}{if $display_tax_label} HT{/if} + {else} + {convertPrice price=$product.total_price_with_tax}{if $display_tax_label} TTC{/if} + {/if} + {else} + {convertPrice price=$product.total_price_without_tax} + {/if} + {else} + gratuit + {/if} +
+
+
+
+ {/foreach} +{/foreach} + +{if $cityPostcodeIsValid == false} + +
+
+

{l s='Can not purchase the order' mod='tntofficiel'}

+ {*COMMANDE IMPOSSIBLE*} + +
+

{l s='Entering city in the address is unknown for the postal code %s' sprintf=$postcode mod='tntofficiel'}

+
+
+
+{/if} + + + + + +
+ +
+

{l s='TNT Additional Address' mod='tntofficiel'}

+ +
+

+
+ +
+ + +
+
+ + {*Téléphone portable*} + +
+
+ + {*Numéro du bâtiment*} + +
+
+ + {*Code interphone*} + +
+
+ + {*Etage*} + +
+

+ +

+

{l s='Required fields' mod='tntofficiel'}

+
+
+ +