diff --git a/www/modules/tntofficiel/Manuel d'install du module TNT sous Prestashop.pdf b/www/modules/tntofficiel/Manuel d'install du module TNT sous Prestashop.pdf new file mode 100644 index 00000000..f86d8b0b Binary files /dev/null and b/www/modules/tntofficiel/Manuel d'install du module TNT sous Prestashop.pdf differ diff --git a/www/modules/tntofficiel/classes/TNTOfficielCart.php b/www/modules/tntofficiel/classes/TNTOfficielCart.php new file mode 100644 index 00000000..2aaf40ee --- /dev/null +++ b/www/modules/tntofficiel/classes/TNTOfficielCart.php @@ -0,0 +1,167 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; + +/** + * Class TNTOfficielCart + */ +class TNTOfficielCart extends ObjectModel +{ + // id_tntofficiel_cart + public $id; + + public $id_cart; + public $carrier_code; + public $carrier_label; + public $delivery_point; + public $delivery_price; + public $customer_email; + public $customer_mobile; + public $address_building; + public $address_accesscode; + public $address_floor; + + public static $definition = array( + 'table' => 'tntofficiel_cart', + 'primary' => 'id_tntofficiel_cart', + 'fields' => array( + 'id_cart' => array( + 'type' => ObjectModel::TYPE_INT, + 'validate' => 'isUnsignedId', + 'required' => true + ), + 'carrier_code' => array( + 'type' => ObjectModel::TYPE_STRING, + 'size' => 64 + ), + 'carrier_label' => array( + 'type' => ObjectModel::TYPE_STRING, + 'size' => 255 + ), + 'delivery_point' => array( + 'type' => ObjectModel::TYPE_STRING + /*, 'validate' => 'isSerializedArray', 'size' => 65000*/ + ), + 'delivery_price' => array( + 'type' => ObjectModel::TYPE_FLOAT, + 'validate' => 'isPrice' + ), + 'customer_email' => array( + 'type' => ObjectModel::TYPE_STRING, + 'validate' => 'isEmail', + 'size' => 128 + ), + 'customer_mobile' => array( + 'type' => ObjectModel::TYPE_STRING, + 'validate' => 'isPhoneNumber', + 'size' => 32 + ), + 'address_building' => array( + 'type' => ObjectModel::TYPE_STRING, + 'size' => 16 + ), + 'address_accesscode' => array( + 'type' => ObjectModel::TYPE_STRING, + 'size' => 16 + ), + 'address_floor' => array( + 'type' => ObjectModel::TYPE_STRING, + 'size' => 16 + ), + ), + ); + + /** + * Constructor. + */ + public function __construct($intArgId = null) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + parent::__construct($intArgId); + } + + public static function loadCartID($intArgCartId) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $intCartId = (int)$intArgCartId; + + // No new cart ID. + if (!($intCartId > 0)) { + return false; + } + + // Search row for cart ID. + $objDbQuery = new DbQuery(); + $objDbQuery->select('*'); + $objDbQuery->from(TNTOfficielCart::$definition['table']); + $objDbQuery->where('id_cart = '.$intCartId); + + $objDB = Db::getInstance(); + $arrResult = $objDB->executeS($objDbQuery); + // If row found and match cart ID. + if (count($arrResult)===1 && $intCartId===(int)$arrResult[0]['id_cart']) { + // Load existing TNT cart entry. + $objTNTCartModel = new TNTOfficielCart((int)$arrResult[0]['id_tntofficiel_cart']); + } else { + // Create a new TNT cart entry. + $objTNTCartModel = new TNTOfficielCart(); + $objTNTCartModel->id_cart = $intCartId; + $objTNTCartModel->save(); + } + + // Check. + if ((int)$objTNTCartModel->id_cart !== $intCartId) { + return false; + } + + return $objTNTCartModel; + } + + /** + * @return array + */ + public function getDeliveryPoint() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $arrDeliveryPoint = Tools::unSerialize($this->delivery_point); + if (!is_array($arrDeliveryPoint)) { + $arrDeliveryPoint = array(); + } + + return $arrDeliveryPoint; + } + + /** + * @param $arrArgDeliveryPoint + * @return mixed + */ + public function setDeliveryPoint($arrArgDeliveryPoint) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + if (!is_array($arrArgDeliveryPoint)) { + return false; + } + + if (isset($arrArgDeliveryPoint['xett'])) { + unset($arrArgDeliveryPoint['pex']); + } elseif (isset($arrArgDeliveryPoint['pex'])) { + unset($arrArgDeliveryPoint['xett']); + } else { + $arrArgDeliveryPoint = array(); + } + + $this->delivery_point = serialize($arrArgDeliveryPoint); + return $this->save(); + } +} diff --git a/www/modules/tntofficiel/classes/index.php b/www/modules/tntofficiel/classes/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/classes/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/controllers/admin/AdminTNTOfficielController.php b/www/modules/tntofficiel/controllers/admin/AdminTNTOfficielController.php new file mode 100644 index 00000000..51c80c7e --- /dev/null +++ b/www/modules/tntofficiel/controllers/admin/AdminTNTOfficielController.php @@ -0,0 +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; + } +} diff --git a/www/modules/tntofficiel/controllers/admin/index.php b/www/modules/tntofficiel/controllers/admin/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/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/controllers/front/address.php b/www/modules/tntofficiel/controllers/front/address.php new file mode 100644 index 00000000..5122393e --- /dev/null +++ b/www/modules/tntofficiel/controllers/front/address.php @@ -0,0 +1,187 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/classes/TNTOfficielCart.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_AddressHelper.php'; + +class TNTOfficielAddressModuleFrontController extends ModuleFrontController +{ + /** + * These constants are use in cpCityHelper.js + * Any change must be impacted in this file as well. + */ + const CHECK_POSTCODE_KO = 0; // postcode/city is not valid + const CHECK_POSTCODE_OK = 1; // postcode/city is valid + const CHECK_POSTCODE_NOT_REQUIRED = 2; // postcode/city does not require validation + + /** + * TNTOfficielAddressModuleFrontController 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; + } + + /** + * Saves the extra address data. + * + * @return string + */ + public function displayAjaxStoreDeliveryInfo() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // Saves the extra address data. + $arrFormErrors = TNTOfficiel_Address::validate($_POST); + if (count($arrFormErrors)) { + echo Tools::jsonEncode(array( + 'result' => false, + 'form_errors' => $arrFormErrors, + )); + + return false; + } + + $objContext = $this->context; + $objCart = $objContext->cart; + $intCartID = (int)$objCart->id; + + // 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( + 'customer_email' => pSQL(Tools::getValue('email')), + 'customer_mobile' => pSQL(Tools::getValue('mobile_phone')), + 'address_building' => pSQL(Tools::getValue('building_number')), + 'address_accesscode' => pSQL(Tools::getValue('intercom_code')), + 'address_floor' => pSQL(Tools::getValue('floor')), + )); + $boolResult = $objTNTCartModel->save(); + } + + if (!$boolResult) { + echo Tools::jsonEncode(array( + 'result' => false, + 'form_errors' => 'Une erreur s\'est produite', + )); + + return false; + } + + echo Tools::jsonEncode(array( + 'result' => true, + )); + + return true; + } + + /** + * Check if the city match the. + * + * @return string + */ + public function displayAjaxCheckPostcodeCity() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $arrResult = array(); + // check the country + $intCountryID = (int)Tools::getValue('countryId'); + $strPostCode = pSQL(Tools::getValue('postcode')); + $strCity = pSQL(Tools::getValue('city')); + + if (Country::getIsoById($intCountryID) != 'FR' || Tools::strlen($strPostCode) != 5) { + $arrResult['result'] = false; + $arrResult['resultCode'] = TNTOfficielAddressModuleFrontController::CHECK_POSTCODE_NOT_REQUIRED; + } else { + $objTNTAddressHelper = TNTOfficiel_AddressHelper::getInstance(); + //check the city/postcode + $mdwResult = $objTNTAddressHelper->checkPostcodeCityFromMiddleware( + $strPostCode, + $strCity, + $this->context->shop->id + ); + if (!$mdwResult['response']) { + //get cities from the middleware from the given postal code + $mdwResult = $objTNTAddressHelper->getCitiesFromMiddleware( + $strPostCode, + $this->context->shop->id + ); + $arrResult['result'] = false; + $arrResult['cities'] = $mdwResult['cities']; + $arrResult['resultCode'] = TNTOfficielAddressModuleFrontController::CHECK_POSTCODE_KO; + } else { + $arrResult['result'] = true; + $arrResult['resultCode'] = TNTOfficielAddressModuleFrontController::CHECK_POSTCODE_OK; + } + } + + echo Tools::jsonEncode($arrResult); + + return true; + } + + /** + * Get cities for a postcode. + * + * @return string + */ + public function displayAjaxGetCities() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $cart = $this->context->cart; + $deliveryAddress = new Address($cart->id_address_delivery); + $mdwResult = TNTOfficiel_AddressHelper::getInstance()->getCitiesFromMiddleware( + $deliveryAddress->postcode, + $this->context->shop->id + ); + + echo Tools::jsonEncode(array( + 'result' => true, + 'cities' => $mdwResult['cities'], + 'postcode' => $deliveryAddress->postcode + )); + + return true; + } + + /** + * Update the city for the current delivery address. + * + * @return array + */ + public function displayAjaxUpdateDeliveryAddress() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $strCity = pSQL(Tools::getValue('city')); + + if ($strCity) { + $objCart = $this->context->cart; + $objAddressDelivery = new Address($objCart->id_address_delivery); + $objAddressDelivery->city = $strCity; + $objAddressDelivery->save(); + } + + echo Tools::jsonEncode(array( + 'result' => true + )); + + return true; + } +} diff --git a/www/modules/tntofficiel/controllers/front/carrier.php b/www/modules/tntofficiel/controllers/front/carrier.php new file mode 100644 index 00000000..bf231bd1 --- /dev/null +++ b/www/modules/tntofficiel/controllers/front/carrier.php @@ -0,0 +1,160 @@ + + * @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; + } +} diff --git a/www/modules/tntofficiel/controllers/front/index.php b/www/modules/tntofficiel/controllers/front/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/controllers/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/controllers/front/shippingMethod.php b/www/modules/tntofficiel/controllers/front/shippingMethod.php new file mode 100644 index 00000000..97b69950 --- /dev/null +++ b/www/modules/tntofficiel/controllers/front/shippingMethod.php @@ -0,0 +1,240 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/classes/TNTOfficielCart.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_RelayPointsHelper.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_ShippingHelper.php'; + +class TNTOfficielShippingMethodModuleFrontController extends ModuleFrontController +{ + /** + * TNTOfficielShippingMethodModuleFrontController 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; + } + + /** + * Get the relay points popup via Ajax. + * JD_DROPOFFPOINT (En Relais Colis®) : XETT + */ + public function displayAjaxBoxRelayPoints() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $objContext = $this->context; + $objCart = $objContext->cart; + $intCartID = (int)$objCart->id; + $objShop = $objContext->shop; + + // Load TNT cart info or create a new one for it's ID. + $objTNTCartModel = TNTOfficielCart::loadCartID($intCartID); + if (Validate::isLoadedObject($objTNTCartModel)) { + // If product code is not "En Relais Colis®". + if ($objTNTCartModel->carrier_code !== 'JD_DROPOFFPOINT') { + // Clear carrier code and delivery point. + $objTNTCartModel->carrier_code = ''; + $objTNTCartModel->setDeliveryPoint(array()); + // Unselect carrier from cart. + $objCart->setDeliveryOption(null); + $objCart->save(); + } + $objTNTCartModel->save(); + } + + $strPostcode = trim(pSQL(Tools::getValue('tnt_postcode'))); + $strCity = trim(pSQL(Tools::getValue('tnt_city'))); + + if (!$strPostcode && !$strCity) { + $objAddress = new Address((int)$objCart->id_address_delivery); + $strPostcode = $objAddress->postcode; + $strCity = $objAddress->city; + } + + // Call API to get list of repositories + $objTNTRelayPointsHelper = TNTOfficiel_RelayPointsHelper::getInstance(); + $arrRelayPoints = $objTNTRelayPointsHelper->getRelayPoints($strPostcode, $strCity, $objShop->id); + $arrCities = TNTOfficiel_AddressHelper::getInstance()->getCitiesFromMiddleware($strPostcode, $objShop->id); + + foreach ($arrRelayPoints as $key => $item) { + $arrRelayPoints[ $key ]['schedule'] = TNTOfficiel_ShippingHelper::getInstance()->getSchedules($item); + } + + /* + if (empty($relay) && !empty($cities['cities'])) { + $city = $cities['cities'][0]; + $relay = $obRelayPointsHelper->getRelayPoints($postcode, $city, $objShop->id); + } + */ + + // Get the relay points + $this->context->smarty->assign( + array( + 'method_id' => 'relay_points', + 'method_name' => 'relay-points', + 'current_postcode' => $strPostcode, + 'current_city' => $strCity, + 'results' => $arrRelayPoints, + 'cities' => $arrCities['cities'], + ) + ); + + $this->context->smarty->display( + _PS_MODULE_DIR_.$this->module->name.'/views/templates/hook/displayCarrierList/deliveryPointsBox.tpl' + ); + + return true; + } + + /** + * Get the repositories popup via Ajax. + * J_DEPOT (Dépôt restant) : PEX + */ + public function displayAjaxBoxDropOffPoints() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $objContext = $this->context; + $objCart = $objContext->cart; + $intCartID = (int)$objCart->id; + $objShop = $objContext->shop; + + // Load TNT cart info or create a new one for it's ID. + $objTNTCartModel = TNTOfficielCart::loadCartID($intCartID); + if (Validate::isLoadedObject($objTNTCartModel)) { + // If product code is not "Dépôt restant". + if ($objTNTCartModel->carrier_code !== 'J_DEPOT') { + // Clear carrier code and delivery point. + $objTNTCartModel->carrier_code = ''; + $objTNTCartModel->setDeliveryPoint(array()); + // Unselect carrier from cart. + $objCart->setDeliveryOption(null); + $objCart->save(); + } + $objTNTCartModel->save(); + } + + $strPostCode = trim(pSQL(Tools::getValue('tnt_postcode'))); + $strCity = trim(pSQL(Tools::getValue('tnt_city'))); + + if (!$strPostCode && !$strCity) { + $objAddress = new Address((int)$objCart->id_address_delivery); + $strPostCode = $objAddress->postcode; + $strCity = $objAddress->city; + } + + // Call API to get list of repositories + $objTNTRelayPointsHelper = TNTOfficiel_RelayPointsHelper::getInstance(); + $arrRepositories = $objTNTRelayPointsHelper->getRepositories($strPostCode, $objShop->id); + $arrCities = TNTOfficiel_AddressHelper::getInstance()->getCitiesFromMiddleware($strPostCode, $objShop->id); + + foreach ($arrRepositories as $key => $repository) { + $arrRepositories[ $key ]['schedule'] = TNTOfficiel_ShippingHelper::getInstance()->getSchedules($repository); + } + + $this->context->smarty->assign( + array( + 'method_id' => 'repositories', + 'method_name' => 'repositories', + 'current_postcode' => $strPostCode, + 'current_city' => $strCity, + 'results' => $arrRepositories, + 'cities' => $arrCities['cities'], + ) + ); + + $this->context->smarty->display( + _PS_MODULE_DIR_.$this->module->name.'/views/templates/hook/displayCarrierList/deliveryPointsBox.tpl' + ); + + return true; + } + + /** + * Save delivery point XETT or PEX info. + */ + public function displayAjaxSaveProductInfo() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $arrDeliveryPoint = (array)Tools::getValue('product'); + + // Check code exist. + if (!array_key_exists('xett', $arrDeliveryPoint) && !array_key_exists('pex', $arrDeliveryPoint)) { + return false; + } + + $objContext = $this->context; + $objCart = $objContext->cart; + $intCartID = (int)$objCart->id; + + // Load TNT cart info or create a new one for it's ID. + $objTNTCartModel = TNTOfficielCart::loadCartID($intCartID); + if (Validate::isLoadedObject($objTNTCartModel)) { + $objTNTCartModel->setDeliveryPoint($arrDeliveryPoint); + } + + $this->context->smarty->assign( + array( + 'item' => $arrDeliveryPoint, + 'method_id' => isset($arrDeliveryPoint['xett']) ? 'relay_point' : 'repository', + 'method_name' => isset($arrDeliveryPoint['xett']) ? 'relay-point' : 'repository', + ) + ); + + $this->context->smarty->display( + _PS_MODULE_DIR_.$this->module->name.'/views/templates/hook/displayCarrierList/deliveryPointSet.tpl' + ); + + return true; + } + + /** + * Save current TNT shipping address. + */ + public function displayAjaxSaveProductCode() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $strProductCode = pSQL(Tools::getValue('productCode')); + + if ($strProductCode) { + $objContext = $this->context; + $objCart = $objContext->cart; + $intCartID = (int)$objCart->id; + + // Load TNT cart info or create a new one for it's ID. + $objTNTCartModel = TNTOfficielCart::loadCartID($intCartID); + if (Validate::isLoadedObject($objTNTCartModel)) { + // Save TNT product code. + $objTNTCartModel->carrier_code = $strProductCode; + // If product code is not "Dépôt restant" or En "Relais Colis®". + if ($strProductCode !== 'JD_DROPOFFPOINT' && $strProductCode !== 'J_DEPOT') { + // Clear delivery point. + $objTNTCartModel->setDeliveryPoint(array()); + } + $objTNTCartModel->save(); + } + } + + echo Tools::jsonEncode(array( + 'success' => true + )); + + return true; + } +} diff --git a/www/modules/tntofficiel/controllers/front/tracking.php b/www/modules/tntofficiel/controllers/front/tracking.php new file mode 100644 index 00000000..61db4747 --- /dev/null +++ b/www/modules/tntofficiel/controllers/front/tracking.php @@ -0,0 +1,68 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; + +class TNTOfficielTrackingModuleFrontController extends ModuleFrontController +{ + /** + * TNTOfficielTrackingModuleFrontController 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; + } + + /** + * Display the tracking popup. + */ + public function displayAjaxTracking() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $intOrderID = (int)Tools::getValue('orderId'); + try { + $arrTNTOrder = TNTOfficiel_OrderHelper::getInstance()->getOrderData($intOrderID); + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + + Controller::getController('PageNotFoundController')->run(); + //$this->smartyOutputContent(_PS_THEME_DIR_.'404.tpl'); + + return false; + } + + //get parcels and for each parcel get its tracking data + $parcels = TNTOfficiel_ParcelsHelper::getInstance()->getParcels($intOrderID); + foreach ($parcels as &$parcel) { + $parcel['trackingData'] = TNTOfficiel_ParcelsHelper::getInstance()->getTrackingData($parcel); + } + + $this->context->smarty->assign( + array( + 'order' => $arrTNTOrder, + 'parcels' => $parcels, + ) + ); + + $this->context->smarty->display( + _PS_MODULE_DIR_.$this->module->name.'/views/templates/front/displayAjaxTracking.tpl' + ); + + return true; + } +} diff --git a/www/modules/tntofficiel/controllers/index.php b/www/modules/tntofficiel/controllers/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/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/index.php b/www/modules/tntofficiel/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/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/libraries/TNTOfficiel_Address.php b/www/modules/tntofficiel/libraries/TNTOfficiel_Address.php new file mode 100644 index 00000000..d41d8cdf --- /dev/null +++ b/www/modules/tntofficiel/libraries/TNTOfficiel_Address.php @@ -0,0 +1,193 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Logger.php'; + +class TNTOfficiel_Address +{ + /** + * @var TNTOfficiel_Logger + */ + private $logger; + + /** + * Constructor. + */ + public function __construct() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->logger = new TNTOfficiel_Logger(); + } + + + /** + * Returns the default values for the extra address data fields. + * + * @param int $intArgAddressID + * @param int $intArgCustomerID + * + * @return array + */ + public static function getDefaultValues($intArgAddressID, $intArgCustomerID) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // Retrieve the customer and address by its id. + $arrRowCustomer = Db::getInstance()->getRow( + 'SELECT * FROM '._DB_PREFIX_.'customer WHERE id_customer = '.(int)$intArgCustomerID + ); + $arrRowAddress = Db::getInstance()->getRow( + 'SELECT * FROM '._DB_PREFIX_.'address WHERE id_address = '.(int)$intArgAddressID + ); + + // Get values from the customer and address object according to the configuration. + return array( + 'email' => TNTOfficiel_Address::_getValue( + $arrRowAddress, + $arrRowCustomer, + 'TNT_CARRIER_ADDRESS_EMAIL' + ), + 'mobile_phone' => TNTOfficiel_Address::_getValue( + $arrRowAddress, + $arrRowCustomer, + 'TNT_CARRIER_ADDRESS_PHONE' + ), + 'building_number' => TNTOfficiel_Address::_getValue( + $arrRowAddress, + $arrRowCustomer, + 'TNT_CARRIER_ADDRESS_BUILDING' + ), + 'intercom_code' => TNTOfficiel_Address::_getValue( + $arrRowAddress, + $arrRowCustomer, + 'TNT_CARRIER_ADDRESS_INTERCOM' + ), + 'floor' => TNTOfficiel_Address::_getValue( + $arrRowAddress, + $arrRowCustomer, + 'TNT_CARRIER_ADDRESS_FLOOR' + ), + ); + } + + /** + * Gets the property from a customer or an address. + * + * @param array $arrAddress + * @param array $arrCustomer + * @param string $strArgConfigField + * + * @return mixed + */ + private static function _getValue($arrAddress, $arrCustomer, $strArgConfigField) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $arrConfigValue = explode('.', Configuration::get($strArgConfigField)); + $strValue = ''; + if (count($arrConfigValue) > 1) { + $objectName = $arrConfigValue[0]; + $objectProperty = $arrConfigValue[1]; + if (in_array($objectProperty, array('id_customer', 'id_address'))) { + $objectProperty = 'id'; + } + try { + $object = null; + if ($objectName == 'customer') { + $object = $arrCustomer; + } + elseif ($objectName == 'address') { + $object = $arrAddress; + } + $strValue = $object[$objectProperty]; + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + } + } + + return $strValue; + } + + /** + * Validate the extra address data form. + * + * @param $values + * + * @return bool + */ + public static function validate($values) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $arrFormErrors = array(); + + //check if email is set and not empty + if (!isset($values['email']) || trim($values['email']) === '') { + $arrFormErrors[] = 'Le champ \'email\' est obligatoire'; + } + + //check if the email is valid + if (!filter_var($values['email'], FILTER_VALIDATE_EMAIL)) { + $arrFormErrors[] = 'L\'email saisi n\'est pas valide'; + } + + //check if mobile phone is set and not empty + if (!isset($values['mobile_phone']) || trim($values['mobile_phone']) === '') { + $arrFormErrors[] = 'Le champ \'Téléphone portable\' est obligatoire'; + } + + //check if mobile phone is set 10 digits and start by 06 or 07 + if (!preg_match('/^((06|07){1}(\d){8})$/', $values['mobile_phone'])) { + $arrFormErrors[] = 'Le champ \'Téléphone portable\' doit être composé de 10 chiffres' + .' sans espace ni point, et commencer par un 06 ou 07'; + } + + $arrFieldList = array( + array( + 'name' => 'email', + 'label' => 'Email de contact', + 'maxlength' => 80, + ), + array( + 'name' => 'mobile_phone', + 'label' => 'Téléphone', + 'maxlength' => 15, + ), + array( + 'name' => 'building_number', + 'label' => 'N° de batiment', + 'maxlength' => 3, + ), + array( + 'name' => 'intercom_code', + 'label' => 'Code interphone', + 'maxlength' => 7, + ), + array( + 'name' => 'floor', + 'label' => 'Etage', + 'maxlength' => 2, + ), + ); + + foreach ($arrFieldList as $arrField) { + if ($values[$arrField['name']]) { + if ($arrField['maxlength'] < iconv_strlen($values[$arrField['name']])) { + $arrFormErrors[] = sprintf('Le champ "%s" doit avoir au maximum %s caractère(s)', $arrField['label'], $arrField['maxlength']); + } + } + } + + return $arrFormErrors; + } +} diff --git a/www/modules/tntofficiel/libraries/TNTOfficiel_Cache.php b/www/modules/tntofficiel/libraries/TNTOfficiel_Cache.php new file mode 100644 index 00000000..1b241879 --- /dev/null +++ b/www/modules/tntofficiel/libraries/TNTOfficiel_Cache.php @@ -0,0 +1,69 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +class TNTOfficiel_Cache +{ + /** + * @param $strArgKey + * @return bool + */ + public static function isStored($strArgKey) + { + $objCache = Cache::getInstance(); + + $boolExistL1 = Cache::isStored($strArgKey); + $boolExistL2 = false; + + if (_PS_CACHE_ENABLED_ && !$boolExistL1) { + $boolExistL2 = $objCache->exists($strArgKey); + } + + return $boolExistL1 || $boolExistL2; + } + + /** + * @param $strArgKey + * @param $mxdArgValue + * @param $intArgTTL + * @return bool + */ + public static function store($strArgKey, $mxdArgValue, $intArgTTL) + { + $objCache = Cache::getInstance(); + + $boolSetL1 = Cache::store($strArgKey, $mxdArgValue); + $boolSetL2 = true; + + if (_PS_CACHE_ENABLED_) { + $boolSetL2 = $objCache->set($strArgKey, $mxdArgValue, $intArgTTL); + } + + return $boolSetL1 && $boolSetL2; + } + + /** + * @param $strArgKey + * @return null + */ + public static function retrieve($strArgKey) + { + $objCache = Cache::getInstance(); + + $mxdGet = null; + + if (Cache::isStored($strArgKey)) { + $mxdGet = Cache::retrieve($strArgKey); + } + elseif (_PS_CACHE_ENABLED_ && $objCache->exists($strArgKey)) { + $mxdGet = $objCache->get($strArgKey); + } + + return $mxdGet; + } +} \ No newline at end of file diff --git a/www/modules/tntofficiel/libraries/TNTOfficiel_Carrier.php b/www/modules/tntofficiel/libraries/TNTOfficiel_Carrier.php new file mode 100644 index 00000000..f9a621c8 --- /dev/null +++ b/www/modules/tntofficiel/libraries/TNTOfficiel_Carrier.php @@ -0,0 +1,330 @@ + + * @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'; + +class TNTOfficiel_Carrier +{ + /** + * Configuration name. + * + * @var string + */ + private static $strConfigNameCarrierID = 'TNT_CARRIER_ID'; + + + /** + * Create a new TNT global carrier and save it as current one. + * + * @return bool + */ + public static function createGlobalCarrier() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // Create new carrier. + $objCarrierNew = new Carrier(); + $objCarrierNew->active = true; + $objCarrierNew->deleted = false; + // Carrier used for module. + $objCarrierNew->is_module = true; + $objCarrierNew->external_module_name = TNTOfficiel::MODULE_NAME; + // Carrier name. + $objCarrierNew->name = 'TNT Express France'; + // Carrier delay description per language ISO code. + // Mandatory, but not used. + $objCarrierNew->delay = array( + //'fr' => 'Livraison en 1 à 3 jours en France métropolitaine (Intra et Corse)', + Configuration::get('PS_LANG_DEFAULT') => 'TNT' + ); + // Disable applying tax rules group. + $objCarrierNew->id_tax_rules_group = 0; + // Disable adding handling charges from config PS_SHIPPING_HANDLING. + $objCarrierNew->shipping_handling = false; + // Enable use of Cart getPackageShippingCost, getOrderShippingCost or getOrderShippingCostExternal + $objCarrierNew->shipping_external = true; + // Enable calculations for the ranges. + $objCarrierNew->need_range = true; + $objCarrierNew->range_behavior = 0; + + // Unable to create new carrier. + if (!$objCarrierNew->add()) { + return false; + } + + $objDB = Db::getInstance(); + + $groups = Group::getGroups(true); + foreach ($groups as $group) { + $objDB->insert( + 'carrier_group', + array( + 'id_carrier' => (int)$objCarrierNew->id, + 'id_group' => (int)$group['id_group'], + ) + ); + } + + $objRangePrice = new RangePrice(); + $objRangePrice->id_carrier = $objCarrierNew->id; + $objRangePrice->delimiter1 = '0'; + $objRangePrice->delimiter2 = '1000000'; + $objRangePrice->add(); + + $objRangeWeight = new RangeWeight(); + $objRangeWeight->id_carrier = $objCarrierNew->id; + $objRangeWeight->delimiter1 = '0'; + $objRangeWeight->delimiter2 = '1000000'; + $objRangeWeight->add(); + + // Get active zones list. + $arrZoneList = Zone::getZones(true); + foreach ($arrZoneList as $arrZone) { + $objDB->insert( + 'carrier_zone', + array( + 'id_carrier' => (int)$objCarrierNew->id, + 'id_zone' => (int)$arrZone['id_zone'] + ) + ); + $objDB->insert( + 'delivery', + array( + 'id_carrier' => (int)$objCarrierNew->id, + 'id_range_price' => (int)$objRangePrice->id, + 'id_range_weight' => null, + 'id_zone' => (int)$arrZone['id_zone'], + 'price' => '0' + ), + true, + false + ); + $objDB->insert( + 'delivery', + array( + 'id_carrier' => (int)$objCarrierNew->id, + 'id_range_price' => null, + 'id_range_weight' => (int)$objRangeWeight->id, + 'id_zone' => (int)$arrZone['id_zone'], + 'price' => '0' + ), + true, + false + ); + } + + // Save the carrier ID. + $boolResult = TNTOfficiel_Carrier::setCarrierID($objCarrierNew->id); + + return $boolResult; + } + + /** + * Create a logo for a carrier. + * + * @param string $strArgModuleDir Module absolute Path. + * @param int $intArgCarrierIDTNT + * @return bool + */ + public static function createLogo($strArgModuleDir, $intArgCarrierIDTNT) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // Add carrier logo. + $boolResult = copy($strArgModuleDir.'/views/img/carriers/tntofficiel.jpg', _PS_SHIP_IMG_DIR_.(int)$intArgCarrierIDTNT.'.jpg'); + + return $boolResult; + } + + /** + * Undelete the existing current TNT global carrier by setting its flag to not deleted. + * + * @return bool + */ + public static function undeleteGlobalCarrier() + { + // Load current TNT carrier object. + $objCarrierTNT = TNTOfficiel_Carrier::loadGlobalCarrier(); + // If TNT carrier object not available. + if ($objCarrierTNT === null) { + // Unable to undelete. + return false; + } + + $objCarrierTNT->active = true; + $objCarrierTNT->deleted = false; + // Always set the right module name. + $objCarrierTNT->external_module_name = TNTOfficiel::MODULE_NAME; + $boolResult = $objCarrierTNT->save(); + + return $boolResult; + } + + /** + * Delete the existing current TNT global carrier by setting its flag to deleted. + * + * @return bool + */ + public static function deleteGlobalCarrier() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // Load current TNT carrier object. + $objCarrierTNT = TNTOfficiel_Carrier::loadGlobalCarrier(); + // If TNT carrier object not available. + if ($objCarrierTNT === null) { + // Nothing to delete. + return true; + } + + $objCarrierTNT->active = false; + $objCarrierTNT->deleted = true; + $boolResult = $objCarrierTNT->save(); + + return $boolResult; + } + + /** + * Get the current TNT carrier ID. + * + * @return int|null + */ + public static function getGlobalCarrierID() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // Get current TNT carrier. + $intCarrierIDTNT = Configuration::get(TNTOfficiel_Carrier::$strConfigNameCarrierID); + // Carrier ID must be an integer greater than 0. + if (empty($intCarrierIDTNT) || $intCarrierIDTNT != (int)$intCarrierIDTNT || !((int)$intCarrierIDTNT > 0) ) { + return null; + } + + return (int)$intCarrierIDTNT; + } + + /** + * Set the current TNT carrier ID. + * + * @param int $intArgCarrierID + * @return bool + */ + public static function setCarrierID($intArgCarrierID) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // Carrier ID must be an integer greater than 0. + if (empty($intArgCarrierID) || $intArgCarrierID != (int)$intArgCarrierID || !((int)$intArgCarrierID > 0) ) { + return false; + } + + return Configuration::updateValue(TNTOfficiel_Carrier::$strConfigNameCarrierID, $intArgCarrierID); + } + + + /** + * Load current TNT global carrier object model. + * + * @return Carrier|null + */ + public static function loadGlobalCarrier() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // Get current TNT carrier ID. + $intCarrierIDTNT = TNTOfficiel_Carrier::getGlobalCarrierID(); + // If TNT carrier ID not availaible. + if ($intCarrierIDTNT === null) { + return null; + } + + // Load TNT carrier. + $objCarrierTNT = new Carrier($intCarrierIDTNT); + + // If TNT carrier object not available. + if (!(Validate::isLoadedObject($objCarrierTNT) && (int)$objCarrierTNT->id === $intCarrierIDTNT)) { + return null; + } + + return $objCarrierTNT; + } + + /** + * Force some current carrier settings. Should be removed in the near future. + * + * @return bool + */ + public static function forceGlobalCarrierDefaultValues() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // Load current TNT carrier object. + $objCarrierTNT = TNTOfficiel_Carrier::loadGlobalCarrier(); + // If TNT carrier correctly loaded. + if ($objCarrierTNT !== null) + { + // Get all users groups associated with the TNT carrier. + $arrCarrierGroups = $objCarrierTNT->getGroups(); + // If there is currently at least one users groups set. + if (is_array($arrCarrierGroups) && count($arrCarrierGroups) > 0) + { + // Current users groups set. + $arrCarrierGroupsSet = array(); + foreach ($arrCarrierGroups as $arrRowCarrierGroup) { + // DB request fail. stop here. + if (!array_key_exists( 'id_group', $arrRowCarrierGroup )) { + return false; + } + $arrCarrierGroupsSet[] = (int)$arrRowCarrierGroup['id_group']; + } + // Users groups to exclude. + $arrCarrierGroupsExclude = array( + (int)Configuration::get('PS_UNIDENTIFIED_GROUP'), + (int)Configuration::get('PS_GUEST_GROUP') + // PS_CUSTOMER_GROUP (default) preserved + // CUSTOM GROUP preserved + ); + + // Get groups previously set, minus groups to exclude. + $arrCarrierGroupsApply = array_diff($arrCarrierGroupsSet, $arrCarrierGroupsExclude); + + // If groups change. + if(count(array_diff($arrCarrierGroupsSet, $arrCarrierGroupsApply)) > 0) { + // Force carrier users groups (delete all, then set). + $objCarrierTNT->setGroups($arrCarrierGroupsApply, true); + } + } + } + + return true; + } + + /** + * Check if a carrier ID is a TNT one. + * + * @param int $intArgCarrierID + * @return boolean + */ + public static function isTNTOfficielCarrierID($intArgCarrierID) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // Carrier ID must be an integer greater than 0. + if (empty($intArgCarrierID) || $intArgCarrierID != (int)$intArgCarrierID || !((int)$intArgCarrierID > 0) ) { + return false; + } + + $intCarrierID = (int)$intArgCarrierID; + + $obCarrier = new Carrier($intCarrierID); + + return $obCarrier->external_module_name === TNTOfficiel::MODULE_NAME; + } +} \ No newline at end of file diff --git a/www/modules/tntofficiel/libraries/TNTOfficiel_Cart.php b/www/modules/tntofficiel/libraries/TNTOfficiel_Cart.php new file mode 100644 index 00000000..a40d4c6d --- /dev/null +++ b/www/modules/tntofficiel/libraries/TNTOfficiel_Cart.php @@ -0,0 +1,121 @@ + + * @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'; + +class TNTOfficiel_Cart +{ + /** + * Is shipping free for cart, through configuration. + * + * @param $objArgCart + * @return bool + */ + public static function isCartShippingFree($objArgCart) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $arrConfigShipping = Configuration::getMultiple(array( + 'PS_SHIPPING_FREE_PRICE', + 'PS_SHIPPING_FREE_WEIGHT' + )); + + // Load current TNT carrier object. + $objCarrierTNT = TNTOfficiel_Carrier::loadGlobalCarrier(); + // If TNT carrier object not available. + if ($objCarrierTNT === null) { + return true; + } + + // If TNT carrier is inactive or free. + if (!$objCarrierTNT->active || $objCarrierTNT->getShippingMethod() == Carrier::SHIPPING_METHOD_FREE) { + return true; + } + + // Get cart amount to reach for free shipping. + $fltFreeFeesPrice = 0; + if (isset($arrConfigShipping['PS_SHIPPING_FREE_PRICE'])) { + $fltFreeFeesPrice = (float)Tools::convertPrice( + (float)$arrConfigShipping['PS_SHIPPING_FREE_PRICE'], + Currency::getCurrencyInstance((int)$objArgCart->id_currency) + ); + } + // Free shipping if cart amount, inc. taxes, inc. product & discount, exc. shipping > PS_SHIPPING_FREE_PRICE + if ($fltFreeFeesPrice > 0 + && $objArgCart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING, null, null, false) >= $fltFreeFeesPrice + ) { + return true; + } + + // Free shipping if cart weight > PS_SHIPPING_FREE_WEIGHT + if (isset($arrConfigShipping['PS_SHIPPING_FREE_WEIGHT']) + && $objArgCart->getTotalWeight() >= (float)$arrConfigShipping['PS_SHIPPING_FREE_WEIGHT'] + && (float)$arrConfigShipping['PS_SHIPPING_FREE_WEIGHT'] > 0 + ) { + return true; + } + + return false; + } + + /** + * Get additional shipping cost for cart (exc. taxes). + * + * @param $objArgCart + * @return float + */ + public static function getCartExtraShippingCost($objArgCart) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $fltShippingCost = 0; + $arrProducts = $objArgCart->getProducts(); + + // If no product, no shipping extra cost. + if (!count($arrProducts)) { + return 0; + } + + // If only virtual products in cart, no extra shipping cost. + if ($objArgCart->isVirtualCart()) { + return 0; + } + + // If TNT carrier is free. + $boolIsCartShippingFree = TNTOfficiel_Cart::isCartShippingFree($objArgCart); + if ($boolIsCartShippingFree) { + return 0; + } + + // Load current TNT carrier object. + $objCarrierTNT = TNTOfficiel_Carrier::loadGlobalCarrier(); + // If TNT carrier object not available, no extra shipping cost. + if ($objCarrierTNT === null) { + return 0; + } + + // Adding handling charges. + $shipping_handling = Configuration::get('PS_SHIPPING_HANDLING'); + if (isset($shipping_handling) && $objCarrierTNT->shipping_handling) { + $fltShippingCost += (float)$shipping_handling; + } + + // Adding additional shipping cost per product. + foreach ($arrProducts as $product) { + if (!$product['is_virtual']) { + $fltShippingCost += $product['additional_shipping_cost'] * $product['cart_quantity']; + } + } + + $fltShippingCost = (float)Tools::convertPrice($fltShippingCost, Currency::getCurrencyInstance((int)$objArgCart->id_currency)); + + return $fltShippingCost; + } +} \ No newline at end of file diff --git a/www/modules/tntofficiel/libraries/TNTOfficiel_DbUtils.php b/www/modules/tntofficiel/libraries/TNTOfficiel_DbUtils.php new file mode 100644 index 00000000..7b0a15ec --- /dev/null +++ b/www/modules/tntofficiel/libraries/TNTOfficiel_DbUtils.php @@ -0,0 +1,33 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; + +class TNTOfficiel_DbUtils +{ + /** + * Gets all the columns name for the given table + * @param string $tableName + * @return array + * @throws PrestaShopDatabaseException + */ + public static function getColumnsFromTable($tableName) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $sql = 'DESC '._DB_PREFIX_.pSQL($tableName); + $results = Db::getInstance()->executeS($sql); + $fields = array(); + foreach ($results as $field) { + $fields[] = $field['Field']; + } + return $fields; + } + +} diff --git a/www/modules/tntofficiel/libraries/TNTOfficiel_Debug.php b/www/modules/tntofficiel/libraries/TNTOfficiel_Debug.php new file mode 100644 index 00000000..055f9637 --- /dev/null +++ b/www/modules/tntofficiel/libraries/TNTOfficiel_Debug.php @@ -0,0 +1,604 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/tntofficiel.php'; + +class TNTOfficiel_Debug +{ + /** + * @var bool Is debugging enabled ? + */ + private static $boolEnabled = false; + /** + * @var array List of allowed client IP. No client IP means all allowed. + */ + private static $arrRemoteIPAddressAllowed = array(); + + /** + * @var bool Backtrace auto added. + */ + private static $boolBackTraceAuto = true; + /** + * @var int Backtrace maximum items. + */ + private static $intBackTraceMaxDeep = 1; //64; + /** + * @var bool Backtrace arguments detail at maximum. + */ + private static $boolBackTraceArgsDetail = false; + + /** + * @var array + */ + private static $arrPHPErrorExclude = array( + E_WARNING => array( + '/^filemtime\(\): stat failed for/ui' + ), + //E_NOTICE => array() + ); + + + + /** + * @var array PHP Errors constant name list. + */ + private static $arrPHPErrorNames = array( + 'E_ERROR', + 'E_RECOVERABLE_ERROR', + 'E_WARNING', + 'E_PARSE', + 'E_NOTICE', + 'E_STRICT', + 'E_DEPRECATED', // PHP 5.3+ + 'E_CORE_ERROR', + 'E_CORE_WARNING', + 'E_COMPILE_ERROR', + 'E_COMPILE_WARNING', + 'E_USER_ERROR', + 'E_USER_WARNING', + 'E_USER_NOTICE', + 'E_USER_DEPRECATED' // PHP 5.3+ + ); + /** + * @var array PHP Errors map + */ + private static $arrPHPErrorMap = null; + + /** + * @var array JSON Errors constant name list. PHP 5.3.0+. + */ + private static $arrJSONErrorNames = array( + 'JSON_ERROR_NONE', + 'JSON_ERROR_DEPTH', + 'JSON_ERROR_STATE_MISMATCH', + 'JSON_ERROR_CTRL_CHAR', + 'JSON_ERROR_SYNTAX', + 'JSON_ERROR_UTF8', // PHP 5.3.3+ + 'JSON_ERROR_RECURSION', // PHP 5.5.0+ + 'JSON_ERROR_INF_OR_NAN', // PHP 5.5.0+ + 'JSON_ERROR_UNSUPPORTED_TYPE', // PHP 5.5.0+ + ); + /** + * @var array JSON Errors map. PHP 5.3.0+. + */ + private static $arrJSONErrorMap = null; + + + /** + * @var bool + */ + private static $boolHandlerRegistered = false; + + /** + * @var string + */ + private static $strRoot = null; + /** + * @var string + */ + private static $strFileName = null; + + + /** + * Prevent Construct. + */ + final private function __construct() + { + trigger_error(sprintf('%s() %s is static.', __FUNCTION__, get_class($this)), E_USER_ERROR); + } + + /** + * Check if client IP address allowed to use debug. + * + * @return bool + */ + public static function isClientIPAddressAllowed() + { + $strRemoteIPAddress = array_key_exists('REMOTE_ADDR', $_SERVER) ? $_SERVER['REMOTE_ADDR'] : null; + + $boolIPAllowed = count(TNTOfficiel_Debug::$arrRemoteIPAddressAllowed) === 0 + || in_array($strRemoteIPAddress, TNTOfficiel_Debug::$arrRemoteIPAddressAllowed, true) === true; + + return $boolIPAllowed; + } + + /** + * Encode to JSON. + * @param $arrDebugInfo + * @return string + */ + public static function encJSON($arrDebugInfo) + { + $flagJSONEncode = 0; + $flagJSONEncode |= defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0; + $flagJSONEncode |= defined('JSON_UNESCAPED_UNICODE') ? JSON_UNESCAPED_UNICODE : 0; + $flagJSONEncode |= defined('JSON_UNESCAPED_SLASHES') ? JSON_UNESCAPED_SLASHES : 0; + + // PHP < 5.3 return null if second parameter is used. + return $flagJSONEncode === 0 ? json_encode($arrDebugInfo) : json_encode($arrDebugInfo, $flagJSONEncode); + } + + /** + * @param int $intArgType + * @return string + */ + public static function getPHPErrorType($intArgType) + { + // Generate constant name mapping. + if (TNTOfficiel_Debug::$arrPHPErrorMap === null) { + TNTOfficiel_Debug::$arrPHPErrorMap = array(); + foreach (TNTOfficiel_Debug::$arrPHPErrorNames as $strPHPErrorTypeName) { + if (defined($strPHPErrorTypeName)) { + $intPHPErrorType = constant($strPHPErrorTypeName); + TNTOfficiel_Debug::$arrPHPErrorMap[ $intPHPErrorType ] = $strPHPErrorTypeName; + } + } + } + + $strPHPErrorType = array_key_exists($intArgType, TNTOfficiel_Debug::$arrPHPErrorMap) ? TNTOfficiel_Debug::$arrPHPErrorMap[ $intArgType ] : (string)$intArgType; + + return $strPHPErrorType; + } + + + /** + * @param int $intArgType + * @return string + */ + public static function getJSONErrorType($intArgType) + { + // Generate constant name mapping. + if (TNTOfficiel_Debug::$arrJSONErrorMap === null) { + TNTOfficiel_Debug::$arrJSONErrorMap = array(); + foreach (TNTOfficiel_Debug::$arrJSONErrorNames as $strJSONErrorTypeName) { + if (defined($strJSONErrorTypeName)) { + $intJSONErrorType = constant($strJSONErrorTypeName); + TNTOfficiel_Debug::$arrJSONErrorMap[ $intJSONErrorType ] = $strJSONErrorTypeName; + } + } + } + + $strJSONErrorType = array_key_exists($intArgType, TNTOfficiel_Debug::$arrJSONErrorMap) ? TNTOfficiel_Debug::$arrJSONErrorMap[ $intArgType ] : (string)$intArgType; + + return $strJSONErrorType; + } + + /** + * Capture an Error. + * + * @param int $intArgType + * @param string $strArgMessage + * @param string $strArgFile + * @param int $intArgLine + * @param bool $boolArgIsLast + * @return boolean + */ + public static function captureError($intArgType, $strArgMessage, $strArgFile = null, $intArgLine = 0, $arrArgContext = array(), $boolArgIsLast = false) + { + $arrLogError = array( + 'type' => $boolArgIsLast ? 'LastError' : 'Error' + ); + + if ($strArgFile !== null) { + $arrLogError['file'] = $strArgFile; + $arrLogError['line'] = $intArgLine; + } + + if ($boolArgIsLast) { + $arrLogError['trace'] = array(); + } + + $strType = TNTOfficiel_Debug::getPHPErrorType($intArgType); + $arrLogError['msg'] = 'Type '.$strType.': '.$strArgMessage; + + if (array_key_exists($intArgType, TNTOfficiel_Debug::$arrPHPErrorExclude) && is_array(TNTOfficiel_Debug::$arrPHPErrorExclude[$intArgType])) { + if (count(TNTOfficiel_Debug::$arrPHPErrorExclude[$intArgType]) === 0) { + return false; + } + foreach (TNTOfficiel_Debug::$arrPHPErrorExclude[$intArgType] as $k => $r) { + if (preg_match($r, $strArgMessage) === 1) { + return false; + } + } + } + + TNTOfficiel_Debug::log($arrLogError); + + // Internal error handler continues (displays/log error, …) + return false; + } + + /** + * Capture last Error. + * Useful at script end for E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE, … + */ + public static function captureLastError() + { + $arrPHPLastError = error_get_last(); + + if (is_array($arrPHPLastError)) { + TNTOfficiel_Debug::captureError( + $arrPHPLastError['type'], + $arrPHPLastError['message'], + $arrPHPLastError['file'], + $arrPHPLastError['line'], + array(), + true + ); + } + + // PHP 5.3.0+ + if (function_exists('json_last_error')) { + $intTypeJSONLastError = json_last_error(); + $strJSONLastErrorType = TNTOfficiel_Debug::getJSONErrorType($intTypeJSONLastError); + // PHP 5.5.0+ + $strJSONLastErrorMessage = function_exists('json_last_error_msg') ? json_last_error_msg() : 'N/A'; + TNTOfficiel_Debug::captureError($strJSONLastErrorType, $strJSONLastErrorMessage, null, 0, array(), true); + + } + } + + /** + * Capture an Exception. + * + * @param \Exception $objArgException + */ + public static function captureException($objArgException) + { + $arrLogException = array( + 'type' => 'Exception' + ); + + if ($objArgException->getFile() !== null) { + $arrLogException['file'] = $objArgException->getFile(); + $arrLogException['line'] = $objArgException->getLine(); + } + + $arrLogException['msg'] = 'Code '.$objArgException->getCode().': '.$objArgException->getMessage(); + $arrLogException['trace'] = $objArgException->getTrace(); + + TNTOfficiel_Debug::log($arrLogException); + } + + /** + * Capture connection status. + */ + public static function captureConnectionStatus() + { + // is non normal connection status. + $intStatus = connection_status(); + // connection_aborted() + if ($intStatus & 1) { + TNTOfficiel_Debug::log(array( + 'type' => 'Shutdown', + 'msg' => sprintf('Connection was aborted by user.') + )); + } + if ($intStatus & 2) { + TNTOfficiel_Debug::log(array( + 'type' => 'Shutdown', + 'msg' => sprintf('Script exceeded maximum execution time.') + )); + } + } + + /** + * Capture output buffer status. + */ + public static function captureOutPutBufferStatus() + { + $msg = 'Output was not sent yet.'; + + // is output buffer was sent + $strOutputBufferFile = null; + $intOutputBufferLine = null; + $boolOutputBufferSent = headers_sent($strOutputBufferFile, $intOutputBufferLine); + if ($boolOutputBufferSent) { + $msg = sprintf('Output was sent in \'%s\' on line %s.', $strOutputBufferFile, $intOutputBufferLine); + } + + TNTOfficiel_Debug::log(array( + 'type' => 'Shutdown', + 'msg' => $msg, + 'headers' => headers_list(), + 'level' => ob_get_level(), + 'trace' => array() + )); + } + + /** + * Capture at shutdown. + */ + public static function captureAtShutdown() + { + TNTOfficiel_Debug::captureLastError(); + TNTOfficiel_Debug::captureConnectionStatus(); + TNTOfficiel_Debug::captureOutPutBufferStatus(); + TNTOfficiel_Debug::addLogContent(']'); + } + + + /** + * Register capture handlers once. + */ + public static function registerHandlers() + { + if (TNTOfficiel_Debug::$boolHandlerRegistered !== true) { + TNTOfficiel_Debug::$boolHandlerRegistered = true; + set_error_handler(array('TNTOfficiel_Debug', 'captureError')); + set_exception_handler(array('TNTOfficiel_Debug', 'captureException')); + register_shutdown_function(array('TNTOfficiel_Debug', 'captureAtShutdown')); + } + } + + /** + * Get the script start time. + * + * @return float + */ + public static function getStartTime() + { + return (float)(array_key_exists('REQUEST_TIME_FLOAT', $_SERVER) ? $_SERVER['REQUEST_TIME_FLOAT'] : + $_SERVER['REQUEST_TIME']); + } + + + /** + * Set log root directory. + * + * @param $strArgRoot + */ + public static function setRootDirectory($strArgRoot) + { + TNTOfficiel_Debug::$strRoot = null; + + $strRealpath = realpath($strArgRoot); + + // If not a writable directory. + if ($strRealpath === false || !is_dir($strRealpath) || !is_writable($strRealpath)) { + return false; + } + + // Add final separator. + if (mb_substr($strRealpath, -1) !== DIRECTORY_SEPARATOR) { + $strRealpath .= DIRECTORY_SEPARATOR; + } + + // Save. + TNTOfficiel_Debug::$strRoot = $strRealpath; + + return true; + + } + + /** + * Get log filename. + * + * @return string + */ + public static function getFilename() + { + // If root directory is defined, but not the filename. + if (TNTOfficiel_Debug::$strRoot !== null && TNTOfficiel_Debug::$strFileName === null) { + $floatScriptTime = TNTOfficiel_Debug::getStartTime(); + $strTimeStamp = var_export($floatScriptTime, true); + $strTimeStamp = preg_replace('/^([0-9]+(?:\.[0-9]{1,6}))[0-9]*$/ui', '$1', $strTimeStamp); + $strTimeStamp = preg_replace('/\./ui', '', $strTimeStamp); + $strTimeStamp = sprintf('%-016s',$strTimeStamp); + $strFileNameSuffix = $strTimeStamp.'_'.preg_replace('/[^a-z0-9_]+/ui', '-', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); + TNTOfficiel_Debug::$strFileName = TNTOfficiel_Debug::$strRoot.'debug_'.$strFileNameSuffix.'.json'; + } + + return TNTOfficiel_Debug::$strFileName; + } + + /** + * Create log file if do not exist. + * Log global info at creation. + * + * @param string $strArgDebugInfo + * @return bool + */ + public static function addLogContent($strArgDebugInfo = '') + { + $strFileName = TNTOfficiel_Debug::getFilename(); + + if ($strFileName === null) { + return false; + } + + // If file don't already exist. + if (!file_exists($strFileName)) { + $arrDebugInfo = array( + 'type' => 'StartInfo', + 'uri' => array_key_exists('REQUEST_URI', $_SERVER) ? $_SERVER['REQUEST_URI'] : null, + 'referer' => array_key_exists('HTTP_REFERER', $_SERVER) ? $_SERVER['HTTP_REFERER'] : null, + 'client' => array_key_exists('REMOTE_ADDR', $_SERVER) ? $_SERVER['REMOTE_ADDR'] : null, + 'post' => $_POST, + 'get' => $_GET, + 'cookie' => $_COOKIE + ); + + $strDebugInfo = '['.TNTOfficiel_Debug::encJSON($arrDebugInfo).','; + + $strArgDebugInfo = $strDebugInfo.$strArgDebugInfo; + } + + file_put_contents($strFileName, $strArgDebugInfo, FILE_APPEND); + } + + /** + * Append log info. + * + * @param null $arrArg + */ + public static function log($arrArg = null) + { + // If not enabled or client IP not allowed. + if (TNTOfficiel_Debug::$boolEnabled !== true || TNTOfficiel_Debug::isClientIPAddressAllowed() !== true) { + return; + } + + // Set default path. + //TNTOfficiel_Debug::setRootDirectory(_PS_ROOT_DIR_.'/log/'); + TNTOfficiel_Debug::setRootDirectory(_PS_MODULE_DIR_.TNTOfficiel::MODULE_NAME.'/'.TNTOfficiel::LOG_DIR); + + // Register handlers if not. + TNTOfficiel_Debug::registerHandlers(); + + if (!is_array($arrArg)) { + $arrArg = array('raw' => $arrArg); + } + + // If message, file and line exist, then concat. + if (array_key_exists('msg', $arrArg) && array_key_exists('file', $arrArg) && array_key_exists('line', $arrArg)) { + $arrArg['msg'] .= ' \''.$arrArg['file'].'\' on line '.$arrArg['line']; + unset($arrArg['file']); + unset($arrArg['line']); + } + + // If no backtrace and auto backtrace set. + if (TNTOfficiel_Debug::$boolBackTraceAuto === true + && (!array_key_exists('trace', $arrArg) || !is_array($arrArg['trace'])) + ) { + // Get current one. + $arrArg['trace'] = debug_backtrace(); + // Remove trace from this current method. + array_shift($arrArg['trace']); + } + + // Process backtrace. + if (array_key_exists('trace', $arrArg) && is_array($arrArg['trace'])) { + + // Final backtrace. + $arrTraceStack = array(); + + // Get each trace, deeper first. + while ($arrTrace = array_shift($arrArg['trace'])) { + + $intDeepIndex = count($arrTraceStack); + // Get stack with maximum items. + if ($intDeepIndex >= TNTOfficiel_Debug::$intBackTraceMaxDeep) { + break; + } + + // function + if (array_key_exists('class', $arrTrace) && is_string($arrTrace['class'])) { + // Exclude this class. + if (in_array($arrTrace['class'], array(__CLASS__), true)) { + continue; + } + $arrTrace['function'] = $arrTrace['class'].$arrTrace['type'].$arrTrace['function']; + } + // file + if (array_key_exists('file', $arrTrace) && is_string($arrTrace['file'])) { + $arrTrace['file'] = '\''.$arrTrace['file'].'\' on line '.$arrTrace['line']; + } else { + $arrTrace['file'] = '[Internal]'; + } + + // arguments + $arrCallerArgs = array(); + if (array_key_exists('args', $arrTrace) && is_array($arrTrace['args'])) { + foreach ($arrTrace['args'] as $k => $mxdTraceArg) { + if (is_scalar($mxdTraceArg) || $mxdTraceArg === null) { + $arrCallerArgs[ $k ] = $mxdTraceArg; + } else { + $arrCallerArgs[ $k ] = '('.gettype($mxdTraceArg).')'; + if (is_object($mxdTraceArg)) { + $arrCallerArgs[ $k ] .= get_class($mxdTraceArg); + } + } + } + $arrTrace['function'] .= '('.count($arrCallerArgs).')'; + } + + unset($arrTrace['line']); + unset($arrTrace['class']); + unset($arrTrace['type']); + unset($arrTrace['object']); + + if (TNTOfficiel_Debug::$boolBackTraceArgsDetail === true) { + + // Detecting circular reference, etc ... + try { + serialize($arrTrace['args']); + } catch (Exception $e) { + $arrTrace['args'] = $arrCallerArgs; + } + + $strArgsJSON = TNTOfficiel_Debug::encJSON($arrTrace['args']); + // If unable to encode. + if (mb_strlen($strArgsJSON) == 0) { + $arrTrace['args'] = $arrCallerArgs; + } + } else { + $arrTrace['args'] = $arrCallerArgs; + } + + // If no arguments. + if (count($arrCallerArgs) === 0) { + // Remove key (no line output). + unset($arrTrace['args']); + } + + // Add trace. + $arrTraceStack[ $intDeepIndex ] = $arrTrace; + } + + // Save processed backtrace. + $arrArg['trace'] = $arrTraceStack; + + // Remove backtrace key if empty. + if (count($arrArg['trace']) === 0) { + unset($arrArg['trace']); + } + } + + // Append time and memory consumption. + $arrArg += array( + 'time' => microtime(true) - TNTOfficiel_Debug::getStartTime(), + 'mem' => memory_get_peak_usage() / 1024 / 1024, + ); + + // List of sorted selected key. + $arrKeyExistSort = array_intersect_key(array_flip( + array('time', 'mem', 'type', 'msg', 'file', 'line', 'trace', 'dump') + ), $arrArg); + // List of unsorted key left. + $arrKeyUnExistUnSort = array_diff_key($arrArg, $arrKeyExistSort); + // Append unsorted list to sorted. + $arrArg = array_merge($arrKeyExistSort, $arrArg) + $arrKeyUnExistUnSort; + + $strDebugInfo = TNTOfficiel_Debug::encJSON($arrArg).','; + $strDebugInfo = preg_replace('/}\s*,\s*{/ui', '},{', $strDebugInfo); + + TNTOfficiel_Debug::addLogContent($strDebugInfo); + } +} diff --git a/www/modules/tntofficiel/libraries/TNTOfficiel_Install.php b/www/modules/tntofficiel/libraries/TNTOfficiel_Install.php new file mode 100644 index 00000000..a65d98e2 --- /dev/null +++ b/www/modules/tntofficiel/libraries/TNTOfficiel_Install.php @@ -0,0 +1,578 @@ + + * @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_Logger.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Carrier.php'; + +class TNTOfficiel_Install +{ + /** @var array */ + public static $arrHookList = array( + // Header + 'displayBackOfficeHeader', + 'actionAdminControllerSetMedia', + 'displayHeader', + // Front-Office display carrier. + 'displayBeforeCarrier', + 'displayCarrierList', + // Front-Office display Order created. + //'displayOrderConfirmation', + // Front-Office order detail. + 'displayOrderDetail', + + // Back-Office order detail. + 'displayAdminOrder', + + // Carrier updated. + 'actionCarrierUpdate', + // Order status before changed. + 'actionOrderStatusUpdate', + 'actionOrderStatusPostUpdate', + // Order created. + 'actionValidateOrder', + + // + //'actionDeliveryPriceByWeight', + //'actionDeliveryPriceByPrice', + // + //'displayPayment', + //'displayPaymentReturn', + //'actionPaymentConfirmation', + //'actionCartSave', + //'actionCarrierProcess', + // + //'actionObjectAddBefore', + //'actionObjectAddAfter', + //'actionObjectUpdateBefore', + //'actionObjectUpdateAfter', + //'actionObjectDeleteBefore', + //'actionObjectDeleteAfter', + //'actionObjectOrderAddBefore', + //'actionObjectOrderAddAfter', + //'actionObjectOrderUpdateBefore', + //'actionObjectOrderUpdateAfter', + //'actionObjectOrderDeleteBefore', + //'actionObjectOrderDeleteAfter', + ); + + /** @var array */ + public static $arrConfigUpdateDeleteList = array( + //'TNT_CARRIER_ID' Carrier ID is created on installCarrier, then preserved. + //'TNT_GOOGLE_MAP_API_KEY' Google Map API Key is created on config form submit, then preserved. + // Authentication information. + 'TNT_CARRIER_USERNAME' => '', + 'TNT_CARRIER_ACCOUNT' => '', + 'TNT_CARRIER_PASSWORD' => '', + // Is Authentication information validated. + 'TNT_CARRIER_ACTIVATED' => false, + // Show pickup number in AdminOrdersController. + 'TNT_CARRIER_PICKUP_NUMBER_SHOW' => '', + // Max weight (kg) per parcel. + 'TNT_CARRIER_MAX_PACKAGE_B2B' => '30.0', + 'TNT_CARRIER_MAX_PACKAGE_B2C' => '20.0', + // Comma separated list of item cart attributes. + 'TNT_CARRIER_ASSOCIATIONS' => '', + // MiddleWare JSON-RPC URL. + 'TNT_CARRIER_MIDDLEWARE_URL' => 'https://solutions-ecommerce.tnt.fr/api/handler', + // MiddleWare IFrame URL. + 'TNT_CARRIER_MIDDLEWARE_SHORT_URL' => 'https://solutions-ecommerce.tnt.fr/login', + 'TNT_CARRIER_SOAP_WSDL' => 'https://www.tnt.fr/service/?wsdl', + // . for ./libraries/TNTOfficiel_Address.php + // DB fields used as default values for delivery address extra data. + 'TNT_CARRIER_ADDRESS_EMAIL' => 'customer.email', + 'TNT_CARRIER_ADDRESS_PHONE' => 'address.phone_mobile', + 'TNT_CARRIER_ADDRESS_BUILDING' => '', + 'TNT_CARRIER_ADDRESS_INTERCOM' => '', + 'TNT_CARRIER_ADDRESS_FLOOR' => '' + ); + + /** @var array */ + public static $arrTemplateOverrideList = array( + array( + 'fileName' => 'view.tpl', + 'directorySrc' => 'views/templates/admin/override/controllers/admin/templates/orders/helpers/view/', + 'directoryDst' => 'controllers/admin/templates/orders/helpers/view/', + ), + ); + + /** + * Prevent Construct. + */ + final private function __construct() + { + trigger_error(sprintf('%s() %s is static.', __FUNCTION__, get_class($this)), E_USER_ERROR); + } + + /** + * Create a new directory with default index.php file. + * + * @param $arrArgDirectoryList an array of directories. + */ + public static function makeModuleDir($arrArgDirectoryList) + { + $strIndexFileContent = <</cache/'). + Media::clearCache(); + // Clear class index cache for PrestaShopAutoload ('/cache/class_index.php'). + Tools::generateIndex(); +/* + // Check cache '/cache/class_index.php' + $objPSAutoload = PrestaShopAutoload::getInstance(); + if ( + !$objPSAutoload->_include_override_path || + //!Configuration::get('PS_DISABLE_OVERRIDES') || + $objPSAutoload->getClassPath('AdminOrdersController') !== 'override/controllers/admin/AdminOrdersController.php' || + $objPSAutoload->getClassPath('Order') !== 'override/classes/order/Order.php' || + $objPSAutoload->getClassPath('OrderHistory') !== 'override/classes/order/OrderHistory.php' + ) { + // Warning !! + } +*/ + } + + /** + * Update settings fields. + * + * @return bool + */ + public static function updateSettings() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $boolUpdated = true; + + foreach (TNTOfficiel_Install::$arrConfigUpdateDeleteList as $strCfgName => $mxdValue) { + $boolUpdated = $boolUpdated && Configuration::updateValue($strCfgName, $mxdValue); + } + + return $boolUpdated; + } + + /** + * Delete settings fields. + * + * @return bool + */ + public static function deleteSettings() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $boolDeleted = true; + + foreach (TNTOfficiel_Install::$arrConfigUpdateDeleteList as $strCfgName => $mxdValue) { + $boolDeleted = $boolDeleted && Configuration::deleteByName($strCfgName); + } + + return $boolDeleted; + } + + + /** + * Creates the admin Tab. + * + * @param $arrArgTabNameLang Module name displayed. + * + * @return bool + */ + public static function createTab($arrArgTabNameLang) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // Creates the parent tab + $parentTab = new Tab(); + $parentTab->class_name = 'AdminTNTOfficiel'; + $parentTab->name = $arrArgTabNameLang; + $parentTab->module = TNTOfficiel::MODULE_NAME; + $parentTab->id_parent = 0; + // TODO : AdminParentShipping as parent ? + //$parentTab->id_parent = Tab::getIdFromClassName('AdminParentShipping'); + $boolResult = (bool)($parentTab->add()); + +/* + if (version_compare(_PS_VERSION_, '1.6', '<')) { + $childrenTab = new Tab(); + $childrenTab->class_name = 'AdminTNTOfficiel'; + $childrenTab->name = $arrTabNameLang; + $childrenTab->module = $strModuleName; + $childrenTab->id_parent = Tab::getIdFromClassName('AdminTNTOfficiel'); + $boolResult15 = (bool)($childrenTab->add()); + + return $boolResult && $boolResult15; + } +*/ + return $boolResult; + } + + /** + * Delete the admin Tab. + * + * @return bool + */ + public static function deleteTab() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $objTabsPSCollection = Tab::getCollectionFromModule(TNTOfficiel::MODULE_NAME)->getAll(); + foreach ($objTabsPSCollection as $tab) { + if (!$tab->delete()) { + return false; + } + } + + return true; + } + + + /** + * Update table. + * + * @return bool + */ + public static function upgradeTables_1_2_20() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $strTablePrefix = _DB_PREFIX_; + + // Test if table tnt_extra_address_data exist. + $strSQLTableExtraExist = <<execute($strSQLTableLogDropTable)) { + return false; + } + + // Update table tnt_extra_address_data if exist. + $arrDBResult = $objDB->executeS($strSQLTableExtraExist); + if(count($arrDBResult) === 1) { + if (!$objDB->execute($strSQLTableExtraAddColumns) + || !$objDB->execute($strSQLTableExtraChangeColumns) + || !$objDB->execute($strSQLTableExtraRenameTable) + ) { + return false; + } + } + + // Update tnt_order if exist. + $arrDBResult = $objDB->executeS($strSQLTableOrderExist); + if(count($arrDBResult) === 1) { + if (!$objDB->execute($strSQLTableOrderChangeColumns) + || !$objDB->execute($strSQLTableOrderRenameTable) + ) { + return false; + } + } + + // Update tnt_parcel if exist. + $arrDBResult = $objDB->executeS($strSQLTableParcelExist); + if(count($arrDBResult) === 1) { + if (!$objDB->execute($strSQLTableParcelChangeColumns) + || !$objDB->execute($strSQLTableParcelRenameTable) + ) { + return false; + } + } + + return true; + } + + /** + * Creates the tables needed by the module. + * + * @return bool + */ + public static function createTables() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // Update if required. + TNTOfficiel_Install::upgradeTables_1_2_20(); + + $strTablePrefix = _DB_PREFIX_; + $strTableEngine = _MYSQL_ENGINE_; + + // Create tntofficiel_cart table. + $strSQLCreateCart = <<execute($strSQLCreateCart) + || !$objDB->execute($strSQLCreateOrder) + || !$objDB->execute($strSQLCreateParcels) + ) { + return false; + } + + return true; + } + + /** + * Create or Restore an existing TNT carrier. + * + * @return bool + */ + public static function installCarrier() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // Try to undelete previously deleted carrier. + $boolResult = TNTOfficiel_Carrier::undeleteGlobalCarrier(); + // If not succeed. + if (!$boolResult) { + // Create a new one. + $boolResult = TNTOfficiel_Carrier::createGlobalCarrier(); + } + + return $boolResult; + } + + /** + * Add a template override in the override directory. + * + * @param $strArgModuleDir Module absolute Path. + * @return array + */ + public static function overrideTemplates($strArgModuleDir) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $arrErrors = array(); + + foreach (TNTOfficiel_Install::$arrTemplateOverrideList as $arrTemplateOverride) { + + $strPathTemplateSrc = $strArgModuleDir.$arrTemplateOverride['directorySrc']; + $strFileTemplateSrc = $strPathTemplateSrc.$arrTemplateOverride['fileName']; + $strPathTemplateDst = _PS_OVERRIDE_DIR_.$arrTemplateOverride['directoryDst']; + $strFileTemplateDst = $strPathTemplateDst.$arrTemplateOverride['fileName']; + + try { + // Create directory if unexist. + if (!is_dir($strPathTemplateDst)) { + mkdir($strPathTemplateDst, 0777, true); + } + // Copy new template file. + if (!copy($strFileTemplateSrc, $strFileTemplateDst)) { + $arrErrors[] = sprintf(Tools::displayError('Impossible d\'installer la surcharge "%s"'), $arrTemplateOverride['fileName']); + } + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + + $arrErrors[] = sprintf(Tools::displayError('Impossible d\'installer la surcharge "%s"'), $arrTemplateOverride['fileName']); + } + } + + return $arrErrors; + } + + /** + * Delete a template override in the override directory. + * + * @return array + */ + public static function unOverrideTemplates() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $arrErrors = array(); + + // Unoverride templates. + foreach (TNTOfficiel_Install::$arrTemplateOverrideList as $arrTemplateOverride) { + $strPathTemplateDst = _PS_OVERRIDE_DIR_.$arrTemplateOverride['directoryDst']; + $strFileTemplateDst = $strPathTemplateDst.$arrTemplateOverride['fileName']; + + try { + // Create directory if not found. + if (!is_dir($strPathTemplateDst)) { + mkdir($strPathTemplateDst, 0777, true); + } + // Delete previous template file if exist. + if (file_exists($strFileTemplateDst)) { + if(!unlink($strFileTemplateDst)) { + $arrErrors[] = sprintf(Tools::displayError('Impossible de supprimer la surcharge "%s"'), $arrTemplateOverride['fileName']); + } + } + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + + $arrErrors[] = sprintf(Tools::displayError('Impossible de supprimer la surcharge "%s"'), $arrTemplateOverride['fileName']); + } + } + + return $arrErrors; + } +} diff --git a/www/modules/tntofficiel/libraries/TNTOfficiel_JsonRPCClient.php b/www/modules/tntofficiel/libraries/TNTOfficiel_JsonRPCClient.php new file mode 100644 index 00000000..8bd9e743 --- /dev/null +++ b/www/modules/tntofficiel/libraries/TNTOfficiel_JsonRPCClient.php @@ -0,0 +1,410 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; + +class TNTOfficiel_AccessDeniedException extends Exception {} +class TNTOfficiel_ConnectionFailureException extends Exception {} +class TNTOfficiel_ServerErrorException extends Exception {} + +/** + * JsonRPC client class + * + * @package JsonRPC + * @author Frederic Guillot + */ +class TNTOfficiel_JsonRPCClient +{ + /** + * URL of the server + * + * @access private + * @var string + */ + private $url; + /** + * If the only argument passed to a function is an array + * assume it contains named arguments + * + * @access public + * @var boolean + */ + public $named_arguments = true; + /** + * HTTP client timeout + * + * @access private + * @var integer + */ + private $timeout; + /** + * Username for authentication + * + * @access private + * @var string + */ + private $username; + /** + * Password for authentication + * + * @access private + * @var string + */ + private $password; + /** + * True for a batch request + * + * @access public + * @var boolean + */ + public $is_batch = false; + /** + * Batch payload + * + * @access public + * @var array + */ + public $batch = array(); + /** + * Enable debug output to the php error log + * + * @access public + * @var boolean + */ + public $debug = false; + /** + * Default HTTP headers to send to the server + * + * @access private + * @var array + */ + private $headers = array( + 'User-Agent: JSON-RPC PHP Client ', + 'Content-Type: application/json', + 'Accept: application/json', + 'Connection: close', + ); + /** + * SSL certificates verification + * + * @access public + * @var boolean + */ + public $ssl_verify_peer = true; + + /** + * Constructor + * + * @access public + * @param string $url Server URL + * @param integer $timeout HTTP timeout + * @param array $headers Custom HTTP headers + */ + public function __construct($url, $timeout = 3, $headers = array()) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->url = $url; + $this->timeout = $timeout; + $this->headers = array_merge($this->headers, $headers); + } + + /** + * Automatic mapping of procedures + * + * @access public + * @param string $method Procedure name + * @param array $params Procedure arguments + * @return mixed + */ + public function __call($method, array $params) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // Allow to pass an array and use named arguments + if ($this->named_arguments && count($params) === 1 && is_array($params[0])) { + $params = $params[0]; + } + return $this->execute($method, $params); + } + + /** + * Set authentication parameters + * + * @access public + * @param string $username Username + * @param string $password Password + * @return Client + */ + public function authentication($username, $password) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->username = $username; + $this->password = $password; + return $this; + } + + /** + * Start a batch request + * + * @access public + * @return Client + */ + public function batch() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->is_batch = true; + $this->batch = array(); + return $this; + } + + /** + * Send a batch request + * + * @access public + * @return array + */ + public function send() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->is_batch = false; + return $this->parseResponse( + $this->doRequest($this->batch) + ); + } + + /** + * Execute a procedure + * + * @access public + * @param string $procedure Procedure name + * @param array $params Procedure arguments + * @return mixed + */ + public function execute($procedure, array $params = array()) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $params['date'] = time(); + if ($this->is_batch) { + $this->batch[] = $this->prepareRequest($procedure, $params); + return $this; + } + return $this->parseResponse( + $this->_doRequest($this->prepareRequest($procedure, $params)) + ); + } + + /** + * Prepare the payload + * + * @access public + * @param string $procedure Procedure name + * @param array $params Procedure arguments + * @return array + */ + public function prepareRequest($procedure, array $params = array()) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $payload = array( + 'jsonrpc' => '2.0', + 'method' => $procedure, + 'id' => mt_rand() + ); + if (! empty($params)) { + $payload['params'] = $params; + } + return $payload; + } + + /** + * Parse the response and return the procedure result + * + * @access public + * @param array $payload + * @return mixed + */ + public function parseResponse(array $payload) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + if ($this->isBatchResponse($payload)) { + $results = array(); + foreach ($payload as $response) { + $results[] = $this->getResult($response); + } + return $results; + } + return $this->getResult($payload); + } + + /** + * Throw an exception according the RPC error + * + * @access public + * @param array $error + * @throws BadFunctionCallException + * @throws InvalidArgumentException + * @throws RuntimeException + */ + public function handleRpcErrors(array $error) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + switch ($error['code']) { + case -32601: + throw new BadFunctionCallException('Procedure not found: '. $error['message']); + case -32602: + throw new InvalidArgumentException('Invalid arguments: '. $error['message']); + default: + throw new RuntimeException('Invalid request/response: '. $error['message'], $error['code']); + } + } + + /** + * Throw an exception according the HTTP response + * + * @access public + * @param array $headers + * @throws TNTOfficiel_AccessDeniedException + * @throws TNTOfficiel_ServerErrorException + */ + public function handleHttpErrors(array $headers) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $exceptions = array( + '401' => 'TNTOfficiel_AccessDeniedException', + '403' => 'TNTOfficiel_AccessDeniedException', + '404' => 'TNTOfficiel_ConnectionFailureException', + '500' => 'TNTOfficiel_ServerErrorException', + ); + foreach ($headers as $header) { + foreach ($exceptions as $code => $exception) { + if (strpos($header, 'HTTP/1.0 '.$code) !== false || strpos($header, 'HTTP/1.1 '.$code) !== false) { + throw new $exception('Response: '.$header); + } + } + } + } + + /** + * Do the HTTP request + * + * @access private + * @param array $payload + * @return array + * @throws TNTOfficiel_ConnectionFailureException + */ + private function _doRequest(array $payload) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + if (extension_loaded('curl')) { + $ch = curl_init(trim($this->url)); + curl_setopt_array($ch, array( + CURLOPT_RETURNTRANSFER => true, + CURLOPT_HTTPHEADER => $this->headers, + CURLOPT_POST => true, + CURLOPT_POSTFIELDS => Tools::jsonEncode($payload), + CURLOPT_RETURNTRANSFER => true, + )); + + $response = Tools::jsonDecode(curl_exec($ch), true); + curl_close($ch); + if (!$response) { + throw new TNTOfficiel_ConnectionFailureException('Unable to establish a connection'); + } + } else { + $stream = @fopen(trim($this->url), 'r', false, $this->_getContext($payload)); + if (!is_resource($stream)) { + throw new TNTOfficiel_ConnectionFailureException('Unable to establish a connection'); + } + $metadata = stream_get_meta_data($stream); + $this->handleHttpErrors($metadata['wrapper_data']); + $response = Tools::jsonDecode(stream_get_contents($stream), true); + } + + if ($this->debug) { + error_log('==> Request: ' . PHP_EOL . Tools::jsonEncode($payload, JSON_PRETTY_PRINT)); + error_log('==> Response: ' . PHP_EOL . Tools::jsonEncode($response, JSON_PRETTY_PRINT)); + } + + TNTOfficiel_Debug::log(array('msg' => '<<', 'file' => __FILE__, 'line' => __LINE__, 'dump' => array('request' => $payload, 'response' => $response))); + + return is_array($response) ? $response : array(); + } + + /** + * Prepare stream context + * + * @access private + * @param array $payload + * @return resource + */ + private function getContext(array $payload) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $headers = $this->headers; + if (! empty($this->username) && ! empty($this->password)) { + $headers[] = 'Authorization: Basic '.base64_encode($this->username.':'.$this->password); + } + return stream_context_create(array( + 'http' => array( + 'method' => 'POST', + 'protocol_version' => 1.1, + 'timeout' => $this->timeout, + 'max_redirects' => 2, + 'header' => implode("\r\n", $headers), + 'content' => Tools::jsonEncode($payload), + 'ignore_errors' => true, + ), + "ssl" => array( + "verify_peer" => $this->ssl_verify_peer, + "verify_peer_name" => $this->ssl_verify_peer, + ) + )); + } + + /** + * Return true if we have a batch response + * + * @access public + * @param array $payload + * @return boolean + */ + private function isBatchResponse(array $payload) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + return array_keys($payload) === range(0, count($payload) - 1); + } + + /** + * Get a RPC call result + * + * @access private + * @param array $payload + * @return mixed + */ + private function getResult(array $payload) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + if (isset($payload['error']['code'])) { + $this->handleRpcErrors($payload['error']); + } + return isset($payload['result']) ? $payload['result'] : null; + } +} \ No newline at end of file diff --git a/www/modules/tntofficiel/libraries/TNTOfficiel_Logger.php b/www/modules/tntofficiel/libraries/TNTOfficiel_Logger.php new file mode 100644 index 00000000..c58d8bb4 --- /dev/null +++ b/www/modules/tntofficiel/libraries/TNTOfficiel_Logger.php @@ -0,0 +1,181 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/tntofficiel.php'; + +class TNTOfficiel_Logger extends AbstractLogger +{ + /** + * @param $request + * @param null $message + * @param string $format + * @param bool|false $isRequest + * @param null $status + * @param null $data + * @return bool + */ + public function logMessageTnt($request, $message = null, $format = 'JSON', $isRequest = false, $status = null, $data = null) + { + try { + $this->_createLogFolder(); + if ($isRequest) { + $formattedMessage = $this->_formatMessageRequest($status, $format, $request); + } else { + $formattedMessage = $this->_formatErrorMessage($message, $format, $request, $data); + } + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + } + + $strLogPath = _PS_MODULE_DIR_.TNTOfficiel::MODULE_NAME.'/'.TNTOfficiel::LOG_DIR; + return (bool)file_put_contents($strLogPath.$this->_getFileName($isRequest), $formattedMessage, FILE_APPEND); + } + + public function logMessage($message, $level) + { + + } + + /** + * Creates the log folder if not exist + */ + private function _createLogFolder() + { + $strLogPath = _PS_MODULE_DIR_.TNTOfficiel::MODULE_NAME.'/'.TNTOfficiel::LOG_DIR; + if (!is_dir($strLogPath)) { + mkdir($strLogPath, 0777, true); + } + } + + /** + * Return the log file name + * @param $isRequest + * @return string + */ + private function _getFileName($isRequest) + { + $dateTime = new DateTime(); + $date = $dateTime->format('Ymd'); + if ($isRequest) { + $fileName = sprintf('TNT-request-%s', $date); + } else { + $fileName = sprintf('TNT-errors-%s', $date); + } + + return $fileName.'.log'; + } + + /** + * Format the message for a request log + * @param $status + * @param $format + * @param $request + * @return string + */ + private function _formatMessageRequest($status, $format, $request) + { + $dateTime = new DateTime(); + $date = $dateTime->format('Ymd H:i:s'); + $account = Configuration::get('TNT_CARRIER_ACCOUNT'); + $formattedMessage = sprintf('%s - %s %s %s:%s %s', $date, $account, $status, $format, $request, chr(10)); + + return $formattedMessage; + } + + /** + * Format the message for an error log + * @param $message + * @param $format + * @param $request + * @param $data + * @return string + */ + private function _formatErrorMessage($message, $format, $request, $data) + { + $dateTime = new DateTime(); + $date = $dateTime->format('Ymd H:i:s'); + $account = Configuration::get('TNT_CARRIER_ACCOUNT'); + $formattedMessage = sprintf('%s - %s %s:%s Error %s || %s %s', $date, $account, $format, $request, $message, $data, chr(10)); + + return $formattedMessage; + } + + /** + * Log install and uninstall steps + * @param $message + * @return bool + */ + public function logInstall($message) + { + $dateTime = new DateTime(); + $date = $dateTime->format('Ymd H:i:s'); + $logMessage = sprintf('%s %s %s', $date, $message, chr(10)); + $filename = 'install.log'; + try { + $this->_createLogFolder(); + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + } + + $strLogPath = _PS_MODULE_DIR_.TNTOfficiel::MODULE_NAME.'/'.TNTOfficiel::LOG_DIR; + return (bool)file_put_contents($strLogPath.$filename, $logMessage, FILE_APPEND); + } + + /** + * Log install and uninstall steps + * @param $message + * @return bool + */ + public function logUninstall($message) + { + $dateTime = new DateTime(); + $date = $dateTime->format('Ymd H:i:s'); + $logMessage = sprintf('%s %s %s', $date, $message, chr(10)); + $filename = 'uninstall.log'; + try { + $this->_createLogFolder(); + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + } + + $strLogPath = _PS_MODULE_DIR_.TNTOfficiel::MODULE_NAME.'/'.TNTOfficiel::LOG_DIR; + return (bool)file_put_contents($strLogPath.$filename, $logMessage, FILE_APPEND); + } + + /** + * Generate an archive containing all the logs files + * + * @param $zipName + * @return ZipArchive + */ + public static function getZip($zipName) + { + $strLogPath = _PS_MODULE_DIR_.TNTOfficiel::MODULE_NAME.'/'.TNTOfficiel::LOG_DIR; + $files = scandir($strLogPath); + + $zip = new ZipArchive(); + $zip->open($zipName, ZipArchive::CREATE); + foreach ($files as $file) { + $filePath = $strLogPath.$file; + $strExt = pathinfo($file, PATHINFO_EXTENSION); + if (in_array($strExt, array('log', 'json'), true) && file_exists($filePath)) { + $zip->addFromString(basename($filePath), Tools::file_get_contents($filePath)); + } + } + $zip->close(); + return $zip; + } + +} diff --git a/www/modules/tntofficiel/libraries/TNTOfficiel_Parcel.php b/www/modules/tntofficiel/libraries/TNTOfficiel_Parcel.php new file mode 100644 index 00000000..26f1f4ac --- /dev/null +++ b/www/modules/tntofficiel/libraries/TNTOfficiel_Parcel.php @@ -0,0 +1,95 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; + +class TNTOfficiel_Parcel +{ + /** + * @var int + */ + private $parcelId; + + /** + * @var array + */ + private $productList; + + /** + * @var float + */ + private $weight = 0; + + /** + * @var int + */ + private $lastAddedProductId; + + /** + * Constructor. + */ + public function __construct() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + } + + /** + * @return int + */ + public function getParcelId() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + return $this->parcelId; + } + + /** + * @param int $parcelId + */ + public function setParcelId($parcelId) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->parcelId = $parcelId; + } + + /** + * @return array + */ + public function getProductList() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + return $this->productList; + } + + /** + * @return float + */ + public function getWeight() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + return $this->weight; + } + + /** + * Add a product to the product list and update the weight;. + * + * @param $product + */ + public function addProduct($product) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->productList[$product['id_product']] = $product; //add the product + $this->weight += $product['weight']; //update the parcel's weight + $this->lastAddedProductId = $product['id_product']; //save the last added product id + } +} diff --git a/www/modules/tntofficiel/libraries/TNTOfficiel_PasswordManager.php b/www/modules/tntofficiel/libraries/TNTOfficiel_PasswordManager.php new file mode 100644 index 00000000..6ebed72e --- /dev/null +++ b/www/modules/tntofficiel/libraries/TNTOfficiel_PasswordManager.php @@ -0,0 +1,63 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; + +class TNTOfficiel_PasswordManager +{ + static $salt = '0hp6df7j46df4gc6df42nfhf6i9gfdzz'; + + /** + * Encrypt password + * @param $password + * @return string + */ + public static function encrypt($password) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $encryptedPwd = trim(base64_encode(mcrypt_encrypt( + MCRYPT_RIJNDAEL_256, TNTOfficiel_PasswordManager::$salt, $password, MCRYPT_MODE_ECB, + mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND) + ))); + + return $encryptedPwd; + } + + /** + * Decrypt password + * @param $password + * @return string + */ + public static function decrypt($password) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $decryptedPwd = trim(mcrypt_decrypt( + MCRYPT_RIJNDAEL_256, TNTOfficiel_PasswordManager::$salt, base64_decode($password), MCRYPT_MODE_ECB, + mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND) + )); + + return $decryptedPwd; + } + + /** + * get a sha1 hash of the password + * @return string + */ + public static function getHash() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $hashedPwd = sha1(TNTOfficiel_PasswordManager::decrypt(Configuration::get('TNT_CARRIER_PASSWORD'))); + + return $hashedPwd; + } + +} diff --git a/www/modules/tntofficiel/libraries/TNTOfficiel_Product.php b/www/modules/tntofficiel/libraries/TNTOfficiel_Product.php new file mode 100644 index 00000000..3f17f42b --- /dev/null +++ b/www/modules/tntofficiel/libraries/TNTOfficiel_Product.php @@ -0,0 +1,50 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_DbUtils.php'; + +class TNTOfficiel_Product +{ + /** + * Get the configured attributes for a product. + * + * @param int $productId + * + * @return array + */ + public static function getProductAttributes($productId) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + //configured attributes + $tntCarrierAssociations = Configuration::get('TNT_CARRIER_ASSOCIATIONS'); + $attributesNames = array(); + if (!empty($tntCarrierAssociations)) { + $attributesNames = explode(',', $tntCarrierAssociations); + } + + //columns from the product table + $productColumns = TNTOfficiel_DbUtils::getColumnsFromTable('product'); + $attributes = array(); + $attribute = array(); + //product + $product = Db::getInstance()->getRow('SELECT * FROM '._DB_PREFIX_.'product WHERE id_product = '.(int)$productId); + + foreach ($attributesNames as $attributeName) { + if (in_array($attributeName, $productColumns)) { + $attribute['code'] = $attributeName; + $attribute['value'] = $product[$attributeName]; + $attributes[] = $attribute; + } + } + + return $attributes; + } +} diff --git a/www/modules/tntofficiel/libraries/TNTOfficiel_ServiceCache.php b/www/modules/tntofficiel/libraries/TNTOfficiel_ServiceCache.php new file mode 100644 index 00000000..09f2ed58 --- /dev/null +++ b/www/modules/tntofficiel/libraries/TNTOfficiel_ServiceCache.php @@ -0,0 +1,30 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; + + +class TNTOfficiel_ServiceCache +{ + /** + * Gets the number of seconds between the current time and next midnight + * @return int + */ + public static function getSecondsUntilMidnight() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $now = time(); + $midnight = strtotime('tomorrow midnight'); + $secondsUntilMidnight = $midnight - $now; + + return $secondsUntilMidnight; + } + +} diff --git a/www/modules/tntofficiel/libraries/TNTOfficiel_SoapClient.php b/www/modules/tntofficiel/libraries/TNTOfficiel_SoapClient.php new file mode 100644 index 00000000..94b4e8a1 --- /dev/null +++ b/www/modules/tntofficiel/libraries/TNTOfficiel_SoapClient.php @@ -0,0 +1,115 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +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/TNTOfficiel_Logger.php'; + +class TNTOfficiel_SoapClient +{ + protected $_username; + protected $_password; + protected $_account; + protected $_wsdl; + private $logger; + + /** + * Constructor : Set Data + */ + public function __construct() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->_username = Configuration::get('TNT_CARRIER_USERNAME'); + $this->_password = TNTOfficiel_PasswordManager::decrypt(Configuration::get('TNT_CARRIER_PASSWORD')); + $this->_account = Configuration::get('TNT_CARRIER_ACCOUNT'); + $this->_wsdl = Configuration::get('TNT_CARRIER_SOAP_WSDL'); + + $this->logger = new TNTOfficiel_Logger(); + } + + /** + * @param $reference + * @return bool|array + */ + public function trackingByConsignment($reference) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + try { + $client = $this->createClient(); + $response = $client->trackingByConsignment(array('parcelNumber' => $reference)); + $this->logger->logMessageTnt('trackingByConsignment', null, 'JSON', true, 'SUCCESS'); + } catch (Exception $objException) { + $strStatus = ($objException->getCode() == 500) ? 'FATAL' : 'ERROR'; + $strMsg = $objException->getMessage(); + $this->logger->logMessageTnt('trackingByConsignment', $strMsg, 'JSON', false, $strStatus); + return false; + } + + return $response; + } + + /** + * Return an instance of SoapHeader for WS Security + * + * @param string $login + * @param string $password + * + * @return \SoapHeader + */ + public function getSecurityHeader($login, $password) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $authHeader = sprintf( + $this->getSecurityHeaderTemplate(), htmlspecialchars($login), htmlspecialchars($password) + ); + + return $authHeader; + } + + /** + * Return template for WS Security header + * + * @return string + */ + protected function getSecurityHeaderTemplate() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + return ' + + %s + %s + + '; + } + + /** + * Return a new instance of SoapClient + * + * @return \SoapClient + */ + public function createClient() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $client = new SoapClient($this->_wsdl, array( + 'soap_version' => SOAP_1_1, + 'trace' => 1, + )); + $authvars = new SoapVar($this->getSecurityHeader($this->_username, $this->_password), XSD_ANYXML); + $soapHeaders = new SoapHeader("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Security", $authvars); + $client->__setSOAPHeaders($soapHeaders); + + return $client; + } + +} diff --git a/www/modules/tntofficiel/libraries/TNTOfficiel_SysCheck.php b/www/modules/tntofficiel/libraries/TNTOfficiel_SysCheck.php new file mode 100644 index 00000000..cf000ca4 --- /dev/null +++ b/www/modules/tntofficiel/libraries/TNTOfficiel_SysCheck.php @@ -0,0 +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_PasswordManager.php'; + +class TNTOfficiel_SysCheck +{ + public static function getPHPConfig() + { + $arrUser = posix_getpwuid(posix_geteuid()); + + $arrEnv = array( + 'http_proxy' => getenv('http_proxy'), + 'https_proxy' => getenv('https_proxy'), + 'ftp_proxy' => getenv('ftp_proxy') + ); + + $arrPHPConstants = array( + 'PHP_OS' => PHP_OS, + 'PHP_VERSION' => PHP_VERSION, + 'PHP_SAPI' => PHP_SAPI, + 'PHP_INT_SIZE (bits)' => PHP_INT_SIZE * 8 + ); + + $arrPHPExtensions = array_intersect_key(array_flip(get_loaded_extensions()), array( + 'curl' => true, + 'session' => true, + 'mcrypt' => true, + 'mhash' => true, + 'mbstring' => true, + 'iconv' => true, + 'zip' => true, + 'zlib' => true, + 'dom' => true, + 'xml' => true, + 'SimpleXML' => true, + 'Zend OPcache' => true, + 'ionCube Loader' => true + )); + + $arrPHPConfiguration = array_intersect_key(ini_get_all(null, false), array( + // php + 'magic_quotes' => 'Off', + 'magic_quotes_gpc' => 'Off', + 'max_input_vars' => '8192', + // core - file uploads + 'upload_max_filesize' => '4M', + // core - language options + 'disable_functions' => '', + 'disable_classes' => '', + // core - paths and directories + 'open_basedir' => '', + // core - data handling + 'register_globals' => 'Off', + // safe mode + 'safe_mode' => '', + 'safe_mode_gid' => '', + 'safe_mode_exec_dir' => '', + 'safe_mode_include_dir' => '', + // filesystem + 'allow_url_fopen' => 'On', + 'allow_url_include' => 'Off', + 'default_socket_timeout' => '60', + // opcache + 'opcache.enable' => 'true' + )); + + if (array_key_exists('open_basedir', $arrPHPConfiguration)) { + $arrPHPConfiguration['open_basedir'] = explode(PATH_SEPARATOR, $arrPHPConfiguration['open_basedir']); + } + + return array( + 'user' => $arrUser, + 'env' => $arrEnv, + 'constants' => $arrPHPConstants, + 'extensions' => $arrPHPExtensions, + 'configuration' => $arrPHPConfiguration + ); + } + + public static function getPSConfig() + { + //$__constants = get_defined_constants(true); + $arrPSConstant = array( + '_PS_VERSION_' => _PS_VERSION_, + '_PS_JQUERY_VERSION_' => _PS_JQUERY_VERSION_, + + '_PS_MODE_DEV_' => _PS_MODE_DEV_, + '_PS_DEBUG_PROFILING_' => _PS_DEBUG_PROFILING_, + + '_PS_MAGIC_QUOTES_GPC_' => _PS_MAGIC_QUOTES_GPC_, + '_PS_USE_SQL_SLAVE_' => _PS_USE_SQL_SLAVE_, + + '_PS_CACHE_ENABLED_' => _PS_CACHE_ENABLED_, + '_PS_CACHING_SYSTEM_' => _PS_CACHING_SYSTEM_, + + '_PS_DEFAULT_THEME_NAME_' => _PS_DEFAULT_THEME_NAME_, + '_PS_THEME_DIR_' => _PS_THEME_DIR_, + '_PS_THEME_OVERRIDE_DIR_' => _PS_THEME_OVERRIDE_DIR_, + '_PS_THEME_MOBILE_DIR_' => _PS_THEME_MOBILE_DIR_, + '_PS_THEME_MOBILE_OVERRIDE_DIR_' => _PS_THEME_MOBILE_OVERRIDE_DIR_, + '_PS_THEME_TOUCHPAD_DIR_' => _PS_THEME_MOBILE_OVERRIDE_DIR_ + ); + + $arrPSConfig = Configuration::getMultiple(array( + // TNT + 'TNT_CARRIER_ACTIVATED', + 'TNT_CARRIER_ID', + 'TNT_CARRIER_USERNAME', + 'TNT_CARRIER_ACCOUNT', + 'TNT_CARRIER_PASSWORD', + 'TNT_CARRIER_PICKUP_NUMBER_SHOW', + 'TNT_GOOGLE_MAP_API_KEY', + 'TNT_CARRIER_MAX_PACKAGE_B2B', + 'TNT_CARRIER_MAX_PACKAGE_B2C', + 'TNT_CARRIER_ASSOCIATIONS', + 'TNT_CARRIER_MIDDLEWARE_URL', + 'TNT_CARRIER_MIDDLEWARE_SHORT_URL', + 'TNT_CARRIER_SOAP_WSDL', + 'TNT_CARRIER_ADDRESS_EMAIL', + 'TNT_CARRIER_ADDRESS_PHONE', + 'TNT_CARRIER_ADDRESS_BUILDING', + 'TNT_CARRIER_ADDRESS_INTERCOM', + 'TNT_CARRIER_ADDRESS_FLOOR', + + 'PS_DISABLE_OVERRIDES', + + 'PS_MULTISHOP_FEATURE_ACTIVE', + 'PS_STOCK_MANAGEMENT', + 'PS_ADVANCED_STOCK_MANAGEMENT', + 'PS_ALLOW_MULTISHIPPING', + 'PS_ORDER_PROCESS_TYPE', + + 'PS_SSL_ENABLED', + 'PS_SSL_ENABLED_EVERYWHERE', + + 'PS_LANG_DEFAULT', + 'PS_SHOP_NAME', + 'PS_SHOP_EMAIL', + 'PS_SHOP_PHONE', + 'PS_DISTANCE_UNIT' + )); + + return array( + 'constants' => $arrPSConstant, + 'configuration' => $arrPSConfig + ); + } + + public static function getShopContext() + { + $flagShopContext = Shop::getContext(); + $arrConstShopContext = array(); + + if ($flagShopContext & Shop::CONTEXT_SHOP) { + $arrConstShopContext[] = 'Shop::CONTEXT_SHOP'; + } + if ($flagShopContext & Shop::CONTEXT_GROUP) { + $arrConstShopContext[] = 'Shop::CONTEXT_GROUP'; + } + if ($flagShopContext & Shop::CONTEXT_ALL) { + $arrConstShopContext[] = 'Shop::CONTEXT_ALL'; + } + + return array( + 'Context::getContext()->shop' => Context::getContext()->shop, + 'Shop::getContext()' => $arrConstShopContext, + 'Shop::isFeatureActive()' => Shop::isFeatureActive(), + 'Shop::getContextShopGroupID(true)' => Shop::getContextShopGroupID(true), + 'Shop::getContextShopID(true)' => Shop::getContextShopID(true) + ); + } + + public static function getModule() + { + $objModule = Module::getInstanceByName(TNTOfficiel::MODULE_NAME); + + return array( + 'Module::isInstalled()' => Module::isInstalled(TNTOfficiel::MODULE_NAME), + 'Module::isEnabled()' => Module::isEnabled(TNTOfficiel::MODULE_NAME), + 'Module::isModuleTrusted()' => Module::isModuleTrusted(TNTOfficiel::MODULE_NAME), + 'Module::getInstanceByName()' => $objModule, + '$objModule->isEnabledForShopContext()' => $objModule->isEnabledForShopContext() + //'$objModule->getPossibleHooksList()' => $objModule->getPossibleHooksList() + ); + } + + public static function getAccount() + { + return array( + 'MyTNTLogin' => (Configuration::get('TNT_CARRIER_USERNAME')), + 'TNTAccount' => (Configuration::get('TNT_CARRIER_ACCOUNT')) + //'MyTNTPassword' => TNTOfficiel_PasswordManager::decrypt(Configuration::get('TNT_CARRIER_PASSWORD')) + ); + } + + public static function cURLRequest($strURL, $arrOptions = null) + { + $arrcURL = array( + 'options' => array( + //CURLOPT_URL => $strURL, + CURLOPT_SSL_VERIFYHOST => false, + //CURLOPT_SSL_VERIFYPEER => false, + CURLOPT_COOKIESESSION => true, + // follow redirect. + CURLOPT_FOLLOWLOCATION => true, + // max redirection. + CURLOPT_MAXREDIRS => 10, + // return response with curl_exec (no direct output). + CURLOPT_RETURNTRANSFER => true, + // include response header? + //CURLOPT_HEADER => false, + // include request header? + //CURLINFO_HEADER_OUT => false, + // timeout for connection to the server. + CURLOPT_CONNECTTIMEOUT => 3, + // timout global. + CURLOPT_TIMEOUT => 5 + ) + ); + + //CURLOPT_PROXY => $strProxy + //CURLOPT_PROXYUSERPWD => 'user:password', + //CURLOPT_PROXYAUTH => 1, + //CURLOPT_PROXYPORT => 80, + //CURLOPT_PROXYTYPE => CURLPROXY_HTTP, + + + if (is_array($arrOptions)) { + $arrcURL['options'] += $arrOptions; + } + + $hdleCURL = curl_init(); + + foreach($arrcURL['options'] as $k => $o) { + curl_setopt($hdleCURL, $k, $o); + } + curl_setopt($hdleCURL, CURLOPT_URL, $strURL); + + + $arrcURL['response'] = curl_exec($hdleCURL); + //CURLINFO_HEADER_OUT + $arrcURL['info'] = curl_getinfo($hdleCURL); + + curl_close($hdleCURL); + + return $arrcURL; + } +} diff --git a/www/modules/tntofficiel/libraries/exceptions/TNTOfficiel_MaxPackageWeightException.php b/www/modules/tntofficiel/libraries/exceptions/TNTOfficiel_MaxPackageWeightException.php new file mode 100644 index 00000000..c26a46e7 --- /dev/null +++ b/www/modules/tntofficiel/libraries/exceptions/TNTOfficiel_MaxPackageWeightException.php @@ -0,0 +1,12 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +class TNTOfficiel_MaxPackageWeightException extends Exception +{ +} diff --git a/www/modules/tntofficiel/libraries/exceptions/TNTOfficiel_OrderAlreadyShippedException.php b/www/modules/tntofficiel/libraries/exceptions/TNTOfficiel_OrderAlreadyShippedException.php new file mode 100644 index 00000000..c9411e06 --- /dev/null +++ b/www/modules/tntofficiel/libraries/exceptions/TNTOfficiel_OrderAlreadyShippedException.php @@ -0,0 +1,12 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +class TNTOfficiel_OrderAlreadyShippedException extends Exception +{ +} diff --git a/www/modules/tntofficiel/libraries/exceptions/index.php b/www/modules/tntofficiel/libraries/exceptions/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/libraries/exceptions/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/libraries/helper/TNTOfficiel_AddressHelper.php b/www/modules/tntofficiel/libraries/helper/TNTOfficiel_AddressHelper.php new file mode 100644 index 00000000..34965e35 --- /dev/null +++ b/www/modules/tntofficiel/libraries/helper/TNTOfficiel_AddressHelper.php @@ -0,0 +1,224 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Logger.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_ServiceCache.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_JsonRPCClient.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_PasswordManager.php'; + +class TNTOfficiel_AddressHelper +{ + /** + * @var Singleton + */ + private static $_instance = null; + + /** + * @var TNTOfficiel_Logger + */ + private $logger; + + /** + * Constructor. + */ + public function __construct() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->logger = new TNTOfficiel_Logger(); + } + + /** + * Creates a singleton. + * + * @param void + * + * @return TNTOfficiel_AddressHelper + */ + public static function getInstance() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + if (is_null(TNTOfficiel_AddressHelper::$_instance)) { + TNTOfficiel_AddressHelper::$_instance = new TNTOfficiel_AddressHelper(); + } + + return TNTOfficiel_AddressHelper::$_instance; + } + + /** + * Get cities from the middleware for the given CP + * Store the result in cache until midnight. + * + * @param string $postcode the postal code + * @param int $idShop the shop id + * + * @return array + */ + public function getCitiesFromMiddleware($postcode, $idShop) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $objCache = Cache::getInstance(); + // get params without timestamp + $params = $this->_getCitiesParams($postcode, $idShop); + $cache_key = 'middleware::getCities_'.md5(serialize($params)); + //check if already in cache + if (!$objCache->exists($cache_key)) { + $client = new TNTOfficiel_JsonRPCClient(Configuration::get('TNT_CARRIER_MIDDLEWARE_URL')); + try { + $cities = $client->execute('getCities', $params); + $this->logger->logMessageTnt('getCities', null, 'JSON', true, 'SUCCESS'); + } catch (Exception $objException) { + $strStatus = ($objException->getCode() == 500) ? 'FATAL' : 'ERROR'; + $strMsg = $objException->getMessage(); + $this->logger->logMessageTnt('getCities', $strMsg, 'JSON', false, $strStatus); + return false; + } + //add in cache until midnight + $objCache->set($cache_key, Tools::jsonEncode($cities), TNTOfficiel_ServiceCache::getSecondsUntilMidnight()); + + return $cities; + } + $cities = Tools::jsonDecode($objCache->get($cache_key), true); + + return $cities; + } + + /** + * Get the data needed by the middleware. + * + * @param string $postcode the postal code + * @param int $idShop the shop id + * + * @return array + */ + private function _getCitiesParams($postcode, $idShop) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $data = array( + 'store' => $idShop, + 'merchant' => array( + 'identity' => Configuration::get('TNT_CARRIER_USERNAME'), + 'password' => TNTOfficiel_PasswordManager::getHash(), + 'merchant_number' => Configuration::get('TNT_CARRIER_ACCOUNT'), + ), + 'postcode' => $postcode, + ); + + return $data; + } + + /** + * ask the middleware to check if the city match the postcode. + * + * @param $postcode + * @param $city + * @param $idShop + * + * @return mixed + */ + public function checkPostcodeCityFromMiddleware($postcode, $city, $idShop) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $objCache = Cache::getInstance(); + // get params without timestamp + $params = $this->_getTestCityParams($postcode, $city, $idShop); + $cache_key = 'middleware::testCity_'.md5(serialize($params)); + //check if already in cache + if (!$objCache->exists($cache_key)) { + $client = new TNTOfficiel_JsonRPCClient(Configuration::get('TNT_CARRIER_MIDDLEWARE_URL')); + try { + $result = $client->execute('testCity', $params); + $this->logger->logMessageTnt('testCity', null, 'JSON', true, 'SUCCESS'); + } catch (Exception $objException) { + $strStatus = ($objException->getCode() == 500) ? 'FATAL' : 'ERROR'; + $strMsg = $objException->getMessage(); + $this->logger->logMessageTnt('testCity', $strMsg, 'JSON', false, $strStatus); + return false; + } + //add in cache until midnight + $objCache->set($cache_key, Tools::jsonEncode($result), TNTOfficiel_ServiceCache::getSecondsUntilMidnight()); + + return $result; + } + $result = Tools::jsonDecode($objCache->get($cache_key), true); + + return $result; + } + + public function getAddressData($addressId, $cartId) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $strSQL = ' +SELECT a.*, tc.* +FROM '._DB_PREFIX_.'orders o +INNER JOIN '._DB_PREFIX_.'address a on a.id_address = o.id_address_delivery +INNER JOIN '._DB_PREFIX_.'tntofficiel_cart tc on tc.id_cart = o.id_cart +WHERE a.id_address = '.(int)$addressId.' and tc.id_cart = '.(int)$cartId; + + $result = Db::getInstance()->getRow($strSQL, false); + if (!$result || count($result) == 0) { + throw new Exception('No address was found for the address '.$addressId.' - '.$cartId); + } + + return $result; + } + + /** + * Get the data needed by the middleware to check the city/postcode. + * + * @param $postcode + * @param $city + * @param $idShop + * + * @return array + */ + private function _getTestCityParams($postcode, $city, $idShop) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $data = $this->_getCitiesParams($postcode, $idShop); + $data['city'] = $city; + + return $data; + } + + /** + * Check the postcode/city validity for a cart. + * + * @param $cart + * + * @return bool + */ + public function checkPostCodeCityForCart($cart) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $deliveryAddress = new Address($cart->id_address_delivery); + $countryIsoCode = Country::getIsoById($deliveryAddress->id_country); + $idShop = (int) Context::getContext()->shop->id; + //do not check if the address is not in france + if ($countryIsoCode == 'FR') { + $result = $this->checkPostcodeCityFromMiddleware( + $deliveryAddress->postcode, + $deliveryAddress->city, + $idShop + ); + + return $result['response']; + } + + return true; + } +} diff --git a/www/modules/tntofficiel/libraries/helper/TNTOfficiel_CarrierHelper.php b/www/modules/tntofficiel/libraries/helper/TNTOfficiel_CarrierHelper.php new file mode 100644 index 00000000..df1fc956 --- /dev/null +++ b/www/modules/tntofficiel/libraries/helper/TNTOfficiel_CarrierHelper.php @@ -0,0 +1,284 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Cache.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Product.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Logger.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_JsonRPCClient.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_PasswordManager.php'; + +class TNTOfficiel_CarrierHelper +{ + /** @var Singleton */ + private static $_instance = null; + + /** @var TNTOfficiel_Logger */ + private $logger; + + /** + * Constructor. + */ + public function __construct() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->logger = new TNTOfficiel_Logger(); + } + + /** + * Creates a singleton. + * + * @param void + * + * @return TNTOfficiel_CarrierHelper + */ + public static function getInstance() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + if (is_null(TNTOfficiel_CarrierHelper::$_instance)) { + TNTOfficiel_CarrierHelper::$_instance = new TNTOfficiel_CarrierHelper(); + } + + return TNTOfficiel_CarrierHelper::$_instance; + } + + /** + * Get the carriers from the middleware or from cache. + * + * @return array + */ + public function getMDWTNTCarrierList($objArgCustomer) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $objContext = Context::getContext(); + $objCart = $objContext->cart; + + $arrTNTCarrierList = array(); + + // Validated account is required. + if (!Configuration::get('TNT_CARRIER_ACTIVATED')) { + return $arrTNTCarrierList; + } + + // A shipping address is required. + if ($objCart->id_address_delivery == 0) { + return $arrTNTCarrierList; + } + + // get params without timestamp + $params = $this->_getCartData($objArgCustomer); + + $maxPackageWeightBtoB = (float)Configuration::get('TNT_CARRIER_MAX_PACKAGE_B2B'); + $maxPackageWeightBtoC = (float)Configuration::get('TNT_CARRIER_MAX_PACKAGE_B2C'); + + $onlyBtoBServices = false; + foreach ($params['quote']['items'] as $item) { + if ($item['weight'] > $maxPackageWeightBtoB) { + return; + } + if ($item['weight'] > $maxPackageWeightBtoC) { + $onlyBtoBServices = true; + } + } + + $cache_key = 'middleware::getCarrierData_'.md5(serialize($params)); + + //check if already in cache + if (!TNTOfficiel_Cache::isStored($cache_key)) { + $client = new TNTOfficiel_JsonRPCClient(Configuration::get('TNT_CARRIER_MIDDLEWARE_URL')); + $arrTNTCarrierList = null; + try { + $arrTNTCarrierList = $client->execute('getCarrierQuote', $params); + $this->logger->logMessageTnt('getCarrierQuote', null, 'JSON', true, 'SUCCESS'); + } catch (Exception $objException) { + $strStatus = ($objException->getCode() == 500) ? 'FATAL' : 'ERROR'; + $strMsg = $objException->getMessage(); + $this->logger->logMessageTnt('getCarrierQuote', $strMsg, 'JSON', false, $strStatus); + } + + if (!is_array($arrTNTCarrierList) || !array_key_exists('products', $arrTNTCarrierList)) { + return; + } + + $arrServiceEnable = array('ENTERPRISE', 'DEPOT'); + foreach ($arrTNTCarrierList['products'] as $key => $product) { + if ($onlyBtoBServices && !in_array($product['type'], $arrServiceEnable)) { + unset($arrTNTCarrierList['products'][$key]); + if (array_key_exists('relay_points', $arrTNTCarrierList)) { + unset($arrTNTCarrierList['relay_points']); + } + continue; + } + $arrTNTCarrierList['products'][$key]['id'] = $product['code'].'_'.$product['type']; + + $arrTNTCarrierList['products'][$key]['due_date'] = null; + if ($product['due_date']) { + $arrTNTCarrierList['products'][$key]['due_date'] = date('d/m/Y', strtotime($product['due_date'])); + } + } + + // add in cache for 600 seconds + TNTOfficiel_Cache::store($cache_key, Tools::jsonEncode($arrTNTCarrierList), 600); + + return $arrTNTCarrierList; + } + $arrTNTCarrierList = Tools::jsonDecode(TNTOfficiel_Cache::retrieve($cache_key), true); + + return $arrTNTCarrierList; + } + + /** + * Get all the data needed by the middleware from the cart. + * + * @return array + */ + private function _getCartData($objCustomer) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $objContext = Context::getContext(); + $objCart = $objContext->cart; + + //get the checkout step if in checkout else set it to 0 + $step = 0; + if (property_exists($objContext->controller, 'step')) { + $step = $objContext->controller->step; + } + + //check if user is logged in + $loggedIn = $objContext->controller->auth; + + //shipping address + $shippingAddress = new Address((int)$objCart->id_address_delivery); + + //total discount + $totalDiscount = 0; + + //items + $items = array(); + foreach ($objCart->getProducts() as $product) { + //reduction amount + $totalDiscount += $discount = Product::getPriceStatic($product['id_product'], false, $product['id_product_attribute'], 6, null, true); + + $attributes = TNTOfficiel_Product::getProductAttributes($product['id_product']); + $items[] = array( + 'qty' => $product['cart_quantity'], + 'price' => $product['price'] + $discount, + 'row_total' => $product['price_wt'] * $product['cart_quantity'], + 'tax' => $product['cart_quantity'] * $product['price'] * $product['rate'] / 100, + 'discount' => $discount, + 'attributes' => $attributes, + 'options' => (isset($product['attributes'])) ? $this->_attributesToArray($product['attributes']) : '', + 'weight' => $product['weight'], + ); + } + + $data = array( + 'store' => $objCart->id_shop, + 'context' => ($step == 2) ? 'CHECKOUT' : 'QUOTE', + 'merchant' => array( + 'identity' => Configuration::get('TNT_CARRIER_USERNAME'), + 'password' => TNTOfficiel_PasswordManager::getHash(), + 'merchant_number' => Configuration::get('TNT_CARRIER_ACCOUNT'), + ), + 'customer' => array( + 'name' => ($loggedIn == true) ? $objCustomer->firstname.' '.$objCustomer->lastname : null, + 'email' => ($loggedIn == true) ? $objCustomer->email : '', + 'group_id' => ($loggedIn == true) ? Customer::getDefaultGroupId((int)$objCustomer->id) : null, + 'dob' => ($loggedIn == true) ? Customer::getDefaultGroupId((int)$objCustomer->birthday) : null, + 'name' => $shippingAddress->company, + ), + 'shipping' => array( + 'country_code' => Country::getIsoById($shippingAddress->id_country), + 'region_code' => Tools::substr($shippingAddress->postcode, 0, 2), + 'post_code' => $shippingAddress->postcode, + 'city' => $shippingAddress->city, + ), + 'quote' => array( + 'items' => $items, + 'subtotal' => $objCart->getOrderTotal(false, Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING), + 'tax' => $objCart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING) + - $objCart->getOrderTotal(false, Cart::BOTH_WITHOUT_SHIPPING), + 'discount' => -($objCart->getOrderTotal(false, Cart::BOTH_WITHOUT_SHIPPING) + - $objCart->getOrderTotal(false, Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING)), + 'coupon_code' => $this->_getDiscountCodes($objCart), + 'freeshipping' => '', + ), + ); + + return $data; + } + + /** + * Transform a string containing attributes data into an array. + * + * @param string $attributes + * + * @return array + */ + private function _attributesToArray($attributes) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $attributesArray = array(); + $attributesTemp = explode(',', preg_replace('/\s+/', '', $attributes)); + foreach ($attributesTemp as $attribute) { + $temp = array(); + $attributeArray = explode(':', $attribute); + $temp['code'] = $attributeArray[0]; + $temp['value'] = $attributeArray[1]; + $attributesArray[] = $temp; + } + + return $attributesArray; + } + + /** + * Gets all the cart discount codes separated by '|'. + * Note: using Cart->getDiscounts() may cause infinite loop through Module->getOrderShippingCost(). + * Note: Cart->getOrderedCartRulesIds() unavailable in Prestashop 1.6.0.5. + * + * @param CartCore $objArgCart + * + * @return string + */ + private function _getDiscountCodes($objArgCart) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $strKeyCache = 'TNTOfficiel_CarrierHelper::_getDiscountCodes'.$objArgCart->id.'-ids'; + if (!Cache::isStored($strKeyCache)) { + $arrCartRulesIdList = Db::getInstance()->executeS(' + SELECT cr.`id_cart_rule` + FROM `'._DB_PREFIX_.'cart_cart_rule` cd + LEFT JOIN `'._DB_PREFIX_.'cart_rule` cr ON cd.`id_cart_rule` = cr.`id_cart_rule` + LEFT JOIN `'._DB_PREFIX_.'cart_rule_lang` crl ON ( + cd.`id_cart_rule` = crl.`id_cart_rule` + AND crl.id_lang = '.(int)$objArgCart->id_lang.' + ) + WHERE `id_cart` = '.(int)$objArgCart->id.' + ORDER BY cr.priority ASC + '); + Cache::store($strKeyCache, $arrCartRulesIdList); + } else { + $arrCartRulesIdList = Cache::retrieve($strKeyCache); + } + + $arrDiscountCodes = array(); + foreach ($arrCartRulesIdList as $arrCartRulesRow) { + $objCartRule = new CartRule($arrCartRulesRow['id_cart_rule']); + $arrDiscountCodes[] = $objCartRule->code; + } + + return implode('|', $arrDiscountCodes); + } +} diff --git a/www/modules/tntofficiel/libraries/helper/TNTOfficiel_OrderHelper.php b/www/modules/tntofficiel/libraries/helper/TNTOfficiel_OrderHelper.php new file mode 100644 index 00000000..e8734ba4 --- /dev/null +++ b/www/modules/tntofficiel/libraries/helper/TNTOfficiel_OrderHelper.php @@ -0,0 +1,195 @@ + + * @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/helper/TNTOfficiel_ShipmentHelper.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Logger.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/pdf/TNTOfficiel_PDFMerger.php'; + +class TNTOfficiel_OrderHelper +{ + /** @var TNTOfficiel_OrderHelper */ + private static $_instance = null; + + /** @var TNTOfficiel_Logger */ + private $logger; + + /** + * Constructor. + */ + public function __construct() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->logger = new TNTOfficiel_Logger(); + } + + /** + * Creates a singleton. + * + * @param void + * + * @return TNTOfficiel_OrderHelper + */ + public static function getInstance() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + if (is_null(TNTOfficiel_OrderHelper::$_instance)) { + TNTOfficiel_OrderHelper::$_instance = new TNTOfficiel_OrderHelper(); + } + + return TNTOfficiel_OrderHelper::$_instance; + } + + /** + * Gets the tnt product code for an order. + * + * @param $orderId + * + * @return string + * + * @throws Exception + */ + public function getOrderData($orderId, $stopOnException = true) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $sql = 'SELECT * FROM '._DB_PREFIX_.'tntofficiel_order WHERE id_order = '.(int)$orderId; + $result = Db::getInstance()->getRow($sql, false); + if (!$result && $stopOnException) { + throw new Exception('No tnt product was found for the order '.$orderId); + } + + return $result; + } + + /** + * Revert the order state to its previous state. + * + * @param $orderId + * + * @throws Exception + */ + public function revertState($orderId) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $arrTNTOrder = $this->getOrderData($orderId); + $orderState = new OrderState($arrTNTOrder['previous_state']); + $history = new OrderHistory(); + $history->id_order = (int)$orderId; + $history->changeIdOrderState((int)$orderState, (int)$orderId); + $history->save(); + } + + /** + * Change the order state to the prestashop default shipping state. + * + * @param $orderId + */ + public function validateShippedState($orderId) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $history = new OrderHistory(); + $history->id_order = (int)$orderId; + $history->changeIdOrderState((int)(Configuration::get('PS_OS_SHIPPING')), (int)$orderId); + $history->save(); + } + + /** + * Get all the tnt orders. + * + * @return array + * + * @throws PrestaShopDatabaseException + */ + public function getTntOrders() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $sql = 'SELECT * FROM '._DB_PREFIX_.'orders o '; + $sql .= 'JOIN '._DB_PREFIX_.'tntofficiel_order t ON o.id_order = t.id_order'; + $orders = Db::getInstance()->executeS($sql); + + return $orders; + } + + /** + * Concatenate all the bt for the given orders. + * + * @param $orderList + * + * @return string + * + * @throws Exception + */ + public function getBt($orderList) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $pdf = new TNTOfficiel_PDFMerger(); + $btCounter = 0; + foreach ($orderList as $orderId) { + try { + $arrTNTOrder = $this->getOrderData($orderId, false); + $strBTFilename = $arrTNTOrder['bt_filename']; + if ($strBTFilename && filesize(_PS_MODULE_DIR_.'tnt_media/media/bt/'.$strBTFilename) > 0) { + ++$btCounter; + $pdf->addPDF(_PS_MODULE_DIR_.'tnt_media/media/bt/'.$strBTFilename); + } + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + } + } + if ($btCounter > 0) { + return $pdf->merge('download', 'bt_list.pdf'); + } + } + + /** + * Create a new address and assign it to the order as the deliveray address. + * + * @param $arrProduct + * @param $orderId + */ + public static function createNewAddress($arrProduct, $orderId) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $strRepoType = (array_key_exists('xett', $arrProduct) && isset($arrProduct['xett'])) ? 'xett' : 'pex'; + + $order = new Order($orderId); + $oldAddress = new Address($order->id_address_delivery); + $address = new Address(); + $address->id_country = (int)Context::getContext()->country->id; + $address->id_customer = 0; + $address->id_manufacturer = 0; + $address->id_supplier = 0; + $address->id_warehouse = 0; + $address->alias = TNTOfficiel::MODULE_NAME; + $address->lastname = $oldAddress->lastname; //lastname cannot be empty + $address->firstname = $oldAddress->firstname; //firstname cannot be empty + $address->company = sprintf('%s - %s', $arrProduct[ $strRepoType ], $arrProduct['name']); + $address->address1 = ($strRepoType === 'xett') ? $arrProduct['address'] : $arrProduct['address1']; + $address->address2 = ($strRepoType === 'xett') ? '' : $arrProduct['address2']; + $address->city = $arrProduct['city']; + $address->postcode = $arrProduct['postcode']; + $address->save(); + //assign the new delivery address to the order + $order->id_address_delivery = (int)$address->id; + $order->save(); + //Db::getInstance()->update('orders', array('id_address_delivery' => $address->id), 'id_order = '.(int) $orderId); + } + +} diff --git a/www/modules/tntofficiel/libraries/helper/TNTOfficiel_ParcelsHelper.php b/www/modules/tntofficiel/libraries/helper/TNTOfficiel_ParcelsHelper.php new file mode 100644 index 00000000..46d084f7 --- /dev/null +++ b/www/modules/tntofficiel/libraries/helper/TNTOfficiel_ParcelsHelper.php @@ -0,0 +1,492 @@ + + * @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/classes/TNTOfficielCart.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Parcel.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_SoapClient.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_OrderHelper.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/exceptions/TNTOfficiel_MaxPackageWeightException.php'; + +class TNTOfficiel_ParcelsHelper +{ + /** @var TNTOfficiel_ParcelsHelper */ + private static $_instance = null; + + /** + * Constructor. + */ + public function __construct() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + } + + /** + * Creates a singleton. + * + * @param void + * + * @return TNTOfficiel_ParcelsHelper + */ + public static function getInstance() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + if (is_null(TNTOfficiel_ParcelsHelper::$_instance)) { + TNTOfficiel_ParcelsHelper::$_instance = new TNTOfficiel_ParcelsHelper(); + } + + return TNTOfficiel_ParcelsHelper::$_instance; + } + + /** + * Creates the parcels for an order. + * + * @param $objCart + * @param $intArgOrderID + * + * @return bool + */ + public function createParcels($objCart, $intArgOrderID) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $orderedProducts = $this->_getProductsOrderedByWeight($objCart->getProducts()); + $fltMaxParcelWeight = $this->_getMaxPackageWeight($intArgOrderID); + $parcels = array(); + $parcel = new TNTOfficiel_Parcel(); + foreach ($orderedProducts as $product) { + $productQuantity = $product['quantity']; + for ($i = 0; $i < $productQuantity; ++$i) { + //check if parcel's weight exceeds the maximum parcel weight + //and remove the last added product in the parcel if it's not the only product in it + if (($parcel->getWeight() + $product['weight']) <= $fltMaxParcelWeight) { + $parcel->addProduct($product); + } else { + $parcels[] = $parcel; + $parcel = new TNTOfficiel_Parcel(); + $parcel->addProduct($product); + } + } + } + //if the parcels contains at least one product we add it to the list + if (count($parcel->getProductList())) { + $parcels[] = $parcel; + } + + //save the parcels + $this->_saveParcels($parcels, $intArgOrderID); + + return true; + } + + /** + * Order a list of products by weight. + * + * @param $products + * + * @return array + */ + private function _getProductsOrderedByWeight($products) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + usort($products, array(__CLASS__, 'compareProductByWeight')); + + return $products; + } + + /** + * Compare two products by their weight. + * + * @param $productA + * @param $productB + * + * @return int + */ + public static function compareProductByWeight($productA, $productB) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + if ($productA['weight'] == $productB['weight']) { + return 0; + } + + return ($productA['weight'] < $productB['weight']) ? -1 : 1; + } + + /** + * Save the parcels in the database. + * + * @param $parcels array + * @param $orderId int + */ + private function _saveParcels($parcels, $orderId) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + foreach ($parcels as $parcel) { + //insert into the parcel table + $this->addParcel($orderId, $parcel->getWeight(), true); + } + } + + /** + * Get the parcels of an order. + * + * @param $orderId int + * + * @return array + */ + public function getParcels($orderId) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $sql = 'SELECT * FROM '._DB_PREFIX_.'tntofficiel_order_parcels WHERE id_order ='.(int)$orderId; + $parcels = Db::getInstance()->executeS($sql); + + return $parcels; + } + + /** + * Remove a parcel. + * + * @param $parcelId int + * + * @return bool + */ + public function removeParcel($parcelId) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + return Db::getInstance()->delete('tntofficiel_order_parcels', 'id_parcel = '.(int)$parcelId); + } + + /** + * Add a parcel. + * + * @param $intArgOrderID int + * @param $fltArgWeight float + * @param $isOrderCreation + * + * @return array + * + * @throws TNTOfficiel_MaxPackageWeightException + */ + public function addParcel($intArgOrderID, $fltArgWeight, $isOrderCreation = true) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $fltMaxPackageWeight = $this->_getMaxPackageWeight($intArgOrderID); + //Does not throw an exception when this is an order creation + //the parcel can contains one product which weight exceeds the maximum weight + if ((float)$fltArgWeight > $fltMaxPackageWeight && !$isOrderCreation) { + throw new TNTOfficiel_MaxPackageWeightException('Le poids d\'un colis ne peut dépasser '.$fltMaxPackageWeight.'Kg'); + } + + Db::getInstance()->insert('tntofficiel_order_parcels', array( + 'id_order' => (int)$intArgOrderID, + 'weight' => max(round((float)$fltArgWeight, 1, PHP_ROUND_HALF_UP), 0.1), + )); + $sql = 'SELECT * FROM '._DB_PREFIX_.'tntofficiel_order_parcels WHERE id_parcel ='.Db::getInstance()->Insert_ID(); + + return Db::getInstance()->executeS($sql); + } + + /** + * Update a parcel. + * + * @param $parcelId int + * @param $weight float + * @param $intArgOrderID int + * + * @return bool + * + * @throws TNTOfficiel_MaxPackageWeightException + */ + public function updateParcel($parcelId, $weight, $intArgOrderID) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $fltMaxPackageWeight = $this->_getMaxPackageWeight($intArgOrderID); + if ((float)$weight > $fltMaxPackageWeight) { + throw new TNTOfficiel_MaxPackageWeightException('Le poids d\'un colis ne peut dépasser '.$fltMaxPackageWeight.'Kg'); + } + $weight = max(round($weight, 1, PHP_ROUND_HALF_UP), 0.1); + $result = array(); + $result['result'] = Db::getInstance()->update( + 'tntofficiel_order_parcels', + array('weight' => (float)$weight), + 'id_parcel = '.(int)$parcelId + ); + $result['weight'] = $weight; + + return $result; + } + + /** + * @param $parcel array + * + * @return array + */ + public function getTrackingData($parcel) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $response = $this->_callTntWs($parcel['parcel_number']); + + $response = (array)$response; + $returnData = ''; + if (count($response) && isset($response['Parcel'])) { + $returnData = $response['Parcel']; + } + if ($returnData) { + $this->_savePdl($returnData, $parcel['id_parcel']); + $returnData = array( + 'history' => $this->_getHistory($returnData), + 'status' => $this->_getStatus($returnData), + 'allStatus' => $this->_getAllStatus($this->_getStatus($returnData)), + ); + } + + return $returnData; + } + + /** + * Get the maximum package weight for the order. + * + * @param $intArgOrderID + * + * @return float + * + * @throws Exception + */ + private function _getMaxPackageWeight($intArgOrderID) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + try { + $arrTNTOrder = TNTOfficiel_OrderHelper::getInstance()->getOrderData($intArgOrderID); + $strCarrierCode = $arrTNTOrder['carrier_code']; + } catch (Exception $objException) { + + // TODO : Should not happen ! Why using carrier code from cart ?? + + $objContext = Context::getContext(); + $objCart = $objContext->cart; + $intCartID = (int)$objCart->id; + + // Load TNT cart info or create a new one for it's ID. + $objTNTCartModel = TNTOfficielCart::loadCartID($intCartID); + if(Validate::isLoadedObject($objTNTCartModel)) { + $strCarrierCode = $objTNTCartModel->carrier_code; + } + + // throw $objException; + + } + // If carrier code is B2B. + if (strpos($strCarrierCode, 'ENTERPRISE')) { + $fltMaxPackageWeight = (float)Configuration::get('TNT_CARRIER_MAX_PACKAGE_B2B'); + } else { + $fltMaxPackageWeight = (float)Configuration::get('TNT_CARRIER_MAX_PACKAGE_B2C'); + } + + return $fltMaxPackageWeight; + } + + /** + * Call the tnt. + * + * @param $parcelNumber + * + * @return stdClass + */ + private function _callTntWs($parcelNumber) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $client = new TNTOfficiel_SoapClient(); + $result = $client->trackingByConsignment($parcelNumber); + + return $result; + } + + /** + * Return All Status de display : depends on status -> maximum 5 status. + * + * @param $status + * + * @return array + */ + protected function _getAllStatus($status) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $statusArray = array( + 1 => TNTOfficiel_ParcelsHelper::translate('Colis chez l’expéditeur'), + 2 => TNTOfficiel_ParcelsHelper::translate('Ramassage du Colis'), + 3 => TNTOfficiel_ParcelsHelper::translate('Acheminement'), + 4 => TNTOfficiel_ParcelsHelper::translate('Livraison en cours'), + 5 => TNTOfficiel_ParcelsHelper::translate('Livré'), + ); + + switch ($status) { + case 6: + $statusArray[5] = TNTOfficiel_ParcelsHelper::translate('Incident'); + break; + case 7: + $statusArray[5] = TNTOfficiel_ParcelsHelper::translate("Retourné à l'expéditeur"); + break; + } + + return $statusArray; + } + + /** + * @param $parcel + * + * @return bool|int + */ + protected function _getStatus($parcel) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $parcel = (array)$parcel; + $statusLabel = isset($parcel['shortStatus']) ? $parcel['shortStatus'] : false; + if (!$statusLabel) { + return false; + } + + $mapping = array( + TNTOfficiel_ParcelsHelper::translate('En attente') => 1, + '--' => 2, + TNTOfficiel_ParcelsHelper::translate('En cours d\'acheminement') => 3, + TNTOfficiel_ParcelsHelper::translate('En cours de livraison') => 4, + TNTOfficiel_ParcelsHelper::translate('En agence TNT') => 4, + TNTOfficiel_ParcelsHelper::translate('Récupéré à l\'agence TNT') => 5, + TNTOfficiel_ParcelsHelper::translate('Livré') => 5, + TNTOfficiel_ParcelsHelper::translate('En attente de vos instructions') => 6, + TNTOfficiel_ParcelsHelper::translate('En attente d\'instructions') => 6, + TNTOfficiel_ParcelsHelper::translate('En attente d\'instructions') => 6, + TNTOfficiel_ParcelsHelper::translate('Incident de livraison') => 6, + TNTOfficiel_ParcelsHelper::translate('Incident intervention') => 6, + TNTOfficiel_ParcelsHelper::translate('Colis refusé par le destinataire') => 6, + TNTOfficiel_ParcelsHelper::translate('Livraison reprogrammée') => 6, + TNTOfficiel_ParcelsHelper::translate('Prise de rendez-vous en cours') => 6, + TNTOfficiel_ParcelsHelper::translate('Prise de rendez-vous en cours') => 6, + TNTOfficiel_ParcelsHelper::translate('Problème douane') => 6, + TNTOfficiel_ParcelsHelper::translate('Enlevé au dépôt') => 3, + TNTOfficiel_ParcelsHelper::translate('En dépôt restant') => 3, + TNTOfficiel_ParcelsHelper::translate('Retourné à l\'expéditeur') => 7, + ); + + return isset($mapping[$statusLabel]) ? $mapping[$statusLabel] : 1; + } + + /** + * @param $parcel + * + * @return bool + */ + protected function _getHistory($parcel) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + if (!$parcel->events) { + return false; + } + + $history = array(); + $states = array(1 => 'request', 2 => 'process', 3 => 'arrival', 4 => 'deliveryDeparture', 5 => 'delivery'); + $events = (array)$parcel->events; + foreach ($states as $idx => $state) { + if ((isset($events[$state.'Center']) || isset($events[$state.'Date'])) + && Tools::strlen($events[$state.'Date']) + ) { + $history[$idx] = array( + 'label' => $this->_getLabel($state), + 'date' => isset($events[$state.'Date']) ? $events[$state.'Date'] : '', + 'center' => isset($events[$state.'Center']) ? $events[$state.'Center'] : '', + ); + } + } + + return $history; + } + + protected function _getLabel($state) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $labels = array( + 'request' => TNTOfficiel_ParcelsHelper::translate('Colis chez l’expéditeur'), + 'process' => TNTOfficiel_ParcelsHelper::translate('Ramassage du colis'), + 'arrival' => TNTOfficiel_ParcelsHelper::translate('Acheminement du colis'), + 'deliveryDeparture' => TNTOfficiel_ParcelsHelper::translate('Livraison du colis en cours'), + 'delivery' => TNTOfficiel_ParcelsHelper::translate('Livraison du colis'), + ); + + return isset($labels[$state]) ? $labels[$state] : ''; + } + + /** + * Save the PDL. + * + * @param $data + * @param $parcelId + * + * @return bool + */ + protected function _savePdl($data, $parcelId) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $result = false; + $pdl = $this->_getPdl($data); + if ($pdl) { + $result = Db::getInstance()->update('tntofficiel_order_parcels', array('pdl' => pSQL($pdl)), 'id_parcel = '.(int)$parcelId); + } + + return $result; + } + + /** + * Get POD Url from parcel data. + * + * @param $data + * + * @return bool|string + */ + protected function _getPdl($data) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $data = (array)$data; + + return isset($data['primaryPODUrl']) && $data['primaryPODUrl'] ? $data['primaryPODUrl'] : + (isset($data['secondaryPODUrl']) && $data['secondaryPODUrl'] ? $data['secondaryPODUrl'] : false); + } + + /** + * get translation. + * + * @param $string + * + * @return string + */ + public static function translate($string) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // TODO + return Translate::getModuleTranslation(TNTOfficiel::MODULE_NAME, $string, 'parcelshelper'); + } +} diff --git a/www/modules/tntofficiel/libraries/helper/TNTOfficiel_RelayPointsHelper.php b/www/modules/tntofficiel/libraries/helper/TNTOfficiel_RelayPointsHelper.php new file mode 100644 index 00000000..6edbd42e --- /dev/null +++ b/www/modules/tntofficiel/libraries/helper/TNTOfficiel_RelayPointsHelper.php @@ -0,0 +1,178 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Logger.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_JsonRPCClient.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_ServiceCache.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_PasswordManager.php'; + +final class TNTOfficiel_RelayPointsHelper +{ + /** @var Singleton */ + private static $_instance = null; + + /** @var TNTOfficiel_Logger */ + private $objLogger; + + /** + * Constructor. + */ + public function __construct() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->objLogger = new TNTOfficiel_Logger(); + } + + /** + * Creates a singleton. + * + * @param void + * + * @return Singleton + */ + public static function getInstance() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + if (is_null(TNTOfficiel_RelayPointsHelper::$_instance)) { + TNTOfficiel_RelayPointsHelper::$_instance = new TNTOfficiel_RelayPointsHelper(); + } + + return TNTOfficiel_RelayPointsHelper::$_instance; + } + + /** + * Get the relay points for the given postcode/city from the middleware or from the cache. + * + * @param $postcode + * @param $city + * @param $idShop + * + * @return array + */ + public function getRelayPoints($postcode, $city, $idShop) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $objCache = Cache::getInstance(); + + // Get params without timestamp + $arrRequestData = $this->_getParams($postcode, $idShop, $city); + $strCacheKey = 'middleware::getRelayPoints_'.md5(serialize($arrRequestData)); + + // Retrieve from cache if exist. + if ($objCache->exists($strCacheKey)) { + return Tools::jsonDecode($objCache->get($strCacheKey), true); + } + + // JSON RPC Request to Middleware. + $client = new TNTOfficiel_JsonRPCClient(Configuration::get('TNT_CARRIER_MIDDLEWARE_URL')); + try { + $arrResponse = $client->execute('getRelayPoints', $arrRequestData); + $this->objLogger->logMessageTnt('getRelayPoints', null, 'JSON', true, 'SUCCESS'); + } catch (Exception $objException) { + $strStatus = ($objException->getCode() == 500) ? 'FATAL' : 'ERROR'; + $strMsg = $objException->getMessage(); + $this->objLogger->logMessageTnt('getRelayPoints', $strMsg, 'JSON', false, $strStatus); + + return array(); + } + + // If no RelayPoints + if ($arrResponse['relay_points'] === false) { + $arrResponse['relay_points'] = array(); + } + + // Store in cache until midnight. + $objCache->set($strCacheKey, Tools::jsonEncode($arrResponse['relay_points']), TNTOfficiel_ServiceCache::getSecondsUntilMidnight()); + + + return $arrResponse['relay_points']; + } + + /** + * Get the repositories for the given postcode from the middleware or from the cache. + * + * @param $postcode + * @param $idShop + * + * @return array + */ + public function getRepositories($postcode, $idShop) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $objCache = Cache::getInstance(); + + // Get params without timestamp + $arrRequestData = $this->_getParams($postcode, $idShop); + $strCacheKey = 'middleware::getRepositories_'.md5(serialize($arrRequestData)); + + // Retrieve from cache if exist. + if ($objCache->exists($strCacheKey)) { + return Tools::jsonDecode($objCache->get($strCacheKey), true); + } + + // JSON RPC Request to Middleware. + $client = new TNTOfficiel_JsonRPCClient(Configuration::get('TNT_CARRIER_MIDDLEWARE_URL')); + try { + $arrResponse = $client->execute('getRepositories', $arrRequestData); + $this->objLogger->logMessageTnt('getRepositories', null, 'JSON', true, 'SUCCESS'); + } catch (Exception $objException) { + $strStatus = ($objException->getCode() == 500) ? 'FATAL' : 'ERROR'; + $strMsg = $objException->getMessage(); + $this->objLogger->logMessageTnt('getRepository', $strMsg, 'JSON', false, $strStatus); + + return array(); + } + + // If no Repositories. + if ($arrResponse['repositories'] === false) { + $arrResponse['repositories'] = array(); + } + + // Store in cache until midnight. + $objCache->set($strCacheKey, Tools::jsonEncode($arrResponse['repositories']), TNTOfficiel_ServiceCache::getSecondsUntilMidnight()); + + return $arrResponse['repositories']; + } + + /** + * Get the params needed by the middleware. + * + * @param $postcode + * @param $idShop + * @param null $city + * + * @return array + */ + private function _getParams($postcode, $idShop, $city = null) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $arrData = array( + 'store' => $idShop, + 'merchant' => array( + 'identity' => Configuration::get('TNT_CARRIER_USERNAME'), + 'password' => TNTOfficiel_PasswordManager::getHash(), + 'merchant_number' => Configuration::get('TNT_CARRIER_ACCOUNT'), + ), + 'postcode' => $postcode, + 'city' => $city, + ); + //add the city if not null + if ($city != null) { + $arrData['city'] = $city; + } + + return $arrData; + } +} diff --git a/www/modules/tntofficiel/libraries/helper/TNTOfficiel_ShipmentHelper.php b/www/modules/tntofficiel/libraries/helper/TNTOfficiel_ShipmentHelper.php new file mode 100644 index 00000000..5ec95b4c --- /dev/null +++ b/www/modules/tntofficiel/libraries/helper/TNTOfficiel_ShipmentHelper.php @@ -0,0 +1,440 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Logger.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_JsonRPCClient.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_PasswordManager.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_OrderHelper.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_AddressHelper.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_ParcelsHelper.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/exceptions/TNTOfficiel_OrderAlreadyShippedException.php'; + +class TNTOfficiel_ShipmentHelper +{ + /** + * The directory where the BT are stored. + */ + const BT_DIR = 'tnt_media/media/bt'; + + /** @var Singleton */ + private static $_instance = null; + + /** @var TNTOfficiel_Logger */ + private $logger; + + /** + * Constructor. + */ + public function __construct() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->logger = new TNTOfficiel_Logger(); + } + + /** + * Creates a singleton. + * + * @param void + * + * @return TNTOfficiel_ShipmentHelper + */ + public static function getInstance() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + if (is_null(TNTOfficiel_ShipmentHelper::$_instance)) { + TNTOfficiel_ShipmentHelper::$_instance = new TNTOfficiel_ShipmentHelper(); + } + + return TNTOfficiel_ShipmentHelper::$_instance; + } + + /** + * Send a shipment request to the middleware. + * + * @param $cart + * @param $orderId + * + * @return bool + * + * @throws Exception + */ + public function saveShipment($cart, $orderId) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $order = new Order($orderId); + try { + $arrTNTOrder = TNTOfficiel_OrderHelper::getInstance()->getOrderData($orderId); + if ($arrTNTOrder['is_shipped']) { + throw new TNTOfficiel_OrderAlreadyShippedException('The shipment has already been created for the order ' + $orderId); + } + $arrTNTAddress = TNTOfficiel_AddressHelper::getInstance()->getAddressData($order->id_address_delivery, $order->id_cart); + $parcels = TNTOfficiel_ParcelsHelper::getInstance()->getParcels($orderId); + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + throw $objException; + } + + //call the middleware + $arrParams = $this->_getParams( + $cart->id_shop, + $arrTNTOrder, + $arrTNTAddress, + $this->_getParcelsData($parcels, $order->reference), + $arrTNTOrder['shipping_date'] + ); + $response = $this->_callMiddleware($arrParams); + if (is_string($response)) { + throw new PrestaShopException($response); + } + + //save the BT + if ($response) { + $this->_saveBT($response['bt'], $order); + $this->_saveTrackingUrls($response['parcels'], $orderId); + $this->_savePickupNumber($response['pickUpNumber'], $orderId); + } + + return true; + } + + /** + * Check if a shipment was successfully done for an order. + * + * @param $orderId + * + * @return bool + */ + public function isShipmentSaved($orderId) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $sql = 'SELECT * FROM '._DB_PREFIX_.'tntofficiel_order WHERE id_order = '.(int)$orderId; + $arrOrder = Db::getInstance()->getRow($sql, false); + + return (bool)$arrOrder['is_shipped']; + } + + /** + * Get the params. + * + * @param $intArgShopID + * @param $arrArgTNTOrder + * @param $arrArgTNTAddress + * @param $parcelsData + * + * @return array + */ + private function _getParams($intArgShopID, $arrArgTNTOrder, $arrArgTNTAddress, $parcelsData, $shippingDate = false) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $productCode = $arrArgTNTOrder['carrier_code']; + + $typeId = (empty($arrArgTNTOrder['carrier_xett'])) ? $arrArgTNTOrder['carrier_pex'] : $arrArgTNTOrder['carrier_xett']; + $arrParams = array( + 'store' => $intArgShopID, + 'merchant' => array( + 'identity' => Configuration::get('TNT_CARRIER_USERNAME'), + 'password' => TNTOfficiel_PasswordManager::getHash(), + 'merchant_number' => Configuration::get('TNT_CARRIER_ACCOUNT'), + ), + 'product' => $productCode, + 'recipient' => array( + 'xett' => $arrArgTNTOrder['carrier_xett'], + 'pex' => $arrArgTNTOrder['carrier_pex'], + 'firstname' => $arrArgTNTAddress['firstname'], + 'lastname' => $arrArgTNTAddress['lastname'], + 'address1' => Tools::substr($arrArgTNTAddress['address1'], 0, 32), + 'address2' => Tools::substr($arrArgTNTAddress['address2'], 0, 32), + 'post_code' => $arrArgTNTAddress['postcode'], + 'city' => $arrArgTNTAddress['city'], + 'email' => $arrArgTNTAddress['customer_email'], + 'phone' => $arrArgTNTAddress['customer_mobile'], + 'access_code' => $arrArgTNTAddress['address_accesscode'], + 'floor' => $arrArgTNTAddress['address_floor'], + 'building' => $arrArgTNTAddress['address_building'], + 'name' => $arrArgTNTAddress['company'], + 'typeId' => $typeId, + ), + 'parcels' => $parcelsData, + ); + + if ($shippingDate) { + $arrParams['shipping_date'] = $shippingDate; + } + + return $arrParams; + } + + /** + * Get parcels data. + * + * @param $parcels array + * + * @return array + */ + private function _getParcelsData($parcels, $orderReference) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $parcelsData = array(); + foreach ($parcels as $parcel) { + $parcelsData[] = array( + 'reference' => $orderReference, + 'weight' => $parcel['weight'], + ); + } + + return $parcelsData; + } + + /** + * Call the middleware to save the shipment. + * + * @param $params + * + * @return mixed + * + * @throws Exception + */ + private function _callMiddleware($params) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $client = new TNTOfficiel_JsonRPCClient(Configuration::get('TNT_CARRIER_MIDDLEWARE_URL')); + try { + $result = $client->execute('saveShipment', $params); + $this->logger->logMessageTnt('saveShipment', null, 'JSON', true, 'SUCCESS'); + } catch (Exception $objException) { + $strStatus = ($objException->getCode() == 500) ? 'FATAL' : 'ERROR'; + $strMsg = $objException->getMessage(); + $this->logger->logMessageTnt('saveShipment', $strMsg, 'JSON', false, $strStatus); + throw $objException; + } + + return $result; + } + + /** + * Call the middleware to save the shipment. + * + * @param $params + * + * @return mixed + * + * @throws Exception + */ + private function _callMiddlewareWithService($params, $service) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $client = new TNTOfficiel_JsonRPCClient(Configuration::get('TNT_CARRIER_MIDDLEWARE_URL')); + try { + $result = $client->execute($service, $params); + $this->logger->logMessageTnt($service, null, 'JSON', true, 'SUCCESS'); + } catch (Exception $objException) { + $strStatus = ($objException->getCode() == 500) ? 'FATAL' : 'ERROR'; + $strMsg = $objException->getMessage(); + $this->logger->logMessageTnt($service, $strMsg, 'JSON', false, $strStatus); + throw $objException; + } + + return $result; + } + + /** + * Saves the BT in the file system. + * + * @param $strBTContent + * @param $order + * + * @throws Exception + */ + private function _saveBT($strBTContent, $order) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + //creates the directory if not exists + if (!is_dir(_PS_MODULE_DIR_.TNTOfficiel_ShipmentHelper::BT_DIR)) { + mkdir(_PS_MODULE_DIR_.TNTOfficiel_ShipmentHelper::BT_DIR, 0777, true); + } + $date = date('Y-m-d_H-i-s'); + $strBTFilename = sprintf('BT_%s_%s.pdf', $order->reference, $date); + //create the file + try { + file_put_contents(_PS_MODULE_DIR_.TNTOfficiel_ShipmentHelper::BT_DIR.'/'.$strBTFilename, utf8_decode($strBTContent)); + Db::getInstance()->update( + 'tntofficiel_order', + array('bt_filename' => pSQL($strBTFilename), 'is_shipped' => true, 'previous_state' => (int)$order->current_state), + 'id_order = '.(int)$order->id + ); + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + throw $objException; + } + } + + /** + * Saves the tracking url for each parcel. + * + * @param $tntParcels + * @param $orderId + * + * @throws Exception + */ + private function _saveTrackingUrls($tntParcels, $orderId) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $sql = 'SELECT * FROM '._DB_PREFIX_.'tntofficiel_order_parcels where id_order = '.(int)$orderId; + $parcels = Db::getInstance()->executeS($sql); + $i = 0; + foreach ($tntParcels as $tntParcel) { + try { + Db::getInstance()->update( + 'tntofficiel_order_parcels', + array( + 'tracking_url' => pSQL($tntParcel['tracking_url']), + 'parcel_number' => pSQL($tntParcel['number']), + ), + 'id_parcel = '.pSQL($parcels[$i]['id_parcel']) + ); + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + throw $objException; + } + ++$i; + } + } + + private function _savePickupNumber($pickupNumber, $orderId) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $sql = 'SELECT * FROM '._DB_PREFIX_.'tntofficiel_order where id_order = '.(int)$orderId; + $orders = Db::getInstance()->executeS($sql); + foreach ($orders as $order) { + Db::getInstance()->update( + 'tntofficiel_order', + array('pickup_number' => pSQL($pickupNumber)), + 'id_tntofficiel_order = '.(int)$order['id_tntofficiel_order'] + ); + } + } + + /** + * Get the first available shipping date. + * + * @param $cart + * @param $intArgOrderID + * + * @return string|bool + * + * @throws Exception + */ + public function getShippingDate($intArgOrderID) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $objOrder = new Order($intArgOrderID); + try { + $arrTNTOrder = TNTOfficiel_OrderHelper::getInstance()->getOrderData($intArgOrderID); + if ($arrTNTOrder['is_shipped']) { + throw new TNTOfficiel_OrderAlreadyShippedException('The shipment has already been created for the order ' + $intArgOrderID); + } + $arrTNTAddress = TNTOfficiel_AddressHelper::getInstance()->getAddressData($objOrder->id_address_delivery, $objOrder->id_cart); + $parcels = TNTOfficiel_ParcelsHelper::getInstance()->getParcels($intArgOrderID); + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + throw $objException; + } + + //call the middleware + $arrParams = $this->_getParams( + $objOrder->id_shop, + $arrTNTOrder, + $arrTNTAddress, + $this->_getParcelsData($parcels, $objOrder->reference) + ); + $arrMDWResponse = $this->_callMiddlewareWithService($arrParams, 'getShippingDate'); + if (is_string($arrMDWResponse)) { + throw new PrestaShopException($arrMDWResponse); + } + + return $arrMDWResponse; + } + + /** + * Get the first available shipping date. + * + * @param $cart + * @param $orderId + * + * @return string|bool + * + * @throws Exception + */ + public function checkSaveShipmentDate($orderId, $shippingDate) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $order = new Order($orderId); + try { + $arrTNTOrder = TNTOfficiel_OrderHelper::getInstance()->getOrderData($orderId); + $arrTNTAddress = TNTOfficiel_AddressHelper::getInstance()->getAddressData($order->id_address_delivery, $order->id_cart); + $parcels = TNTOfficiel_ParcelsHelper::getInstance()->getParcels($orderId); + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + throw $objException; + } + + //call the middleware + $arrParams = $this->_getParams( + $order->id_shop, + $arrTNTOrder, + $arrTNTAddress, + $this->_getParcelsData($parcels, $order->reference), + $shippingDate + ); + $arrMDWResponse = $this->_callMiddlewareWithService($arrParams, 'checkSaveShipment'); + + return $arrMDWResponse; + } + + public function getNewShippingDate($intArgOrderID) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $arrMDWShippingDate = TNTOfficiel_ShipmentHelper::getInstance()->getShippingDate($intArgOrderID); + //$shippingDatePrepa = $response['shippingDatePrepa']; + $shippingDatePrepa = $arrMDWShippingDate['shippingDate']; + + $arrMDWShippingDate = TNTOfficiel_ShipmentHelper::getInstance()->checkSaveShipmentDate($intArgOrderID, $shippingDatePrepa); + + if (!array_key_exists('shippingDate', $arrMDWShippingDate)) { + return false; + } + + return $arrMDWShippingDate; + } +} diff --git a/www/modules/tntofficiel/libraries/helper/TNTOfficiel_ShippingHelper.php b/www/modules/tntofficiel/libraries/helper/TNTOfficiel_ShippingHelper.php new file mode 100644 index 00000000..f8a76076 --- /dev/null +++ b/www/modules/tntofficiel/libraries/helper/TNTOfficiel_ShippingHelper.php @@ -0,0 +1,119 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; + +/** + * Class TNTOfficiel_ShippingHelper. + */ +class TNTOfficiel_ShippingHelper +{ + /** + * @var Singleton + */ + private static $_instance = null; + + /** + * Constructor. + */ + public function __construct() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + } + + /** + * Creates a singleton. + * + * @param void + * + * @return TNTOfficiel_ShippingHelper + */ + public static function getInstance() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + if (is_null(TNTOfficiel_ShippingHelper::$_instance)) { + TNTOfficiel_ShippingHelper::$_instance = new TNTOfficiel_ShippingHelper(); + } + + return TNTOfficiel_ShippingHelper::$_instance; + } + + /** + * @var array + */ + protected $_days = array( + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday', + 'Sunday', + ); + + /** + * Returns an array with schedules for each days. + * + * @param array $params Parameters of the function + * + * @return array + */ + public function getSchedules(array $params = array()) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $schedules = array(); + + if ($hours = $params['hours']) { + $index = 0; + // Position corresponds to the number of the day + $position = 0; + // Current day + $day = null; + // Part of the day + $part = null; + + foreach ($hours as $hour) { + $hour = trim($hour); + $day = $this->_days[$position]; + + if (($index % 2 === 0) && ($index % 4 === 0)) { + $part = 'AM'; + } elseif (($index % 2 === 0) && ($index % 4 === 2)) { + $part = 'PM'; + } + + // Prepare the current Day + if (!isset($schedules[$day])) { + $schedules[$day] = array(); + } + + // Prepare the current period of the current dya + if (!isset($schedules[$day][$part]) && $hour) { + $schedules[$day][$part] = array(); + } + + // If hours different from 0 + if ($hour) { + // Add hour + $schedules[$day][$part][] = $hour; + } + + ++$index; + + if ($index % 4 == 0) { + ++$position; + } + } + } + + return $schedules; + } +} diff --git a/www/modules/tntofficiel/libraries/helper/index.php b/www/modules/tntofficiel/libraries/helper/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/libraries/helper/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/libraries/index.php b/www/modules/tntofficiel/libraries/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/libraries/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/libraries/pdf/TNTOfficiel_PDFMerger.php b/www/modules/tntofficiel/libraries/pdf/TNTOfficiel_PDFMerger.php new file mode 100644 index 00000000..047c042f --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/TNTOfficiel_PDFMerger.php @@ -0,0 +1,202 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +/** + * PDFMerger created by Jarrod Nettles December 2009 + * jarrod@squarecrow.com + * + * v1.0 + * + * Class for easily merging PDFs (or specific pages of PDFs) together into one. Output to a file, browser, download, or return as a string. + * Unfortunately, this class does not preserve many of the enhancements your original PDF might contain. It treats + * your PDF page as an image and then concatenates them all together. + * + * Note that your PDFs are merged in the order that you provide them using the addPDF function, same as the pages. + * If you put pages 12-14 before 1-5 then 12-15 will be placed first in the output. + * + * + * Uses FPDI 1.3.1 from Setasign + * Uses FPDF 1.6 by Olivier Plathey with FPDF_TPL extension 1.1.3 by Setasign + * + * Both of these packages are free and open source software, bundled with this class for ease of use. + * They are not modified in any way. PDFMerger has all the limitations of the FPDI package - essentially, it cannot import dynamic content + * such as form fields, links or page annotations (anything not a part of the page content stream). + * + */ +class TNTOfficiel_PDFMerger +{ + private $_files; //['form.pdf'] ["1,2,4, 5-19"] + private $_fpdi; + + /** + * Merge PDFs. + * @return void + */ + public function __construct() + { + require_once('fpdf/TNTOfficiel_FPDF.php'); + require_once('fpdi/TNTOfficiel_FPDI.php'); + } + + /** + * Add a PDF for inclusion in the merge with a valid file path. Pages should be formatted: 1,3,6, 12-16. + * @param $filepath + * @param $pages + * @return void + */ + public function addPDF($filepath, $pages = 'all') + { + if(file_exists($filepath)) + { + if(strtolower($pages) != 'all') + { + $pages = $this->_rewritepages($pages); + } + + $this->_files[] = array($filepath, $pages); + } + else + { + throw new exception("Could not locate PDF on '$filepath'"); + } + + return $this; + } + + /** + * Merges your provided PDFs and outputs to specified location. + * @param $outputmode + * @param $outputname + * @return PDF + */ + public function merge($outputmode = 'browser', $outputpath = 'newfile.pdf') + { + if(!isset($this->_files) || !is_array($this->_files)): throw new exception("No PDFs to merge."); endif; + + $fpdi = new TNTOfficiel_FPDI; + + //merger operations + foreach($this->_files as $file) + { + $filename = $file[0]; + $filepages = $file[1]; + + $count = $fpdi->setSourceFile($filename); + + //add the pages + if($filepages == 'all') + { + for($i=1; $i<=$count; $i++) + { + $template = $fpdi->importPage($i); + $size = $fpdi->getTemplateSize($template); + $orientation = ($size['h'] > $size['w']) ? 'P' : 'L'; + + $fpdi->AddPage($orientation, array($size['w'], $size['h'])); + $fpdi->useTemplate($template); + } + } + else + { + foreach($filepages as $page) + { + if(!$template = $fpdi->importPage($page)): throw new exception("Could not load page '$page' in PDF '$filename'. Check that the page exists."); endif; + $size = $fpdi->getTemplateSize($template); + $orientation = ($size['h'] > $size['w']) ? 'P' : 'L'; + + $fpdi->AddPage($orientation, array($size['w'], $size['h'])); + $fpdi->useTemplate($template); + } + } + } + + //output operations + $mode = $this->_switchmode($outputmode); + + if($mode == 'S') + { + return $fpdi->Output($outputpath, 'S'); + } + else + { + if($fpdi->Output($outputpath, $mode) == '') + { + return true; + } + else + { + throw new exception("Error outputting PDF to '$outputmode'."); + return false; + } + } + + + } + + /** + * FPDI uses single characters for specifying the output location. Change our more descriptive string into proper format. + * @param $mode + * @return Character + */ + private function _switchmode($mode) + { + switch(strtolower($mode)) + { + case 'download': + return 'D'; + break; + case 'browser': + return 'I'; + break; + case 'file': + return 'F'; + break; + case 'string': + return 'S'; + break; + default: + return 'I'; + break; + } + } + + /** + * Takes our provided pages in the form of 1,3,4,16-50 and creates an array of all pages + * @param $pages + * @return unknown_type + */ + private function _rewritepages($pages) + { + $pages = str_replace(' ', '', $pages); + $part = explode(',', $pages); + + //parse hyphens + foreach($part as $i) + { + $ind = explode('-', $i); + + if(count($ind) == 2) + { + $x = $ind[0]; //start page + $y = $ind[1]; //end page + + if($x > $y): throw new exception("Starting page, '$x' is greater than ending page '$y'."); return false; endif; + + //add middle pages + while($x <= $y): $newpages[] = (int) $x; $x++; endwhile; + } + else + { + $newpages[] = (int) $ind[0]; + } + } + + return $newpages; + } +} diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/TNTOfficiel_FPDF.php b/www/modules/tntofficiel/libraries/pdf/fpdf/TNTOfficiel_FPDF.php new file mode 100644 index 00000000..d2bab1ce --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/TNTOfficiel_FPDF.php @@ -0,0 +1,1641 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +/******************************************************************************* + * FPDF * + * * + * Version: 1.6 * + * Date: 2008-08-03 * + * Author: Olivier PLATHEY * + *******************************************************************************/ + +define('TNTOFFICIEL_FPDF_VERSION', '1.6'); + +class TNTOfficiel_FPDF +{ + var $page; // current page number + var $n; // current object number + var $offsets; // array of object offsets + var $buffer; // buffer holding in-memory PDF + var $pages; // array containing pages + var $state; // current document state + var $compress; // compression flag + var $k; // scale factor (number of points in user unit) + var $DefOrientation; // default orientation + var $CurOrientation; // current orientation + var $PageFormats; // available page formats + var $DefPageFormat; // default page format + var $CurPageFormat; // current page format + var $PageSizes; // array storing non-default page sizes + var $wPt, $hPt; // dimensions of current page in points + var $w, $h; // dimensions of current page in user unit + var $lMargin; // left margin + var $tMargin; // top margin + var $rMargin; // right margin + var $bMargin; // page break margin + var $cMargin; // cell margin + var $x, $y; // current position in user unit + var $lasth; // height of last printed cell + var $LineWidth; // line width in user unit + var $CoreFonts; // array of standard font names + var $fonts; // array of used fonts + var $FontFiles; // array of font files + var $diffs; // array of encoding differences + var $FontFamily; // current font family + var $FontStyle; // current font style + var $underline; // underlining flag + var $CurrentFont; // current font info + var $FontSizePt; // current font size in points + var $FontSize; // current font size in user unit + var $DrawColor; // commands for drawing color + var $FillColor; // commands for filling color + var $TextColor; // commands for text color + var $ColorFlag; // indicates whether fill and text colors are different + var $ws; // word spacing + var $images; // array of used images + var $PageLinks; // array of links in pages + var $links; // array of internal links + var $AutoPageBreak; // automatic page breaking + var $PageBreakTrigger; // threshold used to trigger page breaks + var $InHeader; // flag set when processing header + var $InFooter; // flag set when processing footer + var $ZoomMode; // zoom display mode + var $LayoutMode; // layout display mode + var $title; // title + var $subject; // subject + var $author; // author + var $keywords; // keywords + var $creator; // creator + var $AliasNbPages; // alias for total number of pages + var $PDFVersion; // PDF version number + + /******************************************************************************* + * * + * Public methods * + * * + *******************************************************************************/ + public function TNTOfficiel_FPDF($orientation = 'P', $unit = 'mm', $format = 'A4') + { + // Some checks + $this->_dochecks(); + // Initialization of properties + $this->page = 0; + $this->n = 2; + $this->buffer = ''; + $this->pages = array(); + $this->PageSizes = array(); + $this->state = 0; + $this->fonts = array(); + $this->FontFiles = array(); + $this->diffs = array(); + $this->images = array(); + $this->links = array(); + $this->InHeader = false; + $this->InFooter = false; + $this->lasth = 0; + $this->FontFamily = ''; + $this->FontStyle = ''; + $this->FontSizePt = 12; + $this->underline = false; + $this->DrawColor = '0 G'; + $this->FillColor = '0 g'; + $this->TextColor = '0 g'; + $this->ColorFlag = false; + $this->ws = 0; + // Standard fonts + $this->CoreFonts = array( + 'courier' => 'Courier', 'courierB' => 'Courier-Bold', 'courierI' => 'Courier-Oblique', 'courierBI' => 'Courier-BoldOblique', + 'helvetica' => 'Helvetica', 'helveticaB' => 'Helvetica-Bold', 'helveticaI' => 'Helvetica-Oblique', 'helveticaBI' => 'Helvetica-BoldOblique', + 'times' => 'Times-Roman', 'timesB' => 'Times-Bold', 'timesI' => 'Times-Italic', 'timesBI' => 'Times-BoldItalic', + 'symbol' => 'Symbol', 'zapfdingbats' => 'ZapfDingbats' + ); + // Scale factor + if ($unit == 'pt') + $this->k = 1; + elseif ($unit == 'mm') + $this->k = 72 / 25.4; + elseif ($unit == 'cm') + $this->k = 72 / 2.54; + elseif ($unit == 'in') + $this->k = 72; + else + $this->Error('Incorrect unit: '.$unit); + // Page format + $this->PageFormats = array( + 'a3' => array(841.89, 1190.55), 'a4' => array(595.28, 841.89), 'a5' => array(420.94, 595.28), + 'letter' => array(612, 792), 'legal' => array(612, 1008) + ); + if (is_string($format)) + $format = $this->_getpageformat($format); + $this->DefPageFormat = $format; + $this->CurPageFormat = $format; + // Page orientation + $orientation = strtolower($orientation); + if ($orientation == 'p' || $orientation == 'portrait') { + $this->DefOrientation = 'P'; + $this->w = $this->DefPageFormat[0]; + $this->h = $this->DefPageFormat[1]; + } elseif ($orientation == 'l' || $orientation == 'landscape') { + $this->DefOrientation = 'L'; + $this->w = $this->DefPageFormat[1]; + $this->h = $this->DefPageFormat[0]; + } else + $this->Error('Incorrect orientation: '.$orientation); + $this->CurOrientation = $this->DefOrientation; + $this->wPt = $this->w * $this->k; + $this->hPt = $this->h * $this->k; + // Page margins (1 cm) + $margin = 28.35 / $this->k; + $this->SetMargins($margin, $margin); + // Interior cell margin (1 mm) + $this->cMargin = $margin / 10; + // Line width (0.2 mm) + $this->LineWidth = .567 / $this->k; + // Automatic page break + $this->SetAutoPageBreak(true, 2 * $margin); + // Full width display mode + $this->SetDisplayMode('fullwidth'); + // Enable compression + $this->SetCompression(true); + // Set default PDF version number + $this->PDFVersion = '1.3'; + } + + public function SetMargins($left, $top, $right = null) + { + // Set left, top and right margins + $this->lMargin = $left; + $this->tMargin = $top; + if ($right === null) + $right = $left; + $this->rMargin = $right; + } + + public function SetLeftMargin($margin) + { + // Set left margin + $this->lMargin = $margin; + if ($this->page > 0 && $this->x < $margin) + $this->x = $margin; + } + + public function SetTopMargin($margin) + { + // Set top margin + $this->tMargin = $margin; + } + + public function SetRightMargin($margin) + { + // Set right margin + $this->rMargin = $margin; + } + + public function SetAutoPageBreak($auto, $margin = 0) + { + // Set auto page break mode and triggering margin + $this->AutoPageBreak = $auto; + $this->bMargin = $margin; + $this->PageBreakTrigger = $this->h - $margin; + } + + public function SetDisplayMode($zoom, $layout = 'continuous') + { + // Set display mode in viewer + if ($zoom == 'fullpage' || $zoom == 'fullwidth' || $zoom == 'real' || $zoom == 'default' || !is_string($zoom)) + $this->ZoomMode = $zoom; + else + $this->Error('Incorrect zoom display mode: '.$zoom); + if ($layout == 'single' || $layout == 'continuous' || $layout == 'two' || $layout == 'default') + $this->LayoutMode = $layout; + else + $this->Error('Incorrect layout display mode: '.$layout); + } + + public function SetCompression($compress) + { + // Set page compression + if (function_exists('gzcompress')) + $this->compress = $compress; + else + $this->compress = false; + } + + public function SetTitle($title, $isUTF8 = false) + { + // Title of document + if ($isUTF8) + $title = $this->_UTF8toUTF16($title); + $this->title = $title; + } + + public function SetSubject($subject, $isUTF8 = false) + { + // Subject of document + if ($isUTF8) + $subject = $this->_UTF8toUTF16($subject); + $this->subject = $subject; + } + + public function SetAuthor($author, $isUTF8 = false) + { + // Author of document + if ($isUTF8) + $author = $this->_UTF8toUTF16($author); + $this->author = $author; + } + + public function SetKeywords($keywords, $isUTF8 = false) + { + // Keywords of document + if ($isUTF8) + $keywords = $this->_UTF8toUTF16($keywords); + $this->keywords = $keywords; + } + + public function SetCreator($creator, $isUTF8 = false) + { + // Creator of document + if ($isUTF8) + $creator = $this->_UTF8toUTF16($creator); + $this->creator = $creator; + } + + public function AliasNbPages($alias = '{nb}') + { + // Define an alias for total number of pages + $this->AliasNbPages = $alias; + } + + public function Error($msg) + { + // Fatal error + die('TNTOfficiel_FPDF error: '.$msg); + } + + public function Open() + { + // Begin document + $this->state = 1; + } + + public function Close() + { + // Terminate document + if ($this->state == 3) + return; + if ($this->page == 0) + $this->AddPage(); + // Page footer + $this->InFooter = true; + $this->Footer(); + $this->InFooter = false; + // Close page + $this->_endpage(); + // Close document + $this->_enddoc(); + } + + public function AddPage($orientation = '', $format = '') + { + // Start a new page + if ($this->state == 0) + $this->Open(); + $family = $this->FontFamily; + $style = $this->FontStyle.($this->underline ? 'U' : ''); + $size = $this->FontSizePt; + $lw = $this->LineWidth; + $dc = $this->DrawColor; + $fc = $this->FillColor; + $tc = $this->TextColor; + $cf = $this->ColorFlag; + if ($this->page > 0) { + // Page footer + $this->InFooter = true; + $this->Footer(); + $this->InFooter = false; + // Close page + $this->_endpage(); + } + // Start new page + $this->_beginpage($orientation, $format); + // Set line cap style to square + $this->_out('2 J'); + // Set line width + $this->LineWidth = $lw; + $this->_out(sprintf('%.2F w', $lw * $this->k)); + // Set font + if ($family) + $this->SetFont($family, $style, $size); + // Set colors + $this->DrawColor = $dc; + if ($dc != '0 G') + $this->_out($dc); + $this->FillColor = $fc; + if ($fc != '0 g') + $this->_out($fc); + $this->TextColor = $tc; + $this->ColorFlag = $cf; + // Page header + $this->InHeader = true; + $this->Header(); + $this->InHeader = false; + // Restore line width + if ($this->LineWidth != $lw) { + $this->LineWidth = $lw; + $this->_out(sprintf('%.2F w', $lw * $this->k)); + } + // Restore font + if ($family) + $this->SetFont($family, $style, $size); + // Restore colors + if ($this->DrawColor != $dc) { + $this->DrawColor = $dc; + $this->_out($dc); + } + if ($this->FillColor != $fc) { + $this->FillColor = $fc; + $this->_out($fc); + } + $this->TextColor = $tc; + $this->ColorFlag = $cf; + } + + public function Header() + { + // To be implemented in your own inherited class + } + + public function Footer() + { + // To be implemented in your own inherited class + } + + public function PageNo() + { + // Get current page number + return $this->page; + } + + public function SetDrawColor($r, $g = null, $b = null) + { + // Set color for all stroking operations + if (($r == 0 && $g == 0 && $b == 0) || $g === null) + $this->DrawColor = sprintf('%.3F G', $r / 255); + else + $this->DrawColor = sprintf('%.3F %.3F %.3F RG', $r / 255, $g / 255, $b / 255); + if ($this->page > 0) + $this->_out($this->DrawColor); + } + + public function SetFillColor($r, $g = null, $b = null) + { + // Set color for all filling operations + if (($r == 0 && $g == 0 && $b == 0) || $g === null) + $this->FillColor = sprintf('%.3F g', $r / 255); + else + $this->FillColor = sprintf('%.3F %.3F %.3F rg', $r / 255, $g / 255, $b / 255); + $this->ColorFlag = ($this->FillColor != $this->TextColor); + if ($this->page > 0) + $this->_out($this->FillColor); + } + + public function SetTextColor($r, $g = null, $b = null) + { + // Set color for text + if (($r == 0 && $g == 0 && $b == 0) || $g === null) + $this->TextColor = sprintf('%.3F g', $r / 255); + else + $this->TextColor = sprintf('%.3F %.3F %.3F rg', $r / 255, $g / 255, $b / 255); + $this->ColorFlag = ($this->FillColor != $this->TextColor); + } + + public function GetStringWidth($s) + { + // Get width of a string in the current font + $s = (string)$s; + $cw =& $this->CurrentFont['cw']; + $w = 0; + $l = strlen($s); + for ($i = 0; $i < $l; $i++) + $w += $cw[ $s[ $i ] ]; + + return $w * $this->FontSize / 1000; + } + + public function SetLineWidth($width) + { + // Set line width + $this->LineWidth = $width; + if ($this->page > 0) + $this->_out(sprintf('%.2F w', $width * $this->k)); + } + + public function Line($x1, $y1, $x2, $y2) + { + // Draw a line + $this->_out(sprintf('%.2F %.2F m %.2F %.2F l S', $x1 * $this->k, ($this->h - $y1) * $this->k, $x2 * $this->k, ($this->h - $y2) * $this->k)); + } + + public function Rect($x, $y, $w, $h, $style = '') + { + // Draw a rectangle + if ($style == 'F') + $op = 'f'; + elseif ($style == 'FD' || $style == 'DF') + $op = 'B'; + else + $op = 'S'; + $this->_out(sprintf('%.2F %.2F %.2F %.2F re %s', $x * $this->k, ($this->h - $y) * $this->k, $w * $this->k, -$h * $this->k, $op)); + } + + public function AddFont($family, $style = '', $file = '') + { + // Add a TrueType or Type1 font + $family = strtolower($family); + if ($file == '') + $file = str_replace(' ', '', $family).strtolower($style).'.php'; + if ($family == 'arial') + $family = 'helvetica'; + $style = strtoupper($style); + if ($style == 'IB') + $style = 'BI'; + $fontkey = $family.$style; + if (isset($this->fonts[ $fontkey ])) + return; + include($this->_getfontpath().$file); + if (!isset($name)) + $this->Error('Could not include font definition file'); + $i = count($this->fonts) + 1; + $this->fonts[ $fontkey ] = array('i' => $i, 'type' => $type, 'name' => $name, 'desc' => $desc, 'up' => $up, 'ut' => $ut, 'cw' => $cw, 'enc' => $enc, 'file' => $file); + if ($diff) { + // Search existing encodings + $d = 0; + $nb = count($this->diffs); + for ($i = 1; $i <= $nb; $i++) { + if ($this->diffs[ $i ] == $diff) { + $d = $i; + break; + } + } + if ($d == 0) { + $d = $nb + 1; + $this->diffs[ $d ] = $diff; + } + $this->fonts[ $fontkey ]['diff'] = $d; + } + if ($file) { + if ($type == 'TrueType') + $this->FontFiles[ $file ] = array('length1' => $originalsize); + else + $this->FontFiles[ $file ] = array('length1' => $size1, 'length2' => $size2); + } + } + + public function SetFont($family, $style = '', $size = 0) + { + // Select a font; size given in points + global $tntofficiel_fpdf_charwidths; + + $family = strtolower($family); + if ($family == '') + $family = $this->FontFamily; + if ($family == 'arial') + $family = 'helvetica'; + elseif ($family == 'symbol' || $family == 'zapfdingbats') + $style = ''; + $style = strtoupper($style); + if (strpos($style, 'U') !== false) { + $this->underline = true; + $style = str_replace('U', '', $style); + } else + $this->underline = false; + if ($style == 'IB') + $style = 'BI'; + if ($size == 0) + $size = $this->FontSizePt; + // Test if font is already selected + if ($this->FontFamily == $family && $this->FontStyle == $style && $this->FontSizePt == $size) + return; + // Test if used for the first time + $fontkey = $family.$style; + if (!isset($this->fonts[ $fontkey ])) { + // Check if one of the standard fonts + if (isset($this->CoreFonts[ $fontkey ])) { + if (!isset($tntofficiel_fpdf_charwidths[ $fontkey ])) { + // Load metric file + $file = $family; + if ($family == 'times' || $family == 'helvetica') + $file .= strtolower($style); + include($this->_getfontpath().$file.'.php'); + if (!isset($tntofficiel_fpdf_charwidths[ $fontkey ])) + $this->Error('Could not include font metric file'); + } + $i = count($this->fonts) + 1; + $name = $this->CoreFonts[ $fontkey ]; + $cw = $tntofficiel_fpdf_charwidths[ $fontkey ]; + $this->fonts[ $fontkey ] = array('i' => $i, 'type' => 'core', 'name' => $name, 'up' => -100, 'ut' => 50, 'cw' => $cw); + } else + $this->Error('Undefined font: '.$family.' '.$style); + } + // Select it + $this->FontFamily = $family; + $this->FontStyle = $style; + $this->FontSizePt = $size; + $this->FontSize = $size / $this->k; + $this->CurrentFont =& $this->fonts[ $fontkey ]; + if ($this->page > 0) + $this->_out(sprintf('BT /F%d %.2F Tf ET', $this->CurrentFont['i'], $this->FontSizePt)); + } + + public function SetFontSize($size) + { + // Set font size in points + if ($this->FontSizePt == $size) + return; + $this->FontSizePt = $size; + $this->FontSize = $size / $this->k; + if ($this->page > 0) + $this->_out(sprintf('BT /F%d %.2F Tf ET', $this->CurrentFont['i'], $this->FontSizePt)); + } + + public function AddLink() + { + // Create a new internal link + $n = count($this->links) + 1; + $this->links[ $n ] = array(0, 0); + + return $n; + } + + public function SetLink($link, $y = 0, $page = -1) + { + // Set destination of internal link + if ($y == -1) + $y = $this->y; + if ($page == -1) + $page = $this->page; + $this->links[ $link ] = array($page, $y); + } + + public function Link($x, $y, $w, $h, $link) + { + // Put a link on the page + $this->PageLinks[ $this->page ][] = array($x * $this->k, $this->hPt - $y * $this->k, $w * $this->k, $h * $this->k, $link); + } + + public function Text($x, $y, $txt) + { + // Output a string + $s = sprintf('BT %.2F %.2F Td (%s) Tj ET', $x * $this->k, ($this->h - $y) * $this->k, $this->_escape($txt)); + if ($this->underline && $txt != '') + $s .= ' '.$this->_dounderline($x, $y, $txt); + if ($this->ColorFlag) + $s = 'q '.$this->TextColor.' '.$s.' Q'; + $this->_out($s); + } + + public function AcceptPageBreak() + { + // Accept automatic page break or not + return $this->AutoPageBreak; + } + + public function Cell($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = false, $link = '') + { + // Output a cell + $k = $this->k; + if ($this->y + $h > $this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak()) { + // Automatic page break + $x = $this->x; + $ws = $this->ws; + if ($ws > 0) { + $this->ws = 0; + $this->_out('0 Tw'); + } + $this->AddPage($this->CurOrientation, $this->CurPageFormat); + $this->x = $x; + if ($ws > 0) { + $this->ws = $ws; + $this->_out(sprintf('%.3F Tw', $ws * $k)); + } + } + if ($w == 0) + $w = $this->w - $this->rMargin - $this->x; + $s = ''; + if ($fill || $border == 1) { + if ($fill) + $op = ($border == 1) ? 'B' : 'f'; + else + $op = 'S'; + $s = sprintf('%.2F %.2F %.2F %.2F re %s ', $this->x * $k, ($this->h - $this->y) * $k, $w * $k, -$h * $k, $op); + } + if (is_string($border)) { + $x = $this->x; + $y = $this->y; + if (strpos($border, 'L') !== false) + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x * $k, ($this->h - $y) * $k, $x * $k, ($this->h - ($y + $h)) * $k); + if (strpos($border, 'T') !== false) + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x * $k, ($this->h - $y) * $k, ($x + $w) * $k, ($this->h - $y) * $k); + if (strpos($border, 'R') !== false) + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', ($x + $w) * $k, ($this->h - $y) * $k, ($x + $w) * $k, ($this->h - ($y + $h)) * $k); + if (strpos($border, 'B') !== false) + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x * $k, ($this->h - ($y + $h)) * $k, ($x + $w) * $k, ($this->h - ($y + $h)) * $k); + } + if ($txt !== '') { + if ($align == 'R') + $dx = $w - $this->cMargin - $this->GetStringWidth($txt); + elseif ($align == 'C') + $dx = ($w - $this->GetStringWidth($txt)) / 2; + else + $dx = $this->cMargin; + if ($this->ColorFlag) + $s .= 'q '.$this->TextColor.' '; + $txt2 = str_replace(')', '\\)', str_replace('(', '\\(', str_replace('\\', '\\\\', $txt))); + $s .= sprintf('BT %.2F %.2F Td (%s) Tj ET', ($this->x + $dx) * $k, ($this->h - ($this->y + .5 * $h + .3 * $this->FontSize)) * $k, $txt2); + if ($this->underline) + $s .= ' '.$this->_dounderline($this->x + $dx, $this->y + .5 * $h + .3 * $this->FontSize, $txt); + if ($this->ColorFlag) + $s .= ' Q'; + if ($link) + $this->Link($this->x + $dx, $this->y + .5 * $h - .5 * $this->FontSize, $this->GetStringWidth($txt), $this->FontSize, $link); + } + if ($s) + $this->_out($s); + $this->lasth = $h; + if ($ln > 0) { + // Go to next line + $this->y += $h; + if ($ln == 1) + $this->x = $this->lMargin; + } else + $this->x += $w; + } + + public function MultiCell($w, $h, $txt, $border = 0, $align = 'J', $fill = false) + { + // Output text with automatic or explicit line breaks + $cw =& $this->CurrentFont['cw']; + if ($w == 0) + $w = $this->w - $this->rMargin - $this->x; + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->FontSize; + $s = str_replace("\r", '', $txt); + $nb = strlen($s); + if ($nb > 0 && $s[ $nb - 1 ] == "\n") + $nb--; + $b = 0; + if ($border) { + if ($border == 1) { + $border = 'LTRB'; + $b = 'LRT'; + $b2 = 'LR'; + } else { + $b2 = ''; + if (strpos($border, 'L') !== false) + $b2 .= 'L'; + if (strpos($border, 'R') !== false) + $b2 .= 'R'; + $b = (strpos($border, 'T') !== false) ? $b2.'T' : $b2; + } + } + $sep = -1; + $i = 0; + $j = 0; + $l = 0; + $ns = 0; + $nl = 1; + while ($i < $nb) { + // Get next character + $c = $s[ $i ]; + if ($c == "\n") { + // Explicit line break + if ($this->ws > 0) { + $this->ws = 0; + $this->_out('0 Tw'); + } + $this->Cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); + $i++; + $sep = -1; + $j = $i; + $l = 0; + $ns = 0; + $nl++; + if ($border && $nl == 2) + $b = $b2; + continue; + } + if ($c == ' ') { + $sep = $i; + $ls = $l; + $ns++; + } + $l += $cw[ $c ]; + if ($l > $wmax) { + // Automatic line break + if ($sep == -1) { + if ($i == $j) + $i++; + if ($this->ws > 0) { + $this->ws = 0; + $this->_out('0 Tw'); + } + $this->Cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); + } else { + if ($align == 'J') { + $this->ws = ($ns > 1) ? ($wmax - $ls) / 1000 * $this->FontSize / ($ns - 1) : 0; + $this->_out(sprintf('%.3F Tw', $this->ws * $this->k)); + } + $this->Cell($w, $h, substr($s, $j, $sep - $j), $b, 2, $align, $fill); + $i = $sep + 1; + } + $sep = -1; + $j = $i; + $l = 0; + $ns = 0; + $nl++; + if ($border && $nl == 2) + $b = $b2; + } else + $i++; + } + // Last chunk + if ($this->ws > 0) { + $this->ws = 0; + $this->_out('0 Tw'); + } + if ($border && strpos($border, 'B') !== false) + $b .= 'B'; + $this->Cell($w, $h, substr($s, $j, $i - $j), $b, 2, $align, $fill); + $this->x = $this->lMargin; + } + + public function Write($h, $txt, $link = '') + { + // Output text in flowing mode + $cw =& $this->CurrentFont['cw']; + $w = $this->w - $this->rMargin - $this->x; + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->FontSize; + $s = str_replace("\r", '', $txt); + $nb = strlen($s); + $sep = -1; + $i = 0; + $j = 0; + $l = 0; + $nl = 1; + while ($i < $nb) { + // Get next character + $c = $s[ $i ]; + if ($c == "\n") { + // Explicit line break + $this->Cell($w, $h, substr($s, $j, $i - $j), 0, 2, '', 0, $link); + $i++; + $sep = -1; + $j = $i; + $l = 0; + if ($nl == 1) { + $this->x = $this->lMargin; + $w = $this->w - $this->rMargin - $this->x; + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->FontSize; + } + $nl++; + continue; + } + if ($c == ' ') + $sep = $i; + $l += $cw[ $c ]; + if ($l > $wmax) { + // Automatic line break + if ($sep == -1) { + if ($this->x > $this->lMargin) { + // Move to next line + $this->x = $this->lMargin; + $this->y += $h; + $w = $this->w - $this->rMargin - $this->x; + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->FontSize; + $i++; + $nl++; + continue; + } + if ($i == $j) + $i++; + $this->Cell($w, $h, substr($s, $j, $i - $j), 0, 2, '', 0, $link); + } else { + $this->Cell($w, $h, substr($s, $j, $sep - $j), 0, 2, '', 0, $link); + $i = $sep + 1; + } + $sep = -1; + $j = $i; + $l = 0; + if ($nl == 1) { + $this->x = $this->lMargin; + $w = $this->w - $this->rMargin - $this->x; + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->FontSize; + } + $nl++; + } else + $i++; + } + // Last chunk + if ($i != $j) + $this->Cell($l / 1000 * $this->FontSize, $h, substr($s, $j), 0, 0, '', 0, $link); + } + + public function Ln($h = null) + { + // Line feed; default value is last cell height + $this->x = $this->lMargin; + if ($h === null) + $this->y += $this->lasth; + else + $this->y += $h; + } + + public function Image($file, $x = null, $y = null, $w = 0, $h = 0, $type = '', $link = '') + { + // Put an image on the page + if (!isset($this->images[ $file ])) { + // First use of this image, get info + if ($type == '') { + $pos = strrpos($file, '.'); + if (!$pos) + $this->Error('Image file has no extension and no type was specified: '.$file); + $type = substr($file, $pos + 1); + } + $type = strtolower($type); + if ($type == 'jpeg') + $type = 'jpg'; + $mtd = '_parse'.$type; + if (!method_exists($this, $mtd)) + $this->Error('Unsupported image type: '.$type); + $info = $this->$mtd($file); + $info['i'] = count($this->images) + 1; + $this->images[ $file ] = $info; + } else + $info = $this->images[ $file ]; + // Automatic width and height calculation if needed + if ($w == 0 && $h == 0) { + // Put image at 72 dpi + $w = $info['w'] / $this->k; + $h = $info['h'] / $this->k; + } elseif ($w == 0) + $w = $h * $info['w'] / $info['h']; + elseif ($h == 0) + $h = $w * $info['h'] / $info['w']; + // Flowing mode + if ($y === null) { + if ($this->y + $h > $this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak()) { + // Automatic page break + $x2 = $this->x; + $this->AddPage($this->CurOrientation, $this->CurPageFormat); + $this->x = $x2; + } + $y = $this->y; + $this->y += $h; + } + if ($x === null) + $x = $this->x; + $this->_out(sprintf('q %.2F 0 0 %.2F %.2F %.2F cm /I%d Do Q', $w * $this->k, $h * $this->k, $x * $this->k, ($this->h - ($y + $h)) * $this->k, $info['i'])); + if ($link) + $this->Link($x, $y, $w, $h, $link); + } + + public function GetX() + { + // Get x position + return $this->x; + } + + public function SetX($x) + { + // Set x position + if ($x >= 0) + $this->x = $x; + else + $this->x = $this->w + $x; + } + + public function GetY() + { + // Get y position + return $this->y; + } + + public function SetY($y) + { + // Set y position and reset x + $this->x = $this->lMargin; + if ($y >= 0) + $this->y = $y; + else + $this->y = $this->h + $y; + } + + public function SetXY($x, $y) + { + // Set x and y positions + $this->SetY($y); + $this->SetX($x); + } + + public function Output($name = '', $dest = '') + { + // Output PDF to some destination + if ($this->state < 3) + $this->Close(); + $dest = strtoupper($dest); + if ($dest == '') { + if ($name == '') { + $name = 'doc.pdf'; + $dest = 'I'; + } else + $dest = 'F'; + } + switch ($dest) { + case 'I': + // Send to standard output + if (ob_get_length()) + $this->Error('Some data has already been output, can\'t send PDF file'); + if (php_sapi_name() != 'cli') { + // We send to a browser + header('Content-Type: application/pdf'); + if (headers_sent()) + $this->Error('Some data has already been output, can\'t send PDF file'); + header('Content-Length: '.strlen($this->buffer)); + header('Content-Disposition: inline; filename="'.$name.'"'); + header('Cache-Control: private, max-age=0, must-revalidate'); + header('Pragma: public'); + ini_set('zlib.output_compression', '0'); + } + echo $this->buffer; + break; + case 'D': + // Download file + if (ob_get_length()) + $this->Error('Some data has already been output, can\'t send PDF file'); + header('Content-Type: application/x-download'); + if (headers_sent()) + $this->Error('Some data has already been output, can\'t send PDF file'); + header('Content-Length: '.strlen($this->buffer)); + header('Content-Disposition: attachment; filename="'.$name.'"'); + header('Cache-Control: private, max-age=0, must-revalidate'); + header('Pragma: public'); + ini_set('zlib.output_compression', '0'); + echo $this->buffer; + break; + case 'F': + // Save to local file + $f = fopen($name, 'wb'); + if (!$f) + $this->Error('Unable to create output file: '.$name); + fwrite($f, $this->buffer, strlen($this->buffer)); + fclose($f); + break; + case 'S': + // Return as a string + return $this->buffer; + default: + $this->Error('Incorrect output destination: '.$dest); + } + + return ''; + } + + /******************************************************************************* + * * + * Protected methods * + * * + *******************************************************************************/ + public function _dochecks() + { + // Check availability of %F + if (sprintf('%.1F', 1.0) != '1.0') + $this->Error('This version of PHP is not supported'); + // Check mbstring overloading + if (ini_get('mbstring.func_overload') & 2) + $this->Error('mbstring overloading must be disabled'); + } + + public function _getpageformat($format) + { + $format = strtolower($format); + if (!isset($this->PageFormats[ $format ])) + $this->Error('Unknown page format: '.$format); + $a = $this->PageFormats[ $format ]; + + return array($a[0] / $this->k, $a[1] / $this->k); + } + + public function _getfontpath() + { + if (!defined('TNTOFFICIEL_FPDF_FONTPATH') && is_dir(dirname(__FILE__).'/font')) + define('TNTOFFICIEL_FPDF_FONTPATH', dirname(__FILE__).'/font/'); + + return defined('TNTOFFICIEL_FPDF_FONTPATH') ? TNTOFFICIEL_FPDF_FONTPATH : ''; + } + + public function _beginpage($orientation, $format) + { + $this->page++; + $this->pages[ $this->page ] = ''; + $this->state = 2; + $this->x = $this->lMargin; + $this->y = $this->tMargin; + $this->FontFamily = ''; + // Check page size + if ($orientation == '') + $orientation = $this->DefOrientation; + else + $orientation = strtoupper($orientation[0]); + if ($format == '') + $format = $this->DefPageFormat; + else { + if (is_string($format)) + $format = $this->_getpageformat($format); + } + if ($orientation != $this->CurOrientation || $format[0] != $this->CurPageFormat[0] || $format[1] != $this->CurPageFormat[1]) { + // New size + if ($orientation == 'P') { + $this->w = $format[0]; + $this->h = $format[1]; + } else { + $this->w = $format[1]; + $this->h = $format[0]; + } + $this->wPt = $this->w * $this->k; + $this->hPt = $this->h * $this->k; + $this->PageBreakTrigger = $this->h - $this->bMargin; + $this->CurOrientation = $orientation; + $this->CurPageFormat = $format; + } + if ($orientation != $this->DefOrientation || $format[0] != $this->DefPageFormat[0] || $format[1] != $this->DefPageFormat[1]) + $this->PageSizes[ $this->page ] = array($this->wPt, $this->hPt); + } + + public function _endpage() + { + $this->state = 1; + } + + public function _escape($s) + { + // Escape special characters in strings + $s = str_replace('\\', '\\\\', $s); + $s = str_replace('(', '\\(', $s); + $s = str_replace(')', '\\)', $s); + $s = str_replace("\r", '\\r', $s); + + return $s; + } + + public function _textstring($s) + { + // Format a text string + return '('.$this->_escape($s).')'; + } + + public function _UTF8toUTF16($s) + { + // Convert UTF-8 to UTF-16BE with BOM + $res = "\xFE\xFF"; + $nb = strlen($s); + $i = 0; + while ($i < $nb) { + $c1 = ord($s[ $i++ ]); + if ($c1 >= 224) { + // 3-byte character + $c2 = ord($s[ $i++ ]); + $c3 = ord($s[ $i++ ]); + $res .= chr((($c1 & 0x0F) << 4) + (($c2 & 0x3C) >> 2)); + $res .= chr((($c2 & 0x03) << 6) + ($c3 & 0x3F)); + } elseif ($c1 >= 192) { + // 2-byte character + $c2 = ord($s[ $i++ ]); + $res .= chr(($c1 & 0x1C) >> 2); + $res .= chr((($c1 & 0x03) << 6) + ($c2 & 0x3F)); + } else { + // Single-byte character + $res .= "\0".chr($c1); + } + } + + return $res; + } + + public function _dounderline($x, $y, $txt) + { + // Underline text + $up = $this->CurrentFont['up']; + $ut = $this->CurrentFont['ut']; + $w = $this->GetStringWidth($txt) + $this->ws * substr_count($txt, ' '); + + return sprintf('%.2F %.2F %.2F %.2F re f', $x * $this->k, ($this->h - ($y - $up / 1000 * $this->FontSize)) * $this->k, $w * $this->k, -$ut / 1000 * $this->FontSizePt); + } + + public function _parsejpg($file) + { + // Extract info from a JPEG file + $a = GetImageSize($file); + if (!$a) + $this->Error('Missing or incorrect image file: '.$file); + if ($a[2] != 2) + $this->Error('Not a JPEG file: '.$file); + if (!isset($a['channels']) || $a['channels'] == 3) + $colspace = 'DeviceRGB'; + elseif ($a['channels'] == 4) + $colspace = 'DeviceCMYK'; + else + $colspace = 'DeviceGray'; + $bpc = isset($a['bits']) ? $a['bits'] : 8; + // Read whole file + $f = fopen($file, 'rb'); + $data = ''; + while (!feof($f)) + $data .= fread($f, 8192); + fclose($f); + + return array('w' => $a[0], 'h' => $a[1], 'cs' => $colspace, 'bpc' => $bpc, 'f' => 'DCTDecode', 'data' => $data); + } + + public function _parsepng($file) + { + // Extract info from a PNG file + $f = fopen($file, 'rb'); + if (!$f) + $this->Error('Can\'t open image file: '.$file); + // Check signature + if ($this->_readstream($f, 8) != chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) + $this->Error('Not a PNG file: '.$file); + // Read header chunk + $this->_readstream($f, 4); + if ($this->_readstream($f, 4) != 'IHDR') + $this->Error('Incorrect PNG file: '.$file); + $w = $this->_readint($f); + $h = $this->_readint($f); + $bpc = ord($this->_readstream($f, 1)); + if ($bpc > 8) + $this->Error('16-bit depth not supported: '.$file); + $ct = ord($this->_readstream($f, 1)); + if ($ct == 0) + $colspace = 'DeviceGray'; + elseif ($ct == 2) + $colspace = 'DeviceRGB'; + elseif ($ct == 3) + $colspace = 'Indexed'; + else + $this->Error('Alpha channel not supported: '.$file); + if (ord($this->_readstream($f, 1)) != 0) + $this->Error('Unknown compression method: '.$file); + if (ord($this->_readstream($f, 1)) != 0) + $this->Error('Unknown filter method: '.$file); + if (ord($this->_readstream($f, 1)) != 0) + $this->Error('Interlacing not supported: '.$file); + $this->_readstream($f, 4); + $parms = '/DecodeParms <>'; + // Scan chunks looking for palette, transparency and image data + $pal = ''; + $trns = ''; + $data = ''; + do { + $n = $this->_readint($f); + $type = $this->_readstream($f, 4); + if ($type == 'PLTE') { + // Read palette + $pal = $this->_readstream($f, $n); + $this->_readstream($f, 4); + } elseif ($type == 'tRNS') { + // Read transparency info + $t = $this->_readstream($f, $n); + if ($ct == 0) + $trns = array(ord(substr($t, 1, 1))); + elseif ($ct == 2) + $trns = array(ord(substr($t, 1, 1)), ord(substr($t, 3, 1)), ord(substr($t, 5, 1))); + else { + $pos = strpos($t, chr(0)); + if ($pos !== false) + $trns = array($pos); + } + $this->_readstream($f, 4); + } elseif ($type == 'IDAT') { + // Read image data block + $data .= $this->_readstream($f, $n); + $this->_readstream($f, 4); + } elseif ($type == 'IEND') + break; + else + $this->_readstream($f, $n + 4); + } while ($n); + if ($colspace == 'Indexed' && empty($pal)) + $this->Error('Missing palette in '.$file); + fclose($f); + + return array('w' => $w, 'h' => $h, 'cs' => $colspace, 'bpc' => $bpc, 'f' => 'FlateDecode', 'parms' => $parms, 'pal' => $pal, 'trns' => $trns, 'data' => $data); + } + + public function _readstream($f, $n) + { + // Read n bytes from stream + $res = ''; + while ($n > 0 && !feof($f)) { + $s = fread($f, $n); + if ($s === false) + $this->Error('Error while reading stream'); + $n -= strlen($s); + $res .= $s; + } + if ($n > 0) + $this->Error('Unexpected end of stream'); + + return $res; + } + + public function _readint($f) + { + // Read a 4-byte integer from stream + $a = unpack('Ni', $this->_readstream($f, 4)); + + return $a['i']; + } + + public function _parsegif($file) + { + // Extract info from a GIF file (via PNG conversion) + if (!function_exists('imagepng')) + $this->Error('GD extension is required for GIF support'); + if (!function_exists('imagecreatefromgif')) + $this->Error('GD has no GIF read support'); + $im = imagecreatefromgif($file); + if (!$im) + $this->Error('Missing or incorrect image file: '.$file); + imageinterlace($im, 0); + $tmp = tempnam('.', 'gif'); + if (!$tmp) + $this->Error('Unable to create a temporary file'); + if (!imagepng($im, $tmp)) + $this->Error('Error while saving to temporary file'); + imagedestroy($im); + $info = $this->_parsepng($tmp); + unlink($tmp); + + return $info; + } + + public function _newobj() + { + // Begin a new object + $this->n++; + $this->offsets[ $this->n ] = strlen($this->buffer); + $this->_out($this->n.' 0 obj'); + } + + public function _putstream($s) + { + $this->_out('stream'); + $this->_out($s); + $this->_out('endstream'); + } + + public function _out($s) + { + // Add a line to the document + if ($this->state == 2) + $this->pages[ $this->page ] .= $s."\n"; + else + $this->buffer .= $s."\n"; + } + + public function _putpages() + { + $nb = $this->page; + if (!empty($this->AliasNbPages)) { + // Replace number of pages + for ($n = 1; $n <= $nb; $n++) + $this->pages[ $n ] = str_replace($this->AliasNbPages, $nb, $this->pages[ $n ]); + } + if ($this->DefOrientation == 'P') { + $wPt = $this->DefPageFormat[0] * $this->k; + $hPt = $this->DefPageFormat[1] * $this->k; + } else { + $wPt = $this->DefPageFormat[1] * $this->k; + $hPt = $this->DefPageFormat[0] * $this->k; + } + $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; + for ($n = 1; $n <= $nb; $n++) { + // Page + $this->_newobj(); + $this->_out('<_out('/Parent 1 0 R'); + if (isset($this->PageSizes[ $n ])) + $this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]', $this->PageSizes[ $n ][0], $this->PageSizes[ $n ][1])); + $this->_out('/Resources 2 0 R'); + if (isset($this->PageLinks[ $n ])) { + // Links + $annots = '/Annots ['; + foreach ($this->PageLinks[ $n ] as $pl) { + $rect = sprintf('%.2F %.2F %.2F %.2F', $pl[0], $pl[1], $pl[0] + $pl[2], $pl[1] - $pl[3]); + $annots .= '<_textstring($pl[4]).'>>>>'; + else { + $l = $this->links[ $pl[4] ]; + $h = isset($this->PageSizes[ $l[0] ]) ? $this->PageSizes[ $l[0] ][1] : $hPt; + $annots .= sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>', 1 + 2 * $l[0], $h - $l[1] * $this->k); + } + } + $this->_out($annots.']'); + } + $this->_out('/Contents '.($this->n + 1).' 0 R>>'); + $this->_out('endobj'); + // Page content + $p = ($this->compress) ? gzcompress($this->pages[ $n ]) : $this->pages[ $n ]; + $this->_newobj(); + $this->_out('<<'.$filter.'/Length '.strlen($p).'>>'); + $this->_putstream($p); + $this->_out('endobj'); + } + // Pages root + $this->offsets[1] = strlen($this->buffer); + $this->_out('1 0 obj'); + $this->_out('<_out($kids.']'); + $this->_out('/Count '.$nb); + $this->_out(sprintf('/MediaBox [0 0 %.2F %.2F]', $wPt, $hPt)); + $this->_out('>>'); + $this->_out('endobj'); + } + + public function _putfonts() + { + $nf = $this->n; + foreach ($this->diffs as $diff) { + // Encodings + $this->_newobj(); + $this->_out('<>'); + $this->_out('endobj'); + } + foreach ($this->FontFiles as $file => $info) { + // Font file embedding + $this->_newobj(); + $this->FontFiles[ $file ]['n'] = $this->n; + $font = ''; + $f = fopen($this->_getfontpath().$file, 'rb', 1); + if (!$f) + $this->Error('Font file not found'); + while (!feof($f)) + $font .= fread($f, 8192); + fclose($f); + $compressed = (substr($file, -2) == '.z'); + if (!$compressed && isset($info['length2'])) { + $header = (ord($font[0]) == 128); + if ($header) { + // Strip first binary header + $font = substr($font, 6); + } + if ($header && ord($font[ $info['length1'] ]) == 128) { + // Strip second binary header + $font = substr($font, 0, $info['length1']).substr($font, $info['length1'] + 6); + } + } + $this->_out('<_out('/Filter /FlateDecode'); + $this->_out('/Length1 '.$info['length1']); + if (isset($info['length2'])) + $this->_out('/Length2 '.$info['length2'].' /Length3 0'); + $this->_out('>>'); + $this->_putstream($font); + $this->_out('endobj'); + } + foreach ($this->fonts as $k => $font) { + // Font objects + $this->fonts[ $k ]['n'] = $this->n + 1; + $type = $font['type']; + $name = $font['name']; + if ($type == 'core') { + // Standard font + $this->_newobj(); + $this->_out('<_out('/BaseFont /'.$name); + $this->_out('/Subtype /Type1'); + if ($name != 'Symbol' && $name != 'ZapfDingbats') + $this->_out('/Encoding /WinAnsiEncoding'); + $this->_out('>>'); + $this->_out('endobj'); + } elseif ($type == 'Type1' || $type == 'TrueType') { + // Additional Type1 or TrueType font + $this->_newobj(); + $this->_out('<_out('/BaseFont /'.$name); + $this->_out('/Subtype /'.$type); + $this->_out('/FirstChar 32 /LastChar 255'); + $this->_out('/Widths '.($this->n + 1).' 0 R'); + $this->_out('/FontDescriptor '.($this->n + 2).' 0 R'); + if ($font['enc']) { + if (isset($font['diff'])) + $this->_out('/Encoding '.($nf + $font['diff']).' 0 R'); + else + $this->_out('/Encoding /WinAnsiEncoding'); + } + $this->_out('>>'); + $this->_out('endobj'); + // Widths + $this->_newobj(); + $cw =& $font['cw']; + $s = '['; + for ($i = 32; $i <= 255; $i++) + $s .= $cw[ chr($i) ].' '; + $this->_out($s.']'); + $this->_out('endobj'); + // Descriptor + $this->_newobj(); + $s = '< $v) + $s .= ' /'.$k.' '.$v; + $file = $font['file']; + if ($file) + $s .= ' /FontFile'.($type == 'Type1' ? '' : '2').' '.$this->FontFiles[ $file ]['n'].' 0 R'; + $this->_out($s.'>>'); + $this->_out('endobj'); + } else { + // Allow for additional types + $mtd = '_put'.strtolower($type); + if (!method_exists($this, $mtd)) + $this->Error('Unsupported font type: '.$type); + $this->$mtd($font); + } + } + } + + public function _putimages() + { + $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; + reset($this->images); + while (list($file, $info) = each($this->images)) { + $this->_newobj(); + $this->images[ $file ]['n'] = $this->n; + $this->_out('<_out('/Subtype /Image'); + $this->_out('/Width '.$info['w']); + $this->_out('/Height '.$info['h']); + if ($info['cs'] == 'Indexed') + $this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal']) / 3 - 1).' '.($this->n + 1).' 0 R]'); + else { + $this->_out('/ColorSpace /'.$info['cs']); + if ($info['cs'] == 'DeviceCMYK') + $this->_out('/Decode [1 0 1 0 1 0 1 0]'); + } + $this->_out('/BitsPerComponent '.$info['bpc']); + if (isset($info['f'])) + $this->_out('/Filter /'.$info['f']); + if (isset($info['parms'])) + $this->_out($info['parms']); + if (isset($info['trns']) && is_array($info['trns'])) { + $trns = ''; + for ($i = 0; $i < count($info['trns']); $i++) + $trns .= $info['trns'][ $i ].' '.$info['trns'][ $i ].' '; + $this->_out('/Mask ['.$trns.']'); + } + $this->_out('/Length '.strlen($info['data']).'>>'); + $this->_putstream($info['data']); + unset($this->images[ $file ]['data']); + $this->_out('endobj'); + // Palette + if ($info['cs'] == 'Indexed') { + $this->_newobj(); + $pal = ($this->compress) ? gzcompress($info['pal']) : $info['pal']; + $this->_out('<<'.$filter.'/Length '.strlen($pal).'>>'); + $this->_putstream($pal); + $this->_out('endobj'); + } + } + } + + public function _putxobjectdict() + { + foreach ($this->images as $image) + $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R'); + } + + public function _putresourcedict() + { + $this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); + $this->_out('/Font <<'); + foreach ($this->fonts as $font) + $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R'); + $this->_out('>>'); + $this->_out('/XObject <<'); + $this->_putxobjectdict(); + $this->_out('>>'); + } + + public function _putresources() + { + $this->_putfonts(); + $this->_putimages(); + // Resource dictionary + $this->offsets[2] = strlen($this->buffer); + $this->_out('2 0 obj'); + $this->_out('<<'); + $this->_putresourcedict(); + $this->_out('>>'); + $this->_out('endobj'); + } + + public function _putinfo() + { + $this->_out('/Producer '.$this->_textstring('FPDF '.TNTOFFICIEL_FPDF_VERSION)); + if (!empty($this->title)) + $this->_out('/Title '.$this->_textstring($this->title)); + if (!empty($this->subject)) + $this->_out('/Subject '.$this->_textstring($this->subject)); + if (!empty($this->author)) + $this->_out('/Author '.$this->_textstring($this->author)); + if (!empty($this->keywords)) + $this->_out('/Keywords '.$this->_textstring($this->keywords)); + if (!empty($this->creator)) + $this->_out('/Creator '.$this->_textstring($this->creator)); + $this->_out('/CreationDate '.$this->_textstring('D:'.@date('YmdHis'))); + } + + public function _putcatalog() + { + $this->_out('/Type /Catalog'); + $this->_out('/Pages 1 0 R'); + if ($this->ZoomMode == 'fullpage') + $this->_out('/OpenAction [3 0 R /Fit]'); + elseif ($this->ZoomMode == 'fullwidth') + $this->_out('/OpenAction [3 0 R /FitH null]'); + elseif ($this->ZoomMode == 'real') + $this->_out('/OpenAction [3 0 R /XYZ null null 1]'); + elseif (!is_string($this->ZoomMode)) + $this->_out('/OpenAction [3 0 R /XYZ null null '.($this->ZoomMode / 100).']'); + if ($this->LayoutMode == 'single') + $this->_out('/PageLayout /SinglePage'); + elseif ($this->LayoutMode == 'continuous') + $this->_out('/PageLayout /OneColumn'); + elseif ($this->LayoutMode == 'two') + $this->_out('/PageLayout /TwoColumnLeft'); + } + + public function _putheader() + { + $this->_out('%PDF-'.$this->PDFVersion); + } + + public function _puttrailer() + { + $this->_out('/Size '.($this->n + 1)); + $this->_out('/Root '.$this->n.' 0 R'); + $this->_out('/Info '.($this->n - 1).' 0 R'); + } + + public function _enddoc() + { + $this->_putheader(); + $this->_putpages(); + $this->_putresources(); + // Info + $this->_newobj(); + $this->_out('<<'); + $this->_putinfo(); + $this->_out('>>'); + $this->_out('endobj'); + // Catalog + $this->_newobj(); + $this->_out('<<'); + $this->_putcatalog(); + $this->_out('>>'); + $this->_out('endobj'); + // Cross-ref + $o = strlen($this->buffer); + $this->_out('xref'); + $this->_out('0 '.($this->n + 1)); + $this->_out('0000000000 65535 f '); + for ($i = 1; $i <= $this->n; $i++) + $this->_out(sprintf('%010d 00000 n ', $this->offsets[ $i ])); + // Trailer + $this->_out('trailer'); + $this->_out('<<'); + $this->_puttrailer(); + $this->_out('>>'); + $this->_out('startxref'); + $this->_out($o); + $this->_out('%%EOF'); + $this->state = 3; + } +// End of class +} + +// Handle special IE contype request +if (isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT'] == 'contype') { + header('Content-Type: application/pdf'); + exit; +} diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/courier.php b/www/modules/tntofficiel/libraries/pdf/fpdf/font/courier.php new file mode 100644 index 00000000..b57fad7c --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/courier.php @@ -0,0 +1,15 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +for ($i=0;$i<=255;$i++) { + $tntofficiel_fpdf_charwidths['courier'][chr($i)]=600; +} +$tntofficiel_fpdf_charwidths['courierB']=$tntofficiel_fpdf_charwidths['courier']; +$tntofficiel_fpdf_charwidths['courierI']=$tntofficiel_fpdf_charwidths['courier']; +$tntofficiel_fpdf_charwidths['courierBI']=$tntofficiel_fpdf_charwidths['courier']; diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/helvetica.php b/www/modules/tntofficiel/libraries/pdf/fpdf/font/helvetica.php new file mode 100644 index 00000000..a1649e45 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/helvetica.php @@ -0,0 +1,43 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +$tntofficiel_fpdf_charwidths['helvetica'] = array( + chr(0) => 278, chr(1) => 278, chr(2) => 278, chr(3) => 278, chr(4) => 278, chr(5) => 278, chr(6) => 278, chr(7) => 278, + chr(8) => 278, chr(9) => 278, chr(10) => 278, chr(11) => 278, chr(12) => 278, chr(13) => 278, chr(14) => 278, chr(15) => 278, + chr(16) => 278, chr(17) => 278, chr(18) => 278, chr(19) => 278, chr(20) => 278, chr(21) => 278, chr(22) => 278, chr(23) => 278, + chr(24) => 278, chr(25) => 278, chr(26) => 278, chr(27) => 278, chr(28) => 278, chr(29) => 278, chr(30) => 278, chr(31) => 278, + ' ' => 278, '!' => 278, '"' => 355, '#' => 556, '$' => 556, '%' => 889, '&' => 667, '\'' => 191, + '(' => 333, ')' => 333, '*' => 389, '+' => 584, ',' => 278, '-' => 333, '.' => 278, '/' => 278, + '0' => 556, '1' => 556, '2' => 556, '3' => 556, '4' => 556, '5' => 556, '6' => 556, '7' => 556, + '8' => 556, '9' => 556, ':' => 278, ';' => 278, '<' => 584, '=' => 584, '>' => 584, '?' => 556, + '@' => 1015, 'A' => 667, 'B' => 667, 'C' => 722, 'D' => 722, 'E' => 667, 'F' => 611, 'G' => 778, + 'H' => 722, 'I' => 278, 'J' => 500, 'K' => 667, 'L' => 556, 'M' => 833, 'N' => 722, 'O' => 778, + 'P' => 667, 'Q' => 778, 'R' => 722, 'S' => 667, 'T' => 611, 'U' => 722, 'V' => 667, 'W' => 944, + 'X' => 667, 'Y' => 667, 'Z' => 611, '[' => 278, '\\' => 278, ']' => 278, '^' => 469, '_' => 556, + '`' => 333, 'a' => 556, 'b' => 556, 'c' => 500, 'd' => 556, 'e' => 556, 'f' => 278, 'g' => 556, + 'h' => 556, 'i' => 222, 'j' => 222, 'k' => 500, 'l' => 222, 'm' => 833, 'n' => 556, 'o' => 556, + 'p' => 556, 'q' => 556, 'r' => 333, 's' => 500, 't' => 278, 'u' => 556, 'v' => 500, 'w' => 722, + 'x' => 500, 'y' => 500, 'z' => 500, '{' => 334, '|' => 260, '}' => 334, '~' => 584, chr(127) => 350, + chr(128) => 556, chr(129) => 350, chr(130) => 222, chr(131) => 556, chr(132) => 333, chr(133) => 1000, chr(134) => 556, chr(135) => 556, + chr(136) => 333, chr(137) => 1000, chr(138) => 667, chr(139) => 333, chr(140) => 1000, chr(141) => 350, chr(142) => 611, chr(143) => 350, + chr(144) => 350, chr(145) => 222, chr(146) => 222, chr(147) => 333, chr(148) => 333, chr(149) => 350, chr(150) => 556, chr(151) => 1000, + chr(152) => 333, chr(153) => 1000, chr(154) => 500, chr(155) => 333, chr(156) => 944, chr(157) => 350, chr(158) => 500, chr(159) => 667, + chr(160) => 278, chr(161) => 333, chr(162) => 556, chr(163) => 556, chr(164) => 556, chr(165) => 556, chr(166) => 260, chr(167) => 556, + chr(168) => 333, chr(169) => 737, chr(170) => 370, chr(171) => 556, chr(172) => 584, chr(173) => 333, chr(174) => 737, chr(175) => 333, + chr(176) => 400, chr(177) => 584, chr(178) => 333, chr(179) => 333, chr(180) => 333, chr(181) => 556, chr(182) => 537, chr(183) => 278, + chr(184) => 333, chr(185) => 333, chr(186) => 365, chr(187) => 556, chr(188) => 834, chr(189) => 834, chr(190) => 834, chr(191) => 611, + chr(192) => 667, chr(193) => 667, chr(194) => 667, chr(195) => 667, chr(196) => 667, chr(197) => 667, chr(198) => 1000, chr(199) => 722, + chr(200) => 667, chr(201) => 667, chr(202) => 667, chr(203) => 667, chr(204) => 278, chr(205) => 278, chr(206) => 278, chr(207) => 278, + chr(208) => 722, chr(209) => 722, chr(210) => 778, chr(211) => 778, chr(212) => 778, chr(213) => 778, chr(214) => 778, chr(215) => 584, + chr(216) => 778, chr(217) => 722, chr(218) => 722, chr(219) => 722, chr(220) => 722, chr(221) => 667, chr(222) => 667, chr(223) => 611, + chr(224) => 556, chr(225) => 556, chr(226) => 556, chr(227) => 556, chr(228) => 556, chr(229) => 556, chr(230) => 889, chr(231) => 500, + chr(232) => 556, chr(233) => 556, chr(234) => 556, chr(235) => 556, chr(236) => 278, chr(237) => 278, chr(238) => 278, chr(239) => 278, + chr(240) => 556, chr(241) => 556, chr(242) => 556, chr(243) => 556, chr(244) => 556, chr(245) => 556, chr(246) => 556, chr(247) => 584, + chr(248) => 611, chr(249) => 556, chr(250) => 556, chr(251) => 556, chr(252) => 556, chr(253) => 500, chr(254) => 556, chr(255) => 500 +); diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/helveticab.php b/www/modules/tntofficiel/libraries/pdf/fpdf/font/helveticab.php new file mode 100644 index 00000000..d5b30412 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/helveticab.php @@ -0,0 +1,23 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +$tntofficiel_fpdf_charwidths['helveticaB']=array( + chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722, + 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889, + 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556, + chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611, + chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556 +); diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/helveticabi.php b/www/modules/tntofficiel/libraries/pdf/fpdf/font/helveticabi.php new file mode 100644 index 00000000..3c8737eb --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/helveticabi.php @@ -0,0 +1,23 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +$tntofficiel_fpdf_charwidths['helveticaBI']=array( + chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722, + 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889, + 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556, + chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611, + chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556 +); diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/helveticai.php b/www/modules/tntofficiel/libraries/pdf/fpdf/font/helveticai.php new file mode 100644 index 00000000..fa7f3713 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/helveticai.php @@ -0,0 +1,23 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +$tntofficiel_fpdf_charwidths['helveticaI']=array( + chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833, + 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556, + chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556, + chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500 +); diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/index.php b/www/modules/tntofficiel/libraries/pdf/fpdf/font/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/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/libraries/pdf/fpdf/font/makefont/cp1250.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1250.map new file mode 100644 index 00000000..33a555ee --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1250.map @@ -0,0 +1,251 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+015A Sacute +!8D U+0164 Tcaron +!8E U+017D Zcaron +!8F U+0179 Zacute +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+015B sacute +!9D U+0165 tcaron +!9E U+017E zcaron +!9F U+017A zacute +!A0 U+00A0 space +!A1 U+02C7 caron +!A2 U+02D8 breve +!A3 U+0141 Lslash +!A4 U+00A4 currency +!A5 U+0104 Aogonek +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+015E Scedilla +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+02DB ogonek +!B3 U+0142 lslash +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+0105 aogonek +!BA U+015F scedilla +!BB U+00BB guillemotright +!BC U+013D Lcaron +!BD U+02DD hungarumlaut +!BE U+013E lcaron +!BF U+017C zdotaccent +!C0 U+0154 Racute +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0139 Lacute +!C6 U+0106 Cacute +!C7 U+00C7 Ccedilla +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+011A Ecaron +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+010E Dcaron +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+0147 Ncaron +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0158 Rcaron +!D9 U+016E Uring +!DA U+00DA Uacute +!DB U+0170 Uhungarumlaut +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+0162 Tcommaaccent +!DF U+00DF germandbls +!E0 U+0155 racute +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+013A lacute +!E6 U+0107 cacute +!E7 U+00E7 ccedilla +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+011B ecaron +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+010F dcaron +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+0148 ncaron +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0159 rcaron +!F9 U+016F uring +!FA U+00FA uacute +!FB U+0171 uhungarumlaut +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+0163 tcommaaccent +!FF U+02D9 dotaccent diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1251.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1251.map new file mode 100644 index 00000000..b5960fe4 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1251.map @@ -0,0 +1,255 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0402 afii10051 +!81 U+0403 afii10052 +!82 U+201A quotesinglbase +!83 U+0453 afii10100 +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+20AC Euro +!89 U+2030 perthousand +!8A U+0409 afii10058 +!8B U+2039 guilsinglleft +!8C U+040A afii10059 +!8D U+040C afii10061 +!8E U+040B afii10060 +!8F U+040F afii10145 +!90 U+0452 afii10099 +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9A U+0459 afii10106 +!9B U+203A guilsinglright +!9C U+045A afii10107 +!9D U+045C afii10109 +!9E U+045B afii10108 +!9F U+045F afii10193 +!A0 U+00A0 space +!A1 U+040E afii10062 +!A2 U+045E afii10110 +!A3 U+0408 afii10057 +!A4 U+00A4 currency +!A5 U+0490 afii10050 +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+0401 afii10023 +!A9 U+00A9 copyright +!AA U+0404 afii10053 +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+0407 afii10056 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+0406 afii10055 +!B3 U+0456 afii10103 +!B4 U+0491 afii10098 +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+0451 afii10071 +!B9 U+2116 afii61352 +!BA U+0454 afii10101 +!BB U+00BB guillemotright +!BC U+0458 afii10105 +!BD U+0405 afii10054 +!BE U+0455 afii10102 +!BF U+0457 afii10104 +!C0 U+0410 afii10017 +!C1 U+0411 afii10018 +!C2 U+0412 afii10019 +!C3 U+0413 afii10020 +!C4 U+0414 afii10021 +!C5 U+0415 afii10022 +!C6 U+0416 afii10024 +!C7 U+0417 afii10025 +!C8 U+0418 afii10026 +!C9 U+0419 afii10027 +!CA U+041A afii10028 +!CB U+041B afii10029 +!CC U+041C afii10030 +!CD U+041D afii10031 +!CE U+041E afii10032 +!CF U+041F afii10033 +!D0 U+0420 afii10034 +!D1 U+0421 afii10035 +!D2 U+0422 afii10036 +!D3 U+0423 afii10037 +!D4 U+0424 afii10038 +!D5 U+0425 afii10039 +!D6 U+0426 afii10040 +!D7 U+0427 afii10041 +!D8 U+0428 afii10042 +!D9 U+0429 afii10043 +!DA U+042A afii10044 +!DB U+042B afii10045 +!DC U+042C afii10046 +!DD U+042D afii10047 +!DE U+042E afii10048 +!DF U+042F afii10049 +!E0 U+0430 afii10065 +!E1 U+0431 afii10066 +!E2 U+0432 afii10067 +!E3 U+0433 afii10068 +!E4 U+0434 afii10069 +!E5 U+0435 afii10070 +!E6 U+0436 afii10072 +!E7 U+0437 afii10073 +!E8 U+0438 afii10074 +!E9 U+0439 afii10075 +!EA U+043A afii10076 +!EB U+043B afii10077 +!EC U+043C afii10078 +!ED U+043D afii10079 +!EE U+043E afii10080 +!EF U+043F afii10081 +!F0 U+0440 afii10082 +!F1 U+0441 afii10083 +!F2 U+0442 afii10084 +!F3 U+0443 afii10085 +!F4 U+0444 afii10086 +!F5 U+0445 afii10087 +!F6 U+0446 afii10088 +!F7 U+0447 afii10089 +!F8 U+0448 afii10090 +!F9 U+0449 afii10091 +!FA U+044A afii10092 +!FB U+044B afii10093 +!FC U+044C afii10094 +!FD U+044D afii10095 +!FE U+044E afii10096 +!FF U+044F afii10097 diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1252.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1252.map new file mode 100644 index 00000000..b79015c3 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1252.map @@ -0,0 +1,251 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+0152 OE +!8E U+017D Zcaron +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+0153 oe +!9E U+017E zcaron +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1253.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1253.map new file mode 100644 index 00000000..b5d843c1 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1253.map @@ -0,0 +1,239 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9B U+203A guilsinglright +!A0 U+00A0 space +!A1 U+0385 dieresistonos +!A2 U+0386 Alphatonos +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+2015 afii00208 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+0384 tonos +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+0388 Epsilontonos +!B9 U+0389 Etatonos +!BA U+038A Iotatonos +!BB U+00BB guillemotright +!BC U+038C Omicrontonos +!BD U+00BD onehalf +!BE U+038E Upsilontonos +!BF U+038F Omegatonos +!C0 U+0390 iotadieresistonos +!C1 U+0391 Alpha +!C2 U+0392 Beta +!C3 U+0393 Gamma +!C4 U+0394 Delta +!C5 U+0395 Epsilon +!C6 U+0396 Zeta +!C7 U+0397 Eta +!C8 U+0398 Theta +!C9 U+0399 Iota +!CA U+039A Kappa +!CB U+039B Lambda +!CC U+039C Mu +!CD U+039D Nu +!CE U+039E Xi +!CF U+039F Omicron +!D0 U+03A0 Pi +!D1 U+03A1 Rho +!D3 U+03A3 Sigma +!D4 U+03A4 Tau +!D5 U+03A5 Upsilon +!D6 U+03A6 Phi +!D7 U+03A7 Chi +!D8 U+03A8 Psi +!D9 U+03A9 Omega +!DA U+03AA Iotadieresis +!DB U+03AB Upsilondieresis +!DC U+03AC alphatonos +!DD U+03AD epsilontonos +!DE U+03AE etatonos +!DF U+03AF iotatonos +!E0 U+03B0 upsilondieresistonos +!E1 U+03B1 alpha +!E2 U+03B2 beta +!E3 U+03B3 gamma +!E4 U+03B4 delta +!E5 U+03B5 epsilon +!E6 U+03B6 zeta +!E7 U+03B7 eta +!E8 U+03B8 theta +!E9 U+03B9 iota +!EA U+03BA kappa +!EB U+03BB lambda +!EC U+03BC mu +!ED U+03BD nu +!EE U+03BE xi +!EF U+03BF omicron +!F0 U+03C0 pi +!F1 U+03C1 rho +!F2 U+03C2 sigma1 +!F3 U+03C3 sigma +!F4 U+03C4 tau +!F5 U+03C5 upsilon +!F6 U+03C6 phi +!F7 U+03C7 chi +!F8 U+03C8 psi +!F9 U+03C9 omega +!FA U+03CA iotadieresis +!FB U+03CB upsilondieresis +!FC U+03CC omicrontonos +!FD U+03CD upsilontonos +!FE U+03CE omegatonos diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1254.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1254.map new file mode 100644 index 00000000..3cc8c789 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1254.map @@ -0,0 +1,249 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8A U+0160 Scaron +!8B U+2039 guilsinglleft +!8C U+0152 OE +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9A U+0161 scaron +!9B U+203A guilsinglright +!9C U+0153 oe +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+011E Gbreve +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0130 Idotaccent +!DE U+015E Scedilla +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+011F gbreve +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0131 dotlessi +!FE U+015F scedilla +!FF U+00FF ydieresis diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1255.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1255.map new file mode 100644 index 00000000..fa135306 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1255.map @@ -0,0 +1,233 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9B U+203A guilsinglright +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+20AA afii57636 +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00D7 multiply +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD sfthyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 middot +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00F7 divide +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+05B0 afii57799 +!C1 U+05B1 afii57801 +!C2 U+05B2 afii57800 +!C3 U+05B3 afii57802 +!C4 U+05B4 afii57793 +!C5 U+05B5 afii57794 +!C6 U+05B6 afii57795 +!C7 U+05B7 afii57798 +!C8 U+05B8 afii57797 +!C9 U+05B9 afii57806 +!CB U+05BB afii57796 +!CC U+05BC afii57807 +!CD U+05BD afii57839 +!CE U+05BE afii57645 +!CF U+05BF afii57841 +!D0 U+05C0 afii57842 +!D1 U+05C1 afii57804 +!D2 U+05C2 afii57803 +!D3 U+05C3 afii57658 +!D4 U+05F0 afii57716 +!D5 U+05F1 afii57717 +!D6 U+05F2 afii57718 +!D7 U+05F3 gereshhebrew +!D8 U+05F4 gershayimhebrew +!E0 U+05D0 afii57664 +!E1 U+05D1 afii57665 +!E2 U+05D2 afii57666 +!E3 U+05D3 afii57667 +!E4 U+05D4 afii57668 +!E5 U+05D5 afii57669 +!E6 U+05D6 afii57670 +!E7 U+05D7 afii57671 +!E8 U+05D8 afii57672 +!E9 U+05D9 afii57673 +!EA U+05DA afii57674 +!EB U+05DB afii57675 +!EC U+05DC afii57676 +!ED U+05DD afii57677 +!EE U+05DE afii57678 +!EF U+05DF afii57679 +!F0 U+05E0 afii57680 +!F1 U+05E1 afii57681 +!F2 U+05E2 afii57682 +!F3 U+05E3 afii57683 +!F4 U+05E4 afii57684 +!F5 U+05E5 afii57685 +!F6 U+05E6 afii57686 +!F7 U+05E7 afii57687 +!F8 U+05E8 afii57688 +!F9 U+05E9 afii57689 +!FA U+05EA afii57690 +!FD U+200E afii299 +!FE U+200F afii300 diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1257.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1257.map new file mode 100644 index 00000000..077fdc34 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1257.map @@ -0,0 +1,244 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!8D U+00A8 dieresis +!8E U+02C7 caron +!8F U+00B8 cedilla +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!99 U+2122 trademark +!9B U+203A guilsinglright +!9D U+00AF macron +!9E U+02DB ogonek +!A0 U+00A0 space +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00D8 Oslash +!A9 U+00A9 copyright +!AA U+0156 Rcommaaccent +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00C6 AE +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00F8 oslash +!B9 U+00B9 onesuperior +!BA U+0157 rcommaaccent +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00E6 ae +!C0 U+0104 Aogonek +!C1 U+012E Iogonek +!C2 U+0100 Amacron +!C3 U+0106 Cacute +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+0118 Eogonek +!C7 U+0112 Emacron +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0179 Zacute +!CB U+0116 Edotaccent +!CC U+0122 Gcommaaccent +!CD U+0136 Kcommaaccent +!CE U+012A Imacron +!CF U+013B Lcommaaccent +!D0 U+0160 Scaron +!D1 U+0143 Nacute +!D2 U+0145 Ncommaaccent +!D3 U+00D3 Oacute +!D4 U+014C Omacron +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0172 Uogonek +!D9 U+0141 Lslash +!DA U+015A Sacute +!DB U+016A Umacron +!DC U+00DC Udieresis +!DD U+017B Zdotaccent +!DE U+017D Zcaron +!DF U+00DF germandbls +!E0 U+0105 aogonek +!E1 U+012F iogonek +!E2 U+0101 amacron +!E3 U+0107 cacute +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+0119 eogonek +!E7 U+0113 emacron +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+017A zacute +!EB U+0117 edotaccent +!EC U+0123 gcommaaccent +!ED U+0137 kcommaaccent +!EE U+012B imacron +!EF U+013C lcommaaccent +!F0 U+0161 scaron +!F1 U+0144 nacute +!F2 U+0146 ncommaaccent +!F3 U+00F3 oacute +!F4 U+014D omacron +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0173 uogonek +!F9 U+0142 lslash +!FA U+015B sacute +!FB U+016B umacron +!FC U+00FC udieresis +!FD U+017C zdotaccent +!FE U+017E zcaron +!FF U+02D9 dotaccent diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1258.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1258.map new file mode 100644 index 00000000..7032c35d --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp1258.map @@ -0,0 +1,247 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!82 U+201A quotesinglbase +!83 U+0192 florin +!84 U+201E quotedblbase +!85 U+2026 ellipsis +!86 U+2020 dagger +!87 U+2021 daggerdbl +!88 U+02C6 circumflex +!89 U+2030 perthousand +!8B U+2039 guilsinglleft +!8C U+0152 OE +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!98 U+02DC tilde +!99 U+2122 trademark +!9B U+203A guilsinglright +!9C U+0153 oe +!9F U+0178 Ydieresis +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+0300 gravecomb +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+0110 Dcroat +!D1 U+00D1 Ntilde +!D2 U+0309 hookabovecomb +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+01A0 Ohorn +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+01AF Uhorn +!DE U+0303 tildecomb +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+0301 acutecomb +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+0111 dcroat +!F1 U+00F1 ntilde +!F2 U+0323 dotbelowcomb +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+01A1 ohorn +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+01B0 uhorn +!FE U+20AB dong +!FF U+00FF ydieresis diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp874.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp874.map new file mode 100644 index 00000000..16330d04 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/cp874.map @@ -0,0 +1,225 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+20AC Euro +!85 U+2026 ellipsis +!91 U+2018 quoteleft +!92 U+2019 quoteright +!93 U+201C quotedblleft +!94 U+201D quotedblright +!95 U+2022 bullet +!96 U+2013 endash +!97 U+2014 emdash +!A0 U+00A0 space +!A1 U+0E01 kokaithai +!A2 U+0E02 khokhaithai +!A3 U+0E03 khokhuatthai +!A4 U+0E04 khokhwaithai +!A5 U+0E05 khokhonthai +!A6 U+0E06 khorakhangthai +!A7 U+0E07 ngonguthai +!A8 U+0E08 chochanthai +!A9 U+0E09 chochingthai +!AA U+0E0A chochangthai +!AB U+0E0B sosothai +!AC U+0E0C chochoethai +!AD U+0E0D yoyingthai +!AE U+0E0E dochadathai +!AF U+0E0F topatakthai +!B0 U+0E10 thothanthai +!B1 U+0E11 thonangmonthothai +!B2 U+0E12 thophuthaothai +!B3 U+0E13 nonenthai +!B4 U+0E14 dodekthai +!B5 U+0E15 totaothai +!B6 U+0E16 thothungthai +!B7 U+0E17 thothahanthai +!B8 U+0E18 thothongthai +!B9 U+0E19 nonuthai +!BA U+0E1A bobaimaithai +!BB U+0E1B poplathai +!BC U+0E1C phophungthai +!BD U+0E1D fofathai +!BE U+0E1E phophanthai +!BF U+0E1F fofanthai +!C0 U+0E20 phosamphaothai +!C1 U+0E21 momathai +!C2 U+0E22 yoyakthai +!C3 U+0E23 roruathai +!C4 U+0E24 ruthai +!C5 U+0E25 lolingthai +!C6 U+0E26 luthai +!C7 U+0E27 wowaenthai +!C8 U+0E28 sosalathai +!C9 U+0E29 sorusithai +!CA U+0E2A sosuathai +!CB U+0E2B hohipthai +!CC U+0E2C lochulathai +!CD U+0E2D oangthai +!CE U+0E2E honokhukthai +!CF U+0E2F paiyannoithai +!D0 U+0E30 saraathai +!D1 U+0E31 maihanakatthai +!D2 U+0E32 saraaathai +!D3 U+0E33 saraamthai +!D4 U+0E34 saraithai +!D5 U+0E35 saraiithai +!D6 U+0E36 sarauethai +!D7 U+0E37 saraueethai +!D8 U+0E38 sarauthai +!D9 U+0E39 sarauuthai +!DA U+0E3A phinthuthai +!DF U+0E3F bahtthai +!E0 U+0E40 saraethai +!E1 U+0E41 saraaethai +!E2 U+0E42 saraothai +!E3 U+0E43 saraaimaimuanthai +!E4 U+0E44 saraaimaimalaithai +!E5 U+0E45 lakkhangyaothai +!E6 U+0E46 maiyamokthai +!E7 U+0E47 maitaikhuthai +!E8 U+0E48 maiekthai +!E9 U+0E49 maithothai +!EA U+0E4A maitrithai +!EB U+0E4B maichattawathai +!EC U+0E4C thanthakhatthai +!ED U+0E4D nikhahitthai +!EE U+0E4E yamakkanthai +!EF U+0E4F fongmanthai +!F0 U+0E50 zerothai +!F1 U+0E51 onethai +!F2 U+0E52 twothai +!F3 U+0E53 threethai +!F4 U+0E54 fourthai +!F5 U+0E55 fivethai +!F6 U+0E56 sixthai +!F7 U+0E57 seventhai +!F8 U+0E58 eightthai +!F9 U+0E59 ninethai +!FA U+0E5A angkhankhuthai +!FB U+0E5B khomutthai diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/index.php b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/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/libraries/pdf/fpdf/font/makefont/iso-8859-1.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-1.map new file mode 100644 index 00000000..74fb2fe5 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-1.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-11.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-11.map new file mode 100644 index 00000000..8cf66731 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-11.map @@ -0,0 +1,248 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0E01 kokaithai +!A2 U+0E02 khokhaithai +!A3 U+0E03 khokhuatthai +!A4 U+0E04 khokhwaithai +!A5 U+0E05 khokhonthai +!A6 U+0E06 khorakhangthai +!A7 U+0E07 ngonguthai +!A8 U+0E08 chochanthai +!A9 U+0E09 chochingthai +!AA U+0E0A chochangthai +!AB U+0E0B sosothai +!AC U+0E0C chochoethai +!AD U+0E0D yoyingthai +!AE U+0E0E dochadathai +!AF U+0E0F topatakthai +!B0 U+0E10 thothanthai +!B1 U+0E11 thonangmonthothai +!B2 U+0E12 thophuthaothai +!B3 U+0E13 nonenthai +!B4 U+0E14 dodekthai +!B5 U+0E15 totaothai +!B6 U+0E16 thothungthai +!B7 U+0E17 thothahanthai +!B8 U+0E18 thothongthai +!B9 U+0E19 nonuthai +!BA U+0E1A bobaimaithai +!BB U+0E1B poplathai +!BC U+0E1C phophungthai +!BD U+0E1D fofathai +!BE U+0E1E phophanthai +!BF U+0E1F fofanthai +!C0 U+0E20 phosamphaothai +!C1 U+0E21 momathai +!C2 U+0E22 yoyakthai +!C3 U+0E23 roruathai +!C4 U+0E24 ruthai +!C5 U+0E25 lolingthai +!C6 U+0E26 luthai +!C7 U+0E27 wowaenthai +!C8 U+0E28 sosalathai +!C9 U+0E29 sorusithai +!CA U+0E2A sosuathai +!CB U+0E2B hohipthai +!CC U+0E2C lochulathai +!CD U+0E2D oangthai +!CE U+0E2E honokhukthai +!CF U+0E2F paiyannoithai +!D0 U+0E30 saraathai +!D1 U+0E31 maihanakatthai +!D2 U+0E32 saraaathai +!D3 U+0E33 saraamthai +!D4 U+0E34 saraithai +!D5 U+0E35 saraiithai +!D6 U+0E36 sarauethai +!D7 U+0E37 saraueethai +!D8 U+0E38 sarauthai +!D9 U+0E39 sarauuthai +!DA U+0E3A phinthuthai +!DF U+0E3F bahtthai +!E0 U+0E40 saraethai +!E1 U+0E41 saraaethai +!E2 U+0E42 saraothai +!E3 U+0E43 saraaimaimuanthai +!E4 U+0E44 saraaimaimalaithai +!E5 U+0E45 lakkhangyaothai +!E6 U+0E46 maiyamokthai +!E7 U+0E47 maitaikhuthai +!E8 U+0E48 maiekthai +!E9 U+0E49 maithothai +!EA U+0E4A maitrithai +!EB U+0E4B maichattawathai +!EC U+0E4C thanthakhatthai +!ED U+0E4D nikhahitthai +!EE U+0E4E yamakkanthai +!EF U+0E4F fongmanthai +!F0 U+0E50 zerothai +!F1 U+0E51 onethai +!F2 U+0E52 twothai +!F3 U+0E53 threethai +!F4 U+0E54 fourthai +!F5 U+0E55 fivethai +!F6 U+0E56 sixthai +!F7 U+0E57 seventhai +!F8 U+0E58 eightthai +!F9 U+0E59 ninethai +!FA U+0E5A angkhankhuthai +!FB U+0E5B khomutthai diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-15.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-15.map new file mode 100644 index 00000000..2689703d --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-15.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+20AC Euro +!A5 U+00A5 yen +!A6 U+0160 Scaron +!A7 U+00A7 section +!A8 U+0161 scaron +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+017D Zcaron +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+017E zcaron +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+0152 OE +!BD U+0153 oe +!BE U+0178 Ydieresis +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+00D0 Eth +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+00DE Thorn +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+00F0 eth +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+00FE thorn +!FF U+00FF ydieresis diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-16.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-16.map new file mode 100644 index 00000000..89b802a7 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-16.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+0105 aogonek +!A3 U+0141 Lslash +!A4 U+20AC Euro +!A5 U+201E quotedblbase +!A6 U+0160 Scaron +!A7 U+00A7 section +!A8 U+0161 scaron +!A9 U+00A9 copyright +!AA U+0218 Scommaaccent +!AB U+00AB guillemotleft +!AC U+0179 Zacute +!AD U+00AD hyphen +!AE U+017A zacute +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+010C Ccaron +!B3 U+0142 lslash +!B4 U+017D Zcaron +!B5 U+201D quotedblright +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+017E zcaron +!B9 U+010D ccaron +!BA U+0219 scommaaccent +!BB U+00BB guillemotright +!BC U+0152 OE +!BD U+0153 oe +!BE U+0178 Ydieresis +!BF U+017C zdotaccent +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0106 Cacute +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+015A Sacute +!D8 U+0170 Uhungarumlaut +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0118 Eogonek +!DE U+021A Tcommaaccent +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+0107 cacute +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+015B sacute +!F8 U+0171 uhungarumlaut +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0119 eogonek +!FE U+021B tcommaaccent +!FF U+00FF ydieresis diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-2.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-2.map new file mode 100644 index 00000000..af9588d0 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-2.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+02D8 breve +!A3 U+0141 Lslash +!A4 U+00A4 currency +!A5 U+013D Lcaron +!A6 U+015A Sacute +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+0160 Scaron +!AA U+015E Scedilla +!AB U+0164 Tcaron +!AC U+0179 Zacute +!AD U+00AD hyphen +!AE U+017D Zcaron +!AF U+017B Zdotaccent +!B0 U+00B0 degree +!B1 U+0105 aogonek +!B2 U+02DB ogonek +!B3 U+0142 lslash +!B4 U+00B4 acute +!B5 U+013E lcaron +!B6 U+015B sacute +!B7 U+02C7 caron +!B8 U+00B8 cedilla +!B9 U+0161 scaron +!BA U+015F scedilla +!BB U+0165 tcaron +!BC U+017A zacute +!BD U+02DD hungarumlaut +!BE U+017E zcaron +!BF U+017C zdotaccent +!C0 U+0154 Racute +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+0102 Abreve +!C4 U+00C4 Adieresis +!C5 U+0139 Lacute +!C6 U+0106 Cacute +!C7 U+00C7 Ccedilla +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+011A Ecaron +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+010E Dcaron +!D0 U+0110 Dcroat +!D1 U+0143 Nacute +!D2 U+0147 Ncaron +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+0150 Ohungarumlaut +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+0158 Rcaron +!D9 U+016E Uring +!DA U+00DA Uacute +!DB U+0170 Uhungarumlaut +!DC U+00DC Udieresis +!DD U+00DD Yacute +!DE U+0162 Tcommaaccent +!DF U+00DF germandbls +!E0 U+0155 racute +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+0103 abreve +!E4 U+00E4 adieresis +!E5 U+013A lacute +!E6 U+0107 cacute +!E7 U+00E7 ccedilla +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+011B ecaron +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+010F dcaron +!F0 U+0111 dcroat +!F1 U+0144 nacute +!F2 U+0148 ncaron +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+0151 ohungarumlaut +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+0159 rcaron +!F9 U+016F uring +!FA U+00FA uacute +!FB U+0171 uhungarumlaut +!FC U+00FC udieresis +!FD U+00FD yacute +!FE U+0163 tcommaaccent +!FF U+02D9 dotaccent diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-4.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-4.map new file mode 100644 index 00000000..e81dd7f3 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-4.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0104 Aogonek +!A2 U+0138 kgreenlandic +!A3 U+0156 Rcommaaccent +!A4 U+00A4 currency +!A5 U+0128 Itilde +!A6 U+013B Lcommaaccent +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+0160 Scaron +!AA U+0112 Emacron +!AB U+0122 Gcommaaccent +!AC U+0166 Tbar +!AD U+00AD hyphen +!AE U+017D Zcaron +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+0105 aogonek +!B2 U+02DB ogonek +!B3 U+0157 rcommaaccent +!B4 U+00B4 acute +!B5 U+0129 itilde +!B6 U+013C lcommaaccent +!B7 U+02C7 caron +!B8 U+00B8 cedilla +!B9 U+0161 scaron +!BA U+0113 emacron +!BB U+0123 gcommaaccent +!BC U+0167 tbar +!BD U+014A Eng +!BE U+017E zcaron +!BF U+014B eng +!C0 U+0100 Amacron +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+012E Iogonek +!C8 U+010C Ccaron +!C9 U+00C9 Eacute +!CA U+0118 Eogonek +!CB U+00CB Edieresis +!CC U+0116 Edotaccent +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+012A Imacron +!D0 U+0110 Dcroat +!D1 U+0145 Ncommaaccent +!D2 U+014C Omacron +!D3 U+0136 Kcommaaccent +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+0172 Uogonek +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0168 Utilde +!DE U+016A Umacron +!DF U+00DF germandbls +!E0 U+0101 amacron +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+012F iogonek +!E8 U+010D ccaron +!E9 U+00E9 eacute +!EA U+0119 eogonek +!EB U+00EB edieresis +!EC U+0117 edotaccent +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+012B imacron +!F0 U+0111 dcroat +!F1 U+0146 ncommaaccent +!F2 U+014D omacron +!F3 U+0137 kcommaaccent +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+0173 uogonek +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0169 utilde +!FE U+016B umacron +!FF U+02D9 dotaccent diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-5.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-5.map new file mode 100644 index 00000000..8030fd54 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-5.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+0401 afii10023 +!A2 U+0402 afii10051 +!A3 U+0403 afii10052 +!A4 U+0404 afii10053 +!A5 U+0405 afii10054 +!A6 U+0406 afii10055 +!A7 U+0407 afii10056 +!A8 U+0408 afii10057 +!A9 U+0409 afii10058 +!AA U+040A afii10059 +!AB U+040B afii10060 +!AC U+040C afii10061 +!AD U+00AD hyphen +!AE U+040E afii10062 +!AF U+040F afii10145 +!B0 U+0410 afii10017 +!B1 U+0411 afii10018 +!B2 U+0412 afii10019 +!B3 U+0413 afii10020 +!B4 U+0414 afii10021 +!B5 U+0415 afii10022 +!B6 U+0416 afii10024 +!B7 U+0417 afii10025 +!B8 U+0418 afii10026 +!B9 U+0419 afii10027 +!BA U+041A afii10028 +!BB U+041B afii10029 +!BC U+041C afii10030 +!BD U+041D afii10031 +!BE U+041E afii10032 +!BF U+041F afii10033 +!C0 U+0420 afii10034 +!C1 U+0421 afii10035 +!C2 U+0422 afii10036 +!C3 U+0423 afii10037 +!C4 U+0424 afii10038 +!C5 U+0425 afii10039 +!C6 U+0426 afii10040 +!C7 U+0427 afii10041 +!C8 U+0428 afii10042 +!C9 U+0429 afii10043 +!CA U+042A afii10044 +!CB U+042B afii10045 +!CC U+042C afii10046 +!CD U+042D afii10047 +!CE U+042E afii10048 +!CF U+042F afii10049 +!D0 U+0430 afii10065 +!D1 U+0431 afii10066 +!D2 U+0432 afii10067 +!D3 U+0433 afii10068 +!D4 U+0434 afii10069 +!D5 U+0435 afii10070 +!D6 U+0436 afii10072 +!D7 U+0437 afii10073 +!D8 U+0438 afii10074 +!D9 U+0439 afii10075 +!DA U+043A afii10076 +!DB U+043B afii10077 +!DC U+043C afii10078 +!DD U+043D afii10079 +!DE U+043E afii10080 +!DF U+043F afii10081 +!E0 U+0440 afii10082 +!E1 U+0441 afii10083 +!E2 U+0442 afii10084 +!E3 U+0443 afii10085 +!E4 U+0444 afii10086 +!E5 U+0445 afii10087 +!E6 U+0446 afii10088 +!E7 U+0447 afii10089 +!E8 U+0448 afii10090 +!E9 U+0449 afii10091 +!EA U+044A afii10092 +!EB U+044B afii10093 +!EC U+044C afii10094 +!ED U+044D afii10095 +!EE U+044E afii10096 +!EF U+044F afii10097 +!F0 U+2116 afii61352 +!F1 U+0451 afii10071 +!F2 U+0452 afii10099 +!F3 U+0453 afii10100 +!F4 U+0454 afii10101 +!F5 U+0455 afii10102 +!F6 U+0456 afii10103 +!F7 U+0457 afii10104 +!F8 U+0458 afii10105 +!F9 U+0459 afii10106 +!FA U+045A afii10107 +!FB U+045B afii10108 +!FC U+045C afii10109 +!FD U+00A7 section +!FE U+045E afii10110 +!FF U+045F afii10193 diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-7.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-7.map new file mode 100644 index 00000000..be8698af --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-7.map @@ -0,0 +1,250 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+2018 quoteleft +!A2 U+2019 quoteright +!A3 U+00A3 sterling +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AF U+2015 afii00208 +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+0384 tonos +!B5 U+0385 dieresistonos +!B6 U+0386 Alphatonos +!B7 U+00B7 periodcentered +!B8 U+0388 Epsilontonos +!B9 U+0389 Etatonos +!BA U+038A Iotatonos +!BB U+00BB guillemotright +!BC U+038C Omicrontonos +!BD U+00BD onehalf +!BE U+038E Upsilontonos +!BF U+038F Omegatonos +!C0 U+0390 iotadieresistonos +!C1 U+0391 Alpha +!C2 U+0392 Beta +!C3 U+0393 Gamma +!C4 U+0394 Delta +!C5 U+0395 Epsilon +!C6 U+0396 Zeta +!C7 U+0397 Eta +!C8 U+0398 Theta +!C9 U+0399 Iota +!CA U+039A Kappa +!CB U+039B Lambda +!CC U+039C Mu +!CD U+039D Nu +!CE U+039E Xi +!CF U+039F Omicron +!D0 U+03A0 Pi +!D1 U+03A1 Rho +!D3 U+03A3 Sigma +!D4 U+03A4 Tau +!D5 U+03A5 Upsilon +!D6 U+03A6 Phi +!D7 U+03A7 Chi +!D8 U+03A8 Psi +!D9 U+03A9 Omega +!DA U+03AA Iotadieresis +!DB U+03AB Upsilondieresis +!DC U+03AC alphatonos +!DD U+03AD epsilontonos +!DE U+03AE etatonos +!DF U+03AF iotatonos +!E0 U+03B0 upsilondieresistonos +!E1 U+03B1 alpha +!E2 U+03B2 beta +!E3 U+03B3 gamma +!E4 U+03B4 delta +!E5 U+03B5 epsilon +!E6 U+03B6 zeta +!E7 U+03B7 eta +!E8 U+03B8 theta +!E9 U+03B9 iota +!EA U+03BA kappa +!EB U+03BB lambda +!EC U+03BC mu +!ED U+03BD nu +!EE U+03BE xi +!EF U+03BF omicron +!F0 U+03C0 pi +!F1 U+03C1 rho +!F2 U+03C2 sigma1 +!F3 U+03C3 sigma +!F4 U+03C4 tau +!F5 U+03C5 upsilon +!F6 U+03C6 phi +!F7 U+03C7 chi +!F8 U+03C8 psi +!F9 U+03C9 omega +!FA U+03CA iotadieresis +!FB U+03CB upsilondieresis +!FC U+03CC omicrontonos +!FD U+03CD upsilontonos +!FE U+03CE omegatonos diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-9.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-9.map new file mode 100644 index 00000000..a60bb19d --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/iso-8859-9.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+0080 .notdef +!81 U+0081 .notdef +!82 U+0082 .notdef +!83 U+0083 .notdef +!84 U+0084 .notdef +!85 U+0085 .notdef +!86 U+0086 .notdef +!87 U+0087 .notdef +!88 U+0088 .notdef +!89 U+0089 .notdef +!8A U+008A .notdef +!8B U+008B .notdef +!8C U+008C .notdef +!8D U+008D .notdef +!8E U+008E .notdef +!8F U+008F .notdef +!90 U+0090 .notdef +!91 U+0091 .notdef +!92 U+0092 .notdef +!93 U+0093 .notdef +!94 U+0094 .notdef +!95 U+0095 .notdef +!96 U+0096 .notdef +!97 U+0097 .notdef +!98 U+0098 .notdef +!99 U+0099 .notdef +!9A U+009A .notdef +!9B U+009B .notdef +!9C U+009C .notdef +!9D U+009D .notdef +!9E U+009E .notdef +!9F U+009F .notdef +!A0 U+00A0 space +!A1 U+00A1 exclamdown +!A2 U+00A2 cent +!A3 U+00A3 sterling +!A4 U+00A4 currency +!A5 U+00A5 yen +!A6 U+00A6 brokenbar +!A7 U+00A7 section +!A8 U+00A8 dieresis +!A9 U+00A9 copyright +!AA U+00AA ordfeminine +!AB U+00AB guillemotleft +!AC U+00AC logicalnot +!AD U+00AD hyphen +!AE U+00AE registered +!AF U+00AF macron +!B0 U+00B0 degree +!B1 U+00B1 plusminus +!B2 U+00B2 twosuperior +!B3 U+00B3 threesuperior +!B4 U+00B4 acute +!B5 U+00B5 mu +!B6 U+00B6 paragraph +!B7 U+00B7 periodcentered +!B8 U+00B8 cedilla +!B9 U+00B9 onesuperior +!BA U+00BA ordmasculine +!BB U+00BB guillemotright +!BC U+00BC onequarter +!BD U+00BD onehalf +!BE U+00BE threequarters +!BF U+00BF questiondown +!C0 U+00C0 Agrave +!C1 U+00C1 Aacute +!C2 U+00C2 Acircumflex +!C3 U+00C3 Atilde +!C4 U+00C4 Adieresis +!C5 U+00C5 Aring +!C6 U+00C6 AE +!C7 U+00C7 Ccedilla +!C8 U+00C8 Egrave +!C9 U+00C9 Eacute +!CA U+00CA Ecircumflex +!CB U+00CB Edieresis +!CC U+00CC Igrave +!CD U+00CD Iacute +!CE U+00CE Icircumflex +!CF U+00CF Idieresis +!D0 U+011E Gbreve +!D1 U+00D1 Ntilde +!D2 U+00D2 Ograve +!D3 U+00D3 Oacute +!D4 U+00D4 Ocircumflex +!D5 U+00D5 Otilde +!D6 U+00D6 Odieresis +!D7 U+00D7 multiply +!D8 U+00D8 Oslash +!D9 U+00D9 Ugrave +!DA U+00DA Uacute +!DB U+00DB Ucircumflex +!DC U+00DC Udieresis +!DD U+0130 Idotaccent +!DE U+015E Scedilla +!DF U+00DF germandbls +!E0 U+00E0 agrave +!E1 U+00E1 aacute +!E2 U+00E2 acircumflex +!E3 U+00E3 atilde +!E4 U+00E4 adieresis +!E5 U+00E5 aring +!E6 U+00E6 ae +!E7 U+00E7 ccedilla +!E8 U+00E8 egrave +!E9 U+00E9 eacute +!EA U+00EA ecircumflex +!EB U+00EB edieresis +!EC U+00EC igrave +!ED U+00ED iacute +!EE U+00EE icircumflex +!EF U+00EF idieresis +!F0 U+011F gbreve +!F1 U+00F1 ntilde +!F2 U+00F2 ograve +!F3 U+00F3 oacute +!F4 U+00F4 ocircumflex +!F5 U+00F5 otilde +!F6 U+00F6 odieresis +!F7 U+00F7 divide +!F8 U+00F8 oslash +!F9 U+00F9 ugrave +!FA U+00FA uacute +!FB U+00FB ucircumflex +!FC U+00FC udieresis +!FD U+0131 dotlessi +!FE U+015F scedilla +!FF U+00FF ydieresis diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/koi8-r.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/koi8-r.map new file mode 100644 index 00000000..026880d6 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/koi8-r.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+2500 SF100000 +!81 U+2502 SF110000 +!82 U+250C SF010000 +!83 U+2510 SF030000 +!84 U+2514 SF020000 +!85 U+2518 SF040000 +!86 U+251C SF080000 +!87 U+2524 SF090000 +!88 U+252C SF060000 +!89 U+2534 SF070000 +!8A U+253C SF050000 +!8B U+2580 upblock +!8C U+2584 dnblock +!8D U+2588 block +!8E U+258C lfblock +!8F U+2590 rtblock +!90 U+2591 ltshade +!91 U+2592 shade +!92 U+2593 dkshade +!93 U+2320 integraltp +!94 U+25A0 filledbox +!95 U+2219 periodcentered +!96 U+221A radical +!97 U+2248 approxequal +!98 U+2264 lessequal +!99 U+2265 greaterequal +!9A U+00A0 space +!9B U+2321 integralbt +!9C U+00B0 degree +!9D U+00B2 twosuperior +!9E U+00B7 periodcentered +!9F U+00F7 divide +!A0 U+2550 SF430000 +!A1 U+2551 SF240000 +!A2 U+2552 SF510000 +!A3 U+0451 afii10071 +!A4 U+2553 SF520000 +!A5 U+2554 SF390000 +!A6 U+2555 SF220000 +!A7 U+2556 SF210000 +!A8 U+2557 SF250000 +!A9 U+2558 SF500000 +!AA U+2559 SF490000 +!AB U+255A SF380000 +!AC U+255B SF280000 +!AD U+255C SF270000 +!AE U+255D SF260000 +!AF U+255E SF360000 +!B0 U+255F SF370000 +!B1 U+2560 SF420000 +!B2 U+2561 SF190000 +!B3 U+0401 afii10023 +!B4 U+2562 SF200000 +!B5 U+2563 SF230000 +!B6 U+2564 SF470000 +!B7 U+2565 SF480000 +!B8 U+2566 SF410000 +!B9 U+2567 SF450000 +!BA U+2568 SF460000 +!BB U+2569 SF400000 +!BC U+256A SF540000 +!BD U+256B SF530000 +!BE U+256C SF440000 +!BF U+00A9 copyright +!C0 U+044E afii10096 +!C1 U+0430 afii10065 +!C2 U+0431 afii10066 +!C3 U+0446 afii10088 +!C4 U+0434 afii10069 +!C5 U+0435 afii10070 +!C6 U+0444 afii10086 +!C7 U+0433 afii10068 +!C8 U+0445 afii10087 +!C9 U+0438 afii10074 +!CA U+0439 afii10075 +!CB U+043A afii10076 +!CC U+043B afii10077 +!CD U+043C afii10078 +!CE U+043D afii10079 +!CF U+043E afii10080 +!D0 U+043F afii10081 +!D1 U+044F afii10097 +!D2 U+0440 afii10082 +!D3 U+0441 afii10083 +!D4 U+0442 afii10084 +!D5 U+0443 afii10085 +!D6 U+0436 afii10072 +!D7 U+0432 afii10067 +!D8 U+044C afii10094 +!D9 U+044B afii10093 +!DA U+0437 afii10073 +!DB U+0448 afii10090 +!DC U+044D afii10095 +!DD U+0449 afii10091 +!DE U+0447 afii10089 +!DF U+044A afii10092 +!E0 U+042E afii10048 +!E1 U+0410 afii10017 +!E2 U+0411 afii10018 +!E3 U+0426 afii10040 +!E4 U+0414 afii10021 +!E5 U+0415 afii10022 +!E6 U+0424 afii10038 +!E7 U+0413 afii10020 +!E8 U+0425 afii10039 +!E9 U+0418 afii10026 +!EA U+0419 afii10027 +!EB U+041A afii10028 +!EC U+041B afii10029 +!ED U+041C afii10030 +!EE U+041D afii10031 +!EF U+041E afii10032 +!F0 U+041F afii10033 +!F1 U+042F afii10049 +!F2 U+0420 afii10034 +!F3 U+0421 afii10035 +!F4 U+0422 afii10036 +!F5 U+0423 afii10037 +!F6 U+0416 afii10024 +!F7 U+0412 afii10019 +!F8 U+042C afii10046 +!F9 U+042B afii10045 +!FA U+0417 afii10025 +!FB U+0428 afii10042 +!FC U+042D afii10047 +!FD U+0429 afii10043 +!FE U+0427 afii10041 +!FF U+042A afii10044 diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/koi8-u.map b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/koi8-u.map new file mode 100644 index 00000000..97d9d031 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/koi8-u.map @@ -0,0 +1,256 @@ +!00 U+0000 .notdef +!01 U+0001 .notdef +!02 U+0002 .notdef +!03 U+0003 .notdef +!04 U+0004 .notdef +!05 U+0005 .notdef +!06 U+0006 .notdef +!07 U+0007 .notdef +!08 U+0008 .notdef +!09 U+0009 .notdef +!0A U+000A .notdef +!0B U+000B .notdef +!0C U+000C .notdef +!0D U+000D .notdef +!0E U+000E .notdef +!0F U+000F .notdef +!10 U+0010 .notdef +!11 U+0011 .notdef +!12 U+0012 .notdef +!13 U+0013 .notdef +!14 U+0014 .notdef +!15 U+0015 .notdef +!16 U+0016 .notdef +!17 U+0017 .notdef +!18 U+0018 .notdef +!19 U+0019 .notdef +!1A U+001A .notdef +!1B U+001B .notdef +!1C U+001C .notdef +!1D U+001D .notdef +!1E U+001E .notdef +!1F U+001F .notdef +!20 U+0020 space +!21 U+0021 exclam +!22 U+0022 quotedbl +!23 U+0023 numbersign +!24 U+0024 dollar +!25 U+0025 percent +!26 U+0026 ampersand +!27 U+0027 quotesingle +!28 U+0028 parenleft +!29 U+0029 parenright +!2A U+002A asterisk +!2B U+002B plus +!2C U+002C comma +!2D U+002D hyphen +!2E U+002E period +!2F U+002F slash +!30 U+0030 zero +!31 U+0031 one +!32 U+0032 two +!33 U+0033 three +!34 U+0034 four +!35 U+0035 five +!36 U+0036 six +!37 U+0037 seven +!38 U+0038 eight +!39 U+0039 nine +!3A U+003A colon +!3B U+003B semicolon +!3C U+003C less +!3D U+003D equal +!3E U+003E greater +!3F U+003F question +!40 U+0040 at +!41 U+0041 A +!42 U+0042 B +!43 U+0043 C +!44 U+0044 D +!45 U+0045 E +!46 U+0046 F +!47 U+0047 G +!48 U+0048 H +!49 U+0049 I +!4A U+004A J +!4B U+004B K +!4C U+004C L +!4D U+004D M +!4E U+004E N +!4F U+004F O +!50 U+0050 P +!51 U+0051 Q +!52 U+0052 R +!53 U+0053 S +!54 U+0054 T +!55 U+0055 U +!56 U+0056 V +!57 U+0057 W +!58 U+0058 X +!59 U+0059 Y +!5A U+005A Z +!5B U+005B bracketleft +!5C U+005C backslash +!5D U+005D bracketright +!5E U+005E asciicircum +!5F U+005F underscore +!60 U+0060 grave +!61 U+0061 a +!62 U+0062 b +!63 U+0063 c +!64 U+0064 d +!65 U+0065 e +!66 U+0066 f +!67 U+0067 g +!68 U+0068 h +!69 U+0069 i +!6A U+006A j +!6B U+006B k +!6C U+006C l +!6D U+006D m +!6E U+006E n +!6F U+006F o +!70 U+0070 p +!71 U+0071 q +!72 U+0072 r +!73 U+0073 s +!74 U+0074 t +!75 U+0075 u +!76 U+0076 v +!77 U+0077 w +!78 U+0078 x +!79 U+0079 y +!7A U+007A z +!7B U+007B braceleft +!7C U+007C bar +!7D U+007D braceright +!7E U+007E asciitilde +!7F U+007F .notdef +!80 U+2500 SF100000 +!81 U+2502 SF110000 +!82 U+250C SF010000 +!83 U+2510 SF030000 +!84 U+2514 SF020000 +!85 U+2518 SF040000 +!86 U+251C SF080000 +!87 U+2524 SF090000 +!88 U+252C SF060000 +!89 U+2534 SF070000 +!8A U+253C SF050000 +!8B U+2580 upblock +!8C U+2584 dnblock +!8D U+2588 block +!8E U+258C lfblock +!8F U+2590 rtblock +!90 U+2591 ltshade +!91 U+2592 shade +!92 U+2593 dkshade +!93 U+2320 integraltp +!94 U+25A0 filledbox +!95 U+2022 bullet +!96 U+221A radical +!97 U+2248 approxequal +!98 U+2264 lessequal +!99 U+2265 greaterequal +!9A U+00A0 space +!9B U+2321 integralbt +!9C U+00B0 degree +!9D U+00B2 twosuperior +!9E U+00B7 periodcentered +!9F U+00F7 divide +!A0 U+2550 SF430000 +!A1 U+2551 SF240000 +!A2 U+2552 SF510000 +!A3 U+0451 afii10071 +!A4 U+0454 afii10101 +!A5 U+2554 SF390000 +!A6 U+0456 afii10103 +!A7 U+0457 afii10104 +!A8 U+2557 SF250000 +!A9 U+2558 SF500000 +!AA U+2559 SF490000 +!AB U+255A SF380000 +!AC U+255B SF280000 +!AD U+0491 afii10098 +!AE U+255D SF260000 +!AF U+255E SF360000 +!B0 U+255F SF370000 +!B1 U+2560 SF420000 +!B2 U+2561 SF190000 +!B3 U+0401 afii10023 +!B4 U+0404 afii10053 +!B5 U+2563 SF230000 +!B6 U+0406 afii10055 +!B7 U+0407 afii10056 +!B8 U+2566 SF410000 +!B9 U+2567 SF450000 +!BA U+2568 SF460000 +!BB U+2569 SF400000 +!BC U+256A SF540000 +!BD U+0490 afii10050 +!BE U+256C SF440000 +!BF U+00A9 copyright +!C0 U+044E afii10096 +!C1 U+0430 afii10065 +!C2 U+0431 afii10066 +!C3 U+0446 afii10088 +!C4 U+0434 afii10069 +!C5 U+0435 afii10070 +!C6 U+0444 afii10086 +!C7 U+0433 afii10068 +!C8 U+0445 afii10087 +!C9 U+0438 afii10074 +!CA U+0439 afii10075 +!CB U+043A afii10076 +!CC U+043B afii10077 +!CD U+043C afii10078 +!CE U+043D afii10079 +!CF U+043E afii10080 +!D0 U+043F afii10081 +!D1 U+044F afii10097 +!D2 U+0440 afii10082 +!D3 U+0441 afii10083 +!D4 U+0442 afii10084 +!D5 U+0443 afii10085 +!D6 U+0436 afii10072 +!D7 U+0432 afii10067 +!D8 U+044C afii10094 +!D9 U+044B afii10093 +!DA U+0437 afii10073 +!DB U+0448 afii10090 +!DC U+044D afii10095 +!DD U+0449 afii10091 +!DE U+0447 afii10089 +!DF U+044A afii10092 +!E0 U+042E afii10048 +!E1 U+0410 afii10017 +!E2 U+0411 afii10018 +!E3 U+0426 afii10040 +!E4 U+0414 afii10021 +!E5 U+0415 afii10022 +!E6 U+0424 afii10038 +!E7 U+0413 afii10020 +!E8 U+0425 afii10039 +!E9 U+0418 afii10026 +!EA U+0419 afii10027 +!EB U+041A afii10028 +!EC U+041B afii10029 +!ED U+041C afii10030 +!EE U+041D afii10031 +!EF U+041E afii10032 +!F0 U+041F afii10033 +!F1 U+042F afii10049 +!F2 U+0420 afii10034 +!F3 U+0421 afii10035 +!F4 U+0422 afii10036 +!F5 U+0423 afii10037 +!F6 U+0416 afii10024 +!F7 U+0412 afii10019 +!F8 U+042C afii10046 +!F9 U+042B afii10045 +!FA U+0417 afii10025 +!FB U+0428 afii10042 +!FC U+042D afii10047 +!FD U+0429 afii10043 +!FE U+0427 afii10041 +!FF U+042A afii10044 diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/makefont.php b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/makefont.php new file mode 100644 index 00000000..4dac6187 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/makefont/makefont.php @@ -0,0 +1,397 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +/******************************************************************************* + * Utility to generate font definition files * + * * + * Version: 1.14 * + * Date: 2008-08-03 * + * Author: Olivier PLATHEY * + *******************************************************************************/ + +function ReadMap($enc) +{ + //Read a map file + $file = dirname(__FILE__).'/'.strtolower($enc).'.map'; + $a = file($file); + if (empty($a)) + die('Error: encoding not found: '.$enc); + $cc2gn = array(); + foreach ($a as $l) { + if ($l[0] == '!') { + $e = preg_split('/[ \\t]+/', rtrim($l)); + $cc = hexdec(substr($e[0], 1)); + $gn = $e[2]; + $cc2gn[ $cc ] = $gn; + } + } + for ($i = 0; $i <= 255; $i++) { + if (!isset($cc2gn[ $i ])) + $cc2gn[ $i ] = '.notdef'; + } + + return $cc2gn; +} + +function ReadAFM($file, &$map) +{ + //Read a font metric file + $a = file($file); + if (empty($a)) + die('File not found'); + $widths = array(); + $fm = array(); + $fix = array( + 'Edot' => 'Edotaccent', 'edot' => 'edotaccent', 'Idot' => 'Idotaccent', 'Zdot' => 'Zdotaccent', 'zdot' => 'zdotaccent', + 'Odblacute' => 'Ohungarumlaut', 'odblacute' => 'ohungarumlaut', 'Udblacute' => 'Uhungarumlaut', 'udblacute' => 'uhungarumlaut', + 'Gcedilla' => 'Gcommaaccent', 'gcedilla' => 'gcommaaccent', 'Kcedilla' => 'Kcommaaccent', 'kcedilla' => 'kcommaaccent', + 'Lcedilla' => 'Lcommaaccent', 'lcedilla' => 'lcommaaccent', 'Ncedilla' => 'Ncommaaccent', 'ncedilla' => 'ncommaaccent', + 'Rcedilla' => 'Rcommaaccent', 'rcedilla' => 'rcommaaccent', 'Scedilla' => 'Scommaaccent', 'scedilla' => 'scommaaccent', + 'Tcedilla' => 'Tcommaaccent', 'tcedilla' => 'tcommaaccent', 'Dslash' => 'Dcroat', 'dslash' => 'dcroat', 'Dmacron' => 'Dcroat', 'dmacron' => 'dcroat', + 'combininggraveaccent' => 'gravecomb', 'combininghookabove' => 'hookabovecomb', 'combiningtildeaccent' => 'tildecomb', + 'combiningacuteaccent' => 'acutecomb', 'combiningdotbelow' => 'dotbelowcomb', 'dongsign' => 'dong' + ); + foreach ($a as $l) { + $e = explode(' ', rtrim($l)); + if (count($e) < 2) + continue; + $code = $e[0]; + $param = $e[1]; + if ($code == 'C') { + //Character metrics + $cc = (int)$e[1]; + $w = $e[4]; + $gn = $e[7]; + if (substr($gn, -4) == '20AC') + $gn = 'Euro'; + if (isset($fix[ $gn ])) { + //Fix incorrect glyph name + foreach ($map as $c => $n) { + if ($n == $fix[ $gn ]) + $map[ $c ] = $gn; + } + } + if (empty($map)) { + //Symbolic font: use built-in encoding + $widths[ $cc ] = $w; + } else { + $widths[ $gn ] = $w; + if ($gn == 'X') + $fm['CapXHeight'] = $e[13]; + } + if ($gn == '.notdef') + $fm['MissingWidth'] = $w; + } elseif ($code == 'FontName') + $fm['FontName'] = $param; + elseif ($code == 'Weight') + $fm['Weight'] = $param; + elseif ($code == 'ItalicAngle') + $fm['ItalicAngle'] = (double)$param; + elseif ($code == 'Ascender') + $fm['Ascender'] = (int)$param; + elseif ($code == 'Descender') + $fm['Descender'] = (int)$param; + elseif ($code == 'UnderlineThickness') + $fm['UnderlineThickness'] = (int)$param; + elseif ($code == 'UnderlinePosition') + $fm['UnderlinePosition'] = (int)$param; + elseif ($code == 'IsFixedPitch') + $fm['IsFixedPitch'] = ($param == 'true'); + elseif ($code == 'FontBBox') + $fm['FontBBox'] = array($e[1], $e[2], $e[3], $e[4]); + elseif ($code == 'CapHeight') + $fm['CapHeight'] = (int)$param; + elseif ($code == 'StdVW') + $fm['StdVW'] = (int)$param; + } + if (!isset($fm['FontName'])) + die('FontName not found'); + if (!empty($map)) { + if (!isset($widths['.notdef'])) + $widths['.notdef'] = 600; + if (!isset($widths['Delta']) && isset($widths['increment'])) + $widths['Delta'] = $widths['increment']; + //Order widths according to map + for ($i = 0; $i <= 255; $i++) { + if (!isset($widths[ $map[ $i ] ])) { + echo 'Warning: character '.$map[ $i ].' is missing
'; + $widths[ $i ] = $widths['.notdef']; + } else + $widths[ $i ] = $widths[ $map[ $i ] ]; + } + } + $fm['Widths'] = $widths; + + return $fm; +} + +function MakeFontDescriptor($fm, $symbolic) +{ + //Ascent + $asc = (isset($fm['Ascender']) ? $fm['Ascender'] : 1000); + $fd = "array('Ascent'=>".$asc; + //Descent + $desc = (isset($fm['Descender']) ? $fm['Descender'] : -200); + $fd .= ",'Descent'=>".$desc; + //CapHeight + if (isset($fm['CapHeight'])) + $ch = $fm['CapHeight']; + elseif (isset($fm['CapXHeight'])) + $ch = $fm['CapXHeight']; + else + $ch = $asc; + $fd .= ",'CapHeight'=>".$ch; + //Flags + $flags = 0; + if (isset($fm['IsFixedPitch']) && $fm['IsFixedPitch']) + $flags += 1 << 0; + if ($symbolic) + $flags += 1 << 2; + if (!$symbolic) + $flags += 1 << 5; + if (isset($fm['ItalicAngle']) && $fm['ItalicAngle'] != 0) + $flags += 1 << 6; + $fd .= ",'Flags'=>".$flags; + //FontBBox + if (isset($fm['FontBBox'])) + $fbb = $fm['FontBBox']; + else + $fbb = array(0, $desc - 100, 1000, $asc + 100); + $fd .= ",'FontBBox'=>'[".$fbb[0].' '.$fbb[1].' '.$fbb[2].' '.$fbb[3]."]'"; + //ItalicAngle + $ia = (isset($fm['ItalicAngle']) ? $fm['ItalicAngle'] : 0); + $fd .= ",'ItalicAngle'=>".$ia; + //StemV + if (isset($fm['StdVW'])) + $stemv = $fm['StdVW']; + elseif (isset($fm['Weight']) && preg_match('/bold|black/i', $fm['Weight'])) + $stemv = 120; + else + $stemv = 70; + $fd .= ",'StemV'=>".$stemv; + //MissingWidth + if (isset($fm['MissingWidth'])) + $fd .= ",'MissingWidth'=>".$fm['MissingWidth']; + $fd .= ')'; + + return $fd; +} + +function MakeWidthArray($fm) +{ + //Make character width array + $s = "array(\n\t"; + $cw = $fm['Widths']; + for ($i = 0; $i <= 255; $i++) { + if (chr($i) == "'") + $s .= "'\\''"; + elseif (chr($i) == "\\") + $s .= "'\\\\'"; + elseif ($i >= 32 && $i <= 126) + $s .= "'".chr($i)."'"; + else + $s .= "chr($i)"; + $s .= '=>'.$fm['Widths'][ $i ]; + if ($i < 255) + $s .= ','; + if (($i + 1) % 22 == 0) + $s .= "\n\t"; + } + $s .= ')'; + + return $s; +} + +function MakeFontEncoding($map) +{ + //Build differences from reference encoding + $ref = ReadMap('cp1252'); + $s = ''; + $last = 0; + for ($i = 32; $i <= 255; $i++) { + if ($map[ $i ] != $ref[ $i ]) { + if ($i != $last + 1) + $s .= $i.' '; + $last = $i; + $s .= '/'.$map[ $i ].' '; + } + } + + return rtrim($s); +} + +function SaveToFile($file, $s, $mode) +{ + $f = fopen($file, 'w'.$mode); + if (!$f) + die('Can\'t write to file '.$file); + fwrite($f, $s, strlen($s)); + fclose($f); +} + +function ReadShort($f) +{ + $a = unpack('n1n', fread($f, 2)); + + return $a['n']; +} + +function ReadLong($f) +{ + $a = unpack('N1N', fread($f, 4)); + + return $a['N']; +} + +function CheckTTF($file) +{ + //Check if font license allows embedding + $f = fopen($file, 'rb'); + if (!$f) + die('Error: Can\'t open '.$file); + //Extract number of tables + fseek($f, 4, SEEK_CUR); + $nb = ReadShort($f); + fseek($f, 6, SEEK_CUR); + //Seek OS/2 table + $found = false; + for ($i = 0; $i < $nb; $i++) { + if (fread($f, 4) == 'OS/2') { + $found = true; + break; + } + fseek($f, 12, SEEK_CUR); + } + if (!$found) { + fclose($f); + + return; + } + fseek($f, 4, SEEK_CUR); + $offset = ReadLong($f); + fseek($f, $offset, SEEK_SET); + //Extract fsType flags + fseek($f, 8, SEEK_CUR); + $fsType = ReadShort($f); + $rl = ($fsType & 0x02) != 0; + $pp = ($fsType & 0x04) != 0; + $e = ($fsType & 0x08) != 0; + fclose($f); + if ($rl && !$pp && !$e) + echo 'Warning: font license does not allow embedding'; +} + +/******************************************************************************* + * fontfile: path to TTF file (or empty string if not to be embedded) * + * afmfile: path to AFM file * + * enc: font encoding (or empty string for symbolic fonts) * + * patch: optional patch for encoding * + * type: font type if fontfile is empty * + *******************************************************************************/ +function MakeFont($fontfile, $afmfile, $enc = 'cp1252', $patch = array(), $type = 'TrueType') +{ + //Generate a font definition file + ini_set('auto_detect_line_endings', '1'); + if ($enc) { + $map = ReadMap($enc); + foreach ($patch as $cc => $gn) + $map[ $cc ] = $gn; + } else + $map = array(); + if (!file_exists($afmfile)) + die('Error: AFM file not found: '.$afmfile); + $fm = ReadAFM($afmfile, $map); + if ($enc) + $diff = MakeFontEncoding($map); + else + $diff = ''; + $fd = MakeFontDescriptor($fm, empty($map)); + //Find font type + if ($fontfile) { + $ext = strtolower(substr($fontfile, -3)); + if ($ext == 'ttf') + $type = 'TrueType'; + elseif ($ext == 'pfb') + $type = 'Type1'; + else + die('Error: unrecognized font file extension: '.$ext); + } else { + if ($type != 'TrueType' && $type != 'Type1') + die('Error: incorrect font type: '.$type); + } + //Start generation + $s = 'Error: font file not found: '.$fontfile); + if ($type == 'TrueType') + CheckTTF($fontfile); + $f = fopen($fontfile, 'rb'); + if (!$f) + die('Error: Can\'t open '.$fontfile); + $file = fread($f, filesize($fontfile)); + fclose($f); + if ($type == 'Type1') { + //Find first two sections and discard third one + $header = (ord($file[0]) == 128); + if ($header) { + //Strip first binary header + $file = substr($file, 6); + } + $pos = strpos($file, 'eexec'); + if (!$pos) + die('Error: font file does not seem to be valid Type1'); + $size1 = $pos + 6; + if ($header && ord($file[ $size1 ]) == 128) { + //Strip second binary header + $file = substr($file, 0, $size1).substr($file, $size1 + 6); + } + $pos = strpos($file, '00000000'); + if (!$pos) + die('Error: font file does not seem to be valid Type1'); + $size2 = $pos - $size1; + $file = substr($file, 0, $size1 + $size2); + } + if (function_exists('gzcompress')) { + $cmp = $basename.'.z'; + SaveToFile($cmp, gzcompress($file), 'b'); + $s .= '$file=\''.$cmp."';\n"; + echo 'Font file compressed ('.$cmp.')
'; + } else { + $s .= '$file=\''.basename($fontfile)."';\n"; + echo 'Notice: font file could not be compressed (zlib extension not available)
'; + } + if ($type == 'Type1') { + $s .= '$size1='.$size1.";\n"; + $s .= '$size2='.$size2.";\n"; + } else + $s .= '$originalsize='.filesize($fontfile).";\n"; + } else { + //Not embedded font + $s .= '$file='."'';\n"; + } + $s .= "?>\n"; + SaveToFile($basename.'.php', $s, 't'); + echo 'Font definition file generated ('.$basename.'.php'.')
'; +} diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/symbol.php b/www/modules/tntofficiel/libraries/pdf/fpdf/font/symbol.php new file mode 100644 index 00000000..24b3b469 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/symbol.php @@ -0,0 +1,23 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +$tntofficiel_fpdf_charwidths['symbol']=array( + chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>713,'#'=>500,'$'=>549,'%'=>833,'&'=>778,'\''=>439,'('=>333,')'=>333,'*'=>500,'+'=>549, + ','=>250,'-'=>549,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>549,'='=>549,'>'=>549,'?'=>444,'@'=>549,'A'=>722, + 'B'=>667,'C'=>722,'D'=>612,'E'=>611,'F'=>763,'G'=>603,'H'=>722,'I'=>333,'J'=>631,'K'=>722,'L'=>686,'M'=>889,'N'=>722,'O'=>722,'P'=>768,'Q'=>741,'R'=>556,'S'=>592,'T'=>611,'U'=>690,'V'=>439,'W'=>768, + 'X'=>645,'Y'=>795,'Z'=>611,'['=>333,'\\'=>863,']'=>333,'^'=>658,'_'=>500,'`'=>500,'a'=>631,'b'=>549,'c'=>549,'d'=>494,'e'=>439,'f'=>521,'g'=>411,'h'=>603,'i'=>329,'j'=>603,'k'=>549,'l'=>549,'m'=>576, + 'n'=>521,'o'=>549,'p'=>549,'q'=>521,'r'=>549,'s'=>603,'t'=>439,'u'=>576,'v'=>713,'w'=>686,'x'=>493,'y'=>686,'z'=>494,'{'=>480,'|'=>200,'}'=>480,'~'=>549,chr(127)=>0,chr(128)=>0,chr(129)=>0,chr(130)=>0,chr(131)=>0, + chr(132)=>0,chr(133)=>0,chr(134)=>0,chr(135)=>0,chr(136)=>0,chr(137)=>0,chr(138)=>0,chr(139)=>0,chr(140)=>0,chr(141)=>0,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0, + chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>750,chr(161)=>620,chr(162)=>247,chr(163)=>549,chr(164)=>167,chr(165)=>713,chr(166)=>500,chr(167)=>753,chr(168)=>753,chr(169)=>753,chr(170)=>753,chr(171)=>1042,chr(172)=>987,chr(173)=>603,chr(174)=>987,chr(175)=>603, + chr(176)=>400,chr(177)=>549,chr(178)=>411,chr(179)=>549,chr(180)=>549,chr(181)=>713,chr(182)=>494,chr(183)=>460,chr(184)=>549,chr(185)=>549,chr(186)=>549,chr(187)=>549,chr(188)=>1000,chr(189)=>603,chr(190)=>1000,chr(191)=>658,chr(192)=>823,chr(193)=>686,chr(194)=>795,chr(195)=>987,chr(196)=>768,chr(197)=>768, + chr(198)=>823,chr(199)=>768,chr(200)=>768,chr(201)=>713,chr(202)=>713,chr(203)=>713,chr(204)=>713,chr(205)=>713,chr(206)=>713,chr(207)=>713,chr(208)=>768,chr(209)=>713,chr(210)=>790,chr(211)=>790,chr(212)=>890,chr(213)=>823,chr(214)=>549,chr(215)=>250,chr(216)=>713,chr(217)=>603,chr(218)=>603,chr(219)=>1042, + chr(220)=>987,chr(221)=>603,chr(222)=>987,chr(223)=>603,chr(224)=>494,chr(225)=>329,chr(226)=>790,chr(227)=>790,chr(228)=>786,chr(229)=>713,chr(230)=>384,chr(231)=>384,chr(232)=>384,chr(233)=>384,chr(234)=>384,chr(235)=>384,chr(236)=>494,chr(237)=>494,chr(238)=>494,chr(239)=>494,chr(240)=>0,chr(241)=>329, + chr(242)=>274,chr(243)=>686,chr(244)=>686,chr(245)=>686,chr(246)=>384,chr(247)=>384,chr(248)=>384,chr(249)=>384,chr(250)=>384,chr(251)=>384,chr(252)=>494,chr(253)=>494,chr(254)=>494,chr(255)=>0 +); diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/times.php b/www/modules/tntofficiel/libraries/pdf/fpdf/font/times.php new file mode 100644 index 00000000..8c2a3cc9 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/times.php @@ -0,0 +1,23 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +$tntofficiel_fpdf_charwidths['times']=array( + chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>408,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>180,'('=>333,')'=>333,'*'=>500,'+'=>564, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>564,'='=>564,'>'=>564,'?'=>444,'@'=>921,'A'=>722, + 'B'=>667,'C'=>667,'D'=>722,'E'=>611,'F'=>556,'G'=>722,'H'=>722,'I'=>333,'J'=>389,'K'=>722,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>556,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>722,'W'=>944, + 'X'=>722,'Y'=>722,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>469,'_'=>500,'`'=>333,'a'=>444,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778, + 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>333,'s'=>389,'t'=>278,'u'=>500,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>480,'|'=>200,'}'=>480,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>444,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>889,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>444,chr(148)=>444,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>980, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>200,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>564,chr(173)=>333,chr(174)=>760,chr(175)=>333, + chr(176)=>400,chr(177)=>564,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>453,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>444,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>564,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>722,chr(222)=>556,chr(223)=>500,chr(224)=>444,chr(225)=>444,chr(226)=>444,chr(227)=>444,chr(228)=>444,chr(229)=>444,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>564,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>500,chr(254)=>500,chr(255)=>500 +); diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/timesb.php b/www/modules/tntofficiel/libraries/pdf/fpdf/font/timesb.php new file mode 100644 index 00000000..6c564fba --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/timesb.php @@ -0,0 +1,23 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +$tntofficiel_fpdf_charwidths['timesB']=array( + chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>555,'#'=>500,'$'=>500,'%'=>1000,'&'=>833,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>930,'A'=>722, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>778,'I'=>389,'J'=>500,'K'=>778,'L'=>667,'M'=>944,'N'=>722,'O'=>778,'P'=>611,'Q'=>778,'R'=>722,'S'=>556,'T'=>667,'U'=>722,'V'=>722,'W'=>1000, + 'X'=>722,'Y'=>722,'Z'=>667,'['=>333,'\\'=>278,']'=>333,'^'=>581,'_'=>500,'`'=>333,'a'=>500,'b'=>556,'c'=>444,'d'=>556,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>333,'k'=>556,'l'=>278,'m'=>833, + 'n'=>556,'o'=>500,'p'=>556,'q'=>556,'r'=>444,'s'=>389,'t'=>333,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>394,'|'=>220,'}'=>394,'~'=>520,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>667,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>300,chr(171)=>500,chr(172)=>570,chr(173)=>333,chr(174)=>747,chr(175)=>333, + chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>556,chr(182)=>540,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>330,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>570,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>722,chr(222)=>611,chr(223)=>556,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500 +); diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/timesbi.php b/www/modules/tntofficiel/libraries/pdf/fpdf/font/timesbi.php new file mode 100644 index 00000000..694220bd --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/timesbi.php @@ -0,0 +1,23 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +$tntofficiel_fpdf_charwidths['timesBI']=array( + chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>389,'"'=>555,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>832,'A'=>667, + 'B'=>667,'C'=>667,'D'=>722,'E'=>667,'F'=>667,'G'=>722,'H'=>778,'I'=>389,'J'=>500,'K'=>667,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>611,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>667,'W'=>889, + 'X'=>667,'Y'=>611,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>570,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778, + 'n'=>556,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>556,'v'=>444,'w'=>667,'x'=>500,'y'=>444,'z'=>389,'{'=>348,'|'=>220,'}'=>348,'~'=>570,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>389,chr(159)=>611,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>266,chr(171)=>500,chr(172)=>606,chr(173)=>333,chr(174)=>747,chr(175)=>333, + chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>576,chr(182)=>500,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>300,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>944,chr(199)=>667,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>570,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>611,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>444,chr(254)=>500,chr(255)=>444 +); diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/timesi.php b/www/modules/tntofficiel/libraries/pdf/fpdf/font/timesi.php new file mode 100644 index 00000000..74a61cdf --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/timesi.php @@ -0,0 +1,23 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +$tntofficiel_fpdf_charwidths['timesI']=array( + chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>420,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>214,'('=>333,')'=>333,'*'=>500,'+'=>675, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>675,'='=>675,'>'=>675,'?'=>500,'@'=>920,'A'=>611, + 'B'=>611,'C'=>667,'D'=>722,'E'=>611,'F'=>611,'G'=>722,'H'=>722,'I'=>333,'J'=>444,'K'=>667,'L'=>556,'M'=>833,'N'=>667,'O'=>722,'P'=>611,'Q'=>722,'R'=>611,'S'=>500,'T'=>556,'U'=>722,'V'=>611,'W'=>833, + 'X'=>611,'Y'=>556,'Z'=>556,'['=>389,'\\'=>278,']'=>389,'^'=>422,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>278,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>444,'l'=>278,'m'=>722, + 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>500,'v'=>444,'w'=>667,'x'=>444,'y'=>444,'z'=>389,'{'=>400,'|'=>275,'}'=>400,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>556,chr(133)=>889,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>500,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>556,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>556,chr(148)=>556,chr(149)=>350,chr(150)=>500,chr(151)=>889,chr(152)=>333,chr(153)=>980, + chr(154)=>389,chr(155)=>333,chr(156)=>667,chr(157)=>350,chr(158)=>389,chr(159)=>556,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>275,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>675,chr(173)=>333,chr(174)=>760,chr(175)=>333, + chr(176)=>400,chr(177)=>675,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>523,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>611,chr(193)=>611,chr(194)=>611,chr(195)=>611,chr(196)=>611,chr(197)=>611, + chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>667,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>675,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>556,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>675,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>444,chr(254)=>500,chr(255)=>444 +); diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/font/zapfdingbats.php b/www/modules/tntofficiel/libraries/pdf/fpdf/font/zapfdingbats.php new file mode 100644 index 00000000..90b6f413 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/font/zapfdingbats.php @@ -0,0 +1,23 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +$tntofficiel_fpdf_charwidths['zapfdingbats']=array( + chr(0)=>0,chr(1)=>0,chr(2)=>0,chr(3)=>0,chr(4)=>0,chr(5)=>0,chr(6)=>0,chr(7)=>0,chr(8)=>0,chr(9)=>0,chr(10)=>0,chr(11)=>0,chr(12)=>0,chr(13)=>0,chr(14)=>0,chr(15)=>0,chr(16)=>0,chr(17)=>0,chr(18)=>0,chr(19)=>0,chr(20)=>0,chr(21)=>0, + chr(22)=>0,chr(23)=>0,chr(24)=>0,chr(25)=>0,chr(26)=>0,chr(27)=>0,chr(28)=>0,chr(29)=>0,chr(30)=>0,chr(31)=>0,' '=>278,'!'=>974,'"'=>961,'#'=>974,'$'=>980,'%'=>719,'&'=>789,'\''=>790,'('=>791,')'=>690,'*'=>960,'+'=>939, + ','=>549,'-'=>855,'.'=>911,'/'=>933,'0'=>911,'1'=>945,'2'=>974,'3'=>755,'4'=>846,'5'=>762,'6'=>761,'7'=>571,'8'=>677,'9'=>763,':'=>760,';'=>759,'<'=>754,'='=>494,'>'=>552,'?'=>537,'@'=>577,'A'=>692, + 'B'=>786,'C'=>788,'D'=>788,'E'=>790,'F'=>793,'G'=>794,'H'=>816,'I'=>823,'J'=>789,'K'=>841,'L'=>823,'M'=>833,'N'=>816,'O'=>831,'P'=>923,'Q'=>744,'R'=>723,'S'=>749,'T'=>790,'U'=>792,'V'=>695,'W'=>776, + 'X'=>768,'Y'=>792,'Z'=>759,'['=>707,'\\'=>708,']'=>682,'^'=>701,'_'=>826,'`'=>815,'a'=>789,'b'=>789,'c'=>707,'d'=>687,'e'=>696,'f'=>689,'g'=>786,'h'=>787,'i'=>713,'j'=>791,'k'=>785,'l'=>791,'m'=>873, + 'n'=>761,'o'=>762,'p'=>762,'q'=>759,'r'=>759,'s'=>892,'t'=>892,'u'=>788,'v'=>784,'w'=>438,'x'=>138,'y'=>277,'z'=>415,'{'=>392,'|'=>392,'}'=>668,'~'=>668,chr(127)=>0,chr(128)=>390,chr(129)=>390,chr(130)=>317,chr(131)=>317, + chr(132)=>276,chr(133)=>276,chr(134)=>509,chr(135)=>509,chr(136)=>410,chr(137)=>410,chr(138)=>234,chr(139)=>234,chr(140)=>334,chr(141)=>334,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0, + chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>0,chr(161)=>732,chr(162)=>544,chr(163)=>544,chr(164)=>910,chr(165)=>667,chr(166)=>760,chr(167)=>760,chr(168)=>776,chr(169)=>595,chr(170)=>694,chr(171)=>626,chr(172)=>788,chr(173)=>788,chr(174)=>788,chr(175)=>788, + chr(176)=>788,chr(177)=>788,chr(178)=>788,chr(179)=>788,chr(180)=>788,chr(181)=>788,chr(182)=>788,chr(183)=>788,chr(184)=>788,chr(185)=>788,chr(186)=>788,chr(187)=>788,chr(188)=>788,chr(189)=>788,chr(190)=>788,chr(191)=>788,chr(192)=>788,chr(193)=>788,chr(194)=>788,chr(195)=>788,chr(196)=>788,chr(197)=>788, + chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918, + chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874, + chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0 +); diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/fpdf.css b/www/modules/tntofficiel/libraries/pdf/fpdf/fpdf.css new file mode 100644 index 00000000..dd2c5400 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/fpdf.css @@ -0,0 +1,21 @@ +body {font-family:"Times New Roman",serif} +h1 {font:bold 135% Arial,sans-serif; color:#4000A0; margin-bottom:0.9em} +h2 {font:bold 95% Arial,sans-serif; color:#900000; margin-top:1.5em; margin-bottom:1em} +dl.param dt {text-decoration:underline} +dl.param dd {margin-top:1em; margin-bottom:1em} +dl.param ul {margin-top:1em; margin-bottom:1em} +tt, code, kbd {font-family:"Courier New",Courier,monospace; font-size:82%} +div.source {margin-top:1.4em; margin-bottom:1.3em} +div.source pre {display:table; border:1px solid #24246A; width:100%; margin:0em; font-family:inherit; font-size:100%} +div.source code {display:block; border:1px solid #C5C5EC; background-color:#F0F5FF; padding:6px; color:#000000} +div.doc-source {margin-top:1.4em; margin-bottom:1.3em} +div.doc-source pre {display:table; width:100%; margin:0em; font-family:inherit; font-size:100%} +div.doc-source code {display:block; background-color:#E0E0E0; padding:4px} +.kw {color:#000080; font-weight:bold} +.str {color:#CC0000} +.cmt {color:#008000} +p.demo {text-align:center; margin-top:-0.9em} +a.demo {text-decoration:none; font-weight:bold; color:#0000CC} +a.demo:link {text-decoration:none; font-weight:bold; color:#0000CC} +a.demo:hover {text-decoration:none; font-weight:bold; color:#0000FF} +a.demo:active {text-decoration:none; font-weight:bold; color:#0000FF} diff --git a/www/modules/tntofficiel/libraries/pdf/fpdf/index.php b/www/modules/tntofficiel/libraries/pdf/fpdf/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdf/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/libraries/pdf/fpdi/TNTOfficiel_FPDF2.php b/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_FPDF2.php new file mode 100644 index 00000000..768684d7 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_FPDF2.php @@ -0,0 +1,184 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +// +// FPDI - Version 1.3.1 +// +// Copyright 2004-2009 Setasign - Jan Slabon +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * This class is used as a bridge between TCPDF and FPDI + * and will create the possibility to use both FPDF and TCPDF + * via one FPDI version. + * + * We'll simply remap TCPDF to FPDF again. + * + * It'll be loaded and extended by FPDF_TPL. + */ +class TNTOfficiel_FPDF2 extends TNTOfficiel_TCPDF { + + public function __get($name) { + switch ($name) { + case 'PDFVersion': + return $this->PDFVersion; + case 'k': + return $this->k; + default: + // Error handling + $this->Error('Cannot access protected property '.get_class($this).':$'.$name.' / Undefined property: '.get_class($this).'::$'.$name); + } + } + + public function __set($name, $value) + { + switch ($name) { + case 'PDFVersion': + $this->PDFVersion = $value; + break; + default: + // Error handling + $this->Error('Cannot access protected property '.get_class($this).':$'.$name.' / Undefined property: '.get_class($this).'::$'.$name); + } + } + + /** + * Encryption of imported data by FPDI + * + * @param array $value + */ + public function pdf_write_value(&$value) + { + switch ($value[0]) { + case PDF_TYPE_STRING : + if ($this->encrypted) { + $value[1] = $this->_unescape($value[1]); + $value[1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[1]); + $value[1] = $this->_escape($value[1]); + } + break; + + case PDF_TYPE_STREAM : + if ($this->encrypted) { + $value[2][1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[2][1]); + } + break; + + case PDF_TYPE_HEX : + if ($this->encrypted) { + $value[1] = $this->hex2str($value[1]); + $value[1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[1]); + + // remake hexstring of encrypted string + $value[1] = $this->str2hex($value[1]); + } + break; + } + } + + /** + * Unescapes a PDF string + * + * @param string $s + * @return string + */ + public function _unescape($s) + { + $out = ''; + for ($count = 0, $n = strlen($s); $count < $n; $count++) { + if ($s[$count] != '\\' || $count == $n-1) { + $out .= $s[$count]; + } else { + switch ($s[++$count]) { + case ')': + case '(': + case '\\': + $out .= $s[$count]; + break; + case 'f': + $out .= chr(0x0C); + break; + case 'b': + $out .= chr(0x08); + break; + case 't': + $out .= chr(0x09); + break; + case 'r': + $out .= chr(0x0D); + break; + case 'n': + $out .= chr(0x0A); + break; + case "\r": + if ($count != $n-1 && $s[$count+1] == "\n") + $count++; + break; + case "\n": + break; + default: + // Octal-Values + if (ord($s[$count]) >= ord('0') && + ord($s[$count]) <= ord('9')) { + $oct = ''. $s[$count]; + + if (ord($s[$count+1]) >= ord('0') && + ord($s[$count+1]) <= ord('9')) { + $oct .= $s[++$count]; + + if (ord($s[$count+1]) >= ord('0') && + ord($s[$count+1]) <= ord('9')) { + $oct .= $s[++$count]; + } + } + + $out .= chr(octdec($oct)); + } else { + $out .= $s[$count]; + } + } + } + } + return $out; + } + + /** + * Hexadecimal to string + * + * @param string $hex + * @return string + */ + public function hex2str($hex) + { + return pack('H*', str_replace(array("\r", "\n", ' '), '', $hex)); + } + + /** + * String to hexadecimal + * + * @param string $str + * @return string + */ + public function str2hex($str) + { + return current(unpack('H*', $str)); + } +} \ No newline at end of file diff --git a/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_FPDF_TPL.php b/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_FPDF_TPL.php new file mode 100644 index 00000000..3bb09402 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_FPDF_TPL.php @@ -0,0 +1,431 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +// +// FPDF_TPL - Version 1.1.3 +// +// Copyright 2004-2009 Setasign - Jan Slabon +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +class TNTOfficiel_FPDF_TPL extends TNTOfficiel_FPDF { + /** + * Array of Tpl-Data + * @var array + */ + var $tpls = array(); + + /** + * Current Template-ID + * @var int + */ + var $tpl = 0; + + /** + * "In Template"-Flag + * @var boolean + */ + var $_intpl = false; + + /** + * Nameprefix of Templates used in Resources-Dictonary + * @var string A String defining the Prefix used as Template-Object-Names. Have to beginn with an / + */ + var $tplprefix = "/TPL"; + + /** + * Resources used By Templates and Pages + * @var array + */ + var $_res = array(); + + /** + * Last used Template data + * + * @var array + */ + var $lastUsedTemplateData = array(); + + /** + * Start a Template + * + * This method starts a template. You can give own coordinates to build an own sized + * Template. Pay attention, that the margins are adapted to the new templatesize. + * If you want to write outside the template, for example to build a clipped Template, + * you have to set the Margins and "Cursor"-Position manual after beginTemplate-Call. + * + * If no parameter is given, the template uses the current page-size. + * The Method returns an ID of the current Template. This ID is used later for using this template. + * Warning: A created Template is used in PDF at all events. Still if you don't use it after creation! + * + * @param int $x The x-coordinate given in user-unit + * @param int $y The y-coordinate given in user-unit + * @param int $w The width given in user-unit + * @param int $h The height given in user-unit + * @return int The ID of new created Template + */ + public function beginTemplate($x=null, $y=null, $w=null, $h=null) + { + if ($this->page <= 0) + $this->error("You have to add a page to fpdf first!"); + + if ($x == null) + $x = 0; + if ($y == null) + $y = 0; + if ($w == null) + $w = $this->w; + if ($h == null) + $h = $this->h; + + // Save settings + $this->tpl++; + $tpl =& $this->tpls[$this->tpl]; + $tpl = array( + 'o_x' => $this->x, + 'o_y' => $this->y, + 'o_AutoPageBreak' => $this->AutoPageBreak, + 'o_bMargin' => $this->bMargin, + 'o_tMargin' => $this->tMargin, + 'o_lMargin' => $this->lMargin, + 'o_rMargin' => $this->rMargin, + 'o_h' => $this->h, + 'o_w' => $this->w, + 'buffer' => '', + 'x' => $x, + 'y' => $y, + 'w' => $w, + 'h' => $h + ); + + $this->SetAutoPageBreak(false); + + // Define own high and width to calculate possitions correct + $this->h = $h; + $this->w = $w; + + $this->_intpl = true; + $this->SetXY($x+$this->lMargin, $y+$this->tMargin); + $this->SetRightMargin($this->w-$w+$this->rMargin); + + return $this->tpl; + } + + /** + * End Template + * + * This method ends a template and reset initiated variables on beginTemplate. + * + * @return mixed If a template is opened, the ID is returned. If not a false is returned. + */ + public function endTemplate() + { + if ($this->_intpl) { + $this->_intpl = false; + $tpl =& $this->tpls[$this->tpl]; + $this->SetXY($tpl['o_x'], $tpl['o_y']); + $this->tMargin = $tpl['o_tMargin']; + $this->lMargin = $tpl['o_lMargin']; + $this->rMargin = $tpl['o_rMargin']; + $this->h = $tpl['o_h']; + $this->w = $tpl['o_w']; + $this->SetAutoPageBreak($tpl['o_AutoPageBreak'], $tpl['o_bMargin']); + + return $this->tpl; + } else { + return false; + } + } + + /** + * Use a Template in current Page or other Template + * + * You can use a template in a page or in another template. + * You can give the used template a new size like you use the Image()-method. + * All parameters are optional. The width or height is calculated automaticaly + * if one is given. If no parameter is given the origin size as defined in + * beginTemplate() is used. + * The calculated or used width and height are returned as an array. + * + * @param int $tplidx A valid template-Id + * @param int $_x The x-position + * @param int $_y The y-position + * @param int $_w The new width of the template + * @param int $_h The new height of the template + * @retrun array The height and width of the template + */ + public function useTemplate($tplidx, $_x=null, $_y=null, $_w=0, $_h=0) + { + if ($this->page <= 0) + $this->error("You have to add a page to fpdf first!"); + + if (!isset($this->tpls[$tplidx])) + $this->error("Template does not exist!"); + + if ($this->_intpl) { + $this->_res['tpl'][$this->tpl]['tpls'][$tplidx] =& $this->tpls[$tplidx]; + } + + $tpl =& $this->tpls[$tplidx]; + $w = $tpl['w']; + $h = $tpl['h']; + + if ($_x == null) + $_x = 0; + if ($_y == null) + $_y = 0; + + $_x += $tpl['x']; + $_y += $tpl['y']; + + $wh = $this->getTemplateSize($tplidx, $_w, $_h); + $_w = $wh['w']; + $_h = $wh['h']; + + $tData = array( + 'x' => $this->x, + 'y' => $this->y, + 'w' => $_w, + 'h' => $_h, + 'scaleX' => ($_w/$w), + 'scaleY' => ($_h/$h), + 'tx' => $_x, + 'ty' => ($this->h-$_y-$_h), + 'lty' => ($this->h-$_y-$_h) - ($this->h-$h) * ($_h/$h) + ); + + $this->_out(sprintf("q %.4F 0 0 %.4F %.4F %.4F cm", $tData['scaleX'], $tData['scaleY'], $tData['tx']*$this->k, $tData['ty']*$this->k)); // Translate + $this->_out(sprintf('%s%d Do Q', $this->tplprefix, $tplidx)); + + $this->lastUsedTemplateData = $tData; + + return array("w" => $_w, "h" => $_h); + } + + /** + * Get The calculated Size of a Template + * + * If one size is given, this method calculates the other one. + * + * @param int $tplidx A valid template-Id + * @param int $_w The width of the template + * @param int $_h The height of the template + * @return array The height and width of the template + */ + public function getTemplateSize($tplidx, $_w=0, $_h=0) + { + if (!$this->tpls[$tplidx]) + return false; + + $tpl =& $this->tpls[$tplidx]; + $w = $tpl['w']; + $h = $tpl['h']; + + if ($_w == 0 and $_h == 0) { + $_w = $w; + $_h = $h; + } + + if($_w==0) + $_w = $_h*$w/$h; + if($_h==0) + $_h = $_w*$h/$w; + + return array("w" => $_w, "h" => $_h); + } + + /** + * See FPDF/TCPDF-Documentation ;-) + */ + public function SetFont($family, $style='', $size=0, $fontfile='') + { + if (!is_subclass_of($this, 'TNTOfficiel_TCPDF') && func_num_args() > 3) { + $this->Error('More than 3 arguments for the SetFont method are only available in TNTOfficiel_TCPDF.'); + } + /** + * force the resetting of font changes in a template + */ + if ($this->_intpl) + $this->FontFamily = ''; + + parent::SetFont($family, $style, $size, $fontfile); + + $fontkey = $this->FontFamily.$this->FontStyle; + + if ($this->_intpl) { + $this->_res['tpl'][$this->tpl]['fonts'][$fontkey] =& $this->fonts[$fontkey]; + } else { + $this->_res['page'][$this->page]['fonts'][$fontkey] =& $this->fonts[$fontkey]; + } + } + + /** + * See FPDF/TCPDF-Documentation ;-) + */ + public function Image($file, $x = NULL, $y = NULL, $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0) + { + if (!is_subclass_of($this, 'TNTOfficiel_TCPDF') && func_num_args() > 7) { + $this->Error('More than 7 arguments for the Image method are only available in TNTOfficiel_TCPDF.'); + } + + parent::Image($file, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi, $palign, $ismask, $imgmask, $border); + if ($this->_intpl) { + $this->_res['tpl'][$this->tpl]['images'][$file] =& $this->images[$file]; + } else { + $this->_res['page'][$this->page]['images'][$file] =& $this->images[$file]; + } + } + + /** + * See FPDF-Documentation ;-) + * + * AddPage is not available when you're "in" a template. + */ + public function AddPage($orientation='', $format='') + { + if ($this->_intpl) + $this->Error('Adding pages in templates isn\'t possible!'); + parent::AddPage($orientation, $format); + } + + /** + * Preserve adding Links in Templates ...won't work + */ + public function Link($x, $y, $w, $h, $link, $spaces=0) + { + if (!is_subclass_of($this, 'TNTOfficiel_TCPDF') && func_num_args() > 5) { + $this->Error('More than 7 arguments for the Image method are only available in TNTOfficiel_TCPDF.'); + } + + if ($this->_intpl) + $this->Error('Using links in templates aren\'t possible!'); + parent::Link($x, $y, $w, $h, $link, $spaces); + } + + public function AddLink() + { + if ($this->_intpl) + $this->Error('Adding links in templates aren\'t possible!'); + return parent::AddLink(); + } + + public function SetLink($link, $y=0, $page=-1) + { + if ($this->_intpl) + $this->Error('Setting links in templates aren\'t possible!'); + parent::SetLink($link, $y, $page); + } + + /** + * Private Method that writes the form xobjects + */ + public function _putformxobjects() + { + $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; + reset($this->tpls); + foreach($this->tpls AS $tplidx => $tpl) { + + $p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer']; + $this->_newobj(); + $this->tpls[$tplidx]['n'] = $this->n; + $this->_out('<<'.$filter.'/Type /XObject'); + $this->_out('/Subtype /Form'); + $this->_out('/FormType 1'); + $this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]', + // llx + $tpl['x'], + // lly + -$tpl['y'], + // urx + ($tpl['w']+$tpl['x'])*$this->k, + // ury + ($tpl['h']-$tpl['y'])*$this->k + )); + + if ($tpl['x'] != 0 || $tpl['y'] != 0) { + $this->_out(sprintf('/Matrix [1 0 0 1 %.5F %.5F]', + -$tpl['x']*$this->k*2, $tpl['y']*$this->k*2 + )); + } + + $this->_out('/Resources '); + + $this->_out('<_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) { + $this->_out('/Font <<'); + foreach($this->_res['tpl'][$tplidx]['fonts'] as $font) + $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R'); + $this->_out('>>'); + } + if(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) || + isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) + { + $this->_out('/XObject <<'); + if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) { + foreach($this->_res['tpl'][$tplidx]['images'] as $image) + $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R'); + } + if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) { + foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl) + $this->_out($this->tplprefix.$i.' '.$tpl['n'].' 0 R'); + } + $this->_out('>>'); + } + $this->_out('>>'); + + $this->_out('/Length '.strlen($p).' >>'); + $this->_putstream($p); + $this->_out('endobj'); + } + } + + /** + * Overwritten to add _putformxobjects() after _putimages() + * + */ + public function _putimages() + { + parent::_putimages(); + $this->_putformxobjects(); + } + + public function _putxobjectdict() + { + parent::_putxobjectdict(); + + if (count($this->tpls)) { + foreach($this->tpls as $tplidx => $tpl) { + $this->_out(sprintf('%s%d %d 0 R', $this->tplprefix, $tplidx, $tpl['n'])); + } + } + } + + /** + * Private Method + */ + public function _out($s) + { + if ($this->state==2 && $this->_intpl) { + $this->tpls[$this->tpl]['buffer'] .= $s."\n"; + } else { + parent::_out($s); + } + } +} diff --git a/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_FPDI.php b/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_FPDI.php new file mode 100644 index 00000000..774bafb2 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_FPDI.php @@ -0,0 +1,522 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +// +// FPDI - Version 1.3.1 +// +// Copyright 2004-2009 Setasign - Jan Slabon +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +define('TNTOFFICIEL_FPDI_VERSION','1.3.1'); + +// Check for TCPDF and remap TCPDF to FPDF +if (class_exists('TNTOfficiel_TCPDF')) { + require_once('TNTOfficiel_FPDF2.php'); +} + +require_once('TNTOfficiel_FPDF_TPL.php'); +require_once('TNTOfficiel_fpdi_pdf_parser.php'); + + +class TNTOfficiel_FPDI extends TNTOfficiel_FPDF_TPL { + /** + * Actual filename + * @var string + */ + var $current_filename; + + /** + * Parser-Objects + * @var array + */ + var $parsers; + + /** + * Current parser + * @var object + */ + var $current_parser; + + /** + * object stack + * @var array + */ + var $_obj_stack; + + /** + * done object stack + * @var array + */ + var $_don_obj_stack; + + /** + * Current Object Id. + * @var integer + */ + var $_current_obj_id; + + /** + * The name of the last imported page box + * @var string + */ + var $lastUsedPageBox; + + var $_importedPages = array(); + + + /** + * Set a source-file + * + * @param string $filename a valid filename + * @return int number of available pages + */ + public function setSourceFile($filename) + { + $this->current_filename = $filename; + $fn =& $this->current_filename; + + if (!isset($this->parsers[$fn])) + $this->parsers[$fn] = new TNTOfficiel_fpdi_pdf_parser($fn, $this); + $this->current_parser = $this->parsers[$fn]; + + return $this->parsers[$fn]->getPageCount(); + } + + /** + * Import a page + * + * @param int $pageno pagenumber + * @return int Index of imported page - to use with fpdf_tpl::useTemplate() + */ + public function importPage($pageno, $boxName='/CropBox') + { + if ($this->_intpl) { + return $this->error('Please import the desired pages before creating a new template.'); + } + + $fn =& $this->current_filename; + + // check if page already imported + $pageKey = $fn.((int)$pageno).$boxName; + if (isset($this->_importedPages[$pageKey])) + return $this->_importedPages[$pageKey]; + + $parser =& $this->parsers[$fn]; + $parser->setPageno($pageno); + + $this->tpl++; + $this->tpls[$this->tpl] = array(); + $tpl =& $this->tpls[$this->tpl]; + $tpl['parser'] =& $parser; + $tpl['resources'] = $parser->getPageResources(); + $tpl['buffer'] = $parser->getContent(); + + if (!in_array($boxName, $parser->availableBoxes)) + return $this->Error(sprintf('Unknown box: %s', $boxName)); + $pageboxes = $parser->getPageBoxes($pageno); + + /** + * MediaBox + * CropBox: Default -> MediaBox + * BleedBox: Default -> CropBox + * TrimBox: Default -> CropBox + * ArtBox: Default -> CropBox + */ + if (!isset($pageboxes[$boxName]) && ($boxName == '/BleedBox' || $boxName == '/TrimBox' || $boxName == '/ArtBox')) + $boxName = '/CropBox'; + if (!isset($pageboxes[$boxName]) && $boxName == '/CropBox') + $boxName = '/MediaBox'; + + if (!isset($pageboxes[$boxName])) + return false; + $this->lastUsedPageBox = $boxName; + + $box = $pageboxes[$boxName]; + $tpl['box'] = $box; + + // To build an array that can be used by PDF_TPL::useTemplate() + $this->tpls[$this->tpl] = array_merge($this->tpls[$this->tpl],$box); + + // An imported page will start at 0,0 everytime. Translation will be set in _putformxobjects() + $tpl['x'] = 0; + $tpl['y'] = 0; + + $page =& $parser->pages[$parser->pageno]; + + // handle rotated pages + $rotation = $parser->getPageRotation($pageno); + $tpl['_rotationAngle'] = 0; + if (isset($rotation[1]) && ($angle = $rotation[1] % 360) != 0) { + $steps = $angle / 90; + + $_w = $tpl['w']; + $_h = $tpl['h']; + $tpl['w'] = $steps % 2 == 0 ? $_w : $_h; + $tpl['h'] = $steps % 2 == 0 ? $_h : $_w; + + $tpl['_rotationAngle'] = $angle*-1; + } + + $this->_importedPages[$pageKey] = $this->tpl; + + return $this->tpl; + } + + public function getLastUsedPageBox() + { + return $this->lastUsedPageBox; + } + + public function useTemplate($tplidx, $_x=null, $_y=null, $_w=0, $_h=0, $adjustPageSize=false) + { + if ($adjustPageSize == true && is_null($_x) && is_null($_y)) { + $size = $this->getTemplateSize($tplidx, $_w, $_h); + $format = array($size['w'], $size['h']); + if ($format[0]!=$this->CurPageFormat[0] || $format[1]!=$this->CurPageFormat[1]) { + $this->w=$format[0]; + $this->h=$format[1]; + $this->wPt=$this->w*$this->k; + $this->hPt=$this->h*$this->k; + $this->PageBreakTrigger=$this->h-$this->bMargin; + $this->CurPageFormat=$format; + $this->PageSizes[$this->page]=array($this->wPt, $this->hPt); + } + } + + $this->_out('q 0 J 1 w 0 j 0 G 0 g'); // reset standard values + $s = parent::useTemplate($tplidx, $_x, $_y, $_w, $_h); + $this->_out('Q'); + return $s; + } + + /** + * Private method, that rebuilds all needed objects of source files + */ + public function _putimportedobjects() + { + if (is_array($this->parsers) && count($this->parsers) > 0) { + foreach($this->parsers AS $filename => $p) { + $this->current_parser =& $this->parsers[$filename]; + if (isset($this->_obj_stack[$filename]) && is_array($this->_obj_stack[$filename])) { + while(($n = key($this->_obj_stack[$filename])) !== null) { + $nObj = $this->current_parser->pdf_resolve_object($this->current_parser->c,$this->_obj_stack[$filename][$n][1]); + + $this->_newobj($this->_obj_stack[$filename][$n][0]); + + if ($nObj[0] == PDF_TYPE_STREAM) { + $this->pdf_write_value ($nObj); + } else { + $this->pdf_write_value ($nObj[1]); + } + + $this->_out('endobj'); + $this->_obj_stack[$filename][$n] = null; // free memory + unset($this->_obj_stack[$filename][$n]); + reset($this->_obj_stack[$filename]); + } + } + } + } + } + + + /** + * Private Method that writes the form xobjects + */ + public function _putformxobjects() + { + $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; + reset($this->tpls); + foreach($this->tpls AS $tplidx => $tpl) { + $p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer']; + $this->_newobj(); + $cN = $this->n; // TCPDF/Protection: rem current "n" + + $this->tpls[$tplidx]['n'] = $this->n; + $this->_out('<<'.$filter.'/Type /XObject'); + $this->_out('/Subtype /Form'); + $this->_out('/FormType 1'); + + $this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]', + (isset($tpl['box']['llx']) ? $tpl['box']['llx'] : $tpl['x'])*$this->k, + (isset($tpl['box']['lly']) ? $tpl['box']['lly'] : -$tpl['y'])*$this->k, + (isset($tpl['box']['urx']) ? $tpl['box']['urx'] : $tpl['w'] + $tpl['x'])*$this->k, + (isset($tpl['box']['ury']) ? $tpl['box']['ury'] : $tpl['h']-$tpl['y'])*$this->k + )); + + $c = 1; + $s = 0; + $tx = 0; + $ty = 0; + + if (isset($tpl['box'])) { + $tx = -$tpl['box']['llx']; + $ty = -$tpl['box']['lly']; + + if ($tpl['_rotationAngle'] <> 0) { + $angle = $tpl['_rotationAngle'] * M_PI/180; + $c=cos($angle); + $s=sin($angle); + + switch($tpl['_rotationAngle']) { + case -90: + $tx = -$tpl['box']['lly']; + $ty = $tpl['box']['urx']; + break; + case -180: + $tx = $tpl['box']['urx']; + $ty = $tpl['box']['ury']; + break; + case -270: + $tx = $tpl['box']['ury']; + $ty = 0; + break; + } + } + } elseif ($tpl['x'] != 0 || $tpl['y'] != 0) { + $tx = -$tpl['x']*2; + $ty = $tpl['y']*2; + } + + $tx *= $this->k; + $ty *= $this->k; + + if ($c != 1 || $s != 0 || $tx != 0 || $ty != 0) { + $this->_out(sprintf('/Matrix [%.5F %.5F %.5F %.5F %.5F %.5F]', + $c, $s, -$s, $c, $tx, $ty + )); + } + + $this->_out('/Resources '); + + if (isset($tpl['resources'])) { + $this->current_parser =& $tpl['parser']; + $this->pdf_write_value($tpl['resources']); // "n" will be changed + } else { + $this->_out('<_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) { + $this->_out('/Font <<'); + foreach($this->_res['tpl'][$tplidx]['fonts'] as $font) + $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R'); + $this->_out('>>'); + } + if(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) || + isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) + { + $this->_out('/XObject <<'); + if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) { + foreach($this->_res['tpl'][$tplidx]['images'] as $image) + $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R'); + } + if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) { + foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl) + $this->_out($this->tplprefix.$i.' '.$tpl['n'].' 0 R'); + } + $this->_out('>>'); + } + $this->_out('>>'); + } + + $nN = $this->n; // TCPDF: rem new "n" + $this->n = $cN; // TCPDF: reset to current "n" + $this->_out('/Length '.strlen($p).' >>'); + $this->_putstream($p); + $this->_out('endobj'); + $this->n = $nN; // TCPDF: reset to new "n" + } + + $this->_putimportedobjects(); + } + + /** + * Rewritten to handle existing own defined objects + */ + public function _newobj($obj_id=false,$onlynewobj=false) + { + if (!$obj_id) { + $obj_id = ++$this->n; + } + + //Begin a new object + if (!$onlynewobj) { + $this->offsets[$obj_id] = is_subclass_of($this, 'TNTOfficiel_TCPDF') ? $this->bufferlen : strlen($this->buffer); + $this->_out($obj_id.' 0 obj'); + $this->_current_obj_id = $obj_id; // for later use with encryption + } + return $obj_id; + } + + /** + * Writes a value + * Needed to rebuild the source document + * + * @param mixed $value A PDF-Value. Structure of values see cases in this method + */ + public function pdf_write_value(&$value) + { + if (is_subclass_of($this, 'TNTOfficiel_TCPDF')) { + parent::pdf_write_value($value); + } + + switch ($value[0]) { + + case PDF_TYPE_TOKEN : + $this->_straightOut($value[1] . ' '); + break; + case PDF_TYPE_NUMERIC : + case PDF_TYPE_REAL : + if (is_float($value[1]) && $value[1] != 0) { + $this->_straightOut(rtrim(rtrim(sprintf('%F', $value[1]), '0'), '.') .' '); + } else { + $this->_straightOut($value[1] . ' '); + } + break; + + case PDF_TYPE_ARRAY : + + // An array. Output the proper + // structure and move on. + + $this->_straightOut('['); + for ($i = 0; $i < count($value[1]); $i++) { + $this->pdf_write_value($value[1][$i]); + } + + $this->_out(']'); + break; + + case PDF_TYPE_DICTIONARY : + + // A dictionary. + $this->_straightOut('<<'); + + reset ($value[1]); + + while (list($k, $v) = each($value[1])) { + $this->_straightOut($k . ' '); + $this->pdf_write_value($v); + } + + $this->_straightOut('>>'); + break; + + case PDF_TYPE_OBJREF : + + // An indirect object reference + // Fill the object stack if needed + $cpfn =& $this->current_parser->filename; + + if (!isset($this->_don_obj_stack[$cpfn][$value[1]])) { + $this->_newobj(false,true); + $this->_obj_stack[$cpfn][$value[1]] = array($this->n, $value); + $this->_don_obj_stack[$cpfn][$value[1]] = array($this->n, $value); // Value is maybee obsolete!!! + } + $objid = $this->_don_obj_stack[$cpfn][$value[1]][0]; + + $this->_out($objid.' 0 R'); + break; + + case PDF_TYPE_STRING : + + // A string. + $this->_straightOut('('.$value[1].')'); + + break; + + case PDF_TYPE_STREAM : + + // A stream. First, output the + // stream dictionary, then the + // stream data itself. + $this->pdf_write_value($value[1]); + $this->_out('stream'); + $this->_out($value[2][1]); + $this->_out('endstream'); + break; + case PDF_TYPE_HEX : + $this->_straightOut('<'.$value[1].'>'); + break; + + case PDF_TYPE_BOOLEAN : + $this->_straightOut($value[1] ? 'true ' : 'false '); + break; + + case PDF_TYPE_NULL : + // The null object. + + $this->_straightOut('null '); + break; + } + } + + + /** + * Modified so not each call will add a newline to the output. + */ + public function _straightOut($s) + { + if (!is_subclass_of($this, 'TNTOfficiel_TCPDF')) { + if($this->state==2) + $this->pages[$this->page] .= $s; + else + $this->buffer .= $s; + } else { + if ($this->state == 2) { + if (isset($this->footerlen[$this->page]) AND ($this->footerlen[$this->page] > 0)) { + // puts data before page footer + $page = substr($this->getPageBuffer($this->page), 0, -$this->footerlen[$this->page]); + $footer = substr($this->getPageBuffer($this->page), -$this->footerlen[$this->page]); + $this->setPageBuffer($this->page, $page.' '.$s."\n".$footer); + } else { + $this->setPageBuffer($this->page, $s, true); + } + } else { + $this->setBuffer($s); + } + } + } + + /** + * rewritten to close opened parsers + * + */ + public function _enddoc() + { + parent::_enddoc(); + $this->_closeParsers(); + } + + /** + * close all files opened by parsers + */ + public function _closeParsers() + { + if ($this->state > 2 && count($this->parsers) > 0) { + foreach ($this->parsers as $k => $_){ + $this->parsers[$k]->closeFile(); + $this->parsers[$k] = null; + unset($this->parsers[$k]); + } + return true; + } + return false; + } +} diff --git a/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_fpdi_pdf_parser.php b/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_fpdi_pdf_parser.php new file mode 100644 index 00000000..5a02552e --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_fpdi_pdf_parser.php @@ -0,0 +1,408 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +// +// FPDI - Version 1.3.1 +// +// Copyright 2004-2009 Setasign - Jan Slabon +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +require_once('TNTOfficiel_pdf_parser.php'); + +class TNTOfficiel_fpdi_pdf_parser extends TNTOfficiel_pdf_parser { + + /** + * Pages + * Index beginns at 0 + * + * @var array + */ + var $pages; + + /** + * Page count + * @var integer + */ + var $page_count; + + /** + * actual page number + * @var integer + */ + var $pageno; + + /** + * PDF Version of imported Document + * @var string + */ + var $pdfVersion; + + /** + * FPDI Reference + * @var object + */ + var $fpdi; + + /** + * Available BoxTypes + * + * @var array + */ + var $availableBoxes = array('/MediaBox', '/CropBox', '/BleedBox', '/TrimBox', '/ArtBox'); + + /** + * Constructor + * + * @param string $filename Source-Filename + * @param object $fpdi Object of type fpdi + */ + public function TNTOfficiel_fpdi_pdf_parser($filename, &$fpdi) + { + $this->fpdi =& $fpdi; + + parent::TNTOfficiel_pdf_parser($filename); + + // resolve Pages-Dictonary + $pages = $this->pdf_resolve_object($this->c, $this->root[1][1]['/Pages']); + + // Read pages + $this->read_pages($this->c, $pages, $this->pages); + + // count pages; + $this->page_count = count($this->pages); + } + + /** + * Overwrite parent::error() + * + * @param string $msg Error-Message + */ + public function error($msg) + { + $this->fpdi->error($msg); + } + + /** + * Get pagecount from sourcefile + * + * @return int + */ + public function getPageCount() + { + return $this->page_count; + } + + + /** + * Set pageno + * + * @param int $pageno Pagenumber to use + */ + public function setPageno($pageno) + { + $pageno = ((int) $pageno) - 1; + + if ($pageno < 0 || $pageno >= $this->getPageCount()) { + $this->fpdi->error('Pagenumber is wrong!'); + } + + $this->pageno = $pageno; + } + + /** + * Get page-resources from current page + * + * @return array + */ + public function getPageResources() + { + return $this->_getPageResources($this->pages[$this->pageno]); + } + + /** + * Get page-resources from /Page + * + * @param array $obj Array of pdf-data + */ + public function _getPageResources ($obj) + { // $obj = /Page + $obj = $this->pdf_resolve_object($this->c, $obj); + + // If the current object has a resources + // dictionary associated with it, we use + // it. Otherwise, we move back to its + // parent object. + if (isset ($obj[1][1]['/Resources'])) { + $res = $this->pdf_resolve_object($this->c, $obj[1][1]['/Resources']); + if ($res[0] == PDF_TYPE_OBJECT) + return $res[1]; + return $res; + } else { + if (!isset ($obj[1][1]['/Parent'])) { + return false; + } else { + $res = $this->_getPageResources($obj[1][1]['/Parent']); + if ($res[0] == PDF_TYPE_OBJECT) + return $res[1]; + return $res; + } + } + } + + + /** + * Get content of current page + * + * If more /Contents is an array, the streams are concated + * + * @return string + */ + public function getContent() + { + $buffer = ''; + + if (isset($this->pages[$this->pageno][1][1]['/Contents'])) { + $contents = $this->_getPageContent($this->pages[$this->pageno][1][1]['/Contents']); + foreach($contents AS $tmp_content) { + $buffer .= $this->_rebuildContentStream($tmp_content).' '; + } + } + + return $buffer; + } + + + /** + * Resolve all content-objects + * + * @param array $content_ref + * @return array + */ + public function _getPageContent($content_ref) + { + $contents = array(); + + if ($content_ref[0] == PDF_TYPE_OBJREF) { + $content = $this->pdf_resolve_object($this->c, $content_ref); + if ($content[1][0] == PDF_TYPE_ARRAY) { + $contents = $this->_getPageContent($content[1]); + } else { + $contents[] = $content; + } + } elseif ($content_ref[0] == PDF_TYPE_ARRAY) { + foreach ($content_ref[1] AS $tmp_content_ref) { + $contents = array_merge($contents,$this->_getPageContent($tmp_content_ref)); + } + } + + return $contents; + } + + + /** + * Rebuild content-streams + * + * @param array $obj + * @return string + */ + public function _rebuildContentStream($obj) + { + $filters = array(); + + if (isset($obj[1][1]['/Filter'])) { + $_filter = $obj[1][1]['/Filter']; + + if ($_filter[0] == PDF_TYPE_TOKEN) { + $filters[] = $_filter; + } elseif ($_filter[0] == PDF_TYPE_ARRAY) { + $filters = $_filter[1]; + } + } + + $stream = $obj[2][1]; + + foreach ($filters AS $_filter) { + switch ($_filter[1]) { + case '/FlateDecode': + if (function_exists('gzuncompress')) { + $stream = (strlen($stream) > 0) ? @gzuncompress($stream) : ''; + } else { + $this->error(sprintf('To handle %s filter, please compile php with zlib support.',$_filter[1])); + } + if ($stream === false) { + $this->error('Error while decompressing stream.'); + } + break; + case '/LZWDecode': + include_once('filters/TNTOfficiel_FilterLZW_FPDI.php'); + $decoder = new TNTOfficiel_FilterLZW_FPDI($this->fpdi); + $stream = $decoder->decode($stream); + break; + case '/ASCII85Decode': + include_once('filters/TNTOfficiel_FilterASCII85_FPDI.php'); + $decoder = new TNTOfficiel_FilterASCII85_FPDI($this->fpdi); + $stream = $decoder->decode($stream); + break; + case null: + $stream = $stream; + break; + default: + $this->error(sprintf('Unsupported Filter: %s',$_filter[1])); + } + } + + return $stream; + } + + + /** + * Get a Box from a page + * Arrayformat is same as used by fpdf_tpl + * + * @param array $page a /Page + * @param string $box_index Type of Box @see $availableBoxes + * @return array + */ + public function getPageBox($page, $box_index) + { + $page = $this->pdf_resolve_object($this->c,$page); + $box = null; + if (isset($page[1][1][$box_index])) + $box =& $page[1][1][$box_index]; + + if (!is_null($box) && $box[0] == PDF_TYPE_OBJREF) { + $tmp_box = $this->pdf_resolve_object($this->c,$box); + $box = $tmp_box[1]; + } + + if (!is_null($box) && $box[0] == PDF_TYPE_ARRAY) { + $b =& $box[1]; + return array('x' => $b[0][1]/$this->fpdi->k, + 'y' => $b[1][1]/$this->fpdi->k, + 'w' => abs($b[0][1]-$b[2][1])/$this->fpdi->k, + 'h' => abs($b[1][1]-$b[3][1])/$this->fpdi->k, + 'llx' => min($b[0][1], $b[2][1])/$this->fpdi->k, + 'lly' => min($b[1][1], $b[3][1])/$this->fpdi->k, + 'urx' => max($b[0][1], $b[2][1])/$this->fpdi->k, + 'ury' => max($b[1][1], $b[3][1])/$this->fpdi->k, + ); + } elseif (!isset ($page[1][1]['/Parent'])) { + return false; + } else { + return $this->getPageBox($this->pdf_resolve_object($this->c, $page[1][1]['/Parent']), $box_index); + } + } + + public function getPageBoxes($pageno) + { + return $this->_getPageBoxes($this->pages[$pageno-1]); + } + + /** + * Get all Boxes from /Page + * + * @param array a /Page + * @return array + */ + public function _getPageBoxes($page) + { + $boxes = array(); + + foreach($this->availableBoxes AS $box) { + if ($_box = $this->getPageBox($page,$box)) { + $boxes[$box] = $_box; + } + } + + return $boxes; + } + + /** + * Get the page rotation by pageno + * + * @param integer $pageno + * @return array + */ + public function getPageRotation($pageno) + { + return $this->_getPageRotation($this->pages[$pageno-1]); + } + + public function _getPageRotation ($obj) + { // $obj = /Page + $obj = $this->pdf_resolve_object($this->c, $obj); + if (isset ($obj[1][1]['/Rotate'])) { + $res = $this->pdf_resolve_object($this->c, $obj[1][1]['/Rotate']); + if ($res[0] == PDF_TYPE_OBJECT) + return $res[1]; + return $res; + } else { + if (!isset ($obj[1][1]['/Parent'])) { + return false; + } else { + $res = $this->_getPageRotation($obj[1][1]['/Parent']); + if ($res[0] == PDF_TYPE_OBJECT) + return $res[1]; + return $res; + } + } + } + + /** + * Read all /Page(es) + * + * @param object TNTOfficiel_pdf_context + * @param array /Pages + * @param array the result-array + */ + public function read_pages (&$c, &$pages, &$result) + { + // Get the kids dictionary + $kids = $this->pdf_resolve_object ($c, $pages[1][1]['/Kids']); + + if (!is_array($kids)) + $this->error('Cannot find /Kids in current /Page-Dictionary'); + foreach ($kids[1] as $v) { + $pg = $this->pdf_resolve_object ($c, $v); + if ($pg[1][1]['/Type'][1] === '/Pages') { + // If one of the kids is an embedded + // /Pages array, resolve it as well. + $this->read_pages ($c, $pg, $result); + } else { + $result[] = $pg; + } + } + } + + + + /** + * Get PDF-Version + * + * And reset the PDF Version used in FPDI if needed + */ + public function getPDFVersion() + { + parent::getPDFVersion(); + $this->fpdi->PDFVersion = max($this->fpdi->PDFVersion, $this->pdfVersion); + } + +} \ No newline at end of file diff --git a/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_pdf_context.php b/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_pdf_context.php new file mode 100644 index 00000000..4c6b8871 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_pdf_context.php @@ -0,0 +1,105 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +// +// FPDI - Version 1.3.1 +// +// Copyright 2004-2009 Setasign - Jan Slabon +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +class TNTOfficiel_pdf_context { + + /** + * Modi + * + * @var integer 0 = file | 1 = string + */ + var $_mode = 0; + + var $file; + var $buffer; + var $offset; + var $length; + + var $stack; + + // Constructor + + public function TNTOfficiel_pdf_context(&$f) { + $this->file =& $f; + if (is_string($this->file)) + $this->_mode = 1; + $this->reset(); + } + + // Optionally move the file + // pointer to a new location + // and reset the buffered data + + public function reset($pos = null, $l = 100) { + if ($this->_mode == 0) { + if (!is_null ($pos)) { + fseek ($this->file, $pos); + } + + $this->buffer = $l > 0 ? fread($this->file, $l) : ''; + $this->length = strlen($this->buffer); + if ($this->length < $l) + $this->increase_length($l - $this->length); + } else { + $this->buffer = $this->file; + $this->length = strlen($this->buffer); + } + $this->offset = 0; + $this->stack = array(); + } + + // Make sure that there is at least one + // character beyond the current offset in + // the buffer to prevent the tokenizer + // from attempting to access data that does + // not exist + + public function ensure_content() { + if ($this->offset >= $this->length - 1) { + return $this->increase_length(); + } else { + return true; + } + } + + // Forcefully read more data into the buffer + + public function increase_length($l=100) { + if ($this->_mode == 0 && feof($this->file)) { + return false; + } elseif ($this->_mode == 0) { + $totalLength = $this->length + $l; + do { + $this->buffer .= fread($this->file, $totalLength-$this->length); + } while ((($this->length = strlen($this->buffer)) != $totalLength) && !feof($this->file)); + + return true; + } else { + return false; + } + } +} diff --git a/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_pdf_parser.php b/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_pdf_parser.php new file mode 100644 index 00000000..3cb5e7c3 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdi/TNTOfficiel_pdf_parser.php @@ -0,0 +1,725 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +// +// FPDI - Version 1.3.1 +// +// Copyright 2004-2009 Setasign - Jan Slabon +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +if (!defined('PDF_TYPE_NULL')) + define('PDF_TYPE_NULL', 0); +if (!defined('PDF_TYPE_NUMERIC')) + define('PDF_TYPE_NUMERIC', 1); +if (!defined('PDF_TYPE_TOKEN')) + define('PDF_TYPE_TOKEN', 2); +if (!defined('PDF_TYPE_HEX')) + define('PDF_TYPE_HEX', 3); +if (!defined('PDF_TYPE_STRING')) + define('PDF_TYPE_STRING', 4); +if (!defined('PDF_TYPE_DICTIONARY')) + define('PDF_TYPE_DICTIONARY', 5); +if (!defined('PDF_TYPE_ARRAY')) + define('PDF_TYPE_ARRAY', 6); +if (!defined('PDF_TYPE_OBJDEC')) + define('PDF_TYPE_OBJDEC', 7); +if (!defined('PDF_TYPE_OBJREF')) + define('PDF_TYPE_OBJREF', 8); +if (!defined('PDF_TYPE_OBJECT')) + define('PDF_TYPE_OBJECT', 9); +if (!defined('PDF_TYPE_STREAM')) + define('PDF_TYPE_STREAM', 10); +if (!defined('PDF_TYPE_BOOLEAN')) + define('PDF_TYPE_BOOLEAN', 11); +if (!defined('PDF_TYPE_REAL')) + define('PDF_TYPE_REAL', 12); + +require_once('TNTOfficiel_pdf_context.php'); + +if (!class_exists('TNTOfficiel_pdf_parser')) { + + class TNTOfficiel_pdf_parser { + + /** + * Filename + * @var string + */ + var $filename; + + /** + * File resource + * @var resource + */ + var $f; + + /** + * PDF Context + * @var object TNTOfficiel_pdf_context-Instance + */ + var $c; + + /** + * xref-Data + * @var array + */ + var $xref; + + /** + * root-Object + * @var array + */ + var $root; + + /** + * PDF version of the loaded document + * @var string + */ + var $pdfVersion; + + /** + * Constructor + * + * @param string $filename Source-Filename + */ + public function TNTOfficiel_pdf_parser($filename) + { + $this->filename = $filename; + + $this->f = @fopen($this->filename, 'rb'); + + if (!$this->f) + $this->error(sprintf('Cannot open %s !', $filename)); + + $this->getPDFVersion(); + + $this->c = new TNTOfficiel_pdf_context($this->f); + + // Read xref-Data + $this->xref = array(); + $this->pdf_read_xref($this->xref, $this->pdf_find_xref()); + + // Check for Encryption + $this->getEncryption(); + + // Read root + $this->pdf_read_root(); + } + + /** + * Close the opened file + */ + public function closeFile() + { + if (isset($this->f) && is_resource($this->f)) { + fclose($this->f); + unset($this->f); + } + } + + /** + * Print Error and die + * + * @param string $msg Error-Message + */ + public function error($msg) + { + die('PDF-Parser Error: '.$msg); + } + + /** + * Check Trailer for Encryption + */ + public function getEncryption() + { + if (isset($this->xref['trailer'][1]['/Encrypt'])) { + $this->error('File is encrypted!'); + } + } + + /** + * Find/Return /Root + * + * @return array + */ + public function pdf_find_root() + { + if ($this->xref['trailer'][1]['/Root'][0] != PDF_TYPE_OBJREF) { + $this->error('Wrong Type of Root-Element! Must be an indirect reference'); + } + + return $this->xref['trailer'][1]['/Root']; + } + + /** + * Read the /Root + */ + public function pdf_read_root() + { + // read root + $this->root = $this->pdf_resolve_object($this->c, $this->pdf_find_root()); + } + + /** + * Get PDF-Version + * + * And reset the PDF Version used in FPDI if needed + */ + public function getPDFVersion() + { + fseek($this->f, 0); + preg_match('/\d\.\d/',fread($this->f,16),$m); + if (isset($m[0])) + $this->pdfVersion = $m[0]; + return $this->pdfVersion; + } + + /** + * Find the xref-Table + */ + public function pdf_find_xref() + { + $toRead = 1500; + + $stat = fseek ($this->f, -$toRead, SEEK_END); + if ($stat === -1) { + fseek ($this->f, 0); + } + $data = fread($this->f, $toRead); + + $pos = strlen($data) - strpos(strrev($data), strrev('startxref')); + $data = substr($data, $pos); + + if (!preg_match('/\s*(\d+).*$/s', $data, $matches)) { + $this->error('Unable to find pointer to xref table'); + } + + return (int) $matches[1]; + } + + /** + * Read xref-table + * + * @param array $result Array of xref-table + * @param integer $offset of xref-table + */ + public function pdf_read_xref(&$result, $offset) + { + + fseek($this->f, $o_pos = $offset-20); // set some bytes backwards to fetch errorious docs + + $data = fread($this->f, 100); + + $xrefPos = strrpos($data, 'xref'); + + if ($xrefPos === false) { + fseek($this->f, $offset); + $c = new TNTOfficiel_pdf_context($this->f); + $xrefStreamObjDec = $this->pdf_read_value($c); + + if (is_array($xrefStreamObjDec) && isset($xrefStreamObjDec[0]) && $xrefStreamObjDec[0] == PDF_TYPE_OBJDEC) { + $this->error(sprintf('This document (%s) probably uses a compression technique which is not supported by the free parser shipped with FPDI.', $this->filename)); + } else { + $this->error('Unable to find xref table.'); + } + } + + if (!isset($result['xref_location'])) { + $result['xref_location'] = $o_pos+$xrefPos; + $result['max_object'] = 0; + } + + $cylces = -1; + $bytesPerCycle = 100; + + fseek($this->f, $o_pos = $o_pos+$xrefPos+4); // set the handle directly after the "xref"-keyword + $data = fread($this->f, $bytesPerCycle); + + while (($trailerPos = strpos($data, 'trailer', max($bytesPerCycle*$cylces++, 0))) === false && !feof($this->f)) { + $data .= fread($this->f, $bytesPerCycle); + } + + if ($trailerPos === false) { + $this->error('Trailer keyword not found after xref table'); + } + + $data = substr($data, 0, $trailerPos); + + // get Line-Ending + preg_match_all("/(\r\n|\n|\r)/", substr($data, 0, 100), $m); // check the first 100 bytes for linebreaks + + $differentLineEndings = count(array_unique($m[0])); + if ($differentLineEndings > 1) { + $lines = preg_split("/(\r\n|\n|\r)/", $data, -1, PREG_SPLIT_NO_EMPTY); + } else { + $lines = explode($m[0][1], $data); + } + + $data = $differentLineEndings = $m = null; + unset($data, $differentLineEndings, $m); + + $linesCount = count($lines); + + $start = 1; + + for ($i = 0; $i < $linesCount; $i++) { + $line = trim($lines[$i]); + if ($line) { + $pieces = explode(' ', $line); + $c = count($pieces); + switch($c) { + case 2: + $start = (int)$pieces[0]; + $end = $start+(int)$pieces[1]; + if ($end > $result['max_object']) + $result['max_object'] = $end; + break; + case 3: + if (!isset($result['xref'][$start])) + $result['xref'][$start] = array(); + + if (!array_key_exists($gen = (int) $pieces[1], $result['xref'][$start])) { + $result['xref'][$start][$gen] = $pieces[2] == 'n' ? (int) $pieces[0] : null; + } + $start++; + break; + default: + $this->error('Unexpected data in xref table'); + } + } + } + + $lines = $pieces = $line = $start = $end = $gen = null; + unset($lines, $pieces, $line, $start, $end, $gen); + + fseek($this->f, $o_pos+$trailerPos+7); + + $c = new TNTOfficiel_pdf_context($this->f); + $trailer = $this->pdf_read_value($c); + + $c = null; + unset($c); + + if (!isset($result['trailer'])) { + $result['trailer'] = $trailer; + } + + if (isset($trailer[1]['/Prev'])) { + $this->pdf_read_xref($result, $trailer[1]['/Prev'][1]); + } + + $trailer = null; + unset($trailer); + + return true; + } + + /** + * Reads an Value + * + * @param object $c TNTOfficiel_pdf_context + * @param string $token a Token + * @return mixed + */ + public function pdf_read_value(&$c, $token = null) + { + if (is_null($token)) { + $token = $this->pdf_read_token($c); + } + + if ($token === false) { + return false; + } + + switch ($token) { + case '<': + // This is a hex string. + // Read the value, then the terminator + + $pos = $c->offset; + + while(1) { + + $match = strpos ($c->buffer, '>', $pos); + + // If you can't find it, try + // reading more data from the stream + + if ($match === false) { + if (!$c->increase_length()) { + return false; + } else { + continue; + } + } + + $result = substr ($c->buffer, $c->offset, $match - $c->offset); + $c->offset = $match + 1; + + return array (PDF_TYPE_HEX, $result); + } + + break; + case '<<': + // This is a dictionary. + + $result = array(); + + // Recurse into this function until we reach + // the end of the dictionary. + while (($key = $this->pdf_read_token($c)) !== '>>') { + if ($key === false) { + return false; + } + + if (($value = $this->pdf_read_value($c)) === false) { + return false; + } + + // Catch missing value + if ($value[0] == PDF_TYPE_TOKEN && $value[1] == '>>') { + $result[$key] = array(PDF_TYPE_NULL); + break; + } + + $result[$key] = $value; + } + + return array (PDF_TYPE_DICTIONARY, $result); + + case '[': + // This is an array. + + $result = array(); + + // Recurse into this function until we reach + // the end of the array. + while (($token = $this->pdf_read_token($c)) !== ']') { + if ($token === false) { + return false; + } + + if (($value = $this->pdf_read_value($c, $token)) === false) { + return false; + } + + $result[] = $value; + } + + return array (PDF_TYPE_ARRAY, $result); + + case '(': + // This is a string + $pos = $c->offset; + + $openBrackets = 1; + do { + for (; $openBrackets != 0 && $pos < $c->length; $pos++) { + switch (ord($c->buffer[$pos])) { + case 0x28: // '(' + $openBrackets++; + break; + case 0x29: // ')' + $openBrackets--; + break; + case 0x5C: // backslash + $pos++; + } + } + } while($openBrackets != 0 && $c->increase_length()); + + $result = substr($c->buffer, $c->offset, $pos - $c->offset - 1); + $c->offset = $pos; + + return array (PDF_TYPE_STRING, $result); + + case 'stream': + $o_pos = ftell($c->file)-strlen($c->buffer); + $o_offset = $c->offset; + + $c->reset($startpos = $o_pos + $o_offset); + + $e = 0; // ensure line breaks in front of the stream + if ($c->buffer[0] == chr(10) || $c->buffer[0] == chr(13)) + $e++; + if ($c->buffer[1] == chr(10) && $c->buffer[0] != chr(10)) + $e++; + + if ($this->actual_obj[1][1]['/Length'][0] == PDF_TYPE_OBJREF) { + $tmp_c = new TNTOfficiel_pdf_context($this->f); + $tmp_length = $this->pdf_resolve_object($tmp_c,$this->actual_obj[1][1]['/Length']); + $length = $tmp_length[1][1]; + } else { + $length = $this->actual_obj[1][1]['/Length'][1]; + } + + if ($length > 0) { + $c->reset($startpos+$e,$length); + $v = $c->buffer; + } else { + $v = ''; + } + $c->reset($startpos+$e+$length+9); // 9 = strlen("endstream") + + return array(PDF_TYPE_STREAM, $v); + + default: + if (is_numeric ($token)) { + // A numeric token. Make sure that + // it is not part of something else. + if (($tok2 = $this->pdf_read_token ($c)) !== false) { + if (is_numeric ($tok2)) { + + // Two numeric tokens in a row. + // In this case, we're probably in + // front of either an object reference + // or an object specification. + // Determine the case and return the data + if (($tok3 = $this->pdf_read_token ($c)) !== false) { + switch ($tok3) { + case 'obj': + return array (PDF_TYPE_OBJDEC, (int) $token, (int) $tok2); + case 'R': + return array (PDF_TYPE_OBJREF, (int) $token, (int) $tok2); + } + // If we get to this point, that numeric value up + // there was just a numeric value. Push the extra + // tokens back into the stack and return the value. + array_push ($c->stack, $tok3); + } + } + + array_push ($c->stack, $tok2); + } + + if ($token === (string)((int)$token)) + return array (PDF_TYPE_NUMERIC, (int)$token); + else + return array (PDF_TYPE_REAL, (float)$token); + } elseif ($token == 'true' || $token == 'false') { + return array (PDF_TYPE_BOOLEAN, $token == 'true'); + } elseif ($token == 'null') { + return array (PDF_TYPE_NULL); + } else { + // Just a token. Return it. + return array (PDF_TYPE_TOKEN, $token); + } + } + } + + /** + * Resolve an object + * + * @param object $c TNTOfficiel_pdf_context + * @param array $obj_spec The object-data + * @param boolean $encapsulate Must set to true, cause the parsing and fpdi use this method only without this para + */ + public function pdf_resolve_object(&$c, $obj_spec, $encapsulate = true) + { + // Exit if we get invalid data + if (!is_array($obj_spec)) { + $ret = false; + return $ret; + } + + if ($obj_spec[0] == PDF_TYPE_OBJREF) { + + // This is a reference, resolve it + if (isset($this->xref['xref'][$obj_spec[1]][$obj_spec[2]])) { + + // Save current file position + // This is needed if you want to resolve + // references while you're reading another object + // (e.g.: if you need to determine the length + // of a stream) + + $old_pos = ftell($c->file); + + // Reposition the file pointer and + // load the object header. + + $c->reset($this->xref['xref'][$obj_spec[1]][$obj_spec[2]]); + + $header = $this->pdf_read_value($c); + + if ($header[0] != PDF_TYPE_OBJDEC || $header[1] != $obj_spec[1] || $header[2] != $obj_spec[2]) { + $this->error("Unable to find object ({$obj_spec[1]}, {$obj_spec[2]}) at expected location"); + } + + // If we're being asked to store all the information + // about the object, we add the object ID and generation + // number for later use + $result = array(); + $this->actual_obj =& $result; + if ($encapsulate) { + $result = array ( + PDF_TYPE_OBJECT, + 'obj' => $obj_spec[1], + 'gen' => $obj_spec[2] + ); + } + + // Now simply read the object data until + // we encounter an end-of-object marker + while(1) { + $value = $this->pdf_read_value($c); + if ($value === false || count($result) > 4) { + // in this case the parser coudn't find an endobj so we break here + break; + } + + if ($value[0] == PDF_TYPE_TOKEN && $value[1] === 'endobj') { + break; + } + + $result[] = $value; + } + + $c->reset($old_pos); + + if (isset($result[2][0]) && $result[2][0] == PDF_TYPE_STREAM) { + $result[0] = PDF_TYPE_STREAM; + } + + return $result; + } + } else { + return $obj_spec; + } + } + + + + /** + * Reads a token from the file + * + * @param object $c TNTOfficiel_pdf_context + * @return mixed + */ + public function pdf_read_token(&$c) + { + // If there is a token available + // on the stack, pop it out and + // return it. + + if (count($c->stack)) { + return array_pop($c->stack); + } + + // Strip away any whitespace + + do { + if (!$c->ensure_content()) { + return false; + } + $c->offset += strspn($c->buffer, " \n\r\t", $c->offset); + } while ($c->offset >= $c->length - 1); + + // Get the first character in the stream + + $char = $c->buffer[$c->offset++]; + + switch ($char) { + + case '[': + case ']': + case '(': + case ')': + + // This is either an array or literal string + // delimiter, Return it + + return $char; + + case '<': + case '>': + + // This could either be a hex string or + // dictionary delimiter. Determine the + // appropriate case and return the token + + if ($c->buffer[$c->offset] == $char) { + if (!$c->ensure_content()) { + return false; + } + $c->offset++; + return $char . $char; + } else { + return $char; + } + + case '%': + + // This is a comment - jump over it! + + $pos = $c->offset; + while(1) { + $match = preg_match("/(\r\n|\r|\n)/", $c->buffer, $m, PREG_OFFSET_CAPTURE, $pos); + if ($match === 0) { + if (!$c->increase_length()) { + return false; + } else { + continue; + } + } + + $c->offset = $m[0][1]+strlen($m[0][0]); + + return $this->pdf_read_token($c); + } + + default: + + // This is "another" type of token (probably + // a dictionary entry or a numeric value) + // Find the end and return it. + + if (!$c->ensure_content()) { + return false; + } + + while(1) { + + // Determine the length of the token + + $pos = strcspn($c->buffer, " %[]<>()\r\n\t/", $c->offset); + + if ($c->offset + $pos <= $c->length - 1) { + break; + } else { + // If the script reaches this point, + // the token may span beyond the end + // of the current buffer. Therefore, + // we increase the size of the buffer + // and try again--just to be safe. + + $c->increase_length(); + } + } + + $result = substr($c->buffer, $c->offset - 1, $pos + 1); + + $c->offset += $pos; + return $result; + } + } + } + +} \ No newline at end of file diff --git a/www/modules/tntofficiel/libraries/pdf/fpdi/filters/TNTOfficiel_FilterASCII85.php b/www/modules/tntofficiel/libraries/pdf/fpdi/filters/TNTOfficiel_FilterASCII85.php new file mode 100644 index 00000000..401b4404 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdi/filters/TNTOfficiel_FilterASCII85.php @@ -0,0 +1,110 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +// +// FPDI - Version 1.3.1 +// +// Copyright 2004-2009 Setasign - Jan Slabon +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +if (!defined('ORD_z')) { + define('ORD_z', ord('z')); +} +if (!defined('ORD_exclmark')) { + define('ORD_exclmark', ord('!')); +} +if (!defined('ORD_u')) { + define('ORD_u', ord('u')); +} +if (!defined('ORD_tilde')) { + define('ORD_tilde', ord('~')); +} + +class TNTOfficiel_FilterASCII85 { + + public function error($msg) { + die($msg); + } + + public function decode($in) { + $out = ''; + $state = 0; + $chn = null; + + $l = strlen($in); + + for ($k = 0; $k < $l; ++$k) { + $ch = ord($in[$k]) & 0xff; + + if ($ch == ORD_tilde) { + break; + } + if (preg_match('/^\s$/',chr($ch))) { + continue; + } + if ($ch == ORD_z && $state == 0) { + $out .= chr(0).chr(0).chr(0).chr(0); + continue; + } + if ($ch < ORD_exclmark || $ch > ORD_u) { + $this->error('Illegal character in ASCII85Decode.'); + } + + $chn[$state++] = $ch - ORD_exclmark; + + if ($state == 5) { + $state = 0; + $r = 0; + for ($j = 0; $j < 5; ++$j) + $r = $r * 85 + $chn[$j]; + $out .= chr($r >> 24); + $out .= chr($r >> 16); + $out .= chr($r >> 8); + $out .= chr($r); + } + } + $r = 0; + + if ($state == 1) + $this->error('Illegal length in ASCII85Decode.'); + if ($state == 2) { + $r = $chn[0] * 85 * 85 * 85 * 85 + ($chn[1]+1) * 85 * 85 * 85; + $out .= chr($r >> 24); + } + elseif ($state == 3) { + $r = $chn[0] * 85 * 85 * 85 * 85 + $chn[1] * 85 * 85 * 85 + ($chn[2]+1) * 85 * 85; + $out .= chr($r >> 24); + $out .= chr($r >> 16); + } + elseif ($state == 4) { + $r = $chn[0] * 85 * 85 * 85 * 85 + $chn[1] * 85 * 85 * 85 + $chn[2] * 85 * 85 + ($chn[3]+1) * 85 ; + $out .= chr($r >> 24); + $out .= chr($r >> 16); + $out .= chr($r >> 8); + } + + return $out; + } + + public function encode($in) { + $this->error("ASCII85 encoding not implemented."); + } +} \ No newline at end of file diff --git a/www/modules/tntofficiel/libraries/pdf/fpdi/filters/TNTOfficiel_FilterASCII85_FPDI.php b/www/modules/tntofficiel/libraries/pdf/fpdi/filters/TNTOfficiel_FilterASCII85_FPDI.php new file mode 100644 index 00000000..349d726a --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdi/filters/TNTOfficiel_FilterASCII85_FPDI.php @@ -0,0 +1,41 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +// +// FPDI - Version 1.3.1 +// +// Copyright 2004-2009 Setasign - Jan Slabon +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +require_once('TNTOfficiel_FilterASCII85.php'); + +class TNTOfficiel_FilterASCII85_FPDI extends TNTOfficiel_FilterASCII85 { + + var $fpdi; + + public function TNTOfficiel_FilterASCII85_FPDI(&$fpdi) { + $this->fpdi =& $fpdi; + } + + public function error($msg) { + $this->fpdi->error($msg); + } +} \ No newline at end of file diff --git a/www/modules/tntofficiel/libraries/pdf/fpdi/filters/TNTOfficiel_FilterLZW.php b/www/modules/tntofficiel/libraries/pdf/fpdi/filters/TNTOfficiel_FilterLZW.php new file mode 100644 index 00000000..5216177d --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdi/filters/TNTOfficiel_FilterLZW.php @@ -0,0 +1,162 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +// +// FPDI - Version 1.3.1 +// +// Copyright 2004-2009 Setasign - Jan Slabon +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +class TNTOfficiel_FilterLZW { + + var $sTable = array(); + var $data = null; + var $dataLength = 0; + var $tIdx; + var $bitsToGet = 9; + var $bytePointer; + var $bitPointer; + var $nextData = 0; + var $nextBits = 0; + var $andTable = array(511, 1023, 2047, 4095); + + public function error($msg) { + die($msg); + } + + /** + * Method to decode LZW compressed data. + * + * @param string data The compressed data. + */ + public function decode($data) { + + if($data[0] == 0x00 && $data[1] == 0x01) { + $this->error('LZW flavour not supported.'); + } + + $this->initsTable(); + + $this->data = $data; + $this->dataLength = strlen($data); + + // Initialize pointers + $this->bytePointer = 0; + $this->bitPointer = 0; + + $this->nextData = 0; + $this->nextBits = 0; + + $oldCode = 0; + + $string = ''; + $uncompData = ''; + + while (($code = $this->getNextCode()) != 257) { + if ($code == 256) { + $this->initsTable(); + $code = $this->getNextCode(); + + if ($code == 257) { + break; + } + + $uncompData .= $this->sTable[$code]; + $oldCode = $code; + + } else { + + if ($code < $this->tIdx) { + $string = $this->sTable[$code]; + $uncompData .= $string; + + $this->addStringToTable($this->sTable[$oldCode], $string[0]); + $oldCode = $code; + } else { + $string = $this->sTable[$oldCode]; + $string = $string.$string[0]; + $uncompData .= $string; + + $this->addStringToTable($string); + $oldCode = $code; + } + } + } + + return $uncompData; + } + + + /** + * Initialize the string table. + */ + public function initsTable() { + $this->sTable = array(); + + for ($i = 0; $i < 256; $i++) + $this->sTable[$i] = chr($i); + + $this->tIdx = 258; + $this->bitsToGet = 9; + } + + /** + * Add a new string to the string table. + */ + public function addStringToTable ($oldString, $newString='') { + $string = $oldString.$newString; + + // Add this new String to the table + $this->sTable[$this->tIdx++] = $string; + + if ($this->tIdx == 511) { + $this->bitsToGet = 10; + } elseif ($this->tIdx == 1023) { + $this->bitsToGet = 11; + } elseif ($this->tIdx == 2047) { + $this->bitsToGet = 12; + } + } + + // Returns the next 9, 10, 11 or 12 bits + public function getNextCode() { + if ($this->bytePointer == $this->dataLength) { + return 257; + } + + $this->nextData = ($this->nextData << 8) | (ord($this->data[$this->bytePointer++]) & 0xff); + $this->nextBits += 8; + + if ($this->nextBits < $this->bitsToGet) { + $this->nextData = ($this->nextData << 8) | (ord($this->data[$this->bytePointer++]) & 0xff); + $this->nextBits += 8; + } + + $code = ($this->nextData >> ($this->nextBits - $this->bitsToGet)) & $this->andTable[$this->bitsToGet-9]; + $this->nextBits -= $this->bitsToGet; + + return $code; + } + + public function encode($in) { + $this->error("LZW encoding not implemented."); + } +} \ No newline at end of file diff --git a/www/modules/tntofficiel/libraries/pdf/fpdi/filters/TNTOfficiel_FilterLZW_FPDI.php b/www/modules/tntofficiel/libraries/pdf/fpdi/filters/TNTOfficiel_FilterLZW_FPDI.php new file mode 100644 index 00000000..9b4d8d62 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdi/filters/TNTOfficiel_FilterLZW_FPDI.php @@ -0,0 +1,41 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +// +// FPDI - Version 1.3.1 +// +// Copyright 2004-2009 Setasign - Jan Slabon +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +require_once('TNTOfficiel_FilterLZW.php'); + +class TNTOfficiel_FilterLZW_FPDI extends TNTOfficiel_FilterLZW { + + var $fpdi; + + function TNTOfficiel_FilterLZW_FPDI(&$fpdi) { + $this->fpdi =& $fpdi; + } + + function error($msg) { + $this->fpdi->error($msg); + } +} \ No newline at end of file diff --git a/www/modules/tntofficiel/libraries/pdf/fpdi/filters/index.php b/www/modules/tntofficiel/libraries/pdf/fpdi/filters/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdi/filters/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/libraries/pdf/fpdi/index.php b/www/modules/tntofficiel/libraries/pdf/fpdi/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/fpdi/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/libraries/pdf/index.php b/www/modules/tntofficiel/libraries/pdf/index.php new file mode 100644 index 00000000..f16b36c6 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/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/libraries/pdf/manifest/HTMLTemplateTNTOfficielManifest.php b/www/modules/tntofficiel/libraries/pdf/manifest/HTMLTemplateTNTOfficielManifest.php new file mode 100644 index 00000000..477b692d --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/manifest/HTMLTemplateTNTOfficielManifest.php @@ -0,0 +1,90 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; + +// HTMLTemplate. +class HTMLTemplateTNTOfficielManifest extends HTMLTemplate +{ + public $custom_model; + + public function __construct($custom_object, $smarty) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->custom_model = $custom_object; + $this->smarty = $smarty; + + // header informations + $id_lang = Context::getContext()->language->id; + $this->title = HTMLTemplateTNTOfficielManifest::l('Titre Test'); + // footer informations + $this->shop = new Shop(Context::getContext()->shop->id); + } + + /** + * Returns the template's HTML content + * @return string HTML content + */ + public function getContent() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->smarty->assign(array( + 'manifestData' => $this->custom_model, + )); + + return $this->smarty->fetch(_PS_MODULE_DIR_.'tntofficiel/views/templates/admin/manifest/custom_template_content.tpl'); + } + + public function getHeader() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->smarty->assign(array( + 'manifestData' => $this->custom_model, + )); + + return $this->smarty->fetch(_PS_MODULE_DIR_.'tntofficiel/views/templates/admin/manifest/custom_template_header.tpl'); + } + + /** + * Returns the template filename + * @return string filename + */ + public function getFooter() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + return $this->smarty->fetch(_PS_MODULE_DIR_.'tntofficiel/views/templates/admin/manifest/custom_template_footer.tpl'); + } + + /** + * Returns the template filename + * @return string filename + */ + public function getFilename() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + return 'Manifeste.pdf'; + } + + /** + * Returns the template filename when using bulk rendering + * @return string filename + */ + public function getBulkFilename() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + return 'Manifeste.pdf'; + } + +} diff --git a/www/modules/tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDF.php b/www/modules/tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDF.php new file mode 100644 index 00000000..b55468f0 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDF.php @@ -0,0 +1,34 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; +require_once(_PS_MODULE_DIR_.'tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDFGenerator.php'); + +class TNTOfficiel_ManifestPDF extends PDF +{ + /** + * Constructor + * @param $objects + * @param $template + * @param $smarty + * @param string $orientation + */ + public function __construct($objects, $template, $smarty, $orientation = 'P') + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->pdf_renderer = new TNTOfficiel_ManifestPDFGenerator((bool)Configuration::get('PS_PDF_USE_CACHE'), $orientation); + $this->template = $template; + $this->smarty = $smarty; + $this->objects = $objects; + if (!($objects instanceof Iterator) && !is_array($objects)) + $this->objects = array($objects); + } + +} diff --git a/www/modules/tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDFCreator.php b/www/modules/tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDFCreator.php new file mode 100644 index 00000000..61246ef1 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDFCreator.php @@ -0,0 +1,105 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +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/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'; + +class TNTOfficiel_ManifestPDFCreator +{ + public function __construct() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + } + + /** + * @param $orderList array + * @throws Exception + */ + public function createManifest($orderList) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $parcelsData = array(); + foreach ($orderList as $intOrderID) { + $intOrderID = (int)$intOrderID; + $objOrder = new Order($intOrderID); + if (!TNTOfficiel_Carrier::isTNTOfficielCarrierID($objOrder->id_carrier)) { + continue; + } + $arrTNTOrder = TNTOfficiel_OrderHelper::getInstance()->getOrderData($intOrderID, false); + $onjAddress = new Address($objOrder->id_address_delivery); + $parcels = TNTOfficiel_ParcelsHelper::getInstance()->getParcels($intOrderID); + foreach ($parcels as $p) { + $parcel = $p; + $parcel['address'] = $onjAddress; + $parcel['tntData'] = $arrTNTOrder; + $parcelsData[] = $parcel; + } + } + $carrierAccount = Configuration::get('TNT_CARRIER_ACCOUNT'); + $carrierName = Configuration::get('TNT_CARRIER_USERNAME'); + + $pdf = new TNTOfficiel_ManifestPDF( + array( + 'manifestData' => array( + 'parcelsData' => $parcelsData, + 'carrierAccount' => $carrierAccount, + 'carrierName' => $carrierName, + 'address' => $this->_getMerchantAddress(), + 'totalWeight' => $this->_getTotalWeight($parcelsData), + 'parcelsNumber' => count($parcelsData) + ) + ), + 'TNTOfficielManifest', + Context::getContext()->smarty + ); + $pdf->render(); + } + + /** + * Returns the shop address + * @return array + */ + private function _getMerchantAddress() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $address = array( + 'name' => Configuration::get('PS_SHOP_NAME'), + 'address1' => Configuration::get('PS_SHOP_ADDR1'), + 'address2' => Configuration::get('PS_SHOP_ADDR2'), + 'postcode' => Configuration::get('PS_SHOP_CODE'), + 'city' => Configuration::get('PS_SHOP_CITY'), + 'country' => Configuration::get('PS_SHOP_COUNTRY'), + ); + + return $address; + } + + /** + * Return the total weight for the given parcels + * @param $parcels + * @return float + */ + private function _getTotalWeight($parcels) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $totalWeight = (float)0; + foreach ($parcels as $parcel) { + $totalWeight += $parcel['weight']; + } + + return $totalWeight; + } + +} diff --git a/www/modules/tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDFGenerator.php b/www/modules/tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDFGenerator.php new file mode 100644 index 00000000..6f499ee0 --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/manifest/TNTOfficiel_ManifestPDFGenerator.php @@ -0,0 +1,23 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; + +class TNTOfficiel_ManifestPDFGenerator extends PDFGenerator +{ + public function Header() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + $this->writeHTML($this->header); + + $this->writeHTML('
Page : '.$this->getAliasNumPage().' de '.$this->getAliasNbPages().'
'); + } + +} diff --git a/www/modules/tntofficiel/libraries/pdf/manifest/index.php b/www/modules/tntofficiel/libraries/pdf/manifest/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/libraries/pdf/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/libraries/smarty/TNTOfficiel_OrderSmartyFunction.php b/www/modules/tntofficiel/libraries/smarty/TNTOfficiel_OrderSmartyFunction.php new file mode 100644 index 00000000..28b0e64f --- /dev/null +++ b/www/modules/tntofficiel/libraries/smarty/TNTOfficiel_OrderSmartyFunction.php @@ -0,0 +1,36 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/helper/TNTOfficiel_OrderHelper.php'; + +class TNTOfficiel_OrderSmartyFunction +{ + /** + * @param $data array + * @param $smarty + * + * @return bool|string + */ + public function getTntOrder($data, $smarty) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + try { + $arrTNTOrder = TNTOfficiel_OrderHelper::getInstance()->getOrderData($data['orderId']); + $smarty->assign('tntOrderData', $arrTNTOrder); + + return (is_string($arrTNTOrder)) ? $arrTNTOrder : null; + } catch (Exception $objException) { + $smarty->assign('tntOrderData', false); + + return false; + } + } +} diff --git a/www/modules/tntofficiel/libraries/smarty/TNTOfficiel_ShippingMethodSmartyFunction.php b/www/modules/tntofficiel/libraries/smarty/TNTOfficiel_ShippingMethodSmartyFunction.php new file mode 100644 index 00000000..499574a3 --- /dev/null +++ b/www/modules/tntofficiel/libraries/smarty/TNTOfficiel_ShippingMethodSmartyFunction.php @@ -0,0 +1,98 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; + +/** + * Class TNTOfficiel_ShippingMethodSmartyFunction. + */ +class TNTOfficiel_ShippingMethodSmartyFunction +{ + /** + * @var array + */ + protected $_days = array( + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday', + 'Sunday', + ); + + /** + * Returns an array with schedules for each days. + * + * @param array $params Parameters of the function + * @param $smarty Smarty engine + * + * @return array + */ + public function getSchedules(array $params, $smarty) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + // Deafult value + if (is_null($params)) { + $params = array(); + } + + $schedules = array(); + + if ($hours = $params['hours']) { + $index = 0; + // Position corresponds to the number of the day + $position = 0; + // Current day + $day = null; + // Part of the day + $part = null; + + foreach ($hours as $hour) { + $hour = trim($hour); + $day = $this->_days[$position]; + + if (($index % 2 === 0) && ($index % 4 === 0)) { + $part = 'AM'; + } elseif (($index % 2 === 0) && ($index % 4 === 2)) { + $part = 'PM'; + } + + // Prepare the current Day + if (!isset($schedules[$day])) { + $schedules[$day] = array(); + } + + // Prepare the current period of the current dya + if (!isset($schedules[$day][$part]) && $hour) { + $schedules[$day][$part] = array(); + } + + // If hours different from 0 + if ($hour) { + // Add hour + $schedules[$day][$part][] = $hour; + } + + ++$index; + + if ($index % 4 == 0) { + ++$position; + } + } + } + + if ($assign = $params['assign']) { + $smarty->assign(array( + $assign => $schedules, + )); + } + } +} diff --git a/www/modules/tntofficiel/libraries/smarty/index.php b/www/modules/tntofficiel/libraries/smarty/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/libraries/smarty/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/log/TNT-request-20170911.log b/www/modules/tntofficiel/log/TNT-request-20170911.log new file mode 100644 index 00000000..7c4dd555 --- /dev/null +++ b/www/modules/tntofficiel/log/TNT-request-20170911.log @@ -0,0 +1,706 @@ +20170911 15:01:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:02:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:02:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:05:07 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:05:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:05:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:08:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:08:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:09:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:09:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:10:07 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:10:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:11:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:13:51 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:13:53 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:14:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:14:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:14:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:14:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:14:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:15:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:15:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:17:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:17:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:17:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:17:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:19:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:19:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:19:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:19:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:19:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:21:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:21:57 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:22:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:22:07 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:22:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:22:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:23:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:23:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:25:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:25:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:26:53 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:27:33 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:28:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:28:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:28:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:28:42 - 08949425 SUCCESS JSON:testCity +20170911 15:28:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:28:51 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:29:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:29:44 - 08949425 SUCCESS JSON:testCity +20170911 15:29:46 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:32:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:32:58 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:33:16 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:33:17 - 08949425 SUCCESS JSON:testCity +20170911 15:33:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:35:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:35:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:35:43 - 08949425 SUCCESS JSON:testCity +20170911 15:35:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:35:51 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:35:52 - 08949425 SUCCESS JSON:testCity +20170911 15:35:53 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:36:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:36:03 - 08949425 SUCCESS JSON:testCity +20170911 15:36:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:36:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:36:46 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:37:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:37:14 - 08949425 SUCCESS JSON:testCity +20170911 15:37:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:37:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:37:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:38:58 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:38:58 - 08949425 SUCCESS JSON:testCity +20170911 15:39:00 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:39:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:39:12 - 08949425 SUCCESS JSON:testCity +20170911 15:39:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:39:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:39:42 - 08949425 SUCCESS JSON:testCity +20170911 15:39:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:40:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:40:42 - 08949425 SUCCESS JSON:testCity +20170911 15:40:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:40:53 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:40:53 - 08949425 SUCCESS JSON:testCity +20170911 15:40:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:41:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:41:45 - 08949425 SUCCESS JSON:testCity +20170911 15:41:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:41:54 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:41:55 - 08949425 SUCCESS JSON:testCity +20170911 15:41:57 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:42:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:42:25 - 08949425 SUCCESS JSON:testCity +20170911 15:42:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:42:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:42:50 - 08949425 SUCCESS JSON:testCity +20170911 15:42:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:43:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:43:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:43:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:43:23 - 08949425 SUCCESS JSON:testCity +20170911 15:43:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:43:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:43:27 - 08949425 SUCCESS JSON:testCity +20170911 15:43:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:43:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:44:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:44:25 - 08949425 SUCCESS JSON:testCity +20170911 15:44:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:44:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:44:32 - 08949425 SUCCESS JSON:getRelayPoints +20170911 15:44:32 - 08949425 SUCCESS JSON:getCities +20170911 15:44:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:45:00 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:45:00 - 08949425 SUCCESS JSON:testCity +20170911 15:45:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:46:51 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:46:51 - 08949425 SUCCESS JSON:testCity +20170911 15:46:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:49:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:49:26 - 08949425 SUCCESS JSON:testCity +20170911 15:49:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:49:33 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:49:33 - 08949425 SUCCESS JSON:getRelayPoints +20170911 15:49:34 - 08949425 SUCCESS JSON:getCities +20170911 15:49:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:49:38 - 08949425 SUCCESS JSON:testCity +20170911 15:49:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:49:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:50:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:50:16 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:50:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:50:19 - 08949425 SUCCESS JSON:testCity +20170911 15:50:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:50:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:51:57 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:52:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:52:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:52:17 - 08949425 SUCCESS JSON:testCity +20170911 15:52:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:52:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:52:25 - 08949425 SUCCESS JSON:testCity +20170911 15:52:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:52:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:52:37 - 08949425 SUCCESS JSON:testCity +20170911 15:52:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:53:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:53:47 - 08949425 SUCCESS JSON:testCity +20170911 15:53:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:54:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:54:18 - 08949425 SUCCESS JSON:testCity +20170911 15:54:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:54:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:54:46 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:56:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:56:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:56:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:56:56 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:56:56 - 08949425 SUCCESS JSON:testCity +20170911 15:56:57 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:57:46 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:57:46 - 08949425 SUCCESS JSON:testCity +20170911 15:57:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:58:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:58:41 - 08949425 SUCCESS JSON:testCity +20170911 15:58:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:59:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 15:59:21 - 08949425 SUCCESS JSON:testCity +20170911 15:59:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:00:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:00:26 - 08949425 SUCCESS JSON:testCity +20170911 16:00:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:00:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:00:31 - 08949425 SUCCESS JSON:getRelayPoints +20170911 16:00:31 - 08949425 SUCCESS JSON:getCities +20170911 16:01:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:01:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:01:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:01:18 - 08949425 SUCCESS JSON:testCity +20170911 16:01:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:02:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:02:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:02:54 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:03:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:05:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:06:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:07:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:07:53 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:08:00 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:08:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:08:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:08:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:08:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:08:56 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:09:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:09:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:09:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:09:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:11:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:11:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:11:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:11:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:12:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:12:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:12:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:13:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:13:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:13:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:14:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:14:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:14:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:14:53 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:15:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:15:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:15:16 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:15:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:15:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:16:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:17:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:17:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:17:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:17:46 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:17:54 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:18:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:18:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:18:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:18:46 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:19:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:19:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:19:51 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:20:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:21:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:21:57 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:22:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:22:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:23:08 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:23:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:23:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:23:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:24:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:24:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:24:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:25:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:25:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:25:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:25:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:25:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:25:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:26:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:26:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:26:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:27:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:28:06 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:28:16 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:28:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:28:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:29:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:29:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:32:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:33:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:35:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:37:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:37:31 - 08949425 SUCCESS JSON:testCity +20170911 16:37:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:37:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:37:38 - 08949425 SUCCESS JSON:testCity +20170911 16:37:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:37:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:37:59 - 08949425 SUCCESS JSON:testCity +20170911 16:38:00 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:38:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:38:13 - 08949425 SUCCESS JSON:getRelayPoints +20170911 16:38:13 - 08949425 SUCCESS JSON:getCities +20170911 16:38:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:38:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:38:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:39:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:39:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:44:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:44:06 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:44:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:44:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:45:16 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:45:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:45:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:46:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:46:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:47:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:47:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:48:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:48:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:48:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:50:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:50:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:50:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:50:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:50:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:50:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:52:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:52:16 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:55:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:55:57 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:56:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:57:33 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:58:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:59:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:59:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:59:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 16:59:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:00:00 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:00:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:00:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:00:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:01:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:01:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:02:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:04:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:04:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:05:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:05:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:05:46 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:06:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:06:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:07:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:07:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:07:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:08:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:08:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:11:08 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:12:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:13:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:14:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:14:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:15:06 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:16:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:20:16 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:21:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:21:08 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:21:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:22:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:22:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:22:32 - 08949425 SUCCESS JSON:testCity +20170911 17:22:33 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:24:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:24:33 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:24:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:25:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:25:33 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:27:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:28:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:28:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:28:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:28:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:29:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:30:08 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:30:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:30:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:30:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:30:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:30:56 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:31:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:32:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:32:06 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:33:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:33:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:33:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:33:51 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:34:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:34:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:36:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:36:58 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:36:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:37:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:37:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:37:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:38:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:38:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:38:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:39:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:39:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:41:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:41:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:41:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:41:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:41:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:41:46 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:41:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:41:54 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:41:54 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:42:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:43:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:43:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:44:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:44:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:44:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:44:53 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:45:00 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:46:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:46:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:46:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:47:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:47:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:47:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:48:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:48:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:51:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:51:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:51:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:52:46 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:54:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:55:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:55:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:55:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:55:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:56:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:57:08 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:57:56 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:58:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 17:59:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:00:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:00:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:00:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:00:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:01:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:01:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:01:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:01:53 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:02:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:02:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:03:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:03:16 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:03:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:03:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:03:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:03:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:05:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:05:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:05:53 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:05:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:05:59 - 08949425 SUCCESS JSON:testCity +20170911 18:06:00 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:06:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:06:33 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:07:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:08:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:08:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:09:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:09:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:09:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:09:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:16:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:16:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:16:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:16:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:21:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:21:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:27:07 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:32:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:32:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:32:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:33:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:42:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:42:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:44:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:44:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:44:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:48:07 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:48:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:48:12 - 08949425 SUCCESS JSON:testCity +20170911 18:48:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:48:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:48:19 - 08949425 SUCCESS JSON:getRelayPoints +20170911 18:48:20 - 08949425 SUCCESS JSON:getCities +20170911 18:49:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:49:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:49:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:49:41 - 08949425 SUCCESS JSON:testCity +20170911 18:49:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:49:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:50:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:50:59 - 08949425 SUCCESS JSON:testCity +20170911 18:51:00 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:51:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:51:05 - 08949425 SUCCESS JSON:getRelayPoints +20170911 18:51:05 - 08949425 SUCCESS JSON:getCities +20170911 18:51:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:54:33 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:54:33 - 08949425 SUCCESS JSON:testCity +20170911 18:54:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:54:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:55:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 18:55:13 - 08949425 SUCCESS JSON:testCity +20170911 18:55:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 20:46:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 20:46:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 20:46:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 20:46:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 20:48:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 20:48:56 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 20:49:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 20:51:06 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:10:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:11:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:11:08 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:11:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:14:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:14:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:14:58 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:16:56 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:17:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:17:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:19:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:19:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:20:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:21:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:21:51 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:23:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:25:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:29:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:33:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:34:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:43:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:43:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:43:56 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:44:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:44:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:44:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:45:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:47:06 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:47:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:47:46 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:54:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:54:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:55:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:55:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:56:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:56:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:56:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:56:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:56:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:56:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:56:56 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:57:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:57:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:57:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:57:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:57:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:57:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:57:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:58:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:58:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:58:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:58:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:58:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:58:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:58:58 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:58:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:59:08 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:59:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:59:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:59:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:59:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 21:59:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:01:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:01:54 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:01:58 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:05:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:05:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:07:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:08:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:08:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:08:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:08:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:09:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:09:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:09:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:09:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:10:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:10:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:11:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:12:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:13:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:17:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:28:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:29:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:29:46 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:30:07 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:30:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:30:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:30:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:30:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:30:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:32:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:45:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:50:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:50:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:56:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:56:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:56:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:56:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:56:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 22:56:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:03:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:03:53 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:04:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:04:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:04:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:04:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:04:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:13:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:14:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:14:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:14:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:14:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:14:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:14:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:18:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:18:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:18:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:22:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:24:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:24:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:24:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:24:57 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:29:08 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:29:09 - 08949425 SUCCESS JSON:testCity +20170911 23:29:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:29:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:29:56 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:29:56 - 08949425 SUCCESS JSON:testCity +20170911 23:29:57 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:30:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:30:13 - 08949425 SUCCESS JSON:getRelayPoints +20170911 23:30:13 - 08949425 SUCCESS JSON:getCities +20170911 23:31:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:31:11 - 08949425 SUCCESS JSON:testCity +20170911 23:31:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:31:16 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:33:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:33:39 - 08949425 SUCCESS JSON:testCity +20170911 23:33:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:33:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:33:43 - 08949425 SUCCESS JSON:getRelayPoints +20170911 23:33:43 - 08949425 SUCCESS JSON:getCities +20170911 23:33:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:33:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:35:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:35:12 - 08949425 SUCCESS JSON:testCity +20170911 23:35:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:35:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:35:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:35:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:35:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:35:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:35:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:36:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:36:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:36:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:36:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:38:46 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:39:00 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:39:01 - 08949425 SUCCESS JSON:testCity +20170911 23:39:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:39:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:40:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:40:16 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:40:54 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:41:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:45:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:45:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:45:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:46:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:46:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:47:16 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:47:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:47:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:48:46 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:48:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:48:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:49:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:49:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:49:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:52:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:53:56 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:54:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:54:57 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:55:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:55:53 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:56:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:56:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:56:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:58:08 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:58:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:59:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:59:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:59:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:59:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:59:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:59:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:59:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:59:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170911 23:59:56 - 08949425 SUCCESS JSON:getCarrierQuote diff --git a/www/modules/tntofficiel/log/TNT-request-20170912.log b/www/modules/tntofficiel/log/TNT-request-20170912.log new file mode 100644 index 00000000..c6cb9298 --- /dev/null +++ b/www/modules/tntofficiel/log/TNT-request-20170912.log @@ -0,0 +1,214 @@ +20170912 00:04:08 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:04:08 - 08949425 SUCCESS JSON:testCity +20170912 00:04:09 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:04:14 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:04:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:04:34 - 08949425 SUCCESS JSON:testCity +20170912 00:04:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:04:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:04:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:05:51 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:05:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:07:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:10:07 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:12:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:12:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:14:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:14:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:15:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:15:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:15:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:15:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:15:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:15:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:15:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:16:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:16:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:16:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:16:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:16:51 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:16:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:17:00 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:17:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:17:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:17:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:17:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:17:51 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:17:54 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:17:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:18:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:18:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:18:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:19:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:19:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:19:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:19:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:19:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:20:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:20:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:20:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:20:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:21:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:21:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:21:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:21:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:21:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:21:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:21:33 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:21:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:21:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:21:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:21:51 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:21:51 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:21:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:22:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:22:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:22:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:22:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:22:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:22:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:23:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:23:07 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:23:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:23:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:23:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:23:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:23:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:23:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:23:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:23:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:23:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:24:01 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:24:58 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:25:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:25:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:26:00 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:26:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:26:08 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:26:13 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:26:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:26:58 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:27:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:27:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:27:08 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:27:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:27:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:27:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:28:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:28:16 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:28:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:31:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:31:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:32:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:32:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:33:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:33:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:33:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:33:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:34:17 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:34:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:34:19 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:34:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:34:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:34:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:34:51 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:35:07 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:35:11 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:35:38 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:35:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:36:00 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:36:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:36:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:36:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:36:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:36:27 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:39:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:42:07 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:42:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 00:42:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:29:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:30:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:30:51 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:31:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:31:08 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:31:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:31:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:32:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:33:39 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:33:58 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:34:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:35:03 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:40:48 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:41:18 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:41:32 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:44:31 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:46:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:47:16 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:53:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:55:04 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:58:58 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 09:59:51 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:00:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:00:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:00:43 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:01:33 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:01:59 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:02:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:07:12 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:07:25 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:07:26 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:07:34 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:07:47 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:07:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:07:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:08:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:08:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:09:52 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:10:40 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:11:56 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:16:49 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:20:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:23:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:23:37 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:24:02 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:25:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:25:10 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:25:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:27:07 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:30:58 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:31:30 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:31:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:31:35 - 08949425 SUCCESS JSON:testCity +20170912 10:31:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:33:54 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:33:55 - 08949425 SUCCESS JSON:testCity +20170912 10:33:56 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:34:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:34:29 - 08949425 SUCCESS JSON:testCity +20170912 10:34:29 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:34:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:34:37 - 08949425 SUCCESS JSON:getRelayPoints +20170912 10:34:37 - 08949425 SUCCESS JSON:getCities +20170912 10:34:41 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:34:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:35:23 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:35:28 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:35:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:39:36 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:39:42 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:39:44 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:43:21 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:43:23 - 08949425 SUCCESS JSON:testCity +20170912 10:43:24 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:43:35 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:44:46 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:44:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:44:55 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:45:22 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:45:45 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:45:50 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:45:54 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:46:15 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:46:20 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:47:05 - 08949425 SUCCESS JSON:getCarrierQuote +20170912 10:47:09 - 08949425 SUCCESS JSON:getCarrierQuote diff --git a/www/modules/tntofficiel/logo.gif b/www/modules/tntofficiel/logo.gif new file mode 100644 index 00000000..faff73d5 Binary files /dev/null and b/www/modules/tntofficiel/logo.gif differ diff --git a/www/modules/tntofficiel/logo.png b/www/modules/tntofficiel/logo.png new file mode 100644 index 00000000..7611ca70 Binary files /dev/null and b/www/modules/tntofficiel/logo.png differ diff --git a/www/modules/tntofficiel/override/classes/index.php b/www/modules/tntofficiel/override/classes/index.php new file mode 100644 index 00000000..f16b36c6 --- /dev/null +++ b/www/modules/tntofficiel/override/classes/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/override/classes/order/Order.php b/www/modules/tntofficiel/override/classes/order/Order.php new file mode 100644 index 00000000..a7d37962 --- /dev/null +++ b/www/modules/tntofficiel/override/classes/order/Order.php @@ -0,0 +1,63 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +class Order extends OrderCore +{ + /** + * Order constructor. + * @param null $id + * @param null $id_lang + */ + public function __construct($id = null, $id_lang = null) + { + // Warning : Dependencies on construct implies to do not create static method using TNTOfficiel class ! + require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; + + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + parent::__construct($id, $id_lang); + } + + public function getShipping() + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + return Db::getInstance()->executeS( + 'SELECT DISTINCT oc.`id_order_invoice`, + oc.`weight`, + oc.`shipping_cost_tax_excl`, + oc.`shipping_cost_tax_incl`, + c.`url`, oc.`id_carrier`, + IF((tnt.`carrier_label` IS NULL OR tnt.`carrier_label` = ""), + c.`name`, + CONCAT(c.`name` ,\' (\', tnt.`carrier_label`,\')\')) as `carrier_name`, + oc.`date_add`, + "Delivery" as `type`, + "true" as `can_edit`, + oc.`tracking_number`, + oc.`id_order_carrier`, + osl.`name` as order_state_name, + c.`name` as state_name + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'order_history` oh + ON (o.`id_order` = oh.`id_order`) + LEFT JOIN `'._DB_PREFIX_.'order_carrier` oc + ON (o.`id_order` = oc.`id_order`) + LEFT JOIN `'._DB_PREFIX_.'carrier` c + ON (oc.`id_carrier` = c.`id_carrier`) + LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl + ON (oh.`id_order_state` = osl.`id_order_state` + AND osl.`id_lang` = '.((int) Context::getContext()->language->id).') + LEFT JOIN `'._DB_PREFIX_.'tntofficiel_order` tnt + ON (o.`id_order` = tnt.`id_order`) + WHERE o.`id_order` = '.(int) $this->id.' + GROUP BY c.id_carrier' + ); + } +} diff --git a/www/modules/tntofficiel/override/classes/order/OrderHistory.php b/www/modules/tntofficiel/override/classes/order/OrderHistory.php new file mode 100644 index 00000000..67445eb9 --- /dev/null +++ b/www/modules/tntofficiel/override/classes/order/OrderHistory.php @@ -0,0 +1,360 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +class OrderHistory extends OrderHistoryCore +{ + /** + * OrderHistory constructor. + * + * @param null $id + * @param null $id_lang + * @param null $id_shop + */ + public function __construct($id = null, $id_lang = null, $id_shop = null) + { + // Warning : Dependencies on construct implies to do not create static method using TNTOfficiel class ! + require_once _PS_MODULE_DIR_.'tntofficiel/libraries/TNTOfficiel_Debug.php'; + + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + parent::__construct($id, $id_lang, $id_shop); + } + + /** + * Sets the new state of the given order. + * + * @param int $new_order_state + * @param int/object $id_order + * @param bool $use_existing_payment + */ + public function changeIdOrderState($new_order_state, $id_order, $use_existing_payment = false) + { + TNTOfficiel_Debug::log(array('msg' => '>>', 'file' => __FILE__, 'line' => __LINE__)); + + if (!$new_order_state || !$id_order) { + return; + } + + if (!is_object($id_order) && is_numeric($id_order)) { + $order = new Order((int)$id_order); + } elseif (is_object($id_order)) { + $order = new Order($id_order->id); + } else { + return; + } + + ShopUrl::cacheMainDomainForShop($order->id_shop); + + $new_os = new OrderState((int)$new_order_state, $order->id_lang); + $old_os = $order->getCurrentOrderState(); + + if (in_array($new_os->id, array(Configuration::get('PS_OS_PAYMENT'), Configuration::get('PS_OS_WS_PAYMENT')))) { + Hook::exec( + 'actionPaymentConfirmation', + array('id_order' => (int)$order->id), + null, + false, + true, + false, + $order->id_shop + ); + } + + Hook::exec( + 'actionOrderStatusUpdate', + array('newOrderStatus' => $new_os, 'id_order' => (int)$order->id), + null, + false, + true, + false, + $order->id_shop + ); + + if (Validate::isLoadedObject($order) && ($new_os instanceof OrderState)) { + $virtual_products = $order->getVirtualProducts(); + if ($virtual_products && (!$old_os || !$old_os->logable) && $new_os && $new_os->logable) { + Context::getContext(); + $assign = array(); + foreach ($virtual_products as $key => $virtual_product) { + $id_product_download = ProductDownload::getIdFromIdProduct($virtual_product['product_id']); + $product_download = new ProductDownload($id_product_download); + if ($product_download->display_filename != '') { + $assign[$key]['name'] = $product_download->display_filename; + $dl_link = $product_download->getTextLink(false, $virtual_product['download_hash']) + .'&id_order='.(int)$order->id.'&secure_key='.$order->secure_key; + $assign[$key]['link'] = $dl_link; + if (isset($virtual_product['download_deadline']) + && $virtual_product['download_deadline'] != '0000-00-00 00:00:00' + ) { + $assign[$key]['deadline'] = Tools::displayDate($virtual_product['download_deadline']); + } + if ($product_download->nb_downloadable != 0) { + $assign[$key]['downloadable'] = (int)$product_download->nb_downloadable; + } + } + } + + $customer = new Customer((int)$order->id_customer); + + $links = ''; + $data = array( + '{lastname}' => $customer->lastname, + '{firstname}' => $customer->firstname, + '{id_order}' => (int)$order->id, + '{order_name}' => $order->getUniqReference(), + '{nbProducts}' => count($virtual_products), + '{virtualProducts}' => $links, + ); + if (!empty($assign)) { + Mail::Send( + (int)$order->id_lang, + 'download_product', + Mail::l('The virtual product that you bought is available for download', $order->id_lang), + $data, + $customer->email, + $customer->firstname.' '.$customer->lastname, + null, + null, + null, + null, + _PS_MAIL_DIR_, + false, + (int)$order->id_shop + ); + } + } + + $manager = null; + if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { + $manager = StockManagerFactory::getManager(); + } + + $errorOrCanceledStatuses = array(Configuration::get('PS_OS_ERROR'), Configuration::get('PS_OS_CANCELED')); + + if (Validate::isLoadedObject($old_os)) { + foreach ($order->getProductsDetail() as $product) { + if ($new_os->logable && !$old_os->logable) { + ProductSale::addProductSale($product['product_id'], $product['product_quantity']); + if (!Pack::isPack($product['product_id']) && + in_array($old_os->id, $errorOrCanceledStatuses) && + !StockAvailable::dependsOnStock($product['id_product'], (int)$order->id_shop) + ) { + StockAvailable::updateQuantity( + $product['product_id'], + $product['product_attribute_id'], + -(int)$product['product_quantity'], + $order->id_shop + ); + } + } elseif (!$new_os->logable && $old_os->logable) { + ProductSale::removeProductSale($product['product_id'], $product['product_quantity']); + + if (!Pack::isPack($product['product_id']) && + in_array($new_os->id, $errorOrCanceledStatuses) && + !StockAvailable::dependsOnStock($product['id_product']) + ) { + StockAvailable::updateQuantity( + $product['product_id'], + $product['product_attribute_id'], + (int)$product['product_quantity'], + $order->id_shop + ); + } + } elseif (!$new_os->logable && !$old_os->logable && + in_array($new_os->id, $errorOrCanceledStatuses) && + !in_array($old_os->id, $errorOrCanceledStatuses) && + !StockAvailable::dependsOnStock($product['id_product']) + ) { + StockAvailable::updateQuantity( + $product['product_id'], + $product['product_attribute_id'], + (int)$product['product_quantity'], + $order->id_shop + ); + } + + if ((int)$this->id_employee) { + $employee = new Employee((int)$this->id_employee); + $this->id_employee = Validate::isLoadedObject($employee) ? $this->id_employee : 0; + } + + if ($new_os->shipped == 1 && $old_os->shipped == 0 && + Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && + Warehouse::exists($product['id_warehouse']) && + $manager != null && + (int)$product['advanced_stock_management'] == 1) { + $warehouse = new Warehouse($product['id_warehouse']); + + $manager->removeProduct( + $product['product_id'], + $product['product_attribute_id'], + $warehouse, + $product['product_quantity'], + Configuration::get('PS_STOCK_CUSTOMER_ORDER_REASON'), + true, + (int)$order->id, + 0, + (int)$this->id_employee + ); + } elseif ($new_os->shipped == 0 && $old_os->shipped == 1 && + Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && + Warehouse::exists($product['id_warehouse']) && + $manager != null && + (int)$product['advanced_stock_management'] == 1 + ) { + if (Pack::isPack($product['product_id'])) { + $pack_products = Pack::getItems( + $product['product_id'], + Configuration::get('PS_LANG_DEFAULT', null, null, $order->id_shop) + ); + foreach ($pack_products as $pack_product) { + if ($pack_product->advanced_stock_management == 1) { + $mvts = StockMvt::getNegativeStockMvts( + $order->id, + $pack_product->id, + 0, + $pack_product->pack_quantity * $product['product_quantity'] + ); + foreach ($mvts as $mvt) { + $manager->addProduct( + $pack_product->id, + 0, + new Warehouse($mvt['id_warehouse']), + $mvt['physical_quantity'], + null, + $mvt['price_te'], + true, + (int)$this->id_employee + ); + } + if (!StockAvailable::dependsOnStock($product['id_product'])) { + StockAvailable::updateQuantity( + $pack_product->id, + 0, + (int)$pack_product->pack_quantity * $product['product_quantity'], + $order->id_shop + ); + } + } + } + } else { + $mvts = StockMvt::getNegativeStockMvts( + $order->id, + $product['product_id'], + $product['product_attribute_id'], + $product['product_quantity'] + ); + foreach ($mvts as $mvt) { + $manager->addProduct( + $product['product_id'], + $product['product_attribute_id'], + new Warehouse($mvt['id_warehouse']), + $mvt['physical_quantity'], + null, + $mvt['price_te'], + true + ); + } + } + } + } + } + } + + $this->id_order_state = (int)$new_order_state; + + if (!Validate::isLoadedObject($new_os) || !Validate::isLoadedObject($order)) { + die(Tools::displayError('Invalid new order status')); + } + + $order->current_state = $this->id_order_state; + $order->valid = $new_os->logable; + $order->update(); + + if ($new_os->invoice && !$order->invoice_number) { + $order->setInvoice($use_existing_payment); + } elseif ($new_os->delivery && !$order->delivery_number) { + // TODO : Method setDeliverySlip() not available in PS1.6.0.5. + $order->setDeliverySlip(); + } + + if ($new_os->paid == 1) { + $invoices = $order->getInvoicesCollection(); + if ($order->total_paid != 0) { + $payment_method = Module::getInstanceByName($order->module); + } + + foreach ($invoices as $invoice) { + $rest_paid = $invoice->getRestPaid(); + if ($rest_paid > 0) { + $payment = new OrderPayment(); + $payment->order_reference = Tools::substr($order->reference, 0, 9); + $payment->id_currency = $order->id_currency; + $payment->amount = $rest_paid; + + if ($order->total_paid != 0) { + $payment->payment_method = $payment_method->displayName; + } else { + $payment->payment_method = null; + } + + if ($payment->id_currency == $order->id_currency) { + $order->total_paid_real += $payment->amount; + } else { + $order->total_paid_real += Tools::ps_round( + Tools::convertPrice($payment->amount, $payment->id_currency, false), + 2 + ); + } + $order->save(); + + $payment->conversion_rate = 1; + $payment->save(); + Db::getInstance()->execute( + 'INSERT INTO `'._DB_PREFIX_.'order_invoice_payment`' + .' (`id_order_invoice`, `id_order_payment`, `id_order`) + VALUES('.(int)$invoice->id.', '.(int)$payment->id.', '.(int)$order->id.')' + ); + } + } + } + + if ($new_os->delivery) { + $order->setDelivery(); + } + + Hook::exec( + 'actionOrderStatusPostUpdate', + array('newOrderStatus' => $new_os, 'id_order' => (int)$order->id), + null, + false, + true, + false, + $order->id_shop + ); + + ShopUrl::resetMainDomainCache(); + } +} diff --git a/www/modules/tntofficiel/override/classes/order/index.php b/www/modules/tntofficiel/override/classes/order/index.php new file mode 100644 index 00000000..f16b36c6 --- /dev/null +++ b/www/modules/tntofficiel/override/classes/order/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/override/controllers/admin/AdminOrdersController.php b/www/modules/tntofficiel/override/controllers/admin/AdminOrdersController.php new file mode 100644 index 00000000..c4f56250 --- /dev/null +++ b/www/modules/tntofficiel/override/controllers/admin/AdminOrdersController.php @@ -0,0 +1,498 @@ + + * @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/override/controllers/admin/index.php b/www/modules/tntofficiel/override/controllers/admin/index.php new file mode 100644 index 00000000..f16b36c6 --- /dev/null +++ b/www/modules/tntofficiel/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/override/controllers/index.php b/www/modules/tntofficiel/override/controllers/index.php new file mode 100644 index 00000000..f16b36c6 --- /dev/null +++ b/www/modules/tntofficiel/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/override/index.php b/www/modules/tntofficiel/override/index.php new file mode 100644 index 00000000..f16b36c6 --- /dev/null +++ b/www/modules/tntofficiel/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/translations/fr.php b/www/modules/tntofficiel/translations/fr.php new file mode 100644 index 00000000..90002ab8 --- /dev/null +++ b/www/modules/tntofficiel/translations/fr.php @@ -0,0 +1,381 @@ +tntofficiel_53ac215797e00f595f14c7ad53e7aa1a'] = 'TNT Express France'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_9b7637001f5d2bcb42efb4ab6b3e93da'] = 'La livraison express 24h partout en France avant 13h'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_3ed8d415ab1bbac628429a85851e53b6'] = 'TNT'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_eaccd6522158b8d67b706ffc5e3a93f9'] = 'Données d\'authentification incorrectes'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_e81d9f25acf7fa457ab32527a882ed50'] = 'TNT Express'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_1ac2ea936f12116ef4e1bcb8c75fb417'] = 'Exporter les logs'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_c9cc8cce247e49bae79f15173ce97354'] = 'Sauvegarder'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_630f6dc397fe74e52d5189e2c80f282b'] = 'Retour à la liste'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_14c4b06b824ec593239362517f538b29'] = 'Utilisateur'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_e268443e43d93dab7ebef303bbe9642f'] = 'Compte'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_5f4dcc3b5aa765d61d8327deb882cf99'] = 'Mot de passe'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_a43b0d7b1bdddcd9650598df155c4ef6'] = 'Afficher le numéro de ramassage'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_f9ae539a015bd1b6c974c17ed1bd3a0f'] = 'Google Maps API'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_34df815e78180dfe3de4498717befae3'] = 'Le nom d\'utilisateur est obligatoire'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_4b944d27d010a334b7a7ac925d58fc2a'] = 'Le numéro de compte est obligatoire'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_b34731c53c709e721b0f11e567759f38'] = 'Le mot de passe est obligatoire'; +$_MODULE['<{tntofficiel}prestashop>tntofficiel_b5c2f36d66da368ec60fae8ea9ff7b76'] = 'Une erreur est survenue lors de la création de la livraison'; +$_MODULE['<{tntofficiel}prestashop>_print_bt_icon_277b18808bb6fba9845a813795fe8baa'] = 'BT'; +$_MODULE['<{tntofficiel}prestashop>_print_bt_icon_76c3e002d3c052bd6a909366a8dc3845'] = 'Manifeste'; +$_MODULE['<{tntofficiel}prestashop>displayajaxtracking_cc97a74bb428ffc130b1b39eabc141f5'] = 'Détail de la livraison'; +$_MODULE['<{tntofficiel}prestashop>displayajaxtracking_d3d2e617335f08df83599665eef8a418'] = 'Fermer'; +$_MODULE['<{tntofficiel}prestashop>displayajaxtracking_b6026301f6eccf9afcf19458173e63e8'] = 'Numéro de suivi'; +$_MODULE['<{tntofficiel}prestashop>displayajaxtracking_50b613e90b9579184a11f56ab19ea5be'] = 'Suivre mon colis'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_5c0a951f54c0c7bf4c66dd2e6d0fe2de'] = 'Date de ramassage'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_2e79cbc13bbc903d989eab943a2e394f'] = 'Date de livraison'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_0bfc9d7a908999118a95316e5b2cd3ca'] = 'La date n\'est pas valide'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_3e6548fbd02839544c5a6ce445116b03'] = 'La date est valide'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_96f26ad4b9f1ed9c512d5944dc40d558'] = 'Colis'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_83a71abc738492fd7d9d536c5c2a7231'] = 'Numéro de ramassage : '; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_392235852a55ba6cba1db9df1b4695f0'] = 'Poids total : '; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_2ce124d87604bed00f310d4585d26ea7'] = 'Kg'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_faca76e418e6a6bf8ca1815c9586bf7c'] = 'Numéro de colis'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_7edabf994b76a00cbc60c95af337db8f'] = 'Poids'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_418c5509e2171d55b0aee5c2ea4442b5'] = 'Action'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_4e0799443cae591e21badb40f9a20754'] = 'PDL'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_151648106e4bf98297882ea2ea1c4b0e'] = 'Mise à jour réussie'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_06933067aafd48425d67bcb01bba5cb6'] = 'Mise à jour'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_1e8e42b87a65326b98ced7d3af717a72'] = 'Voir'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_34ec78fcc91ffb1e54cd85e4a0924332'] = 'Ajouter'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_ae30ab8690d876020e4f8dec7332f3a7'] = 'Ajouter un colis'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_09d2c2cea0ca2c48cc357e7fa996db87'] = 'Poids du colis'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_43781db5c40ecc39fd718685594f0956'] = 'Sauver'; +$_MODULE['<{tntofficiel}prestashop>displayadminorder_d41f0f868a0dbe1e9f25fe8c125f7fdd'] = 'Une commande doit contenir au moins un colis'; +$_MODULE['<{tntofficiel}prestashop>displaycarrierlist_c945f0cc434c21e830eb9bd8d45b2845'] = 'La commande ne peut pas être achetée'; +$_MODULE['<{tntofficiel}prestashop>displaycarrierlist_0c0a7d8a27886268bf0f5ec9727288df'] = 'La ville saisie est inconnue pour le code postal %s'; +$_MODULE['<{tntofficiel}prestashop>displaycarrierlist_eacc8a7970c5a823d0f383f15591c8b0'] = 'Informations complémentaires transporteur'; +$_MODULE['<{tntofficiel}prestashop>displaycarrierlist_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Email'; +$_MODULE['<{tntofficiel}prestashop>displaycarrierlist_4e186c431f7c016c761c722debb9768e'] = 'Téléphone portable'; +$_MODULE['<{tntofficiel}prestashop>displaycarrierlist_070c051179746c6932db988f0a52b282'] = 'Numéro du bâtiment (3 caractères maximum)'; +$_MODULE['<{tntofficiel}prestashop>displaycarrierlist_dc4a632c5933c9c81274bedc8dd797f7'] = 'Code d\'accès au bâtiment (7 caractères maximum)'; +$_MODULE['<{tntofficiel}prestashop>displaycarrierlist_f3f6d0343d56ce88ce7958170ed05cb3'] = 'Etage (2 caractères maximum)'; +$_MODULE['<{tntofficiel}prestashop>displaycarrierlist_70397c4b252a5168c5ec003931cea215'] = 'Champs obligatoires'; +$_MODULE['<{tntofficiel}prestashop>displaycarrierlist_6971dd4c515c58b6122410c8bd1ed6fe'] = 'Le champ \'Téléphone portable\' doit être composé de 10 chiffres sans espace ni point, et commencer par un 06 ou 07'; +$_MODULE['<{tntofficiel}prestashop>displaycarrierlist_8144eaaa3a1db5748161ec93fa3b5f1c'] = 'Une erreur s\'est produite'; +$_MODULE['<{tntofficiel}prestashop>displayorderdetail_a7dd12b1dab17d25467b0b0a4c8d4a92'] = 'Voir'; +$_MODULE['<{tntofficiel}prestashop>displayorderdetail_ef7eea8df7e16831217a3b25c58bf508'] = 'Suivre mes colis'; +$_MODULE['<{tntofficiel}prestashop>deliverypointsbox_60c1249f2568c852f5fa352e609d1741'] = 'Choisissez votre Relais Colis®'; +$_MODULE['<{tntofficiel}prestashop>deliverypointsbox_775721e7246431e9e3fa4c9ea932db0d'] = 'Choisissez votre Dépôt restant'; +$_MODULE['<{tntofficiel}prestashop>deliverypointset_ccdb7bf9d93e5652b57cabcc8c41e061'] = 'Horaires'; +$_MODULE['<{tntofficiel}prestashop>deliverypointset_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lundi'; +$_MODULE['<{tntofficiel}prestashop>deliverypointset_5792315f09a5d54fb7e3d066672b507f'] = 'Mardi'; +$_MODULE['<{tntofficiel}prestashop>deliverypointset_796c163589f295373e171842f37265d5'] = 'Mercredi'; +$_MODULE['<{tntofficiel}prestashop>deliverypointset_78ae6f0cd191d25147e252dc54768238'] = 'Jeudi'; +$_MODULE['<{tntofficiel}prestashop>deliverypointset_c33b138a163847cdb6caeeb7c9a126b4'] = 'Vendredi'; +$_MODULE['<{tntofficiel}prestashop>deliverypointset_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Samedi'; +$_MODULE['<{tntofficiel}prestashop>deliverypointset_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Dimanche'; +$_MODULE['<{tntofficiel}prestashop>deliverypointset_be5d5d37542d75f93a87094459f76678'] = 'et'; +$_MODULE['<{tntofficiel}prestashop>deliverypointset_03f4a47830f97377a35321051685071e'] = 'Fermé'; +$_MODULE['<{tntofficiel}prestashop>deliverypointset_f4ec5f57bd4d31b803312d873be40da9'] = 'Modifier'; +$_MODULE['<{tntofficiel}prestashop>form_48974cc3df177e6b565c39aa155458cd'] = 'Adresse de livraison'; +$_MODULE['<{tntofficiel}prestashop>form_8bcdc441379cbf584638b0589a3f9adb'] = 'Code postal'; +$_MODULE['<{tntofficiel}prestashop>form_57d056ed0984166336b7879c2af3657f'] = 'Ville'; +$_MODULE['<{tntofficiel}prestashop>form_36936b078805af8a6e283161721f99e1'] = '-- Sélectionner une ville --'; +$_MODULE['<{tntofficiel}prestashop>form_647552b29642ed538b23b5bc3d28864f'] = 'Aucune ville disponible'; +$_MODULE['<{tntofficiel}prestashop>form_f4ec5f57bd4d31b803312d873be40da9'] = 'Modifier'; +$_MODULE['<{tntofficiel}prestashop>list_ccdb7bf9d93e5652b57cabcc8c41e061'] = 'Horaires'; +$_MODULE['<{tntofficiel}prestashop>list_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lundi'; +$_MODULE['<{tntofficiel}prestashop>list_5792315f09a5d54fb7e3d066672b507f'] = 'Mardi'; +$_MODULE['<{tntofficiel}prestashop>list_796c163589f295373e171842f37265d5'] = 'Mercredi'; +$_MODULE['<{tntofficiel}prestashop>list_78ae6f0cd191d25147e252dc54768238'] = 'Jeudi'; +$_MODULE['<{tntofficiel}prestashop>list_c33b138a163847cdb6caeeb7c9a126b4'] = 'Vendredi'; +$_MODULE['<{tntofficiel}prestashop>list_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Samedi'; +$_MODULE['<{tntofficiel}prestashop>list_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Dimanche'; +$_MODULE['<{tntofficiel}prestashop>list_be5d5d37542d75f93a87094459f76678'] = 'et'; +$_MODULE['<{tntofficiel}prestashop>list_03f4a47830f97377a35321051685071e'] = 'Fermé'; +$_MODULE['<{tntofficiel}prestashop>list_961f2247a2070bedff9f9cd8d64e2650'] = 'Choisir'; +$_MODULE['<{tntofficiel}prestashop>list_5a07832bfc91847bdde742703f7a7d71'] = 'Aucune ville correspondante pour le code postal demandé.'; +$_MODULE['<{tntofficiel}prestashop>list_671f3468c84b318bbcd174a4a546765e'] = 'Vérifier le code postal et cliquez sur'; +$_MODULE['<{tntofficiel}prestashop>list_f4ec5f57bd4d31b803312d873be40da9'] = 'Modifier'; +$_MODULE['<{tntofficiel}prestashop>list_fdfeefba19d7a7f570a372d1cf8b20fb'] = 'Sélectionnez une ville dans la liste et cliquez sur'; +$_MODULE['<{tntofficiel}prestashop>list_e0db4c0842a1cc908c6c97e621bd8481'] = 'Aucun point de livraison n\'est disponible pour cette ville.'; +$_MODULE['<{tntofficiel}prestashop>view_010cd82f1f972dc6b720536adb555533'] = 'Commandes liées'; +$_MODULE['<{tntofficiel}prestashop>view_01abfc750a0c942167651c40d088531d'] = 'n°'; +$_MODULE['<{tntofficiel}prestashop>view_0262a3dc4fae9adc8cb46e788806ccbf'] = 'Créer une commande'; +$_MODULE['<{tntofficiel}prestashop>view_034d2690db87b737dd810afccbe41b7a'] = 'Créer une commande'; +$_MODULE['<{tntofficiel}prestashop>view_03ab340b3f99e03cff9e84314ead38c0'] = 'Quantité'; +$_MODULE['<{tntofficiel}prestashop>view_03c2e7e41ffc181a4e84080b4710e81e'] = 'Nouveau'; +$_MODULE['<{tntofficiel}prestashop>view_065ab3a28ca4f16f55f103adc7d0226f'] = 'Livraison'; +$_MODULE['<{tntofficiel}prestashop>view_068f80c7519d0528fb08e82137a72131'] = 'Produits'; +$_MODULE['<{tntofficiel}prestashop>view_06933067aafd48425d67bcb01bba5cb6'] = 'Mettre à jour'; +$_MODULE['<{tntofficiel}prestashop>view_0945359809dad1fbf3dea1c95a0da951'] = 'Document'; +$_MODULE['<{tntofficiel}prestashop>view_0aed4e816d2ab18361bbfe990b4fdcde'] = 'Utiliser ce panier'; +$_MODULE['<{tntofficiel}prestashop>view_0c458988127eb2150776881e2ef3f0c4'] = 'Adresse de livraison'; +$_MODULE['<{tntofficiel}prestashop>view_0d4d1c76cbf823ecde73e6a2e17672bd'] = 'Commande n°%1$d (%2$s) - %3$s %4$s'; +$_MODULE['<{tntofficiel}prestashop>view_0d9175fe89fb80d815e7d03698b6e83a'] = 'Cadeau'; +$_MODULE['<{tntofficiel}prestashop>view_0da6a00e3eb2132d5cf97463a099c49f'] = 'Commander n°'; +$_MODULE['<{tntofficiel}prestashop>view_0eaadb4fcb48a0a0ed7bc9868be9fbaa'] = 'Attention'; +$_MODULE['<{tntofficiel}prestashop>view_0ec8109e3ffa61bcc147c89d9a396cd7'] = '%s HT'; +$_MODULE['<{tntofficiel}prestashop>view_0fe067d5d05655a4c80602c1d6e7d0c5'] = 'Message de l\'emballage cadeau'; +$_MODULE['<{tntofficiel}prestashop>view_1067f7778added234b6064bc8aa0765d'] = 'Remettre les produits en stock'; +$_MODULE['<{tntofficiel}prestashop>view_107ca6f108ab1c0c66015df0f61845a9'] = 'Emballage recyclé'; +$_MODULE['<{tntofficiel}prestashop>view_10ea517069300c23c17f113a3d084c57'] = 'Changer l\'état de la commande'; +$_MODULE['<{tntofficiel}prestashop>view_11599f38f7ac080ae579f1bf32f08561'] = 'Ajouter un bon d\'achat'; +$_MODULE['<{tntofficiel}prestashop>view_14c7a12fdbf437a0545aed3365ce3f84'] = 'Aucune marchandise n\'a été retournée pour le moment'; +$_MODULE['<{tntofficiel}prestashop>view_153c7809e6b00b6cbfa01b8aa9db43e3'] = 'payé au lieu de'; +$_MODULE['<{tntofficiel}prestashop>view_197101c4a1b1fc503dcd6ebee127aa10'] = 'Prix unitaire'; +$_MODULE['<{tntofficiel}prestashop>view_19dfe063714422004b75043eaf74c9b8'] = 'Mode de livraison'; +$_MODULE['<{tntofficiel}prestashop>view_1a747e98fba823d6be62189cbac46dcb'] = 'Emballage recyclé'; +$_MODULE['<{tntofficiel}prestashop>view_1c481aa99d081c32182011a758f73d33'] = '%s'; +$_MODULE['<{tntofficiel}prestashop>view_1c76cbfe21c6f44c1d1e59d54f3e4420'] = 'Société'; +$_MODULE['<{tntofficiel}prestashop>view_1cbe7897dd334369ef17e185ee455c46'] = 'Erreur : Choisir une date de ramassage'; +$_MODULE['<{tntofficiel}prestashop>view_1dd1c5fb7f25cd41b291d43a89e3aefd'] = 'Aujourd\'hui'; +$_MODULE['<{tntofficiel}prestashop>view_1e1cc9bdeb2f29f5480106aec7e9bc48'] = 'Maintenant'; +$_MODULE['<{tntofficiel}prestashop>view_1e504df905c966d01e09188c5ebd451f'] = 'Cacher les paniers et commandes pour ce client.'; +$_MODULE['<{tntofficiel}prestashop>view_1f065062cdb50b501c5cb5160cf21ab0'] = 'Marge nette par visiteur'; +$_MODULE['<{tntofficiel}prestashop>view_200e62e510bab9b03c912e10a5363a7a'] = 'Créer une nouvelle facture'; +$_MODULE['<{tntofficiel}prestashop>view_257630448a4acd9cfc1ce6c7a5ce05f3'] = 'Ajouter un nouveau client'; +$_MODULE['<{tntofficiel}prestashop>view_267806034cfac4481cabe7b81c81f91d'] = 'Commande depuis le back-office'; +$_MODULE['<{tntofficiel}prestashop>view_284b47b0bb63ae2df3b29f0e691d6fcf'] = 'Adresses'; +$_MODULE['<{tntofficiel}prestashop>view_28a996f23ec7c4f6cf75da6bf30670bd'] = 'Rechercher un client en tapant les premières lettres de son nom.'; +$_MODULE['<{tntofficiel}prestashop>view_290612199861c31d1036b185b4e69b75'] = 'Récapitulatif'; +$_MODULE['<{tntofficiel}prestashop>view_2992ddfe54874870b55a608156745a84'] = 'Bon de Transport de TNT'; +$_MODULE['<{tntofficiel}prestashop>view_29aa46cc3d2677c7e0f216910df600ff'] = 'Frais de port offerts'; +$_MODULE['<{tntofficiel}prestashop>view_29c14e1df15d10b73ec9605fd146b9fe'] = 'Aucun transporteur ne peut être appliqué à cette commande'; +$_MODULE['<{tntofficiel}prestashop>view_2ab74fb771ac34b95b1657895282d5d9'] = 'Choisissez un message prédéfini'; +$_MODULE['<{tntofficiel}prestashop>view_2d0f6b8300be19cf35e89e66f0677f95'] = 'Ajouter au panier'; +$_MODULE['<{tntofficiel}prestashop>view_2ef876508663171dedb532b4ecdb19a1'] = 'Marque de la carte'; +$_MODULE['<{tntofficiel}prestashop>view_3247bceed27afd513688fe6de93224a1'] = 'N° de Ramassage'; +$_MODULE['<{tntofficiel}prestashop>view_341216368d7ecd01ce32b8b9892293cf'] = 'toutes taxes comprises.'; +$_MODULE['<{tntofficiel}prestashop>view_341ee6bf57abde84135c32f55a607de2'] = 'Souhaitez-vous envoyer ce message au client ?'; +$_MODULE['<{tntofficiel}prestashop>view_34623cd7893be21da4239d08f79aec9a'] = 'Prix du produit, diminué du montant du bon de réduction initial'; +$_MODULE['<{tntofficiel}prestashop>view_3601146c4e948c32b6424d2c0a7f0118'] = 'Prix'; +$_MODULE['<{tntofficiel}prestashop>view_386c339d37e737a436499d423a77df0c'] = 'Devise'; +$_MODULE['<{tntofficiel}prestashop>view_3964fd83339fec5014c831822005653a'] = 'Choisir l\'heure'; +$_MODULE['<{tntofficiel}prestashop>view_3a2d5fe857d8f9541136a124c2edec6c'] = 'Ou'; +$_MODULE['<{tntofficiel}prestashop>view_3aed2ba8458a0f4099f520c58e9f2f5d'] = 'Si vous ne sélectionnez pas \"Transporteur offert\", le coût normal du transporteur sera appliqué'; +$_MODULE['<{tntofficiel}prestashop>view_3b0649c72650c313a357338dcdfb64ec'] = 'Commentaire'; +$_MODULE['<{tntofficiel}prestashop>view_3d0d1f906e27800531e054a3b6787b7c'] = 'Quantité'; +$_MODULE['<{tntofficiel}prestashop>view_3d4d2d9627d3f1b1c0d22b9e85c687d1'] = 'Le panier doit avoir un client'; +$_MODULE['<{tntofficiel}prestashop>view_3ec365dd533ddb7ef3d1c111186ce872'] = 'Détails'; +$_MODULE['<{tntofficiel}prestashop>view_3ed8d415ab1bbac628429a85851e53b6'] = 'TNT'; +$_MODULE['<{tntofficiel}prestashop>view_400264c3cd8f2e65b9f19375230b59b8'] = 'Générer un bon de réduction'; +$_MODULE['<{tntofficiel}prestashop>view_4174f012bc63b679f092acd1a933bf5c'] = 'L\'e-mail a été envoyé au client.'; +$_MODULE['<{tntofficiel}prestashop>view_41953cbf836297b3c96b137a2b789ccb'] = 'Appliquer à toutes les factures'; +$_MODULE['<{tntofficiel}prestashop>view_41de6d6cfb8953c021bbe4ba0701c8a1'] = 'Messages'; +$_MODULE['<{tntofficiel}prestashop>view_4320b10eab24c2b8ee337355e7deb4c6'] = 'Ajouter une réduction'; +$_MODULE['<{tntofficiel}prestashop>view_43c2b5547b84d3fe632a8297c27ed20e'] = 'Vous devez ajouter au moins une adresse pour passer la commande.'; +$_MODULE['<{tntofficiel}prestashop>view_44749712dbec183e983dcd78a7736c41'] = 'Date'; +$_MODULE['<{tntofficiel}prestashop>view_448e9885f58aad30823ddde9996114d6'] = 'Choisir un état de commande'; +$_MODULE['<{tntofficiel}prestashop>view_449fae749af1f675c63510eecb0b88c4'] = 'Afficher ce panier'; +$_MODULE['<{tntofficiel}prestashop>view_44f36e0e113ab5d842c47691364f6eb4'] = 'Impossible de retourner ce produit'; +$_MODULE['<{tntofficiel}prestashop>view_4523758f4415c5b7afe9c6bd6b4917b3'] = 'Texte n°%s'; +$_MODULE['<{tntofficiel}prestashop>view_453c92894f48764318534163c2bb2830'] = 'Les prix sont Hors Taxe'; +$_MODULE['<{tntofficiel}prestashop>view_465d60b936c982d7b57674f30ba022d0'] = 'Produit'; +$_MODULE['<{tntofficiel}prestashop>view_466eadd40b3c10580e3ab4e8061161ce'] = 'Facture'; +$_MODULE['<{tntofficiel}prestashop>view_47ac923d219501859fb68fed8c8db77b'] = 'Déclinaison'; +$_MODULE['<{tntofficiel}prestashop>view_47f9082fc380ca62d531096aa1d110f1'] = 'Privé'; +$_MODULE['<{tntofficiel}prestashop>view_4800d00deaa0a28a18151d76feb858cb'] = 'Nouveau détail de facture'; +$_MODULE['<{tntofficiel}prestashop>view_484f5a79672cebe198ebdde45a1d672f'] = 'Paquet cadeau'; +$_MODULE['<{tntofficiel}prestashop>view_4994a8ffeba4ac3140beb89e8d41f174'] = 'Langue'; +$_MODULE['<{tntofficiel}prestashop>view_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{tntofficiel}prestashop>view_4ad439b4f7069964e258259e049fa90c'] = 'Remboursement standard'; +$_MODULE['<{tntofficiel}prestashop>view_4b6c6cda10a23d1bdc920f2e47e5f46f'] = 'Ajouter un produit'; +$_MODULE['<{tntofficiel}prestashop>view_4b8def9be8f45a8d6baea36b26868965'] = 'Annuler les produits'; +$_MODULE['<{tntofficiel}prestashop>view_4c15f9bb0c76e90180c701b2d39994d8'] = 'Frais de port (TTC)'; +$_MODULE['<{tntofficiel}prestashop>view_4c2a8fe7eaf24721cc7a9f0175115bd4'] = 'Message'; +$_MODULE['<{tntofficiel}prestashop>view_4ce1f4aa76f0f9eaadaff8de2fe0860a'] = 'Impossible de récupérer une date de ramassage'; +$_MODULE['<{tntofficiel}prestashop>view_4d734cc32a5cac86597621969696baa8'] = 'Cette valeur doit être taxes incluses.'; +$_MODULE['<{tntofficiel}prestashop>view_5068c162a60b5859f973f701333f45c5'] = 'Numéro de suivi'; +$_MODULE['<{tntofficiel}prestashop>view_50cd1871f950375eef4e2efce35366c6'] = 'Ajouter une note'; +$_MODULE['<{tntofficiel}prestashop>view_52aeead61e400c8faeb3c1dcb355e7a5'] = 'Date d\'expiration de la carte'; +$_MODULE['<{tntofficiel}prestashop>view_54e85d70ea67acdcc86963b14d6223a8'] = 'Paniers abandonnés'; +$_MODULE['<{tntofficiel}prestashop>view_552a0d8c17d95d5dbdc0c28217024f5a'] = 'Frais d\'expédition'; +$_MODULE['<{tntofficiel}prestashop>view_57297718fdb439175177cf6b196172d1'] = 'État de la commande'; +$_MODULE['<{tntofficiel}prestashop>view_576e650084068ed747fb3b22196dcd70'] = 'Si vous décidez de créer cette remise pour toutes les factures, une seule remise sera créée pour chaque facture de commande.'; +$_MODULE['<{tntofficiel}prestashop>view_585bc67adbb73dcca638b897fb73a900'] = 'Voir le document'; +$_MODULE['<{tntofficiel}prestashop>view_58a13b9a4e13f53cf70a60bf583321e1'] = 'Total bons de réduction (HT)'; +$_MODULE['<{tntofficiel}prestashop>view_5d9fe8726be08b6e26a0c05319590b01'] = 'Plus de détails...'; +$_MODULE['<{tntofficiel}prestashop>view_5da618e8e4b89c66fe86e32cdafde142'] = 'Du'; +$_MODULE['<{tntofficiel}prestashop>view_5db361171166373b9694fc4aeb0932b5'] = 'Il n\'y a pas de document disponible'; +$_MODULE['<{tntofficiel}prestashop>view_5e1ce9eb796081fea13e0d0dd3c3d76f'] = 'Numéro de référence'; +$_MODULE['<{tntofficiel}prestashop>view_5f9a97c1e1ac934b2eb46a9888c3bc8c'] = 'hors taxe.'; +$_MODULE['<{tntofficiel}prestashop>view_601d8c4b9f72fc1862013c19b677a499'] = 'Adresse de facturation'; +$_MODULE['<{tntofficiel}prestashop>view_60adc330494a66981dec101c81e27f03'] = 'Siret'; +$_MODULE['<{tntofficiel}prestashop>view_614103b76fd0d9de068d69034fb6f987'] = '(%s)'; +$_MODULE['<{tntofficiel}prestashop>view_6188ffe19286d3bf694160609cf15e82'] = 'Inclure le montant du bon de réduction initial'; +$_MODULE['<{tntofficiel}prestashop>view_62902641c38f3a4a8eb3212454360e24'] = 'Minute'; +$_MODULE['<{tntofficiel}prestashop>view_63d5049791d9d79d86e9a108b0a999ca'] = 'Référence'; +$_MODULE['<{tntofficiel}prestashop>view_6416e8cb5fc0a208d94fa7f5a300dbc4'] = 'Entrepôt'; +$_MODULE['<{tntofficiel}prestashop>view_643b37e767ef12dd6aa58c77dfcb9bda'] = 'Pour ce groupe de clients, les prix sont affichés : [1]%s[/1]'; +$_MODULE['<{tntofficiel}prestashop>view_65247263c6ea1d91027b28a41db8cb4b'] = 'Editing this product line will remove the reduction and base price.'; +$_MODULE['<{tntofficiel}prestashop>view_6564612f96de4b8015ded38cd2c9c443'] = 'Manifeste TNT'; +$_MODULE['<{tntofficiel}prestashop>view_66dc0eb61ab4157d6170494e6841a77a'] = 'Commentaire privé'; +$_MODULE['<{tntofficiel}prestashop>view_6702a6e3bc2dce95c3e3b61fe578f29c'] = 'Montant'; +$_MODULE['<{tntofficiel}prestashop>view_689202409e48743b914713f96d93947c'] = 'Valeur'; +$_MODULE['<{tntofficiel}prestashop>view_694e8d1f2ee056f98ee488bdc4982d73'] = 'Quantité'; +$_MODULE['<{tntofficiel}prestashop>view_6a5efd211a422296eab4adc476c98f0e'] = 'Retourner les produits'; +$_MODULE['<{tntofficiel}prestashop>view_6a7bac4a86e299a2718b9d2c7c8aaea9'] = 'Compte créé'; +$_MODULE['<{tntofficiel}prestashop>view_6a94d8492279c2bfd3e81f3158658980'] = '[Génération] Règle panier pour livraison offerte'; +$_MODULE['<{tntofficiel}prestashop>view_6c957f72dc8cdacc75762f2cbdcdfaf2'] = 'Prix unitaire'; +$_MODULE['<{tntofficiel}prestashop>view_6fe50cb3c0bf60f28ac9049ae6cb8c26'] = 'Cette commande a été passée par un compte invité.'; +$_MODULE['<{tntofficiel}prestashop>view_711cb64729ed5b666cf97c01691f5806'] = 'Inclure frais de port'; +$_MODULE['<{tntofficiel}prestashop>view_7137dec9b59978006f8b0ec036099346'] = 'Cet avertissement concerne aussi la commande'; +$_MODULE['<{tntofficiel}prestashop>view_719fec04166d6fa75f89cd29ad61fa8c'] = 'Taxes'; +$_MODULE['<{tntofficiel}prestashop>view_71e2851d86b252a44c658b896c486921'] = 'Modifier une note'; +$_MODULE['<{tntofficiel}prestashop>view_729a51874fe901b092899e9e8b31c97a'] = 'Êtes-vous sûr ?'; +$_MODULE['<{tntofficiel}prestashop>view_730224c4825ae2c174f4cdaff321520e'] = 'Transformer en compte client'; +$_MODULE['<{tntofficiel}prestashop>view_7315d80cbbbb36fdcd92ba46a6384eff'] = 'Montrer les paniers et commandes pour ce client.'; +$_MODULE['<{tntofficiel}prestashop>view_73af90a8372beea9f81a3c3ca77a4aa8'] = 'Envoyer un e-mail au client contenant le lien pour effectuer le paiement.'; +$_MODULE['<{tntofficiel}prestashop>view_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Commandes'; +$_MODULE['<{tntofficiel}prestashop>view_747c6a3564774149c989884e0c581d53'] = 'Envoyer le message'; +$_MODULE['<{tntofficiel}prestashop>view_74c06eb18eeb118d7b3c623d0c717290'] = 'Rembourser les produits'; +$_MODULE['<{tntofficiel}prestashop>view_76f0ed934de85cc7131910b32ede7714'] = 'Rembourser'; +$_MODULE['<{tntofficiel}prestashop>view_7731388b0fae4c0d7214f6a1f6f1771f'] = 'Montant de votre choix'; +$_MODULE['<{tntofficiel}prestashop>view_773b660773e6106c248814fa87b480f7'] = 'Erreur durant l\'envoi de l\'e-mail au client.'; +$_MODULE['<{tntofficiel}prestashop>view_77fd2b4393b379bedd30efcd5df02090'] = 'Remboursement partiel'; +$_MODULE['<{tntofficiel}prestashop>view_782678f4ba02feb3e9ecd51e902cd16b'] = 'Historique des remboursements'; +$_MODULE['<{tntofficiel}prestashop>view_7bb36e0f484d91aeba5d83fe2af63d28'] = 'Rechercher un produit'; +$_MODULE['<{tntofficiel}prestashop>view_7bf753e0cbb2d38818ba2a3ee3b36f4d'] = 'Total des taxes'; +$_MODULE['<{tntofficiel}prestashop>view_7dce122004969d56ae2e0245cb754d35'] = 'Modifier'; +$_MODULE['<{tntofficiel}prestashop>view_7fb46048bafd1294fab5c1675ef4f849'] = 'Saisir un paiement'; +$_MODULE['<{tntofficiel}prestashop>view_7fc63f077cf04742cf02e7c589b428e9'] = '(Max %s %s)'; +$_MODULE['<{tntofficiel}prestashop>view_80cb34a90bc2178e9219ccc4ab106867'] = 'Générer la facture'; +$_MODULE['<{tntofficiel}prestashop>view_85fb93a8ee9440499692da24a1621769'] = 'APE'; +$_MODULE['<{tntofficiel}prestashop>view_867343577fa1f33caa632a19543bd252'] = 'Mots clés'; +$_MODULE['<{tntofficiel}prestashop>view_883370e6a8360f9ffe2e658db153fd74'] = 'Cette fonctionnalité va générer un mot de passe aléatoire et envoyer un e-mail au client.'; +$_MODULE['<{tntofficiel}prestashop>view_88427ec035734b45aae9f7d8859a5008'] = 'ID de la transaction'; +$_MODULE['<{tntofficiel}prestashop>view_887ee91702c962a70b87cbef07bbcaec'] = 'HT'; +$_MODULE['<{tntofficiel}prestashop>view_894fdeeda7d3575fd6775732d026992c'] = 'Erreur : le prix du produit doit être établi'; +$_MODULE['<{tntofficiel}prestashop>view_8a8ece2eaecf6b5771d66434212e060d'] = 'Total payé depuis la création du compte'; +$_MODULE['<{tntofficiel}prestashop>view_8b3e7bc0ed634c2bc8ac54a4cc2e781f'] = 'Mise en place d\'un formulaire de paiement'; +$_MODULE['<{tntofficiel}prestashop>view_8c489d0946f66d17d73f26366a4bf620'] = 'Poids'; +$_MODULE['<{tntofficiel}prestashop>view_8d4ac0e8c6f5900930ddfccd45d10abf'] = 'payés en trop'; +$_MODULE['<{tntofficiel}prestashop>view_8e0398b929d533c18fff7f5e21e8fcbd'] = 'Prix du produit'; +$_MODULE['<{tntofficiel}prestashop>view_90bf4568676d012fc21b3556fbd0303b'] = 'Dupliquer cette commande'; +$_MODULE['<{tntofficiel}prestashop>view_914419aa32f04011357d3b604a86d7eb'] = 'Transporteur'; +$_MODULE['<{tntofficiel}prestashop>view_931d3a3ad177dd96a28c9642fec11b01'] = 'Numéro de carte'; +$_MODULE['<{tntofficiel}prestashop>view_93cba07454f06a4a960172bbd6e2a435'] = 'Oui'; +$_MODULE['<{tntofficiel}prestashop>view_94003250a2187a9f51b227b490e5ab6b'] = 'Nouveau client'; +$_MODULE['<{tntofficiel}prestashop>view_947d8520f04473da621f2718138f3bc6'] = '30 jours'; +$_MODULE['<{tntofficiel}prestashop>view_961f2247a2070bedff9f9cd8d64e2650'] = 'Choisissez'; +$_MODULE['<{tntofficiel}prestashop>view_96a1d1c198d05a84d447899f9ee1bef0'] = 'Commande %1$s de %2$s %3$s'; +$_MODULE['<{tntofficiel}prestashop>view_96a2d6388d5c73e22a1edbe506f86b17'] = 'Total frais de port (HT)'; +$_MODULE['<{tntofficiel}prestashop>view_96b0141273eabab320119c467cdcaf17'] = 'Total'; +$_MODULE['<{tntofficiel}prestashop>view_979640f579db842e61902ca061153965'] = 'Retours produits'; +$_MODULE['<{tntofficiel}prestashop>view_988fd738de9c6d177440c5dcf69e73ce'] = 'Retour'; +$_MODULE['<{tntofficiel}prestashop>view_99e1953076f2095e40cecd83ecda351c'] = 'Suivi TNT'; +$_MODULE['<{tntofficiel}prestashop>view_9d5bf15117441a1b52eb1f0808e4aad3'] = 'Réductions'; +$_MODULE['<{tntofficiel}prestashop>view_9f38710d8e9ee2338dafa9ae484b0d85'] = 'Aller sur la page de paiement pour procéder au paiement.'; +$_MODULE['<{tntofficiel}prestashop>view_a1fa27779242b4902f7ae3bdd5c6d508'] = 'Type'; +$_MODULE['<{tntofficiel}prestashop>view_a240fa27925a635b08dc28c9e4f9216d'] = 'Commande'; +$_MODULE['<{tntofficiel}prestashop>view_a2eda4e1c4dfc9bade7150b878c57a46'] = 'Voir tous les messages'; +$_MODULE['<{tntofficiel}prestashop>view_a59dfa688b2182563bfc189928a66965'] = '%1s - %2s'; +$_MODULE['<{tntofficiel}prestashop>view_a5e35abc0c9e2d2784d0ef619b36448b'] = 'Frais d\'expédition'; +$_MODULE['<{tntofficiel}prestashop>view_a6105c0a611b41b08f1209506350279e'] = 'oui'; +$_MODULE['<{tntofficiel}prestashop>view_a6181ae0a3e0370de94efa64782a6e79'] = 'Pas de bon de livraison'; +$_MODULE['<{tntofficiel}prestashop>view_a6ecff447ea8327b43f5d16a924fb6be'] = 'Voir la facture'; +$_MODULE['<{tntofficiel}prestashop>view_a76d4ef5f3f6a672bbfab2865563e530'] = 'Heure'; +$_MODULE['<{tntofficiel}prestashop>view_a76e7775f5454953c7152f5160e75182'] = 'Configurer les messages prédéfinis'; +$_MODULE['<{tntofficiel}prestashop>view_a82868319826fb092b73968e661b5b38'] = 'Bons de réduction'; +$_MODULE['<{tntofficiel}prestashop>view_a85eba4c6c699122b2bb1387ea4813ad'] = 'Panier'; +$_MODULE['<{tntofficiel}prestashop>view_a9971a36ea6236b1577b27dba46775ed'] = 'Référence fournisseur'; +$_MODULE['<{tntofficiel}prestashop>view_aa52110dbfce51cc1ec8a163264151e2'] = 'Existant'; +$_MODULE['<{tntofficiel}prestashop>view_accfc34fe6c65228a926b524870161ab'] = 'Ce panier n\'existe pas'; +$_MODULE['<{tntofficiel}prestashop>view_ad8783089f828b927473fb61d51940ec'] = 'Utiliser'; +$_MODULE['<{tntofficiel}prestashop>view_adaaee4b22041c27198d410c68d952c9'] = 'Pourcentage'; +$_MODULE['<{tntofficiel}prestashop>view_aea807cc550550acd7b8d9a7bc469f6a'] = 'Vous devez choisir une boutique pour créer de nouvelles commandes'; +$_MODULE['<{tntofficiel}prestashop>view_aeddc664f1e95691c69ea44a5c1c18f5'] = 'Ce produit est en rupture de stock'; +$_MODULE['<{tntofficiel}prestashop>view_afdbd71037839ec5a581febacab7bad7'] = 'Aucun client trouvé'; +$_MODULE['<{tntofficiel}prestashop>view_b15e1100a6196acba01ef7aaa5b2a9e5'] = 'Ajouter une nouvelle adresse'; +$_MODULE['<{tntofficiel}prestashop>view_b2ee912b91d69b435159c7c3f6df7f5f'] = 'Numéro'; +$_MODULE['<{tntofficiel}prestashop>view_b2f40690858b404ed10e62bdf422c704'] = 'Montant'; +$_MODULE['<{tntofficiel}prestashop>view_b52b44c9d23e141b067d7e83b44bb556'] = 'Produits'; +$_MODULE['<{tntofficiel}prestashop>view_b55e509c697e4cca0e1d160a7806698f'] = 'Heure'; +$_MODULE['<{tntofficiel}prestashop>view_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Description'; +$_MODULE['<{tntofficiel}prestashop>view_b718adec73e04ce3ec720dd11a06a308'] = 'ID'; +$_MODULE['<{tntofficiel}prestashop>view_b7623e931f082f027293f27dbfe7a8ea'] = 'Montrer au client'; +$_MODULE['<{tntofficiel}prestashop>view_b8d649752e2493d7d761b05cc255c3fd'] = 'La quantité à retourner est supérieure à la quantité disponible'; +$_MODULE['<{tntofficiel}prestashop>view_b9208b03bcc9eb4a336258dcdcb66207'] = 'Déclinaisons'; +$_MODULE['<{tntofficiel}prestashop>view_b9313ee2094019f4ee5212f784f45d65'] = 'Exclure le montant du bon de réduction initial'; +$_MODULE['<{tntofficiel}prestashop>view_b94cb106eaa958b2ab473da305e57977'] = 'Total (HT)'; +$_MODULE['<{tntofficiel}prestashop>view_b9af8635591dc44009ccd8e5389722ec'] = 'Aucun produit trouvé'; +$_MODULE['<{tntofficiel}prestashop>view_b9e6daaef804c01f3847f1da8b053dd1'] = 'Image n°'; +$_MODULE['<{tntofficiel}prestashop>view_ba794350deb07c0c96fe73bd12239059'] = 'Emballage'; +$_MODULE['<{tntofficiel}prestashop>view_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non'; +$_MODULE['<{tntofficiel}prestashop>view_bbee72681d2c075d95355d3d9ccefb4e'] = 'Avoir concernant la commande n°%d'; +$_MODULE['<{tntofficiel}prestashop>view_bcab2ed7cab19f8e119317a7e59d316a'] = 'Erreur : aucun produit sélectionné'; +$_MODULE['<{tntofficiel}prestashop>view_bcd1b68617759b1dfcff0403a6b5a8d1'] = 'PDF'; +$_MODULE['<{tntofficiel}prestashop>view_be4254ec37a7bf0d2babdf04bce774cf'] = 'Imprimer la commande'; +$_MODULE['<{tntofficiel}prestashop>view_be73df859979ad499dd484eeb187be60'] = 'Historique des retours'; +$_MODULE['<{tntofficiel}prestashop>view_c04e4a193365ce28bcc3e5b210dd3065'] = '%1s - %2s - %3s'; +$_MODULE['<{tntofficiel}prestashop>view_c112bd7d596888979be02bd780e6a94f'] = 'Afficher cette commande'; +$_MODULE['<{tntofficiel}prestashop>view_c12a553ab6ad810580afa3f07aa9f51f'] = 'non payés'; +$_MODULE['<{tntofficiel}prestashop>view_c20497ad97022701fa9b5d3c34c0c474'] = 'Propriétaire de la carte'; +$_MODULE['<{tntofficiel}prestashop>view_c2808546f3e14d267d798f4e0e6f102e'] = 'Personnalisé'; +$_MODULE['<{tntofficiel}prestashop>view_c453a4b8e8d98e82f35b67f433e3b4da'] = 'Paiement'; +$_MODULE['<{tntofficiel}prestashop>view_c4832c266d52c6cef340a9c656ddda26'] = 'Erreur. Vous ne pouvez pas rembourser un montant négatif.'; +$_MODULE['<{tntofficiel}prestashop>view_c4b689eeebf8e942907a1cc1d086dba6'] = 'Procéder à un remboursement partiel'; +$_MODULE['<{tntofficiel}prestashop>view_c6ba3f7beac8724d025d570d002b1579'] = 'Aucun bon trouvé'; +$_MODULE['<{tntofficiel}prestashop>view_c78ba40a94a132dc170cba2f8c66f310'] = 'Rechercher un produit en saisissant les premières lettres de son nom.'; +$_MODULE['<{tntofficiel}prestashop>view_c89db248919294ef0291a6586f6e9a5b'] = 'Rechercher un bon d\'achat'; +$_MODULE['<{tntofficiel}prestashop>view_c990c4027126c39a93fcaaafb68732b3'] = 'Supprimer la réduction'; +$_MODULE['<{tntofficiel}prestashop>view_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; +$_MODULE['<{tntofficiel}prestashop>view_cb1766c2f66e428afb3b74a67c045370'] = 'Marquer ce message comme \'lu\''; +$_MODULE['<{tntofficiel}prestashop>view_cc61945cbbf46721a053467c395c666f'] = 'Remboursé'; +$_MODULE['<{tntofficiel}prestashop>view_cd5cb1c932fc6f41a4fb3f6ec2f0c2da'] = 'Erreur : la quantité doit être établie'; +$_MODULE['<{tntofficiel}prestashop>view_ce26601dac0dea138b7295f02b7620a7'] = 'Client'; +$_MODULE['<{tntofficiel}prestashop>view_ce5bf551379459c1c61d2a204061c455'] = 'Emplacement'; +$_MODULE['<{tntofficiel}prestashop>view_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-mail'; +$_MODULE['<{tntofficiel}prestashop>view_cf439751556c68503540b036d35b1c78'] = '%s (%s remboursé)'; +$_MODULE['<{tntofficiel}prestashop>view_d201284604b35aa9392cb9c1acc434a6'] = 'Avoir concernant la commande n°%d'; +$_MODULE['<{tntofficiel}prestashop>view_d53b54a2bdbf970c70b7de7de4f6021f'] = 'Commandes validées'; +$_MODULE['<{tntofficiel}prestashop>view_d68a1671669f7e55d73dd78c22d52dfa'] = 'Cette commande a été payée en partie par bon de réduction. Choisissez le montant que vous souhaitez rembourser'; +$_MODULE['<{tntofficiel}prestashop>view_d694c11f096d5d666dde9ab8f9d9ba29'] = 'Changer la devise'; +$_MODULE['<{tntofficiel}prestashop>view_d71940f24ee38ee09f6e06b908480bcf'] = 'Renvoyer l\'e-mail'; +$_MODULE['<{tntofficiel}prestashop>view_da22c93ccb398c72070f4000cc7b59a1'] = 'Personnalisation'; +$_MODULE['<{tntofficiel}prestashop>view_db205f01b4fd580fb5daa9072d96849d'] = 'Total produits'; +$_MODULE['<{tntofficiel}prestashop>view_dc8d1b4e8c9bdf1eed97eb9ed5877a43'] = 'Voulez-vous écraser le message actuel ?'; +$_MODULE['<{tntofficiel}prestashop>view_ddd167afc1441dcab03a9546c8ef8b51'] = 'Voir le bon de livraison'; +$_MODULE['<{tntofficiel}prestashop>view_de78da3154b793d64d302db27e65baec'] = 'Aucun moyen de paiement disponible'; +$_MODULE['<{tntofficiel}prestashop>view_deb10517653c255364175796ace3553f'] = 'Produit'; +$_MODULE['<{tntofficiel}prestashop>view_e0a1695cc8d58eae2745b55059687db6'] = 'Boutique : %s'; +$_MODULE['<{tntofficiel}prestashop>view_e12167aa0a7698e6ebc92b4ce3909b53'] = 'Au'; +$_MODULE['<{tntofficiel}prestashop>view_e13004b81566bfc42daa48372c15111b'] = 'Changer l\'état de la commande'; +$_MODULE['<{tntofficiel}prestashop>view_e1b638a956fae226de3740f63a4e7d48'] = 'Vous souhaitez ajouter plus de produit qu\'il n\'y a de stock, êtes-vous sûr de vouloir ajouter cette quantité ?'; +$_MODULE['<{tntofficiel}prestashop>view_e2103a9e878a2280b3163e5ee098cbdf'] = 'Êtes-vous sûr de vouloir créer une nouvelle facture ?'; +$_MODULE['<{tntofficiel}prestashop>view_e2e79605fc9450ec17957cf0e910f5c6'] = 'TTC'; +$_MODULE['<{tntofficiel}prestashop>view_e413f403aa8d5253b487d09fc84e47a0'] = 'Générer un avoir'; +$_MODULE['<{tntofficiel}prestashop>view_e49701f123af735cf327227e8ab09bac'] = 'Commande manuelle - Employé'; +$_MODULE['<{tntofficiel}prestashop>view_e4c3da18c66c0147144767efeb59198f'] = 'Taux de transformation'; +$_MODULE['<{tntofficiel}prestashop>view_e5bd639f4d74cf2c52afada77086f788'] = 'Procéder à un remboursement'; +$_MODULE['<{tntofficiel}prestashop>view_e5d61db40a917c78a9d8e821dd0dd8de'] = 'Ajouter une commande'; +$_MODULE['<{tntofficiel}prestashop>view_ea067eb37801c5aab1a1c685eb97d601'] = 'Total payé'; +$_MODULE['<{tntofficiel}prestashop>view_ea4788705e6873b424c65e91c2846b19'] = 'Annuler'; +$_MODULE['<{tntofficiel}prestashop>view_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Livraison'; +$_MODULE['<{tntofficiel}prestashop>view_eb1b764a2636ba00ae66e6946ba4ee99'] = 'Bon de transport de TNT'; +$_MODULE['<{tntofficiel}prestashop>view_ec211f7c20af43e742bf2570c3cb84f9'] = 'Ajouter'; +$_MODULE['<{tntofficiel}prestashop>view_ec53a8c4f07baed5d8825072c89799be'] = 'État'; +$_MODULE['<{tntofficiel}prestashop>view_ecd2046a1d4a6e46c11914c04b9559e4'] = 'Un compte client utilisant cette adresse e-mail existe déjà'; +$_MODULE['<{tntofficiel}prestashop>view_ee7197503a8a3820850df76fb406c224'] = 'Bon de livraison'; +$_MODULE['<{tntofficiel}prestashop>view_eed1808b8206c5a62cc6407f85cf95bc'] = 'Total (TTC)'; +$_MODULE['<{tntofficiel}prestashop>view_eeddc7284795f5c71b12156c06e9e821'] = 'Rechercher un client'; +$_MODULE['<{tntofficiel}prestashop>view_ef5f330df17f8c955005c26466c2463c'] = 'Les retours produits sont désactivés'; +$_MODULE['<{tntofficiel}prestashop>view_f0aaaae189e9c7711931a65ffcd22543'] = 'Moyen de paiement'; +$_MODULE['<{tntofficiel}prestashop>view_f13673c7e261fd8d00915c9cb768ad95'] = 'Message de la commande'; +$_MODULE['<{tntofficiel}prestashop>view_f14b582c1b0eab88ed5904fb781568c0'] = 'Nom de la réduction'; +$_MODULE['<{tntofficiel}prestashop>view_f28128b38efbc6134dc40751ee21fd29'] = 'Documents'; +$_MODULE['<{tntofficiel}prestashop>view_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer'; +$_MODULE['<{tntofficiel}prestashop>view_f38c718d5cc5ea7331d8acf533f9bf0d'] = 'Cette avertissement concerne aussi les commandes suivantes'; +$_MODULE['<{tntofficiel}prestashop>view_f4ec5f57bd4d31b803312d873be40da9'] = 'Modifier'; +$_MODULE['<{tntofficiel}prestashop>view_f5359d1dd07def542aa9b0577fb27068'] = 'Mettre à jour l\'état'; +$_MODULE['<{tntofficiel}prestashop>view_f53e8d0e97c47ce70ca9c5eaa08a00d0'] = 'Avoir'; +$_MODULE['<{tntofficiel}prestashop>view_f741fe9d353085c596e3c3610101e245'] = 'Renvoyer cet e-mail au client'; +$_MODULE['<{tntofficiel}prestashop>view_f8246f1c2cfd9a81a376223428bd09d7'] = 'Pas de facture'; +$_MODULE['<{tntofficiel}prestashop>view_f8a09f634b7b3ede2da34607da2aaebe'] = 'Quantités disponibles'; +$_MODULE['<{tntofficiel}prestashop>view_f8b1369a8e9d90da0cae0b11049309af'] = 'Non défini'; +$_MODULE['<{tntofficiel}prestashop>view_f92965e2c8a7afb3c1b9a5c09a263636'] = 'Valider'; +$_MODULE['<{tntofficiel}prestashop>view_f9a5775d7def0b6c57393fc86bb7a730'] = 'N\'oubliez pas de mettre à jour vos taux de change avant d\'effectuer cette modification.'; +$_MODULE['<{tntofficiel}prestashop>view_fb61758d0f0fda4ba867c3d5a46c16a7'] = 'Sources'; +$_MODULE['<{tntofficiel}prestashop>view_fc24bca31a0e2f75c9979c18760a4960'] = 'Voir la commande'; +$_MODULE['<{tntofficiel}prestashop>view_fc26e55e0993a75e892175deb02aae15'] = 'Paniers'; +$_MODULE['<{tntofficiel}prestashop>view_fcebe56087b9373f15514831184fa572'] = 'En Stock'; +$_MODULE['<{tntofficiel}prestashop>view_fdfac28b5ad628f25649d9c2eb4fc62e'] = 'Retourné'; +$_MODULE['<{tntofficiel}prestashop>view_ffbb5322a3702b0d8d9c7f506209c540'] = 'Panier moyen'; \ No newline at end of file diff --git a/www/modules/tntofficiel/translations/index.php b/www/modules/tntofficiel/translations/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/translations/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/upgrade/index.php b/www/modules/tntofficiel/upgrade/index.php new file mode 100644 index 00000000..f16b36c6 --- /dev/null +++ b/www/modules/tntofficiel/upgrade/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/upgrade/install-1.2.10.php b/www/modules/tntofficiel/upgrade/install-1.2.10.php new file mode 100644 index 00000000..64b73b50 --- /dev/null +++ b/www/modules/tntofficiel/upgrade/install-1.2.10.php @@ -0,0 +1,67 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +if (!defined('_PS_VERSION_')) { + exit; +} + +function upgrade_module_1_2_10($objTNT) +{ + $templateOverrides = array( + array( + 'fileName' => 'view.tpl', + 'directorySrc' => 'views/templates/admin/override/controllers/admin/templates/orders/helpers/view/', + 'directoryDst' => 'controllers/admin/templates/orders/helpers/view/', + ), + ); + + foreach ($templateOverrides as $template) { + try { + $directoryDst = _PS_OVERRIDE_DIR_.$template['directoryDst']; + if (!is_dir($directoryDst)) { + mkdir($directoryDst, 0777, true); + } + $overrideDestination = $directoryDst.$template['fileName']; + if (file_exists($overrideDestination)) { + unlink($overrideDestination); + } + } catch (Exception $objException) { + $logger = new FileLogger(); + $logger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $logger->log($objException->getMessage(), 3); + return false; + } + + try { + $directoryDst = _PS_OVERRIDE_DIR_.$template['directoryDst']; + if (!is_dir($directoryDst)) { + mkdir($directoryDst, 0777, true); + } + $overrideSrc = $objTNT->getLocalPath().$template['directorySrc'].$template['fileName']; + $overrideDestination = $directoryDst.$template['fileName']; + + copy($overrideSrc, $overrideDestination); + } catch (Exception $objException) { + $logger = new FileLogger(); + $logger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $logger->log($objException->getMessage(), 3); + return false; + } + } + + // Reinstall Overrides + if (!$objTNT->uninstallOverrides()) { + return false; + } + if (!$objTNT->installOverrides()) { + return false; + } + + return true; +} diff --git a/www/modules/tntofficiel/upgrade/install-1.2.11.php b/www/modules/tntofficiel/upgrade/install-1.2.11.php new file mode 100644 index 00000000..ce268d85 --- /dev/null +++ b/www/modules/tntofficiel/upgrade/install-1.2.11.php @@ -0,0 +1,67 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +if (!defined('_PS_VERSION_')) { + exit; +} + +function upgrade_module_1_2_11($objTNT) +{ + $templateOverrides = array( + array( + 'fileName' => 'view.tpl', + 'directorySrc' => 'views/templates/admin/override/controllers/admin/templates/orders/helpers/view/', + 'directoryDst' => 'controllers/admin/templates/orders/helpers/view/', + ), + ); + + foreach ($templateOverrides as $template) { + try { + $directoryDst = _PS_OVERRIDE_DIR_.$template['directoryDst']; + if (!is_dir($directoryDst)) { + mkdir($directoryDst, 0777, true); + } + $overrideDestination = $directoryDst.$template['fileName']; + if (file_exists($overrideDestination)) { + unlink($overrideDestination); + } + } catch (Exception $objException) { + $logger = new FileLogger(); + $logger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $logger->log($objException->getMessage(), 3); + return false; + } + + try { + $directoryDst = _PS_OVERRIDE_DIR_.$template['directoryDst']; + if (!is_dir($directoryDst)) { + mkdir($directoryDst, 0777, true); + } + $overrideSrc = $objTNT->getLocalPath().$template['directorySrc'].$template['fileName']; + $overrideDestination = $directoryDst.$template['fileName']; + + copy($overrideSrc, $overrideDestination); + } catch (Exception $objException) { + $logger = new FileLogger(); + $logger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $logger->log($objException->getMessage(), 3); + return false; + } + } + + // Reinstall Overrides + if (!$objTNT->uninstallOverrides()) { + return false; + } + if (!$objTNT->installOverrides()) { + return false; + } + + return true; +} diff --git a/www/modules/tntofficiel/upgrade/install-1.2.12.php b/www/modules/tntofficiel/upgrade/install-1.2.12.php new file mode 100644 index 00000000..afe31b99 --- /dev/null +++ b/www/modules/tntofficiel/upgrade/install-1.2.12.php @@ -0,0 +1,67 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +if (!defined('_PS_VERSION_')) { + exit; +} + +function upgrade_module_1_2_12($objTNT) +{ + $templateOverrides = array( + array( + 'fileName' => 'view.tpl', + 'directorySrc' => 'views/templates/admin/override/controllers/admin/templates/orders/helpers/view/', + 'directoryDst' => 'controllers/admin/templates/orders/helpers/view/', + ), + ); + + foreach ($templateOverrides as $template) { + try { + $directoryDst = _PS_OVERRIDE_DIR_.$template['directoryDst']; + if (!is_dir($directoryDst)) { + mkdir($directoryDst, 0777, true); + } + $overrideDestination = $directoryDst.$template['fileName']; + if (file_exists($overrideDestination)) { + unlink($overrideDestination); + } + } catch (Exception $objException) { + $logger = new FileLogger(); + $logger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $logger->log($objException->getMessage(), 3); + return false; + } + + try { + $directoryDst = _PS_OVERRIDE_DIR_.$template['directoryDst']; + if (!is_dir($directoryDst)) { + mkdir($directoryDst, 0777, true); + } + $overrideSrc = $objTNT->getLocalPath().$template['directorySrc'].$template['fileName']; + $overrideDestination = $directoryDst.$template['fileName']; + + copy($overrideSrc, $overrideDestination); + } catch (Exception $objException) { + $logger = new FileLogger(); + $logger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $logger->log($objException->getMessage(), 3); + return false; + } + } + + // Reinstall Overrides + if (!$objTNT->uninstallOverrides()) { + return false; + } + if (!$objTNT->installOverrides()) { + return false; + } + + return true; +} diff --git a/www/modules/tntofficiel/upgrade/install-1.2.13.php b/www/modules/tntofficiel/upgrade/install-1.2.13.php new file mode 100644 index 00000000..0922be4d --- /dev/null +++ b/www/modules/tntofficiel/upgrade/install-1.2.13.php @@ -0,0 +1,75 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +if (!defined('_PS_VERSION_')) { + exit; +} + +function upgrade_module_1_2_13($objTNT) +{ + $templateOverrides = array( + array( + 'fileName' => 'view.tpl', + 'directorySrc' => 'views/templates/admin/override/controllers/admin/templates/orders/helpers/view/', + 'directoryDst' => 'controllers/admin/templates/orders/helpers/view/', + ), + ); + + foreach ($templateOverrides as $template) { + try { + $directoryDst = _PS_OVERRIDE_DIR_.$template['directoryDst']; + if (!is_dir($directoryDst)) { + mkdir($directoryDst, 0777, true); + } + $overrideDestination = $directoryDst.$template['fileName']; + if (file_exists($overrideDestination)) { + unlink($overrideDestination); + } + } catch (Exception $objException) { + $logger = new FileLogger(); + $logger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $logger->log($objException->getMessage(), 3); + return false; + } + + try { + $directoryDst = _PS_OVERRIDE_DIR_.$template['directoryDst']; + if (!is_dir($directoryDst)) { + mkdir($directoryDst, 0777, true); + } + $overrideSrc = $objTNT->getLocalPath().$template['directorySrc'].$template['fileName']; + $overrideDestination = $directoryDst.$template['fileName']; + + copy($overrideSrc, $overrideDestination); + } catch (Exception $objException) { + $logger = new FileLogger(); + $logger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $logger->log($objException->getMessage(), 3); + return false; + } + } + + // Reinstall Overrides + if (!$objTNT->uninstallOverrides()) { + return false; + } + if (!$objTNT->installOverrides()) { + return false; + } + + $intCarrierIDTNT = Configuration::get('TNT_CARRIER_ID'); + if ($intCarrierIDTNT > 0) { + Db::getInstance()->execute(' + UPDATE '._DB_PREFIX_.'carrier + SET max_weight = 0.0 + WHERE id_carrier = '.(int)$intCarrierIDTNT); + } + + return true; +} diff --git a/www/modules/tntofficiel/upgrade/install-1.2.14.php b/www/modules/tntofficiel/upgrade/install-1.2.14.php new file mode 100644 index 00000000..8cca774f --- /dev/null +++ b/www/modules/tntofficiel/upgrade/install-1.2.14.php @@ -0,0 +1,67 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +if (!defined('_PS_VERSION_')) { + exit; +} + +function upgrade_module_1_2_14($objTNT) +{ + $templateOverrides = array( + array( + 'fileName' => 'view.tpl', + 'directorySrc' => 'views/templates/admin/override/controllers/admin/templates/orders/helpers/view/', + 'directoryDst' => 'controllers/admin/templates/orders/helpers/view/', + ), + ); + + foreach ($templateOverrides as $template) { + try { + $directoryDst = _PS_OVERRIDE_DIR_.$template['directoryDst']; + if (!is_dir($directoryDst)) { + mkdir($directoryDst, 0777, true); + } + $overrideDestination = $directoryDst.$template['fileName']; + if (file_exists($overrideDestination)) { + unlink($overrideDestination); + } + } catch (Exception $objException) { + $logger = new FileLogger(); + $logger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $logger->log($objException->getMessage(), 3); + return false; + } + + try { + $directoryDst = _PS_OVERRIDE_DIR_.$template['directoryDst']; + if (!is_dir($directoryDst)) { + mkdir($directoryDst, 0777, true); + } + $overrideSrc = $objTNT->getLocalPath().$template['directorySrc'].$template['fileName']; + $overrideDestination = $directoryDst.$template['fileName']; + + copy($overrideSrc, $overrideDestination); + } catch (Exception $objException) { + $logger = new FileLogger(); + $logger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $logger->log($objException->getMessage(), 3); + return false; + } + } + + // Reinstall Overrides + if (!$objTNT->uninstallOverrides()) { + return false; + } + if (!$objTNT->installOverrides()) { + return false; + } + + return true; +} diff --git a/www/modules/tntofficiel/upgrade/install-1.2.17.php b/www/modules/tntofficiel/upgrade/install-1.2.17.php new file mode 100644 index 00000000..3ab7a48f --- /dev/null +++ b/www/modules/tntofficiel/upgrade/install-1.2.17.php @@ -0,0 +1,64 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +if (!defined('_PS_VERSION_')) { + exit; +} + +function upgrade_module_1_2_17($objArgTNTOfficiel_1_2_17) +{ + $arrTemplateOverrideList = array( + array( + 'fileName' => 'view.tpl', + 'directorySrc' => 'views/templates/admin/override/controllers/admin/templates/orders/helpers/view/', + 'directoryDst' => 'controllers/admin/templates/orders/helpers/view/', + ), + ); + + //$strModuleDirSrc = _PS_MODULE_DIR_.$objTNTOfficiel->name.DIRECTORY_SEPARATOR; + $strModuleDirSrc = $objArgTNTOfficiel_1_2_17->getLocalPath(); + + foreach ($arrTemplateOverrideList as $arrTemplateOverride) { + $strPathTemplateSrc = $strModuleDirSrc.$arrTemplateOverride['directorySrc']; + $strFileTemplateSrc = $strPathTemplateSrc.$arrTemplateOverride['fileName']; + $strPathTemplateDst = _PS_OVERRIDE_DIR_.$arrTemplateOverride['directoryDst']; + $strFileTemplateDst = $strPathTemplateDst.$arrTemplateOverride['fileName']; + + try { + // Create directory if unexist. + if (!is_dir($strPathTemplateDst)) { + mkdir($strPathTemplateDst, 0777, true); + } + // Delete previous template file if exist. + if (file_exists($strFileTemplateDst)) { + unlink($strFileTemplateDst); + } + // Copy new template file. + copy($strFileTemplateSrc, $strFileTemplateDst); + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + return false; + } + } + + // Reinstall Overrides: Module::uninstallOverrides() Module::installOverrides(). + if (!($objArgTNTOfficiel_1_2_17->uninstallOverrides() && $objArgTNTOfficiel_1_2_17->installOverrides())) { + return false; + } + + // Delete unused config. + if (!Configuration::deleteByName('TNT_CARRIER_CREDENTIALS_OK')) { + return false; + } + + // Success. + return true; +} diff --git a/www/modules/tntofficiel/upgrade/install-1.2.18.php b/www/modules/tntofficiel/upgrade/install-1.2.18.php new file mode 100644 index 00000000..cdadbc30 --- /dev/null +++ b/www/modules/tntofficiel/upgrade/install-1.2.18.php @@ -0,0 +1,67 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +if (!defined('_PS_VERSION_')) { + exit; +} + +function upgrade_module_1_2_18($objArgTNTOfficiel_1_2_18) +{ + $arrTemplateOverrideList = array( + array( + 'fileName' => 'view.tpl', + 'directorySrc' => 'views/templates/admin/override/controllers/admin/templates/orders/helpers/view/', + 'directoryDst' => 'controllers/admin/templates/orders/helpers/view/', + ), + ); + + $boolCopy = true; + + //$strModuleDirSrc = _PS_MODULE_DIR_.$objTNTOfficiel->name.DIRECTORY_SEPARATOR; + $strModuleDirSrc = $objArgTNTOfficiel_1_2_18->getLocalPath(); + + foreach ($arrTemplateOverrideList as $arrTemplateOverride) { + $strPathTemplateSrc = $strModuleDirSrc.$arrTemplateOverride['directorySrc']; + $strFileTemplateSrc = $strPathTemplateSrc.$arrTemplateOverride['fileName']; + $strPathTemplateDst = _PS_OVERRIDE_DIR_.$arrTemplateOverride['directoryDst']; + $strFileTemplateDst = $strPathTemplateDst.$arrTemplateOverride['fileName']; + + try { + // Create directory if unexist. + if (!is_dir($strPathTemplateDst)) { + mkdir($strPathTemplateDst, 0777, true); + } + // Delete previous template file if exist. + if (file_exists($strFileTemplateDst)) { + unlink($strFileTemplateDst); + } + // Copy new template file. + $boolCopy = $boolCopy && copy($strFileTemplateSrc, $strFileTemplateDst); + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + + return false; + } + } + + // If at least a file copy has fail. + if (!$boolCopy) { + return false; + } + + // Reinstall Overrides: Module::uninstallOverrides() Module::installOverrides(). + if (!($objArgTNTOfficiel_1_2_18->uninstallOverrides() && $objArgTNTOfficiel_1_2_18->installOverrides())) { + return false; + } + + // Success. + return true; +} diff --git a/www/modules/tntofficiel/upgrade/install-1.2.19.php b/www/modules/tntofficiel/upgrade/install-1.2.19.php new file mode 100644 index 00000000..75b2eaa7 --- /dev/null +++ b/www/modules/tntofficiel/upgrade/install-1.2.19.php @@ -0,0 +1,67 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +if (!defined('_PS_VERSION_')) { + exit; +} + +function upgrade_module_1_2_19($objArgTNTOfficiel_1_2_19) +{ + $arrTemplateOverrideList = array( + array( + 'fileName' => 'view.tpl', + 'directorySrc' => 'views/templates/admin/override/controllers/admin/templates/orders/helpers/view/', + 'directoryDst' => 'controllers/admin/templates/orders/helpers/view/', + ), + ); + + $boolCopy = true; + + //$strModuleDirSrc = _PS_MODULE_DIR_.$objTNTOfficiel->name.DIRECTORY_SEPARATOR; + $strModuleDirSrc = $objArgTNTOfficiel_1_2_19->getLocalPath(); + + foreach ($arrTemplateOverrideList as $arrTemplateOverride) { + $strPathTemplateSrc = $strModuleDirSrc.$arrTemplateOverride['directorySrc']; + $strFileTemplateSrc = $strPathTemplateSrc.$arrTemplateOverride['fileName']; + $strPathTemplateDst = _PS_OVERRIDE_DIR_.$arrTemplateOverride['directoryDst']; + $strFileTemplateDst = $strPathTemplateDst.$arrTemplateOverride['fileName']; + + try { + // Create directory if unexist. + if (!is_dir($strPathTemplateDst)) { + mkdir($strPathTemplateDst, 0777, true); + } + // Delete previous template file if exist. + if (file_exists($strFileTemplateDst)) { + unlink($strFileTemplateDst); + } + // Copy new template file. + $boolCopy = $boolCopy && copy($strFileTemplateSrc, $strFileTemplateDst); + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + + return false; + } + } + + // If at least a file copy has fail. + if (!$boolCopy) { + return false; + } + + // Reinstall Overrides: Module::uninstallOverrides() Module::installOverrides(). + if (!($objArgTNTOfficiel_1_2_19->uninstallOverrides() && $objArgTNTOfficiel_1_2_19->installOverrides())) { + return false; + } + + // Success. + return true; +} diff --git a/www/modules/tntofficiel/upgrade/install-1.2.20.php b/www/modules/tntofficiel/upgrade/install-1.2.20.php new file mode 100644 index 00000000..4ce2788c --- /dev/null +++ b/www/modules/tntofficiel/upgrade/install-1.2.20.php @@ -0,0 +1,150 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +if (!defined('_PS_VERSION_')) { + exit; +} + +function upgrade_module_1_2_20($objArgTNTOfficiel_1_2_20) +{ + $strTablePrefix = _DB_PREFIX_; + + // Dop unused log table. + $strSQLTableLogDropTable = <<execute($strSQLTableLogDropTable) + || !$objDB->execute($strSQLTableExtraAddColumns) + || !$objDB->execute($strSQLTableExtraChangeColumns) + || !$objDB->execute($strSQLTableExtraRenameTable) + || !$objDB->execute($strSQLTableOrderChangeColumns) + || !$objDB->execute($strSQLTableOrderRenameTable) + || !$objDB->execute($strSQLTableParcelChangeColumns) + || !$objDB->execute($strSQLTableParcelRenameTable) + ) { + return false; + } + + $arrTemplateOverrideList = array( + array( + 'fileName' => 'view.tpl', + 'directorySrc' => 'views/templates/admin/override/controllers/admin/templates/orders/helpers/view/', + 'directoryDst' => 'controllers/admin/templates/orders/helpers/view/', + ), + ); + + $boolCopy = true; + + //$strModuleDirSrc = _PS_MODULE_DIR_.$objTNTOfficiel->name.DIRECTORY_SEPARATOR; + $strModuleDirSrc = $objArgTNTOfficiel_1_2_20->getLocalPath(); + + foreach ($arrTemplateOverrideList as $arrTemplateOverride) { + $strPathTemplateSrc = $strModuleDirSrc.$arrTemplateOverride['directorySrc']; + $strFileTemplateSrc = $strPathTemplateSrc.$arrTemplateOverride['fileName']; + $strPathTemplateDst = _PS_OVERRIDE_DIR_.$arrTemplateOverride['directoryDst']; + $strFileTemplateDst = $strPathTemplateDst.$arrTemplateOverride['fileName']; + + try { + // Create directory if unexist. + if (!is_dir($strPathTemplateDst)) { + mkdir($strPathTemplateDst, 0777, true); + } + // Delete previous template file if exist. + if (file_exists($strFileTemplateDst)) { + unlink($strFileTemplateDst); + } + // Copy new template file. + $boolCopy = $boolCopy && copy($strFileTemplateSrc, $strFileTemplateDst); + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + + return false; + } + } + + // If at least a file copy has fail. + if (!$boolCopy) { + return false; + } + + // Reinstall Overrides: Module::uninstallOverrides() Module::installOverrides(). + if (!($objArgTNTOfficiel_1_2_20->uninstallOverrides() && $objArgTNTOfficiel_1_2_20->installOverrides())) { + return false; + } + + // Success. + return true; +} diff --git a/www/modules/tntofficiel/upgrade/install-1.2.21.php b/www/modules/tntofficiel/upgrade/install-1.2.21.php new file mode 100644 index 00000000..108849ee --- /dev/null +++ b/www/modules/tntofficiel/upgrade/install-1.2.21.php @@ -0,0 +1,70 @@ + + * @copyright 2016-2017 GFI Informatique, 2016-2017 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +if (!defined('_PS_VERSION_')) { + exit; +} + +function upgrade_module_1_2_21($objArgTNTOfficiel_1_2_21) +{ + // TODO : rename. + //$obCarrier->external_module_name === 'tnt' + + $arrTemplateOverrideList = array( + array( + 'fileName' => 'view.tpl', + 'directorySrc' => 'views/templates/admin/override/controllers/admin/templates/orders/helpers/view/', + 'directoryDst' => 'controllers/admin/templates/orders/helpers/view/', + ), + ); + + $boolCopy = true; + + //$strModuleDirSrc = _PS_MODULE_DIR_.$objTNTOfficiel->name.DIRECTORY_SEPARATOR; + $strModuleDirSrc = $objArgTNTOfficiel_1_2_21->getLocalPath(); + + foreach ($arrTemplateOverrideList as $arrTemplateOverride) { + $strPathTemplateSrc = $strModuleDirSrc.$arrTemplateOverride['directorySrc']; + $strFileTemplateSrc = $strPathTemplateSrc.$arrTemplateOverride['fileName']; + $strPathTemplateDst = _PS_OVERRIDE_DIR_.$arrTemplateOverride['directoryDst']; + $strFileTemplateDst = $strPathTemplateDst.$arrTemplateOverride['fileName']; + + try { + // Create directory if unexist. + if (!is_dir($strPathTemplateDst)) { + mkdir($strPathTemplateDst, 0777, true); + } + // Delete previous template file if exist. + if (file_exists($strFileTemplateDst)) { + unlink($strFileTemplateDst); + } + // Copy new template file. + $boolCopy = $boolCopy && copy($strFileTemplateSrc, $strFileTemplateDst); + } catch (Exception $objException) { + $objFileLogger = new FileLogger(); + $objFileLogger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_tnt_exception.log'); + $objFileLogger->logError($objException->getMessage()); + + return false; + } + } + + // If at least a file copy has fail. + if (!$boolCopy) { + return false; + } + + // Reinstall Overrides: Module::uninstallOverrides() Module::installOverrides(). + if (!($objArgTNTOfficiel_1_2_21->uninstallOverrides() && $objArgTNTOfficiel_1_2_21->installOverrides())) { + return false; + } + + // Success. + return true; +} diff --git a/www/modules/tntofficiel/views/css/AdminTNTOfficiel.css b/www/modules/tntofficiel/views/css/AdminTNTOfficiel.css new file mode 100644 index 00000000..db6efa35 --- /dev/null +++ b/www/modules/tntofficiel/views/css/AdminTNTOfficiel.css @@ -0,0 +1,15 @@ +.fluidMedia { + position: relative; + padding-bottom: 56.25%; /* proportion value to aspect ratio 16:9 (9 / 16 = 0.5625 or 56.25%) */ + padding-top: 30px; + height: 0; + overflow: hidden; +} + +.fluidMedia iframe { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} \ No newline at end of file diff --git a/www/modules/tntofficiel/views/css/deliveryPointsBox.css b/www/modules/tntofficiel/views/css/deliveryPointsBox.css new file mode 100644 index 00000000..e3a4edf6 --- /dev/null +++ b/www/modules/tntofficiel/views/css/deliveryPointsBox.css @@ -0,0 +1,735 @@ +.relay-points *, +.repositories * { + font-family: 'Open Sans', sans-serif; +} + +.addresses-list { + position: absolute; + left: 0; + top: 142px; + right: 0; + bottom: 0; + z-index: 1; + background-color: #FFFFFF; +} + +#list_scrollbar_container, +#relay_points_map, +#repositories_map { + display: block; +} + +#list_scrollbar_container { + float: left; + position: relative; + width: 64.5% !important; +} + +#relay_points_map, +#repositories_map { + float: right; + width: 35%; + height: 100%; + border-left: 1px solid #FFFFFF; +} + +.relay-points .validation-advice, +.repositories .validation-advice { + position: absolute; + background-color: #df280a; + padding: 0 10px; + color: #FFF !important; + top: -30px; + border-radius: 2px; +} + +.relay-points .validation-advice::before, +.repositories .validation-advice::before { + content: '\25BC'; + color: #df280a; + position: absolute; + top: 17px; + left: 30px; +} + +.relay-points button, .repositories button { + padding: 5px 10px; + font-size: 12px; + font-weight: bold; + border: 0; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + color: white; + background: #1cb3f4; + cursor: pointer; +} + +.relay-points-container, +.repositories-container { + overflow: hidden; +} + +.relay-points-form, +.repositories-form { + overflow: hidden; +} + +.relay-points-form .label, +.repositories-form .label { + font-weight: bold; + color: #444; +} + +.relay-points-list .relay-point-item:hover, +.relay-points-list .relay-point-item.is-selected, +.relay-points-list .repository-item:hover, +.relay-points-list .repository-item.is-selected, +.repositories-list .relay-point-item:hover, +.repositories-list .relay-point-item.is-selected, +.repositories-list .repository-item:hover, +.repositories-list .repository-item.is-selected { + background: #eeeeee !important; + cursor: pointer; +} + +.relay-points-list .relay-point-item-please-wait, +.relay-points-list .repository-item-please-wait, +.repositories-list .relay-point-item-please-wait, +.repositories-list .repository-item-please-wait { + float: none; +} + +.relay-points-list .relay-point-name, +.relay-points-list .repository-name, +.repositories-list .relay-point-name, +.repositories-list .repository-name { + font-weight: bold; +} + +.relay-points-list .no-results, +.repositories-list .no-results{ + border: 1px solid #e7e7e7; + padding: 20px; + margin-right: -26px; + text-align: center; +} +.relay-points-header { + height: 80px; + /*background: url("../img/carrier/delivery/option-RelaisColis.png") right center no-repeat;*/ + margin-right: 25px; +} + +.repositories-header { + height: 80px; + /*background: url("../img/carrier/delivery/option-Entreprise.png") right center no-repeat;*/ + margin-right: 25px; +} + +.relay-points-header h2 { + display: block; + font-size: 26px; + margin: 0; + padding-left: 110px; + line-height: 80px; + /*text-transform: uppercase;*/ + font-weight: normal; + /*background: url("../img/modal/top-picto.png") left center no-repeat;*/ + background: url("../img/carrier/delivery/option-RelaisColis.png") left center no-repeat; +} + +.repositories-header h2 { + display: block; + font-size: 26px; + margin: 0; + padding-left: 110px; + line-height: 80px; + /*text-transform: uppercase;*/ + font-weight: normal; + /*background: url("../img/modal/top-picto.png") left center no-repeat;*/ + background: url("../img/carrier/delivery/option-Entreprise.png") left center no-repeat; +} + +.location-topbar { + padding: 8px 10px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + border: 1px solid #e7e7e7; + background: #f8f8f8; + overflow: visible; + position: relative; +} + +.location-topbar .relay-points-form, +.location-topbar .repositories-form { + display: table; + width: 100%; +} + +.location-topbar .relay-points-form span, +.location-topbar .relay-points-form .form-list, +.location-topbar .repositories-form span, +.location-topbar .repositories-form .form-list { + display: table-cell; + vertical-align: middle; +} + +.location-topbar .relay-points-form .form-list, +.location-topbar .repositories-form .form-list { + max-width: 750px; +} + +.location-topbar .relay-points-form .fields, +.location-topbar .repositories-form .fields { + margin: 0 0 0 15px; +} + +.location-topbar .relay-points-form .field, +.location-topbar .repositories-form .field { + float: left; + margin: 0 10px; + position: relative; + vertical-align: middle; + width: inherit +} + +.lt-ie8 .location-topbar .relay-points-form .field, +.lt-ie8 .location-topbar .repositories-form .field { + display: inline; + zoom: 1; +} + +.location-topbar .relay-points-form .field label, +.location-topbar .repositories-form .field label { + color: #000000 !important; + font-weight: normal !important; +} + +.location-topbar .relay-points-form .field label, +.location-topbar .relay-points-form .field select, +.location-topbar .relay-points-form .field .input-box, +.location-topbar .repositories-form .field label, +.location-topbar .repositories-form .field select, +.location-topbar .repositories-form .field .input-box { + display: table-cell; + vertical-align: middle; + height: 30px; + line-height: 30px; +} + +.location-topbar .relay-points-form .field select, +.location-topbar .repositories-form .field select { + margin-top: 0 +} + +.location-topbar .relay-points-form .field select, +.location-topbar .relay-points-form .field .input-box input, +.location-topbar .repositories-form .field select, +.location-topbar .repositories-form .field .input-box input { + height: 30px; + width: inherit; + margin-left: 20px; + padding: 0 10px; + border: 1px solid #e7e7e7; + border-radius: 4px; + line-height: 30px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.location-topbar .relay-points-form .field em.required, +.location-topbar .repositories-form .field em.required { + color: #eb340a; + float: right; +} + +.location-topbar button { + font-size: 14px; + position: relative; +} + +.relay-points-list .relay-point-item, +.relay-points-list .repository-item, +.repositories-list .relay-point-item, +.repositories-list .repository-item { + display: table; + margin-bottom: 18px; + border: 1px solid #e7e7e7; +} + +.relay-points-list .relay-point-item:hover, +.relay-points-list .repository-item:hover, +.repositories-list .relay-point-item:hover, +.repositories-list .repository-item:hover { + background: white; +} + +.relay-points-list .relay-point-item > div, +.relay-points-list .repository-item > div, +.repositories-list .relay-point-item > div, +.repositories-list .repository-item > div { + display: table-cell; + vertical-align: top; + padding: 15px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.relay-points-list .relay-point-item > div.relay-point-address, +.relay-points-list .relay-point-item > div.repository-address, +.relay-points-list .repository-item > div.relay-point-address, +.relay-points-list .repository-item > div.repository-address, +.repositories-list .relay-point-item > div.relay-point-address, +.repositories-list .relay-point-item > div.repository-address, +.repositories-list .repository-item > div.relay-point-address, +.repositories-list .repository-item > div.repository-address { + width: 32%; + background: #f8f8f8; +} + +.relay-points-list .relay-point-item > div.relay-point-address > p, +.relay-points-list .relay-point-item > div.repository-address > p, +.relay-points-list .repository-item > div.relay-point-address > p, +.relay-points-list .repository-item > div.repository-address > p, +.repositories-list .relay-point-item > div.relay-point-address > p, +.repositories-list .relay-point-item > div.repository-address > p, +.repositories-list .repository-item > div.relay-point-address > p, +.repositories-list .repository-item > div.repository-address > p { + display: block; +} + +.relay-points-list .relay-point-item > div.relay-point-details, +.relay-points-list .relay-point-item > div.repository-details, +.relay-points-list .repository-item > div.relay-point-details, +.relay-points-list .repository-item > div.repository-details, +.repositories-list .relay-point-item > div.relay-point-details, +.repositories-list .relay-point-item > div.repository-details, +.repositories-list .repository-item > div.relay-point-details, +.repositories-list .repository-item > div.repository-details { + width: 44%; +} + +.relay-points-list .relay-point-item > div.relay-point-details p, +.relay-points-list .relay-point-item > div.repository-details p, +.relay-points-list .repository-item > div.relay-point-details p, +.relay-points-list .repository-item > div.repository-details p, +.repositories-list .relay-point-item > div.relay-point-details p, +.repositories-list .relay-point-item > div.repository-details p, +.repositories-list .repository-item > div.relay-point-details p, +.repositories-list .repository-item > div.repository-details p { + display: inline; +} + +.relay-points-list .relay-point-item > div.relay-point-action, +.relay-points-list .relay-point-item > div.repository-action, +.relay-points-list .repository-item > div.relay-point-action, +.relay-points-list .repository-item > div.repository-action, +.repositories-list .relay-point-item > div.relay-point-action, +.repositories-list .relay-point-item > div.repository-action, +.repositories-list .repository-item > div.relay-point-action, +.repositories-list .repository-item > div.repository-action { + width: 10%; + text-align: center; +} + +.relay-points-list .relay-point-item > div.relay-point-action > div, +.relay-points-list .relay-point-item > div.repository-action > div, +.relay-points-list .repository-item > div.relay-point-action > div, +.relay-points-list .repository-item > div.repository-action > div, +.repositories-list .relay-point-item > div.relay-point-action > div, +.repositories-list .relay-point-item > div.repository-action > div, +.repositories-list .repository-item > div.relay-point-action > div, +.repositories-list .repository-item > div.repository-action > div { + margin-bottom: 10px; +} + +.relay-points-list .relay-point-item > div.relay-point-action .location-code, +.relay-points-list .relay-point-item > div.repository-action .location-code, +.relay-points-list .repository-item > div.relay-point-action .location-code, +.relay-points-list .repository-item > div.repository-action .location-code, +.repositories-list .relay-point-item > div.relay-point-action .location-code, +.repositories-list .relay-point-item > div.repository-action .location-code, +.repositories-list .repository-item > div.relay-point-action .location-code, +.repositories-list .repository-item > div.repository-action .location-code { + font-size: 16px; + font-weight: bold; + text-transform: uppercase; +} + +.relay-points-list .relay-point-item > div.relay-point-action .location-nb, +.relay-points-list .relay-point-item > div.repository-action .location-nb, +.relay-points-list .repository-item > div.relay-point-action .location-nb, +.relay-points-list .repository-item > div.repository-action .location-nb, +.repositories-list .relay-point-item > div.relay-point-action .location-nb, +.repositories-list .relay-point-item > div.repository-action .location-nb, +.repositories-list .repository-item > div.relay-point-action .location-nb, +.repositories-list .repository-item > div.repository-action .location-nb { + background: url("../img/modal/location-point.png") center no-repeat; + height: 34px; + line-height: 25px; + color: white; + font-weight: bold; + width: 21px; + display: inline-block; + vertical-align: middle; +} + +.lt-ie8 .relay-points-list .relay-point-item > div.relay-point-action .location-nb, +.lt-ie8 .relay-points-list .relay-point-item > div.repository-action .location-nb, +.lt-ie8 .relay-points-list .repository-item > div.relay-point-action .location-nb, +.lt-ie8 .relay-points-list .repository-item > div.repository-action .location-nb, +.lt-ie8 .repositories-list .relay-point-item > div.relay-point-action .location-nb, +.lt-ie8 .repositories-list .relay-point-item > div.repository-action .location-nb, +.lt-ie8 .repositories-list .repository-item > div.relay-point-action .location-nb, +.lt-ie8 .repositories-list .repository-item > div.repository-action .location-nb { + display: inline; + zoom: 1; +} + +.relay-points-list .relay-point-item > div.relay-point-action .location-distance, +.relay-points-list .relay-point-item > div.repository-action .location-distance, +.relay-points-list .repository-item > div.relay-point-action .location-distance, +.relay-points-list .repository-item > div.repository-action .location-distance, +.repositories-list .relay-point-item > div.relay-point-action .location-distance, +.repositories-list .relay-point-item > div.repository-action .location-distance, +.repositories-list .repository-item > div.relay-point-action .location-distance, +.repositories-list .repository-item > div.repository-action .location-distance { + font-size: 14px; + font-weight: bold; + color: white; + background: #ea661d; +} + +.shipping-method-info { + padding: 15px; +} + +.shipping-method-info-name { + font-weight: bold; +} + +.shipping-method-info-details { + margin-top: 10px; +} + +.shipping-method-info-time > p { + display: inline-block; + vertical-align: middle; +} + +.relay-point-time p, +.repository-time p { + display: inline-block; + *display: inline; + *z-index: 1; +} + +.lt-ie8 .shipping-method-info-time > p { + display: inline; + zoom: 1; +} + +.shipping-method-info-select { + margin-top: 10px +} + +/* TNT Service description */ +#order .delivery_option > div > table.resume td.delivery_option_info_tnt i{ + font-style: italic; +} + +/* TNT delivery logo */ +#order .delivery_option > div > table.resume td.delivery_option_logo_tnt, +#order-opc .delivery_option > div > table.resume td.delivery_option_logo_tnt { + padding: 0; +} + +table.resume tbody > tr > td.delivery_option_radio, +table.resume tbody > tr > td.delivery_option_logo { + vertical-align: middle; +} + +/* TNT radio or checkbox input */ +input[type="radio"].tnt_carrier_radio,input[type="checkbox"].tnt_carrier_radio { + display:inline-block; +} + +table.resume td.delivery_option_logo_tnt > img.order_carrier_logo { + max-width: 100%; + min-width: 48px; + max-height: none; + margin: 0 auto; + display: block; +} + + +@media (max-width: 770px) { + .relay-points-header, .repositories-header { + background-position: 50% 0; + background-size: auto 50px; + display: block; + height: auto; + margin-bottom: 10px; + margin-right: 0; + padding-top: 10px; + text-align: center; + vertical-align: middle + } + + .relay-points-header h2, .repositories-header h2 { + background: transparent none repeat scroll 0 0; + display: inline; + font-size: 16px; + line-height: inherit; + margin-bottom: 0; + margin-left: 0; + margin-right: 0; + padding-left: 0; + position: relative + } + + .relay-points-container .relay-points-form > span, + .relay-points-container .repositories-form > span, + .repositories-container .relay-points-form > span, + .repositories-container .repositories-form > span { + display: block + } + + .relay-points-container .relay-points-form .form-list, + .relay-points-container .repositories-form .form-list, + .repositories-container .relay-points-form .form-list, + .repositories-container .repositories-form .form-list { + display: block + } + + .relay-points-container .relay-points-form .form-list .fields, + .relay-points-container .relay-points-form .form-list .field, + .relay-points-container .relay-points-form .form-list input, + .relay-points-container .relay-points-form .form-list select, + .relay-points-container .repositories-form .form-list .fields, + .relay-points-container .repositories-form .form-list .field, + .relay-points-container .repositories-form .form-list input, + .relay-points-container .repositories-form .form-list select, + .repositories-container .relay-points-form .form-list .fields, + .repositories-container .relay-points-form .form-list .field, + .repositories-container .relay-points-form .form-list input, + .repositories-container .relay-points-form .form-list select, + .repositories-container .repositories-form .form-list .fields, + .repositories-container .repositories-form .form-list .field, + .repositories-container .repositories-form .form-list input, + .repositories-container .repositories-form .form-list select { + margin: 0 + } + + .relay-points-container .relay-points-form .form-list .field, + .relay-points-container .repositories-form .form-list .field, + .repositories-container .relay-points-form .form-list .field, + .repositories-container .repositories-form .form-list .field { + overflow: hidden; + padding-top: 6px; + width: 100% + } + + .relay-points-container .relay-points-form .form-list .field label, + .relay-points-container .repositories-form .form-list .field label, + .repositories-container .relay-points-form .form-list .field label, + .repositories-container .repositories-form .form-list .field label { + width: 15% + } + + .relay-points-container .relay-points-form .form-list .field .input-box, + .relay-points-container .repositories-form .form-list .field .input-box, + .repositories-container .relay-points-form .form-list .field .input-box, + .repositories-container .repositories-form .form-list .field .input-box { + width: 20% + } + + .relay-points-container .relay-points-form .form-list .field input, + .relay-points-container .relay-points-form .form-list .field select, + .relay-points-container .repositories-form .form-list .field input, + .relay-points-container .repositories-form .form-list .field select, + .repositories-container .relay-points-form .form-list .field input, + .repositories-container .relay-points-form .form-list .field select, + .repositories-container .repositories-form .form-list .field input, + .repositories-container .repositories-form .form-list .field select { + display: block; + margin: 0; + width: 100% + } + + .relay-points-container .relay-points-form .form-list button[type="submit"], + .relay-points-container .repositories-form .form-list button[type="submit"], + .repositories-container .relay-points-form .form-list button[type="submit"], + .repositories-container .repositories-form .form-list button[type="submit"] { + text-align: center; + width: 100% + } + + .relay-points-container .relay-points-form .form-list button[type="submit"] span, + .relay-points-container .repositories-form .form-list button[type="submit"] span, + .repositories-container .relay-points-form .form-list button[type="submit"] span, + .repositories-container .repositories-form .form-list button[type="submit"] span { + display: block + } + + .relay-points-container #list_scrollbar_container, + .repositories-container #list_scrollbar_container { + display: block; + float: none; + width: 100% !important + } + + .relay-points-container #list_scrollbar_container .relay-point-address, + .relay-points-container #list_scrollbar_container .relay-point-details, + .relay-points-container #list_scrollbar_container .relay-point-action, + .relay-points-container #list_scrollbar_container .repository-address, + .relay-points-container #list_scrollbar_container .repository-details, + .relay-points-container #list_scrollbar_container .repository-action, + .repositories-container #list_scrollbar_container .relay-point-address, + .repositories-container #list_scrollbar_container .relay-point-details, + .repositories-container #list_scrollbar_container .relay-point-action, + .repositories-container #list_scrollbar_container .repository-address, + .repositories-container #list_scrollbar_container .repository-details, + .repositories-container #list_scrollbar_container .repository-action { + display: block; + width: 100% + } + + .relay-points-container #list_scrollbar_container div.relay-point-address, + .relay-points-container #list_scrollbar_container div.relay-point-details, + .repositories-container #list_scrollbar_container div.relay-point-address, + .repositories-container #list_scrollbar_container div.relay-point-details, + .relay-points-container #list_scrollbar_container .relay-point-action, + .relay-points-container #list_scrollbar_container .repository-action, + .repositories-container #list_scrollbar_container .relay-point-action, + .repositories-container #list_scrollbar_container .repository-action { + font-size: 1em; + line-height: normal; + padding: 0.825em 0; + } + + .relay-points-container #list_scrollbar_container li.relay-point-item p, + .repositories-container #list_scrollbar_container li.relay-point-item p { + margin: 0 0 0.75ex; + } + + .relay-points-container #list_scrollbar_container .relay-point-action .location-nb, + .relay-points-container #list_scrollbar_container .repository-action .location-nb, + .repositories-container #list_scrollbar_container .relay-point-action .location-nb, + .repositories-container #list_scrollbar_container .repository-action .location-nb { + display: block; + width: 100% + } + + .relay-points-container #list_scrollbar_container .relay-point-action .location-distance, + .relay-points-container #list_scrollbar_container .repository-action .location-distance, + .repositories-container #list_scrollbar_container .relay-point-action .location-distance, + .repositories-container #list_scrollbar_container .repository-action .location-distance { + padding: 0 10px; + display: inline-block; + vertical-align: middle + } + + .lt-ie8 .relay-points-container #list_scrollbar_container .relay-point-action .location-distance, + .lt-ie8 .relay-points-container #list_scrollbar_container .repository-action .location-distance, + .lt-ie8 .repositories-container #list_scrollbar_container .relay-point-action .location-distance, + .lt-ie8 .repositories-container #list_scrollbar_container .repository-action .location-distance { + display: inline; + zoom: 1 + } + + .relay-points-container #list_scrollbar_container .relay-point-item, + .relay-points-container #list_scrollbar_container .repositories-item, + .repositories-container #list_scrollbar_container .relay-point-item, + .repositories-container #list_scrollbar_container .repositories-item { + display: block; + text-align: center !important + } + + .relay-points-container #list_scrollbar_container .please-wait, + .repositories-container #list_scrollbar_container .please-wait { + margin-bottom: 15px; + margin-left: 0 !important; + margin-right: 0 !important; + margin-top: 0 !important; + display: inline-block; + vertical-align: middle + } + + .lt-ie8 .relay-points-container #list_scrollbar_container .please-wait, + .lt-ie8 .repositories-container #list_scrollbar_container .please-wait { + display: inline; + zoom: 1 + } + + .relay-points-container .relay-points-map, .relay-points-container .repositories-map, + .repositories-container .relay-points-map, .repositories-container .repositories-map { + display: none !important + } + + .relay-points .addresses-list, .repositories .addresses-list { + top: 204px; + } + + .lv_contentBottom { + overflow: hidden + } +} + +@media (max-width: 320px) { + .relay-points-container #list_scrollbar_container div.relay-point-address, + .relay-points-container #list_scrollbar_container div.relay-point-details, + .repositories-container #list_scrollbar_container div.relay-point-address, + .repositories-container #list_scrollbar_container div.relay-point-details, + .relay-points-container #list_scrollbar_container .relay-point-action, + .relay-points-container #list_scrollbar_container .repository-action, + .repositories-container #list_scrollbar_container .relay-point-action, + .repositories-container #list_scrollbar_container .repository-action { + font-size: 0.925em; + line-height: normal; + padding: 0.825em 0; + } + + .relay-points-container #list_scrollbar_container li.relay-point-item p, + .repositories-container #list_scrollbar_container li.relay-point-item p { + margin: 0 0 0.5ex; + } +} + + +@media (min-width: 770px) and (max-width: 979px) { + .location-topbar .relay-points-form .field, + .location-topbar .repositories-form .field { + display: block; + float: none + } + + .location-topbar .relay-points-form .field label, + .location-topbar .repositories-form .field label { + width: 40% + } + + .location-topbar .relay-points-form .field .input-box, + .location-topbar .repositories-form .field .input-box { + width: 60% + } + + .location-topbar .relay-points-form button[type="submit"], + .location-topbar .repositories-form button[type="submit"] { + margin-top: 10px; + text-align: center; + width: 100% + } + + .location-topbar .relay-points-form button[type="submit"] span, + .location-topbar .repositories-form button[type="submit"] span { + display: block + } + + .relay-points .addresses-list, .repositories .addresses-list { + top: 212px; + } +} diff --git a/www/modules/tntofficiel/views/css/extraAddressData.css b/www/modules/tntofficiel/views/css/extraAddressData.css new file mode 100644 index 00000000..b36bcc16 --- /dev/null +++ b/www/modules/tntofficiel/views/css/extraAddressData.css @@ -0,0 +1,31 @@ +#loading { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(255, 255, 255, 0.2); + z-index: 10000000; +} + +#loading img { + display: block; + margin: 0 auto; + position: relative; + top: 50%; + -webkit-transform: translateY(-50%); + -moz-transform: translateY(-50%); + -ms-transform: translateY(-50%); + -o-transform: translateY(-50%); + transform: translateY(-50%); +} + +span.required:after { + content: " *"; + color: red; +} + +p.required { + text-align: right; + color: red; +} diff --git a/www/modules/tntofficiel/views/css/index.php b/www/modules/tntofficiel/views/css/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/css/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/css/manifest.css b/www/modules/tntofficiel/views/css/manifest.css new file mode 100644 index 00000000..e209998f --- /dev/null +++ b/www/modules/tntofficiel/views/css/manifest.css @@ -0,0 +1,60 @@ +.tablehead{ + padding: 10px; + border-bottom: solid black 5px; + border-top: solid black 5px; +} + +.parcels{ + font-size: smaller; + padding: 5px; +} + +.title { + text-align: center; + text-decoration: underline; + font-weight: normal; + font-size: 11pt; +} + +.body { + font-size: 9pt; +} + +.bold { + font-weight: bold; +} + +.uppercase { + text-transform: uppercase; +} + +.logo-container, .pagination-container { + text-align: right; +} + +.table-header td { + width: 33%; +} + +.parcels-table-container { + border: 1px solid white; +} +.parcels-table-container tr, .parcels-table-container td { + border: 1px solid white; +} + +.parcels td { + font-size: 9pt; + padding: 10px 0; + margin: 10px 0; +} + +.footer-text { + margin: 0; + padding: 0; + font-size: 18px; +} + +.signature { + margin-top: 30px; +} \ No newline at end of file diff --git a/www/modules/tntofficiel/views/css/style.css b/www/modules/tntofficiel/views/css/style.css new file mode 100644 index 00000000..bca9fe59 --- /dev/null +++ b/www/modules/tntofficiel/views/css/style.css @@ -0,0 +1,39 @@ +@font-face { + font-family: 'tnt-middleware'; + src: url(data:font/opentype;base64,AAEAAAALAIAAAwAwT1MvMg8SAioAAAC8AAAAYGNtYXAaVsyHAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZmP9ZCYAAAF4AAAD9GhlYWQHJ9nNAAAFbAAAADZoaGVhB8IDxgAABaQAAAAkaG10eAoAACUAAAXIAAAAFGxvY2EAKAIOAAAF3AAAAAxtYXhwABEBcwAABegAAAAgbmFtZdobW84AAAYIAAAB2nBvc3QAAwAAAAAH5AAAACAAAwMAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADmAAPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg5gD//f//AAAAAAAg5gD//f//AAH/4xoEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAALACUACQQAAy4ADAA7AEgAaQB2AJcBDQEmATIBSwFwAAABIgYVFBYzMjY1NCYjFxQGKwEiJiMwJicuATEVFAYrASImPQE0NjsBMhYzMBYXFBYxNTQ2MzAyMzIWHQEnIgYVFBYzMjY1NCYjFxQGKwEqATEVFAYrASImPQEwIisBIiY9ATQ2OwEyFh0BJSIGFRQWMzI2NTQmIxcUBisBIiYxFRQGKwEiJj0BMAYrASImPQE0NjsBMhYdARM0JicuASMhIgYHDgEdASMiBgcOAQ8BDgEHDgEHDgEHFAYVHAEVHAEdASIGBw4BFRQWFx4BFx4BFx4BFzIWMzoBMzoBOwEUFhceATMyNjc+ATUzFBYXHgEzMjY3PgE1OgEzOgEzMjYzPgE3PgE3PgE3PgE1ETEBDgEjIiYnLgE1NDY3PgEzMhYXHgEVFAYHEyM1NDY/AT4BOwEVAQ4BIyImJy4BNTQ2Nz4BMzIWFx4BFRQGBxMiJicOASMiJicOASMiJjU0NjMyFhc+ATMyFhc+ATMyFhUUBiMCtyMzMyMjMjIjLgIBFAEBASMBAQECARYBAgIBEwECASICAgIBFAIBAvIjMjIjIzIyIywBAhUCBAEBGAEBAwIWAgEBAlICAQFcJDIyJCMyMiMsAgEVAgQCARcBAgICFwECAgFTAQJZBQYFDQj9twcNBQYFXAcRCQkPBXEEBgMDBAEBAgEBBw0GBQUBAQEEAwIFAgIHBAUHAQIHBgUHASQWFRYzHx40FRUW2xYVFjMfHjQVFRYBBgYFCAECBgUFBwICBAMDBAEBAf1YCxoODxoLCwsLCwsaDw4aCwsLCwsW3AMCcAIHA1sB6gsaDg8aCwsLCwsLGg8OGgsLCwsLIyA0Dg40ICA0Dg40IC5AQC4gNA4ONCAgNA4ONCAtQUEtAjoyIyQyMiQjMoQBAgEwAQIDNAECAgFdAgEBMAEBBDQCAQECXYQyIyQyMiQjMjsBAkkBAgIBSQIBEwECAgETOzIjJDIyJCMyOwECAUoBAgIBSgECARMBAgIBEwEKCAwGBQYGBQYMCG4DBAQJBXEECQUECQQECgcHCgMDCwgHCgO2BgUGDQcECAMDBgICAwECAQEBHjQVFRYWFRU0Hh40FRUWFhUVNB4BAQECAQMCAgYDAwgEAkn9XwsLCwsLGg4PGgsLCwsLCxoPDhoLAVgRBAYDbwMCkv6oCwsLCwsaDg8aCwsLCwsLGg8OGgsBDiEbGyEhGxshQS4tQSEaGiEhGhohQS0uQQAAAQAAAAEAADznI0NfDzz1AAsEAAAAAADSBMrRAAAAANIEytEAAAAABAADLgAAAAgAAgAAAAAAAAABAAADwP/AAAAEAAAAAAAEAAABAAAAAAAAAAAAAAAAAAAABQQAAAAAAAAAAAAAAAIAAAAEAAAlAAAAAAAKABQAHgH6AAEAAAAFAXEACwAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAOAK4AAQAAAAAAAQAOAAAAAQAAAAAAAgAHAJ8AAQAAAAAAAwAOAEsAAQAAAAAABAAOALQAAQAAAAAABQALACoAAQAAAAAABgAOAHUAAQAAAAAACgAaAN4AAwABBAkAAQAcAA4AAwABBAkAAgAOAKYAAwABBAkAAwAcAFkAAwABBAkABAAcAMIAAwABBAkABQAWADUAAwABBAkABgAcAIMAAwABBAkACgA0APh0bnQtbWlkZGxld2FyZQB0AG4AdAAtAG0AaQBkAGQAbABlAHcAYQByAGVWZXJzaW9uIDEuMABWAGUAcgBzAGkAbwBuACAAMQAuADB0bnQtbWlkZGxld2FyZQB0AG4AdAAtAG0AaQBkAGQAbABlAHcAYQByAGV0bnQtbWlkZGxld2FyZQB0AG4AdAAtAG0AaQBkAGQAbABlAHcAYQByAGVSZWd1bGFyAFIAZQBnAHUAbABhAHJ0bnQtbWlkZGxld2FyZQB0AG4AdAAtAG0AaQBkAGQAbABlAHcAYQByAGVGb250IGdlbmVyYXRlZCBieSBJY29Nb29uLgBGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABJAGMAbwBNAG8AbwBuAC4AAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('opentype'); + font-weight: normal; + font-style: normal; +} + +[class^="icon-AdminTNTOfficiel"], [class*=" icon-AdminTNTOfficiel"] { + font-family: 'tnt-middleware'; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + text-align: center; + + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-AdminTNTOfficiel:before { + content: "\e600"; +} + +.bootstrap .alert.alert-danger.alert-danger-small, .bootstrap .alert.alert-success.alert-danger-small{ + display: inline-block; + padding: 5px; + margin-bottom: 0px; +} + +.bootstrap .alert.alert-danger.alert-danger-small::before, .bootstrap .alert.alert-success.alert-danger-small::before { + content: ""; +} + +.export-logs { + padding: 10px; +} \ No newline at end of file diff --git a/www/modules/tntofficiel/views/css/tracking.css b/www/modules/tntofficiel/views/css/tracking.css new file mode 100644 index 00000000..b845c4b7 --- /dev/null +++ b/www/modules/tntofficiel/views/css/tracking.css @@ -0,0 +1,208 @@ +/* Tracking Popup */ +div { + font-family: 'Open Sans', sans-serif; +} + +div.header { + background-color:#f59b48; + border-color: #f59b48; + color: #ffffff ; + height : 60px; + width: 100%; + padding: -20px; +} + +div.header div.title { + margin-left: 10px; + font-size: 25px; + text-transform: uppercase; + display: inline-block; + vertical-align: top; + margin-top: 10px; +} + +div.header div.tnt-logo { + width: 100px; + height: 40px; + background: url("../img/_r2_c2.jpg") 0 0 no-repeat; + margin-left: 15px; + margin-top: 13px; + display: inline-block; +} + +div.header a.close { + text-decoration: none; + background: url("../img/_r2_c4.jpg") 0 0 no-repeat; + float: right; + width: 24px; + height: 24px; + margin-top: 18px; + margin-right: 15px; + display: inline-block; +} + + +div.tracklist { + margin-bottom: 50px; +} + +div.header-track { + margin-top: 20px; + border: 1px solid #d3d3d3; + border-radius: 3px; + background-color: #F5F5F5; + width: 100%; + padding: 0px 5px 5px 5px; + box-sizing: border-box; +} + + + + +div.header-track div { + vertical-align: middle; +} + +div.header-track div.button { + font-weight: bold; + color: #ffffff; + background-color: #1cb3f4; + font-size : 13px; + text-align: right; + text-transform: none; + padding: 12px 20px 2px 25px; + text-align: right; + border-radius: 3px; + margin: 4px 20px 2px 108px; + height: 30px; +} + +div.header-track div.button a { + color: #ffffff; + height: 15px; + +} + +div.header-track div.track-label { + display: inline-block; + font-weight: bold; + font-size: 16px; + width: 175px; + padding-left: 10px; +} + +div.header-track div.track-number { + display: inline-block; + font-weight: bold; + font-size: 15px; + background-color: #ffffff; + border-radius: 3px; + border: 1px solid #d3d3d3; + padding: 2px 2px 2px 7px; + height: 30px; + width: 180px; + margin: 10px 2px 2px 0px; +} + +div.status-track p { + margin-top: 20px; + padding-left: 10px; + font-weight: bold; + font-size: 15px; + margin-bottom: 20px; +} + +div.status-track li.status { + display: inline-block; + background-color: #d3d3d3; + color: #7F7F7F; + margin: 2px; + border-radius: 3px; + font-size: 13px; + font-weight: 600; + height: 36px; + padding: 7px 17px; + line-height: 33px; +} + +div.status-track ul li.current { + display: inline-block; + background-color: #1cb3f4; + color: #ffffff; +} + +.history-track { + margin-bottom: 30px; +} + +.history-track ul li { + margin-top: 15px; + display: block; +} + +.history-track ul li ul li { + display: inline-block; +} + +.history-track ul li ul li.label { + width: 250px; + color: #000000; + +} + +.history-track ul li ul { + margin-left: 10px; +} + +.history-track ul li ul li.date , .history-track ul li ul li.center { + font-weight: bold; + font-size: 13px ; +} + +.history-track ul li ul li.index { + font-weight: bold; + font-size: 12px; + line-height: 16px; + border-radius: 50px; + background-color: #f59b48; + width: 16px; + height: 16px; + color: #ffffff; + text-align: center; + padding: 3px; +} + + +div.button { + font-weight: bold; + color: #ffffff; + background-color: #1cb3f4; + font-size : 13px; + text-align: right; + text-transform: none; + padding: 7px 20px 2px 25px; + border-radius: 3px; + margin: 10px 3px 2px 0px; + height: 30px; + float: right; +} + +div.tnt-arrow { + width: 10px; + height: 16px; + background: url("../img/arrow.png") 0 0 no-repeat; + display: inline-block; + margin-left: 10px; +} + +div.header-track div.button a { + text-decoration: none; +} + +div.footer-track div.button { + padding: 11px 20px 2px 25px; +} +div.footer-track div.button a{ + color: #ffffff; + text-decoration: none; +} \ No newline at end of file diff --git a/www/modules/tntofficiel/views/fonts/index.php b/www/modules/tntofficiel/views/fonts/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/fonts/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/fonts/tnt-middleware.eot b/www/modules/tntofficiel/views/fonts/tnt-middleware.eot new file mode 100644 index 00000000..ead1e602 Binary files /dev/null and b/www/modules/tntofficiel/views/fonts/tnt-middleware.eot differ diff --git a/www/modules/tntofficiel/views/fonts/tnt-middleware.svg b/www/modules/tntofficiel/views/fonts/tnt-middleware.svg new file mode 100644 index 00000000..cb955c15 --- /dev/null +++ b/www/modules/tntofficiel/views/fonts/tnt-middleware.svg @@ -0,0 +1,11 @@ + + + +Generated by IcoMoon + + + + + + + \ No newline at end of file diff --git a/www/modules/tntofficiel/views/fonts/tnt-middleware.ttf b/www/modules/tntofficiel/views/fonts/tnt-middleware.ttf new file mode 100644 index 00000000..b7ea657a Binary files /dev/null and b/www/modules/tntofficiel/views/fonts/tnt-middleware.ttf differ diff --git a/www/modules/tntofficiel/views/fonts/tnt-middleware.woff b/www/modules/tntofficiel/views/fonts/tnt-middleware.woff new file mode 100644 index 00000000..5af17ebd Binary files /dev/null and b/www/modules/tntofficiel/views/fonts/tnt-middleware.woff differ diff --git a/www/modules/tntofficiel/views/img/AdminTNTOfficiel.gif b/www/modules/tntofficiel/views/img/AdminTNTOfficiel.gif new file mode 100644 index 00000000..8b2f8c17 Binary files /dev/null and b/www/modules/tntofficiel/views/img/AdminTNTOfficiel.gif differ diff --git a/www/modules/tntofficiel/views/img/_r2_c2.jpg b/www/modules/tntofficiel/views/img/_r2_c2.jpg new file mode 100644 index 00000000..ccebe470 Binary files /dev/null and b/www/modules/tntofficiel/views/img/_r2_c2.jpg differ diff --git a/www/modules/tntofficiel/views/img/_r2_c4.jpg b/www/modules/tntofficiel/views/img/_r2_c4.jpg new file mode 100644 index 00000000..7e05bf11 Binary files /dev/null and b/www/modules/tntofficiel/views/img/_r2_c4.jpg differ diff --git a/www/modules/tntofficiel/views/img/ajax-loader.gif b/www/modules/tntofficiel/views/img/ajax-loader.gif new file mode 100644 index 00000000..c97ec6ea Binary files /dev/null and b/www/modules/tntofficiel/views/img/ajax-loader.gif differ diff --git a/www/modules/tntofficiel/views/img/arrow.png b/www/modules/tntofficiel/views/img/arrow.png new file mode 100644 index 00000000..4ea53b4e Binary files /dev/null and b/www/modules/tntofficiel/views/img/arrow.png differ diff --git a/www/modules/tntofficiel/views/img/carrier.jpg b/www/modules/tntofficiel/views/img/carrier.jpg new file mode 100644 index 00000000..92d5fabb Binary files /dev/null and b/www/modules/tntofficiel/views/img/carrier.jpg differ diff --git a/www/modules/tntofficiel/views/img/carrier/delivery/index.php b/www/modules/tntofficiel/views/img/carrier/delivery/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/img/carrier/delivery/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/img/carrier/delivery/option-ChezVous.png b/www/modules/tntofficiel/views/img/carrier/delivery/option-ChezVous.png new file mode 100644 index 00000000..6dfc7be0 Binary files /dev/null and b/www/modules/tntofficiel/views/img/carrier/delivery/option-ChezVous.png differ diff --git a/www/modules/tntofficiel/views/img/carrier/delivery/option-Entreprise.png b/www/modules/tntofficiel/views/img/carrier/delivery/option-Entreprise.png new file mode 100644 index 00000000..fe2be50e Binary files /dev/null and b/www/modules/tntofficiel/views/img/carrier/delivery/option-Entreprise.png differ diff --git a/www/modules/tntofficiel/views/img/carrier/delivery/option-RelaisColis.png b/www/modules/tntofficiel/views/img/carrier/delivery/option-RelaisColis.png new file mode 100644 index 00000000..3ba9ac9f Binary files /dev/null and b/www/modules/tntofficiel/views/img/carrier/delivery/option-RelaisColis.png differ diff --git a/www/modules/tntofficiel/views/img/carrier/index.php b/www/modules/tntofficiel/views/img/carrier/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/img/carrier/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/img/carrier/tntofficiel.jpg b/www/modules/tntofficiel/views/img/carrier/tntofficiel.jpg new file mode 100644 index 00000000..ad458c54 Binary files /dev/null and b/www/modules/tntofficiel/views/img/carrier/tntofficiel.jpg differ diff --git a/www/modules/tntofficiel/views/img/depot_r8_c2.jpg b/www/modules/tntofficiel/views/img/depot_r8_c2.jpg new file mode 100644 index 00000000..c7f3a1fe Binary files /dev/null and b/www/modules/tntofficiel/views/img/depot_r8_c2.jpg differ diff --git a/www/modules/tntofficiel/views/img/domicile_r4_c2.jpg b/www/modules/tntofficiel/views/img/domicile_r4_c2.jpg new file mode 100644 index 00000000..23d52797 Binary files /dev/null and b/www/modules/tntofficiel/views/img/domicile_r4_c2.jpg differ diff --git a/www/modules/tntofficiel/views/img/entreprise_r2_c2.jpg b/www/modules/tntofficiel/views/img/entreprise_r2_c2.jpg new file mode 100644 index 00000000..677812e5 Binary files /dev/null and b/www/modules/tntofficiel/views/img/entreprise_r2_c2.jpg differ diff --git a/www/modules/tntofficiel/views/img/index.php b/www/modules/tntofficiel/views/img/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/img/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/img/modal/index.php b/www/modules/tntofficiel/views/img/modal/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/img/modal/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/img/modal/location-point-map.png b/www/modules/tntofficiel/views/img/modal/location-point-map.png new file mode 100644 index 00000000..0aca3108 Binary files /dev/null and b/www/modules/tntofficiel/views/img/modal/location-point-map.png differ diff --git a/www/modules/tntofficiel/views/img/modal/location-point.png b/www/modules/tntofficiel/views/img/modal/location-point.png new file mode 100644 index 00000000..951b2844 Binary files /dev/null and b/www/modules/tntofficiel/views/img/modal/location-point.png differ diff --git a/www/modules/tntofficiel/views/img/modal/marker/1.png b/www/modules/tntofficiel/views/img/modal/marker/1.png new file mode 100644 index 00000000..95a8a0ae Binary files /dev/null and b/www/modules/tntofficiel/views/img/modal/marker/1.png differ diff --git a/www/modules/tntofficiel/views/img/modal/marker/10.png b/www/modules/tntofficiel/views/img/modal/marker/10.png new file mode 100644 index 00000000..71af2ab7 Binary files /dev/null and b/www/modules/tntofficiel/views/img/modal/marker/10.png differ diff --git a/www/modules/tntofficiel/views/img/modal/marker/2.png b/www/modules/tntofficiel/views/img/modal/marker/2.png new file mode 100644 index 00000000..ce89cf1b Binary files /dev/null and b/www/modules/tntofficiel/views/img/modal/marker/2.png differ diff --git a/www/modules/tntofficiel/views/img/modal/marker/3.png b/www/modules/tntofficiel/views/img/modal/marker/3.png new file mode 100644 index 00000000..fb002192 Binary files /dev/null and b/www/modules/tntofficiel/views/img/modal/marker/3.png differ diff --git a/www/modules/tntofficiel/views/img/modal/marker/4.png b/www/modules/tntofficiel/views/img/modal/marker/4.png new file mode 100644 index 00000000..a2aee782 Binary files /dev/null and b/www/modules/tntofficiel/views/img/modal/marker/4.png differ diff --git a/www/modules/tntofficiel/views/img/modal/marker/5.png b/www/modules/tntofficiel/views/img/modal/marker/5.png new file mode 100644 index 00000000..aa5622b8 Binary files /dev/null and b/www/modules/tntofficiel/views/img/modal/marker/5.png differ diff --git a/www/modules/tntofficiel/views/img/modal/marker/6.png b/www/modules/tntofficiel/views/img/modal/marker/6.png new file mode 100644 index 00000000..7ef0e639 Binary files /dev/null and b/www/modules/tntofficiel/views/img/modal/marker/6.png differ diff --git a/www/modules/tntofficiel/views/img/modal/marker/7.png b/www/modules/tntofficiel/views/img/modal/marker/7.png new file mode 100644 index 00000000..d3119b44 Binary files /dev/null and b/www/modules/tntofficiel/views/img/modal/marker/7.png differ diff --git a/www/modules/tntofficiel/views/img/modal/marker/8.png b/www/modules/tntofficiel/views/img/modal/marker/8.png new file mode 100644 index 00000000..a4acb848 Binary files /dev/null and b/www/modules/tntofficiel/views/img/modal/marker/8.png differ diff --git a/www/modules/tntofficiel/views/img/modal/marker/9.png b/www/modules/tntofficiel/views/img/modal/marker/9.png new file mode 100644 index 00000000..12221769 Binary files /dev/null and b/www/modules/tntofficiel/views/img/modal/marker/9.png differ diff --git a/www/modules/tntofficiel/views/img/modal/marker/index.php b/www/modules/tntofficiel/views/img/modal/marker/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/img/modal/marker/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/img/modal/top-logo.png b/www/modules/tntofficiel/views/img/modal/top-logo.png new file mode 100644 index 00000000..2df498a7 Binary files /dev/null and b/www/modules/tntofficiel/views/img/modal/top-logo.png differ diff --git a/www/modules/tntofficiel/views/img/modal/top-picto.png b/www/modules/tntofficiel/views/img/modal/top-picto.png new file mode 100644 index 00000000..60281b73 Binary files /dev/null and b/www/modules/tntofficiel/views/img/modal/top-picto.png differ diff --git a/www/modules/tntofficiel/views/img/relais_r6_c2.jpg b/www/modules/tntofficiel/views/img/relais_r6_c2.jpg new file mode 100644 index 00000000..7b0f1391 Binary files /dev/null and b/www/modules/tntofficiel/views/img/relais_r6_c2.jpg differ diff --git a/www/modules/tntofficiel/views/js/address-city-check.js b/www/modules/tntofficiel/views/js/address-city-check.js new file mode 100644 index 00000000..d3ca1bff --- /dev/null +++ b/www/modules/tntofficiel/views/js/address-city-check.js @@ -0,0 +1,147 @@ +/** + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +$(document).ready(function () { + + // Remove the data-validate attribute from the city and postcode fields. + $("#postcode").removeAttr("data-validate"); + $("#city").removeAttr("data-validate"); + $("#postcode").removeClass("validate"); + $("#city").removeClass("validate"); + + // Create the FancyBox. + createFancyBox(); + + // When a city is selected. + $("#validateCity").on('click', function () { + // Actions to perform when a city is selected in the fancybox. + // put the value in the city field + $("#city").val($("#helper_city").val()); + // add the form-ok class to the city and postcode field + $("#city").parent().removeClass('form-error').addClass('form-ok'); + $("#postcode").parent().removeClass('form-error').addClass('form-ok'); + // close the fancybox + $.fancybox.close(); + // enable the save button + $("#submitAddress").removeClass("disabled"); + }); + + $("#add_address").on('submit', function (objEvent) { + var strPostalCode = $("#postcode").val(); + var boolIsPostalCodeCityValid = false; + + // Do not perform a check if the postcode or the city is not entered + if (strPostalCode.length < 1) { + return null; + } + + // call the middleware to check if the city match the CP. + var objJqXHR = $.ajax({ + "url": window.TNTOfficiel.link.front.module.checkAddressPostcodeCity, + "method": 'POST', + "data": { + "postcode": strPostalCode, + "city": $("#city").val(), + "countryId": $("#id_country").val() + }, + "async": false + }); + + objJqXHR + .done(function (mxdData, strTextStatus, objJqXHR) { + // handle the response from the ajax request. + var response = JSON.parse(mxdData); + //if the city match the postcode + //resultCode are defined in TntAddressModuleFrontController + switch (response.resultCode) { + // postcode/city is not valid. + case 0: + $("#city").parent().removeClass('form-ok').addClass('form-error'); + //display the fancybox + displayFancyBox(response.cities, strPostalCode); + break; + // postcode/city is valid. + case 1: + $("#city").parent().removeClass('form-error').addClass('form-ok'); + $("#postcode").parent().removeClass('form-error').addClass('form-ok'); + boolIsPostalCodeCityValid = true; + break; + // postcode/city does not require validation. + default: + boolIsPostalCodeCityValid = true; + } + }) + .fail(function (objJqXHR, strTextStatus, strErrorThrown) { + // console.error( objJqXHR.status + ' ' + objJqXHR.statusText ); + }) + .always(function () { + // if postal code and city is not correct. + if (!boolIsPostalCodeCityValid) { + objEvent.preventDefault(); + } + }); + }); +}); + + +/** + * insert the fancy box html into the page + */ +function createFancyBox() { + $("#page").append('\ +\ +
\ +
\ +

Sélectionnez votre ville

\ +
\ + \ + \ +
\ +
\ + \ + \ +
\ +

\ + \ +

\ +
\ +
' + ); +} + +/** + * Display the fancybox + */ +function displayFancyBox(arrArgCities, strArgPostCode) { + // fancybox configuration + $("a#fancybox_city_helper").fancybox({ + "transitionIn": 'elastic', + "transitionOut": 'elastic', + "type": 'inline', + "speedIn": 600, + "speedOut": 200, + "overlayShow": false, + "autoDimensions": true, + "helpers": { + overlay: {closeClick: false} + } + }); + + // Generate the options to be put in the city select field. + var strHTMLOptions = ""; + $.each(arrArgCities, function (index, city) { + strHTMLOptions += ""; + }); + + $("#helper_city").html(strHTMLOptions); + $("#helper_city").addClass("form-control"); + $("#helper_postcode").val(strArgPostCode); + $("a#fancybox_city_helper").trigger("click"); +} \ No newline at end of file diff --git a/www/modules/tntofficiel/views/js/adminTntOrders.js b/www/modules/tntofficiel/views/js/adminTntOrders.js new file mode 100644 index 00000000..2334227b --- /dev/null +++ b/www/modules/tntofficiel/views/js/adminTntOrders.js @@ -0,0 +1,20 @@ +/** + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +$(document).ready(function () { + $("#form-order button").on('click', function () { + var $elmtForm = $("#form-order"); + var strAttrAction = $elmtForm.attr('action'); + if (strAttrAction) { + strAttrAction = strAttrAction.replace('&submitBulkgetManifestorder', '').replace('&submitBulkgetBTorder', ''); + $elmtForm.attr('action', strAttrAction); + } + }); + +}); + diff --git a/www/modules/tntofficiel/views/js/deliveryPointsBox.js b/www/modules/tntofficiel/views/js/deliveryPointsBox.js new file mode 100644 index 00000000..8441cc63 --- /dev/null +++ b/www/modules/tntofficiel/views/js/deliveryPointsBox.js @@ -0,0 +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(); + } + } + } +} + diff --git a/www/modules/tntofficiel/views/js/displayAdminOrder.js b/www/modules/tntofficiel/views/js/displayAdminOrder.js new file mode 100644 index 00000000..58499a22 --- /dev/null +++ b/www/modules/tntofficiel/views/js/displayAdminOrder.js @@ -0,0 +1,277 @@ +/** + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +$(document).ready(function () { + $("#parcelsTbody").on('click', function (objEvent) { + var $elmt = $(objEvent.target); + if ($elmt.hasClass('removeParcel')) { + removeParcel($elmt.val()); + } + if ($elmt.hasClass('updateParcel')) { + updateParcel($elmt.val()); + } + }); + + $("#submitAddParcel").on('click', function () { + addParcel(); + }); + + $("a#fancyBoxAddParcelLink").fancybox({ + "afterClose": function () { + $("#addParcelFancyBox #addParcelError").hide(); + $("#addParcelWeight").val(""); + }, + "transitionIn": 'elastic', + "transitionOut": 'elastic', + "type": 'inline', + "speedIn": 600, + "speedOut": 200, + "overlayShow": false, + "autoDimensions": true, + "autoCenter": false, + "helpers": { + overlay: { + closeClick: false, + locked: false + } + } + }); + + $("input[id*='parcelWeight-']").on('change', function () { + var value = parseFloat($(this).val()); + if (value.toFixed(1) == 0.0) { + value = 0.1; + } + $(this).val(value.toFixed(1)); + }); + + $('#shipping_date').datepicker({ + "minDate": startDate, + "dateFormat": 'dd/mm/yy', + "onSelect": function () { + $('#formAdminShippingDatePanel .alert').hide(); + $('.waitimage').show(); + var data = {}; + data['orderId'] = id_order; + data['shippingDate'] = $('#shipping_date').val(); + $.ajax({ + type: 'POST', + url: checkShippingDateValidUrl, + data: data, + global: false, + success: function (json) { + var data = jQuery.parseJSON(json); + if (data.error) { + if (data.error.length) { + $("#delivery-date-error").html(data.error); + } else { + $("#delivery-date-error").html('La date n\'est pas valide.'); + } + $("#delivery-date-error").show(); + return; + } + + if (data.dueDate) { + $("#due-date").html(data.dueDate); + } + + if (data.mdwMessage) { + $("#delivery-date-success").html(data.mdwMessage); + } else { + $("#delivery-date-success").html('La date est valide.'); + } + $("#delivery-date-success").show(); + + }, + error: function () { + $("#delivery-date-error").html('Une erreur s\'est produite, merci de réessayer dans quelques minutes.'); + $("#delivery-date-error").show(); + }, + complete: function () { + $('.waitimage').hide(); + } + }); + } + }); + + if (typeof shippingDate != 'undefined') { + $("#shipping_date").datepicker("setDate", shippingDate); + } + if (boolIsShipped) { + $("#shipping_date").datepicker("option", "disabled", true); + } + + if (!boolIsAddressEditable) { + $("#addressShipping form :input").attr("disabled", true); + $('#addressShipping a').css("cursor", "not-allowed"); + $('#addressShipping a').on('click', function (objEvent) { + objEvent.preventDefault(); + }); + } + + updateTotalWeight(); + +}); + +/** + * remove a parcel + * @param rowNumber + */ +function removeParcel(parcelId) { + var data = { + "parcelId": parcelId + }; + var parcelCount = getParcelRowCount(); + + if (parcelCount <= 1) { + $("#updateParcelErrorMessage-" + parcelId).html(atLeastOneParcelStr); + $("#parcelWeightError-" + parcelId).show(); + } + else { + $.ajax({ + type: 'POST', + url: removeParcelUrl, + data: data, + success: function (json) { + $("#row-parcel-" + parcelId).remove(); + updateTotalWeight(); + } + }); + } +} + +/** + * Update a parcel + * @param parcelId + */ +function updateParcel(parcelId) { + $("#parcelWeightError-" + parcelId).hide(); + $("#parcelWeightSuccess-" + parcelId).hide(); + var data = {}; + data['parcelId'] = parcelId; + data['weight'] = $("#parcelWeight-" + parcelId).val(); + data['orderId'] = id_order; + if (isNaN($("#parcelWeight-" + parcelId).val()) || $("#parcelWeight-" + parcelId).val() <= 0) { + $("#updateParcelErrorMessage-" + parcelId).html("Le poids n'est pas valide"); + $("#parcelWeightError-" + parcelId).show(); + } else { + $.ajax({ + type: 'POST', + url: updateParcelUrl, + data: data, + success: function (json) { + var response = JSON.parse(json); + if (!response.result) { + $("#updateParcelErrorMessage-" + parcelId).html(response.error); + $("#parcelWeightError-" + parcelId).show(); + } else { + $("#parcelWeight-" + parcelId).val(response.weight); + $("#parcelWeightSuccess-" + parcelId).show(); + updateTotalWeight(); + } + } + }); + } +} + +/** + * Add a parcel + */ +function addParcel() { + $("#addParcelFancyBox #addParcelError").hide(); + //check if the weight value is valid + if (isNaN($("#addParcelWeight").val()) || ($("#addParcelWeight").val() <= 0)) { + $("#addParcelFancyBox #addParcelErrorMessage").html("Le poids n'est pas valide"); + $("#addParcelFancyBox #addParcelError").show(); + } else { + var data = {}; + data['orderId'] = id_order; + data['weight'] = $("#addParcelWeight").val(); + $.ajax({ + type: 'POST', + url: addParcelUrl, + data: data, + success: function (json) { + var response = JSON.parse(json); + if (response.result) { + $.fancybox.close(); + addRowParcel(json); + updateTotalWeight(); + } else { + $("#addParcelFancyBox #addParcelErrorMessage").html(response.error); + $("#addParcelFancyBox #addParcelError").show(); + } + } + }); + } + +}; + +/** + * Get the TNT admin controller token + * @returns {*|jQuery} + */ +function getAdminTNTOfficielToken() { + return $("#AdminTNTOfficielToken").val(); +}; + +/** + * add a row in the parcels table + */ +function addRowParcel(json) { + var nextRowNumber = getNexttParcelNumber(); + var data = JSON.parse(json); + + $("#parcelsTbody").append('\ +\ + \ +
' + nextRowNumber + '
\ + \ + \ +  \ + \ + \ + \ + \ +  \ + \ + \ +'); + +} + +/* + * Add or update total weight + */ +function updateTotalWeight() { + var sum = 0; + $("[id*='parcelWeight-']").each(function () { + var value = $(this).val(); + // add only if the value is number + if (!isNaN(value) && value.length != 0) { + sum += parseFloat(value); + } + }); + $("#total-weight").html(sum); +} + +function getParcelRowCount() { + return $("#parcelsTable > #parcelsTbody tr").length++; +} + +function getNexttParcelNumber() { + return parseInt($("#parcelsTable > #parcelsTbody tr:last-child td:first-child div.input-group").html()) + 1 +} \ No newline at end of file diff --git a/www/modules/tntofficiel/views/js/index.php b/www/modules/tntofficiel/views/js/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/js/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/js/lib/index.php b/www/modules/tntofficiel/views/js/lib/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/js/lib/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/js/lib/kvz/index.php b/www/modules/tntofficiel/views/js/lib/kvz/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/js/lib/kvz/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/js/lib/kvz/phpjs/index.php b/www/modules/tntofficiel/views/js/lib/kvz/phpjs/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/js/lib/kvz/phpjs/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/js/lib/kvz/phpjs/url/base64_decode.js b/www/modules/tntofficiel/views/js/lib/kvz/phpjs/url/base64_decode.js new file mode 100644 index 00000000..c5f91c0c --- /dev/null +++ b/www/modules/tntofficiel/views/js/lib/kvz/phpjs/url/base64_decode.js @@ -0,0 +1,64 @@ +/** + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +function base64_decode(data) { + // discuss at: http://phpjs.org/functions/base64_decode/ + // original by: Tyler Akins (http://rumkin.com) + // improved by: Thunder.m + // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // input by: Aman Gupta + // input by: Brett Zamir (http://brett-zamir.me) + // bugfixed by: Onno Marsman + // bugfixed by: Pellentesque Malesuada + // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA=='); + // returns 1: 'Kevin van Zonneveld' + // example 2: base64_decode('YQ==='); + // returns 2: 'a' + // example 3: base64_decode('4pyTIMOgIGxhIG1vZGU='); + // returns 3: '✓ à la mode' + + var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, + ac = 0, + dec = '', + tmp_arr = []; + + if (!data) { + return data; + } + + data += ''; + + do { + // unpack four hexets into three octets using index points in b64 + h1 = b64.indexOf(data.charAt(i++)); + h2 = b64.indexOf(data.charAt(i++)); + h3 = b64.indexOf(data.charAt(i++)); + h4 = b64.indexOf(data.charAt(i++)); + + bits = h1 << 18 | h2 << 12 | h3 << 6 | h4; + + o1 = bits >> 16 & 0xff; + o2 = bits >> 8 & 0xff; + o3 = bits & 0xff; + + if (h3 == 64) { + tmp_arr[ac++] = String.fromCharCode(o1); + } else if (h4 == 64) { + tmp_arr[ac++] = String.fromCharCode(o1, o2); + } else { + tmp_arr[ac++] = String.fromCharCode(o1, o2, o3); + } + } while (i < data.length); + + dec = tmp_arr.join(''); + + return decodeURIComponent(escape(dec.replace(/\0+$/, ''))); +} \ No newline at end of file diff --git a/www/modules/tntofficiel/views/js/lib/kvz/phpjs/url/base64_encode.js b/www/modules/tntofficiel/views/js/lib/kvz/phpjs/url/base64_encode.js new file mode 100644 index 00000000..81cb9871 --- /dev/null +++ b/www/modules/tntofficiel/views/js/lib/kvz/phpjs/url/base64_encode.js @@ -0,0 +1,59 @@ +/** + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +function base64_encode(data) { + // discuss at: http://phpjs.org/functions/base64_encode/ + // original by: Tyler Akins (http://rumkin.com) + // improved by: Bayron Guevara + // improved by: Thunder.m + // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // improved by: Rafał Kukawski (http://kukawski.pl) + // bugfixed by: Pellentesque Malesuada + // example 1: base64_encode('Kevin van Zonneveld'); + // returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA==' + // example 2: base64_encode('a'); + // returns 2: 'YQ==' + // example 3: base64_encode('✓ à la mode'); + // returns 3: '4pyTIMOgIGxhIG1vZGU=' + + var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, + ac = 0, + enc = '', + tmp_arr = []; + + if (!data) { + return data; + } + + data = unescape(encodeURIComponent(data)); + + do { + // pack three octets into four hexets + o1 = data.charCodeAt(i++); + o2 = data.charCodeAt(i++); + o3 = data.charCodeAt(i++); + + bits = o1 << 16 | o2 << 8 | o3; + + h1 = bits >> 18 & 0x3f; + h2 = bits >> 12 & 0x3f; + h3 = bits >> 6 & 0x3f; + h4 = bits & 0x3f; + + // use hexets to index into b64, and append result to encoded string + tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); + } while (i < data.length); + + enc = tmp_arr.join(''); + + var r = data.length % 3; + + return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3); +} \ No newline at end of file diff --git a/www/modules/tntofficiel/views/js/lib/kvz/phpjs/url/index.php b/www/modules/tntofficiel/views/js/lib/kvz/phpjs/url/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/js/lib/kvz/phpjs/url/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/js/lib/nanoscroller/index.php b/www/modules/tntofficiel/views/js/lib/nanoscroller/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/js/lib/nanoscroller/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/js/lib/nanoscroller/jquery.nanoscroller.min.js b/www/modules/tntofficiel/views/js/lib/nanoscroller/jquery.nanoscroller.min.js new file mode 100644 index 00000000..6658830d --- /dev/null +++ b/www/modules/tntofficiel/views/js/lib/nanoscroller/jquery.nanoscroller.min.js @@ -0,0 +1,3 @@ +/*! nanoScrollerJS - v0.8.7 - (c) 2015 James Florentino; Licensed MIT */ + +!function(a){return"function"==typeof define&&define.amd?define(["jquery"],function(b){return a(b,window,document)}):"object"==typeof exports?module.exports=a(require("jquery"),window,document):a(jQuery,window,document)}(function(a,b,c){"use strict";var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H;z={paneClass:"nano-pane",sliderClass:"nano-slider",contentClass:"nano-content",enabledClass:"has-scrollbar",flashedClass:"flashed",activeClass:"active",iOSNativeScrolling:!1,preventPageScrolling:!1,disableResize:!1,alwaysVisible:!1,flashDelay:1500,sliderMinHeight:20,sliderMaxHeight:null,documentContext:null,windowContext:null},u="scrollbar",t="scroll",l="mousedown",m="mouseenter",n="mousemove",p="mousewheel",o="mouseup",s="resize",h="drag",i="enter",w="up",r="panedown",f="DOMMouseScroll",g="down",x="wheel",j="keydown",k="keyup",v="touchmove",d="Microsoft Internet Explorer"===b.navigator.appName&&/msie 7./i.test(b.navigator.appVersion)&&b.ActiveXObject,e=null,D=b.requestAnimationFrame,y=b.cancelAnimationFrame,F=c.createElement("div").style,H=function(){var a,b,c,d,e,f;for(d=["t","webkitT","MozT","msT","OT"],a=e=0,f=d.length;f>e;a=++e)if(c=d[a],b=d[a]+"ransform",b in F)return d[a].substr(0,d[a].length-1);return!1}(),G=function(a){return H===!1?!1:""===H?a:H+a.charAt(0).toUpperCase()+a.substr(1)},E=G("transform"),B=E!==!1,A=function(){var a,b,d;return a=c.createElement("div"),b=a.style,b.position="absolute",b.width="100px",b.height="100px",b.overflow=t,b.top="-9999px",c.body.appendChild(a),d=a.offsetWidth-a.clientWidth,c.body.removeChild(a),d},C=function(){var a,c,d;return c=b.navigator.userAgent,(a=/(?=.+Mac OS X)(?=.+Firefox)/.test(c))?(d=/Firefox\/\d{2}\./.exec(c),d&&(d=d[0].replace(/\D+/g,"")),a&&+d>23):!1},q=function(){function j(d,f){this.el=d,this.options=f,e||(e=A()),this.$el=a(this.el),this.doc=a(this.options.documentContext||c),this.win=a(this.options.windowContext||b),this.body=this.doc.find("body"),this.$content=this.$el.children("."+this.options.contentClass),this.$content.attr("tabindex",this.options.tabIndex||0),this.content=this.$content[0],this.previousPosition=0,this.options.iOSNativeScrolling&&null!=this.el.style.WebkitOverflowScrolling?this.nativeScrolling():this.generate(),this.createEvents(),this.addEvents(),this.reset()}return j.prototype.preventScrolling=function(a,b){if(this.isActive)if(a.type===f)(b===g&&a.originalEvent.detail>0||b===w&&a.originalEvent.detail<0)&&a.preventDefault();else if(a.type===p){if(!a.originalEvent||!a.originalEvent.wheelDelta)return;(b===g&&a.originalEvent.wheelDelta<0||b===w&&a.originalEvent.wheelDelta>0)&&a.preventDefault()}},j.prototype.nativeScrolling=function(){this.$content.css({WebkitOverflowScrolling:"touch"}),this.iOSNativeScrolling=!0,this.isActive=!0},j.prototype.updateScrollValues=function(){var a,b;a=this.content,this.maxScrollTop=a.scrollHeight-a.clientHeight,this.prevScrollTop=this.contentScrollTop||0,this.contentScrollTop=a.scrollTop,b=this.contentScrollTop>this.previousPosition?"down":this.contentScrollTop=a.maxScrollTop&&a.prevScrollTop!==a.maxScrollTop?a.$el.trigger("scrollend"):0===a.contentScrollTop&&0!==a.prevScrollTop&&a.$el.trigger("scrolltop"),!1}}(this),up:function(a){return function(b){return a.isBeingDragged=!1,a.pane.removeClass(a.options.activeClass),a.doc.unbind(n,a.events[h]).unbind(o,a.events[w]),a.body.unbind(m,a.events[i]),!1}}(this),resize:function(a){return function(b){a.reset()}}(this),panedown:function(a){return function(b){return a.sliderY=(b.offsetY||b.originalEvent.layerY)-.5*a.sliderHeight,a.scroll(),a.events.down(b),!1}}(this),scroll:function(a){return function(b){a.updateScrollValues(),a.isBeingDragged||(a.iOSNativeScrolling||(a.sliderY=a.sliderTop,a.setOnScrollStyles()),null!=b&&(a.contentScrollTop>=a.maxScrollTop?(a.options.preventPageScrolling&&a.preventScrolling(b,g),a.prevScrollTop!==a.maxScrollTop&&a.$el.trigger("scrollend")):0===a.contentScrollTop&&(a.options.preventPageScrolling&&a.preventScrolling(b,w),0!==a.prevScrollTop&&a.$el.trigger("scrolltop"))))}}(this),wheel:function(a){return function(b){var c;if(null!=b)return c=b.delta||b.wheelDelta||b.originalEvent&&b.originalEvent.wheelDelta||-b.detail||b.originalEvent&&-b.originalEvent.detail,c&&(a.sliderY+=-c/3),a.scroll(),!1}}(this),enter:function(a){return function(b){var c;if(a.isBeingDragged)return 1!==(b.buttons||b.which)?(c=a.events)[w].apply(c,arguments):void 0}}(this)}},j.prototype.addEvents=function(){var a;this.removeEvents(),a=this.events,this.options.disableResize||this.win.bind(s,a[s]),this.iOSNativeScrolling||(this.slider.bind(l,a[g]),this.pane.bind(l,a[r]).bind(""+p+" "+f,a[x])),this.$content.bind(""+t+" "+p+" "+f+" "+v,a[t])},j.prototype.removeEvents=function(){var a;a=this.events,this.win.unbind(s,a[s]),this.iOSNativeScrolling||(this.slider.unbind(),this.pane.unbind()),this.$content.unbind(""+t+" "+p+" "+f+" "+v,a[t])},j.prototype.generate=function(){var a,c,d,f,g,h,i;return f=this.options,h=f.paneClass,i=f.sliderClass,a=f.contentClass,(g=this.$el.children("."+h)).length||g.children("."+i).length||this.$el.append('
'),this.pane=this.$el.children("."+h),this.slider=this.pane.find("."+i),0===e&&C()?(d=b.getComputedStyle(this.content,null).getPropertyValue("padding-right").replace(/[^0-9.]+/g,""),c={right:-14,paddingRight:+d+14}):e&&(c={right:-e},this.$el.addClass(f.enabledClass)),null!=c&&this.$content.css(c),this},j.prototype.restore=function(){this.stopped=!1,this.iOSNativeScrolling||this.pane.show(),this.addEvents()},j.prototype.reset=function(){var a,b,c,f,g,h,i,j,k,l,m,n;return this.iOSNativeScrolling?void(this.contentHeight=this.content.scrollHeight):(this.$el.find("."+this.options.paneClass).length||this.generate().stop(),this.stopped&&this.restore(),a=this.content,f=a.style,g=f.overflowY,d&&this.$content.css({height:this.$content.height()}),b=a.scrollHeight+e,l=parseInt(this.$el.css("max-height"),10),l>0&&(this.$el.height(""),this.$el.height(a.scrollHeight>l?l:a.scrollHeight)),i=this.pane.outerHeight(!1),k=parseInt(this.pane.css("top"),10),h=parseInt(this.pane.css("bottom"),10),j=i+k+h,n=Math.round(j/b*i),nthis.options.sliderMaxHeight&&(n=this.options.sliderMaxHeight),g===t&&f.overflowX!==t&&(n+=e),this.maxSliderTop=j-n,this.contentHeight=b,this.paneHeight=i,this.paneOuterHeight=j,this.sliderHeight=n,this.paneTop=k,this.slider.height(n),this.events.scroll(),this.pane.show(),this.isActive=!0,a.scrollHeight===a.clientHeight||this.pane.outerHeight(!0)>=a.scrollHeight&&g!==t?(this.pane.hide(),this.isActive=!1):this.el.clientHeight===a.scrollHeight&&g===t?this.slider.hide():this.slider.show(),this.pane.css({opacity:this.options.alwaysVisible?1:"",visibility:this.options.alwaysVisible?"visible":""}),c=this.$content.css("position"),("static"===c||"relative"===c)&&(m=parseInt(this.$content.css("right"),10),m&&this.$content.css({right:"",marginRight:m})),this)},j.prototype.scroll=function(){return this.isActive?(this.sliderY=Math.max(0,this.sliderY),this.sliderY=Math.min(this.maxSliderTop,this.sliderY),this.$content.scrollTop(this.maxScrollTop*this.sliderY/this.maxSliderTop),this.iOSNativeScrolling||(this.updateScrollValues(),this.setOnScrollStyles()),this):void 0},j.prototype.scrollBottom=function(a){return this.isActive?(this.$content.scrollTop(this.contentHeight-this.$content.height()-a).trigger(p),this.stop().restore(),this):void 0},j.prototype.scrollTop=function(a){return this.isActive?(this.$content.scrollTop(+a).trigger(p),this.stop().restore(),this):void 0},j.prototype.scrollTo=function(a){return this.isActive?(this.scrollTop(this.$el.find(a).get(0).offsetTop),this):void 0},j.prototype.stop=function(){return y&&this.scrollRAF&&(y(this.scrollRAF),this.scrollRAF=null),this.stopped=!0,this.removeEvents(),this.iOSNativeScrolling||this.pane.hide(),this},j.prototype.destroy=function(){return this.stopped||this.stop(),!this.iOSNativeScrolling&&this.pane.length&&this.pane.remove(),d&&this.$content.height(""),this.$content.removeAttr("tabindex"),this.$el.hasClass(this.options.enabledClass)&&(this.$el.removeClass(this.options.enabledClass),this.$content.css({right:""})),this},j.prototype.flash=function(){return!this.iOSNativeScrolling&&this.isActive?(this.reset(),this.pane.addClass(this.options.flashedClass),setTimeout(function(a){return function(){a.pane.removeClass(a.options.flashedClass)}}(this),this.options.flashDelay),this):void 0},j}(),a.fn.nanoScroller=function(b){return this.each(function(){var c,d;if((d=this.nanoscroller)||(c=a.extend({},z,b),this.nanoscroller=d=new q(this,c)),b&&"object"==typeof b){if(a.extend(d.options,b),null!=b.scrollBottom)return d.scrollBottom(b.scrollBottom);if(null!=b.scrollTop)return d.scrollTop(b.scrollTop);if(b.scrollTo)return d.scrollTo(b.scrollTo);if("bottom"===b.scroll)return d.scrollBottom(0);if("top"===b.scroll)return d.scrollTop(0);if(b.scroll&&b.scroll instanceof a)return d.scrollTo(b.scroll);if(b.stop)return d.stop();if(b.destroy)return d.destroy();if(b.flash)return d.flash()}return d.reset()})},a.fn.nanoScroller.Constructor=q}); \ No newline at end of file diff --git a/www/modules/tntofficiel/views/js/lib/nanoscroller/nanoscroller.css b/www/modules/tntofficiel/views/js/lib/nanoscroller/nanoscroller.css new file mode 100644 index 00000000..252fdda6 --- /dev/null +++ b/www/modules/tntofficiel/views/js/lib/nanoscroller/nanoscroller.css @@ -0,0 +1,48 @@ +/** initial setup **/ +.nano { + position : relative; + width : 100%; + height : 100%; + overflow : hidden; +} +.nano > .nano-content { + position : absolute; + overflow : scroll; + overflow-x : hidden; + top : 0; + right : 0; + bottom : 0; + left : 0; + padding-right : 27px; +} +.nano > .nano-content:focus { + outline: thin dotted; +} +.nano > .nano-content::-webkit-scrollbar { + display: none; +} +.has-scrollbar > .nano-content::-webkit-scrollbar { + display: block; +} +.nano > .nano-pane { + background : #E5E5E5; + position : absolute; + width : 20px; + right : 1px; + top : 0; + bottom : 0; + margin : 0 0 0 5px; + -moz-border-radius : 5px; + -webkit-border-radius : 5px; + border-radius : 5px; +} +.nano > .nano-pane > .nano-slider { + background: #CACACA; + position : relative; + margin : 0 0px; + -moz-border-radius : 5px; + -webkit-border-radius : 5px; + border-radius : 5px; +} +.nano:hover > .nano-pane, .nano-pane.active, .nano-pane.flashed { +} diff --git a/www/modules/tntofficiel/views/js/order-city-check.js b/www/modules/tntofficiel/views/js/order-city-check.js new file mode 100644 index 00000000..d856d23f --- /dev/null +++ b/www/modules/tntofficiel/views/js/order-city-check.js @@ -0,0 +1,119 @@ +/** + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + */ + +$(document).ready(function () { + + // Create the FancyBox. + createFancyBox(); + + var boolIsCityValid = false; + + // When a city is selected. + $("#validateCity").on('click', function () { + + var objJqXHR = $.ajax({ + "url": window.TNTOfficiel.link.front.module.updateAddressDelivery, + "method": 'POST', + "data": { + "city": $("#helper_city").val() + }, + "async": false + }); + + objJqXHR + .done(function (mxdData, strTextStatus, objJqXHR) { + }) + .fail(function (objJqXHR, strTextStatus, strErrorThrown) { + // console.error( objJqXHR.status + ' ' + objJqXHR.statusText ); + }) + .always(function () { + // Close the FancyBox. + $.fancybox.close(); + boolIsCityValid = true; + }); + }); + + $("[name='processAddress']").on('click', function (objEvent) { + if (!boolIsCityValid) { + objEvent.preventDefault(); + + var objJqXHR = $.ajax({ + "url": window.TNTOfficiel.link.front.module.getAddressCities, + "method": 'POST', + "async": false + }); + + objJqXHR + .done(function (mxdData, strTextStatus, objJqXHR) { + var response = JSON.parse(mxdData); + displayFancyBox(response.cities, response.postcode) + }) + .fail(function (objJqXHR, strTextStatus, strErrorThrown) { + // console.error( objJqXHR.status + ' ' + objJqXHR.statusText ); + }) + .always(function () {}); + } + }); +}); + +/** + * insert the fancy box html into the page + */ +function createFancyBox() { + $("#page").append('\ +\ +
\ +
\ +

Sélectionnez votre ville

\ +
\ + \ + \ +
\ +
\ + \ + \ +
\ +

\ + \ +

\ +
\ +
' + ); +} + +/** + * Display the fancybox + */ +function displayFancyBox(arrArgCities, strArgPostCode) { + // fancybox configuration + $("a#fancybox_city_helper").fancybox({ + "transitionIn": 'elastic', + "transitionOut": 'elastic', + "type": 'inline', + "speedIn": 600, + "speedOut": 200, + "overlayShow": false, + "autoDimensions": true, + "helpers": { + overlay: {closeClick: false} + } + }); + + // Generate the options to be put in the city select field. + var strHTMLOptions = ""; + $.each(arrArgCities, function (index, city) { + strHTMLOptions += ""; + }); + + $("#helper_city").html(strHTMLOptions); + $("#helper_city").addClass("form-control"); + $("#helper_postcode").val(strArgPostCode); + $("a#fancybox_city_helper").trigger("click"); +} \ No newline at end of file diff --git a/www/modules/tntofficiel/views/templates/hook/displayAdminOrder.tpl b/www/modules/tntofficiel/views/templates/hook/displayAdminOrder.tpl new file mode 100644 index 00000000..5aaf9e8d --- /dev/null +++ b/www/modules/tntofficiel/views/templates/hook/displayAdminOrder.tpl @@ -0,0 +1,169 @@ +{* + * 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 date' mod='tntofficiel'} +
+
+ + + + + + + + + + + + + +
{l s='Shipping date' mod='tntofficiel'}{l s='Due date' mod='tntofficiel'}
+
+ +
+ +
+
+ + +
+ {$dueDate|escape:'htmlall':'UTF-8'} +
+
+ + + + +
+ +
+
+ + {l s='parcels' mod='tntofficiel'} {$parcels|@count} {if !empty($pickupNumber)}{l s='Pickup number: ' mod='tntofficiel'} {$pickupNumber|escape:'htmlall':'UTF-8'}{/if} + {l s='Total weight: ' mod='tntofficiel'} 0 {l s='Kg' mod='tntofficiel'} +
+
+ + + + + + + + + + + {foreach from=$parcels item=parcel key=parcelIndex} + + + + + + + {/foreach} + +
{l s='parcel number' mod='tntofficiel'}{l s='weight' mod='tntofficiel'}{l s='action' mod='tntofficiel'}{l s='PDL' mod='tntofficiel'}
+
+ {$parcelIndex + 1|intval} +
+
+ + + + + {if empty($isShipped)} + + + {/if} + + {if $parcel['pdl'] != ''} + + + + {/if} +
+
+ {if empty($isShipped)} + + {/if} +
+ +
+
+

{l s='add parcel' mod='tntofficiel'}

+ +
+ + +
+ +

+ +

+
+
+ +
+ +
+
+ +
+ + \ No newline at end of file diff --git a/www/modules/tntofficiel/views/templates/hook/displayBeforeCarrier.tpl b/www/modules/tntofficiel/views/templates/hook/displayBeforeCarrier.tpl new file mode 100644 index 00000000..3d5e82a6 --- /dev/null +++ b/www/modules/tntofficiel/views/templates/hook/displayBeforeCarrier.tpl @@ -0,0 +1,19 @@ +{* + * 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/hook/displayCarrierList.tpl b/www/modules/tntofficiel/views/templates/hook/displayCarrierList.tpl index 8d5cd1de..a58dea12 100644 --- a/www/modules/tntofficiel/views/templates/hook/displayCarrierList.tpl +++ b/www/modules/tntofficiel/views/templates/hook/displayCarrierList.tpl @@ -91,7 +91,7 @@ + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + *} +{if isset($item)} + {if $method_name == 'relay-point'} + {assign var='method_code' value='xett'} + {assign var='method_name_item' value='relay-point'} + {else} + {assign var='method_code' value='pex'} + {assign var='method_name_item' value='repository'} + {/if} + + {assign var='id' value=$item.$method_code|lower} + {*{tnt_shipping_method_get_schedules_schedules hours=$item.hours assign='schedules'}*} + {assign var='schedules' value=$item.schedule} +
+
+ {if $method_code == 'xett'} +
Code: {$item.xett|escape:'htmlall':'UTF-8'}
+ {/if} +
{$item.name|escape:'htmlall':'UTF-8'}
+ {* For relay points *} + {if $method_code == 'xett'} +
{$item.address|escape:'htmlall':'UTF-8'}
+ {else} + {* For repositories *} +
{$item.address1|escape:'htmlall':'UTF-8'}
+
{$item.address2|escape:'htmlall':'UTF-8'}
+ {/if} +
{$item.postcode|escape:'htmlall':'UTF-8'} {$item.city|escape:'htmlall':'UTF-8'}
+
+
+

{l s='Schedules' mod='tntofficiel'} :

+ {foreach from=$schedules key=day item=schedule} +
+

{l s=$day mod='tntofficiel'}:

+ {*{l s='Monday' mod='tntofficiel'} + {l s='Tuesday' mod='tntofficiel'} + {l s='Wednesday' mod='tntofficiel'} + {l s='Thursday' mod='tntofficiel'} + {l s='Friday' mod='tntofficiel'} + {l s='Saturday' mod='tntofficiel'} + {l s='Sunday' mod='tntofficiel'}*} + +

+ {if !empty($schedule)} + {assign var='i' value=0} + {foreach from=$schedule item=part} + {' - '|implode:$part|escape:'htmlall':'UTF-8'} + {if ($schedule|@count) > 1 and $i < (($schedule|@count) -1)} + {l s='and' mod='tntofficiel'} + {/if} + {assign var='i' value=$i+1} + {/foreach} + {else} + {l s='Closed' mod='tntofficiel'} + {/if} +

+
+ {/foreach} +
+ +
+ +{/if} \ No newline at end of file diff --git a/www/modules/tntofficiel/views/templates/hook/displayCarrierList/deliveryPointsBox.tpl b/www/modules/tntofficiel/views/templates/hook/displayCarrierList/deliveryPointsBox.tpl new file mode 100644 index 00000000..7188b5c1 --- /dev/null +++ b/www/modules/tntofficiel/views/templates/hook/displayCarrierList/deliveryPointsBox.tpl @@ -0,0 +1,33 @@ +{* + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + *} +
+
+

+ {if $method_id == 'relay_points'} + {l s='Choose your package relay point' mod='tntofficiel'} + {else} + {l s='Choose your depot' mod='tntofficiel'} + {/if} +

+
+ +
+ {include file='./deliveryPointsBox/form.tpl'} +
+
+ {include file='./deliveryPointsBox/list.tpl'} +
+
+
+ + \ No newline at end of file diff --git a/www/modules/tntofficiel/views/templates/hook/displayCarrierList/deliveryPointsBox/form.tpl b/www/modules/tntofficiel/views/templates/hook/displayCarrierList/deliveryPointsBox/form.tpl new file mode 100644 index 00000000..f00003d9 --- /dev/null +++ b/www/modules/tntofficiel/views/templates/hook/displayCarrierList/deliveryPointsBox/form.tpl @@ -0,0 +1,58 @@ +{* + * 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 Address' mod='tntofficiel'} +
    + {* Postcode *} +
  • +
    + + +
    + +
    +
    + + {* Cities list *} +
    + {* If cities *} + {if !empty($cities)} + +
    + +
    + {else} + {* if no results *} + +
    + +
    + {/if} +
    + + {* Cities list *} +
    + +
    +
  • +
+
\ No newline at end of file diff --git a/www/modules/tntofficiel/views/templates/hook/displayCarrierList/deliveryPointsBox/index.php b/www/modules/tntofficiel/views/templates/hook/displayCarrierList/deliveryPointsBox/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/templates/hook/displayCarrierList/deliveryPointsBox/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/displayCarrierList/deliveryPointsBox/list.tpl b/www/modules/tntofficiel/views/templates/hook/displayCarrierList/deliveryPointsBox/list.tpl new file mode 100644 index 00000000..9f92eed4 --- /dev/null +++ b/www/modules/tntofficiel/views/templates/hook/displayCarrierList/deliveryPointsBox/list.tpl @@ -0,0 +1,100 @@ +{* + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + *} + +
+
+
    + {if !empty($results)} + {if $method_name == 'relay-points'} + {assign var='method_code' value='xett'} + {assign var='method_name_item' value='relay-point'} + {else} + {assign var='method_code' value='pex'} + {assign var='method_name_item' value='repository'} + {/if} + + {foreach from=$results key=index item=item} + {assign var='id' value=$item.$method_code|lower} + + {*{tnt_shipping_method_get_schedules hours=$item.hours assign='schedules'}*} + {assign var='schedules' value=$item.schedule} + {*$item.schedule*} +
  • +
    + {if $method_code == 'xett'} +

    Code: {$item.xett|escape:'htmlall':'UTF-8'}

    + {/if} +

    {$item.name|escape:'htmlall':'UTF-8'}

    + {* For relay points *} + {if $method_code == 'xett'} +

    {$item.address|escape:'htmlall':'UTF-8'}

    + {else} + {* For repositories *} +

    {$item.address1|escape:'htmlall':'UTF-8'}

    +

    {$item.address2|escape:'htmlall':'UTF-8'}

    + {/if} +

    {$item.postcode|escape:'htmlall':'UTF-8'} {$item.city|escape:'htmlall':'UTF-8'}

    +
    +
    +

    {l s='Schedules' mod='tntofficiel'} : +

    + {foreach from=$schedules key=day item=schedule} +
    +

    {l s=$day mod='tntofficiel'}:

    + {*{l s='Monday' mod='tntofficiel'} + {l s='Tuesday' mod='tntofficiel'} + {l s='Wednesday' mod='tntofficiel'} + {l s='Thursday' mod='tntofficiel'} + {l s='Friday' mod='tntofficiel'} + {l s='Saturday' mod='tntofficiel'} + {l s='Sunday' mod='tntofficiel'}*} + +

    + {if !empty($schedule)} + {assign var='i' value=0} + {foreach from=$schedule item=part} + {' - '|implode:$part|escape:'htmlall':'UTF-8'} + {if ($schedule|@count) > 1 and $i < (($schedule|@count) -1)} + {l s='and' mod='tntofficiel'} + {/if} + {assign var='i' value=$i+1} + {/foreach} + {else} + {l s='Closed' mod='tntofficiel'} + {/if} +

    +
    + {/foreach} +
    +
    +
    {$id|escape:'htmlall':'UTF-8'}
    +
    +
    {$index|intval + 1}
    + {if isset($item.distance)} +
    {'%s Km'|sprintf:$item.distance|escape:'htmlall':'UTF-8'|ltrim:0}
    + {/if} +
    + +
    +
  • + {/foreach} + {elseif empty($cities)} +
  • + {l s='No matching cities for the requested postal code.' mod='tntofficiel'} +
    {l s='Check the postal code and click' mod='tntofficiel'} {l s='Change' mod='tntofficiel'}. +
  • + {elseif empty($current_city)} +
  • {l s='Select a city from the list and click' mod='tntofficiel'} {l s='Change' mod='tntofficiel'}.
  • + {else} +
  • {l s='No delivery point for this city.' mod='tntofficiel'}
  • + {/if} +
+
+
diff --git a/www/modules/tntofficiel/views/templates/hook/displayCarrierList/index.php b/www/modules/tntofficiel/views/templates/hook/displayCarrierList/index.php new file mode 100644 index 00000000..b3e6797b --- /dev/null +++ b/www/modules/tntofficiel/views/templates/hook/displayCarrierList/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/displayCarrierList2.tpl new file mode 100644 index 00000000..d23b25f6 --- /dev/null +++ b/www/modules/tntofficiel/views/templates/hook/displayCarrierList2.tpl @@ -0,0 +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'}

+
+
+ + diff --git a/www/modules/tntofficiel/views/templates/hook/displayOrderDetail.tpl b/www/modules/tntofficiel/views/templates/hook/displayOrderDetail.tpl new file mode 100644 index 00000000..40582b59 --- /dev/null +++ b/www/modules/tntofficiel/views/templates/hook/displayOrderDetail.tpl @@ -0,0 +1,18 @@ +{* + * TNT OFFICIAL MODULE FOR PRESTASHOP + * + * @author GFI Informatique + * @copyright 2016 GFI Informatique, 2016 TNT + * @license https://opensource.org/licenses/MIT MIT License + *} +
+ + + {l s='show' mod='tntofficiel'} + + + +

+ {l s='Follow my parcels' mod='tntofficiel'} +

+
\ No newline at end of file