diff --git a/modules/logistics/AdminLogistics.php b/modules/logistics/AdminLogistics.php index 7a60b148..cdcf9acb 100644 --- a/modules/logistics/AdminLogistics.php +++ b/modules/logistics/AdminLogistics.php @@ -20,11 +20,12 @@ foreach(array_map(function($value) { include _PS_ROOT_DIR_.'/modules/privatesales/Sale.php'; - -class AdminLogistics extends AdminTab { +class AdminLogistics extends AdminTab +{ public $_html = ''; - private function stripaccents($str) { + private function stripaccents($str) + { return preg_replace( '~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml|caron);~i', '$1', @@ -32,7 +33,8 @@ class AdminLogistics extends AdminTab { ); } - private function isoreplace($str) { + private function isoreplace($str) + { // ISO/CEI 646 return str_replace(array( 'Ç', 'ü', 'é', 'â', 'ä', 'à', @@ -84,41 +86,10 @@ class AdminLogistics extends AdminTab { ), $str); } - private function printLabel($data, $mr=false) { + private function printLabel($data, $mr=false) + { global $cookie; - //require dirname(__FILE__).'/libs/predis/autoload.php'; // Conflicts with Prestashop autoload - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Option/OptionInterface.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Option/AbstractOption.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Command/Processor/CommandProcessingInterface.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Command/PrefixableCommandInterface.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Command/CommandInterface.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Command/AbstractCommand.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Command/PrefixableCommand.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Command/PubSubPublish.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Connection/ConnectionInterface.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Connection/SingleConnectionInterface.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Connection/AbstractConnection.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Connection/StreamConnection.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Connection/ConnectionParametersInterface.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Connection/ConnectionParameters.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Connection/ConnectionFactoryInterface.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Connection/ConnectionFactory.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Profile/ServerProfileInterface.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Profile/ServerProfile.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Profile/ServerVersion26.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Option/ClientCluster.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Option/ClientPrefix.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Option/ClientExceptions.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Option/ClientReplication.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Option/ClientConnectionFactory.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Option/ClientProfile.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Option/ClientOptionsInterface.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Option/ClientOptions.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/BasicClientInterface.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/ClientInterface.php'; - require_once dirname(__FILE__).'/libs/predis/lib/Predis/Client.php'; - $redis = new Predis\Client(); if($mr){ @@ -167,7 +138,7 @@ class AdminLogistics extends AdminTab { && ( $delete_number = Tools::getValue('delete_number') )) { // Suppression LAPOSTE - if ($delete = (int) Tools::getValue('delete_laposte')) { + if ($delete = (int) Tools::getValue('delete_soflexibilite')) { Db::getInstance()->ExecuteS(' DELETE FROM `'._DB_PREFIX_.'lapostews` WHERE `id_order_detail` = '.$delete.' @@ -302,7 +273,7 @@ class AdminLogistics extends AdminTab { $weight = 0.24; $order = new Order((int) $id_order); if (Validate::isLoadedObject($order)) { - $parcel_carrier == 'laposte'? $weight = 0.24: TRUE; + $parcel_carrier == 'laposte' ? $weight = 0.24 : true; if ($parcel_carrier == "laposte" || $parcel_carrier == "mondialrelay") { $result = $logistics_carriers[$parcel_carrier]->registerParcel($order, $products, $weight); if($result[0] != '') { @@ -847,9 +818,9 @@ class AdminLogistics extends AdminTab {