diff --git a/modules/mondialrelay/AdminMondialRelay.php b/modules/mondialrelay/AdminMondialRelay.php index ad725f05..3ae7e787 100755 --- a/modules/mondialrelay/AdminMondialRelay.php +++ b/modules/mondialrelay/AdminMondialRelay.php @@ -1,6 +1,6 @@ -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 9538 $ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -require_once(dirname(__FILE__).'/classes/MondialRelayClass.php'); require_once(dirname(__FILE__).'/classes/MRCreateTickets.php'); require_once(dirname(__FILE__).'/mondialrelay.php'); class AdminMondialRelay extends AdminTab { - private $mondialrelay = NULL; - + private $mondialrelay = null; + + public $post_errors = array(); + public function __construct() { - MondialRelay::initModuleAccess(); - + $this->mondialrelay = new MondialRelay(); + $this->table = 'mr_selected'; - $this->className = 'MondialRelayClass'; parent::__construct(); + $this->context = Context::getContext(); + $datas = array( + 'display_header' => true, + 'display_header_javascript' => true, + 'display_footer' => true, + ); + + $this->context->smarty->assign($datas); + } + + /** + * @Override + * display orders by sales + */ + private function displaySalesTable() + { + global $currentIndex; + + $mr_carriers = array(); + foreach (Db::getInstance()->executeS(' + SELECT `id_carrier` + FROM `'._DB_PREFIX_.'mr_method` + ') as $row) { + $mr_carriers[] = (int) $row['id_carrier']; + } + + $details = MondialRelay::getAccountDetail(); + + $id_sales = array(); + + foreach (Db::getInstance()->executeS(' + SELECT DISTINCT p.`id_sale` + FROM `'._DB_PREFIX_.'privatesale` p + LEFT JOIN `'._DB_PREFIX_.'product_ps_cache` ppc + ON ppc.`id_sale` = p.`id_sale` + LEFT JOIN `'._DB_PREFIX_.'order_detail` od + ON od.`product_id` = ppc.`id_product` + LEFT JOIN `'._DB_PREFIX_.'order_state_current` ost + ON ost.`id_order` = od.`id_order` + LEFT JOIN `'._DB_PREFIX_.'orders` o + ON o.`id_order` = od.`id_order` + WHERE ost.`id_order_state` = '.(int) $details['MR_ORDER_STATE'].' + AND o.`id_carrier` IN ('.implode(', ', $mr_carriers).') + ') as $row){ + $id_sales[] = (int) $row['id_sale']; + } + + $sales = Db::getInstance()->executeS(' + SELECT p.`id_sale`, cl.`name` + FROM `'._DB_PREFIX_.'privatesale` p + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl + ON cl.`id_category` = p.`id_category` + WHERE cl.id_lang = '.(int) $this->context->language->id.' + AND p.`id_sale` IN ('.implode(', ', $id_sales).') + '); + + $html = ' +
+
+ '.$this->l('Liste des ventes').' + +
+ +
+
+
+ +
+
+
'; + echo $html; } private function displayOrdersTable() { - global $cookie; + $order_state = new OrderState((int)(Configuration::get('MONDIAL_RELAY_ORDER_STATE')), $this->context->language->id); + $orders = MondialRelay::getOrders(array(), MondialRelay::NO_FILTER, $this->mondialrelay->account_shop['MR_WEIGHT_COEFFICIENT']); - $mondialrelay = new MondialRelay(); - $order_state = new OrderState((int)(Configuration::get('MONDIAL_RELAY_ORDER_STATE')), $cookie->id_lang); - $mr_weight_coef = (int)(Configuration::get('MR_WEIGHT_COEF')); - - $html = ''; - // Simulate a ticket generation $MRCreateTicket = new MRCreateTickets(array( - 'orderIdList' => NULL, - 'totalOrder' => NULL, - 'weightList' => NULL)); - - $errorListTicket = $MRCreateTicket->checkPreValidation(); - - $titleType = array( - 'error' => $this->l('Thanks to kindly correct the following errors on '). - ' '. - $this->l('the contact page').':'; - } + $order['display_total_price'] = Tools::displayPrice($order['total'], new Currency($order['id_currency'])); + $order['display_shipping_price'] = Tools::displayPrice($order['shipping'], new Currency($order['id_currency'])); + if (version_compare(_PS_VERSION_, '1.5.5', '<')) + $order['display_date'] = Tools::displayDate($order['date'], $this->context->language->id); + else + $order['display_date'] = Tools::displayDate($order['date']); + $order['weight'] = (!empty($order['mr_weight']) && $order['mr_weight'] > 0) ? $order['mr_weight'] : $order['order_weight']; } - - $html .= '

'.$this->l('All orders which have the state').' "'.$order_state->name.'" '. - $this->l('will be available for sticker creation'); - $html .= '. ' . $this->l('Change configuration') . '

-
- - -
'; - $orders = MondialRelay::getOrders(array()); - if (empty($orders)) - $html.= '

' . $this->l('No orders with this state.') . '

'; - else - { - $html.= '
'; - $html.= "\n"; - $html.= ''; - $html.= ''; - $html.= ''; - $html.= ''; - $html.= ''; - $html.= ''; - $html.= ''; - $html.= ''; - $html.= ''; - $html.= ''; - $html.= ''; - $html.= ''; - $html.= ''; - - foreach ($orders as $order) - { - if ($order['weight'] == 0) - { - $result_weight = Db::getInstance()->getRow(' - SELECT SUM(product_weight * product_quantity) as weight - FROM '._DB_PREFIX_.'order_detail - WHERE id_order = '.(int)($order['id_order'])); - $order['weight'] = round($mr_weight_coef * $result_weight['weight']); - } + $controller = (_PS_VERSION_ < '1.5') ? 'AdminContact' : 'AdminStores'; + + $this->context->smarty->assign(array( + 'MR_token_admin_module' => Tools::getAdminToken('AdminModules'.(int)(Tab::getIdFromClassName('AdminModules')).(int)$this->context->employee->id), + 'MR_token_admin_contact' => array( + 'controller_name' => $controller, + 'token' => Tools::getAdminToken($controller.(int)(Tab::getIdFromClassName($controller)).(int)$this->context->employee->id)), + 'MR_token_admin_orders' => Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)$this->context->employee->id), + 'MR_order_state_name' => $order_state->name, + 'MR_orders' => $orders, + 'MR_PS_IMG_DIR_' => _PS_IMG_DIR_, + 'MR_errors_type' => $MRCreateTicket->checkPreValidation()) + ); - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ' - - - - - - - - - '; - } - $html .= ' -
'.$this->l('Order ID').''.$this->l('Customer').''.$this->l('Total price').''.$this->l('Total shipping').''.$this->l('Date').''.$this->l('Put a Weight (grams)').''.$this->l('MR Number').''.$this->l('MR Country').''.$this->l('Exp Number').''.$this->l('Detail').'
'.$order['id_order'].''.$order['customer'].''.Tools::displayPrice($order['total'], new Currency($order['id_currency'])) . ''.Tools::displayPrice($order['shipping'], new Currency($order['id_currency'])) . ''.Tools::displayDate($order['date'], $order['id_lang']).''.$order['MR_Selected_Num'].''.$order['MR_Selected_Pays'].''.$order['exp_number'].' - - '.$this->l('View').' -
'; - $html .= ' -
-
- -
-
-
'; - $html .= ''; - } - unset($mondialrelay); unset($order_state); - return $html; + echo $this->mondialrelay->fetchTemplate('/views/templates/admin/', 'generate_tickets'); } public function displayhistoriqueForm() { - $mondialrelay = new MondialRelay(); - $_html = ''; - $query = "SELECT * FROM `" . _DB_PREFIX_ ."mr_historique` ORDER BY `id` DESC ;"; - $query = Db::getInstance()->ExecuteS($query); + $query = 'SELECT * FROM `'._DB_PREFIX_.'mr_history` ORDER BY `id` DESC ;'; + $history = Db::getInstance()->executeS($query); - $_html.= ' -
- ' . $this->l('History of labels creation') . ' -
-
- - - - - - - - - '; - foreach ($query AS $k => $row) - { - $_html.= ' - - - - - - - '; - } - $_html .= ' - -
' . $this->l('Order ID') . '' . $this->l('Exp num') . '' . $this->l('Print stick A4') . '' . $this->l('Print stick A5') . '
- - '.$row['order'].''.$row['exp'].' - - - -
-
- -
- -
-
'; + foreach ($history as &$item) + $item['url_10x15'] = str_replace('format=A4', 'format=10x15', $item['url_a4']); + + $this->context->smarty->assign(array( + 'MR_histories' => $history) + ); + echo $this->mondialrelay->fetchTemplate('/views/templates/admin/', 'history'); + } - return $_html; + public function displaySettings($post_action) + { + $curr_order_state = new OrderState((int)$this->mondialrelay->account_shop['MR_ORDER_STATE']); + $order_state = array( + 'id_order_state' => $this->mondialrelay->account_shop['MR_ORDER_STATE'], + 'name' => $curr_order_state->name[$this->context->language->id] + ); + + $this->context->smarty->assign(array( + 'MR_token_admin_mondialrelay' => Tools::getAdminToken('AdminMondialRelay'.(int)(Tab::getIdFromClassName('AdminMondialRelay')).(int)$this->context->employee->id), + 'MR_account_set' => MondialRelay::isAccountSet(), + 'MR_order_state' => $order_state, + 'MR_orders_states_list' => OrderState::getOrderStates($this->context->language->id), + 'MR_form_action' => $post_action, + 'MR_error_list' => $this->post_errors + )); + + echo $this->mondialrelay->fetchTemplate('/views/templates/admin/', 'settings'); + } + + public function postProcess() + { + $post_action = array( + 'type' => Tools::getValue('MR_action_name'), + 'message_success' => $this->l('Action Succeed'), + 'had_errors' => false + ); + + parent::postProcess(); + + if (Tools::isSubmit('submit_order_state')) + if (($order_state = (int)Tools::getValue('id_order_state'))) + { + $this->mondialrelay->account_shop['MR_ORDER_STATE'] = $order_state; + + if ($this->mondialrelay->updateAccountShop()) + $post_action['message_success'] = $this->l('Order State has been updated'); + else + $this->post_errors[] = $this->l('Cannot Update the account shop'); + } + + /* + * @Override sale submit process + */ + if (Tools::isSubmit('mr_submitSale') && Tools::getValue('mr_id_sale')){ + $id_sale = (int) Tools::getValue('mr_id_sale'); + $this->processShippingSale($id_sale); + } + + if (count($this->post_errors)) + $post_action['had_errors'] = true; + + return $post_action; } public function display() - { - $html = ''; - - // Allow to override the older jquery to use a new one :) - // Added for the 1.3 compatibility to keep using the recent code - if (_PS_VERSION_ < '1.4') - $html .= MondialRelay::getjQueryCompatibility(); - - $html .= ' - '; - - $html .= $this->displayOrdersTable(); - $html .= '

'; - $html .= $this->displayhistoriqueForm(); - echo $html; - } -} + { -?> + $post_action = count($_POST) ? $this->postProcess() : null; + + $this->displaySettings($post_action); + if (MondialRelay::isAccountSet() && (int)$this->mondialrelay->account_shop['MR_ORDER_STATE']) + { + $this->displaySalesTable(); + // $this->displayOrdersTable(); + // $this->displayhistoriqueForm(); + } + } + + /** + * @Override + */ + public function processShippingSale($id_sale){ + + } +} \ No newline at end of file diff --git a/modules/mondialrelay/ajax.php b/modules/mondialrelay/ajax.php index 68230760..270158e8 100755 --- a/modules/mondialrelay/ajax.php +++ b/modules/mondialrelay/ajax.php @@ -1,6 +1,6 @@ - -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 9219 $ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA */ /* - * File called by ajax. It's like a controler, you have to send the -* method name of the webservice and implement it. + * File called by ajax. It's like a controller, you have to send the + * method name of the webservice and implement it. * Each Name method allow to instanciate an object containing -* methods to manage correctly the data and name fields + * methods to manage correctly the data and name fields */ - -require_once(realpath(dirname(__FILE__).'/../../config/config.inc.php')); -require_once(realpath(dirname(__FILE__).'/../../init.php')); -require(dirname(__FILE__).'/mondialrelay.php'); -require(dirname(__FILE__).'/classes/MRCreateTickets.php'); -require(dirname(__FILE__).'/classes/MRGetTickets.php'); -require(dirname(__FILE__).'/classes/MRGetRelayPoint.php'); -require(dirname(__FILE__).'/classes/MRRelayDetail.php'); -require(dirname(__FILE__).'/classes/MRManagement.php'); +/* +* Clean displayed content for Admin ajax query +*/ +@ob_clean(); -global $cookie, $cart, $customer; +/* +* Front Ajax query, need the front cookie and MR class +* When it's back query, the PS core made the work +*/ +if (!defined('_PS_ADMIN_DIR_')) +{ + require_once(realpath(dirname(__FILE__).'/../../config/config.inc.php')); + require_once(realpath(dirname(__FILE__).'/../../init.php')); + require_once(dirname(__FILE__).'/mondialrelay.php'); +} -MondialRelay::initModuleAccess(); +$mondialrelay = isset($this) ? $this : new Mondialrelay(); -// Access page List liable to the generated token +require_once(dirname(__FILE__).'/classes/MRCreateTickets.php'); +require_once(dirname(__FILE__).'/classes/MRGetTickets.php'); +require_once(dirname(__FILE__).'/classes/MRGetRelayPoint.php'); +require_once(dirname(__FILE__).'/classes/MRRelayDetail.php'); +require_once(dirname(__FILE__).'/classes/MRManagement.php'); +require_once(dirname(__FILE__).'/classes/MRDownloadPDF.php'); + +/* Can't use Tools at this time... Need to know if _PS_ADMIN_DIR_ has to be defined */ +$method = Tools::getValue('method'); +$token = Tools::getValue('mrtoken'); + +/* Access page List liable to the generated token*/ $accessPageList = array( MondialRelay::getToken('front') => array( 'MRGetRelayPoint', - 'addSelectedCarrierToDB'), + 'addSelectedCarrierToDB' + ), MondialRelay::getToken('back') => array( 'MRGetTickets', 'MRCreateTickets', 'MRDeleteHistory', 'uninstallDetail', - 'DeleteHistory')); + 'DeleteHistory', + 'MRDownloadPDF' + ) +); -$method = Tools::getValue('method'); -$token = Tools::getValue('mrtoken'); $params = array(); $result = array(); -// If the method name assoacited to the token received doesn't match with -// the list, then we kill the request +/* If the method name associated to the token received doesn't match with*/ +/* the list, then we kill the request*/ if (!isset($accessPageList[$token]) || !in_array($method, $accessPageList[$token])) exit(); -// Method name allow to instanciate his object to properly call the -// implemented interface method and do his job -switch($method) +/* Method name allow to instanciate his object to properly call the*/ +/* implemented interface method and do his job*/ +switch ($method) { case 'MRCreateTickets': $params['orderIdList'] = Tools::getValue('order_id_list'); $params['totalOrder'] = Tools::getValue('numSelected'); $params['weightList'] = Tools::getValue('weight_list'); + $params['insuranceList'] = Tools::getValue('insurance_list'); break; case 'MRGetTickets': $params['detailedExpeditionList'] = Tools::getValue('detailedExpeditionList'); break; + case 'MRDownloadPDF': + $params['Expeditions'] = Tools::getValue('detailedExpeditionList'); + break; case 'DeleteHistory': $params['historyIdList'] = Tools::getValue('history_id_list'); break; @@ -88,28 +108,43 @@ switch($method) break; case 'MRGetRelayPoint': $params['id_carrier'] = Tools::getValue('id_carrier'); - $params['weight'] = $cart->getTotalWeight(); - $params['id_address_delivery'] = $cart->id_address_delivery; + $params['weight'] = Context::getContext()->cart->getTotalWeight(); + $params['id_address_delivery'] = Context::getContext()->cart->id_address_delivery; + + if (Tools::getValue('weight') && Tools::getValue('id_address_delivery') && Tools::getValue('process_selection')){ + $params['weight'] = (int) Tools::getValue('weight'); + $params['id_address_delivery'] = (int) Tools::getValue('id_address_delivery'); + } + break; case 'addSelectedCarrierToDB': $params['id_carrier'] = Tools::getValue('id_carrier'); - $params['id_cart'] = $cart->id; - $params['id_customer'] = $cookie->id_customer; + $params['id_cart'] = Context::getContext()->cart->id; + $params['id_customer'] = Context::getContext()->customer->id; $params['id_mr_method'] = Tools::getValue('id_mr_method'); $params['relayPointInfo'] = Tools::getValue('relayPointInfo'); + + + if (Tools::getValue('id_cart') && Tools::getValue('process_selection')){ + $params['id_cart'] = 0; + $tmp_cart = new Cart(Tools::getValue('id_cart')); + if ($tmp_cart->id_customer == (int) Context::getContext()->customer->id) + $params['id_cart'] = $tmp_cart->id; + } break; default: -} - -// Try to instanciate the method object name and call the necessaries method -try +} + +/* Try to instanciate the method object name and call the necessaries method*/ +try { if (class_exists($method, false)) { - $obj = new $method($params); + /* $this is the current mondialrelay object loaded when use in BO. Use for perf*/ + $obj = new $method($params, $mondialrelay); - // Verify that the class implement correctly the interface - // Else use a Management class to do some ajax stuff + /* Verify that the class implement correctly the interface*/ + /* Else use a Management class to do some ajax stuff*/ if (($obj instanceof IMondialRelayWSMethod)) { $obj->init(); @@ -118,18 +153,16 @@ try } unset($obj); } - elseif (($management = new MRManagement($params)) && - method_exists($management, $method)) - $result = $management->{$method}(); - else + else if (($management = new MRManagement($params)) && method_exists($management, $method)) + $result = $management->{$method}(); + else throw new Exception('Method Class : '.$method.' can\'t be found'); unset($management); } catch(Exception $e) { - echo MondialRelay::jsonEncode(array('other' => array('error' => array($e->getMessage())))); + echo MRTools::jsonEncode(array('other' => array('error' => array($e->getMessage())))); exit(-1); } -echo MondialRelay::jsonEncode($result); +echo MRTools::jsonEncode($result); exit(0); -?> diff --git a/modules/mondialrelay/backward_compatibility/Context.php b/modules/mondialrelay/backward_compatibility/Context.php new file mode 100755 index 00000000..5f1f3604 --- /dev/null +++ b/modules/mondialrelay/backward_compatibility/Context.php @@ -0,0 +1,347 @@ + +* @copyright 2007-2014 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if ((bool)Configuration::get('PS_MOBILE_DEVICE')) + require_once(_PS_MODULE_DIR_ . '/mobile_theme/Mobile_Detect.php'); + +// Retro 1.3, 'class_exists' cause problem with autoload... +if (version_compare(_PS_VERSION_, '1.4', '<')) +{ + // Not exist for 1.3 + class Shop extends ObjectModel + { + public $id = 1; + public $id_shop_group = 1; + + public function __construct() + { + } + + + public static function getShops() + { + return array( + array('id_shop' => 1, 'name' => 'Default shop') + ); + } + + public static function getCurrentShop() + { + return 1; + } + } + + class Logger + { + public static function AddLog($message, $severity = 2) + { + $fp = fopen(dirname(__FILE__).'/../logs.txt', 'a+'); + fwrite($fp, '['.(int)$severity.'] '.Tools::safeOutput($message)); + fclose($fp); + } + } + +} + +// Not exist for 1.3 and 1.4 +class Context +{ + /** + * @var Context + */ + protected static $instance; + + /** + * @var Cart + */ + public $cart; + + /** + * @var Customer + */ + public $customer; + + /** + * @var Cookie + */ + public $cookie; + + /** + * @var Link + */ + public $link; + + /** + * @var Country + */ + public $country; + + /** + * @var Employee + */ + public $employee; + + /** + * @var Controller + */ + public $controller; + + /** + * @var Language + */ + public $language; + + /** + * @var Currency + */ + public $currency; + + /** + * @var AdminTab + */ + public $tab; + + /** + * @var Shop + */ + public $shop; + + /** + * @var Smarty + */ + public $smarty; + + /** + * @ var Mobile Detect + */ + public $mobile_detect; + + /** + * @var boolean|string mobile device of the customer + */ + protected $mobile_device; + + public function __construct() + { + global $cookie, $cart, $smarty, $link; + + $this->tab = null; + + $this->cookie = $cookie; + $this->cart = $cart; + $this->smarty = $smarty; + $this->link = $link; + + $this->controller = new ControllerBackwardModule(); + if (is_object($cookie)) + { + $this->currency = new Currency((int)$cookie->id_currency); + $this->language = new Language((int)$cookie->id_lang); + $this->country = new Country((int)$cookie->id_country); + $this->customer = new CustomerBackwardModule((int)$cookie->id_customer); + $this->employee = new Employee((int)$cookie->id_employee); + } + else + { + $this->currency = null; + $this->language = null; + $this->country = null; + $this->customer = null; + $this->employee = null; + } + + $this->shop = new ShopBackwardModule(); + + if ((bool)Configuration::get('PS_MOBILE_DEVICE')) + $this->mobile_detect = new Mobile_Detect(); + } + + public function getMobileDevice() + { + if (is_null($this->mobile_device)) + { + $this->mobile_device = false; + if ($this->checkMobileContext()) + { + switch ((int)Configuration::get('PS_MOBILE_DEVICE')) + { + case 0: // Only for mobile device + if ($this->mobile_detect->isMobile() && !$this->mobile_detect->isTablet()) + $this->mobile_device = true; + break; + case 1: // Only for touchpads + if ($this->mobile_detect->isTablet() && !$this->mobile_detect->isMobile()) + $this->mobile_device = true; + break; + case 2: // For touchpad or mobile devices + if ($this->mobile_detect->isMobile() || $this->mobile_detect->isTablet()) + $this->mobile_device = true; + break; + } + } + } + + return $this->mobile_device; + } + + protected function checkMobileContext() + { + return isset($_SERVER['HTTP_USER_AGENT']) + && (bool)Configuration::get('PS_MOBILE_DEVICE') + && !Context::getContext()->cookie->no_mobile; + } + + /** + * Get a singleton context + * + * @return Context + */ + public static function getContext() + { + if (!isset(self::$instance)) + self::$instance = new Context(); + return self::$instance; + } + + /** + * Clone current context + * + * @return Context + */ + public function cloneContext() + { + return clone($this); + } + + /** + * @return int Shop context type (Shop::CONTEXT_ALL, etc.) + */ + public static function shop() + { + if (!self::$instance->shop->getContextType()) + return ShopBackwardModule::CONTEXT_ALL; + return self::$instance->shop->getContextType(); + } +} + +/** + * Class Shop for Backward compatibility + */ +class ShopBackwardModule extends Shop +{ + const CONTEXT_ALL = 1; + + public $id = 1; + public $id_shop_group = 1; + + + public function getContextType() + { + return ShopBackwardModule::CONTEXT_ALL; + } + + // Simulate shop for 1.3 / 1.4 + public function getID() + { + return 1; + } + + /** + * Get shop theme name + * + * @return string + */ + public function getTheme() + { + return _THEME_NAME_; + } + + public function isFeatureActive() + { + return false; + } +} + +/** + * Class Controller for a Backward compatibility + * Allow to use method declared in 1.5 + */ +class ControllerBackwardModule +{ + /** + * @param $js_uri + * @return void + */ + public function addJS($js_uri) + { + Tools::addJS($js_uri); + } + + /** + * @param $css_uri + * @param string $css_media_type + * @return void + */ + public function addCSS($css_uri, $css_media_type = 'all') + { + Tools::addCSS($css_uri, $css_media_type); + } + + public function addJquery() + { + if (_PS_VERSION_ < '1.5') + $this->addJS(_PS_JS_DIR_.'jquery/jquery-1.4.4.min.js'); + elseif (_PS_VERSION_ >= '1.5') + $this->addJS(_PS_JS_DIR_.'jquery/jquery-1.7.2.min.js'); + } + +} + +/** + * Class Customer for a Backward compatibility + * Allow to use method declared in 1.5 + */ +class CustomerBackwardModule extends Customer +{ + public $logged = false; + /** + * Check customer informations and return customer validity + * + * @since 1.5.0 + * @param boolean $with_guest + * @return boolean customer validity + */ + public function isLogged($with_guest = false) + { + if (!$with_guest && $this->is_guest == 1) + return false; + + /* Customer is valid only if it can be load and if object password is the same as database one */ + if ($this->logged == 1 && $this->id && Validate::isUnsignedId($this->id) && Customer::checkPassword($this->id, $this->passwd)) + return true; + return false; + } +} diff --git a/modules/mondialrelay/backward_compatibility/Display.php b/modules/mondialrelay/backward_compatibility/Display.php new file mode 100755 index 00000000..309e8579 --- /dev/null +++ b/modules/mondialrelay/backward_compatibility/Display.php @@ -0,0 +1,48 @@ + +* @copyright 2007-2014 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/** + * Class allow to display tpl on the FO + */ +class BWDisplay extends FrontController +{ + // Assign template, on 1.4 create it else assign for 1.5 + public function setTemplate($template) + { + if (_PS_VERSION_ >= '1.5') + parent::setTemplate($template); + else + $this->template = $template; + } + + // Overload displayContent for 1.4 + public function displayContent() + { + parent::displayContent(); + + echo Context::getContext()->smarty->fetch($this->template); + } +} diff --git a/modules/mondialrelay/backward_compatibility/backward.ini b/modules/mondialrelay/backward_compatibility/backward.ini new file mode 100755 index 00000000..6520fb7a --- /dev/null +++ b/modules/mondialrelay/backward_compatibility/backward.ini @@ -0,0 +1 @@ +version = 0.4 \ No newline at end of file diff --git a/modules/mondialrelay/backward_compatibility/backward.php b/modules/mondialrelay/backward_compatibility/backward.php new file mode 100755 index 00000000..21f9eb41 --- /dev/null +++ b/modules/mondialrelay/backward_compatibility/backward.php @@ -0,0 +1,55 @@ + +* @copyright 2007-2014 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/** + * Backward function compatibility + * Need to be called for each module in 1.4 + */ + +// Get out if the context is already defined +if (!in_array('Context', get_declared_classes())) + require_once(dirname(__FILE__).'/Context.php'); + +// Get out if the Display (BWDisplay to avoid any conflict)) is already defined +if (!in_array('BWDisplay', get_declared_classes())) + require_once(dirname(__FILE__).'/Display.php'); + +// If not under an object we don't have to set the context +if (!isset($this)) + return; +else if (isset($this->context)) +{ + // If we are under an 1.5 version and backoffice, we have to set some backward variable + if (_PS_VERSION_ >= '1.5' && isset($this->context->employee->id) && $this->context->employee->id && isset(AdminController::$currentIndex) && !empty(AdminController::$currentIndex)) + { + global $currentIndex; + $currentIndex = AdminController::$currentIndex; + } + return; +} + +$this->context = Context::getContext(); +$this->smarty = $this->context->smarty; diff --git a/modules/mondialrelay/backward_compatibility/index.php b/modules/mondialrelay/backward_compatibility/index.php new file mode 100755 index 00000000..b856f563 --- /dev/null +++ b/modules/mondialrelay/backward_compatibility/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2014 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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; \ No newline at end of file diff --git a/modules/mondialrelay/classes/IMondialRelayWSMethod.php b/modules/mondialrelay/classes/IMondialRelayWSMethod.php index 18a38bc2..0b0e82eb 100755 --- a/modules/mondialrelay/classes/IMondialRelayWSMethod.php +++ b/modules/mondialrelay/classes/IMondialRelayWSMethod.php @@ -1,6 +1,6 @@ -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 6594 $ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ require_once(dirname(__FILE__).'/../errorCode.php'); require_once(realpath(dirname(__FILE__).'/../mondialrelay.php')); -require_once(realpath(dirname(__FILE__).'/../lib/nusoap/nusoap.php')); /* - * This method allow to create any method object to dial more - * easyly with the Mondial Reelay WebService + * This method allow to create any method object to dial more easyly with the Mondial Reelay WebService */ interface IMondialRelayWSMethod { @@ -56,5 +54,4 @@ interface IMondialRelayWSMethod */ public function getResult(); } - -?> +?> \ No newline at end of file diff --git a/modules/mondialrelay/classes/MRCreateTickets.php b/modules/mondialrelay/classes/MRCreateTickets.php index 9c22b14c..ada67b2b 100755 --- a/modules/mondialrelay/classes/MRCreateTickets.php +++ b/modules/mondialrelay/classes/MRCreateTickets.php @@ -1,6 +1,6 @@ -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 10348 $ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ @@ -35,245 +35,251 @@ require_once(dirname(__FILE__).'/IMondialRelayWSMethod.php'); */ class MRCreateTickets implements IMondialRelayWSMethod { + public $class_name = __CLASS__; + private $_fields = array( 'id_mr_selected' => 0, 'list' => array( 'Enseigne' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^[0-9A-Z]{2}[0-9A-Z ]{6}$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z]{2}[0-9A-Z ]{6}$#'), 'ModeCol' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^(CCC|CDR|CDS|REL)$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^(CCC|CDR|CDS|REL)$#'), 'ModeLiv' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^(LCC|LD1|LDS|24R|ESP|DRI)$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^(LCC|LD1|LDS|24R|ESP|DRI|HOM)$#'), 'NDossier' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^(|[0-9A-Z_ -]{0,15})$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|[0-9A-Z_ -]{0,15})$#'), 'NClient' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^(|[0-9A-Z]{0,9})$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|[0-9A-Z]{0,9})$#'), 'Expe_Langage' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^[A-Z]{2}$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[A-Z]{2}$#'), 'Expe_Ad1' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^[0-9A-Z_\-\'., /]{2,32}$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z_\-\'., /]{2,32}$#'), 'Expe_Ad2' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^[0-9A-Z_\-\'., /]{0,32}$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z_\-\'., /]{0,32}$#'), 'Expe_Ad3' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^[0-9A-Z_\-\'., /]{0,32}$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z_\-\'., /]{0,32}$#'), 'Expe_Ad4' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^[0-9A-Z]{2}[0-9A-Z ]{6}$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z]{2}[0-9A-Z ]{6}$#'), 'Expe_Ville' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^[A-Z_\-\' ]{2,26}$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[A-Z_\-\' 0-9]{2,26}$#'), 'Expe_CP' => array( - 'required' => true, - 'value' => '', - 'params' => array(), - 'methodValidation' => 'checkZipcodeByCountry'), + 'required' => true, + 'value' => '', + 'params' => array(), + 'methodValidation' => 'checkZipcodeByCountry'), 'Expe_Pays' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^[A-Z]{2}$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[A-Z]{2}$#'), 'Expe_Tel1' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^((00|\+)[1-9]{2}|0)[0-9][0-9]{7,8}$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^((00|\+)[1-9]{2}|0)[0-9][0-9]{7,8}$#'), 'Expe_Tel2' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^((00|\+)[1-9]{2}|0)[0-9][0-9]{7,8}$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^((00|\+)[1-9]{2}|0)[0-9][0-9]{7,8}$#'), 'Expe_Mail' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^[\w\-\.\@_]{0,70}$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[\w\-\.\@_]{0,70}$#'), 'Dest_Langage' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^[A-Z]{2}$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[A-Z]{2}$#'), 'Dest_Ad1' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^[0-9A-Z_\-\'., /]{2,32}$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z_\-\'., /]{2,32}$#'), 'Dest_Ad2' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^[0-9A-Z_\-\'., /]{2,32}$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z_\-\'., /]{2,32}$#'), 'Dest_Ad3' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^[0-9A-Z_\-\'., /]{2,32}$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z_\-\'., /]{2,32}$#'), 'Dest_Ad4' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^[0-9A-Z_\-\'., /]{0,32}$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z_\-\'., /]{0,32}$#'), 'Dest_Ville' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^[A-Z_\-\' ]{2,26}$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[A-Z_\-\' 0-9]{2,26}$#'), 'Dest_CP' => array( - 'required' => true, - 'value' => '', - 'params' => array(), - 'methodValidation' => 'checkZipcodeByCountry'), + 'required' => true, + 'value' => '', + 'params' => array(), + 'methodValidation' => 'checkZipcodeByCountry'), 'Dest_Pays' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^[A-Z]{2}$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[A-Z]{2}$#'), 'Dest_Tel1' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^((00|\+)[1-9]{2}|0)[0-9][0-9]{7,8}$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^((00|\+)[1-9]{2}|0)[0-9][0-9]{7,8}$#'), 'Dest_Tel2' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^((00|\+)[1-9]{2}|0)[0-9][0-9]{7,8}$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^((00|\+)[1-9]{2}|0)[0-9][0-9]{7,8}$#'), 'Dest_Mail' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^[\w\-\.\@_]{0,70}$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[\w\-\.\@_+]{0,70}$#'), 'Poids' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^[0-9]{3,7}$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9]{3,7}$#'), 'Longueur' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^[0-9]{0,3}$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[0-9]{0,3}$#'), 'Taille' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^(XS|S|M|L|XL|XXL|3XL)$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(XS|S|M|L|XL|XXL|3XL)$#'), 'NbColis' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^[0-9]{1,2}$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9]{1,2}$#'), 'CRT_Valeur' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^[0-9]{1,7}$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9]{1,7}$#'), 'CRT_Devise' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^(|EUR)$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|EUR)$#'), 'Exp_Valeur' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^[0-9]{0,7}$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[0-9]{0,7}$#'), 'Exp_Devise' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^(|EUR)$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|EUR)$#'), 'COL_Rel_Pays' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^[A-Z]{2}$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[A-Z]{2}$#'), 'COL_Rel' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^(|[0-9]{6})$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|[0-9]{6})$#'), 'LIV_Rel_Pays' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^[A-Z]{2}$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[A-Z]{2}$#'), 'LIV_Rel' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^(|[0-9]{6})$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|[0-9]{6})$#'), 'TAvisage' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^(|O|N)$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|O|N)$#'), 'TReprise' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^(|O|N)$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|O|N)$#'), 'Montage' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^(|[0-9]{1,3})$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|[0-9]{1,3})$#'), 'TRDV' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^(|O|N)$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|O|N)$#'), 'Assurance' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^(|[0-9A-Z]{1})$#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|[0-9A-Z]{1})$#'), 'Instructions' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^[0-9A-Z_\-\'., /]{0,31}#'), + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z_\-\'., /]{0,31}#'), 'Security' => array( - 'required' => true, - 'value' => '', - 'regexValidation' => '#^[0-9A-Z]{32}$#'), + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z]{32}$#'), 'Texte' => array( - 'required' => false, - 'value' => '', - 'regexValidation' => '#^([^<>&\']{3,30})(\(cr\)[^<>&\']{0,30}){0,9}$#'))); - - private $_orderListId = NULL; + 'required' => false, + 'value' => '', + 'regexValidation' => '#^([^<>&\']{3,30})(\(cr\)[^<>&\']{0,30}){0,9}$#'))); + + private $_orderListId = null; private $_totalOrder = 0; - private $_weightList = NULL; - private $_mondialRelay = NULL; + private $_weightList = null; + private $_insuranceList = null; + private $_mondialrelay = null; private $_fieldsList = array(); private $_webServiceKey = ''; private $_markCode = ''; - + private $_resultList = array( 'error' => array(), 'success' => array()); - - private $_webserviceURL = 'http://www.mondialrelay.fr/webservice/Web_Services.asmx?WSDL'; - - public function __construct($params) + + private $_webserviceURL = ''; + + public function __construct($params, $object) { $this->_orderListId = $params['orderIdList']; $this->_totalOrder = $params['totalOrder']; $this->_weightList = $params['weightList']; - $this->_webServiceKey = Configuration::get('MR_KEY_WEBSERVICE'); - $this->_markCode = Configuration::get('MR_CODE_MARQUE'); + $this->_insuranceList = isset($params['insuranceList']) ? $params['insuranceList'] : ''; + $this->_mondialrelay = $object; + $this->_webServiceKey = $this->_mondialrelay->account_shop['MR_KEY_WEBSERVICE']; + $this->_markCode = $this->_mondialrelay->account_shop['MR_CODE_MARQUE']; + $this->class_name = Tools::strtolower($this->class_name); + + $this->_webserviceURL = MondialRelay::MR_URL.'webservice/Web_Services.asmx?WSDL'; } - + public function __destruct() { - unset($this->_mondialRelay); + unset($this->_mondialrelay); } - + /* * Build a correct weight format (NNNNN) */ private function _weightFormat($weight) - { - while (strlen($weight) != 5) - $weight = '0'.$weight; - return $weight; + { + return sprintf("%05s", $weight); } - + /* * Set the default value to the order paramaters */ private function _setRequestDefaultValue() - { - $this->_fields['list']['Enseigne']['value'] = Configuration::get('MR_ENSEIGNE_WEBSERVICE'); - $this->_fields['list']['Expe_Langage']['value'] = Configuration::get('MR_LANGUAGE'); + { + $this->_fields['list']['Enseigne']['value'] = $this->_mondialrelay->account_shop['MR_ENSEIGNE_WEBSERVICE']; + $this->_fields['list']['Expe_Langage']['value'] = $this->_mondialrelay->account_shop['MR_LANGUAGE']; $this->_fields['list']['Expe_Ad1']['value'] = Configuration::get('PS_SHOP_NAME'); $this->_fields['list']['Expe_Ad3']['value'] = Configuration::get('PS_SHOP_ADDR1'); // Deleted, cause to many failed for the process @@ -281,13 +287,15 @@ class MRCreateTickets implements IMondialRelayWSMethod $this->_fields['list']['Expe_Ville']['value'] = Configuration::get('PS_SHOP_CITY'); $this->_fields['list']['Expe_CP']['value'] = Configuration::get('PS_SHOP_CODE'); $this->_fields['list']['Expe_CP']['params']['id_country'] = Configuration::get('PS_COUNTRY_DEFAULT'); - - if (_PS_VERSION_ >= '1.4') + + if (version_compare(_PS_VERSION_, '1.4', '>=')) + { $this->_fields['list']['Expe_Pays']['value'] = Country::getIsoById(Configuration::get('PS_SHOP_COUNTRY_ID')); + $this->_fields['list']['Expe_CP']['params']['id_country'] = Configuration::get('PS_SHOP_COUNTRY_ID'); + } else - $this->_fields['list']['Expe_Pays']['value'] = substr(Configuration::get('PS_SHOP_COUNTRY'), 0, 2); - - $this->_fields['list']['Expe_Tel1']['value'] = str_replace(array('.', ' ', '-', '_'), '', Configuration::get('PS_SHOP_PHONE')); + $this->_fields['list']['Expe_Pays']['value'] = Tools::substr(Configuration::get('PS_SHOP_COUNTRY'), 0, 2); + $this->_fields['list']['Expe_Tel1']['value'] = MRTools::getFormatedPhone(Configuration::get('PS_SHOP_PHONE')); $this->_fields['list']['Expe_Mail']['value'] = Configuration::get('PS_SHOP_EMAIL'); $this->_fields['list']['NbColis']['value'] = 1; $this->_fields['list']['CRT_Valeur']['value'] = 0; @@ -300,49 +308,56 @@ class MRCreateTickets implements IMondialRelayWSMethod */ public function init() { - $this->_mondialRelay = new MondialRelay(); - if ($this->_totalOrder == 0) - throw new Exception($this->_mondialRelay->l('Please select at least one order')); - + throw new Exception($this->_mondialrelay->l('Please select at least one order', $this->class_name)); + $this->_setRequestDefaultValue(); - if (count($orderListDetails = $this->_mondialRelay->getOrders($this->_orderListId))) + if (count($orderListDetails = $this->_mondialrelay->getOrders($this->_orderListId))) { foreach ($orderListDetails as $orderDetail) - { + { // Storage temporary $base = $this->_fields; $tmp = &$base['list']; - + $deliveriesAddress = new Address($orderDetail['id_address_delivery']); $customer = new Customer($orderDetail['id_customer']); - + // Store the weight order set by the user - foreach($this->_weightList as $orderWeightInfos) + + foreach ($this->_weightList as $orderWeightInfos) { $detail = explode('-', $orderWeightInfos); if (count($detail) == 2 && $detail[1] == $orderDetail['id_order']) - $tmp['Poids']['value'] = $this->_weightFormat($detail[0]); + $tmp['Poids']['value'] = (float)$this->_weightFormat($detail[0]); } - + foreach ($this->_insuranceList as $insurance) + { + $detail = explode('-', $insurance); + if (count($detail) == 2 && $detail[1] == $orderDetail['id_order']) + $tmp['Assurance']['value'] = (int)($detail[0]); + else + $tmp['Assurance']['value'] = $orderDetail['mr_ModeAss']; + } + $dest_tel = (!empty($deliveriesAddress->phone)) ? MRTools::getFormatedPhone($deliveriesAddress->phone) : ''; + $dest_tel2 = (!empty($deliveriesAddress->phone_mobile)) ? MRTools::getFormatedPhone($deliveriesAddress->phone_mobile) : ''; $destIsoCode = Country::getIsoById($deliveriesAddress->id_country); $tmp['ModeCol']['value'] = $orderDetail['mr_ModeCol']; $tmp['ModeLiv']['value'] = $orderDetail['mr_ModeLiv']; $tmp['NDossier']['value'] = $orderDetail['id_order']; $tmp['NClient']['value'] = $orderDetail['id_customer']; $tmp['Dest_Langage']['value'] = 'FR'; //Language::getIsoById($orderDetail['id_lang']); - $tmp['Dest_Ad1']['value'] = substr($deliveriesAddress->firstname.' '.$deliveriesAddress->lastname, 0, 32);; - $tmp['Dest_Ad2']['value'] = substr($deliveriesAddress->address2, 0, 32); - $tmp['Dest_Ad3']['value'] = substr($deliveriesAddress->address1, 0, 32); + $tmp['Dest_Ad1']['value'] = preg_replace(MRTools::REGEX_CLEAN_ADDR, '', Tools::substr(MRTools::removeAccents($deliveriesAddress->firstname.' '.$deliveriesAddress->lastname), 0, 32)); + $tmp['Dest_Ad2']['value'] = preg_replace(MRTools::REGEX_CLEAN_ADDR, '', Tools::substr(MRTools::removeAccents($deliveriesAddress->address2), 0, 32)); + $tmp['Dest_Ad3']['value'] = preg_replace(MRTools::REGEX_CLEAN_ADDR, '', Tools::substr(MRTools::removeAccents($deliveriesAddress->address1), 0, 32)); $tmp['Dest_Ville']['value'] = $deliveriesAddress->city; $tmp['Dest_CP']['value'] = $deliveriesAddress->postcode; $tmp['Dest_CP']['params']['id_country'] = $deliveriesAddress->id_country; $tmp['Dest_Pays']['value'] = $destIsoCode; - $tmp['Dest_Tel1']['value'] = str_replace(array('.', ' ', '-', '_'), '', $deliveriesAddress->phone); - $tmp['Dest_Tel2']['value'] = str_replace(array('.', ' ', '-', '_'), '', $deliveriesAddress->phone_mobile); + $tmp['Dest_Tel1']['value'] = $dest_tel; + $tmp['Dest_Tel2']['value'] = $dest_tel2; $tmp['Dest_Mail']['value'] = $customer->email; - $tmp['Assurance']['value'] = $orderDetail['mr_ModeAss']; - if ($orderDetail['MR_Selected_Num'] != 'LD1' && $orderDetail['MR_Selected_Num'] != 'LDS') + if ($orderDetail['mr_ModeLiv'] != 'LD1' && $orderDetail['mr_ModeLiv'] != 'LDS' && $orderDetail['mr_ModeLiv'] != 'HOM') { $tmp['LIV_Rel_Pays']['value'] = $orderDetail['MR_Selected_Pays']; $tmp['LIV_Rel']['value'] = $orderDetail['MR_Selected_Num']; @@ -350,7 +365,7 @@ class MRCreateTickets implements IMondialRelayWSMethod // Store the necessary information to the root case table $base['id_mr_selected'] = $orderDetail['id_mr_selected']; - + // Add the temporary values to a field list for multiple request $this->_fieldsList[] = $base; unset($deliveriesAddress); @@ -359,7 +374,7 @@ class MRCreateTickets implements IMondialRelayWSMethod $this->_generateMD5SecurityKey(); } } - + /* * Generate the MD5 key for each param list */ @@ -367,79 +382,98 @@ class MRCreateTickets implements IMondialRelayWSMethod { // RootCase is the array case where the main information are stored // it's an array containing id_mr_selected and an array with the necessary fields - foreach($this->_fieldsList as &$rootCase) + foreach ($this->_fieldsList as &$rootCase) { $concatenationValue = ''; - foreach($rootCase['list'] as $paramName => &$valueDetailed) - if ($paramName != 'Texte' && $paramName != 'Security') + foreach ($rootCase['list'] as $paramName => &$valueDetailed) + if ($paramName != 'Texte' && $paramName != 'Security') { // Mac server make an empty string instead of a cleaned string // TODO : test on windows and linux server - $cleanedString = MRTools::replaceAccentedCharacters($valueDetailed['value']); - $valueDetailed['value'] = !empty($cleanedString) ? strtoupper($cleanedString) : strtoupper($valueDetailed['value']); - + $cleanedString = MRTools::removeAccents($valueDetailed['value']); + $valueDetailed['value'] = !empty($cleanedString) ? Tools::strtoupper($cleanedString) : Tools::strtoupper($valueDetailed['value']); + // Call a pointer function if exist to do different test - if (isset($valueDetailed['methodValidation']) && - method_exists('MRTools', $valueDetailed['methodValidation']) && - isset($valueDetailed['params']) && - MRTools::$valueDetailed['methodValidation']($valueDetailed['value'], $valueDetailed['params'])) + if (isset($valueDetailed['methodValidation']) && method_exists('MRTools', $valueDetailed['methodValidation']) && isset($valueDetailed['params']) && MRTools::$valueDetailed['methodValidation']($valueDetailed['value'], $valueDetailed['params'])) $concatenationValue .= $valueDetailed['value']; // Use simple Regex test given by MondialRelay - else if (isset($valueDetailed['regexValidation']) && - preg_match($valueDetailed['regexValidation'], $valueDetailed['value'], $matches)) + else if (isset($valueDetailed['regexValidation']) && preg_match($valueDetailed['regexValidation'], $valueDetailed['value'], $matches)) $concatenationValue .= $valueDetailed['value']; - // If the key is required, we set an error, else it's skipped - else if ((!strlen($valueDetailed['value']) && $valueDetailed['required']) || strlen($valueDetailed['value'])) + // If the key is required, we set an error, else it's skipped + else if ((!Tools::strlen($valueDetailed['value']) && $valueDetailed['required']) || Tools::strlen($valueDetailed['value'])) { if (empty($valueDetailed['value'])) - $error = $this->_mondialRelay->l('This key').' ['.$paramName.'] '.$this->_mondialRelay->l('is empty and need to be filled'); + $error = $this->_mondialrelay->l('This key', $this->class_name).' ['.$paramName.'] '.$this->_mondialrelay->l('is empty and need to be filled', $this->class_name); else - $error = 'This key ['.$paramName.'] hasn\'t a valid value format : '.$valueDetailed['value']; + $error = 'This key ['.$paramName.'] hasn not a valid value format : '.$valueDetailed['value']; $this->_resultList['error'][$rootCase['list']['NDossier']['value']][] = $error; } } - $concatenationValue .= $this->_webServiceKey; - $rootCase['list']['Security']['value' ] = strtoupper(md5($concatenationValue)); + $concatenationValue .= $this->_webServiceKey; + $rootCase['list']['Security']['value'] = Tools::strtoupper(md5($concatenationValue)); } } - + /* * Update the tables used and send mail with the order history */ private function _updateTable($params, $expeditionNum, $ticketURL, $trackingURL, $id_mr_selected) { - global $cookie; - - Db::getInstance()->Execute(' + $sql = ' UPDATE `'._DB_PREFIX_.'mr_selected` SET `MR_poids` = \''.pSQL($params['Poids']).'\', + `MR_insurance` = \''.pSQL($params['Assurance']).'\', `exp_number` = \''.pSQL($expeditionNum).'\', `url_etiquette` = \''.pSQL($ticketURL).'\', `url_suivi` = \''.pSQL($trackingURL).'\' - WHERE id_mr_selected = '.(int)$id_mr_selected); - + WHERE id_mr_selected = '.(int)$id_mr_selected; + Db::getInstance()->execute($sql); + // NDossier contains the id_order $order = new Order($params['NDossier']); - - // Update the database for order and orderHistory + + // Update the database for order and orderHistory $order->shipping_number = $expeditionNum; $order->update(); + if (version_compare(_PS_VERSION_, '1.5', '>=')) + { + //Retrieve Order Carrier + $sql = 'SELECT `id_order_carrier` + FROM `'._DB_PREFIX_.'order_carrier` + WHERE `id_order` = '.(int)$order->id; + + $id_order_carrier = Db::getInstance()->getValue($sql); + + if($id_order_carrier) + { + $order_carrier = new OrderCarrier((int)$id_order_carrier); + if(Validate::isLoadedObject($order_carrier)) + { + $order_carrier->tracking_number = pSQL($expeditionNum); + $order_carrier->update(); + } + } + } + $templateVars = array('{followup}' => $trackingURL); - $orderState = (Configuration::get('PS_OS_SHIPPING')) ? - Configuration::get('PS_OS_SHIPPING') : + $orderState = (Configuration::get('PS_OS_SHIPPING')) ? + Configuration::get('PS_OS_SHIPPING') : _PS_OS_SHIPPING_; - + $history = new OrderHistory(); $history->id_order = (int)$params['NDossier']; - $history->changeIdOrderState($orderState, (int)$params['NDossier']); - $history->id_employee = (int)$cookie->id_employee; + if (version_compare(_PS_VERSION_, '1.5.2', '>=')) + $history->changeIdOrderState((int)$orderState, $order); + else + $history->changeIdOrderState((int)$orderState, (int)($params['NDossier'])); + $history->id_employee = (isset(Context::getContext()->employee->id) ? (int)Context::getContext()->employee->id : ''); $history->addWithemail(true, $templateVars); - unset($order); + unset($order_carrier); unset($history); } - + /* * Manage the return value of the webservice, handle the errors or build the * succeed message @@ -448,139 +482,128 @@ class MRCreateTickets implements IMondialRelayWSMethod { $errors = &$this->_resultList['error'][$params['NDossier']]; $success = &$this->_resultList['success'][$params['NDossier']]; - - if ($client->fault) - $errors[] = $this->_mondialRelay->l('It seems the request isn\'t valid:'). - $result; - - $result = $result['WSI2_CreationEtiquetteResult']; - if (($errorNumber = $result['STAT']) != 0) + $result = $result->WSI2_CreationEtiquetteResult; + if (($errorNumber = $result->STAT) != 0) { - $errors[] = $this->_mondialRelay->l('There is an error number : ').$errorNumber; - $errors[] = $this->_mondialRelay->l('Details : '). - $this->_mondialRelay->getErrorCodeDetail($errorNumber); + $errors[] = $this->_mondialrelay->l('There is an error number : ', $this->class_name).$errorNumber; + $errors[] = $this->_mondialrelay->l('Details : ', $this->class_name). + $this->_mondialrelay->getErrorCodeDetail($errorNumber); } else { - $baseURL = 'http://www.mondialrelay.fr/'; - $expedition = $result['ExpeditionNum']; - $securityKey = strtoupper(md5('<'.$params['Enseigne'].$this->_markCode. + $baseURL = MondialRelay::MR_URL; + $expedition = $result->ExpeditionNum; + $securityKey = Tools::strtoupper(md5('<'.$params['Enseigne'].$this->_markCode. '>'.$expedition.'<'.$this->_webServiceKey.'>')); - $ticketURL = $baseURL.$result['URL_Etiquette']; + $ticketURL = $baseURL.$result->URL_Etiquette; $trackingURL = $baseURL. - 'lg_fr/espaces/url/popup_exp_details.aspx?cmrq='.$params['Enseigne']. - $this->_markCode.'&nexp='.$expedition.'&crc='.$securityKey; - - $success['displayExpedition'] = $this->_mondialRelay->l('Expedition Number : ') . $expedition; - $success['displayTicketURL'] = $this->_mondialRelay->l('Ticket URL : ') . $ticketURL; - $success['displayTrackingURL'] = $this->_mondialRelay->l('Tracking URL: ') . $trackingURL; - $success['expeditionNumber'] = $expedition; + 'public/permanent/tracking.aspx?ens='.$params['Enseigne'].$this->_markCode.'&exp='.$expedition.'&language='.Configuration::get('PS_LANG_DEFAULT').'&crc='.$securityKey; - $this->_updateTable($params, $expedition, $ticketURL, $trackingURL, $id_mr_selected); + $success['displayExpedition'] = $this->_mondialrelay->l('Expedition Number : ', $this->class_name).$expedition; + $success['displayTicketURL'] = $this->_mondialrelay->l('Ticket URL : ', $this->class_name).$ticketURL; + $success['displayTrackingURL'] = $this->_mondialrelay->l('Tracking URL: ', $this->class_name).$trackingURL; + $success['expeditionNumber'] = $expedition; + + $this->_updateTable($params, $expedition, $ticketURL, $trackingURL, $id_mr_selected); } } - + /* * Send one or multiple request to the webservice */ public function send() { - if ($client = new nusoap_client($this->_webserviceURL, true)) + if ($client = new SoapClient($this->_webserviceURL)) { $client->soap_defencoding = 'UTF-8'; $client->decode_utf8 = false; - - foreach($this->_fieldsList as $rootCase) + + foreach ($this->_fieldsList as $rootCase) { $params = $this->_getSimpleParamArray($rootCase['list']); - $result = $client->call( - 'WSI2_CreationEtiquette', - $params, - 'http://www.mondialrelay.fr/webservice/', - 'http://www.mondialrelay.fr/webservice/WSI2_CreationEtiquette'); - + $result = $client->WSI2_CreationEtiquette($params); $this->_parseResult($client, $result, $params, $rootCase['id_mr_selected']); } unset($client); + Configuration::updateValue('MONDIALRELAY_CONFIGURATION_OK', true); } else - throw new Exception($this->_mondialRelay->l('The Mondial Relay webservice isn\'t currently reliable')); + throw new Exception($this->_mondialrelay->l('The Mondial Relay webservice is not currently reliable', $this->class_name)); } - + /* ** Check if the shop parameter are currently well configured */ public function checkPreValidation() { $errorList = array('error' => array(), 'warn' => array()); - - if (!$this->_mondialRelay) - $this->_mondialRelay = new MondialRelay(); - + $list = array( 'Expe_Langage' => array( - 'value' => Configuration::get('MR_LANGUAGE'), - 'error' => $this->_mondialRelay->l('Please check your language configuration')), + 'value' => $this->_mondialrelay->account_shop['MR_LANGUAGE'], + 'error' => $this->_mondialrelay->l('Please check your language configuration', $this->class_name)), 'Expe_Ad1' => array( 'value' => Configuration::get('PS_SHOP_NAME'), - 'error' => $this->_mondialRelay->l('Please check your shop name configuration')), + 'error' => $this->_mondialrelay->l('Please check your shop name configuration', $this->class_name)), 'Expe_Ad3' => array( 'value' => Configuration::get('PS_SHOP_ADDR1'), - 'error' => $this->_mondialRelay->l('Please check your address 1 configuration')), + 'error' => $this->_mondialrelay->l('Please check your address 1 configuration', $this->class_name)), 'Expe_Ville' => array( 'value' => Configuration::get('PS_SHOP_CITY'), - 'error' => $this->_mondialRelay->l('Please check your city configuration')), + 'error' => $this->_mondialrelay->l('Please check your city configuration', $this->class_name)), 'Expe_CP' => array( 'value' => Configuration::get('PS_SHOP_CODE'), - 'error' => $this->_mondialRelay->l('Please check your zipcode configuration'), - 'warn' => $this->_mondialRelay->l('It seems the layout of your zipcode country is not configured or you didn\'t set a right zipcode')), + 'error' => $this->_mondialrelay->l('Please check your zipcode configuration', $this->class_name)), 'Expe_Pays' => array( - 'value' => ((_PS_VERSION_ >= '1.4') ? - Country::getIsoById(Configuration::get('PS_SHOP_COUNTRY_ID')) : - substr(Configuration::get('PS_SHOP_COUNTRY'), 0, 2)), - 'error' => $this->_mondialRelay->l('Please check your country configuration')), + 'value' => ((version_compare(_PS_VERSION_, '1.4', '>=')) ? + Country::getIsoById(Configuration::get('PS_SHOP_COUNTRY_ID')) : + Tools::substr(Configuration::get('PS_SHOP_COUNTRY'), 0, 2)), + 'error' => $this->_mondialrelay->l('Please check your country configuration', $this->class_name)), 'Expe_Tel1' => array( - 'value' => str_replace(array('.', ' ', '-'), '', Configuration::get('PS_SHOP_PHONE')), - 'error' => $this->_mondialRelay->l('Please check your Phone configuration')), + 'value' => MRTools::getFormatedPhone(Configuration::get('PS_SHOP_PHONE')), + 'error' => $this->_mondialrelay->l('Please check your Phone configuration', $this->class_name)), 'Expe_Mail' => array( 'value' => Configuration::get('PS_SHOP_EMAIL'), - 'error' => $this->_mondialRelay->l('Please check your mail configuration'))); - - foreach($list as $name => $tab) - { + 'error' => $this->_mondialrelay->l('Please check your mail configuration', $this->class_name))); + + foreach ($list as $name => $tab) + { // Mac server make an empty string instead of a cleaned string // TODO : test on windows and linux server - $cleanedString = MRTools::replaceAccentedCharacters($tab['value']); - $tab['value'] = !empty($cleanedString) ? strtoupper($cleanedString) : strtoupper($tab['value']); - + $cleanedString = MRTools::removeAccents($tab['value']); + $tab['value'] = !empty($cleanedString) ? Tools::strtoupper($cleanedString) : Tools::strtoupper($tab['value']); + if ($name == 'Expe_CP') { - if (!($zipcodeError = MRTools::checkZipcodeByCountry($tab['value'], array( - 'id_country' => Configuration::get('PS_COUNTRY_DEFAULT'))))) - $errorList['error'][$name] = $tab['error']; - else if ($zipcodeError < 0) - $errorList['warn'][$name] = $tab['warn']; + if (version_compare(_PS_VERSION_, '1.4', '>=')) + { + if (!(MRTools::checkZipcodeByCountry($tab['value'], array( + 'id_country' => Configuration::get('PS_SHOP_COUNTRY_ID'))))) + $errorList['error'][$name] = $tab['error']; + } + else + $errorList['warn'][$name] = $this->_mondialrelay->l('Post code cannot be validated with PrestaShop versions older than 1.4', $this->class_name); } - else if (isset($this->_fields['list'][$name]['regexValidation']) && - (!preg_match($this->_fields['list'][$name]['regexValidation'], $tab['value'], $matches))) + else if (isset($this->_fields['list'][$name]['regexValidation']) && + (!preg_match($this->_fields['list'][$name]['regexValidation'], $tab['value'], $matches))) $errorList['error'][$name] = $tab['error']; } return $errorList; } - + /* - * Get the values with associated fields name - * @fields : array containing multiple values information - */ + * Get the values with associated fields name + * @fields : array containing multiple values information + */ private function _getSimpleParamArray($fields) { $params = array(); - - foreach($fields as $keyName => $valueDetailed) + + foreach ($fields as $keyName => $valueDetailed) $params[$keyName] = $valueDetailed['value']; return $params; } - + /* * Return the fields list */ @@ -588,7 +611,7 @@ class MRCreateTickets implements IMondialRelayWSMethod { return $this->_fieldsList['list']; } - + /* * Return the result of one or multiple sent requests */ @@ -596,7 +619,7 @@ class MRCreateTickets implements IMondialRelayWSMethod { return $this->_resultList; } - + /* * Return which number order of the list is currently managed */ diff --git a/modules/mondialrelay/classes/MRDownloadPDF.php b/modules/mondialrelay/classes/MRDownloadPDF.php new file mode 100755 index 00000000..ebd3bd3a --- /dev/null +++ b/modules/mondialrelay/classes/MRDownloadPDF.php @@ -0,0 +1,191 @@ + +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once(dirname(__FILE__).'/IMondialRelayWSMethod.php'); + +/* + * Allow to create tickets - 'WSI2_CreationEtiquette' + */ +class MRDownloadPDF implements IMondialRelayWSMethod +{ + public $class_name = __CLASS__; + + private $_fields = array( + 'list' => array( + 'Enseigne' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z]{2}[0-9A-Z ]{6}$#'), + 'Expeditions' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9]{8}(;[0-9]{8})*$#'), + 'Langue' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[A-Z]{2}$#'), + 'Security' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z]{32}$#'))); + + + private $_mondialrelay = null; + private $_fieldsList = array(); + private $_webServiceKey = ''; + private $_markCode = ''; + private $Expeditions = ''; + + private $_resultList = array( + 'error' => array(), + 'success' => array()); + + private $_webserviceURL = ''; + + public function __construct($params, $object) + { + $this->Expeditions = $params['Expeditions']; + $this->_mondialrelay = $object; + $this->_webServiceKey = $this->_mondialrelay->account_shop['MR_KEY_WEBSERVICE']; + $this->_markCode = $this->_mondialrelay->account_shop['MR_CODE_MARQUE']; + $this->class_name = Tools::strtolower($this->class_name); + $this->_webserviceURL = MondialRelay::MR_URL.'webservice/Web_Services.asmx?WSDL'; + } + + public function __destruct() + { + unset($this->_mondialrelay); + } + + /* + * Initiate the data needed to be send properly + * Can manage a list of data for multiple request + */ + public function init() + { + $this->_fields['list']['Enseigne']['value'] = $this->_mondialrelay->account_shop['MR_ENSEIGNE_WEBSERVICE']; + $this->_fields['list']['Expeditions']['value'] = $this->Expeditions; + $this->_fields['list']['Langue']['value'] = $this->_mondialrelay->account_shop['MR_LANGUAGE']; + $this->_fieldsList[] = $this->_fields; + $this->_generateMD5SecurityKey(); + } + + /* + * Generate the MD5 key for each param list + */ + private function _generateMD5SecurityKey() + { + foreach ($this->_fieldsList as &$rootCase) + { + $concatenationValue = ''; + foreach ($rootCase['list'] as $paramName => &$valueDetailed) + if ($paramName != 'Texte' && $paramName != 'Security') + { + $valueDetailed['value'] = Tools::strtoupper($valueDetailed['value']); + if (preg_match($valueDetailed['regexValidation'], $valueDetailed['value'], $matches)) + $concatenationValue .= $valueDetailed['value']; + elseif ((!Tools::strlen($valueDetailed['value']) && $valueDetailed['required']) || Tools::strlen($valueDetailed['value'])) + { + $error = $this->_mondialrelay->l('This key').' ['.$paramName.'] '.$this->_mondialrelay->l('hasn\'t a valide value format').' : '.$valueDetailed['value']; + $this->_resultList['error'][] = $error; + } + } + $concatenationValue .= $this->_webServiceKey; + $rootCase['list']['Security']['value'] = Tools::strtoupper(md5($concatenationValue)); + } + } + + /* + * Manage the return value of the webservice, handle the errors or build the + * succeed message + */ + private function _parseResult($client, $result, $params) + { + $errors = &$this->_resultList['error'][]; + $success = &$this->_resultList['success'][]; + $result = $result->WSI2_GetEtiquettesResult; + if (($errorNumber = $result->STAT) != 0) + { + $errors[] = $this->_mondialrelay->l('There is an error number : ', $this->class_name).$errorNumber; + $errors[] = $this->_mondialrelay->l('Details : ', $this->class_name). + $this->_mondialrelay->getErrorCodeDetail($errorNumber); + } + else + { + $baseURL = 'http://www.mondialrelay.fr'; + $success['URL_PDF_A4'] = $baseURL.$result->URL_PDF_A4; + $success['URL_PDF_A5'] = $baseURL.$result->URL_PDF_A5; + $success['URL_PDF_10x15'] = $baseURL.str_replace('format=A4', 'format=10x15', $result->URL_PDF_A4); + } + } + + /* + * Send one or multiple request to the webservice + */ + public function send() + { + if ($client = new SoapClient($this->_webserviceURL)) + { + $client->soap_defencoding = 'UTF-8'; + $client->decode_utf8 = false; + foreach ($this->_fieldsList as $rootCase) + { + $params = $this->_getSimpleParamArray($rootCase['list']); + $result = $client->WSI2_GetEtiquettes($params); + $this->_parseResult($client, $result, $params); + } + unset($client); + } + else + throw new Exception($this->_mondialrelay->l('The Mondial Relay webservice isn\'t currently reliable')); + } + + /* + * Return the fields list + */ + public function getFieldsList() + { + return $this->_fieldsList['list']; + } + + /* + * Return the result of one or multiple sent requests + */ + public function getResult() + { + return $this->_resultList; + } + + private function _getSimpleParamArray($fields) + { + $params = array(); + + foreach ($fields as $keyName => $valueDetailed) + $params[$keyName] = $valueDetailed['value']; + return $params; + } +} diff --git a/modules/mondialrelay/classes/MRGetRelayPoint.php b/modules/mondialrelay/classes/MRGetRelayPoint.php index 6ba8e773..f25a0afc 100755 --- a/modules/mondialrelay/classes/MRGetRelayPoint.php +++ b/modules/mondialrelay/classes/MRGetRelayPoint.php @@ -1,6 +1,6 @@ -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 7086 $ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ @@ -35,7 +35,7 @@ require_once(dirname(__FILE__).'/IMondialRelayWSMethod.php'); */ class MRGetRelayPoint implements IMondialRelayWSMethod { - // Params is required if you use a pointer function + /*Params is required if you use a pointer function*/ private $_fields = array( 'list' => array( 'Enseigne' => array( @@ -49,7 +49,7 @@ class MRGetRelayPoint implements IMondialRelayWSMethod 'Ville' => array( 'required' => false, 'value' => '', - 'regexValidation' => '#^[A-Z_\-\' ]{2,25}$#'), + 'regexValidation' => '#^[A-Z_\-\' 0-9]{2,25}$#'), 'CP' => array( 'required' => false, 'value' => '', @@ -62,11 +62,11 @@ class MRGetRelayPoint implements IMondialRelayWSMethod 'Poids' => array( 'required' => false, 'value' => '', - 'regexValidation' => '#^[0-9]{1,6}$#'), + 'regexValidation' => '#^[0-9]{3,7}$#'), 'Action' => array( 'required' => false, 'value' => '', - 'regexValidation' => '#^(REL|24R|ESP|DRI)$#'), + 'regexValidation' => '#^(REL|24R|ESP|DRI)$#'), 'Security' => array( 'required' => true, 'value' => '', @@ -75,7 +75,7 @@ class MRGetRelayPoint implements IMondialRelayWSMethod private $_id_address_delivery = 0; private $_weight = 0; private $_webServiceKey = ''; - private $_mondialRelay = NULL; + private $_mondialRelay = null; private $_id_carrier = 0; private $_id_delivery_country = 0; @@ -83,34 +83,36 @@ class MRGetRelayPoint implements IMondialRelayWSMethod 'error' => array(), 'success' => array()); - private $_webserviceURL = 'http://www.mondialrelay.fr/webservice/Web_Services.asmx?WSDL'; + private $_webserviceURL; - public function __construct($params) - { + public function __construct($params, $object) + { + $this->_mondialRelay = $object; $this->_id_address_delivery = (int)($params['id_address_delivery']); $this->_id_carrier = (int)($params['id_carrier']); - $this->_weight = (float)($params['weight']); - $this->_webServiceKey = Configuration::get('MR_KEY_WEBSERVICE'); + $this->_weight = (float)($params['weight']); + $this->_webServiceKey = $this->_mondialRelay->account_shop['MR_KEY_WEBSERVICE']; + $this->_webserviceURL = MondialRelay::MR_URL.'webservice/Web_Services.asmx?WSDL'; } public function __destruct() { - unset($this->_mondialRelay); + unset($this->_mondialRelay); } public function init() - { - $this->_mondialRelay = new MondialRelay(); + { $address = new Address($this->_id_address_delivery); + $weight = $this->_mondialRelay->account_shop['MR_WEIGHT_COEFFICIENT'] * $this->_weight; if (!$address) throw new Exception($this->_mondialrelay->l('Customer address can\'t be found')); - $this->_fields['list']['Enseigne']['value'] = Configuration::get('MR_ENSEIGNE_WEBSERVICE'); - $this->_fields['list']['Poids']['value'] = Configuration::get('MR_WEIGHT_COEF') * $this->_weight; - $this->_fields['list']['Pays']['value'] = Country::getIsoById($address->id_country); - $this->_fields['list']['Ville']['value'] = $address->city; - $this->_fields['list']['CP']['value'] = $address->postcode; + $this->_fields['list']['Enseigne']['value'] = $this->_mondialRelay->account_shop['MR_ENSEIGNE_WEBSERVICE']; + $this->_fields['list']['Poids']['value'] = ($weight < 100) ? 100 : $weight; + $this->_fields['list']['Pays']['value'] = trim(Country::getIsoById($address->id_country)); + $this->_fields['list']['Ville']['value'] = trim($address->city); + $this->_fields['list']['CP']['value'] = trim($address->postcode); $this->_fields['list']['CP']['params']['id_country'] = $address->id_country; $this->_generateMD5SecurityKey(); @@ -123,27 +125,23 @@ class MRGetRelayPoint implements IMondialRelayWSMethod private function _generateMD5SecurityKey() { $concatenationValue = ''; - foreach($this->_fields['list'] as $paramName => &$valueDetailed) + foreach ($this->_fields['list'] as $paramName => &$valueDetailed) if ($paramName != 'Texte' && $paramName != 'Security') { // Mac server make an empty string instead of a cleaned string // TODO : test on windows and linux server - $cleanedString = MRTools::replaceAccentedCharacters($valueDetailed['value']); - $valueDetailed['value'] = !empty($cleanedString) ? strtoupper($cleanedString) : strtoupper($valueDetailed['value']); + $cleanedString = MRTools::removeAccents($valueDetailed['value']); + $valueDetailed['value'] = !empty($cleanedString) ? Tools::strtoupper($cleanedString) : Tools::strtoupper($valueDetailed['value']); - $valueDetailed['value'] = strtoupper($valueDetailed['value']); + $valueDetailed['value'] = Tools::strtoupper($valueDetailed['value']); // Call a pointer function if exist to do different test - if (isset($valueDetailed['methodValidation']) && - method_exists('MRTools', $valueDetailed['methodValidation']) && - isset($valueDetailed['params']) && - MRTools::$valueDetailed['methodValidation']($valueDetailed['value'], $valueDetailed['params'])) + if (isset($valueDetailed['methodValidation']) && method_exists('MRTools', $valueDetailed['methodValidation']) && isset($valueDetailed['params']) && MRTools::$valueDetailed['methodValidation']($valueDetailed['value'], $valueDetailed['params'])) $concatenationValue .= $valueDetailed['value']; // Use simple Regex test given by MondialRelay - else if (isset($valueDetailed['regexValidation']) && - preg_match($valueDetailed['regexValidation'], $valueDetailed['value'], $matches)) + else if (isset($valueDetailed['regexValidation']) && preg_match($valueDetailed['regexValidation'], $valueDetailed['value'], $matches)) $concatenationValue .= $valueDetailed['value']; - // If the key is required, we set an error, else it's skipped - else if ((!strlen($valueDetailed['value']) && $valueDetailed['required']) || strlen($valueDetailed['value'])) + // If the key is required, we set an error, else it's skipped + elseif ((!Tools::strlen($valueDetailed['value']) && $valueDetailed['required']) || Tools::strlen($valueDetailed['value'])) { $error = $this->_mondialRelay->l('This key').' ['.$paramName.'] '. $this->_mondialRelay->l('hasn\'t a valide value format').' : '.$valueDetailed['value']; @@ -151,7 +149,7 @@ class MRGetRelayPoint implements IMondialRelayWSMethod } } $concatenationValue .= $this->_webServiceKey; - $this->_fields['list']['Security']['value'] = strtoupper(md5($concatenationValue)); + $this->_fields['list']['Security']['value'] = Tools::strtoupper(md5($concatenationValue)); } /* @@ -162,7 +160,7 @@ class MRGetRelayPoint implements IMondialRelayWSMethod { $params = array(); - foreach($fields as $keyName => $valueDetailed) + foreach ($fields as $keyName => $valueDetailed) $params[$keyName] = $valueDetailed['value']; return $params; } @@ -173,31 +171,28 @@ class MRGetRelayPoint implements IMondialRelayWSMethod private function _getRelayPointDetails($relayPointList) { $relayPointNumList = array(); - foreach($relayPointList as $num => $relayPoint) + foreach ($relayPointList as $relayPoint) $relayPointNumList[] = $relayPoint['Num']; - - $MRRelayDetail = new MRRelayDetail(array( - 'relayPointNumList' => $relayPointNumList, - 'id_address_delivery' => $this->_id_address_delivery)); - $MRRelayDetail->init(); - $MRRelayDetail->send(); - return $MRRelayDetail->getResult(); + $MRRelayDetail = new MRRelayDetail(array('relayPointNumList' => $relayPointNumList, 'id_address_delivery' => $this->_id_address_delivery)); + $MRRelayDetail->init(); + $MRRelayDetail->send(); + return $MRRelayDetail->getResult(); } - + /* ** Generate a perman link to view relay detail on their website */ private function _addLinkHoursDetail(&$relayPointList) { $relayPointNumList = array(); - foreach($relayPointList as $num => $relayPoint) - $relayPointNumList[] = $relayPoint['Num']; + foreach ($relayPointList as $relayPoint) + $relayPointNumList[] = $relayPoint->Num; $permaList = MRRelayDetail::getPermaLink($relayPointNumList, $this->_id_address_delivery); - foreach($relayPointList as $num => &$relayPoint) + foreach ($relayPointList as &$relayPoint) { - $relayPoint['permaLinkDetail'] = ''; - if (array_key_exists($relayPoint['Num'], $permaList)) - $relayPoint['permaLinkDetail'] = $permaList[$relayPoint['Num']]; + $relayPoint->permaLinkDetail = ''; + if (array_key_exists($relayPoint->Num, $permaList)) + $relayPoint->permaLinkDetail = $permaList[$relayPoint->Num]; } return $relayPointList; } @@ -210,46 +205,41 @@ class MRGetRelayPoint implements IMondialRelayWSMethod { $errors = array(); $success = array(); - - if ($client->fault) - $errors[$errorTotal++] = $this->_mondialRelay->l('It seems the request isn\'t valid:'). - $result; - - $result = $result['WSI2_RecherchePointRelaisResult']; - if (($errorNumber = $result['STAT']) != 0) + $result = $result->WSI2_RecherchePointRelaisResult; + if (($errorNumber = $result->STAT) != 0) { $errors[] = $this->_mondialRelay->l('There is an error number : ').$errorNumber; $errors[] = $this->_mondialRelay->l('Details : '). - $this->_mondialRelay->getErrorCodeDetail($errorNumber); + $this->_mondialRelay->getErrorCodeDetail($errorNumber); } else { - unset($result['STAT']); + unset($result->STAT); // Clean Content - foreach($result as $num => $relayPoint) + foreach ($result as $num => $relayPoint) { $totalEmptyFields = 0; - foreach ($relayPoint as $key => &$value) + foreach ($relayPoint as &$value) { - $value = trim($value); - if (empty($value)) - ++$totalEmptyFields; - } - if ($totalEmptyFields == count($relayPoint)) - unset($result[$num]); - } - if (!count($result)) - $errors[] = $this->_mondialRelay->l('MondialRelay can\'t find any relay point near your address. Maybe your address isn\'t properly filled ?'); - else - { - $this->_addLinkHoursDetail($result); - - // Fetch detail info using webservice (not used anymore) - // $this->_generateLinkHoursDetail($result); - // $result = (count($relayDetail['success'])) ? $relayDetail['success'] : $result; - } - $success = $result; + $value = trim($value); + if (empty($value)) + ++$totalEmptyFields; + } + if ($totalEmptyFields == count($relayPoint)) + unset($result[$num]); + } + if (!count($result)) + $errors[] = $this->_mondialRelay->l('MondialRelay can\'t find any relay point near your address. Maybe your address isn\'t properly filled ?'); + else + { + $this->_addLinkHoursDetail($result); + + // Fetch detail info using webservice (not used anymore) + // $this->_generateLinkHoursDetail($result); + // $result = (count($relayDetail['success'])) ? $relayDetail['success'] : $result; + } + $success = $result; } $this->_resultList['error'] = $errors; $this->_resultList['success'] = $success; @@ -260,18 +250,13 @@ class MRGetRelayPoint implements IMondialRelayWSMethod */ public function send() { - if ($client = new nusoap_client($this->_webserviceURL, true)) + if ($client = new SoapClient($this->_webserviceURL)) { $client->soap_defencoding = 'UTF-8'; $client->decode_utf8 = false; $params = $this->_getSimpleParamArray($this->_fields['list']); - $result = $client->call( - 'WSI2_RecherchePointRelais', - $params, - 'http://www.mondialrelay.fr/webservice/', - 'http://www.mondialrelay.fr/webservice/WSI2_RecherchePointRelais'); - + $result = $client->WSI2_RecherchePointRelais($params); $this->_parseResult($client, $result, $params); unset($client); } diff --git a/modules/mondialrelay/classes/MRGetTickets.php b/modules/mondialrelay/classes/MRGetTickets.php index b082c384..da0f638b 100755 --- a/modules/mondialrelay/classes/MRGetTickets.php +++ b/modules/mondialrelay/classes/MRGetTickets.php @@ -1,6 +1,6 @@ -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 8783 $ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ @@ -56,31 +56,31 @@ class MRGetTickets implements IMondialRelayWSMethod private $_detailedExpeditionList = array(); private $_webServiceKey = ''; - private $_mondialRelay = NULL; + private $_mondialrelay = null; private $_resultList = array( 'error' => array(), 'success' => array()); - private $_webserviceURL = 'http://www.mondialrelay.fr/webservice/Web_Services.asmx?WSDL'; + private $_webserviceURL; - public function __construct($params) + public function __construct($params, $object) { + $this->_mondialrelay = $object; $this->_detailedExpeditionList = $params['detailedExpeditionList']; - $this->_webServiceKey = Configuration::get('MR_KEY_WEBSERVICE'); + $this->_webServiceKey = $this->_mondialrelay->account_shop['MR_KEY_WEBSERVICE']; + $this->_webserviceURL = MondialRelay::MR_URL.'webservice/Web_Services.asmx?WSDL'; } public function __destruct() { - unset($this->_mondialRelay); + unset($this->_mondialrelay); } public function init() - { - $this->_mondialRelay = new MondialRelay(); - - $this->_fields['list']['Enseigne']['value'] = Configuration::get('MR_ENSEIGNE_WEBSERVICE'); - $this->_fields['list']['Langue']['value'] = Configuration::get('MR_LANGUAGE'); + { + $this->_fields['list']['Enseigne']['value'] = $this->_mondialrelay->account_shop['MR_ENSEIGNE_WEBSERVICE']; + $this->_fields['list']['Langue']['value'] = $this->_mondialrelay->account_shop['MR_LANGUAGE']; foreach ($this->_detailedExpeditionList as $detailedExpedition) { @@ -101,24 +101,24 @@ class MRGetTickets implements IMondialRelayWSMethod { // RootCase is the array case where the main information are stored // it's an array containing id_mr_selected and an array with the necessary fields - foreach($this->_fieldsList as &$rootCase) + foreach ($this->_fieldsList as &$rootCase) { $concatenationValue = ''; - foreach($rootCase['list'] as $paramName => &$valueDetailed) + foreach ($rootCase['list'] as $paramName => &$valueDetailed) if ($paramName != 'Texte' && $paramName != 'Security') { - $valueDetailed['value'] = strtoupper($valueDetailed['value']); + $valueDetailed['value'] = Tools::strtoupper($valueDetailed['value']); if (preg_match($valueDetailed['regexValidation'], $valueDetailed['value'], $matches)) $concatenationValue .= $valueDetailed['value']; - elseif ((!strlen($valueDetailed['value']) && $valueDetailed['required']) || strlen($valueDetailed['value'])) + elseif ((!Tools::strlen($valueDetailed['value']) && $valueDetailed['required']) || Tools::strlen($valueDetailed['value'])) { - $error = $this->_mondialRelay->l('This key').' ['.$paramName.'] '.$this->_mondialRelay->l('hasn\'t a valide value format').' : '.$valueDetailed['value']; + $error = $this->_mondialrelay->l('This key').' ['.$paramName.'] '.$this->_mondialrelay->l('hasn\'t a valide value format').' : '.$valueDetailed['value']; $id_order = $this->_getOrderIdWithExpeditionNumber($rootCase['list']['Expeditions']['value']); $this->_resultList['error'][$id_order][] = $error; } } $concatenationValue .= $this->_webServiceKey; - $rootCase['list']['Security']['value' ] = strtoupper(md5($concatenationValue)); + $rootCase['list']['Security']['value'] = Tools::strtoupper(md5($concatenationValue)); } } @@ -130,7 +130,7 @@ class MRGetTickets implements IMondialRelayWSMethod { $params = array(); - foreach($fields as $keyName => $valueDetailed) + foreach ($fields as $keyName => $valueDetailed) $params[$keyName] = $valueDetailed['value']; return $params; } @@ -141,14 +141,14 @@ class MRGetTickets implements IMondialRelayWSMethod private function _updateTable($id_order, $expeditionNumber, $URLA4, $URLA5, &$success) { $query = ' - SELECT id FROM `'._DB_PREFIX_.'mr_historique` + SELECT id FROM `'._DB_PREFIX_.'mr_history` WHERE `order`='.(int)$id_order; $row = Db::getInstance()->getRow($query); if ($row) { $query = ' - UPDATE `'._DB_PREFIX_.'mr_historique` + UPDATE `'._DB_PREFIX_.'mr_history` SET `exp` = \''.(int)$expeditionNumber.'\', `url_a4` = \''.pSQL((string)$URLA4).'\', @@ -158,7 +158,7 @@ class MRGetTickets implements IMondialRelayWSMethod else { $query = ' - INSERT INTO '._DB_PREFIX_.'mr_historique + INSERT INTO '._DB_PREFIX_.'mr_history (`order`, `exp`, `url_a4`, `url_a5`) VALUES ( '.(int)$id_order.', @@ -166,7 +166,7 @@ class MRGetTickets implements IMondialRelayWSMethod \''.pSQL((string)$URLA4).'\', \''.pSQL((string)$URLA5).'\')'; } - Db::getInstance()->Execute($query); + Db::getInstance()->execute($query); $success['id_mr_history'] = isset($row['id']) ? $row['id'] : Db::getInstance()->Insert_ID(); } @@ -180,27 +180,24 @@ class MRGetTickets implements IMondialRelayWSMethod $success = array(); $id_order = $this->_getOrderIdWithExpeditionNumber($params['Expeditions']); - if ($client->fault) - $errors[$errorTotal++] = $this->_mondialRelay->l('It seems the request isn\'t valid:'). - $result; - - $result = $result['WSI2_GetEtiquettesResult']; - if (($errorNumber = $result['STAT']) != 0) + $result = $result->WSI2_GetEtiquettesResult; + if (($errorNumber = $result->STAT) != 0) { - $errors[] = $this->_mondialRelay->l('There is an error number : ').$errorNumber; - $errors[] = $this->_mondialRelay->l('Details : '). - $this->_mondialRelay->getErrorCodeDetail($errorNumber); + $errors[] = $this->_mondialrelay->l('There is an error number : ').$errorNumber; + $errors[] = $this->_mondialrelay->l('Details : '). + $this->_mondialrelay->getErrorCodeDetail($errorNumber); } else { $baseURL = 'http://www.mondialrelay.fr'; - $URLPDF_A4 = $baseURL.$result['URL_PDF_A4']; - $URLPDF_A5 = $baseURL.$result['URL_PDF_A5']; - + $URLPDF_A4 = $baseURL.$result->URL_PDF_A4; + $URLPDF_A5 = $baseURL.$result->URL_PDF_A5; + $success['id_order'] = $id_order; $success['expeditionNumber'] = $params['Expeditions']; $success['URLPDF_A4'] = $URLPDF_A4; $success['URLPDF_A5'] = $URLPDF_A5; + $success['URLPDF_10x15'] = $baseURL.str_replace('format=A4', 'format=10x15', $result->URL_PDF_A4); $this->_updateTable($id_order, $params['Expeditions'], $URLPDF_A4, $URLPDF_A5, $success); } $this->_resultList['error'][$id_order] = $errors; @@ -212,7 +209,7 @@ class MRGetTickets implements IMondialRelayWSMethod */ private function _getOrderIdWithExpeditionNumber($expeditionNumber) { - foreach($this->_detailedExpeditionList as $detailedExpedition) + foreach ($this->_detailedExpeditionList as $detailedExpedition) if ($detailedExpedition['expeditionNumber'] == $expeditionNumber) return $detailedExpedition['id_order']; return 0; @@ -223,26 +220,21 @@ class MRGetTickets implements IMondialRelayWSMethod */ public function send() { - if ($client = new nusoap_client($this->_webserviceURL, true)) + if ($client = new SoapClient($this->_webserviceURL)) { $client->soap_defencoding = 'UTF-8'; $client->decode_utf8 = false; - foreach($this->_fieldsList as $rootCase) + foreach ($this->_fieldsList as $rootCase) { $params = $this->_getSimpleParamArray($rootCase['list']); - $result = $client->call( - 'WSI2_GetEtiquettes', - $params, - 'http://www.mondialrelay.fr/webservice/', - 'http://www.mondialrelay.fr/webservice/WSI2_GetEtiquettes'); - + $result = $client->WSI2_GetEtiquettes($params); $this->_parseResult($client, $result, $params); } unset($client); } else - throw new Exception($this->_mondialRelay->l('The Mondial Relay webservice isn\'t currently reliable')); + throw new Exception($this->_mondialrelay->l('The Mondial Relay webservice isn\'t currently reliable')); } /* diff --git a/modules/mondialrelay/classes/MRManagement.php b/modules/mondialrelay/classes/MRManagement.php index bf373082..f7e28dbd 100755 --- a/modules/mondialrelay/classes/MRManagement.php +++ b/modules/mondialrelay/classes/MRManagement.php @@ -1,6 +1,6 @@ -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 9219 $ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ @@ -42,30 +42,29 @@ class MRManagement extends MondialRelay parent::__construct(); } - public function __destruct() - { - - } - /* ** This method fill the database with the selected carrier */ public function addSelectedCarrierToDB() { - $query = 'SELECT `id_mr_selected` - FROM `' . _DB_PREFIX_ . 'mr_selected` - WHERE `id_cart` = '.(int)$this->_params['id_cart']; - + $db = Db::getInstance(); + // insutance + $sql = 'SELECT insurance FROM '._DB_PREFIX_.'mr_method WHERE id_mr_method = '.(int)$this->_params['id_mr_method']; + $insurance = $db->getValue($sql); + + $query = 'SELECT `id_mr_selected` FROM `'._DB_PREFIX_.'mr_selected` WHERE `id_cart` = '.(int)$this->_params['id_cart'].' '; + // Not exist and needed for database unset($this->_params['relayPointInfo']['permaLinkDetail']); // Update if Exist else add a new entry - if (Db::getInstance()->getRow($query)) + if ($db->getRow($query)) { $query = 'UPDATE `'._DB_PREFIX_.'mr_selected` - SET `id_method` = '.(int)$this->_params['id_mr_method'].', '; + SET `id_method` = '.(int)$this->_params['id_mr_method'].', + `MR_insurance` = '.(int)$insurance.','; if (is_array($this->_params['relayPointInfo'])) - foreach($this->_params['relayPointInfo'] as $nameKey => $value) + foreach ($this->_params['relayPointInfo'] as $nameKey => $value) $query .= '`MR_Selected_'.MRTools::bqSQL($nameKey).'` = "'.pSQL($value).'", '; else // Clean the existing relay point data $query .= ' @@ -82,34 +81,36 @@ class MRManagement extends MondialRelay else { $query = 'INSERT INTO `'._DB_PREFIX_.'mr_selected` - (`id_customer`, `id_method`, `id_cart`, '; + (`id_customer`, `id_method`, `id_cart`, MR_insurance, '; if (is_array($this->_params['relayPointInfo'])) - foreach($this->_params['relayPointInfo'] as $nameKey => $value) + foreach ($this->_params['relayPointInfo'] as $nameKey => $value) $query .= '`MR_Selected_'.MRTools::bqSQL($nameKey).'`, '; $query = rtrim($query, ', ').') VALUES ( '.(int)$this->_params['id_customer'].', '.(int)$this->_params['id_mr_method'].', - '.(int)$this->_params['id_cart'].', '; + '.(int)$this->_params['id_cart'].', + '.(int)$insurance.', '; + if (is_array($this->_params['relayPointInfo'])) - foreach($this->_params['relayPointInfo'] as $nameKey => $value) + foreach ($this->_params['relayPointInfo'] as $nameKey => $value) $query .= '"'.pSQL($value).'", '; $query = rtrim($query, ', ').')'; } - Db::getInstance()->Execute($query); + $db->execute($query); } - + public function uninstallDetail() { $html = ''; - switch($this->_params['action']) + switch ($this->_params['action']) { case 'showFancy': $html .= '

'.$this->l('Uninstalling Mondial Relay').'

- '.$this->l('You\'re attempt to uninstall the module, do you want to remove the database').' ? + '.$this->l('You\'re about to uninstall the module, do you want to remove the database').' ?


@@ -139,24 +140,23 @@ class MRManagement extends MondialRelay if (is_array($this->_params['historyIdList']) && count($this->_params['historyIdList'])) { $query = ' - DELETE FROM `'._DB_PREFIX_.'mr_historique` + DELETE FROM `'._DB_PREFIX_.'mr_history` WHERE id IN('; - foreach($this->_params['historyIdList'] as $id) + foreach ($this->_params['historyIdList'] as $id) $query .= (int)$id.', '; $query = trim($query, ', ').')'; $success['deletedListId'] = $this->_params['historyIdList']; - $totalDeleted = Db::getInstance()->Execute($query); + $totalDeleted = Db::getInstance()->execute($query); if (count($success['deletedListId']) != $totalDeleted) { $error[] = $this->l('Some items can\'t be removed, please try to remove it again'); - foreach($success['deletedListId'] as $id) + foreach ($success['deletedListId'] as $id) { $query = ' - SELECT id FROM `'._DB_PREFIX_.'mr_historique` + SELECT id FROM `'._DB_PREFIX_.'mr_history` WHERE id='.(int)$id; - if (Db::getInstance()->getRow($query) && - ($key = array_search($id, $success['deletedListId'])) !== FALSE) + if (Db::getInstance()->getRow($query) && ($key = array_search($id, $success['deletedListId'])) !== false) unset($success['deletedListId'][$key]); } } @@ -167,5 +167,4 @@ class MRManagement extends MondialRelay throw new Exception($this->l('Please select at least one history element')); return $this->_resultList; } -} -?> +} \ No newline at end of file diff --git a/modules/mondialrelay/classes/MRRelayDetail.php b/modules/mondialrelay/classes/MRRelayDetail.php index d7ca77b4..1d2ab9bb 100755 --- a/modules/mondialrelay/classes/MRRelayDetail.php +++ b/modules/mondialrelay/classes/MRRelayDetail.php @@ -1,6 +1,6 @@ -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 8783 $ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ @@ -54,40 +54,42 @@ class MRRelayDetail implements IMondialRelayWSMethod 'value' => '', 'regexValidation' => '#^[0-9A-Z]{32}$#'))); - private $_relayPointNumList = array(); + private $_relayPointNumList = array(); private $_id_address_delivery = 0; private $_webServiceKey = ''; - private $_mondialRelay = NULL; + private $_mondialrelay = null; private $_markCode = ''; private $_resultList = array( 'error' => array(), 'success' => array()); - private $_webserviceURL = 'http://www.mondialrelay.fr/webservice/Web_Services.asmx?WSDL'; + private $_webserviceURL = ''; - public function __construct($params) + public function __construct($params, $object) { + $this->_mondialrelay = $object; + $this->_relayPointNumList = $params['relayPointNumList']; $this->_id_address_delivery = (int)($params['id_address_delivery']); - $this->_webServiceKey = Configuration::get('MR_KEY_WEBSERVICE'); - $this->_markCode = Configuration::get('MR_CODE_MARQUE'); + $this->_webServiceKey = $this->_mondialRelay->account_shop['MR_KEY_WEBSERVICE']; + $this->_markCode = $this->_mondialRelay->account_shop['MR_CODE_MARQUE']; + $this->_webserviceURL = MondialRelay::MR_URL.'webservice/Web_Services.asmx?WSDL'; } public function __destruct() { - unset($this->_mondialRelay); + unset($this->_mondialrelay); } public function init() - { - $this->_mondialRelay = new MondialRelay(); + { $address = new Address($this->_id_address_delivery); if (!$address) throw new Exception($this->_mondialrelay->l('Customer address can\'t be found')); - $this->_fields['list']['Enseigne']['value'] = Configuration::get('MR_ENSEIGNE_WEBSERVICE'); + $this->_fields['list']['Enseigne']['value'] = $this->_mondialRelay->account_shop['MR_ENSEIGNE_WEBSERVICE']; $this->_fields['list']['Pays']['value'] = Country::getIsoById($address->id_country); foreach ($this->_relayPointNumList as $num) @@ -110,39 +112,35 @@ class MRRelayDetail implements IMondialRelayWSMethod { // RootCase is the array case where the main information are stored // it's an array containing id_mr_selected and an array with the necessary fields - foreach($this->_fieldsList as &$rootCase) + foreach ($this->_fieldsList as &$rootCase) { $concatenationValue = ''; - foreach($rootCase['list'] as $paramName => &$valueDetailed) + foreach ($rootCase['list'] as $paramName => &$valueDetailed) if ($paramName != 'Texte' && $paramName != 'Security') { // Mac server make an empty string instead of a cleaned string // TODO : test on windows and linux server - $cleanedString = MRTools::replaceAccentedCharacters($valueDetailed['value']); - $valueDetailed['value'] = !empty($cleanedString) ? strtoupper($cleanedString) : strtoupper($valueDetailed['value']); + $cleanedString = MRTools::removeAccents($valueDetailed['value']); + $valueDetailed['value'] = !empty($cleanedString) ? Tools::strtoupper($cleanedString) : Tools::strtoupper($valueDetailed['value']); // Call a pointer function if exist to do different test - if (isset($valueDetailed['methodValidation']) && - method_exists('MRTools', $valueDetailed['methodValidation']) && - isset($valueDetailed['params']) && - MRTools::$valueDetailed['methodValidation']($valueDetailed['value'], $valueDetailed['params'])) + if (isset($valueDetailed['methodValidation']) && method_exists('MRTools', $valueDetailed['methodValidation']) && isset($valueDetailed['params']) && MRTools::$valueDetailed['methodValidation']($valueDetailed['value'], $valueDetailed['params'])) $concatenationValue .= $valueDetailed['value']; // Use simple Regex test given by MondialRelay - else if (isset($valueDetailed['regexValidation']) && - preg_match($valueDetailed['regexValidation'], $valueDetailed['value'], $matches)) + else if (isset($valueDetailed['regexValidation']) && preg_match($valueDetailed['regexValidation'], $valueDetailed['value'], $matches)) $concatenationValue .= $valueDetailed['value']; - // If the key is required, we set an error, else it's skipped - else if ((!strlen($valueDetailed['value']) && $valueDetailed['required']) || strlen($valueDetailed['value'])) + // If the key is required, we set an error, else it's skipped + elseif ((!Tools::strlen($valueDetailed['value']) && $valueDetailed['required']) || Tools::strlen($valueDetailed['value'])) { if (empty($valueDetailed['value'])) - $error = $this->_mondialRelay->l('This key').' ['.$paramName.'] '.$this->_mondialRelay->l('is empty and need to be filled'); + $error = $this->_mondialrelay->l('This key').' ['.$paramName.'] '.$this->_mondialrelay->l('is empty and need to be filled'); else - $error = 'This key ['.$paramName.'] hasn\'t a valid value format : '.$valueDetailed['value']; + $error = 'This key ['.$paramName.'] hasn\'t a valid value format : '.$valueDetailed['value']; $this->_resultList['error'][$rootCase['list']['Num']['value']] = $error; } } $concatenationValue .= $this->_webServiceKey; - $rootCase['list']['Security']['value' ] = strtoupper(md5($concatenationValue)); + $rootCase['list']['Security']['value'] = Tools::strtoupper(md5($concatenationValue)); } } @@ -154,7 +152,7 @@ class MRRelayDetail implements IMondialRelayWSMethod { $params = array(); - foreach($fields as $keyName => $valueDetailed) + foreach ($fields as $keyName => $valueDetailed) $params[$keyName] = $valueDetailed['value']; return $params; } @@ -166,44 +164,41 @@ class MRRelayDetail implements IMondialRelayWSMethod private function _parseResult($client, $result, $params) { $errors = array(); - - if ($client->fault) - $errors[$errorTotal++] = $this->_mondialRelay->l('It seems the request isn\'t valid:'). - $result; - $result = $result['WSI2_DetailPointRelaisResult']; - if (($errorNumber = $result['STAT']) != 0) + $result = $result->WSI2_DetailPointRelaisResult; + if (($errorNumber = $result->STAT) != 0) { - $errors[] = $this->_mondialRelay->l('There is an error number : ').$errorNumber; - $errors[] = $this->_mondialRelay->l('Details : '). - $this->_mondialRelay->getErrorCodeDetail($errorNumber); + $errors[] = $this->_mondialrelay->l('There is an error number : ').$errorNumber; + $errors[] = $this->_mondialrelay->l('Details : '). + $this->_mondialrelay->getErrorCodeDetail($errorNumber); } else { $HDayList = array( - 'Horaires_Lundi' => $this->_mondialRelay->l('Monday'), - 'Horaires_Mardi' => $this->_mondialRelay->l('Tuesday'), - 'Horaires_Mercredi' => $this->_mondialRelay->l('Wednesday'), - 'Horaires_Jeudi' => $this->_mondialRelay->l('Thursday'), - 'Horaires_Vendredi' => $this->_mondialRelay->l('Friday'), - 'Horaires_Samedi' => $this->_mondialRelay->l('Saturday'), - 'Horaires_Dimanche' => $this->_mondialRelay->l('Sunday')); + 'Horaires_Lundi' => $this->_mondialrelay->l('Monday'), + 'Horaires_Mardi' => $this->_mondialrelay->l('Tuesday'), + 'Horaires_Mercredi' => $this->_mondialrelay->l('Wednesday'), + 'Horaires_Jeudi' => $this->_mondialrelay->l('Thursday'), + 'Horaires_Vendredi' => $this->_mondialrelay->l('Friday'), + 'Horaires_Samedi' => $this->_mondialrelay->l('Saturday'), + 'Horaires_Dimanche' => $this->_mondialrelay->l('Sunday')); $orderedDate = array(); // Format hour properly $priority = 0; - foreach($HDayList as $day => $tradDayName) + foreach ($HDayList as $day => $tradDayName) { - foreach($result[$day]['string'] as $num => &$value) + $mr_day = $result->{$day}; + foreach ($mr_day['string'] as &$value) if ($value == '0000') $value = ''; else $value = implode('h', str_split($value, 2)); - $orderedDate[$priority++] = array('name' => $tradDayName, 'list' => $result[$day]); + $orderedDate[$priority++] = array('name' => $tradDayName, 'list' => $mr_day); unset($result[$day]); } - $result['orderedDate'] = $orderedDate; - $this->_resultList['success'][$result['Num']] = $result; - } + $result->orderedDate = $orderedDate; + $this->_resultList['success'][$result->Num] = $result; + } $this->_resultList['error'][] = $errors; } @@ -212,48 +207,44 @@ class MRRelayDetail implements IMondialRelayWSMethod */ public function send() { - if ($client = new nusoap_client($this->_webserviceURL, true)) + if ($client = new SoapClient($this->_webserviceURL)) { $client->soap_defencoding = 'UTF-8'; $client->decode_utf8 = false; - foreach($this->_fieldsList as $rootCase) + foreach ($this->_fieldsList as $rootCase) { $params = $this->_getSimpleParamArray($rootCase['list']); - $result = $client->call( - 'WSI2_DetailPointRelais', - $params, - 'http://www.mondialrelay.fr/webservice/', - 'http://www.mondialrelay.fr/webservice/WSI2_GetEtiquettes'); - + $result = $client->WSI2_DetailPointRelais($params); $this->_parseResult($client, $result, $params); } unset($client); } else - throw new Exception($this->_mondialRelay->l('The Mondial Relay webservice isn\'t currently reliable')); + throw new Exception($this->_mondialrelay->l('The Mondial Relay webservice isn\'t currently reliable')); } /* ** Generate a list of perma link */ - static public function getPermaLink($relayList, $id_address_delivery) + public static function getPermaLink($relayList, $id_address_delivery) { if (!($address = new Address($id_address_delivery))) return array(); + + $mondialrelay = new MondialRelay(); - $permaList = array(); - $iso = strtoupper(Country::getIsoById($address->id_country)); - $ens = strtoupper(Configuration::get('MR_ENSEIGNE_WEBSERVICE').Configuration::get('MR_CODE_MARQUE')); - $url = 'http://www.mondialrelay.com/public/permanent/details_relais.aspx?ens='. - Configuration::get('MR_ENSEIGNE_WEBSERVICE').Configuration::get('MR_CODE_MARQUE'); - foreach($relayList as $num => $relayNum) + $list = array(); + $iso = Tools::strtoupper(Country::getIsoById($address->id_country)); + $ens = $mondialrelay->account_shop['MR_ENSEIGNE_WEBSERVICE'].$mondialrelay->account_shop['MR_CODE_MARQUE']; + $url = 'http://www.mondialrelay.com/public/permanent/details_relais.aspx?ens='.$ens; + foreach ($relayList as $relayNum) { - $crc = strtoupper(MD5('<'.$ens.'>'.$relayNum.$iso.'<'.Configuration::get('MR_KEY_WEBSERVICE').'>')); - $permaList[$relayNum] = $url.'&num='.$relayNum.'&pays='.$iso.'&crc='.$crc; + $crc = Tools::strtoupper(md5('<'.Tools::strtoupper($ens).'>'.$relayNum.$iso.'<'.$mondialrelay->account_shop['MR_KEY_WEBSERVICE'].'>')); + $list[$relayNum] = $url.'&num='.$relayNum.'&pays='.$iso.'&crc='.$crc; } - unset($address); - return $permaList; + unset($address, $mondialrelay); + return $list; } /* diff --git a/modules/mondialrelay/classes/MRTools.php b/modules/mondialrelay/classes/MRTools.php index 823ee028..0747560f 100755 --- a/modules/mondialrelay/classes/MRTools.php +++ b/modules/mondialrelay/classes/MRTools.php @@ -1,6 +1,6 @@ -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 6839 $ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ @@ -30,29 +30,201 @@ */ class MRTools { - /* - ** Replace all accented chars to normal - */ - static public function replaceAccentedCharacters($string) + const REGEX_CLEAN_ADDR = '/[^a-zA-Z0-9-\s\'\!\,\|\(\)\.\*\&\#\/\:]/'; + + const REGEX_CLEAN_PHONE = '/[^0-9+\(\)]*/'; + + /** + * Check if a string could be UTF8 one + * + * @static + * @param $str + * @return bool + */ + public static function seemsUTF8($str) { - if (function_exists('iconv')) + $length = strlen($str); + + for ($i = 0; $i < $length; $i++) { - $currentLocale = setlocale(LC_ALL, NULL); - setlocale(LC_ALL, 'en_US.UTF8'); - $cleanedString = iconv('UTF-8','ASCII//TRANSLIT', $string); - setLocale(LC_ALL, $currentLocale); + $c = ord($str[$i]); + if ($c < 0x80) + $n = 0; # 0bbbbbbb + else if (($c & 0xE0) == 0xC0) + $n = 1; # 110bbbbb + else if (($c & 0xF0) == 0xE0) + $n = 2; # 1110bbbb + else if (($c & 0xF8) == 0xF0) + $n = 3; # 11110bbb + else if (($c & 0xFC) == 0xF8) + $n = 4; # 111110bb + else if (($c & 0xFE) == 0xFC) + $n = 5; # 1111110b + else + return false; # Does not match any model + for ($j = 0; $j < $n; $j++) + { + # n bytes matching 10bbbbbb follow ? + if ((++$i == $length) || ((ord($str[$i]) & 0xC0) != 0x80)) + return false; + } + } + return true; + } + + /** + * Converts all accent characters to ASCII characters. + * + * If there are no accent characters, then the string given is just returned. + * + * @param string $string Text that might have accent characters + * @return string Filtered string with replaced "nice" characters. + */ + public static function removeAccents($string) + { + if (!preg_match('/[\x80-\xff]/', $string)) + return $string; + + if (MRTools::seemsUTF8($string)) + { + $chars = array( + // Decompositions for Latin-1 Supplement + chr(195).chr(128) => 'A', chr(195).chr(129) => 'A', + chr(195).chr(130) => 'A', chr(195).chr(131) => 'A', + chr(195).chr(132) => 'A', chr(195).chr(133) => 'A', + chr(195).chr(135) => 'C', chr(195).chr(136) => 'E', + chr(195).chr(137) => 'E', chr(195).chr(138) => 'E', + chr(195).chr(139) => 'E', chr(195).chr(140) => 'I', + chr(195).chr(141) => 'I', chr(195).chr(142) => 'I', + chr(195).chr(143) => 'I', chr(195).chr(145) => 'N', + chr(195).chr(146) => 'O', chr(195).chr(147) => 'O', + chr(195).chr(148) => 'O', chr(195).chr(149) => 'O', + chr(195).chr(150) => 'O', chr(195).chr(153) => 'U', + chr(195).chr(154) => 'U', chr(195).chr(155) => 'U', + chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y', + chr(195).chr(159) => 's', chr(195).chr(160) => 'a', + chr(195).chr(161) => 'a', chr(195).chr(162) => 'a', + chr(195).chr(163) => 'a', chr(195).chr(164) => 'a', + chr(195).chr(165) => 'a', chr(195).chr(167) => 'c', + chr(195).chr(168) => 'e', chr(195).chr(169) => 'e', + chr(195).chr(170) => 'e', chr(195).chr(171) => 'e', + chr(195).chr(172) => 'i', chr(195).chr(173) => 'i', + chr(195).chr(174) => 'i', chr(195).chr(175) => 'i', + chr(195).chr(177) => 'n', chr(195).chr(178) => 'o', + chr(195).chr(179) => 'o', chr(195).chr(180) => 'o', + chr(195).chr(181) => 'o', chr(195).chr(182) => 'o', + chr(195).chr(182) => 'o', chr(195).chr(185) => 'u', + chr(195).chr(186) => 'u', chr(195).chr(187) => 'u', + chr(195).chr(188) => 'u', chr(195).chr(189) => 'y', + chr(195).chr(191) => 'y', + // Decompositions for Latin Extended-A + chr(196).chr(128) => 'A', chr(196).chr(129) => 'a', + chr(196).chr(130) => 'A', chr(196).chr(131) => 'a', + chr(196).chr(132) => 'A', chr(196).chr(133) => 'a', + chr(196).chr(134) => 'C', chr(196).chr(135) => 'c', + chr(196).chr(136) => 'C', chr(196).chr(137) => 'c', + chr(196).chr(138) => 'C', chr(196).chr(139) => 'c', + chr(196).chr(140) => 'C', chr(196).chr(141) => 'c', + chr(196).chr(142) => 'D', chr(196).chr(143) => 'd', + chr(196).chr(144) => 'D', chr(196).chr(145) => 'd', + chr(196).chr(146) => 'E', chr(196).chr(147) => 'e', + chr(196).chr(148) => 'E', chr(196).chr(149) => 'e', + chr(196).chr(150) => 'E', chr(196).chr(151) => 'e', + chr(196).chr(152) => 'E', chr(196).chr(153) => 'e', + chr(196).chr(154) => 'E', chr(196).chr(155) => 'e', + chr(196).chr(156) => 'G', chr(196).chr(157) => 'g', + chr(196).chr(158) => 'G', chr(196).chr(159) => 'g', + chr(196).chr(160) => 'G', chr(196).chr(161) => 'g', + chr(196).chr(162) => 'G', chr(196).chr(163) => 'g', + chr(196).chr(164) => 'H', chr(196).chr(165) => 'h', + chr(196).chr(166) => 'H', chr(196).chr(167) => 'h', + chr(196).chr(168) => 'I', chr(196).chr(169) => 'i', + chr(196).chr(170) => 'I', chr(196).chr(171) => 'i', + chr(196).chr(172) => 'I', chr(196).chr(173) => 'i', + chr(196).chr(174) => 'I', chr(196).chr(175) => 'i', + chr(196).chr(176) => 'I', chr(196).chr(177) => 'i', + chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij', + chr(196).chr(180) => 'J', chr(196).chr(181) => 'j', + chr(196).chr(182) => 'K', chr(196).chr(183) => 'k', + chr(196).chr(184) => 'k', chr(196).chr(185) => 'L', + chr(196).chr(186) => 'l', chr(196).chr(187) => 'L', + chr(196).chr(188) => 'l', chr(196).chr(189) => 'L', + chr(196).chr(190) => 'l', chr(196).chr(191) => 'L', + chr(197).chr(128) => 'l', chr(197).chr(129) => 'L', + chr(197).chr(130) => 'l', chr(197).chr(131) => 'N', + chr(197).chr(132) => 'n', chr(197).chr(133) => 'N', + chr(197).chr(134) => 'n', chr(197).chr(135) => 'N', + chr(197).chr(136) => 'n', chr(197).chr(137) => 'N', + chr(197).chr(138) => 'n', chr(197).chr(139) => 'N', + chr(197).chr(140) => 'O', chr(197).chr(141) => 'o', + chr(197).chr(142) => 'O', chr(197).chr(143) => 'o', + chr(197).chr(144) => 'O', chr(197).chr(145) => 'o', + chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe', + chr(197).chr(148) => 'R',chr(197).chr(149) => 'r', + chr(197).chr(150) => 'R',chr(197).chr(151) => 'r', + chr(197).chr(152) => 'R',chr(197).chr(153) => 'r', + chr(197).chr(154) => 'S',chr(197).chr(155) => 's', + chr(197).chr(156) => 'S',chr(197).chr(157) => 's', + chr(197).chr(158) => 'S',chr(197).chr(159) => 's', + chr(197).chr(160) => 'S', chr(197).chr(161) => 's', + chr(197).chr(162) => 'T', chr(197).chr(163) => 't', + chr(197).chr(164) => 'T', chr(197).chr(165) => 't', + chr(197).chr(166) => 'T', chr(197).chr(167) => 't', + chr(197).chr(168) => 'U', chr(197).chr(169) => 'u', + chr(197).chr(170) => 'U', chr(197).chr(171) => 'u', + chr(197).chr(172) => 'U', chr(197).chr(173) => 'u', + chr(197).chr(174) => 'U', chr(197).chr(175) => 'u', + chr(197).chr(176) => 'U', chr(197).chr(177) => 'u', + chr(197).chr(178) => 'U', chr(197).chr(179) => 'u', + chr(197).chr(180) => 'W', chr(197).chr(181) => 'w', + chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y', + chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z', + chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z', + chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z', + chr(197).chr(190) => 'z', chr(197).chr(191) => 's', + // Euro Sign + chr(226).chr(130).chr(172) => 'E', + // GBP (Pound) Sign + chr(194).chr(163) => ''); + + $string = strtr($string, $chars); } else - $cleanedString = strtr($string, - 'àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ', - 'aaaaaceeeeiiiinooooouuuuyyAAAAACEEEEIIIINOOOOOUUUUY'); - return $cleanedString; + { + // Assume ISO-8859-1 if not UTF-8 + $chars['in'] = chr(128).chr(131).chr(138).chr(142).chr(154).chr(158) + .chr(159).chr(162).chr(165).chr(181).chr(192).chr(193).chr(194) + .chr(195).chr(196).chr(197).chr(199).chr(200).chr(201).chr(202) + .chr(203).chr(204).chr(205).chr(206).chr(207).chr(209).chr(210) + .chr(211).chr(212).chr(213).chr(214).chr(216).chr(217).chr(218) + .chr(219).chr(220).chr(221).chr(224).chr(225).chr(226).chr(227) + .chr(228).chr(229).chr(231).chr(232).chr(233).chr(234).chr(235) + .chr(236).chr(237).chr(238).chr(239).chr(241).chr(242).chr(243) + .chr(244).chr(245).chr(246).chr(248).chr(249).chr(250).chr(251) + .chr(252).chr(253).chr(255); + + $chars['out'] = 'EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy'; + + $string = strtr($string, $chars['in'], $chars['out']); + $double_chars = array(); + $double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254)); + $double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th'); + $string = str_replace($double_chars['in'], $double_chars['out'], $string); + } + return $string; + } + + /* Add for 1.3 compatibility and avoid duplicate code */ + public static function jsonEncode($result) + { + return (method_exists('Tools', 'jsonEncode')) ? + Tools::jsonEncode($result) : Tools::jsonEncode($result); } /* ** Fix security and compatibility for PS < 1.4.5 */ - static function bqSQL($string) + public static function bqSQL($string) { return str_replace('`', '\`', pSQL($string)); } @@ -60,7 +232,7 @@ class MRTools /* ** Check zip code by country */ - static public function checkZipcodeByCountry($zipcode, $params) + public static function checkZipcodeByCountry($zipcode, $params) { $id_country = $params['id_country']; @@ -84,6 +256,15 @@ class MRTools return true; return false; } + + public static function getFormatedPhone($phone_number) + { + $begin = Tools::substr($phone_number, 0, 3); + $pad_number = (strpos($begin, '+3') !== false) ? 12 : + (strpos($begin, '00') ? 13 : 10); + + return str_pad(Tools::substr(preg_replace(MRTools::REGEX_CLEAN_PHONE, '', $phone_number), 0, $pad_number), $pad_number, '0'); + } } ?> diff --git a/modules/mondialrelay/classes/index.php b/modules/mondialrelay/classes/index.php index b559f985..dd2cf574 100755 --- a/modules/mondialrelay/classes/index.php +++ b/modules/mondialrelay/classes/index.php @@ -1,13 +1,13 @@ -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 7233 $ -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) -* International Registered Trademark & Property of PrestaShop SA +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA */ - + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); diff --git a/modules/mondialrelay/connexion.php b/modules/mondialrelay/connexion.php new file mode 100755 index 00000000..1b794f40 --- /dev/null +++ b/modules/mondialrelay/connexion.php @@ -0,0 +1,60 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once(dirname(__FILE__).'/../../config/config.inc.php'); +include_once(dirname(__FILE__).'/mondialrelay.php'); +include_once(dirname(__FILE__).'/errorCode.php'); +try{ + if (!Tools::getValue('token')) + die('{"error":"Security error"}'); + if (sha1('mr'._COOKIE_KEY_.'Back') != Tools::getValue('token')) + die('{"error":"Security error"}'); + + $webservice = MondialRelay::MR_URL.'webservice/Web_Services.asmx?WSDL'; + $client = new SoapClient($webservice); + $params = array(); + $params['Enseigne'] = Tools::getValue('enseigne'); + $params['Poids'] = ''; + $params['Taille'] = ''; + $params['CP'] = (Configuration::get('PS_SHOP_CODE')) ? Configuration::get('PS_SHOP_CODE') : '75000'; + $params['Ville'] = ''; + $id_country = (Configuration::get('PS_SHOP_COUNTRY_ID')) ? Configuration::get('PS_SHOP_COUNTRY_ID') : Configuration::get('PS_COUNTRY_DEFAULT'); + $params['Pays'] = Country::getIsoById($id_country); + $params['Action'] = ''; + $concat = $params['Enseigne'].$params['Pays'].$params['Ville'].$params['CP'].$params['Poids'].Tools::getValue('key'); + $params['Security'] = Tools::strtoupper(md5($concat)); + $result_mr = $client->WSI2_RecherchePointRelais($params); + if (($errorNumber = $result_mr->WSI2_RecherchePointRelaisResult->STAT) != 0) + { + echo '{"error":"'.str_replace('"', '', $statCode[$errorNumber]).'"}'; + die(); + } + echo '{"success":1}'; +} +catch(Exception $e) { + echo '{"error":"'.str_replace('"', '', $statCode[99]).'"}'; + die(); +} \ No newline at end of file diff --git a/modules/mondialrelay/cron.php b/modules/mondialrelay/cron.php index 5fd4222b..fb555967 100755 --- a/modules/mondialrelay/cron.php +++ b/modules/mondialrelay/cron.php @@ -1,6 +1,6 @@ -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 7835 $ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ @@ -31,40 +30,49 @@ include_once('mondialrelay.php'); if (Tools::getValue('secure_key') != Configuration::get('MONDIAL_RELAY_SECURE_KEY')) exit; -$expeditions = Db::getInstance()->ExecuteS(' +$account_shop = MondialRelay::getAccountDetail(); + +$expeditions = Db::getInstance()->executeS(' SELECT ms.`exp_number`, ms.`id_cart`, o.`id_order` FROM `'._DB_PREFIX_.'mr_selected` ms LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_cart` = ms.`id_cart`) WHERE `exp_number` != 0'); if (empty($expeditions)) - exit; - + die('No order'); +else + echo 'Start progress
'; + $params = array( -'Enseigne' => Configuration::get('MR_ENSEIGNE_WEBSERVICE'), +'Enseigne' => $account_shop['MR_ENSEIGNE_WEBSERVICE'], 'Langue' => 'FR' ); -require_once(dirname(__FILE__).'/lib/nusoap/lib/nusoap.php'); -$client_mr = new nusoap_client("http://www.mondialrelay.fr/webservice/Web_Services.asmx?WSDL", true); +$client_mr = new SoapClient(MondialRelay::MR_URL.'webservice/Web_Services.asmx?WSDL'); $client_mr->soap_defencoding = 'UTF-8'; $client_mr->decode_utf8 = false; +$i = 0; foreach ($expeditions as $expedition) { - if ($expedition['id_order'] == NULL) + if ($expedition['id_order'] == null) continue; - if (OrderHistory::getLastOrderState((int)($expedition['id_order']))->id == Configuration::get('PS_OS_DELIVERED')) + $order = new Order((int)($expedition['id_order'])); + if ($order->current_state == Configuration::get('PS_OS_DELIVERED')) continue; $params['Expedition'] = $expedition['exp_number']; - $params['Security'] = strtoupper(md5($params['Enseigne'].$params['Expedition'].'FR'.Configuration::get('MR_KEY_WEBSERVICE'))); + $params['Security'] = Tools::strtoupper(md5($params['Enseigne'].$params['Expedition'].'FR'.$account_shop['MR_KEY_WEBSERVICE'])); $is_delivered = 0; - $result_mr = $client_mr->call('WSI2_TracingColisDetaille', $params, 'http://www.mondialrelay.fr/webservice/', 'http://www.mondialrelay.fr/webservice/WSI2_TracingColisDetaille'); - if (isset($result_mr['WSI2_TracingColisDetailleResult']['Tracing']['ret_WSI2_sub_TracingColisDetaille'])) - foreach ($result_mr['WSI2_TracingColisDetailleResult']['Tracing']['ret_WSI2_sub_TracingColisDetaille'] as $result) - if (isset($result['Libelle']) AND $result['Libelle'] == 'COLIS LIVRÉ') + $result_mr = $client_mr->WSI2_TracingColisDetaille($params); + + if (isset($result_mr->WSI2_TracingColisDetailleResult->Tracing->ret_WSI2_sub_TracingColisDetaille)) + foreach ($result_mr->WSI2_TracingColisDetailleResult->Tracing->ret_WSI2_sub_TracingColisDetaille as $result) + if (isset($result->Libelle) && $result->Libelle == 'COLIS LIVRÉ') + { $is_delivered = 1; + break; + } if ($is_delivered == 1) { @@ -73,4 +81,8 @@ foreach ($expeditions as $expedition) $history->changeIdOrderState((int)(Configuration::get('PS_OS_DELIVERED')), (int)($expedition['id_order'])); $history->addWithemail(); } + $i++; + + echo '

'.$i.'

'; } +echo 'End progress
'; \ No newline at end of file diff --git a/modules/mondialrelay/css/index.php b/modules/mondialrelay/css/index.php new file mode 100755 index 00000000..ce386689 --- /dev/null +++ b/modules/mondialrelay/css/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 7776 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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; \ No newline at end of file diff --git a/modules/mondialrelay/css/style.css b/modules/mondialrelay/css/style.css new file mode 100755 index 00000000..708a1531 --- /dev/null +++ b/modules/mondialrelay/css/style.css @@ -0,0 +1,453 @@ +div.PS_MRFormType +{ + width:100%; + margin-top:20px; +} + +div.PS_MRFormType fieldset > ul +{ + list-style-type: none; +} + +div.PS_MRFormType fieldset > ul > li +{ + margin-top:10px; +} + +div.PS_MRFormType fieldset > ul > li > span.indication +{ + font-style:italic; + font-size:11px; + margin-left:5px; +} + +div.PS_MRFormType fieldset > ul > li.PS_MRSubmit +{ + text-align:left; + padding-left:150px; +} + +div.PS_MRSubmitButton +{ + text-align:center; + margin-top:20px; +} + +.PS_MRRequireFields +{ + display:inline; + padding:2px 10px; +} + +tr.PS_MRErrorList td +{ + border: 1px solid #EC9B9B; + background-color: #FFE2E3; + color: #383838; + font-weight: 700; + line-height: 18px; + text-align:center; +} + +tr.PS_MRSuccessList td +{ + border: 1px solid #72CB67; + background-color: #DFFAD3; + color: #383838; + font-weight: 700; + line-height: 18px; + text-align:center; +} + +table#PS_MRHistoriqueTableList +{ + text-align:center; +} + +table#PS_MRHistoriqueTableList tr > td > img +{ + margin-bottom:5px; +} + +table#PS_MRHistoriqueTableList +{ + width:100%; +} + +table#PS_MRHistoriqueTableList tr +{ + height:30px; +} + +div#otherErrors +{ + display:none; +} + +div#otherErrors span +{ + text-align:left; +} + +div#PS_MRUnRemovedItem +{ + display:none; + color:#FF0000; +} + +.shippingList { + +} +.shippingList li { + margin: 5px; + display: block; + clear: both; +} +.shipLabel { + width: 230px; + float: left; + text-align: left; +} +.selectShipping { + width: 100px; +} +.settingsList { + width: 400px; + float: left; + margin-right: 10px; +} +.settingsList li { + display: block; + padding: 5px; + clear: both; +} +.upsLabel { + width: 170px; + float: left; + text-align: left; +} +.upsInput { + float: left; +} +.upsSubmit { + text-align: center; +} +.addMethodForm { + margin-bottom: 10px; +} + +table#orders +{ + width:100%; +} + +table#orders td +{ + text-align:center; + height: 30px; +} + +table#orders th +{ + text-align:center; + height: 40px; +} + +table#orders th.fixed +{ + width:70px; +} + +table#orders tr +{ + text-align:center; +} + +div.submit_button +{ + margin-top:10px; + text-align:center; +} + +div.PS_MRLoader +{ + display:none; +} + +.MR_form_admintab h3 +{ + margin: 10px; + margin-bottom: .5em; + line-height: 1.4em; +} + +div#PS_MRAskBackupContent +{ + border:1px solid #000; + background: url(../img/logo_hd.png) no-repeat 10px 50px #BEBEBE; + line-height:18px; + font-size:14px; + height:190px; +} + +div#PS_MRAskBackupContent div +{ + width:290px; + float:right; + margin-right:20px; + text-align: center; +} + +div#PS_MRAskBackupContent div > p +{ + line-height: 30px; +} + +div#PS_MRAskBackupContent h2 +{ + padding-top:10px; +} + +tr.PS_MRSelectedCarrier > td +{ + text-align: center; + border-bottom: 1px black; +} + +.PS_MRWarn +{ + border: 1px solid #D3C200; + background-color: #FFFAC6; + line-height: 20px; +} + +.PS_MRRelayPointInfo +{ + text-align: left; + vertical-align: top; + margin: 10px 0; + cursor: pointer; +} + +.PS_MRRelayPointInfo:hover +{ + background-color: #f4f4f4; +} + +.PS_MRRelayPointInfo img +{ + height: 40px; + float:left; + padding: 0 10px; +} + +.PS_MRRelayPointInfo p +{ + float:left; + width:360px; + text-align: justify; +} + +.PS_MRFloatRelayPointSelecteIt +{ + display:block; +} + +.PS_MRRelayPointInfo:hover .PS_MRFloatRelayPointSelecteIt +{ + display:block; +} + +.PS_MRRelayPointInfo .PS_MRFloatRelayPointSelected +{ + color:#333333; + background:url(../img/selectRelayPoint.png) no-repeat 0px -25px; +} + +.PS_MRFloatRelayPointSelected +{ + display:block; +} + +.PS_MRFloatRelayPointSelecteIt a.PS_MRSelectRelayPointButton +{ + background: url("../img/selectRelayPoint.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0); + color: #666666; + display: block; + float: right; + height: 25px; + margin-top: 8px; + padding: 0 20px 0 25px; + text-decoration: none; + width: 90px; + line-height: 25px; +} + +.PS_MRFloatRelayPointSelected a.PS_MRSelectRelayPointButton +{ + background: url("../img/selectRelayPoint.png") no-repeat scroll 0 -25px rgba(0, 0, 0, 0); + color: #333333; + display: block; + float: right; + font-size: 10px; + height: 25px; + margin-top: 8px; + padding: 0 20px 0 25px; + text-decoration: none; + width: 90px; + line-height: 25px; +} + +a.PS_MRSelectRelayPointButton:hover +{ + color:#333333; + background:url(../img/selectRelayPoint.png) no-repeat 0px -25px; +} + +.PS_MRGmapDefaultPosition +{ + display:none; +} + +div.PS_MRGmapStyle +{ + width: 550px; + height:250px; + display: none; +} + +div#PS_MRPersonalizedFields +{ + display:none; +} + +.clearfix:before, +.clearfix:after +{ + content: "."; + display: block; + height: 0; + overflow: hidden +} +.clearfix:after {clear: both} +.clearfix {zoom: 1} + +.PS_MRGmapBulbe +{ + width:405px; + height:66px; + overflow: hidden; +} + +.MR_date {width:450px;position:relative;float:right; line-height: 9px;} +.MR_date span.titre {margin-left:50px;font-weight:bold;} +.MR_date span.vacances {margin-left:5px;color:Red; } +.MR_date table {border-spacing:3px;font-size:11pt; border: solid 1px #eee;} +.MR_date tr.p {background-color:#e9e9e9; height:9px;} +.MR_date td.g {font-weight:bold;} +.MR_date td.d {} + +/* 1.3 compatibility*/ +.MR_warn +{ + border: 1px solid #D3C200; + background-color: #FFFAC6; + color: #383838; + font-weight: 700; + margin: 0 0 10px 0; + line-height: 20px; + padding: 10px 0px; + text-align: center; +} + +/* 1.3 compatibility*/ +.MR_error +{ + border: 1px solid #EC9B9B; + background-color: #FAE2E3; + color: #383838; + font-weight: 700; + margin: 0 0 10px 0; + line-height: 20px; + padding: 10px 0px; + text-align: center; +} + +.MR_error ul > li, .MR_warn ul > li +{ + list-style: none; + text-align: left; +} + +/* 1.3 - 1.4 compatibility*/ +.MR_hint +{ + margin-top: 4px; + margin-bottom: 2px; + border: 1px solid #268CCD; + padding: 8px 6px 8px 34px; + color: #383838; + background: #F1F9FF url(../img/help.png) no-repeat 6px 5px; + border-radius: 3px; +} + +#MR_config_menu +{ + background-color: #F8F8F8; + border: 1px solid #CCC; + margin-bottom: 10px; + padding: 10px 0; + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-image: initial; + height: 130px; +} + +#MR_config_menu ul +{ + margin: 0 auto; + padding: 0; + width:100%; +} + +#MR_config_menu ul > li +{ + color: #666; + float: left; + list-style: none outside none; + padding: 10px 40px; + text-align: center; +} + +#MR_config_menu ul > li.selected +{ + color: #383838; + font-weight: bolder; + border: 1px solid #CCC; + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + background-color: #EBEDF4; +} + +#MR_config_menu ul > li.selected > a +{ + color: #383838; + font-weight: bolder; +} + +#MR_error_account +{ + display: none; + text-align: center; +} + +.PS_MRFormType +{ + display: none; +} + +.send_disable_carrier_form { + cursor: pointer; +} \ No newline at end of file diff --git a/modules/mondialrelay/de.php b/modules/mondialrelay/de.php index b18fbe52..8016b338 100755 --- a/modules/mondialrelay/de.php +++ b/modules/mondialrelay/de.php @@ -2,175 +2,181 @@ global $_MODULE; $_MODULE = array(); -$_MODULE['<{mondialrelay}prestashop>mondialrelay_e0626222614bdee31951d84c64e5e9ff'] = 'Auswählen'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_91b442d385b54e1418d81adc34871053'] = 'Ausgewählt'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_ef2a1f426c2c289ed5986c7636a5d696'] = 'Bitte wählen Sie einen Paketstützpunkt'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_80a0c205cd57b22fca7f174253870300'] = 'Öffnungszeiten'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_2b56b60f878922093facd42284848a0c'] = 'Mehr...'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_e82faee1422140edd04b2f94c5051500'] = 'Azione avvenuta con successo'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_3b2d373418745276ae6e207421245cdc'] = 'Stato ordine aggiornato'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_b4ac3d3f15bc0984d0906aff1202e701'] = 'Non posso aggiornare l\'account negozio'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_44585fcd617dce6416d8283b026714c1'] = 'Mondial Relay'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_ed4a3b96dc1f38c160775cac1f7bcd6d'] = 'An Mondial Relay Stützpunkte liefern.'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_70d70ce314f545b7c500a086f147f64b'] = 'Ungültiger Shop'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_709b076565df5fa98cdb2528d897633d'] = 'Ungültiger Mark-Code'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c86508f5bc6b4456e7003d6a1868689d'] = 'Ungültiger Webservice Schlüssel'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_ea9261a3dad976b40ff2088a19fda2c3'] = 'Ungültige Sprache'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_4eb287cc225ba0e1bcfe9cc1b8315def'] = 'Ungültiger Gewichtskoeffizient'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_f82576de014726e9ef9b4ed2a9eb947b'] = 'Bitte konfigurieren Sie Ihre Mondial Relay-Konto-Einstellungen vor dem Erstellen eines Lieferanten'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_70ff82d47f295f730c6accf07a2948e8'] = 'Ungültiger Versanddienstnamen'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_e1f1787db2fee596f4c3bfaf1d098f8d'] = 'Ungültiger Col-Modus'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_9414b7de379a09941e894d28f19949ae'] = 'Ungültiger Liefermodus'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_5eeb9ca7eee4be7192dd10d917f79a12'] = 'Ungültiger Assurance-Modus'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_8b446ac2013dc7085802de71cc342ead'] = 'Sie müssen mindestens ein Zustellungsland angeben'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_b9a85d87ae6dd77f2107734a4cd0bb15'] = 'Ungültiger Google-Schlüssel'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_979c6094728c14aac1b66d544dc5cebd'] = 'Ungültiger Bestellstatus'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_808fb4e3a637a759565de1d314ea526f'] = 'Die übermittelte Hauptadresse hat ein ungültiges Format'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen erfolgreich aktualisiert'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_07213a0161f52846ab198be103b5ab43'] = 'Fehler'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_cb5e100e5a9a3e7f6d1fd97512215282'] = 'Fehler'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_350c1cc4343826a89f08a33bb49c6d98'] = 'Mondial Relay Bewertungsmodul konfigurieren'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_5a2355a42ba3ab265701183c914467f2'] = 'Versuchen Sie den Cache und Kompilierung auf AUS zu stellen'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_3de769f9a81eed916583d5b35c58dbdd'] = 'falls Sie mit dem Modul nach einer Aktualisierung Probleme haben sollten'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_8f8b21bd013b38d1e3059557c22a57e7'] = 'Nutzen Sie die folgende Kurzanleitung, um das Mondial Relay Modul zu konfigurieren.'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_d21a9f93917604d5490ad529a7cf1ff9'] = 'So erstellen Sie eine Mondial Relay Lieferanten'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6a2e6af5fff47adb3afd780b97d9b4b'] = 'Geben Sie Ihre Mondial Relay-Konto-Einstellungen ein und speichern Sie sie'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_94fbe32464fcfa902feed9f256439833'] = 'Erstellen sie einen Versanddienst mit dem nachstehenden Formular \"Neuen Versanddienst erstellen\"'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_b962d8fb95f5a439f50502152f3bad71'] = 'Definieren Sie einen Preis für Ihren Lieferanten auf'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_faf1247ae6846a9955a466d4f301bbe4'] = 'Der Lieferanten-Seite'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_10d78806b84b97ebc774e9f6277af6ac'] = 'Um Etiketten zu generieren, müssen Sie eine gültige und registrierte Adresse Ihres Shops auf Ihrer'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_af5efea250326c1c34d69aa9364b482c'] = 'Kontakt-Seite haben'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_362dff77f7403550e886db901404856c'] = 'Löschen erfolgreich'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_66661dacf33146201b60dc16520ddd68'] = 'Fügen Sie eine Versandart hinzu'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_b651efdb98a5d6bd2b3935d0c3f4a5e2'] = 'Erforderlich'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_531e144cc23ef08408b81cb4d9c641dc'] = 'Lieferantenname'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c9b415ea1576b19d10d42b332798cd16'] = 'Sammel-Modus'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_d24262afca47ba80b691c878243441e8'] = 'Sammeln im Shop'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_201bdb87f8e278b943d07ae924d5de6e'] = 'Liefer-Modus'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_142ef02888af88b8b772335277d1c0c8'] = 'Lieferung an einen Abholpunkt'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_eeab8b7cf3c7a558a0e8a4050fa994ca'] = 'Colis Drive Lieferung'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_8f7794b107749728c3333ef38d2687e8'] = 'Hauslieferung RDC (1 Person)'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_e451efc8ce05b96b214b4c2935f2c657'] = 'Besondere Hauslieferung (2 Personen)'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_eaff1bdf24fcffe0e14e29a1bff51a12'] = 'Versicherung'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_96ba408f20bc3e065f400c650d32fd1a'] = 'Keine Versicherung'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_e5a8fafb1dfb538c172e1e014e86b871'] = 'Zusatzversicherung Lv1'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_b02f8d6d4b6217cca317161c87f64065'] = 'Zusatzversicherung Lv2'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_90b95ae88150c6a34c4129dc4f1ebbd5'] = 'Zusatzversicherung Lv3'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c15b40b8c535191f6f0b6f9beaced3cf'] = 'Zusatzversicherung LV4'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_b67a442fff3ca0a03ea253b0668f946d'] = 'Zusatzversicherung Lv5'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_33cbd0d8b6476501f55a8320481ec0f1'] = 'Zustellländer:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_aef71ba4fd060dea2e2c76d1b5076caf'] = 'Halten Sie die die STRG-Taste gedrückt, um mehrere Länder zu wählen'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_0309a6c666a7a803fdb9db95de71cf01'] = 'Frankreich'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_6c1674d14bf5f95742f572cddb0641a7'] = 'Belgien'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_06630c890abadde9228ea818ce52b621'] = 'Luxemburg'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_907eba32d950bfab68227fd7ea22999b'] = 'Spanien'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_0c24ec05a02c710cedd400e3680d8b81'] = 'Versandart-Liste'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_14039af96b01e718a9c9d9c1259b6472'] = 'Keine Versandmethoden erstellt'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_8596361cec00f8d2438d264827eee737'] = 'Versand konfigurieren'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_9ffc3ccc968a96d902af963c6d7b4e97'] = 'Erweiterte Einstellungen'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_1d1d57f5840e1da871622295ba206b30'] = 'Klicken um Optionen anzuzeigen oder zu verbergen'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_fcf5b2122da1d5a5f5c7253b96a3f9d9'] = 'URL Cron Task:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_759e1f68a70bbe8c48eb30fa4b512de8'] = 'Sei haben Mondialrelay nicht durch die Installationsmethode aktualisiert. Führen Sie bitte folgende Einstellungen manuell durch, damit der Ticket-Prozess reibungslos funktioniert'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_bbd9bc77f1f5b6a9edce6db062b607c9'] = 'Dieser Teil erlaubt Ihnen die Daten zwischenzuspeichern, nachdem Sie ein MondialRelay Ticket generiert haben. Einige Felder sind in der Länge und nur auf Buchstaben beschränkt.'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_9127fe218b2cac7f0c8aecd7016a891d'] = 'Shopname'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_7e9bbecd32836500b557db33c3b3e93b'] = 'Der veon Mondialrelay genutzte Schlüssel lautet'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_32963eea43914b6a418fb2fd9850beb9'] = 'und hat folgenden Standard-Wert'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_d02bbc3cb147c272b0445ac5ca7d1a36'] = 'Bestellstatus'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_818f954f4838ecad839c5dcbd287d291'] = 'Wählen Sie den Bestellstatus für Marken. Sie können die Marken auf'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_5117e194c641ad4fc55417b554aead3c'] = 'der Mondial Relay Verwaltungsseite verwalten'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_1ba3935c9858ffb8e19a35ca640b8505'] = 'Mondial Relay Kontoeinstellungen'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_a125105400f6e4ee4574da3793af5ef2'] = 'Diese Parameter werden Ihnen von Mondialrelay mitgeteilt, sobald Sie den Dienst abonniert haben'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_12a3fbd35c1cab4b1101b91d708efd15'] = 'mr_marke_WebService:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_6f0434b67007b555dfd1201f4e0d5254'] = 'mr_code_marke:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_08f785193c96b2a78dec8d76a46648d6'] = 'mr_Schlüssel_WebService:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dae2d7c71f2daaedb00191af25dc28d'] = 'mr_Sprache:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_a26329cba9723551cb8654deba32872b'] = 'mr_Gewicht_koef:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_99244b234ec089eca40ff9e8ec343e87'] = 'Gramm = 1'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_61cbc2d26b4157292673c772ddd6c0f7'] = 'Einstellungen aktualisieren'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_2673bca5ba0a7871770e69c962e6ce38'] = 'Nb Versand:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dbe844fb964d5eca2f51be724e43294'] = 'Label URL'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6aefd5e2191e1210a2f50416812b517'] = 'Follow-up-URL'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_61e70b58e38fd01daa254f44c4fa264b'] = 'Nb Abholpunkt:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_bba366864d25056c941b72f18ef79e7c'] = 'Dieser Fehler ist nicht bekannt :'; -$_MODULE['<{mondialrelay}prestashop>orderdetail_81b7b4587a2a3ea7a0d6bb1df3fbba54'] = 'Lieferung nach'; -$_MODULE['<{mondialrelay}prestashop>orderdetail_c2d05abc7f5ebdc72b6656df35038b43'] = 'Meine Sendung auf der Mondial Relay Webseite verfolgen'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_a1c3470a944b9625cfb924fd15c8bdbf'] = 'Bitte mindestens eine Bestellung auswählen'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_dc41aac14af17f1d19fca5e3b9439e74'] = 'Dieser Schlüssel'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_306b346c19017609403424203ea3d720'] = 'ist leer und muss angegeben werden'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Die Anfrage scheint ungültig zu sein'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_c9b4de92f371ae545ad6f051c07d58ca'] = 'Fehler Nummer:'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_ea5f761be4e4888eabf4e1501d7817d1'] = 'Detail:'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_eabb11bf9623f08409a0a4c9d035a336'] = 'Versand-Nummer:'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_b92c3d3319314513c547675924ceecd1'] = 'Ticket URL : '; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_66b793b6b4125e300717e8cf7449f533'] = 'Tracking URL: '; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_2653c23b8c0daac59571e4be5e8fa7d0'] = 'Der Webservice von Mondial Relay ist zu r Zeit nicht erreichbar'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_26b6b6eaec970108c5e84286159fbf48'] = 'Bitte prüfen Sie Ihre Spracheinstellungen'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_557595c2e17c9948a9448eb763ac1a88'] = 'Bitte prüfen Sie Ihre Namenseinstellungen'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_017ca6b770ad53669a4eec82894dfcd3'] = 'Bitte prüfen Sie Ihre Adresseneinstellungen'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_3f79e1fc66b4f9cca7bd68cab176020d'] = 'Bitte prüfen Sie Ihre Städteeinstellungen'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_404665d9b65239985d59b30b3dcb26b5'] = 'Bitte prüfen Sie Ihre PLZ-Einstellungen'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_74cb73eddbe6eaf556023f943fc7e1fd'] = 'Das Format Ihrer PLZ entspricht nicht dem Länderformat oder Sie haben keine entsprechende PLZ angegeben.'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_0b8a30478b9572b86718989d483fd88d'] = 'Bitte prüfen Sie Ihre Ländereinstellungen'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_7ddf2d94bf037b7d1088c0600ea589c3'] = 'Bitte prüfen Sie Ihre Telefonnummer-Einstellungen'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_9c7ce7be9a2c593b24d448edb4f804e0'] = 'Bitte prüfen Sie Ihre Maileinstellungen'; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_14288d48d107056c1acf8aaae1bf282b'] = 'Kudenadresse nicht gefunden'; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_dc41aac14af17f1d19fca5e3b9439e74'] = 'Der Schlüssel'; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_135a7b9a62531e066a95093d8951b344'] = 'hat kein gültiges Datenformat'; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Die Anfrage ist ungültig:'; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_c9b4de92f371ae545ad6f051c07d58ca'] = 'Fehler: '; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_ea5f761be4e4888eabf4e1501d7817d1'] = 'Details:'; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_4e274658c9e97c2a336dde79dd0a7772'] = 'Mondial Relay kann in Ihrer Nähe leider keinen Stützpunkt finden. Haben Sie Ihre Adresse korrekt angegeben ?'; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_2653c23b8c0daac59571e4be5e8fa7d0'] = 'Mondial Relay Seite ist im Moment nicht verfügbar.'; -$_MODULE['<{mondialrelay}prestashop>mrgettickets_dc41aac14af17f1d19fca5e3b9439e74'] = 'Der Schlüssel'; -$_MODULE['<{mondialrelay}prestashop>mrgettickets_135a7b9a62531e066a95093d8951b344'] = 'hat kein gültiges Datenformat'; -$_MODULE['<{mondialrelay}prestashop>mrgettickets_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Die Anfrage ist ungültig:'; -$_MODULE['<{mondialrelay}prestashop>mrgettickets_c9b4de92f371ae545ad6f051c07d58ca'] = 'Fehler:'; -$_MODULE['<{mondialrelay}prestashop>mrgettickets_ea5f761be4e4888eabf4e1501d7817d1'] = 'Details: '; -$_MODULE['<{mondialrelay}prestashop>mrgettickets_2653c23b8c0daac59571e4be5e8fa7d0'] = 'Der Webservice von Mondial Relay ist zu r Zeit nicht erreichbar'; -$_MODULE['<{mondialrelay}prestashop>mrmanagement_38b4abe2f5860f034e315f2da648a3d6'] = 'Mondial Relay Uninstall'; -$_MODULE['<{mondialrelay}prestashop>mrmanagement_77bad09c976ec16f38381dc220139367'] = 'Sie versuchen das Modul zu deinstallieren, alle Datenbankeinträge werden ebenso entfernt'; -$_MODULE['<{mondialrelay}prestashop>mrmanagement_09c081633d484a62a2f6940c12a0de36'] = 'Daten belassen und deinstallieren'; -$_MODULE['<{mondialrelay}prestashop>mrmanagement_0b7f47fce1d82d53244771c64b1535c0'] = 'Deaktivieren (alle Daten löschen) und deinstallieren'; -$_MODULE['<{mondialrelay}prestashop>mrmanagement_ea4788705e6873b424c65e91c2846b19'] = 'stornieren'; -$_MODULE['<{mondialrelay}prestashop>mrmanagement_a42bb0eaa485682166770a54469385f6'] = 'Einige Einträge konnten nicht entfernt werden, bitte versuchen Sie es noch einmal.'; -$_MODULE['<{mondialrelay}prestashop>mrmanagement_11744bfebb33e52be37a66a530b7045d'] = 'Bitte wählen Sie mindestens ein Verlaufselement aus'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_14288d48d107056c1acf8aaae1bf282b'] = 'Kundenadresse konnte nicht gefunden werden'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_dc41aac14af17f1d19fca5e3b9439e74'] = 'Dieser Schlüssel'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_306b346c19017609403424203ea3d720'] = 'ist leer und muss angegeben werden'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Die Anfrage ist ungültig:'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_c9b4de92f371ae545ad6f051c07d58ca'] = 'Es ist ein Fehler in der Nummer vorhanden:'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_ea5f761be4e4888eabf4e1501d7817d1'] = 'Details:'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_6f8522e0610541f1ef215a22ffa66ff6'] = 'Montag'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_5792315f09a5d54fb7e3d066672b507f'] = 'Dienstag'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_796c163589f295373e171842f37265d5'] = 'Mittwoch'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_78ae6f0cd191d25147e252dc54768238'] = 'Donnerstag'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_c33b138a163847cdb6caeeb7c9a126b4'] = 'Freitag'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Samstag'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Sonntag'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_2653c23b8c0daac59571e4be5e8fa7d0'] = 'Modial Relay Webservice ist im Moment nicht verfügbar.'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_d1908b9b04e81c4b6112e38b608c49af'] = 'Sie haben den Fehler korrigiert. Besten Dank.'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_ccce63109db30895153094de05c60fa5'] = 'Kontaktseite'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_7c5fd3d93bd19d81953db3b374997961'] = 'Bitte überprüfen Sie diese Warnung, es kann sein dass die Generierung Ihres Tickets deshalb fehlschlägt'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_de21dc13e1ea638777fbfad49f88b332'] = 'Alle Bestellugen, die den Status haben'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_a0bf3c9ac2d785f053d883b8746e91ba'] = 'wird für die Erstellung Ihres Aufklebers verfügbar sein'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_2345e28c9b93f368968be4781ed70f5c'] = 'Konfiguration ändern'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_37c85a61df6352af7285c307022c4413'] = 'Keine Bestelungen mit diesem Status'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_d79cf3f429596f77db95c65074663a54'] = 'Bestell ID'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_ce26601dac0dea138b7295f02b7620a7'] = 'Kunde'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_0eede552438475bdfe820c13f24c9399'] = 'Gesamtpreis'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_f4e8b53a114e5a17d051ab84d326cae5'] = 'Versandkosten Gesamt'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_44749712dbec183e983dcd78a7736c41'] = 'Datum'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_3715c824cbc0f966c61a72254f248a2e'] = 'Gewicht (Gramm)'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_6ccc0fdff9995e1a0fce00c99e5b6085'] = 'MR Nummer'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_f9c50cba4de9032d7a6797a2458f8ed9'] = 'MR Land'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_428c091372d840900cf8536519fa0056'] = 'Exp Nummer'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_a254c25adc7d10d7e9c4889484f875a5'] = 'Detail'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_4351cfebe4b61d8aa5efa1d020710005'] = 'Ansicht'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_2e01172e31495f41fcebcf3f831cc82c'] = 'Erfolgreich abgeschlossen'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_32b919d18cfaca89383f6000dcc9c031'] = 'generieren'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_4f1a377c20ace646ddd303ad1e1d243d'] = 'Aufkleber Verlauf'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_e1a98101d56e29eeea312a0eb2748a92'] = 'Exp Nr.'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_aab39f783ba2e72eaad1770f4d9ad0c4'] = 'A4 Aufkleber drucken'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_3eb2bc1ee46258d2a166e89398756b3e'] = 'A5 Aufkleber drucken'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_fa98e6528c9df7f26978c2beb7de3d99'] = 'Verlauf löschen'; - -?> \ No newline at end of file +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ed4a3b96dc1f38c160775cac1f7bcd6d'] = 'Consegna nei punti Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d2286c9c8c8f92cb0e805b17834591b0'] = 'Insegna non valida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_709b076565df5fa98cdb2528d897633d'] = 'Codice marchio non valido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c86508f5bc6b4456e7003d6a1868689d'] = 'Chiave webservice non valida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ea9261a3dad976b40ff2088a19fda2c3'] = 'Lingua non valida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4eb287cc225ba0e1bcfe9cc1b8315def'] = 'Coefficiente di peso non valido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_70ff82d47f295f730c6accf07a2948e8'] = 'Nome del corriere non valido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e1f1787db2fee596f4c3bfaf1d098f8d'] = 'Col mode non valido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9414b7de379a09941e894d28f19949ae'] = 'Modalità di consegna non valida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5eeb9ca7eee4be7192dd10d917f79a12'] = 'Modalità di garanzia non valida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8b446ac2013dc7085802de71cc342ead'] = 'È necessario scegliere almeno un paese di consegna'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_979c6094728c14aac1b66d544dc5cebd'] = 'Stato dell\'ordine non valido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e82faee1422140edd04b2f94c5051500'] = 'Azione avvenuta con successo'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_672facd73d4aee44c116cfd95298db87'] = 'Dettaggli account aggiornati con successo'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b4ac3d3f15bc0984d0906aff1202e701'] = 'Non posso aggiornare l\'account negozio'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ea50be3d60be594e10e9e3560cb9159f'] = 'Metodo di spedizione aggiunto'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d0cfdfcfb71029b561f5ebdc176d87ca'] = 'Stato ordine cambiato con succsso'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_7534411af2e35bed1f79df5938f077f9'] = 'Spedizioniere trovato (disabilitato dal database di prestashop)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2673bca5ba0a7871770e69c962e6ce38'] = 'Numero spedizione:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dbe844fb964d5eca2f51be724e43294'] = 'Etichetta URL'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6aefd5e2191e1210a2f50416812b517'] = 'URL di tracking'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_61e70b58e38fd01daa254f44c4fa264b'] = 'Numero punto relay:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_aa625fced6f01ae595b6a9ac499c2ecf'] = 'Range di peso non può essere aggiunto'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_63d15383121b5bb5c53323f3f96bd1f2'] = 'Range di prezzo non può essere aggiunto'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d4d197dd028e28ae56208971b564921a'] = 'Zona di default non può essere aggiunta'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_760ac6deb1c5b84321f65ba0c7f319f5'] = 'Zona dello spedizioniere e di destinazione non può essere aggiunta'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8bf569ff65b32464e623ca9e9a10688d'] = 'Spedizioniere non può essere creato in PrestaShop'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6ed26bdf3f9141ddca4ede91f943e567'] = 'Metodo di spedizione non può essere aggiunto per il modulo'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_af135815ccf731bcbffb522004762b57'] = 'Spedizioniere non può essere cancellato'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_bba366864d25056c941b72f18ef79e7c'] = 'Questo errore non è contemplata:'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_a1c3470a944b9625cfb924fd15c8bdbf'] = 'Si prega di selezionare almeno un ordine'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_dc41aac14af17f1d19fca5e3b9439e74'] = 'Questo tasto'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_306b346c19017609403424203ea3d720'] = 'è vuoto e deve essere riempito'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_c9b4de92f371ae545ad6f051c07d58ca'] = 'C\'è un numero di errore:'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_ea5f761be4e4888eabf4e1501d7817d1'] = 'Dettagli:'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_eabb11bf9623f08409a0a4c9d035a336'] = 'Spedizione Numero:'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_b92c3d3319314513c547675924ceecd1'] = 'Biglietto URL:'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_66b793b6b4125e300717e8cf7449f533'] = 'URL di tracciamento:'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_26b6b6eaec970108c5e84286159fbf48'] = 'Si prega di controllare la configurazione del linguaggio'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_557595c2e17c9948a9448eb763ac1a88'] = 'Si prega di controllare la configurazione del nome del negozio'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_017ca6b770ad53669a4eec82894dfcd3'] = 'Verifica il tuo indirizzo 1 configurazione'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_3f79e1fc66b4f9cca7bd68cab176020d'] = 'Si prega di controllare la configurazione della città'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_404665d9b65239985d59b30b3dcb26b5'] = 'Si prega di controllare la configurazione del codice postale'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_0b8a30478b9572b86718989d483fd88d'] = 'Si prega di controllare la configurazione del paese'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_7ddf2d94bf037b7d1088c0600ea589c3'] = 'Si prega di controllare la configurazione del telefono'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_9c7ce7be9a2c593b24d448edb4f804e0'] = 'Controlla la tua configurazione della posta'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_85e6a18230d49abf8cfe912809185258'] = 'Una versione precedente alla 1.4 di PrestaShop non può validare il CAP'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_14288d48d107056c1acf8aaae1bf282b'] = 'Indirizzo di un cliente non può essere trovato'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_dc41aac14af17f1d19fca5e3b9439e74'] = 'Questo tasto'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_135a7b9a62531e066a95093d8951b344'] = 'non ha un formato Valide valore'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Sembra che la richiesta non è valida:'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_c9b4de92f371ae545ad6f051c07d58ca'] = 'C\'è un numero di errore:'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_ea5f761be4e4888eabf4e1501d7817d1'] = 'Dettagli:'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_4e274658c9e97c2a336dde79dd0a7772'] = 'MondialRelay non riesce a trovare alcun punto di relè vicino al vostro indirizzo. Forse il vostro indirizzo non è riempita?'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_2653c23b8c0daac59571e4be5e8fa7d0'] = 'Il webservice Mondial Relay non è attualmente affidabile'; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_dc41aac14af17f1d19fca5e3b9439e74'] = 'Questo tasto'; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_135a7b9a62531e066a95093d8951b344'] = 'non ha un formato Valide valore'; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Sembra che la richiesta non è valida:'; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_c9b4de92f371ae545ad6f051c07d58ca'] = 'C\'è un numero di errore:'; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_ea5f761be4e4888eabf4e1501d7817d1'] = 'Dettagli:'; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_2653c23b8c0daac59571e4be5e8fa7d0'] = 'Il webservice Mondial Relay non è attualmente affidabile'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_38b4abe2f5860f034e315f2da648a3d6'] = 'Disinstallazione Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_a4691c957e81a6f0b6f0ed44f8f2dfe8'] = 'Sei tentativo di disinstallare il modulo, vuoi rimuovere il database'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_09c081633d484a62a2f6940c12a0de36'] = 'Keep it e disinstallare'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_0b7f47fce1d82d53244771c64b1535c0'] = 'Rimuovere e disinstallare'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_ea4788705e6873b424c65e91c2846b19'] = 'Annullare'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_a42bb0eaa485682166770a54469385f6'] = 'Alcune voci non possono essere rimossi, prova a rimuoverlo di nuovo'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_11744bfebb33e52be37a66a530b7045d'] = 'Si prega di selezionare almeno un elemento di storia'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_14288d48d107056c1acf8aaae1bf282b'] = 'Indirizzo di un cliente non può essere trovato'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_dc41aac14af17f1d19fca5e3b9439e74'] = 'Questo tasto'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_306b346c19017609403424203ea3d720'] = 'è vuoto e deve essere riempito'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Sembra che la richiesta non è valida:'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_c9b4de92f371ae545ad6f051c07d58ca'] = 'C\'è un numero di errore:'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_ea5f761be4e4888eabf4e1501d7817d1'] = 'Dettagli:'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lunedi'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_5792315f09a5d54fb7e3d066672b507f'] = 'Martedì'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_796c163589f295373e171842f37265d5'] = 'Mercoledì'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_78ae6f0cd191d25147e252dc54768238'] = 'Giovedi'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_c33b138a163847cdb6caeeb7c9a126b4'] = 'Venerdì'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Sabato'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Domenica'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_2653c23b8c0daac59571e4be5e8fa7d0'] = 'Il webservice Mondial Relay non è attualmente affidabile'; +$_MODULE['<{mondialrelay}prestashop>checkout_process_836f6c949a2f2d61489bf410def82111'] = 'Mondial Relay non può trovare dei punti relay a causa di un errore di PrestaShop'; +$_MODULE['<{mondialrelay}prestashop>configuration_0f27e5e9020f28e3f31b78376e11d4c7'] = 'Configurazione Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>configuration_8bc212f48680748479bbd322d4d73d3f'] = 'Dettagli account'; +$_MODULE['<{mondialrelay}prestashop>configuration_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Spedizione'; +$_MODULE['<{mondialrelay}prestashop>configuration_fe4c6a5e7bd6793b37370e4e46daf998'] = 'Settaggi avanzati'; +$_MODULE['<{mondialrelay}prestashop>configuration_326e057f57e830834c20d668e44627ef'] = 'informazioni'; +$_MODULE['<{mondialrelay}prestashop>configuration_29141d2b5a484e8032ef64339733f0dc'] = 'Per favore inserisci i tuoi settaggi account di Modial Relay'; +$_MODULE['<{mondialrelay}prestashop>configuration_5a2355a42ba3ab265701183c914467f2'] = 'Cerca di spegnere la cache e forza la compilazione su sì'; +$_MODULE['<{mondialrelay}prestashop>configuration_3de769f9a81eed916583d5b35c58dbdd'] = 'Se hai problemi con questo modulo dopo un aggiornamento'; +$_MODULE['<{mondialrelay}prestashop>configuration_8f8b21bd013b38d1e3059557c22a57e7'] = 'Guarda il seguente HOW TO per aiutarti a configurare il modulo Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>configuration_d21a9f93917604d5490ad529a7cf1ff9'] = 'Per creare uno spedizioniere Modial Relay'; +$_MODULE['<{mondialrelay}prestashop>configuration_c6a2e6af5fff47adb3afd780b97d9b4b'] = 'Inserisci e salva i tuoi settaggi account Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>configuration_b29c4694f835ad29b9893cd3fed36fbc'] = 'Crea uno Spedizioniere usanto il bottone Spedizioni'; +$_MODULE['<{mondialrelay}prestashop>configuration_b962d8fb95f5a439f50502152f3bad71'] = 'Definisci un prezzo per il tuo corriere'; +$_MODULE['<{mondialrelay}prestashop>configuration_faf1247ae6846a9955a466d4f301bbe4'] = 'La pagina del corriere'; +$_MODULE['<{mondialrelay}prestashop>configuration_10d78806b84b97ebc774e9f6277af6ac'] = 'Per generare le etichette, devi aver registrato un indirizzo valido nel tuo negozio nella tua'; +$_MODULE['<{mondialrelay}prestashop>configuration_af5efea250326c1c34d69aa9364b482c'] = 'pagina contatti'; +$_MODULE['<{mondialrelay}prestashop>configuration_1ba3935c9858ffb8e19a35ca640b8505'] = 'Settaggi account Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>configuration_a125105400f6e4ee4574da3793af5ef2'] = 'Questi parametri ti sono stati forniti da Mondial Relay una volta iscritto al servizio'; +$_MODULE['<{mondialrelay}prestashop>configuration_12a3fbd35c1cab4b1101b91d708efd15'] = 'Insegna WebService:'; +$_MODULE['<{mondialrelay}prestashop>configuration_6f0434b67007b555dfd1201f4e0d5254'] = 'Codice marca:'; +$_MODULE['<{mondialrelay}prestashop>configuration_08f785193c96b2a78dec8d76a46648d6'] = 'Chiave WebService'; +$_MODULE['<{mondialrelay}prestashop>configuration_0dae2d7c71f2daaedb00191af25dc28d'] = 'Lingua:'; +$_MODULE['<{mondialrelay}prestashop>configuration_a26329cba9723551cb8654deba32872b'] = 'Coefficiente di peso'; +$_MODULE['<{mondialrelay}prestashop>configuration_99244b234ec089eca40ff9e8ec343e87'] = 'Grammi = 1'; +$_MODULE['<{mondialrelay}prestashop>configuration_61cbc2d26b4157292673c772ddd6c0f7'] = 'Aggiorna le impostazioni'; +$_MODULE['<{mondialrelay}prestashop>configuration_70397c4b252a5168c5ec003931cea215'] = 'Campi richiesti'; +$_MODULE['<{mondialrelay}prestashop>configuration_9ffc3ccc968a96d902af963c6d7b4e97'] = 'Settaggi avanzati'; +$_MODULE['<{mondialrelay}prestashop>configuration_fcf5b2122da1d5a5f5c7253b96a3f9d9'] = 'URL Cron Task:'; +$_MODULE['<{mondialrelay}prestashop>configuration_66661dacf33146201b60dc16520ddd68'] = 'Aggiunti un metodo di spedizione'; +$_MODULE['<{mondialrelay}prestashop>configuration_531e144cc23ef08408b81cb4d9c641dc'] = 'Nome corriere'; +$_MODULE['<{mondialrelay}prestashop>configuration_8f497c1a3d15af9e0c215019f26b887d'] = 'Ritardo'; +$_MODULE['<{mondialrelay}prestashop>configuration_201bdb87f8e278b943d07ae924d5de6e'] = 'Modalità di consegna'; +$_MODULE['<{mondialrelay}prestashop>configuration_142ef02888af88b8b772335277d1c0c8'] = 'Consegna ad un punto Relay'; +$_MODULE['<{mondialrelay}prestashop>configuration_eeab8b7cf3c7a558a0e8a4050fa994ca'] = 'Consegna dal corriere'; +$_MODULE['<{mondialrelay}prestashop>configuration_8f7794b107749728c3333ef38d2687e8'] = 'Consegna a piano terra (1 persona)'; +$_MODULE['<{mondialrelay}prestashop>configuration_e451efc8ce05b96b214b4c2935f2c657'] = 'Consegna a casa (2 persone)'; +$_MODULE['<{mondialrelay}prestashop>configuration_eaff1bdf24fcffe0e14e29a1bff51a12'] = 'Assicurazione'; +$_MODULE['<{mondialrelay}prestashop>configuration_96ba408f20bc3e065f400c650d32fd1a'] = 'No assicurazione'; +$_MODULE['<{mondialrelay}prestashop>configuration_e5a8fafb1dfb538c172e1e014e86b871'] = 'Complementary Insurance Lv1'; +$_MODULE['<{mondialrelay}prestashop>configuration_b02f8d6d4b6217cca317161c87f64065'] = 'Complementary Insurance Lv2'; +$_MODULE['<{mondialrelay}prestashop>configuration_90b95ae88150c6a34c4129dc4f1ebbd5'] = 'Complementary Insurance Lv3'; +$_MODULE['<{mondialrelay}prestashop>configuration_c15b40b8c535191f6f0b6f9beaced3cf'] = 'Complementary Insurance Lv4'; +$_MODULE['<{mondialrelay}prestashop>configuration_b67a442fff3ca0a03ea253b0668f946d'] = 'Complementary Insurance Lv5'; +$_MODULE['<{mondialrelay}prestashop>configuration_33cbd0d8b6476501f55a8320481ec0f1'] = 'Nazioni di consegna:'; +$_MODULE['<{mondialrelay}prestashop>configuration_aef71ba4fd060dea2e2c76d1b5076caf'] = 'Tu puoi scegliere diverse nazioni premendo CTRL'; +$_MODULE['<{mondialrelay}prestashop>configuration_0309a6c666a7a803fdb9db95de71cf01'] = 'Francia'; +$_MODULE['<{mondialrelay}prestashop>configuration_6c1674d14bf5f95742f572cddb0641a7'] = 'Beglio'; +$_MODULE['<{mondialrelay}prestashop>configuration_06630c890abadde9228ea818ce52b621'] = 'Lussemburgo'; +$_MODULE['<{mondialrelay}prestashop>configuration_907eba32d950bfab68227fd7ea22999b'] = 'Spagna'; +$_MODULE['<{mondialrelay}prestashop>configuration_0c24ec05a02c710cedd400e3680d8b81'] = 'Lista metodi di spedizione'; +$_MODULE['<{mondialrelay}prestashop>configuration_14039af96b01e718a9c9d9c1259b6472'] = 'Nessun metodo di spedizione creato'; +$_MODULE['<{mondialrelay}prestashop>configuration_daf999e234b6f358dda641bf381b685a'] = 'Configura spedizioni'; +$_MODULE['<{mondialrelay}prestashop>header_e0626222614bdee31951d84c64e5e9ff'] = 'Seleziona'; +$_MODULE['<{mondialrelay}prestashop>header_91b442d385b54e1418d81adc34871053'] = 'Selezionato'; +$_MODULE['<{mondialrelay}prestashop>header_ef2a1f426c2c289ed5986c7636a5d696'] = 'Scegli un punto Reley'; +$_MODULE['<{mondialrelay}prestashop>header_80a0c205cd57b22fca7f174253870300'] = 'Apertura ore'; +$_MODULE['<{mondialrelay}prestashop>header_2b56b60f878922093facd42284848a0c'] = 'Altri dettagli'; +$_MODULE['<{mondialrelay}prestashop>order_detail_81b7b4587a2a3ea7a0d6bb1df3fbba54'] = 'Spedire a'; +$_MODULE['<{mondialrelay}prestashop>order_detail_c2d05abc7f5ebdc72b6656df35038b43'] = 'Segui il mio pacco sul sito Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>post_action_466ec9f29b485204ef53818459da48af'] = 'errore(i)'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_8d63728960e021f7632a11922685705e'] = 'Grazie per correggere gli errori su'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_264f456c4202f0aba86e481a246a3ef1'] = 'la pagina contatti:'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_de21dc13e1ea638777fbfad49f88b332'] = 'Tutti gli ordini che hanno uno stato'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_378116486b5a90bb50fd4f1557698d96'] = 'sarà disponibile per la creazione di una etichetta'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_5dadbd0ec9f0b182be4ead8dad39da79'] = 'Lista ordini'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_d79cf3f429596f77db95c65074663a54'] = 'ID ordine'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_ce26601dac0dea138b7295f02b7620a7'] = 'Cliente'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_0eede552438475bdfe820c13f24c9399'] = 'Totale prezzo'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_c28e0582276cb6747e37d948e1727929'] = 'Totale spedizione'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_44749712dbec183e983dcd78a7736c41'] = 'Data'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_52150799c57e873360cca13c080a91b4'] = 'Inserisci un peso (gr)'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_6ccc0fdff9995e1a0fce00c99e5b6085'] = 'MR numero'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_f9c50cba4de9032d7a6797a2458f8ed9'] = 'MR Nazione'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_428c091372d840900cf8536519fa0056'] = 'EXP Numero'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_a254c25adc7d10d7e9c4889484f875a5'] = 'Dettagli'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_4351cfebe4b61d8aa5efa1d020710005'] = 'Vedi'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_2e01172e31495f41fcebcf3f831cc82c'] = 'Operazione completata con successo'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_37c85a61df6352af7285c307022c4413'] = 'Nessun ordine con questo stato'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_32b919d18cfaca89383f6000dcc9c031'] = 'Generare'; +$_MODULE['<{mondialrelay}prestashop>history_4f1a377c20ace646ddd303ad1e1d243d'] = 'Storico delle etichette create'; +$_MODULE['<{mondialrelay}prestashop>history_d79cf3f429596f77db95c65074663a54'] = 'ID ordine'; +$_MODULE['<{mondialrelay}prestashop>history_e1a98101d56e29eeea312a0eb2748a92'] = 'Exp num'; +$_MODULE['<{mondialrelay}prestashop>history_aab39f783ba2e72eaad1770f4d9ad0c4'] = 'Stampa etichetta A4'; +$_MODULE['<{mondialrelay}prestashop>history_3eb2bc1ee46258d2a166e89398756b3e'] = 'Stampa etichetta A5'; +$_MODULE['<{mondialrelay}prestashop>history_9e50665937cbb2f3c833d3626a9f9abb'] = 'Nessun storico disponibile'; +$_MODULE['<{mondialrelay}prestashop>history_fa98e6528c9df7f26978c2beb7de3d99'] = 'Cancella storico selezionato'; +$_MODULE['<{mondialrelay}prestashop>settings_0a4ee7474864081af12dba847fafdaa6'] = 'Settaggi tab Admin'; +$_MODULE['<{mondialrelay}prestashop>settings_d02bbc3cb147c272b0445ac5ca7d1a36'] = 'Stato ordine'; +$_MODULE['<{mondialrelay}prestashop>settings_ca57625685f058f54d82c6e05876a131'] = 'Scegli uno stato ordine per le etichette'; +$_MODULE['<{mondialrelay}prestashop>settings_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; +$_MODULE['<{mondialrelay}prestashop>settings_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; diff --git a/modules/mondialrelay/docs/index.php b/modules/mondialrelay/docs/index.php new file mode 100755 index 00000000..9d353d76 --- /dev/null +++ b/modules/mondialrelay/docs/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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; \ No newline at end of file diff --git a/modules/mondialrelay/docs/install.pdf b/modules/mondialrelay/docs/install.pdf index 1565f494..663942b6 100755 Binary files a/modules/mondialrelay/docs/install.pdf and b/modules/mondialrelay/docs/install.pdf differ diff --git a/modules/mondialrelay/en.php b/modules/mondialrelay/en.php index 957e3610..601358d4 100755 --- a/modules/mondialrelay/en.php +++ b/modules/mondialrelay/en.php @@ -2,8 +2,3 @@ global $_MODULE; $_MODULE = array(); -$_MODULE['<{mondialrelay}prestashop>mondialrelay_12a3fbd35c1cab4b1101b91d708efd15'] = 'Webservice Enseigne:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_6f0434b67007b555dfd1201f4e0d5254'] = 'Code marque:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_08f785193c96b2a78dec8d76a46648d6'] = 'Webservice Key:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dae2d7c71f2daaedb00191af25dc28d'] = 'Etiquette\'s Language:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_a26329cba9723551cb8654deba32872b'] = 'Weight Coefficient:'; diff --git a/modules/mondialrelay/errorCode.php b/modules/mondialrelay/errorCode.php index 7b0e39c8..36a55cae 100755 --- a/modules/mondialrelay/errorCode.php +++ b/modules/mondialrelay/errorCode.php @@ -1,6 +1,28 @@ +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ $statCode = array( '1' => 'Enseigne invalide', diff --git a/modules/mondialrelay/es.php b/modules/mondialrelay/es.php index 14dc623a..8abdcd1d 100755 --- a/modules/mondialrelay/es.php +++ b/modules/mondialrelay/es.php @@ -2,173 +2,181 @@ global $_MODULE; $_MODULE = array(); -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_d1908b9b04e81c4b6112e38b608c49af'] = 'Gracias por corregir los siguientes errores en'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_ccce63109db30895153094de05c60fa5'] = 'la página de contacto'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_7c5fd3d93bd19d81953db3b374997961'] = 'Por favor mire la siguiente advertencia, quizas el ticket no se genere'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_de21dc13e1ea638777fbfad49f88b332'] = 'Todos los pedidos que tengan un estado'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_a0bf3c9ac2d785f053d883b8746e91ba'] = 'estará disponible para la creación del ticket'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_2345e28c9b93f368968be4781ed70f5c'] = 'Cambio de configuración'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_37c85a61df6352af7285c307022c4413'] = 'No hay pedidos con este estado.'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_d79cf3f429596f77db95c65074663a54'] = 'ID del pedido'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_ce26601dac0dea138b7295f02b7620a7'] = 'Cliente'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_0eede552438475bdfe820c13f24c9399'] = 'El precio total'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_f4e8b53a114e5a17d051ab84d326cae5'] = 'Total de gastos de envío'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_44749712dbec183e983dcd78a7736c41'] = 'Fecha'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_3715c824cbc0f966c61a72254f248a2e'] = 'Ponga un peso (gramos)'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_6ccc0fdff9995e1a0fce00c99e5b6085'] = 'Número MR'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_f9c50cba4de9032d7a6797a2458f8ed9'] = 'País RM '; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_428c091372d840900cf8536519fa0056'] = 'Número envío'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_a254c25adc7d10d7e9c4889484f875a5'] = 'Detalle'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_4351cfebe4b61d8aa5efa1d020710005'] = 'Ver'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_2e01172e31495f41fcebcf3f831cc82c'] = 'Operación realizada con éxito'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_32b919d18cfaca89383f6000dcc9c031'] = 'Generar'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_4f1a377c20ace646ddd303ad1e1d243d'] = 'Historia de la creación de etiquetas'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_e1a98101d56e29eeea312a0eb2748a92'] = 'Exp. número'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_aab39f783ba2e72eaad1770f4d9ad0c4'] = 'Imprimir etiqutea en formato A4'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_3eb2bc1ee46258d2a166e89398756b3e'] = 'Imprimir etiqueta en formato A5 '; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_fa98e6528c9df7f26978c2beb7de3d99'] = 'Borrar los historiales seleccionados'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_e82faee1422140edd04b2f94c5051500'] = 'Acción de éxito'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_3b2d373418745276ae6e207421245cdc'] = 'Estado de pedido ha sido actualizado'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_b4ac3d3f15bc0984d0906aff1202e701'] = 'No se puede actualizar la cuenta de la tienda'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_44585fcd617dce6416d8283b026714c1'] = 'Mondial Relay'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_ed4a3b96dc1f38c160775cac1f7bcd6d'] = 'Entregue sus envíos en un punto de recogida '; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_70d70ce314f545b7c500a086f147f64b'] = 'Tienda no válida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d2286c9c8c8f92cb0e805b17834591b0'] = 'Enseigne no válido '; $_MODULE['<{mondialrelay}prestashop>mondialrelay_709b076565df5fa98cdb2528d897633d'] = 'Código Marca no válido'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_c86508f5bc6b4456e7003d6a1868689d'] = 'Clave Webservice no válida'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_ea9261a3dad976b40ff2088a19fda2c3'] = 'Idioma no válido'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_4eb287cc225ba0e1bcfe9cc1b8315def'] = 'Coeficiente de peso no válido'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_f82576de014726e9ef9b4ed2a9eb947b'] = 'Antes de crear un transportista, debe configurar los parámetros de su cuenta Mondial Relay'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_70ff82d47f295f730c6accf07a2948e8'] = 'Nombre del transportista no válido'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_e1f1787db2fee596f4c3bfaf1d098f8d'] = 'Modo Col no válido'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_9414b7de379a09941e894d28f19949ae'] = 'Modo de entrega no válido'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_5eeb9ca7eee4be7192dd10d917f79a12'] = 'Seguro no válido'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_8b446ac2013dc7085802de71cc342ead'] = 'Debe elegir al menos un país de entrega'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_b9a85d87ae6dd77f2107734a4cd0bb15'] = 'Clave Google no válida'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_979c6094728c14aac1b66d544dc5cebd'] = 'Estado de pedido no válido'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_808fb4e3a637a759565de1d314ea526f'] = 'La dirección principal entrada no tiene un buen formato'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c888438d14855d7d96a2724ee9c306bd'] = 'Se ha actualizado con éxito'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_07213a0161f52846ab198be103b5ab43'] = 'errores'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_cb5e100e5a9a3e7f6d1fd97512215282'] = 'error'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_350c1cc4343826a89f08a33bb49c6d98'] = 'Configuración del módulo Relay Rate'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_5a2355a42ba3ab265701183c914467f2'] = 'Intente desactivar la cache y activar Forzar compilación'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_3de769f9a81eed916583d5b35c58dbdd'] = 'si tiene problemas con el modulo después de actualizar'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_8f8b21bd013b38d1e3059557c22a57e7'] = 'Mire los siguientes How-To para ayudarlo a configurar el modulo Mondial Relay'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_d21a9f93917604d5490ad529a7cf1ff9'] = 'Para crear un transportista Mondial Relay'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6a2e6af5fff47adb3afd780b97d9b4b'] = 'Introduzca y guarde los parámetros de la cuenta Mondial Relay'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_94fbe32464fcfa902feed9f256439833'] = 'Cree un transporte usando la opcion Añadir transportista abajo'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_b962d8fb95f5a439f50502152f3bad71'] = 'Deafina un precio para sus transportista en'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_faf1247ae6846a9955a466d4f301bbe4'] = 'La página de transportistas'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_10d78806b84b97ebc774e9f6277af6ac'] = 'Para generar sus etiquetas, debe haber introducido una dirección correcta de su tienda en'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_af5efea250326c1c34d69aa9364b482c'] = 'página contacto'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_362dff77f7403550e886db901404856c'] = 'Borrado con éxito'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_66661dacf33146201b60dc16520ddd68'] = 'Añadir un transportista'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_b651efdb98a5d6bd2b3935d0c3f4a5e2'] = 'Campo obligatorio'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_531e144cc23ef08408b81cb4d9c641dc'] = 'Nombre del transportista'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c9b415ea1576b19d10d42b332798cd16'] = 'Modo de recogida'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_d24262afca47ba80b691c878243441e8'] = 'Recogida en la tienda'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_201bdb87f8e278b943d07ae924d5de6e'] = 'Modo de entraga'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_142ef02888af88b8b772335277d1c0c8'] = 'Entrega en Punto de recogida'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_eeab8b7cf3c7a558a0e8a4050fa994ca'] = 'Entrega Colis Drive'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_8f7794b107749728c3333ef38d2687e8'] = 'Entrega a domicilio RDC (1 persona)'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_e451efc8ce05b96b214b4c2935f2c657'] = 'Entrega a domicilio especializada (2 personas)'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_eaff1bdf24fcffe0e14e29a1bff51a12'] = 'Seguro'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_96ba408f20bc3e065f400c650d32fd1a'] = 'Sin seguro'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_e5a8fafb1dfb538c172e1e014e86b871'] = 'Seguro complementario N1'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_b02f8d6d4b6217cca317161c87f64065'] = 'Seguro complementario N2'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_90b95ae88150c6a34c4129dc4f1ebbd5'] = 'Seguro complementario N3'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c15b40b8c535191f6f0b6f9beaced3cf'] = 'Seguro complementario N4'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_b67a442fff3ca0a03ea253b0668f946d'] = 'Seguro complementario N5'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_33cbd0d8b6476501f55a8320481ec0f1'] = 'Lista de países :'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_aef71ba4fd060dea2e2c76d1b5076caf'] = 'Puede elegir varios países pulsando Ctrl mientras selecciona los países'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_0309a6c666a7a803fdb9db95de71cf01'] = 'Francia'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_6c1674d14bf5f95742f572cddb0641a7'] = 'Bélgica'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_06630c890abadde9228ea818ce52b621'] = 'Luxemburgo'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_907eba32d950bfab68227fd7ea22999b'] = 'España'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_0c24ec05a02c710cedd400e3680d8b81'] = 'Lista de transportistas'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_14039af96b01e718a9c9d9c1259b6472'] = 'No se ha creado ningún transportista'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_8596361cec00f8d2438d264827eee737'] = 'Configuración transportista'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_9ffc3ccc968a96d902af963c6d7b4e97'] = 'Opciones avanzadas'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_1d1d57f5840e1da871622295ba206b30'] = 'Clic para mostrar / ocultar opciones'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_fcf5b2122da1d5a5f5c7253b96a3f9d9'] = 'URL del cron para lanzar la actualización de los pedidos'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_759e1f68a70bbe8c48eb30fa4b512de8'] = 'Parece que actualizo Mondialrelay sin usar instalar/desinstalar , Debe configurar esta parte para que la generación de tickets funcione'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_bbd9bc77f1f5b6a9edce6db062b607c9'] = 'Esta parte de deja sobreescribir la información enviada a Mondial Relay cuando genera un ticket. Algunos campos están restringidos por longitud o caracteres prohibidos.'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_9127fe218b2cac7f0c8aecd7016a891d'] = 'Nombre de la tienda'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_7e9bbecd32836500b557db33c3b3e93b'] = 'La clave utilizada por Mondialrelay es'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_32963eea43914b6a418fb2fd9850beb9'] = 'y tiene el valor por defecto'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_f4f70727dc34561dfde1a3c529b6205c'] = 'Parámetros'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_d02bbc3cb147c272b0445ac5ca7d1a36'] = 'Estado de los pedidos'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_818f954f4838ecad839c5dcbd287d291'] = 'Elija un estado para generar etiquetas. Puede administrar sus etiquetas en'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_5117e194c641ad4fc55417b554aead3c'] = 'la página de administración de Mondial Relay'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_1ba3935c9858ffb8e19a35ca640b8505'] = 'Parámetros de la cuenta Mondial Relay'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_a125105400f6e4ee4574da3793af5ef2'] = 'Estos parametros son dados por Mondial Relay una vez suscripto a su servicio'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_12a3fbd35c1cab4b1101b91d708efd15'] = 'Tienda WebService '; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_6f0434b67007b555dfd1201f4e0d5254'] = 'Código marca:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_08f785193c96b2a78dec8d76a46648d6'] = 'Clave Webservice:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dae2d7c71f2daaedb00191af25dc28d'] = 'Idioma:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_a26329cba9723551cb8654deba32872b'] = 'Coeficinte de peso:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_99244b234ec089eca40ff9e8ec343e87'] = 'gramos = 1'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_61cbc2d26b4157292673c772ddd6c0f7'] = 'Guardar cambios'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_2673bca5ba0a7871770e69c962e6ce38'] = 'Número de expediciones'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dbe844fb964d5eca2f51be724e43294'] = 'URL de las etiquetas'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6aefd5e2191e1210a2f50416812b517'] = 'URL de los seguimientos'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_61e70b58e38fd01daa254f44c4fa264b'] = 'Número de puntos recogida'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e82faee1422140edd04b2f94c5051500'] = 'Acción de éxito'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_672facd73d4aee44c116cfd95298db87'] = 'El detalle de la cuenta se ha actualizado'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b4ac3d3f15bc0984d0906aff1202e701'] = 'No se puede actualizar la cuenta de la tienda'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ea50be3d60be594e10e9e3560cb9159f'] = 'El método de envío se ha añadido'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d0cfdfcfb71029b561f5ebdc176d87ca'] = 'Estado de envío cambiado correctamente'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_7534411af2e35bed1f79df5938f077f9'] = 'EL transportista ha sido borrado (desactivada en la base de datos prestashop)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2673bca5ba0a7871770e69c962e6ce38'] = 'Nb expedición:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dbe844fb964d5eca2f51be724e43294'] = 'Etiqueta de URL'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6aefd5e2191e1210a2f50416812b517'] = 'Seguimiento de URL'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_61e70b58e38fd01daa254f44c4fa264b'] = 'Nb Punto de Transición:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_aa625fced6f01ae595b6a9ac499c2ecf'] = 'Rango de peso no se puede añadir'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_63d15383121b5bb5c53323f3f96bd1f2'] = 'Rango de precios no se puede añadir'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d4d197dd028e28ae56208971b564921a'] = 'Zona predeterminada no se puede añadir'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_760ac6deb1c5b84321f65ba0c7f319f5'] = 'Datos de la zona Transportista o entrega no se añadira'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8bf569ff65b32464e623ca9e9a10688d'] = 'El transportista no puede crearse en Prestashop'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6ed26bdf3f9141ddca4ede91f943e567'] = 'El metodo del transportista no puede agregarse al modulo'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_af135815ccf731bcbffb522004762b57'] = 'EL transportista no puede borrarse todavia'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_bba366864d25056c941b72f18ef79e7c'] = 'Este error no se conoce:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_e0626222614bdee31951d84c64e5e9ff'] = 'Seleccionar'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_91b442d385b54e1418d81adc34871053'] = 'Seleccionado'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_ef2a1f426c2c289ed5986c7636a5d696'] = 'Por favor seleccione un punto de envio'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_80a0c205cd57b22fca7f174253870300'] = 'Horario de atención'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_2b56b60f878922093facd42284848a0c'] = 'Mas detalles'; -$_MODULE['<{mondialrelay}prestashop>orderdetail_81b7b4587a2a3ea7a0d6bb1df3fbba54'] = 'Entregado a'; -$_MODULE['<{mondialrelay}prestashop>orderdetail_c2d05abc7f5ebdc72b6656df35038b43'] = 'Seguir mi paquete en la web de Mondial Relay'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_a1c3470a944b9625cfb924fd15c8bdbf'] = 'Por favor, seleccione al menos un pedido'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_dc41aac14af17f1d19fca5e3b9439e74'] = 'La clave'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_306b346c19017609403424203ea3d720'] = 'está vacío y debe ser llenado'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Parece que la petición no es válida:'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_c9b4de92f371ae545ad6f051c07d58ca'] = 'Hay un número de error:'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_ea5f761be4e4888eabf4e1501d7817d1'] = 'Detalles:'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_eabb11bf9623f08409a0a4c9d035a336'] = 'Envío Número:'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_b92c3d3319314513c547675924ceecd1'] = 'Ticket URL'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_66b793b6b4125e300717e8cf7449f533'] = 'URL de seguimiento:'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_2653c23b8c0daac59571e4be5e8fa7d0'] = 'El servicio web Mondial Relay no es seguro actualmente '; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_26b6b6eaec970108c5e84286159fbf48'] = 'Por favor verifique la configuración de su idioma'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_557595c2e17c9948a9448eb763ac1a88'] = 'Por favor verifique el nombre de su tienda'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_017ca6b770ad53669a4eec82894dfcd3'] = 'Por favor verifique la dirección 1'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_3f79e1fc66b4f9cca7bd68cab176020d'] = 'Por favor verifique la configuración de su ciudad'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_404665d9b65239985d59b30b3dcb26b5'] = 'Por favor verifique la configuración de su código postal'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_74cb73eddbe6eaf556023f943fc7e1fd'] = 'Parece que la configuración de el código postal de su país no esta configurado o puso el código incorrecto'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_0b8a30478b9572b86718989d483fd88d'] = 'Por favor verifique la configuración de su pais'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_7ddf2d94bf037b7d1088c0600ea589c3'] = 'Por favor verifique la configuración de su teléfono'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_9c7ce7be9a2c593b24d448edb4f804e0'] = 'Por favor verifique la configuración de su email'; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_14288d48d107056c1acf8aaae1bf282b'] = 'La dirección del cliente no se encuentra'; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_dc41aac14af17f1d19fca5e3b9439e74'] = 'Esta llave'; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_135a7b9a62531e066a95093d8951b344'] = 'no tiene un formato válido'; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Parece que la solicitud es inválida:'; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_c9b4de92f371ae545ad6f051c07d58ca'] = 'Hay un error numero:'; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_ea5f761be4e4888eabf4e1501d7817d1'] = 'Detalles:'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_26b6b6eaec970108c5e84286159fbf48'] = 'Por favor, compruebe su configuración de idioma'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_557595c2e17c9948a9448eb763ac1a88'] = 'Por favor, compruebe la configuración de su nombre de la tienda'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_017ca6b770ad53669a4eec82894dfcd3'] = 'Por favor, compruebe la configuracion de la dirección1'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_3f79e1fc66b4f9cca7bd68cab176020d'] = 'Por favor, compruebe la configuración de su ciudad'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_404665d9b65239985d59b30b3dcb26b5'] = 'Por favor, compruebe la configuración de su código postal'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_0b8a30478b9572b86718989d483fd88d'] = 'Por favor, compruebe la configuración de su país'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_7ddf2d94bf037b7d1088c0600ea589c3'] = 'Por favor, compruebe la configuración de su teléfono'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_9c7ce7be9a2c593b24d448edb4f804e0'] = 'Por favor, revise su configuración de correo'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_85e6a18230d49abf8cfe912809185258'] = 'Utilizando una versión PrestaShop menos de 1.4, nose puede validar el código postal'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_14288d48d107056c1acf8aaae1bf282b'] = 'Dirección del cliente no se encuentra'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_dc41aac14af17f1d19fca5e3b9439e74'] = 'La clave'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_135a7b9a62531e066a95093d8951b344'] = 'no tiene un formato de valor válido'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Parece que la petición no es válida'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_c9b4de92f371ae545ad6f051c07d58ca'] = 'Hay un número de error:'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_ea5f761be4e4888eabf4e1501d7817d1'] = 'Detalles'; $_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_4e274658c9e97c2a336dde79dd0a7772'] = 'MondialRelay no puede encontrar ningun punto cerca de su dirección. Quizás su dirección no es correcta?'; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_2653c23b8c0daac59571e4be5e8fa7d0'] = 'El servicio web Mondial Relay no esta disponible'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_2653c23b8c0daac59571e4be5e8fa7d0'] = 'El servicio web Mondial Relay no es seguro actualmente '; $_MODULE['<{mondialrelay}prestashop>mrgettickets_dc41aac14af17f1d19fca5e3b9439e74'] = 'La clave'; $_MODULE['<{mondialrelay}prestashop>mrgettickets_135a7b9a62531e066a95093d8951b344'] = 'no tiene un formato de valor válido'; $_MODULE['<{mondialrelay}prestashop>mrgettickets_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Parece que la petición no es válida'; $_MODULE['<{mondialrelay}prestashop>mrgettickets_c9b4de92f371ae545ad6f051c07d58ca'] = 'Hay un número de error:'; $_MODULE['<{mondialrelay}prestashop>mrgettickets_ea5f761be4e4888eabf4e1501d7817d1'] = 'Detalles: '; $_MODULE['<{mondialrelay}prestashop>mrgettickets_2653c23b8c0daac59571e4be5e8fa7d0'] = 'El servicio web Mondial Relay no es seguro actualmente '; -$_MODULE['<{mondialrelay}prestashop>mrmanagement_38b4abe2f5860f034e315f2da648a3d6'] = 'Desinstalar Mondial Relay'; -$_MODULE['<{mondialrelay}prestashop>mrmanagement_77bad09c976ec16f38381dc220139367'] = 'Usted esta intentando desinstalar el modulo, desea remover la base de datos'; -$_MODULE['<{mondialrelay}prestashop>mrmanagement_09c081633d484a62a2f6940c12a0de36'] = 'Mantener y desinstalar'; -$_MODULE['<{mondialrelay}prestashop>mrmanagement_0b7f47fce1d82d53244771c64b1535c0'] = 'Borrar y desinstalar'; -$_MODULE['<{mondialrelay}prestashop>mrmanagement_ea4788705e6873b424c65e91c2846b19'] = 'Cancelar'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_38b4abe2f5860f034e315f2da648a3d6'] = 'Desinstalación de Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_a4691c957e81a6f0b6f0ed44f8f2dfe8'] = 'Usted debe vuelver a intentar desinstalar el módulo, desea eliminar la base de datos'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_09c081633d484a62a2f6940c12a0de36'] = 'Mantener y desinstalar'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_0b7f47fce1d82d53244771c64b1535c0'] = 'Borrar y desinstalar'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_ea4788705e6873b424c65e91c2846b19'] = 'Suprimir'; $_MODULE['<{mondialrelay}prestashop>mrmanagement_a42bb0eaa485682166770a54469385f6'] = 'Algunos artículos no se pueden quitar, por favor, inténtelo de nuevo'; $_MODULE['<{mondialrelay}prestashop>mrmanagement_11744bfebb33e52be37a66a530b7045d'] = 'Por favor, seleccione al menos un elemento'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_14288d48d107056c1acf8aaae1bf282b'] = 'No se encuentra la dirección del cliente'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_dc41aac14af17f1d19fca5e3b9439e74'] = 'Esta llave'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_306b346c19017609403424203ea3d720'] = 'esta vacia y necesita llenarla'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Parece que la solicitud es inválida:'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_c9b4de92f371ae545ad6f051c07d58ca'] = 'Hay un error e nel numero:'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_ea5f761be4e4888eabf4e1501d7817d1'] = 'Detalles:'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lunes:'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_5792315f09a5d54fb7e3d066672b507f'] = 'Martes:'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_796c163589f295373e171842f37265d5'] = 'Miercoles:'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_78ae6f0cd191d25147e252dc54768238'] = 'Jueves:'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_c33b138a163847cdb6caeeb7c9a126b4'] = 'Viernes:'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Sabado:'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Domingo:'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_2653c23b8c0daac59571e4be5e8fa7d0'] = 'El servicio web de Mondial Relay no esta disponible'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_14288d48d107056c1acf8aaae1bf282b'] = 'Cancelar'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_dc41aac14af17f1d19fca5e3b9439e74'] = 'La clave'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_306b346c19017609403424203ea3d720'] = 'está vacío y debe ser llenado'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Parece que la petición no es válida'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_c9b4de92f371ae545ad6f051c07d58ca'] = 'Hay un número de error:'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_ea5f761be4e4888eabf4e1501d7817d1'] = 'Detalles'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lunes'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_5792315f09a5d54fb7e3d066672b507f'] = 'Martes'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_796c163589f295373e171842f37265d5'] = 'Miércoles'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_78ae6f0cd191d25147e252dc54768238'] = 'Jueves'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_c33b138a163847cdb6caeeb7c9a126b4'] = 'Viernes'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Sábado'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Domingo'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_2653c23b8c0daac59571e4be5e8fa7d0'] = 'El servicio web Mondial Relay no es seguro actualmente '; +$_MODULE['<{mondialrelay}prestashop>checkout_process_836f6c949a2f2d61489bf410def82111'] = 'Mondial Relay no puede buscar cualquier punto de repetición debido a un error prestashop'; +$_MODULE['<{mondialrelay}prestashop>configuration_0f27e5e9020f28e3f31b78376e11d4c7'] = 'Mondial Relay Configuración'; +$_MODULE['<{mondialrelay}prestashop>configuration_8bc212f48680748479bbd322d4d73d3f'] = 'detalles de la cuenta'; +$_MODULE['<{mondialrelay}prestashop>configuration_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Envío'; +$_MODULE['<{mondialrelay}prestashop>configuration_fe4c6a5e7bd6793b37370e4e46daf998'] = 'Ajustes avanzados'; +$_MODULE['<{mondialrelay}prestashop>configuration_326e057f57e830834c20d668e44627ef'] = 'Info'; +$_MODULE['<{mondialrelay}prestashop>configuration_29141d2b5a484e8032ef64339733f0dc'] = 'Por favor, ajuste la configuración de la cuenta Mondial Relay '; +$_MODULE['<{mondialrelay}prestashop>configuration_5a2355a42ba3ab265701183c914467f2'] = 'Trata de desactivar la caché y forzar compilación para'; +$_MODULE['<{mondialrelay}prestashop>configuration_3de769f9a81eed916583d5b35c58dbdd'] = 'si usted tiene algún problema con el módulo después de una actualización'; +$_MODULE['<{mondialrelay}prestashop>configuration_8f8b21bd013b38d1e3059557c22a57e7'] = '¡Echa un vistazo a la siguiente HOW-TO para ayudarle a configurar el módulo deMondial Relay'; +$_MODULE['<{mondialrelay}prestashop>configuration_d21a9f93917604d5490ad529a7cf1ff9'] = 'Para crear una compañía Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>configuration_c6a2e6af5fff47adb3afd780b97d9b4b'] = 'Entra y guarde los ajustes de la cuenta Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>configuration_b29c4694f835ad29b9893cd3fed36fbc'] = 'Crear un transportista con el botón de envío'; +$_MODULE['<{mondialrelay}prestashop>configuration_b962d8fb95f5a439f50502152f3bad71'] = 'Definir un precio para su compañía en el'; +$_MODULE['<{mondialrelay}prestashop>configuration_faf1247ae6846a9955a466d4f301bbe4'] = 'La página del transportista'; +$_MODULE['<{mondialrelay}prestashop>configuration_10d78806b84b97ebc774e9f6277af6ac'] = 'Para generar las etiquetas, debe tener una dirección válida y registrada de su tiendaen su'; +$_MODULE['<{mondialrelay}prestashop>configuration_af5efea250326c1c34d69aa9364b482c'] = 'la página de contacto'; +$_MODULE['<{mondialrelay}prestashop>configuration_1ba3935c9858ffb8e19a35ca640b8505'] = 'Configuración de la cuenta Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>configuration_a125105400f6e4ee4574da3793af5ef2'] = 'Estos parámetros son proporcionados por Mondial Relay, una vez se ha suscrito a su servicio'; +$_MODULE['<{mondialrelay}prestashop>configuration_12a3fbd35c1cab4b1101b91d708efd15'] = 'Webservice Enseigne:'; +$_MODULE['<{mondialrelay}prestashop>configuration_6f0434b67007b555dfd1201f4e0d5254'] = 'Código de marca:'; +$_MODULE['<{mondialrelay}prestashop>configuration_08f785193c96b2a78dec8d76a46648d6'] = 'Webservice clave:'; +$_MODULE['<{mondialrelay}prestashop>configuration_0dae2d7c71f2daaedb00191af25dc28d'] = 'Idioma:'; +$_MODULE['<{mondialrelay}prestashop>configuration_a26329cba9723551cb8654deba32872b'] = 'Coeficiente de peso:'; +$_MODULE['<{mondialrelay}prestashop>configuration_99244b234ec089eca40ff9e8ec343e87'] = 'gramos = 1'; +$_MODULE['<{mondialrelay}prestashop>configuration_61cbc2d26b4157292673c772ddd6c0f7'] = 'Actualizar ajustes'; +$_MODULE['<{mondialrelay}prestashop>configuration_70397c4b252a5168c5ec003931cea215'] = 'Campos obligatorios'; +$_MODULE['<{mondialrelay}prestashop>configuration_9ffc3ccc968a96d902af963c6d7b4e97'] = 'Configuración avanzada'; +$_MODULE['<{mondialrelay}prestashop>configuration_fcf5b2122da1d5a5f5c7253b96a3f9d9'] = 'URL de tarea programada'; +$_MODULE['<{mondialrelay}prestashop>configuration_66661dacf33146201b60dc16520ddd68'] = 'Añadir un Método de envío'; +$_MODULE['<{mondialrelay}prestashop>configuration_531e144cc23ef08408b81cb4d9c641dc'] = 'Nombre del transportista'; +$_MODULE['<{mondialrelay}prestashop>configuration_8f497c1a3d15af9e0c215019f26b887d'] = 'Retraso'; +$_MODULE['<{mondialrelay}prestashop>configuration_201bdb87f8e278b943d07ae924d5de6e'] = 'Modo de entrega'; +$_MODULE['<{mondialrelay}prestashop>configuration_142ef02888af88b8b772335277d1c0c8'] = 'Entrega a un punto de relevo'; +$_MODULE['<{mondialrelay}prestashop>configuration_eeab8b7cf3c7a558a0e8a4050fa994ca'] = 'Envio Colis Drive'; +$_MODULE['<{mondialrelay}prestashop>configuration_8f7794b107749728c3333ef38d2687e8'] = 'Inicio de entrega RDC (1 persona)'; +$_MODULE['<{mondialrelay}prestashop>configuration_e451efc8ce05b96b214b4c2935f2c657'] = 'La entrega a domicilio Especial (2 personas)'; +$_MODULE['<{mondialrelay}prestashop>configuration_eaff1bdf24fcffe0e14e29a1bff51a12'] = 'de seguros'; +$_MODULE['<{mondialrelay}prestashop>configuration_96ba408f20bc3e065f400c650d32fd1a'] = 'No tiene seguro'; +$_MODULE['<{mondialrelay}prestashop>configuration_e5a8fafb1dfb538c172e1e014e86b871'] = 'Seguro Complementario Lv1'; +$_MODULE['<{mondialrelay}prestashop>configuration_b02f8d6d4b6217cca317161c87f64065'] = 'Seguro Complementario Lv2'; +$_MODULE['<{mondialrelay}prestashop>configuration_90b95ae88150c6a34c4129dc4f1ebbd5'] = 'Seguro Complementario Lv3'; +$_MODULE['<{mondialrelay}prestashop>configuration_c15b40b8c535191f6f0b6f9beaced3cf'] = 'Seguro Complementario Lv4'; +$_MODULE['<{mondialrelay}prestashop>configuration_b67a442fff3ca0a03ea253b0668f946d'] = 'Seguro Complementario Lv5'; +$_MODULE['<{mondialrelay}prestashop>configuration_33cbd0d8b6476501f55a8320481ec0f1'] = 'Países de envío:'; +$_MODULE['<{mondialrelay}prestashop>configuration_aef71ba4fd060dea2e2c76d1b5076caf'] = 'Usted puede elegir varios países presionando Ctrl mientras selecciona los países'; +$_MODULE['<{mondialrelay}prestashop>configuration_0309a6c666a7a803fdb9db95de71cf01'] = 'Francia'; +$_MODULE['<{mondialrelay}prestashop>configuration_6c1674d14bf5f95742f572cddb0641a7'] = 'Bélgica'; +$_MODULE['<{mondialrelay}prestashop>configuration_06630c890abadde9228ea818ce52b621'] = 'Luxemburgo'; +$_MODULE['<{mondialrelay}prestashop>configuration_907eba32d950bfab68227fd7ea22999b'] = 'España'; +$_MODULE['<{mondialrelay}prestashop>configuration_0c24ec05a02c710cedd400e3680d8b81'] = 'Lista de método de envío \\\\\\\\ \'s'; +$_MODULE['<{mondialrelay}prestashop>configuration_14039af96b01e718a9c9d9c1259b6472'] = 'No hay métodos de envío creados'; +$_MODULE['<{mondialrelay}prestashop>configuration_daf999e234b6f358dda641bf381b685a'] = 'Envío de configuración'; +$_MODULE['<{mondialrelay}prestashop>header_e0626222614bdee31951d84c64e5e9ff'] = 'Seleccionar'; +$_MODULE['<{mondialrelay}prestashop>header_91b442d385b54e1418d81adc34871053'] = 'seleccionado'; +$_MODULE['<{mondialrelay}prestashop>header_ef2a1f426c2c289ed5986c7636a5d696'] = 'Por favor, elija un punto de relevo'; +$_MODULE['<{mondialrelay}prestashop>header_80a0c205cd57b22fca7f174253870300'] = 'Horario de apertura'; +$_MODULE['<{mondialrelay}prestashop>header_2b56b60f878922093facd42284848a0c'] = 'Más detalles'; +$_MODULE['<{mondialrelay}prestashop>order_detail_81b7b4587a2a3ea7a0d6bb1df3fbba54'] = 'Enviado a'; +$_MODULE['<{mondialrelay}prestashop>order_detail_c2d05abc7f5ebdc72b6656df35038b43'] = 'Siga mi paquete en la página web Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>post_action_466ec9f29b485204ef53818459da48af'] = 'error(es)'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_8d63728960e021f7632a11922685705e'] = 'Gracias a la amabilidad de corregir los errores siguientes en'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_264f456c4202f0aba86e481a246a3ef1'] = 'la página de contacto:'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_de21dc13e1ea638777fbfad49f88b332'] = 'Todos los pedidos que tienen el estado'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_378116486b5a90bb50fd4f1557698d96'] = 'estará disponible para la creación de adhesivo'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_5dadbd0ec9f0b182be4ead8dad39da79'] = 'Lista de pedidos'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_d79cf3f429596f77db95c65074663a54'] = 'ID pedido'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_ce26601dac0dea138b7295f02b7620a7'] = 'cliente'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_0eede552438475bdfe820c13f24c9399'] = 'Precio total'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_c28e0582276cb6747e37d948e1727929'] = 'Total gastos de envío:'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_44749712dbec183e983dcd78a7736c41'] = 'Fecha'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_52150799c57e873360cca13c080a91b4'] = 'Ponga un peso (en gramos)'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_6ccc0fdff9995e1a0fce00c99e5b6085'] = 'Número de MR'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_f9c50cba4de9032d7a6797a2458f8ed9'] = 'País MR'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_428c091372d840900cf8536519fa0056'] = 'Exp. Número'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_a254c25adc7d10d7e9c4889484f875a5'] = 'Detalle'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_4351cfebe4b61d8aa5efa1d020710005'] = 'Vista'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_2e01172e31495f41fcebcf3f831cc82c'] = 'Operación exitosa'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_37c85a61df6352af7285c307022c4413'] = 'No hay pedidos con este estado.'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_32b919d18cfaca89383f6000dcc9c031'] = '¡Generar!'; +$_MODULE['<{mondialrelay}prestashop>history_4f1a377c20ace646ddd303ad1e1d243d'] = 'Historial de creación de etiquetas'; +$_MODULE['<{mondialrelay}prestashop>history_d79cf3f429596f77db95c65074663a54'] = 'ID pedido'; +$_MODULE['<{mondialrelay}prestashop>history_e1a98101d56e29eeea312a0eb2748a92'] = 'Exp. número'; +$_MODULE['<{mondialrelay}prestashop>history_aab39f783ba2e72eaad1770f4d9ad0c4'] = 'Imprimir etiqueta A4'; +$_MODULE['<{mondialrelay}prestashop>history_3eb2bc1ee46258d2a166e89398756b3e'] = 'Imprimir etiqueta A5'; +$_MODULE['<{mondialrelay}prestashop>history_9e50665937cbb2f3c833d3626a9f9abb'] = 'No hay historias disponibles'; +$_MODULE['<{mondialrelay}prestashop>history_fa98e6528c9df7f26978c2beb7de3d99'] = 'Eliminar el historial de seleccionados'; +$_MODULE['<{mondialrelay}prestashop>settings_0a4ee7474864081af12dba847fafdaa6'] = 'Configuraciones de admin Tab'; +$_MODULE['<{mondialrelay}prestashop>settings_d02bbc3cb147c272b0445ac5ca7d1a36'] = 'Estado de los pedidos'; +$_MODULE['<{mondialrelay}prestashop>settings_ca57625685f058f54d82c6e05876a131'] = 'Elige el estado para que las etiquetas.'; +$_MODULE['<{mondialrelay}prestashop>settings_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar '; +$_MODULE['<{mondialrelay}prestashop>settings_f4f70727dc34561dfde1a3c529b6205c'] = 'Ajustes'; diff --git a/modules/mondialrelay/fr.php b/modules/mondialrelay/fr.php index 555651d8..ba836d12 100755 --- a/modules/mondialrelay/fr.php +++ b/modules/mondialrelay/fr.php @@ -2,157 +2,79 @@ global $_MODULE; $_MODULE = array(); -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_d1908b9b04e81c4b6112e38b608c49af'] = 'Merci de bien vouloir corriger les erreurs suivantes dans'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_ccce63109db30895153094de05c60fa5'] = 'la page de contact'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_7c5fd3d93bd19d81953db3b374997961'] = 'Merci de jeter un oeil à la mise en garde suivante, peut-être que l\'étiquette ne sera pas générée'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_de21dc13e1ea638777fbfad49f88b332'] = 'Toutes les commandes qui auront un statut'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_a0bf3c9ac2d785f053d883b8746e91ba'] = 'seront disponibles pour la création d\'ètiquette'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_2345e28c9b93f368968be4781ed70f5c'] = 'Changer la configuration'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_37c85a61df6352af7285c307022c4413'] = 'Aucune commande n\'existe avec ce statut'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_d79cf3f429596f77db95c65074663a54'] = 'Identifiant de la commande'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_ce26601dac0dea138b7295f02b7620a7'] = 'Client'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_0eede552438475bdfe820c13f24c9399'] = 'Prix total'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_f4e8b53a114e5a17d051ab84d326cae5'] = 'Total frais d\'expédition'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_44749712dbec183e983dcd78a7736c41'] = 'Date'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_3715c824cbc0f966c61a72254f248a2e'] = 'Mettez un poids (grammes)'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_6ccc0fdff9995e1a0fce00c99e5b6085'] = 'Numéro MR'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_f9c50cba4de9032d7a6797a2458f8ed9'] = 'Pays MR'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_428c091372d840900cf8536519fa0056'] = 'Numéro d\'expedition'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_a254c25adc7d10d7e9c4889484f875a5'] = 'Détail'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_4351cfebe4b61d8aa5efa1d020710005'] = 'Voir'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_2e01172e31495f41fcebcf3f831cc82c'] = 'Opération réussie'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_32b919d18cfaca89383f6000dcc9c031'] = 'Générer'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_4f1a377c20ace646ddd303ad1e1d243d'] = 'Historique de la création d\'étiquettes'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_e1a98101d56e29eeea312a0eb2748a92'] = 'Exp num'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_aab39f783ba2e72eaad1770f4d9ad0c4'] = 'Imprimer l\'étiquette format A4'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_3eb2bc1ee46258d2a166e89398756b3e'] = 'Imprimer l\'étiquette format A5'; -$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_fa98e6528c9df7f26978c2beb7de3d99'] = 'Supprimer les historiques sélectionnés'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_e82faee1422140edd04b2f94c5051500'] = 'Action terminée avec succès!'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_3b2d373418745276ae6e207421245cdc'] = 'Le statut de la commande a été mis à jour'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_b4ac3d3f15bc0984d0906aff1202e701'] = 'Impossible de mettre à jour le compte'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_44585fcd617dce6416d8283b026714c1'] = 'Mondial Relay'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_ed4a3b96dc1f38c160775cac1f7bcd6d'] = 'Livrez vos colis en point relais'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_70d70ce314f545b7c500a086f147f64b'] = 'Enseigne invalide'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ed4a3b96dc1f38c160775cac1f7bcd6d'] = 'Livrez vos colis en Point Relais®'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ec0cc3039fa07db6a4e83582d2796883'] = 'Mondial Relay nécessite les librairies SOAP et CURL pour pouvoir fonctionner.'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4c9120f1a5947445c0e9620254ceb30b'] = 'Confirmation de Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d2286c9c8c8f92cb0e805b17834591b0'] = 'Enseigne invalide'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_709b076565df5fa98cdb2528d897633d'] = 'Code Marque invalide'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_c86508f5bc6b4456e7003d6a1868689d'] = 'Clé Webservice invalide'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_ea9261a3dad976b40ff2088a19fda2c3'] = 'Langage invalide'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_4eb287cc225ba0e1bcfe9cc1b8315def'] = 'Coefficient de poids invalide'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_f82576de014726e9ef9b4ed2a9eb947b'] = 'Configurez d\'abord vos paramètres de compte Mondial Relay avant de créer un transporteur'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_70ff82d47f295f730c6accf07a2948e8'] = 'Nom de transporteur invalide'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_e1f1787db2fee596f4c3bfaf1d098f8d'] = 'Col Mode invalide'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_9414b7de379a09941e894d28f19949ae'] = 'Mode de livraison invalide'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_5eeb9ca7eee4be7192dd10d917f79a12'] = 'Assurance invalide'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_8b446ac2013dc7085802de71cc342ead'] = 'Vous devez choisir au moins un pays de livraison'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_b9a85d87ae6dd77f2107734a4cd0bb15'] = 'Clé google invalide'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_979c6094728c14aac1b66d544dc5cebd'] = 'Etat de commande invalide'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_808fb4e3a637a759565de1d314ea526f'] = 'L\'adresse principale envoyée ne n\'a pas un bon format'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour avec succès'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_07213a0161f52846ab198be103b5ab43'] = 'erreurs'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_cb5e100e5a9a3e7f6d1fd97512215282'] = 'erreur'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_350c1cc4343826a89f08a33bb49c6d98'] = 'Configuration du Module Mondial Relay'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_5a2355a42ba3ab265701183c914467f2'] = 'Essayez de désactiver le cache et de forcer la compilation smarty'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_3de769f9a81eed916583d5b35c58dbdd'] = 'si vous rencontrez le moindre problème après une mise à jour du module'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_8f8b21bd013b38d1e3059557c22a57e7'] = 'Consulter le manuel pour vous guider dans la configuration de Mondial Relay'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_d21a9f93917604d5490ad529a7cf1ff9'] = 'Pour créer un transporteur Mondial Relay'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6a2e6af5fff47adb3afd780b97d9b4b'] = 'Remplissez et sauvegarder vos paramètres Mondial Relay'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_94fbe32464fcfa902feed9f256439833'] = 'Créez un transporteur via le formulaire ‘’ajouter un transporteur’’ ci-dessous'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_b962d8fb95f5a439f50502152f3bad71'] = 'Definissez un prix pour votre transporteur sur'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_faf1247ae6846a9955a466d4f301bbe4'] = 'La page Transporteurs'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_10d78806b84b97ebc774e9f6277af6ac'] = 'Pour générer vos étiquettes, vous devez avoir enregistré une adresse valide de votre boutique sur votre'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_af5efea250326c1c34d69aa9364b482c'] = 'page contact'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_362dff77f7403550e886db901404856c'] = 'Suppression effectuée'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_66661dacf33146201b60dc16520ddd68'] = 'Ajouter un transporteur'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_b651efdb98a5d6bd2b3935d0c3f4a5e2'] = 'Champ obligatoire'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_531e144cc23ef08408b81cb4d9c641dc'] = 'Nom du transporteur'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c9b415ea1576b19d10d42b332798cd16'] = 'Mode de collecte'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_d24262afca47ba80b691c878243441e8'] = 'Collecte à l\'enseigne'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_201bdb87f8e278b943d07ae924d5de6e'] = 'Mode de livraison'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_142ef02888af88b8b772335277d1c0c8'] = 'Livraison dans un point relais'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_eeab8b7cf3c7a558a0e8a4050fa994ca'] = 'Livraison Colis Drive'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_8f7794b107749728c3333ef38d2687e8'] = 'Livraison à domicile RDC (1 personne)'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_e451efc8ce05b96b214b4c2935f2c657'] = 'Livraison à domicile spécialisée (2 personnes)'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_eaff1bdf24fcffe0e14e29a1bff51a12'] = 'Assurance'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_96ba408f20bc3e065f400c650d32fd1a'] = 'Défaut, pas d\'assurance complémentaire'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_e5a8fafb1dfb538c172e1e014e86b871'] = 'Assurance complémentaire N1'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_b02f8d6d4b6217cca317161c87f64065'] = 'Assurance complémentaire N2'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_90b95ae88150c6a34c4129dc4f1ebbd5'] = 'Assurance complémentaire N3'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c15b40b8c535191f6f0b6f9beaced3cf'] = 'Assurance complémentaire N4'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_b67a442fff3ca0a03ea253b0668f946d'] = 'Assurance complémentaire N5'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_33cbd0d8b6476501f55a8320481ec0f1'] = 'Pays de livraison :'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_aef71ba4fd060dea2e2c76d1b5076caf'] = 'Vous pouvez choisir plusieurs pays en appuyant sur Ctrl tout en sélectionnant les pays'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_0309a6c666a7a803fdb9db95de71cf01'] = 'France'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_6c1674d14bf5f95742f572cddb0641a7'] = 'Belgique'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_06630c890abadde9228ea818ce52b621'] = 'Luxembourg'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_907eba32d950bfab68227fd7ea22999b'] = 'Espagne'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_0c24ec05a02c710cedd400e3680d8b81'] = 'Liste des transporteurs'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_14039af96b01e718a9c9d9c1259b6472'] = 'Aucun transporteur créé'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_8596361cec00f8d2438d264827eee737'] = 'Modifier les paramètres de ce transporteur'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_9ffc3ccc968a96d902af963c6d7b4e97'] = 'Paramètres avancés'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_1d1d57f5840e1da871622295ba206b30'] = 'Cliquez pour afficher / cacher les options'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_fcf5b2122da1d5a5f5c7253b96a3f9d9'] = 'URL de la tache CRON à lancer pour la mise à jour des statuts de commandes'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_759e1f68a70bbe8c48eb30fa4b512de8'] = 'Il semblerait que vous venez de mettre à jour Mondial Relay sans avoir réinitialisé le module : il est requis de configurer les champs ci-dessous afin de pouvoir générer les étiquettes'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_bbd9bc77f1f5b6a9edce6db062b607c9'] = 'Cette partie permet de réécrire les données envoyées à Mondial Relay lorsque vous lancez le processus de génération de tickets. Certains champs sont assez restrictifs en terme de longueur ou de caractères utilisés.'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_9127fe218b2cac7f0c8aecd7016a891d'] = 'Nom de la boutique'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_7e9bbecd32836500b557db33c3b3e93b'] = 'La clé utilisée par Mondialrelay est'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_32963eea43914b6a418fb2fd9850beb9'] = 'et elle contient comme valeur par défaut'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_d02bbc3cb147c272b0445ac5ca7d1a36'] = 'Etat des commandes'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_818f954f4838ecad839c5dcbd287d291'] = 'Choississez le statut pour la génération d\'étiquette. Vous pouvez administrer vos étiquettes sur'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_5117e194c641ad4fc55417b554aead3c'] = 'la page d\'administration de Mondial Relay'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_1ba3935c9858ffb8e19a35ca640b8505'] = 'Paramètres du compte Mondial Relay'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_a125105400f6e4ee4574da3793af5ef2'] = 'Ces paramẻtres sont fournis par Mondial Relay lors de la souscription à leur service'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_12a3fbd35c1cab4b1101b91d708efd15'] = 'Enseigne Webservice:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_6f0434b67007b555dfd1201f4e0d5254'] = 'Code marque:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_08f785193c96b2a78dec8d76a46648d6'] = 'Clé Webservice:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dae2d7c71f2daaedb00191af25dc28d'] = 'Langage:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_a26329cba9723551cb8654deba32872b'] = 'Coefficient de Poids:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_99244b234ec089eca40ff9e8ec343e87'] = 'grammes = 1'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_61cbc2d26b4157292673c772ddd6c0f7'] = 'Enregistrer les modifications'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_2673bca5ba0a7871770e69c962e6ce38'] = 'Nombre d\'expéditions'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dbe844fb964d5eca2f51be724e43294'] = 'URL des étiquettes'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6aefd5e2191e1210a2f50416812b517'] = 'URL du suivi'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_61e70b58e38fd01daa254f44c4fa264b'] = 'Nombre de Points Relais'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e82faee1422140edd04b2f94c5051500'] = 'Action réussie'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_672facd73d4aee44c116cfd95298db87'] = 'Les informations du compte viennent d\'être mises à jour'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b4ac3d3f15bc0984d0906aff1202e701'] = 'Impossibilité de mettre à jour les infos du compte pour cette boutique'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ea50be3d60be594e10e9e3560cb9159f'] = 'Nouvelle méthode de transport ajoutée'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d0cfdfcfb71029b561f5ebdc176d87ca'] = 'Le statu de la commande à été mise à jour'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_7534411af2e35bed1f79df5938f077f9'] = 'Le transporteur a été supprimé (désactivé dans la base de données de PrestaShop)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2673bca5ba0a7871770e69c962e6ce38'] = 'Numéro d\'expédition'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dbe844fb964d5eca2f51be724e43294'] = 'URL de l\'étiquette'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6aefd5e2191e1210a2f50416812b517'] = 'URL de suivi'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_61e70b58e38fd01daa254f44c4fa264b'] = 'Numéro du Point Relais® :'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_aa625fced6f01ae595b6a9ac499c2ecf'] = 'La tranche de poids ne peut être ajouté'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_63d15383121b5bb5c53323f3f96bd1f2'] = 'La tranche de prix ne peux être ajouté'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d4d197dd028e28ae56208971b564921a'] = 'La zone par défaut ne peut être ajouté'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_760ac6deb1c5b84321f65ba0c7f319f5'] = 'La zone du transporteur ou les données de livraison ne peuvent être ajouté'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8bf569ff65b32464e623ca9e9a10688d'] = 'Le transporteur ne peut être créé'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6ed26bdf3f9141ddca4ede91f943e567'] = 'Le mode de transporteur ne peut être ajouté pour le module'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_af135815ccf731bcbffb522004762b57'] = 'Le transporteur ne peut être supprimé'; $_MODULE['<{mondialrelay}prestashop>mondialrelay_bba366864d25056c941b72f18ef79e7c'] = 'Cette erreur n\'est pas mentionnée:'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_e0626222614bdee31951d84c64e5e9ff'] = 'Choisir'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_91b442d385b54e1418d81adc34871053'] = 'Sélectionné'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_ef2a1f426c2c289ed5986c7636a5d696'] = 'Merci de choisir un point relay'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_80a0c205cd57b22fca7f174253870300'] = 'Heures d\'ouvertures'; -$_MODULE['<{mondialrelay}prestashop>mondialrelay_2b56b60f878922093facd42284848a0c'] = 'Plus de détails'; -$_MODULE['<{mondialrelay}prestashop>orderdetail_81b7b4587a2a3ea7a0d6bb1df3fbba54'] = 'Livraison à'; -$_MODULE['<{mondialrelay}prestashop>orderdetail_c2d05abc7f5ebdc72b6656df35038b43'] = 'Suivre mon colis sur le site de Mondial Relay'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_a1c3470a944b9625cfb924fd15c8bdbf'] = 'Veuillez choisir au moins une commande'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_dc41aac14af17f1d19fca5e3b9439e74'] = 'Cette clé'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_306b346c19017609403424203ea3d720'] = 'est vide et doit être renseignée'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Il semble que la requête ne soit pas valide'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_c9b4de92f371ae545ad6f051c07d58ca'] = 'Erreur numéro :'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_ea5f761be4e4888eabf4e1501d7817d1'] = 'Détails :'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_eabb11bf9623f08409a0a4c9d035a336'] = 'Numéro d\'expédition :'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_b92c3d3319314513c547675924ceecd1'] = 'URL du Ticket :'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_66b793b6b4125e300717e8cf7449f533'] = 'Url de Tracking :'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_2653c23b8c0daac59571e4be5e8fa7d0'] = 'Le webservice Mondial Relay est actuellement innaccessible.'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_952a812236cabbd70b949ecb43f89c82'] = 'Le webservice Mondial Relay semble être déconnecté'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_26b6b6eaec970108c5e84286159fbf48'] = 'Merci de vérifier la configuration de votre langue'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_557595c2e17c9948a9448eb763ac1a88'] = 'Merci de vérifier la configuration de votre nom de boutique'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_017ca6b770ad53669a4eec82894dfcd3'] = 'Merci de vérifier la configuration de votre adresse 1'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_3f79e1fc66b4f9cca7bd68cab176020d'] = 'Merci de vérifier la configuration de votre ville'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_404665d9b65239985d59b30b3dcb26b5'] = 'Merci de vérifier la configuration de votre code postal'; -$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_74cb73eddbe6eaf556023f943fc7e1fd'] = 'Il semble que le format du code postal ne soit pas configuré ou que vous n\'avez pas défini de code postal valide'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_0b8a30478b9572b86718989d483fd88d'] = 'Merci de vérifier la configuration de votre pays'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_7ddf2d94bf037b7d1088c0600ea589c3'] = 'Merci de vérifier la configuration de votre téléphone'; $_MODULE['<{mondialrelay}prestashop>mrcreatetickets_9c7ce7be9a2c593b24d448edb4f804e0'] = 'Merci de vérifier la configuration de votre email'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_85e6a18230d49abf8cfe912809185258'] = 'La validation du code postal ne peux être effectué sur une version de PrestaShop inférieur à la 1.4'; +$_MODULE['<{mondialrelay}prestashop>mrdownloadpdf_dc41aac14af17f1d19fca5e3b9439e74'] = 'Cette clé'; +$_MODULE['<{mondialrelay}prestashop>mrdownloadpdf_135a7b9a62531e066a95093d8951b344'] = 'n\'est pas dans un format valide'; +$_MODULE['<{mondialrelay}prestashop>mrdownloadpdf_c9b4de92f371ae545ad6f051c07d58ca'] = 'Erreur numéro : '; +$_MODULE['<{mondialrelay}prestashop>mrdownloadpdf_ea5f761be4e4888eabf4e1501d7817d1'] = 'Détails : '; +$_MODULE['<{mondialrelay}prestashop>mrdownloadpdf_2653c23b8c0daac59571e4be5e8fa7d0'] = 'Le service Mondial Relay est actuellement indisponible'; $_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_14288d48d107056c1acf8aaae1bf282b'] = 'L\'adresse du client ne peut etre trouvé'; $_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_dc41aac14af17f1d19fca5e3b9439e74'] = 'Cette clé'; $_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_135a7b9a62531e066a95093d8951b344'] = 'n\'a pas un format valide'; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Il semblerai que la requete n\'est pas valide'; $_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_c9b4de92f371ae545ad6f051c07d58ca'] = 'Il y a une erreur numéro'; $_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_ea5f761be4e4888eabf4e1501d7817d1'] = 'Détail :'; -$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_4e274658c9e97c2a336dde79dd0a7772'] = 'MondialRelay ne peux trouver aucun point relais proche de votre adresse. Peut etre que votre adresse n\'est pas correctement rempli ?'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_4e274658c9e97c2a336dde79dd0a7772'] = 'MondialRelay ne peux trouver aucun Point Relais® proche de votre adresse. Peut etre que votre adresse n\'est pas correctement rempli ?'; $_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_2653c23b8c0daac59571e4be5e8fa7d0'] = 'Le webservice MondialRelay n\'est pas joignable'; $_MODULE['<{mondialrelay}prestashop>mrgettickets_dc41aac14af17f1d19fca5e3b9439e74'] = 'Cette clé'; $_MODULE['<{mondialrelay}prestashop>mrgettickets_135a7b9a62531e066a95093d8951b344'] = 'n\'a pas un format valide'; -$_MODULE['<{mondialrelay}prestashop>mrgettickets_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Il semble que la requête soit invalide :'; $_MODULE['<{mondialrelay}prestashop>mrgettickets_c9b4de92f371ae545ad6f051c07d58ca'] = 'Erreur numéro :'; $_MODULE['<{mondialrelay}prestashop>mrgettickets_ea5f761be4e4888eabf4e1501d7817d1'] = 'Détails :'; $_MODULE['<{mondialrelay}prestashop>mrgettickets_2653c23b8c0daac59571e4be5e8fa7d0'] = 'Le webservice Mondial Relay est actuellement innaccessible.'; $_MODULE['<{mondialrelay}prestashop>mrmanagement_38b4abe2f5860f034e315f2da648a3d6'] = 'Désintaller MondialRelay'; -$_MODULE['<{mondialrelay}prestashop>mrmanagement_77bad09c976ec16f38381dc220139367'] = 'Vous allez désintaller le module : voulez vous aussi effacer les paramètres relatifs à Mondial Relay?'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_a4691c957e81a6f0b6f0ed44f8f2dfe8'] = 'Vous allez désintaller le module : voulez vous aussi effacer les paramètres relatifs à Mondial Relay?'; $_MODULE['<{mondialrelay}prestashop>mrmanagement_09c081633d484a62a2f6940c12a0de36'] = 'Garder et désintaller'; $_MODULE['<{mondialrelay}prestashop>mrmanagement_0b7f47fce1d82d53244771c64b1535c0'] = 'Supprimer et désinstaller'; $_MODULE['<{mondialrelay}prestashop>mrmanagement_ea4788705e6873b424c65e91c2846b19'] = 'Annuler'; @@ -161,7 +83,6 @@ $_MODULE['<{mondialrelay}prestashop>mrmanagement_11744bfebb33e52be37a66a530b7045 $_MODULE['<{mondialrelay}prestashop>mrrelaydetail_14288d48d107056c1acf8aaae1bf282b'] = 'L\'adresse du client ne peut être trouvé'; $_MODULE['<{mondialrelay}prestashop>mrrelaydetail_dc41aac14af17f1d19fca5e3b9439e74'] = 'Cette clé'; $_MODULE['<{mondialrelay}prestashop>mrrelaydetail_306b346c19017609403424203ea3d720'] = 'est vide et doit être renseignée'; -$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Il semble que la requête ne soit pas valide'; $_MODULE['<{mondialrelay}prestashop>mrrelaydetail_c9b4de92f371ae545ad6f051c07d58ca'] = 'Erreur numéro :'; $_MODULE['<{mondialrelay}prestashop>mrrelaydetail_ea5f761be4e4888eabf4e1501d7817d1'] = 'Détails :'; $_MODULE['<{mondialrelay}prestashop>mrrelaydetail_6f8522e0610541f1ef215a22ffa66ff6'] = 'Lundi'; @@ -172,3 +93,142 @@ $_MODULE['<{mondialrelay}prestashop>mrrelaydetail_c33b138a163847cdb6caeeb7c9a126 $_MODULE['<{mondialrelay}prestashop>mrrelaydetail_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Samedi'; $_MODULE['<{mondialrelay}prestashop>mrrelaydetail_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Dimanche'; $_MODULE['<{mondialrelay}prestashop>mrrelaydetail_2653c23b8c0daac59571e4be5e8fa7d0'] = 'Le webservice Mondial Relay est actuellement innaccessible.'; +$_MODULE['<{mondialrelay}prestashop>install-1.8.0_315a8895cf7c458597be5cf3c5b18d0b'] = 'Impossibilité de créer la table \'method shop\''; +$_MODULE['<{mondialrelay}prestashop>install-1.8.0_e364c3962f360330a5d8084c3ef5cacf'] = 'Imossibilité de changer le nom de la table \'method\''; +$_MODULE['<{mondialrelay}prestashop>install-1.8.0_6384826d8bae08ec0ca4d1cd386a32c8'] = 'Impossibilité de renommer la table d\'historique'; +$_MODULE['<{mondialrelay}prestashop>install-1.8.0_4c74bd0afa2a8ecb894674c9cd942da5'] = 'Impossibilité de mettre à jour la table \'method shop\''; +$_MODULE['<{mondialrelay}prestashop>install-1.8.3_665cc27f3a529d80315dd49378a6c2bf'] = 'Impossibilité de créer de nouveaux champs dans la table \'method\''; +$_MODULE['<{mondialrelay}prestashop>configuration_0f27e5e9020f28e3f31b78376e11d4c7'] = 'Configuration de Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>configuration_8bc212f48680748479bbd322d4d73d3f'] = 'Détails du compte'; +$_MODULE['<{mondialrelay}prestashop>configuration_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Transporteur'; +$_MODULE['<{mondialrelay}prestashop>configuration_fe4c6a5e7bd6793b37370e4e46daf998'] = 'Paramètres avancés'; +$_MODULE['<{mondialrelay}prestashop>configuration_326e057f57e830834c20d668e44627ef'] = 'Infos'; +$_MODULE['<{mondialrelay}prestashop>configuration_02d4482d332e1aef3437cd61c9bcc624'] = 'Contactez nous'; +$_MODULE['<{mondialrelay}prestashop>configuration_29141d2b5a484e8032ef64339733f0dc'] = 'Merci de configurer le détail votre compte'; +$_MODULE['<{mondialrelay}prestashop>configuration_ed4dac9dada37651967d305576326e07'] = 'Le service clientèle de Mondial Relay est disponible pour vous aider et répondre à vos questions. Contactez-nous par : '; +$_MODULE['<{mondialrelay}prestashop>configuration_2f8531293ddfd4f30bb978e93d49f650'] = 'Mail : '; +$_MODULE['<{mondialrelay}prestashop>configuration_d0398e90769ea6ed2823a3857bcc19ea'] = 'Téléphone : '; +$_MODULE['<{mondialrelay}prestashop>configuration_c276d381dccea7ac2d2e5060d52356c5'] = '09.69.322.332 (appel non surtaxé)'; +$_MODULE['<{mondialrelay}prestashop>configuration_5b303c899b89c35d9d3e3d7f6ff4e8ed'] = 'Pour plus d\'information, veuillez vous rendre sur notre site à la section FAQ :'; +$_MODULE['<{mondialrelay}prestashop>configuration_5a2355a42ba3ab265701183c914467f2'] = 'Essayez de désactiver le cache et de forcer la compilation smarty'; +$_MODULE['<{mondialrelay}prestashop>configuration_3de769f9a81eed916583d5b35c58dbdd'] = 'si vous rencontrez le moindre problème après une mise à jour du module'; +$_MODULE['<{mondialrelay}prestashop>configuration_8f8b21bd013b38d1e3059557c22a57e7'] = 'Consulter le manuel pour vous guider dans la configuration de Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>configuration_d21a9f93917604d5490ad529a7cf1ff9'] = 'Pour créer un transporteur Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>configuration_c6a2e6af5fff47adb3afd780b97d9b4b'] = 'Remplissez et sauvegardez vos paramètres Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>configuration_4695eb112007792d94d42c8a3755169f'] = 'Ajoutez une méthode de transport depuis l’icône '; +$_MODULE['<{mondialrelay}prestashop>configuration_0dbbe632f1eaf7b912714a1aab4578c9'] = 'Transporteur'; +$_MODULE['<{mondialrelay}prestashop>configuration_b962d8fb95f5a439f50502152f3bad71'] = 'Définissez un prix pour votre transporteur sur'; +$_MODULE['<{mondialrelay}prestashop>configuration_faf1247ae6846a9955a466d4f301bbe4'] = 'La page Transporteurs'; +$_MODULE['<{mondialrelay}prestashop>configuration_10d78806b84b97ebc774e9f6277af6ac'] = 'Pour générer vos étiquettes, vous devez avoir enregistré une adresse valide de votre boutique sur votre'; +$_MODULE['<{mondialrelay}prestashop>configuration_af5efea250326c1c34d69aa9364b482c'] = 'page contact'; +$_MODULE['<{mondialrelay}prestashop>configuration_1ba3935c9858ffb8e19a35ca640b8505'] = 'Détails du compte Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>configuration_a125105400f6e4ee4574da3793af5ef2'] = 'Ces paramètres vous sont donnés par Mondial Relay une fois inscrit à leurs services'; +$_MODULE['<{mondialrelay}prestashop>configuration_12a3fbd35c1cab4b1101b91d708efd15'] = 'Enseigne Webservice :'; +$_MODULE['<{mondialrelay}prestashop>configuration_6f0434b67007b555dfd1201f4e0d5254'] = 'Code Marque :'; +$_MODULE['<{mondialrelay}prestashop>configuration_08f785193c96b2a78dec8d76a46648d6'] = 'Clé Webservice :'; +$_MODULE['<{mondialrelay}prestashop>configuration_0dae2d7c71f2daaedb00191af25dc28d'] = 'Langue des étiquettes'; +$_MODULE['<{mondialrelay}prestashop>configuration_a26329cba9723551cb8654deba32872b'] = 'Coefficient de Poids :'; +$_MODULE['<{mondialrelay}prestashop>configuration_99244b234ec089eca40ff9e8ec343e87'] = 'grammes = 1kg'; +$_MODULE['<{mondialrelay}prestashop>configuration_61cbc2d26b4157292673c772ddd6c0f7'] = 'Mettre à jour le compte'; +$_MODULE['<{mondialrelay}prestashop>configuration_c7ad75acafd2cdc04bc168e30e9314fd'] = 'Vérifier la connexion'; +$_MODULE['<{mondialrelay}prestashop>configuration_70397c4b252a5168c5ec003931cea215'] = 'Champs requis'; +$_MODULE['<{mondialrelay}prestashop>configuration_9ffc3ccc968a96d902af963c6d7b4e97'] = 'Paramètres avancés'; +$_MODULE['<{mondialrelay}prestashop>configuration_1ee1c44c2dc81681f961235604247b81'] = 'Mode :'; +$_MODULE['<{mondialrelay}prestashop>configuration_6ed562a0d4381eef12d92c87520f3208'] = 'Widget'; +$_MODULE['<{mondialrelay}prestashop>configuration_960b44c579bc2f6818d2daaf9e4c16f0'] = 'Normal'; +$_MODULE['<{mondialrelay}prestashop>configuration_fcf5b2122da1d5a5f5c7253b96a3f9d9'] = 'URL de la tache CRON'; +$_MODULE['<{mondialrelay}prestashop>configuration_6f9c467e60d98ac0bfa290ab83566ec0'] = 'Mise à jour de la configuration avancée'; +$_MODULE['<{mondialrelay}prestashop>configuration_66661dacf33146201b60dc16520ddd68'] = 'Ajouter une méthode de transport'; +$_MODULE['<{mondialrelay}prestashop>configuration_531e144cc23ef08408b81cb4d9c641dc'] = 'Nom du transporteur'; +$_MODULE['<{mondialrelay}prestashop>configuration_8f497c1a3d15af9e0c215019f26b887d'] = 'Délais '; +$_MODULE['<{mondialrelay}prestashop>configuration_201bdb87f8e278b943d07ae924d5de6e'] = 'Mode de livraison'; +$_MODULE['<{mondialrelay}prestashop>configuration_142ef02888af88b8b772335277d1c0c8'] = 'Livraison dans un Point Relais®'; +$_MODULE['<{mondialrelay}prestashop>configuration_eeab8b7cf3c7a558a0e8a4050fa994ca'] = 'Livraison Colis Drive'; +$_MODULE['<{mondialrelay}prestashop>configuration_8f7794b107749728c3333ef38d2687e8'] = 'Livraison à domicile RDC (1 personne)'; +$_MODULE['<{mondialrelay}prestashop>configuration_e451efc8ce05b96b214b4c2935f2c657'] = 'Livraison à domicile spécialisée (2 personnes)'; +$_MODULE['<{mondialrelay}prestashop>configuration_09a00f755c3b3d63bf62e14172c1e9a1'] = 'Livraison à domicile spécialisée'; +$_MODULE['<{mondialrelay}prestashop>configuration_eaff1bdf24fcffe0e14e29a1bff51a12'] = 'Assurance'; +$_MODULE['<{mondialrelay}prestashop>configuration_96ba408f20bc3e065f400c650d32fd1a'] = 'Sans assurance'; +$_MODULE['<{mondialrelay}prestashop>configuration_e5a8fafb1dfb538c172e1e014e86b871'] = 'Assurance complémentaire N1'; +$_MODULE['<{mondialrelay}prestashop>configuration_b02f8d6d4b6217cca317161c87f64065'] = 'Assurance complémentaire N2'; +$_MODULE['<{mondialrelay}prestashop>configuration_90b95ae88150c6a34c4129dc4f1ebbd5'] = 'Assurance complémentaire N3'; +$_MODULE['<{mondialrelay}prestashop>configuration_c15b40b8c535191f6f0b6f9beaced3cf'] = 'Assurance complémentaire N4'; +$_MODULE['<{mondialrelay}prestashop>configuration_b67a442fff3ca0a03ea253b0668f946d'] = 'Assurance complémentaire N5'; +$_MODULE['<{mondialrelay}prestashop>configuration_33cbd0d8b6476501f55a8320481ec0f1'] = 'Pays de livraison :'; +$_MODULE['<{mondialrelay}prestashop>configuration_aef71ba4fd060dea2e2c76d1b5076caf'] = 'Vous pouvez choisir plusieurs pays en appuyant sur Ctrl tout en sélectionnant les pays'; +$_MODULE['<{mondialrelay}prestashop>configuration_0309a6c666a7a803fdb9db95de71cf01'] = 'France'; +$_MODULE['<{mondialrelay}prestashop>configuration_6c1674d14bf5f95742f572cddb0641a7'] = 'Belgique'; +$_MODULE['<{mondialrelay}prestashop>configuration_06630c890abadde9228ea818ce52b621'] = 'Luxembourg'; +$_MODULE['<{mondialrelay}prestashop>configuration_907eba32d950bfab68227fd7ea22999b'] = 'Espagne'; +$_MODULE['<{mondialrelay}prestashop>configuration_d8b00929dec65d422303256336ada04f'] = 'Allemagne'; +$_MODULE['<{mondialrelay}prestashop>configuration_9891739094756d2605946c867b32ad28'] = 'Autriche'; +$_MODULE['<{mondialrelay}prestashop>configuration_89f9c9f489be2a83cf57e53b9197d288'] = 'Angleterre'; +$_MODULE['<{mondialrelay}prestashop>configuration_1007e1b7f894dfbf72a0eaa80f3bc57e'] = 'Italie'; +$_MODULE['<{mondialrelay}prestashop>configuration_ea71b362e3ea9969db085abfccdeb10d'] = 'Portugal'; +$_MODULE['<{mondialrelay}prestashop>configuration_0c24ec05a02c710cedd400e3680d8b81'] = 'Liste des transporteurs'; +$_MODULE['<{mondialrelay}prestashop>configuration_14039af96b01e718a9c9d9c1259b6472'] = 'Aucun transporteur créé'; +$_MODULE['<{mondialrelay}prestashop>configuration_59f7eec7440c6687288e747d4a7f40a0'] = 'ID_MR'; +$_MODULE['<{mondialrelay}prestashop>configuration_9cd59510f1c2c821657486bc4c0f7584'] = 'ID transporteur'; +$_MODULE['<{mondialrelay}prestashop>configuration_914419aa32f04011357d3b604a86d7eb'] = 'Transporteur'; +$_MODULE['<{mondialrelay}prestashop>configuration_aa9cd1f8c658c08a9ff87208e3b7ba17'] = 'Pays de livraisons'; +$_MODULE['<{mondialrelay}prestashop>configuration_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer'; +$_MODULE['<{mondialrelay}prestashop>configuration_7dce122004969d56ae2e0245cb754d35'] = 'Modifier'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_8d63728960e021f7632a11922685705e'] = 'Merci de bien vouloir corriger les erreurs suivantes dans'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_264f456c4202f0aba86e481a246a3ef1'] = 'la page de contact'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_7c5fd3d93bd19d81953db3b374997961'] = 'Merci de prendre connaissance des différentes erreurs, il se peut que le ticket n\'ait pas été généré.'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_de21dc13e1ea638777fbfad49f88b332'] = 'Toutes les commandes qui auront un statut'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_378116486b5a90bb50fd4f1557698d96'] = 'seront disponibles pour la création d\'étiquette'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_5dadbd0ec9f0b182be4ead8dad39da79'] = 'Liste des commandes'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_d79cf3f429596f77db95c65074663a54'] = 'Numéro de commande'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_ce26601dac0dea138b7295f02b7620a7'] = 'Client'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_0eede552438475bdfe820c13f24c9399'] = 'Prix total'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_c28e0582276cb6747e37d948e1727929'] = 'Total frais d\'expédition'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_44749712dbec183e983dcd78a7736c41'] = 'Date'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_52150799c57e873360cca13c080a91b4'] = 'Mettez un poids (grammes)'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_353a5729c99abab9b3c8289317b7a0a4'] = 'Choisissez votre assurance'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_6ccc0fdff9995e1a0fce00c99e5b6085'] = 'Numéro MR'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_f9c50cba4de9032d7a6797a2458f8ed9'] = 'Pays MR'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_428c091372d840900cf8536519fa0056'] = 'Numéro d\'expédition'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_a254c25adc7d10d7e9c4889484f875a5'] = 'Détail'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_6d64e1c3efd87dde257ae83da23d7c05'] = 'Sans assurance'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_23d246d67562088260e5629a39826a86'] = 'Assurance complémentaire N1'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_ba98b5ad1ec30ae524c6332dcea740ee'] = 'Assurance complémentaire N2'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_8b461a1d49779e5bb291b08b0bc7e21f'] = 'Assurance complémentaire N3'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_31f29c5d469d45702b0559098359d27f'] = 'Assurance complémentaire N4'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_5c509536a49ceed46f86b9efabde83ae'] = 'Assurance complémentaire N5'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_4351cfebe4b61d8aa5efa1d020710005'] = 'Voir'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_2e01172e31495f41fcebcf3f831cc82c'] = 'Opération réussie'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_37c85a61df6352af7285c307022c4413'] = 'Aucune commande disponible avec ce statut'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_32b919d18cfaca89383f6000dcc9c031'] = 'Générer'; +$_MODULE['<{mondialrelay}prestashop>history_4f1a377c20ace646ddd303ad1e1d243d'] = 'Historique de la création d\'étiquettes'; +$_MODULE['<{mondialrelay}prestashop>history_d79cf3f429596f77db95c65074663a54'] = 'Numéro de commande'; +$_MODULE['<{mondialrelay}prestashop>history_e1a98101d56e29eeea312a0eb2748a92'] = 'Numéro d\'expédition'; +$_MODULE['<{mondialrelay}prestashop>history_aab39f783ba2e72eaad1770f4d9ad0c4'] = 'Imprimer l\'étiquette au format A4'; +$_MODULE['<{mondialrelay}prestashop>history_3eb2bc1ee46258d2a166e89398756b3e'] = 'Imprimer l\'étiquette au format A5'; +$_MODULE['<{mondialrelay}prestashop>history_beb01a974a6a87ef6eeaed92c4970405'] = 'Imprimer l\'étiquette au format 10x15'; +$_MODULE['<{mondialrelay}prestashop>history_9e50665937cbb2f3c833d3626a9f9abb'] = 'Aucun historique disponible'; +$_MODULE['<{mondialrelay}prestashop>history_39a8c1a6d32fd2364eb3567967e4bd96'] = 'Imprimer l\'étiquette sélectionnée au format A4'; +$_MODULE['<{mondialrelay}prestashop>history_3d96962756b2dce870961e4658f8e8b5'] = 'Imprimer l\'étiquette sélectionnée au format A5'; +$_MODULE['<{mondialrelay}prestashop>history_e3743db648a23e969b0be5ef75639834'] = 'Imprimer l\'étiquette sélectionnée au format 10x15'; +$_MODULE['<{mondialrelay}prestashop>history_fa98e6528c9df7f26978c2beb7de3d99'] = 'Supprimer les historiques sélectionnés'; +$_MODULE['<{mondialrelay}prestashop>post_action_466ec9f29b485204ef53818459da48af'] = 'erreur(s)'; +$_MODULE['<{mondialrelay}prestashop>settings_0a4ee7474864081af12dba847fafdaa6'] = 'Configuration du panneau d\'administration'; +$_MODULE['<{mondialrelay}prestashop>settings_d02bbc3cb147c272b0445ac5ca7d1a36'] = 'Etat des commandes'; +$_MODULE['<{mondialrelay}prestashop>settings_ca57625685f058f54d82c6e05876a131'] = 'Choississez le statut pour la génération d\'étiquette.'; +$_MODULE['<{mondialrelay}prestashop>settings_c9cc8cce247e49bae79f15173ce97354'] = 'Sauvegarder'; +$_MODULE['<{mondialrelay}prestashop>settings_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{mondialrelay}prestashop>checkout_process_836f6c949a2f2d61489bf410def82111'] = 'Mondialrelay ne peut récupérer les points relais du à une erreur de Prestashop'; +$_MODULE['<{mondialrelay}prestashop>checkout_process_widget_ad3d06d03d94223fa652babc913de686'] = 'Valider votre Point Relais®'; +$_MODULE['<{mondialrelay}prestashop>checkout_process_widget_b5cdf9b63fda35c33bb5e35cc3716b95'] = 'Point Relais® sélectionné :'; +$_MODULE['<{mondialrelay}prestashop>header_e0626222614bdee31951d84c64e5e9ff'] = 'Choisir'; +$_MODULE['<{mondialrelay}prestashop>header_91b442d385b54e1418d81adc34871053'] = 'Sélectionné'; +$_MODULE['<{mondialrelay}prestashop>header_ef2a1f426c2c289ed5986c7636a5d696'] = 'Merci de choisir un Point Relais®'; +$_MODULE['<{mondialrelay}prestashop>header_80a0c205cd57b22fca7f174253870300'] = 'Heure d\'ouvertude'; +$_MODULE['<{mondialrelay}prestashop>header_2b56b60f878922093facd42284848a0c'] = 'Plus de détails'; +$_MODULE['<{mondialrelay}prestashop>header_widget_e0626222614bdee31951d84c64e5e9ff'] = 'Choisir'; +$_MODULE['<{mondialrelay}prestashop>header_widget_91b442d385b54e1418d81adc34871053'] = 'Sélectionné'; +$_MODULE['<{mondialrelay}prestashop>header_widget_ef2a1f426c2c289ed5986c7636a5d696'] = 'Merci de choisir un Point Relais®'; +$_MODULE['<{mondialrelay}prestashop>header_widget_80a0c205cd57b22fca7f174253870300'] = 'Heure d\'ouvertude'; +$_MODULE['<{mondialrelay}prestashop>header_widget_2b56b60f878922093facd42284848a0c'] = 'Plus de détails'; +$_MODULE['<{mondialrelay}prestashop>order_detail_a68825a6533d5eceea97b4426c7ceede'] = 'Votre Point Relais®'; +$_MODULE['<{mondialrelay}prestashop>order_detail_c2d05abc7f5ebdc72b6656df35038b43'] = 'Suivre mon colis sur le site de Mondial Relay'; diff --git a/modules/mondialrelay/AdminMondialRelay.gif b/modules/mondialrelay/img/AdminMondialRelay.gif similarity index 100% rename from modules/mondialrelay/AdminMondialRelay.gif rename to modules/mondialrelay/img/AdminMondialRelay.gif diff --git a/modules/mondialrelay/img/details.gif b/modules/mondialrelay/img/details.gif new file mode 100755 index 00000000..95eaaa9a Binary files /dev/null and b/modules/mondialrelay/img/details.gif differ diff --git a/modules/mondialrelay/img/error2.png b/modules/mondialrelay/img/error2.png new file mode 100755 index 00000000..5d52e2f1 Binary files /dev/null and b/modules/mondialrelay/img/error2.png differ diff --git a/modules/mondialrelay/images/getTickets.gif b/modules/mondialrelay/img/getTickets.gif similarity index 100% rename from modules/mondialrelay/images/getTickets.gif rename to modules/mondialrelay/img/getTickets.gif diff --git a/modules/mondialrelay/images/help.png b/modules/mondialrelay/img/help.png similarity index 100% rename from modules/mondialrelay/images/help.png rename to modules/mondialrelay/img/help.png diff --git a/modules/mondialrelay/img/icones/account_detail.png b/modules/mondialrelay/img/icones/account_detail.png new file mode 100755 index 00000000..f939bbdc Binary files /dev/null and b/modules/mondialrelay/img/icones/account_detail.png differ diff --git a/modules/mondialrelay/img/icones/help.png b/modules/mondialrelay/img/icones/help.png new file mode 100755 index 00000000..700e0634 Binary files /dev/null and b/modules/mondialrelay/img/icones/help.png differ diff --git a/modules/mondialrelay/img/icones/index.php b/modules/mondialrelay/img/icones/index.php new file mode 100755 index 00000000..4deda527 --- /dev/null +++ b/modules/mondialrelay/img/icones/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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; \ No newline at end of file diff --git a/modules/mondialrelay/img/icones/info.png b/modules/mondialrelay/img/icones/info.png new file mode 100755 index 00000000..ea00799b Binary files /dev/null and b/modules/mondialrelay/img/icones/info.png differ diff --git a/modules/mondialrelay/img/icones/settings.png b/modules/mondialrelay/img/icones/settings.png new file mode 100755 index 00000000..81160c93 Binary files /dev/null and b/modules/mondialrelay/img/icones/settings.png differ diff --git a/modules/mondialrelay/img/icones/supplier.png b/modules/mondialrelay/img/icones/supplier.png new file mode 100755 index 00000000..8f2f4d1c Binary files /dev/null and b/modules/mondialrelay/img/icones/supplier.png differ diff --git a/modules/mondialrelay/img/index.php b/modules/mondialrelay/img/index.php new file mode 100755 index 00000000..0bfbc8e9 --- /dev/null +++ b/modules/mondialrelay/img/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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; \ No newline at end of file diff --git a/modules/mondialrelay/images/loader.gif b/modules/mondialrelay/img/loader.gif similarity index 100% rename from modules/mondialrelay/images/loader.gif rename to modules/mondialrelay/img/loader.gif diff --git a/modules/mondialrelay/images/logo.gif b/modules/mondialrelay/img/logo.gif similarity index 100% rename from modules/mondialrelay/images/logo.gif rename to modules/mondialrelay/img/logo.gif diff --git a/modules/mondialrelay/logo_hd.png b/modules/mondialrelay/img/logo_hd.png similarity index 100% rename from modules/mondialrelay/logo_hd.png rename to modules/mondialrelay/img/logo_hd.png diff --git a/modules/mondialrelay/images/pdf_icon.jpg b/modules/mondialrelay/img/pdf_icon.jpg similarity index 100% rename from modules/mondialrelay/images/pdf_icon.jpg rename to modules/mondialrelay/img/pdf_icon.jpg diff --git a/modules/mondialrelay/images/selectRelayPoint.png b/modules/mondialrelay/img/selectRelayPoint.png similarity index 100% rename from modules/mondialrelay/images/selectRelayPoint.png rename to modules/mondialrelay/img/selectRelayPoint.png diff --git a/modules/mondialrelay/index.php b/modules/mondialrelay/index.php index b559f985..0bfbc8e9 100755 --- a/modules/mondialrelay/index.php +++ b/modules/mondialrelay/index.php @@ -1,13 +1,13 @@ -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 7233 $ -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ - + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); diff --git a/modules/mondialrelay/js/gmap.js b/modules/mondialrelay/js/gmap.js index e1a8d53e..4ffe85b4 100755 --- a/modules/mondialrelay/js/gmap.js +++ b/modules/mondialrelay/js/gmap.js @@ -2219,4 +2219,4 @@ return this; } -}(jQuery)); +})(jQuery); diff --git a/modules/mondialrelay/js/index.php b/modules/mondialrelay/js/index.php new file mode 100755 index 00000000..fc4110ff --- /dev/null +++ b/modules/mondialrelay/js/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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; \ No newline at end of file diff --git a/modules/mondialrelay/js/jquery-1.6.4.min.js b/modules/mondialrelay/js/jquery-1.6.4.min.js index 3684c36b..e5c7d431 100755 --- a/modules/mondialrelay/js/jquery-1.6.4.min.js +++ b/modules/mondialrelay/js/jquery-1.6.4.min.js @@ -1,4 +1,6 @@ -/*! jQuery v1.6.4 http://jquery.com/ | http://jquery.org/license */ +/** +* ! jQuery v1.6.4 http://jquery.com/ | http://jquery.org/license +*/ (function(a,b){function cu(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cr(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cq(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cp(){cn=b}function co(){setTimeout(cp,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bv(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bl(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bd,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bk(a){f.nodeName(a,"input")?bj(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bj)}function bj(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bi(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bh(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bg(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function U(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function M(a,b){return(a&&a!=="*"?a+".":"")+b.replace(y,"`").replace(z,"&")}function L(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function J(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function D(){return!0}function C(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(K,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.4",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;B.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-1000px",top:"-1000px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="

",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i=f.expando,j=typeof c=="string",k=a.nodeType,l=k?f.cache:a,m=k?a[f.expando]:a[f.expando]&&f.expando;if((!m||e&&m&&l[m]&&!l[m][i])&&j&&d===b)return;m||(k?a[f.expando]=m=++f.uuid:m=f.expando),l[m]||(l[m]={},k||(l[m].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?l[m][i]=f.extend(l[m][i],c):l[m]=f.extend(l[m],c);g=l[m],e&&(g[i]||(g[i]={}),g=g[i]),d!==b&&(g[f.camelCase(c)]=d);if(c==="events"&&!g[c])return g[i]&&g[i].events;j?(h=g[c],h==null&&(h=g[f.camelCase(c)])):h=g;return h}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e=f.expando,g=a.nodeType,h=g?f.cache:a,i=g?a[f.expando]:f.expando;if(!h[i])return;if(b){d=c?h[i][e]:h[i];if(d){d[b]||(b=f.camelCase(b)),delete d[b];if(!l(d))return}}if(c){delete h[i][e];if(!l(h[i]))return}var j=h[i][e];f.support.deleteExpando||!h.setInterval?delete h[i]:h[i]=null,j?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=j):g&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=v:u&&(i=u)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.attr(a,b,""),a.removeAttribute(b),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(u&&f.nodeName(a,"button"))return u.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(u&&f.nodeName(a,"button"))return u.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==null?g:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabIndex=f.propHooks.tabIndex,v={get:function(a,c){var d;return f.prop(a,c)===!0||(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(u=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var w=/\.(.*)$/,x=/^(?:textarea|input|select)$/i,y=/\./g,z=/ /g,A=/[^\w\s.|`]/g,B=function(a){return a.replace(A,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=C;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=C);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),B).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},I=function(c){var d=c.target,e,g;if(!!x.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=H(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:I,beforedeactivate:I,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&I.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&I.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",H(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in G)f.event.add(this,c+".specialChange",G[c]);return x.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return x.test(this.nodeName)}},G=f.event.special.change.filters,G.focus=G.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=S.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(U(c[0])||U(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=R.call(arguments);N.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!T[a]?f.unique(e):e,(this.length>1||P.test(d))&&O.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};be.optgroup=be.option,be.tbody=be.tfoot=be.colgroup=be.caption=be.thead,be.th=be.td,f.support.htmlSerialize||(be._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!be[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bh(a,d),e=bi(a),g=bi(d);for(h=0;e[h];++h)g[h]&&bh(e[h],g[h])}if(b){bg(a,d);if(c){e=bi(a),g=bi(d);for(h=0;e[h];++h)bg(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=be[l]||be._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bn.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bm,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bm.test(g)?g.replace(bm,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bv(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bw=function(a,c){var d,e,g;c=c.replace(bo,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bx=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bp.test(d)&&bq.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bv=bw||bx,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bz=/%20/g,bA=/\[\]$/,bB=/\r?\n/g,bC=/#.*$/,bD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bE=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bF=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bG=/^(?:GET|HEAD)$/,bH=/^\/\//,bI=/\?/,bJ=/)<[^<]*)*<\/script>/gi,bK=/^(?:select|textarea)/i,bL=/\s+/,bM=/([?&])_=[^&]*/,bN=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bO=f.fn.load,bP={},bQ={},bR,bS,bT=["*/"]+["*"];try{bR=e.href}catch(bU){bR=c.createElement("a"),bR.href="",bR=bR.href}bS=bN.exec(bR.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bO)return bO.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bJ,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bK.test(this.nodeName)||bE.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bB,"\r\n")}}):{name:b.name,value:c.replace(bB,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?bX(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),bX(a,b);return a},ajaxSettings:{url:bR,isLocal:bF.test(bS[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bT},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bV(bP),ajaxTransport:bV(bQ),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?bZ(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=b$(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bD.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bC,"").replace(bH,bS[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bL),d.crossDomain==null&&(r=bN.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bS[1]&&r[2]==bS[2]&&(r[3]||(r[1]==="http:"?80:443))==(bS[3]||(bS[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bW(bP,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bG.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bI.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bM,"$1_="+x);d.url=y+(y===d.url?(bI.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bT+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bW(bQ,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bz,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cq("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=ct.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!ct.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cu(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cu(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNaN(j)?i:j}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/modules/mondialrelay/js/jquery.plugin.mondialrelay.parcelshoppicker.2.0.0.js b/modules/mondialrelay/js/jquery.plugin.mondialrelay.parcelshoppicker.2.0.0.js new file mode 100755 index 00000000..0bd78a81 --- /dev/null +++ b/modules/mondialrelay/js/jquery.plugin.mondialrelay.parcelshoppicker.2.0.0.js @@ -0,0 +1,546 @@ +/** +* 2007-2014 Mondial relay +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to Mondial relay so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade Mondial relay to newer +* versions in the future. If you wish to customize Mondial relay for your +* needs please refer to Mondial relay for more information. +* +* @author Mondial relay +* @copyright 2007-2014 Mondial relay +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of Mondial relay +*/ +var Widgets = Widgets || function () { + + var private = { + ashx: 'service.ashx', + svc: 'services/parcelshop-picker.v2.0.0.svc', + w_name: 'parcelshop-picker/v2.0.0', + sw_url: '', + img_url: 'www.mondialrelay.fr', + bounds: null, + map: null, + overlays: [], + infowindows: [], + InfoWindow: null, + container: null, + callback: null, + mapLoaded: false, + containerId: null, + params: null, + protocol: '', + + jsonpcall: function (fn, paramArray, callbackFn) { + // Create list of parameters in the form (http get format): + // paramName1 = paramValue1 & paramName2 = paramValue2 & + var paramList = ''; + if (paramArray.length > 0) { + for (var i = 0; i < paramArray.length; i += 2) { + paramList += paramArray[i] + '=' + paramArray[i + 1] + '&'; + } + } + + // ======================================= + // CORRECTION PROFILEO + // ======================================= + $.getJSON(private.protocol + private.sw_url + '/' + fn + '?' + paramList + 'method=?', callbackFn); + }, + + loadhtml: function (container, urlraw, callback) { + var urlselector = (urlraw).split(" ", 1); + var url = urlselector[0]; + var selector = urlraw.substring(urlraw.indexOf(' ') + 1, urlraw.length); + private.container = container; + private.callback = callback; + private.jsonpcall(private.ashx, ['downloadurl', escape(url)], + function (msg) { + // gets the contents of the Html in the 'msg' + // todo: apply selector + private.container.html(msg); + if ($.isFunction(private.callback)) { + private.callback(); + } + }); + }, + + Manage_Response: function (result, container, Target, TargetDisplay, TargetDisplayInfoPR) { + if (result.Error == null) { + container.find(".MRW-Results").slideDown('slow'); + container.find(".MRW-RList").html(result.Value).show(); + if (private.params.ShowResultsOnMap) { + // Ajout des points sur la google map + //if (!private.mapLoaded) { + private.MR_LoadMap(private.params); + private.mapLoaded = true; + //} + + // Supprime le contenu de la carte + private.MR_clearOverlays(); + + // Boucle sur les Points Relais + for (var i = 0; i < result.PRList.length; i++) { + // Ajout d'un marker pour chaque Point Relais + + private.MR_AddGmapMarker( + private.map, + new google.maps.LatLng(result.PRList[i].Lat.replace(',', '.'), result.PRList[i].Long.replace(',', '.')), + result.PRList[i], + i, + private.sw_url, + Target, + TargetDisplay, + TargetDisplayInfoPR + ); + + } + + // Redimentionne la carte + private.map.fitBounds(private.bounds); + + // AutoSelect + if (private.params.AutoSelect) { + private.MR_FocusOnMaker(private.params.AutoSelect); + } + } else { + $('#MRW-Map', private.container).html(""); + for (var i = 0; i < result.PRList.length; i++) { + $('#MRW-Map', private.container).append(private.MR_BuildparcelShopDetails(result.PRList[i])) + + $.data($('#MRW-Map > div:last-child')[0], "ParcelShop", result.PRList[i]) + + + $('#MRW-Map > div:last-child').bind("select", function () { + + private.MR_SelectparcelShop($.data($(this)[0], "ParcelShop")); + }); + + + $('#MRW-Map > div', private.container).hide() + } + } + + + + } else { + container.find(".MRW-Results").hide(); + container.find(".MRW-Errors").html(result.Error).slideDown("slow"); + } + + container.find('.progressBar').hide(); + + // Gestion du hover sur les items + container.find('.PR-List-Item').mouseover(function () { + $(this).addClass("PR-hover"); + }); + container.find('.PR-List-Item').mouseout(function () { + $(this).removeClass("PR-hover"); + }); + + }, + MR_Widget_Call: function (container, Target, TargetDisplay, TargetDisplayInfoPR) { + container.find(".MRW-Errors").hide(); + container.find('.progressBar').show(); + container.find(".MRW-Errors").html(""); + + var a0 = container.find('input.Arg0')[0].value; + var a1 = container.find('input.Arg1')[0].value; + var a2 = container.find('input.Arg2')[0].value; + var a3 = container.find('input.Arg3')[0].value; + var a4 = container.find('input.Arg4')[0].value; + var a5 = container.find('input.Arg5')[0].value; + var a6 = container.find('input.Arg6')[0].value; + var a7 = container.find('input.Arg7')[0].value; + var a8 = private.params.VacationBefore || ''; + var a9 = private.params.VacationAfter || ''; + + private.jsonpcall(private.w_name + "/" + private.svc + "/SearchPR", + ["Brand", a0, "Country", a1, "PostCode", a2, "ColLivMod", a3, "Weight", a4, "NbResults", a5, "SearchDelay", a6, "SearchFar", a7, "ClientContainerId", private.containerId, "VacationBefore", a8, "VacationAfter", a9], + function (result) { + private.Manage_Response(result, container, Target, TargetDisplay, TargetDisplayInfoPR); + }); + }, + MR_LoadMap: function (prms) { + var myOptions = { + zoom: 5, + center: new google.maps.LatLng(46.80000, 1.69000), + mapTypeId: google.maps.MapTypeId.ROADMAP, + panControl: false, // Flèches de direction + rotateControl: true, + scaleControl: true, // Mesure de distance + scrollwheel: prms.MapScrollWheel ? prms.MapScrollWheel : false, // Zoom avec la molette de la souris + streetViewControl: prms.MapStreetView ? prms.MapStreetView : false, // Autorisation de StreetView + zoomControl: true // Zoom + }; + private.map = new google.maps.Map(document.getElementById('MRW-Map'), myOptions); + private.bounds = new google.maps.LatLngBounds(); + private.overlays = []; + private.infowindows = []; + }, + MR_clearOverlays: function () { + for (var n = 0, overlay; overlay = private.overlays[n]; n++) { + overlay.setMap(null); + } + // Clear overlays from collection + private.overlays = []; + private.infowindows = []; + private.bounds = new google.maps.LatLngBounds(); + }, + MR_FocusOnMaker: function (id) { + // Boucle sur les Markers + for (var i = 0; i < private.overlays.length; i++) { + // Test de validité + if (id == private.overlays[i].get("id")) { + private.MR_FocusOnMap(i); + } + } + }, + + MR_AddGmapMarker: function (map, latLng, PRI, Id, sw_url, Target, TargetDisplay, TargetDisplayInfoPR) { + // Get the letter for the marker + var letter = String.fromCharCode("A".charCodeAt(0) + (private.overlays.length)); + + // Create the marker + var marker = new google.maps.Marker({ + position: latLng, + map: map, + icon: new google.maps.MarkerImage(private.protocol + private.sw_url + "/" + private.w_name + "/css/imgs/gmaps_pr02" + letter + ".png") + }); + + // Add clickListener + google.maps.event.addListener(marker, 'click', function () { + // Fermeture de la fenêtre précédente + for(i in private.infowindows) + if(private.infowindows[i] != null) + private.infowindows[i].close(); + + private.InfoWindow = new google.maps.InfoWindow({ + content: private.MR_BuildparcelShopDetails(PRI) + }); + + private.InfoWindow.open(private.map, marker); + + private.infowindows.push(private.InfoWindow); + + private.map.setCenter(marker.getPosition()); + }); + + // Add clickListener + google.maps.event.addListener(marker, 'click', function () { + private.MR_SelectparcelShop(PRI); + }); + + // Add Marker to Overlays collection + private.overlays.push(marker); + + // Redimentionne la carte + private.bounds.extend(latLng); + //map.fitBounds(bounds); + + return marker; + }, + MR_SelectparcelShop: function (PRI) { + $(private.params.Target).val(PRI.Pays + '-' + PRI.ID).trigger('change'); + $(private.params.TargetDisplay).html(PRI.Pays + '-' + PRI.ID); + if (private.params.TargetDisplayInfoPR) { + $(private.params.TargetDisplayInfoPR).html(PRI.Nom + '
' + PRI.Adresse1 + '
' + PRI.Adresse2 + '
' + PRI.Pays + '-' + PRI.CP + ' ' + PRI.Ville + ' '); + } + + $(".PR-Selected").removeClass("PR-Selected"); + $('.PR-Id[Value="' + PRI.Pays + '-' + PRI.ID + '"]').parent().addClass("PR-Selected"); + + if (private.params.OnParcelShopSelected) { + private.params.OnParcelShopSelected(PRI) + } + }, + + MR_BuildparcelShopDetails: function (PRI) { + var content = '
' + + '
' + PRI.Nom + '
' + + '
' + + 'Info' + + 'Photo' + + '
' + + '
' + + '
' + PRI.HoursHtmlTable + '
' + + '
' + + '' + + '
' + + '
' + + '
' + return content; + }, + MR_loadjscssfile: function (filename, filetype) { + var fileref; + if (filetype == "js") { + fileref = document.createElement('script'); + fileref.setAttribute("type", "text/javascript"); + fileref.setAttribute("src", filename); + } + else if (filetype == "css") { + fileref = document.createElement("link"); + fileref.setAttribute("rel", "stylesheet"); + fileref.setAttribute("type", "text/css"); + fileref.setAttribute("href", filename); + } + if (typeof fileref != "undefined") { document.getElementsByTagName("head")[0].appendChild(fileref); } + }, + + MR_pad_left: function (s, c, n) { + if (!s || !c || s.length >= n) { + return s; + } + + var max = (n - s.length) / c.length; + for (var i = 0; i < max; i++) { + s = c + s; + } + + return s; + }, + + + // Initialisation du Widget après chargement du contrôle + MR_Widget_Init: function (container, prms) { + private.params = prms; + // Autocomplete sur le nom de ville + var t = container.find('input.iArg0'); + var autoCpl = $("
"); + autoCpl.addClass("PR-AutoCplCity"); + autoCpl.css("width", t.width()); + + container.find('.MRW-Search').append(autoCpl); + + container.find('input.Arg2').live('keydown', function (e) { + container.find('.PR-AutoCplCity').html("").slideUp("fast"); + }); + + container.find('input.iArg0').live('keydown', function (e) { + var keyCode = e.keyCode || e.which; + + var ia0 = container.find('input.iArg0')[0].value; + var a2 = ""; //container.find('input.Arg2')[0].value; + var a1 = container.find('input.Arg1')[0].value; + + var inp = String.fromCharCode(keyCode); + //déplacement par les touches + //en cas de touche fleche vers le bas + if (keyCode == 40) { + if (container.find('.PR-AutoCplCity .AutoCpl-Hover').length === 0) { + container.find('.PR-AutoCplCity div:first-child').addClass("AutoCpl-Hover"); + } else if (container.find('.AutoCpl-Hover').next().length > 0) { + container.find('.AutoCpl-Hover').removeClass("AutoCpl-Hover").next().addClass("AutoCpl-Hover"); + } + } + //en cas de touche fleche vers le haut + else if (keyCode == 38) { + if (container.find('.PR-AutoCplCity .AutoCpl-Hover').length === 0) { + container.find('.PR-AutoCplCity div:last-child').addClass("AutoCpl-Hover"); + } else if (container.find('.AutoCpl-Hover').prev().length > 0) { + container.find('.AutoCpl-Hover').removeClass("AutoCpl-Hover").prev().addClass("AutoCpl-Hover"); + } + } + //en cas de touche entrée + else if ((keyCode == 13 || keyCode == 9) && container.find('.AutoCpl-Hover').length > 0) { + e.preventDefault(); + container.find('input.Arg2')[0].value = container.find('.AutoCpl-Hover').attr("title"); + container.find('input.iArg0')[0].value = container.find('.AutoCpl-Hover').attr("name"); + container.find('.PR-AutoCplCity').html("").slideUp("fast"); + return; + } + //pour toute autre touche de type caractère + else if (/[a-zA-Z0-9\-_ ]/.test(inp)) { + ia0 = ia0 + inp; + if (ia0.length > 3) { + container.find('.PR-AutoCplCity').css("top", (this.offsetTop + 20) + "px"); + container.find('.PR-AutoCplCity').css("left", (this.offsetLeft) + "px"); + + private.jsonpcall(private.w_name + "/" + private.svc + "/AutoCPLCity", + ["PostCode", a2, "Country", a1, "City", ia0], + function (result) { + container.find('.PR-AutoCplCity').html(""); + + for (var i = 0; i < result.Value.length; i++) { + var elm = $("
"); + elm.attr("title", result.Value[i].PostCode); + elm.attr("name", result.Value[i].Name); + elm.addClass("PR-City"); + + elm.html(result.Value[i].Name + " (" + result.Value[i].PostCode + ")"); + container.find('.PR-AutoCplCity').append(elm); + elm.click(function () { + container.find('input.Arg2')[0].value = $(this).attr("title"); + container.find('input.iArg0')[0].value = $(this).attr("name"); + container.find('.PR-AutoCplCity').html("").slideUp("fast"); + }); + } + container.find('.PR-AutoCplCity').slideDown("fast"); + }); + + } + } + else { + container.find('.PR-AutoCplCity').html("").slideUp("fast"); + } + }); + + container.find('input.iArg0').blur(function (event) { + if (container.find('.AutoCpl-Hover').length) { + container.find('input.Arg2')[0].value = container.find('.AutoCpl-Hover').attr("title"); + container.find('input.iArg0')[0].value = container.find('.AutoCpl-Hover').attr("name"); + } + + }); + + // Fonction au click sur le bouton rechercher + container.find('.MRW-BtGo').click(function () { + var btn = $(this); + private.MR_Widget_Call(container, prms.Target, prms.TargetDisplay, prms.TargetDisplayInfoPR); + return false; + }); + + // Fonction au click sur la selection des pays + container.find('.MRW-flag').click(function () { + var btn = $(this); + container.find('.MRW-fl-Select').slideDown("fast").css("top", (this.offsetTop + this.height + 2) + "px").css("left", this.offsetLeft - 3 + "px"); + }); + + // Fonction au click sur la selection d'un pays + container.find('.MRW-fl-Item').click(function () { + var btn = $(this); + container.find('.MRW-fl-Select').slideUp("fast"); + container.find('.MRW-flag').attr('src', btn.find('img').attr('src')); + container.find('input.Arg1')[0].value = btn.find('img').attr('alt'); + }); + + container.find('input.Arg0')[0].value = prms.Brand; + container.find('input.Arg1')[0].value = prms.Country; + container.find('input.Arg2')[0].value = prms.PostCode; + container.find('input.Arg3')[0].value = prms.ColLivMod; + container.find('input.Arg4')[0].value = prms.Weight; + container.find('input.Arg5')[0].value = prms.NbResults; + container.find('input.Arg6')[0].value = prms.SearchDelay; + container.find('input.Arg7')[0].value = prms.SearchFar; + + if (prms.PostCode != "") { private.MR_Widget_Call(container, prms.Target, prms.TargetDisplay, prms.TargetDisplayInfoPR); } + } + }; + + var pub = { + MR_WidgetJq: function (Div, prms) { + var settings = $.extend({ + CSS: "1", // (Facultatif) Utilisation du CSS par défaut (1 = Oui) + Target: "", // (Obligatoire) L'ID du Point Relais sera retourné dans l'élément d'ID INPUT "RetourWidget" + TargetDisplay: "", // (Facultatif) L'ID du Point Relais sera retourné dans l'élément d'ID HTML "RetourDisplay" + Country: "FR", // (Obligatoire) Pays préselectionné + PostCode: "", // (Facultatif) Code Postal préselectionné + ColLivMod: "24R", // (Facultatif) Mode de collecte ou de livraison prévu + Weight: "", // (Facultatif) Poids du colis en Grammes + NbResults: "10", // (Facultatif) Nombre de résultat maximum affichable + SearchDelay: "", // (Facultatif) Délai prévu avant la remise du colis à Mondial Relay + AllowedCountries: "", // (Facultatif) Distance de recherche maximum + SearchFar: "", // (Facultatif) Distance de recherche maximum + MapScrollWheel: false, // (Facultatif) Maps : Activation de la molette de la souris pour effectuer un Zoom + MapStreetView: false, + ShowResultsOnMap: true, + UseSSL: ssl, + ServiceUrl: 'widget.mondialrelay.com', + OnParcelShopSelected: null + }, prms); + + if (settings.UseSSL) { + private.protocol = 'https://'; + settings.ServiceUrl= 'www.mondialrelay.fr/widget/'; + } else { + private.protocol = 'http://'; + } + + private.sw_url = settings.ServiceUrl; + + if (settings.AllowedCountries == "") { + settings.AllowedCountries = settings.Country; + } + + if (!Div.attr("id")) { Div.attr("id", "MRParcelShopPicker_" + Math.floor((Math.random() * 10000000) + 1)) } + + private.containerId = Div.attr("id") + + if (settings.CSS != "0") { + private.MR_loadjscssfile(private.protocol + private.sw_url + "/" + private.w_name + "/css/style.min.css", "css"); + } + private.container = Div; + private.loadhtml(private.container, private.protocol + private.sw_url + "/" + private.w_name + "/services/widget.v2.0.0.aspx?allowedCountries=" + settings.AllowedCountries + "&Country=" + settings.Country + "&UseSSL=" + settings.UseSSL, + function () { private.MR_Widget_Init(private.container, settings); }); + + return this; + }, + // load widget into 'container' from 'host' + MR_Widget: function (Div, prms) { + return pub.MR_WidgetJq($(Div), prms); + }, + MR_Destroy: function (Div, prms) { + private.container = $(Div); + private.container.find('input.Arg2').unbind('keydown'); + private.container.find('input.iArg0').unbind('keydown'); + private.mapLoaded = false; + }, + MR_FocusOnMap: function (i) { + if (private.params.ShowResultsOnMap) { + google.maps.event.trigger(private.overlays[i], "click"); + } else { + $('#MRW-Map > div', private.container).hide(); + $('#MRW-Map > div:nth-child(' + (i + 1) + ')', private.container).show().trigger('select'); + } + }, + MR_tabselect: function (tab) { + $(".Tabs-Btn-Selected", private.container).removeClass("Tabs-Btn-Selected"); + $('#btn_' + tab, private.container).addClass("Tabs-Btn-Selected"); + $(".Tabs-Tab-Selected", private.container).removeClass("Tabs-Tab-Selected"); + $('#tab_' + tab, private.container).addClass("Tabs-Tab-Selected"); + } + + }; + + return pub; +} (); + + +; (function ($, doc, win) { + "use strict"; + + var name = 'MondialRelay-ParcelShopPicker'; + + $.fn.MR_ParcelShopPicker = function (opts) { + + return this.each(function (i, el) { + var base = el; + base.init = function () { + base.MR = new Widgets.MR_Widget(el, opts); + $("#" + base.id).bind("FocusOnMap", function (evt, id) { + this.MR.MR_FocusOnMap(id) + }); + $("#" + base.id).bind("TabSelect", function (evt, id) { + this.MR.MR_tabselect(id) + }); + + }; + + + + base.init(); + + }); + }; +})(jQuery, document, window); + diff --git a/modules/mondialrelay/js/mondialrelay.js b/modules/mondialrelay/js/mondialrelay.js new file mode 100755 index 00000000..504d0b7f --- /dev/null +++ b/modules/mondialrelay/js/mondialrelay.js @@ -0,0 +1,1361 @@ +/** +* 2007-2014 Mondial relay +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to Mondial relay so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade Mondial relay to newer +* versions in the future. If you wish to customize Mondial relay for your +* needs please refer to Mondial relay for more information. +* +* @author Mondial relay +* @copyright 2007-2014 Mondial relay +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of Mondial relay +*/ +var PS_MRObject = (function($, undefined) { + + var toggle_status_order_list = false; + var toggle_history_order_list = false; + var relay_point_max = 10; + var last_gmap_info_clicked = ''; + +// /!\ All the following list data could be store into the same variable +// But for a better reading of the code, there are separated + +// List of the supplier id which the user trying to fetch the relay + var fetchingRelayPoint = new Array(); + +// List of the relay point object + var relayPointDataContainers = new Array(); + +// List of the google map object + var GmapList = new Object(); + +// List the marker liable to the relay pint + var markerList = new Object(); + + var selected = false; + + /** + * Toggle selected orders + */ + function toggleOrderListSelection() + { + toggle_status_order_list = !toggle_status_order_list; + $('input[name="order_id_list[]"]').attr('checked', toggle_status_order_list); + } + + /** + * Toggle selected histories + */ + function toggleHistoryListSelection() + { + toggle_history_order_list = !toggle_history_order_list; + $('input[name="history_id_list[]"]').attr('checked', toggle_history_order_list); + } + + /** + * Request Ajax call to get tickets + * + * @param detailedExpeditionList + */ + function getTickets(detailedExpeditionList) + { + $.ajax( + { + type : 'POST', + url : _PS_MR_MODULE_DIR_+"ajax.php", + data : {'detailedExpeditionList':detailedExpeditionList, 'method':'MRGetTickets', 'mrtoken':mrtoken}, + dataType: 'json', + success: function(json) + { + if (json && json.success) + { + $('#MR_error_histories').remove(); + for (id_order in json.success) + if (json.success[id_order]) + { + $('#URLA4_' + id_order).html('\ + download pdf'); + $('#URLA5_' + id_order).html('\ + download pdf'); + $('#URL10x15_' + id_order).html('\ + download pdf'); + $('#expeditionNumber_' + id_order).html(json.success[id_order].expeditionNumber); + $('#detailHistory_' + id_order).children('td').children('input').attr('value', json.success[id_order].id_mr_history); + $('#detailHistory_' + id_order).children('td').children('input').attr('id', 'PS_MRHistoryId_' + json.success[id_order].id_mr_history); + } + } + displayBackGenerateSubmitButton(); + displayBackHistoriesSubmitButton(); + }, + error: function(xhr, ajaxOptions, thrownError) + { + displayBackGenerateSubmitButton(); + } + }); + } + + /** + * Check error for the generated tickets + * @param json + */ + function checkErrorGeneratedTickets(json) + { + i = 0; + $('.PS_MRErrorList').fadeOut('fast', function() + { + if ((++i >= $('.PS_MRErrorList').length) && json && json.error) + for (id_order in json.error) + if (json.error[id_order] && json.error[id_order].length) + { + $('#errorCreatingTicket_' + id_order).children('td').children('span').html(''); + $('#errorCreatingTicket_' + id_order).fadeOut('slow'); + $('#errorCreatingTicket_' + id_order).fadeIn('slow'); + for (numError in json.error[id_order]) + $('#errorCreatingTicket_' + id_order).children('td').children('span').append(json.error[id_order][numError] + '
'); + } + }); + checkOtherErrors(json); + } + + /** + * Check Errors code + * @param json + */ + function checkOtherErrors(json) + { + $('#otherErrors').fadeOut('fast', function() + { + if (json && json.other && json.other.error) + for (numError in json.other.error) + if (json.other.error[numError]) + { + $('#otherErrors').fadeIn('slow'); + $('#otherErrors').children('span').html(''); + $('#otherErrors').children('span').append(json.other.error[numError]); + } + }); + } + + /** + * Check anything about generated tickets + * @param json + */ + function checkSucceedGenerateTickets(json) + { + detailedExpeditionList = new Array(); + + i = 0; + $('.PS_MRSuccessList').fadeOut('fast', function() + { + if ((++i >= $('.PS_MRSuccessList').length) && json && json.success) + { + for (id_order in json.success) + if (json.success[id_order] && json.success[id_order].expeditionNumber) + { + $('#successCreatingTicket_' + id_order).children('td').children('span').html(''); + $('#PS_MRLineOrderInformation-' + id_order).remove(); + $('#successCreatingTicket_' + id_order).fadeIn('slow'); + detailedExpeditionList.push({'id_order':id_order, 'expeditionNumber':json.success[id_order].expeditionNumber}); + + if (!$('#detailHistory_' + id_order).length) + { + $('#PS_MRHistoriqueTableList').append('\ + \ + \ + ' + id_order + '\ + \ + \ + \ + \ + '); + } + else + { + $('#detailHistory_' + id_order).children('#URLA4_' + id_order).html(''); + $('#detailHistory_' + id_order).children('#URLA5_' + id_order).html(''); + $('#detailHistory_' + id_order).children('#URL10x15_' + id_order).html(''); + $('#detailHistory_' + id_order).children('#expeditionNumber_' + id_order).html(''); + } + $('#successCreatingTicket_' + id_order).fadeOut('slow'); + } + + $('.PS_MRSubmitButton').css('display', 'block'); + } + if(detailedExpeditionList.length) + return detailedExpeditionList; + }); + return detailedExpeditionList; + } + + /** + * Display the button to generate tickets + */ + function displayBackGenerateSubmitButton() + { + $('#PS_MRSubmitGenerateLoader').css('display', 'none'); + if ($('.order_id_list').length) + $('#PS_MRSubmitButtonGenerateTicket').fadeIn('slow'); + } + + /** + * Display the button to delete histories + */ + function displayBackHistoriesSubmitButton() + { + $('#PS_MRSubmitDeleteHistoriesLoader').css('display', 'none'); + if ($('.history_id_list').length) + $('#PS_MRSubmitButtonDeleteHistories').fadeIn('slow'); + } + + /** + * Request an ajax call to generate the tickets + */ + function generateTicketsAjax() + { + var order_id_list = new Array(); + var weight_list = new Array(); + var insurance_list = new Array(); + + $('#PS_MRSubmitButtonGenerateTicket').css('display', 'none'); + $('#PS_MRSubmitGenerateLoader').fadeIn('slow'); + + numSelected = $('input[name="order_id_list[]"]:checked').length; + $('input[name="order_id_list[]"]:checked').each(function() + { + order_id_list.push($(this).val()); + weight_list.push(($('#weight_' + $(this).val()).val()) + '-' + $(this).val()); + insurance_list.push(($('#insurance_' + $(this).val()).val()) + '-' + $(this).val()); + }); + + $.ajax( + { + type : 'POST', + url : _PS_MR_MODULE_DIR_+"ajax.php", + data : {'order_id_list' : order_id_list, + 'numSelected' : numSelected, + 'weight_list' : weight_list, + 'insurance_list' : insurance_list, + 'method' : 'MRCreateTickets', + 'mrtoken' : mrtoken}, + dataType: 'json', + success: function(json) + { + detailedExpeditionList = new Array(); + + checkErrorGeneratedTickets(json); + detailedExpeditionList = checkSucceedGenerateTickets(json); + + if (detailedExpeditionList.length) + getTickets(detailedExpeditionList); + else + displayBackGenerateSubmitButton(); + }, + error: function(xhr, ajaxOptions, thrownError) + { + display_generate_button = true; + displayBackGenerateSubmitButton(); + } + }); + + delete(order_id_list); + delete(weight_list); + delete(insurance_list); + } + + /** + * Display deleted history details + */ + function displayDeletedHistoryInformation() + { + $('input[name="history_id_list[]"]:checked').each(function() + { + $(this).parent().parent().css('background-color', '#FFE2E3'); + }); + displayBackHistoriesSubmitButton(); + } + + /** + * Manage the removed histories id + * + * @param json + */ + function checkDeletedHistoriesId(json) + { + if (json && json.success) + { + // Allow to wait the end of the loop to manage unremoved item + i = 0; + for (numberHistoryId in json.success.deletedListId) + { + $('#PS_MRHistoryId_' + json.success.deletedListId[numberHistoryId]).parent().parent().fadeOut('fast', function() { + $(this).remove(); + // Fadeout is asynchome verify everytime the number element + if (++i == json.success.deletedListId.length) + displayDeletedHistoryInformation(json.success.deletedListId.length); + }); + } + // Use if none element exist in the list + if (i == json.success.deletedListId.length) + displayDeletedHistoryInformation(); + } + else + displayBackHistoriesSubmitButton(); + } + + /** + * Delete the histories selected by the merchant + */ + function deleteSelectedHistories() + { + var history_id_list = new Array(); + + $('#PS_MRSubmitButtonDeleteHistories').css('display', 'none'); + $('#PS_MRSubmitDeleteHistoriesLoader').fadeIn('slow'); + + numSelected = $('input[name="order_id_list[]"]:checked').length; + $('input[name="history_id_list[]"]:checked').each(function() + { + history_id_list.push($(this).val()); + }); + + $.ajax( + { + type : 'POST', + url : _PS_MR_MODULE_DIR_+"ajax.php", + data : {'history_id_list' : history_id_list, + 'numSelected' : numSelected, + 'method' : 'DeleteHistory', + 'mrtoken' : mrtoken}, + dataType: 'json', + success: function(json) + { + checkOtherErrors(json); + checkDeletedHistoriesId(json); + }, + error: function(xhr, ajaxOptions, thrownError) + { + display_generate_button = true; + displayBackHistoriesSubmitButton(); + } + }); + } + + function PS_MRSubmitButtonPrintSelected(format) { + var history_id_list = new Array(); + var history_id_list_str = ''; + $('input[name="history_id_list[]"]:checked').each(function() + { + var id_order = $.trim($(this).parent().next().html()); + var expeditionNumber = $.trim($(this).parent().next().next().html()); + history_id_list.push({'id_order':id_order, 'expeditionNumber':expeditionNumber}); + expeditionNumber = strPad(expeditionNumber,8,0); + history_id_list_str += expeditionNumber+';'; + }); + + if(history_id_list.length) { + history_id_list_str = history_id_list_str.substr(0,(history_id_list_str.length-1)); + $.ajax( + { + type : 'POST', + url : _PS_MR_MODULE_DIR_+"ajax.php", + data : { + 'detailedExpeditionList' : history_id_list_str, + 'history_id_list' : history_id_list, + 'method' : 'MRDownloadPDF', + 'mrtoken' : mrtoken}, + dataType: 'json', + success: function(json) + { + var url = json.success[0]; + if(format == 4 && url!=null) { + document.location.href= url.URL_PDF_A4; + } + if(format == 5 && url!=null) { + document.location.href= url.URL_PDF_A5; + } + if(format == '10x15' && url!=null) { + document.location.href= url.URL_PDF_10x15; + } + }, + error: function(xhr, ajaxOptions, thrownError) + { + ; + } + }); + } + } + + function strPad(input, length, string) { + string = string || '0'; input = input + ''; + return input.length >= length ? input : new Array(length - input.length + 1).join(string) + input; + } + /** + * Display a fancy box displaying details about the + * backup of the database + */ + function PS_MRGetUninstallDetail(url) + { + $.ajax( + { + type: 'POST', + url: _PS_MR_MODULE_DIR_+"ajax.php", + data: {'method' : 'uninstallDetail', + 'action' : 'showFancy', + 'href' : url, + 'mrtoken' : mrtoken}, + dataType: 'json', + success: function(json) + { + ((json.html.length) ? + $.fancybox(json.html, + { + 'autoDimensions' : false, + 'width' : 450, + 'height' : 'auto', + 'transitionIn' : 'none', + 'transitionOut' : 'none', + 'onComplete' : function() + { + PS_MRHandleUninstallButton(url); + + // Rewrite some css properties of Fancybox + $('#fancybox-wrap').css('width', ''); + $('#fancybox-content').css('background-color', ''); + $('#fancybox-content').css('border', ''); + } + }) + : ''); + }, + error: function(xhr, ajaxOptions, thrownError) + { + // Put debug to see error detail + } + }); + return false; + } + + /** + * Handle the button when a user clicked on the uninstall button + */ + function PS_MRHandleUninstallButton(url) + { + $('#PS_MR_BackupAction').click(function() + { + $.fancybox.close(); + PS_MRBackupDatabase(url); + }); + + $('#PS_MR_UninstallAction').click(function() + { + window.location.href = url; + $.fancybox.close(); + return true; + }); + + $('#PS_MR_StopUninstall').click(function() + { + $.fancybox.close(); + return false; + }); + } + + /** + * Ajax call to keep the database of the module safe + */ + function PS_MRBackupDatabase(url) + { + $.ajax( + { + type: 'POST', + url: _PS_MR_MODULE_DIR_+"ajax.php", + data: {'method' : 'uninstallDetail', + 'action' : 'backupAndUninstall', + 'mrtoken' : mrtoken}, + dataType: 'json', + success: function(json) + { + url += '&keepDatabase=true'; + window.location.href = url; + }, + error: function(xhr, ajaxOptions, thrownError) + { + // Put debug to see error detail + } + }); + } + + /** + * Add / update a entry to the selected carrier to the mr_selected table + * with the selected relay point information + * + * @param relayPointNumber + * @param id_carrier + */ + function PS_MRAddSelectedRelayPointInDB(relayPointNumber, id_carrier) + { + PS_MRSelectedRelayPoint['relayPointNum'] = relayPointNumber; + + // Ajax call to add the selection in the database (compatibility for 1.3) + // But keep this way to add a selection better that the hook + $.ajax({ + type: 'POST', + url: _PS_MR_MODULE_DIR_ + 'ajax.php', + data: {'method' : 'addSelectedCarrierToDB', + 'relayPointInfo' : relayPointDataContainers[relayPointNumber], + 'id_carrier' : id_carrier, + 'id_mr_method' : PS_MRCarrierMethodList[id_carrier], + 'mrtoken' : mrtoken}, + success: function(json) + { + if (PS_MROPC && PS_MRData.PS_VERSION < '1.5') + updateCarrierSelectionAndGift(); + }, + error: function(xhr, ajaxOptions, thrownError) + { + } + }); + } + + /** + * Add / update a entry to the selected carrier to the mr_selected table + * Without relay point information + * + * @param id_carrier + */ + function PS_MRAddSelectedCarrierInDB(id_carrier) + { + PS_MRHideLastRelayPointList(); + + // Make the request + $.ajax({ + type: 'POST', + url: _PS_MR_MODULE_DIR_ + 'ajax.php', + data: {'method' : 'addSelectedCarrierToDB', + 'id_carrier' : id_carrier, + 'id_mr_method' : PS_MRCarrierMethodList[id_carrier], + 'mrtoken' : mrtoken}, + success: function(json) + { + }, + error: function(xhr, ajaxOptions, thrownError) + { + } + }); + } + + /** + * Handle function when an user click on a shipping + * + * @param carrierSelected + * @param id_carrier + * @param MRLivraisonType + */ + function PS_MRCarrierSelectedProcess(carrierSelected, id_carrier, MRLivraisonType) + { + // Reset for any carrier changement + if (MRLivraisonType != 'LD1' && MRLivraisonType != 'LDS' && MRLivraisonType != 'HOM') + { + // Seek Relay point if it doesn't a home delivery mode + PS_MRGetRelayPoint(carrierSelected); + } + else + { + // Simply add the selected carrier to the db, relay information will be empty + PS_MRAddSelectedCarrierInDB(id_carrier); + + // Won't have any relay points + PS_MRSelectedRelayPoint['relayPointNum'] = -1; + } + } + + /** + * Hide the last displayed relay point list + */ + function PS_MRHideLastRelayPointList() + { + $('.PS_MRSelectedCarrier').fadeOut('fast'); + } + + /** + * Check if the user select a carrier and a relay point if exist + */ + function PS_MRCheckSelectedRelayPoint() + { + var input; + + // Check if the input is linked to the module and look into + // a temporary variable if a relay point has been selected + if ((input = $('input[name=id_carrier]:checked')).length && + PS_MRCarrierMethodList[input.val()] != undefined && + PS_MRSelectedRelayPoint['relayPointNum'] == 0) + { + //$('#PS_MRSelectCarrierError').fadeIn('fast'); + alert(PS_MRTranslationList['errorSelection']); + return false; + } + return true; + } + + /** + * Link the generated relay point to an handle click + * Allow to add the selected relay point in the database + */ + function PS_MRHandleSelectedRelayPoint() + { + // Link all new generated relay point Selected button to an action + $('.PS_MRSelectRelayPointButton').click(function() + { + // Unselect all previous selection (normaly juste one) + $('.PS_MRFloatRelayPointSelected').each(function() + { + $(this).attr('class', 'PS_MRFloatRelayPointSelecteIt'); + $(this).children('a').text(PS_MRTranslationList['Select']); + }); + // Make the Selection + $(this).html(PS_MRTranslationList['Selected']); + $(this).parent().attr('class', 'PS_MRFloatRelayPointSelected'); + + // Get the info about the relay point (relayPoint_RelayPointNumber_IdCarrier) + var tab = $(this).parent().parent().attr('id').split('_'); + + // Store Separated data for the ajax query + if (tab.length == 3) + { + var relayPointNumber = tab[1]; + var id_carrier = tab[2]; + PS_MRAddSelectedRelayPointInDB(relayPointNumber, id_carrier); + } + }); + } + + + /** + * Display the relay point fetched + * + * @param json + * @param blockContent + * @param carrier_id + */ + function PS_MRDisplayRelayPoint(json, blockContent, carrier_id) + { + if (typeof json != 'undefined' && typeof blockContent != 'undefined') + { + numberDisplayed = 0; + + // Disable Gmap for IE user + // if (!$.browser.msie) + PS_MRCreateGmap(carrier_id); + blockContent.fadeOut('fast', function() + { + $(this).children('td').html(''); + for (relayPoint in json.success) + { + // Check if the the content wasn't already displayed + contentBlockid = 'relayPoint_' + json.success[relayPoint].Num + '_' + carrier_id; + if (!$('#' + contentBlockid).size()) + { + // Set translation if a preselection exist + var BtTranslation = (PS_MRSelectedRelayPoint['relayPointNum'] == json.success[relayPoint].Num) ? + PS_MRTranslationList['Selected'] : PS_MRTranslationList['Select']; + + var classSelection = (PS_MRSelectedRelayPoint['relayPointNum'] == json.success[relayPoint].Num) ? + 'PS_MRFloatRelayPointSelected' : 'PS_MRFloatRelayPointSelecteIt'; + + $('
' + + '' + + '

' + json.success[relayPoint].LgAdr1 + '
' + json.success[relayPoint].LgAdr3 + + ' - ' + json.success[relayPoint].CP + ' - ' + json.success[relayPoint].Ville + + ' ' + json.success[relayPoint].Pays + '

' + + '
' + + '' + BtTranslation + '' + + '
\ +
').appendTo($(this).children('td')); + + // Store all the object content to prevent an ajax request + relayPointDataContainers[json.success[relayPoint].Num] = json.success[relayPoint]; + ++numberDisplayed; + // Display popup for IE user + //if (!$.browser.msie) + PS_MRAddGMapMarker(carrier_id, json.success[relayPoint].Num, contentBlockid); + /* else + $('#' + contentBlockid).children('p').click(function() { + PS_MROpenPopupDetail(json.success[relayPoint].permaLinkDetail); + });*/ + } + } + PS_MRHandleSelectedRelayPoint(); + $(this).fadeIn('fast'); + }); + } + } + + /** + * Display error about the fetch of the relay point + * + * @param errorList + * @param blockContent + */ + function PS_MRDisplayErrorRelayPoint(errorList, blockContent) + { + + blockContent.fadeOut('fast', function() + { + $(this).children('td').html(''); + for (numError in errorList) + { + $('
' + errorList[numError] + '
').appendTo($(this).children('td')); + } + $(this).fadeIn('fast'); + }); + } + + /** + * Fetch the relay point + * + * @param carrierSelected + */ + function PS_MRFetchRelayPoint(carrierSelected) + { + carrier_id = carrierSelected.val().replace(',', ''); + // Block is an input, we need the 'tr' element + blockTR =$('#MR_PR_list_'+carrier_id+' tr'); + // Add a new line to the table after the clicked parent element + blockTR.after(' \ + \ +
\ + \ +
\ + '); + + fetchingRelayPoint[carrier_id] = $('#PS_MRSelectedCarrier_' + carrier_id); + $.ajax( + { + type: 'POST', + url: _PS_MR_MODULE_DIR_ + 'ajax.php', + data: {'method' : 'MRGetRelayPoint', + 'id_carrier' : carrier_id, + 'ajax' : true, + 'step' : 2, + 'mrtoken' : mrtoken}, + dataType: 'json', + success: function(json) + { + if (json && json.error && json.error.length) + PS_MRDisplayErrorRelayPoint(json.error, $('#PS_MRSelectedCarrier_' + carrier_id)); + else if (json && json.success) + PS_MRDisplayRelayPoint(json, $('#PS_MRSelectedCarrier_' + carrier_id), carrier_id); + }, + error: function(xhr, ajaxOptions, thrownError) + { + // Put debug to see error detail + } + }); + } + + /** + * Display the relay point of a selected Carrier and keep fetched data + * in the html page (cache) + * + * @param carrierSelected + */ + function PS_MRGetRelayPoint(carrierSelected) + { + carrier_id = carrierSelected.val().replace(',',''); + + // Init back the inital view, hide existing element, (keep cached) + element = 0; + totalElement = $('.PS_MRSelectedCarrier').size(); + + // Check if the element has already been fetched + if (totalElement) + // It Works like a foreach + $('.PS_MRSelectedCarrier').fadeOut('fast', function() + { + if ((element + 1) >= totalElement) + { + // Check if the user already clicked and if the process is done + if (typeof fetchingRelayPoint[carrier_id] != 'undefined') + { + fetchingRelayPoint[carrier_id].fadeIn('fast'); + return ; + } + // If the element isn't cached, we fetch it + PS_MRFetchRelayPoint(carrierSelected); + } + ++element; + }); + else + PS_MRFetchRelayPoint(carrierSelected); + } + + /** + * Create the Gmap Block and cache the js object for the carrier + * + * @param id_carrier + */ + function PS_MRCreateGmap(id_carrier) + { + // This has been written this way because it needed to have a known block + // present everytime in the page. Body is the only one sure. + // It's an hidden block which will be put in the right block when user select his + // own carrier + $('body').prepend('\ + \ + \ +
\ +
'); + $('#PS_MRGmap_' + id_carrier).gmap3( + { + action: 'init', + callback: function(result) + { + GmapList[id_carrier] = $(this); + // Can't set the display to none by default (bug due to + // navigator that tell to google that the content size = 0 + //$(this).toggle('fast'); + } + } + ); + } + + /** + * Resize the map when the div got changement about dimension / position and displaying + * + * @param $map + */ + function PS_MRGmapResizeEvent($map) + { + gmap = $map.gmap3({action:'get'}); + google.maps.event.trigger(gmap, 'resize'); + } + + /** + * Move the view of the gmap to a marker + * liable to the relay point + * + * @param $map + * @param marker + * @param relayNum + */ + function PS_MRGmapPlaceViewOnMarker($map, marker, relayNum) + { + $map.gmap3( + { + action:'panTo', + args:[marker.position], + callback: function() + { + PS_MRDisplayClickedGmapWindow(marker, relayNum, $map); + + // Make dancing markers in Firefox / IE will use the CPU to 50 to 100 % about + if (!$.browser.msie && !$.browser.mozilla) + (function(m) + { + setTimeout(function() + { + m.setAnimation(google.maps.Animation.BOUNCE); + }, 200); + })(marker); + // marker.setAnimation(google.maps.Animation.BOUNCE); + } + }); + } + + /** + * Stop all dancing marker of the current selected carrier + * + * @param currentMarkerList + */ + function PS_MRStopDancingMarkers(currentMarkerList) + { + for (markerNumber in currentMarkerList) + if (currentMarkerList[markerNumber] != undefined) + if (currentMarkerList[markerNumber].getAnimation() != null) + currentMarkerList[markerNumber].setAnimation(null); + } + + /** + * Display the Gmap of the selected relay point + * + * @param contentBlockid + * @param $map + */ + function PS_MRDisplayGmap(contentBlockid, $map) + { + var tab = contentBlockid.split('_'); + var relayPointNumber = tab[1]; + var id_carrier = tab[2]; + + // Stop the dancing marker of the current carrier + PS_MRStopDancingMarkers(markerList[id_carrier]); + if ($('#PS_MRGmap_' + id_carrier).css('display') == 'none') + { + $('#' + contentBlockid).after($('#PS_MRGmap_' + id_carrier)); + $('#PS_MRGmap_' + id_carrier).slideDown('fast', function() + { + PS_MRGmapResizeEvent($map); + PS_MRGmapPlaceViewOnMarker($map, markerList[id_carrier][relayPointNumber], relayPointNumber); + }); + } + else + { + previousElem = $('#PS_MRGmap_' + id_carrier).prev(); + //$('#' + contentBlockid).after($('#PS_MRGmap_' + id_carrier)); + $('#PS_MRGmap_' + id_carrier).toggle('fast', function() + { + if (previousElem.attr('id') != contentBlockid) + { + $('#' + contentBlockid).after($(this)); + $('#PS_MRGmap_' + id_carrier).slideDown('fast', function() + { + PS_MRGmapResizeEvent($map); + PS_MRGmapPlaceViewOnMarker($map, markerList[id_carrier][relayPointNumber], relayPointNumber); + }); + } + }); + } + } + + /** + * Generate an html block to display the opening hours details + * + * @param relayInfo + */ + function PS_MRGetTimeRelayDetail(relayInfo) + { + var params = "\'height=200, width=400, top=100, left=100, toolbar=no, menubar=yes, location=no, resizable=yes, scrollbars=no, status=no\'"; + onClick = 'onClick="window.open(\'' + relayInfo.permaLinkDetail + '\', \'MondialRelay\', '+ params +' )"'; + + var html = ' \ +
\ + \ +

' + relayInfo.LgAdr1 + '
' + relayInfo.LgAdr3 + + ' - ' + relayInfo.CP + ' - ' + relayInfo.Ville + + ' ' + relayInfo.Pays + '

\ + ' + PS_MRTranslationList['moreDetails'] + ' \ +
'; + return html; + } + + /** + * Call a MondialRelay page into a popup + * + * @param url + */ + function PS_MROpenPopupDetail(url) + { + window.open(url, 'MondialRelay', + 'height=200, width=400, top=100, left=100, toolbar=no, menubar=yes, \ + location=no, resizable=yes, scrollbars=no, status=no'); + } + + /** + * Display the gmap windows selected by the user + * + * @param marker + * @param relayNum + * @param mapObject + */ + function PS_MRDisplayClickedGmapWindow(marker, relayNum, mapObject) + { + if (last_gmap_info_clicked.length) + { + // Close the last opening window in gmap + if ((lastWin = mapObject.gmap3({action:'get', name:'infowindow', tag:last_gmap_info_clicked}))) + lastWin.close(); + } + + // Open the selected detail window + map = mapObject.gmap3('get'); + if ((currentWindow = mapObject.gmap3({action:'get', name:'infowindow', tag:relayNum}))) + currentWindow.open(map, marker); + last_gmap_info_clicked = relayNum; + } + + /** + * Add a new Marker to a Gmap for a carrier using the + * relay point information + * + * @param id_carrier + * @param relayPointNumber + * @param contentBlockid + */ + function PS_MRAddGMapMarker(id_carrier, relayPointNumber, contentBlockid) + { + // Check if the gmap has been properly created + if (GmapList[id_carrier] == undefined) + return ; + var relayInfo = relayPointDataContainers[relayPointNumber]; + var detailContentHtml = PS_MRGetTimeRelayDetail(relayInfo); + + // Add Marker to the map + var fullFormatedAddress = relayInfo.LgAdr1 + ' ' + relayInfo.LgAdr3 + ' ' + + relayInfo.CP + ' ' + relayInfo.Ville + ' ' + relayInfo.Pays; + GmapList[id_carrier].gmap3( + { + action: 'addMarker', + address: fullFormatedAddress, + tag:relayInfo.Num, + map: + { + center: true, + zoom: 14 + }, + marker: { + events: + { + click:function(marker, event, data) + { + PS_MRDisplayClickedGmapWindow(marker, relayInfo.Num, $(this)); + } + }, + callback: function(marker) + { + if (marker) + { + // Check if the a marker list exist for the carrier, + if (markerList[id_carrier] == undefined) + markerList[id_carrier] = new Object(); + + // Store the marker in the markerList of the carrier + markerList[id_carrier][relayPointNumber] = marker; + + // Link all relay point line info to an action + $('#' + contentBlockid).children('p').click(function() + { + PS_MRDisplayGmap($(this).parent().attr('id'), GmapList[id_carrier]); + }); + return true; + } + else + $('#' + contentBlockid).children('p').click(function() + { + PS_MROpenPopupDetail(relayInfo.permaLinkDetail); + }); + } + }, + infowindow: + { + options: {content:detailContentHtml}, + tag:relayInfo.Num, + callback: function(infowindow) { + + var windowList = $(this).gmap3({action:'get', name:'infowindow', all:true}); + $.each(windowList, function(i, elem) { + elem.close(); + }); + } + } + }); + return false; + } + + /** + * Display the selected form block for the configuration page + * @param block_id + */ + function PS_MRDisplayConfigurationForm(block_id) + { + var block_form_id = block_id + '_block'; + var total_form = $('.PS_MRFormType').length; + var i = 0; + $('.PS_MRFormType').each(function() + { + if ($(this).attr('id') != block_form_id) + $(this).css('display', 'none'); + if ((i + 1) == total_form) + { + $('#' + block_form_id).fadeIn('fast'); + $('#' + block_id).parents('ul').children('li').attr('class', ''); + $('#' + block_id).parent().attr('class', 'selected'); + } + ++i; + }); + + if ($('#' + block_form_id).length == 0) + $('#MR_error_account').fadeIn('fast'); + } + + function checkToDisplayRelayList() + { + if (typeof PS_MRData != 'undefined') + { + PS_MRSelectedRelayPoint['relayPointNum'] = PS_MRData.pre_selected_relay; + + if (PS_MRData.PS_VERSION < '1.5') { + $('input[name="id_carrier"]').each(function(i, e){ + var parent_element = $(e).closest('tr'); + var new_element = 'MR_PR_list_'+$(e).val().replace(',', ''); + var MR_idcarrier = $(e).val().replace(',', ''); + MR_carrier = isMRCarrier(MR_idcarrier); + + if($('#'+new_element).length > 0) { + $('#'+new_element).remove(); + if( isMRCarrier(MR_idcarrier)!=false && typeof(MR_carrier) != "undefined" && (MR_carrier.dlv_mode!='LD1' && MR_carrier.dlv_mode!='LDS' && MR_carrier.dlv_mode!='HOM')) { + $(parent_element).after( + '
' + + '' + +'
' + +'' + ); + } + } + else { + if( isMRCarrier(MR_idcarrier)!=false ) { + if(typeof(MR_carrier) != "undefined" && (MR_carrier.dlv_mode!='LD1' && MR_carrier.dlv_mode!='LDS' && MR_carrier.dlv_mode!='HOM')) + { + $(parent_element).after( + '
' + + '' + +'
' + +'' + ); + } + } + } + + + if($(e).attr('checked') == 'checked' || $(e).attr('checked')) { + if(MR_carrier != false) { + PS_MRCarrierMethodList[MR_idcarrier] = MR_carrier.id_mr_method; + PS_MRSelectedRelayPoint['carrier_id'] = MR_idcarrier; + var new_element = 'MR_PR_list_'+MR_idcarrier; + + PS_MRCarrierSelectedProcess($(this), MR_idcarrier, MR_carrier.dlv_mode); + + if(MR_carrier.dlv_mode!='LD1' && MR_carrier.dlv_mode!='LDS' && MR_carrier.dlv_mode!='HOM') + $('.trMRSelected').fadeIn('fast'); + else + $('.trMRSelected').fadeOut('fast'); + } + else { + PS_MRHideLastRelayPointList(); + PS_MRSelectedRelayPoint['relayPointNum'] = -1; + $('.trMRSelected').fadeOut('fast'); + } + } + }); + } + else { + $('input.delivery_option_radio').each(function(i, e){ + var MR_idcarrier = $(e).val().replace(',', ''); + MR_carrier = isMRCarrier(MR_idcarrier); + var carrier_selected = $('input.delivery_option_radio:checked').val(); + var parent_element = $(e).parents('.delivery_option'); + var new_element = 'MR_PR_list_'+MR_idcarrier; + if($('#'+new_element).length > 0) { + $('#'+new_element).remove(); + if( isMRCarrier(MR_idcarrier)!=false && typeof(MR_carrier) != "undefined" && (MR_carrier.dlv_mode!='LD1' && MR_carrier.dlv_mode!='LDS' && MR_carrier.dlv_mode!='HOM')) { + $(parent_element).append( + '
' + + '' + +'
'); + } + } + else { + if( isMRCarrier(MR_idcarrier)!=false && typeof(MR_carrier) != "undefined" && (MR_carrier.dlv_mode!='LD1' && MR_carrier.dlv_mode!='LDS' && MR_carrier.dlv_mode!='HOM')) { + $(parent_element).append( + '
' + + '' + +'
'); + } + } + + // Hide MR input if one of them is not selected + if($(e).val() == carrier_selected) + { + console.log(carrier_selected); + if(MR_carrier != false) { + PS_MRCarrierMethodList[MR_idcarrier] = MR_carrier.id_mr_method; + PS_MRSelectedRelayPoint['carrier_id'] = MR_idcarrier; + var new_element = 'MR_PR_list_'+MR_idcarrier; + + PS_MRCarrierSelectedProcess($(this), MR_idcarrier, MR_carrier.dlv_mode); + + if(MR_carrier.dlv_mode!='LD1' && MR_carrier.dlv_mode!='LDS' && MR_carrier.dlv_mode!='HOM') + $('.trMRSelected').fadeIn('fast'); + else + $('.trMRSelected').fadeOut('fast'); + } + else { + PS_MRHideLastRelayPointList(); + PS_MRSelectedRelayPoint['relayPointNum'] = -1; + $('.trMRSelected').fadeOut('fast'); + } + } + }); + } + } + } + + function isMRCarrier(id_carrier){ + var carrier_list = PS_MRData.carrier_list; + for(i in carrier_list){ + var MR_carrier = carrier_list[i]; + if(MR_carrier.id_carrier == id_carrier) { + return MR_carrier; + } + } + return false; + } + + $(document).ready(function() + { + $('#form').submit(function() + { + return PS_MRCheckSelectedRelayPoint(); + }); + $('#toggleStatusOrderList').click(function() + { + toggleOrderListSelection(); + }); + $('#toggleStatusHistoryList').click(function() + { + toggleHistoryListSelection(); + }); + $('#generate').click(function() + { + generateTicketsAjax(); + }); + $('#PS_MRSubmitButtonDeleteHistories').click(function() + { + deleteSelectedHistories(); + }); + $('#PS_MRSubmitButtonPrintSelectedA4').click(function() + { + PS_MRSubmitButtonPrintSelected(4); + }); + $('#PS_MRSubmitButtonPrintSelectedA5').click(function() + { + PS_MRSubmitButtonPrintSelected(5); + }); + $('#PS_MRSubmitButtonPrintSelected10x15').click(function() + { + PS_MRSubmitButtonPrintSelected('10x15'); + }); + + // Shipping method list + $('.send_disable_carrier_form').click(function() { + $(this).parent('form').submit(); + }); + + // Configuration form page + $('#MR_config_menu a').each(function() { + $(this).click(function() { + PS_MRDisplayConfigurationForm($(this).attr('id')); + }); + }) + + if (typeof(PS_MR_SELECTED_TAB ) != 'undefined') + $('#MR_' + PS_MR_SELECTED_TAB + '_block').fadeIn('fast'); + + // Have the
  • elements centered (TODO: Change it using css if possible) + if ($('#MR_config_menu').size()) + { + var width = $('#MR_config_menu').width(); + + // Take directly the ul width woudln't work + var ul_width = 0; + + $('#MR_config_menu').find('ul > li').each(function() { + + var padding_left = parseInt($(this).css('padding-left').replace(/[^-\d\.]/g, '')); + var padding_right = parseInt($(this).css('padding-right').replace(/[^-\d\.]/g, '')); + + ul_width += parseInt($(this).width()) + padding_left + padding_right; + }); + + width = ((width - ul_width) / 2); + $('#MR_config_menu').children('ul').css('margin-left', width + 'px'); + } + + // 1.5 OPC Validation - Warn user to select a relay point + $('.payment_module a').live('click', function() { + if (typeof PS_MRData != 'undefined') + { + if (PS_MRData.PS_VERSION >= '1.5' && PS_MRData.carrier) + { + var _return = !(!PS_MRSelectedRelayPoint['carrier_id'] || !PS_MRSelectedRelayPoint['relayPointNum']); + if (!_return) + alert(PS_MRTranslationList['errorSelection']); + return _return; + } + } + }); + + // If MR carrier selected, check MR relay point is selected too + $('input[name=processCarrier], button[name=processCarrier]').click(function(){ + var _return = !(PS_MRSelectedRelayPoint['carrier_id'] && !PS_MRSelectedRelayPoint['relayPointNum']); + if (!_return) + alert(PS_MRTranslationList['errorSelection']); + + return _return; + }); + + if (typeof PS_MRData != 'undefined') + { + if (PS_MRData.PS_VERSION < '1.5') { + $('input[name="id_carrier"]').click(function(){ + checkToDisplayRelayList(); + }); + } + } + + // Handle input click of the other input to hide the previous relay point list displayed + }); + + // To have public method access for this closure + return { + initFront : function() { + checkToDisplayRelayList(); + }, + uninstall : function(url) + { + return PS_MRGetUninstallDetail(url); + } + }; +})(jQuery); + + + + +/** + * Check connexion to webservice * + */ +function mr_checkConnexion() { + var enseigne = $("#MR_enseigne_webservice").val(); + var code_marque = $("#MR_code_marque").val(); + var key = $("#MR_webservice_key").val(); + $.ajax( + { + type : 'POST', + url: _PS_MR_MODULE_DIR_ + 'connexion.php', + data : "enseigne="+enseigne+"&code_marque="+code_marque+"&key="+key+"&token="+mrtoken, + dataType: 'json', + success: function(json) + { + if (json && json.success) + { + alert("Connection valide. Veuillez mettre à jour votre compte."); + } + else { + if(json && json.error) + alert(json.error); + else + alert("Service Indisponible"); + } + } + }); +} \ No newline at end of file diff --git a/modules/mondialrelay/js/mondialrelay_widget.js b/modules/mondialrelay/js/mondialrelay_widget.js new file mode 100755 index 00000000..332427f7 --- /dev/null +++ b/modules/mondialrelay/js/mondialrelay_widget.js @@ -0,0 +1,258 @@ +/* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 16986 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + function getNumeric(val) { + var reg=new RegExp("[0-9]+","g"); + var res = reg.exec(val); + if(isNaN(res)) + return 0; + else + return res; + } + + function checkToDisplayRelayList() + { + if (typeof PS_MRData != 'undefined') + { + //============================================================ + // auto display fancybox if radio already check + //============================================================ + PS_MRSelectedRelayPoint['relayPointNum'] = PS_MRData.pre_selected_relay; + // PS_VERSION < '1.5' + if (PS_MRData.PS_VERSION < '1.5') + { + // Bind id_carrierX to an ajax call + $.each(PS_MRData.carrier_list, function(i, carrier) { + PS_MRCarrierMethodList[carrier.id_carrier] = carrier.id_mr_method; + if ($('#id_carrier' + carrier.id_carrier).attr('checked')) { + PS_MRSelectedRelayPoint['carrier_id'] = carrier.id_carrier; + PS_MRDisplayWidget(carrier.id_carrier); + } + }); + + } + else if (PS_MRData.PS_VERSION >= '1.5' + && typeof PS_MRData.carrier != 'undefined' + ) + { // 1.5 way + var carrier_selected = $('input[class=delivery_option_radio]:checked').val(); + $.each(PS_MRData.carrier_list, function(i, carrier) { + PS_MRCarrierMethodList[carrier.id_carrier] = carrier.id_mr_method; + if (carrier.id_carrier+',' == carrier_selected || carrier.id_carrier == carrier_selected) { + overrideUpdateExtraCarrier(carrier_selected, id_address); + PS_MRSelectedRelayPoint['carrier_id'] = carrier.id_carrier; + PS_MRDisplayWidget(carrier.id_carrier); + } + }); + } + //============================================================ + // Handle input click of the other input to hide the previous relay point list displayed + $('input[name=id_carrier], input.delivery_option_radio').click(function(e){ + displayPickupPlace(0); + }); + } + //return false; + } + + function isMRCarrier(id_carrier){ + var carrier_list = PS_MRData.carrier_list; + for(i in carrier_list){ + var MR_carrier = carrier_list[i]; + if(MR_carrier.id_carrier == id_carrier) { + return MR_carrier; + } + } + return false; + } + + function hideRelaySelectedBox(_this){ + // Hide MR input if one of them is not selected + if (PS_MRCarrierMethodList[_this.val()] == undefined){ + // 1.5 way + var id = getNumeric(_this.val()); + if(PS_MRCarrierMethodList[id] == undefined) { + displayPickupPlace(0); + PS_MRSelectedRelayPoint['carrier_id'] = 0; + PS_MRDisplayWidget(0); + PS_MRSelectedRelayPoint['relayPointNum'] = 0; + } + else { + PS_MRSelectedRelayPoint['carrier_id'] = id; + PS_MRDisplayWidget(id); + } + } + else { + PS_MRSelectedRelayPoint['carrier_id'] = _this.val(); + PS_MRDisplayWidget(_this.val()); + } + return false; + } + + function PS_MRDisplayWidget(carrier_id) { + var dlv_mode = ''; + $.each(PS_MRData.carrier_list, function(i, carrier) { + if (carrier.id_carrier == carrier_id) + dlv_mode = carrier.dlv_mode; + PS_MRSelectedRelayPoint['relayPointNum'] = -1; + PS_MRAddSelectedCarrierInDB(carrier_id); + } + ); + if(carrier_id) { + if(dlv_mode!='LD1' && dlv_mode!='LDS' && dlv_mode!='HOM') { + loadMR_Map("#Zone_Widget", dlv_mode); + $("#link_zone_widget").click(); + if(PS_MRSelectedRelayPoint['relayPointNum'] == -1) + PS_MRSelectedRelayPoint['relayPointNum'] = 0; + } + else + displayPickupPlace(0); + } + return false; + } + + + function overrideUpdateExtraCarrier(id_delivery_option, id_address) + { + if(PS_MRData.PS_VERSION < '1.5') + return false; + + var url = ""; + var method = 'updateExtraCarrier'; + var params = ''; + if(typeof(orderOpcUrl) !== 'undefined') { + method = 'updateCarrierAndGetPayments'; + params += '&recyclable='+(($('#recyclable:checked').val() != undefined)? 1:0); + params += '&gift='+(($('#gift:checked').val() != undefined)? 1:0); + params += '&gift_message='+$('#gift_message').val(); + params += '&delivery_option['+id_address+']='+id_delivery_option; + url = orderOpcUrl; + } + else + url = orderUrl; + + $.ajax({ + type: 'POST', + headers: { "cache-control": "no-cache" }, + url: url + '?rand=' + new Date().getTime(), + async: false, + cache: false, + dataType : "json", + data: 'ajax=true' + +'&method='+method + +params + +'&id_address='+id_address + +'&id_delivery_option='+id_delivery_option + +'&token='+static_token + +'&allow_refresh=1', + success: function(jsonData) + { + //$('#HOOK_EXTRACARRIER_'+id_address).html(jsonData['content']); + return false; + } + }); + return false; + } + + function displayPickupPlace(info) { + var id = "relay_point_selected_box"; + + if(!info) { + $('#'+id).hide(); + $('#'+id).remove(); + return false; + } + + if (PS_MRData.PS_VERSION < '1.5') + { + var block_carrier = $('#carrierTable'); + } + else { + var block_carrier = $('.delivery_options_address'); + } + if($('#'+id).length !== 0) { + $('#'+id).html('

    '+relay_point_selected_box_label+'

    '+info); + $('#'+id).show(); + } + else { + $('

    '+relay_point_selected_box_label+'

    '+info+'
    ').insertAfter(block_carrier); + } + return false; + } + + function PS_MRAddSelectedCarrierInDB(id_carrier) + { + // Make the request + $.ajax({ + type: 'POST', + url: _PS_MR_MODULE_DIR_ + 'ajax.php', + data: {'method' : 'addSelectedCarrierToDB', + 'id_carrier' : id_carrier, + 'id_mr_method' : PS_MRCarrierMethodList[id_carrier], + 'mrtoken' : mrtoken}, + success: function(json) + { + return false; + } + }); + return false; + } + + $(document).ready(function() + { + // 1.5 OPC Validation - Warn user to select a relay point + $('.payment_module a').live('click', function() { + if (typeof PS_MRData != 'undefined') + { + if (PS_MRData.PS_VERSION >= '1.5' && PS_MRData.carrier && PS_MRSelectedRelayPoint['carrier_id']!=0) + { + var _return = !(!PS_MRSelectedRelayPoint['carrier_id'] || !PS_MRSelectedRelayPoint['relayPointNum']); + if (!_return) + alert(PS_MRTranslationList['errorSelection']); + return _return; + } + } + }); + + // If MR carrier selected, check MR relay point is selected too + $('input[name=processCarrier], button[name=processCarrier]').click(function(){ + var carrier_selected = $('input[class=delivery_option_radio]:checked').val(); + if (PS_MRSelectedRelayPoint['carrier_id']+',' == carrier_selected || PS_MRSelectedRelayPoint['carrier_id'] == carrier_selected) + { + var _return = !(PS_MRSelectedRelayPoint['carrier_id'] && !PS_MRSelectedRelayPoint['relayPointNum']); + if (!_return) + alert(PS_MRTranslationList['errorSelection']); + return _return; + } + }); + + if (typeof PS_MRData != 'undefined') + { + if (PS_MRData.PS_VERSION < '1.5') { + $('input[name="id_carrier"]').click(function(){ + checkToDisplayRelayList(); + }); + } + } + }); diff --git a/modules/mondialrelay/logo.png b/modules/mondialrelay/logo.png new file mode 100755 index 00000000..56a3ec7a Binary files /dev/null and b/modules/mondialrelay/logo.png differ diff --git a/modules/mondialrelay/mails/en/index.php b/modules/mondialrelay/mails/en/index.php new file mode 100755 index 00000000..4deda527 --- /dev/null +++ b/modules/mondialrelay/mails/en/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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; \ No newline at end of file diff --git a/modules/mondialrelay/mails/en/mr_new_order.html b/modules/mondialrelay/mails/en/mr_new_order.html new file mode 100755 index 00000000..07d21265 --- /dev/null +++ b/modules/mondialrelay/mails/en/mr_new_order.html @@ -0,0 +1,77 @@ + + + + + [{shop_name}] New order + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + {shop_name} +
     
    Hello {firstname} {lastname}, thank you for shopping with {shop_name} and Mondial Relay.
     
    Order details
     
    + Order: {order_name} placed on {date} +
    Payment: {payment} +
     
    + Carrier: {carrier} +
     
    + + + + + + + + + +
    Point Relais® Delivery addressBilling address
    +
    {delivery_company} +
    {delivery_address1} +
    {delivery_city} {delivery_postal_code} +
    {delivery_country} +
    + {invoice_company} +
    {invoice_firstname} {invoice_lastname} +
    {invoice_address1} +
    {invoice_address2} +
    {invoice_city} {invoice_postal_code} +
    {invoice_country} {invoice_state} +
    {invoice_phone} +
    {invoice_other} +
    +
     
    + You can review this order and download your invoice from the "Order history" section of your account by clicking "My account" on our Website. +
     
    + {shop_name} powered with PrestaShop™
    + + \ No newline at end of file diff --git a/modules/mondialrelay/mails/en/mr_new_order.txt b/modules/mondialrelay/mails/en/mr_new_order.txt new file mode 100755 index 00000000..114df554 --- /dev/null +++ b/modules/mondialrelay/mails/en/mr_new_order.txt @@ -0,0 +1,31 @@ +Hello {firstname} {lastname}, thank you for your order on {shop_name}! + +Order details + + Order: {order_name} placed on {date} + Payment: {payment} + +Shipping + + Carrier: {carrier} + + Delivery address: + + {delivery_company} + {delivery_address1} + {delivery_postal_code} {delivery_city} + {delivery_country} + + Billing address: + + {invoice_company} + {invoice_firstname} {invoice_lastname} + {invoice_address1} + {invoice_address2} + {invoice_postal_code} {invoice_city} + {invoice_country} {invoice_state} + {invoice_other} + +You can review this order and download your invoice from the "Order history" section of your account by clicking "My account" on our Website. + +{shop_url} powered by PrestaShop™ diff --git a/modules/mondialrelay/mondialrelay.php b/modules/mondialrelay/mondialrelay.php index c7abe4dd..3acecb97 100755 --- a/modules/mondialrelay/mondialrelay.php +++ b/modules/mondialrelay/mondialrelay.php @@ -1,13 +1,13 @@ -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 10545 $ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA */ if (!defined('_PS_VERSION_')) exit; -require_once(_PS_MODULE_DIR_.'mondialrelay/classes/MondialRelayClass.php'); require_once(_PS_MODULE_DIR_.'mondialrelay/classes/MRTools.php'); class MondialRelay extends Module { - const INSTALL_SQL_FILE = 'mrInstall.sql'; - + const INSTALL_SQL_FILE = 'sql/mrInstall.sql'; + private $_postErrors; - + public static $modulePath = ''; public static $moduleURL = ''; static public $MRFrontToken = ''; static public $MRBackToken = ''; - // Added for 1.3 compatibility + /* Added for 1.3 compatibility */ const ONLY_PRODUCTS = 1; const ONLY_DISCOUNTS = 2; const BOTH = 3; @@ -50,139 +48,126 @@ class MondialRelay extends Module const ONLY_SHIPPING = 5; const ONLY_WRAPPING = 6; const ONLY_PRODUCTS_WITHOUT_SHIPPING = 7; - - // SQL FILTER ORDER + + /* SQL FILTER ORDER */ const NO_FILTER = 0; const WITHOUT_HOME_DELIVERY = 1; + const MR_URL = 'http://www.mondialrelay.fr/'; + + /* Contains the details of the current shop used */ + public $account_shop = array( + 'MR_ENSEIGNE_WEBSERVICE' => '', + 'MR_CODE_MARQUE' => '', + 'MR_KEY_WEBSERVICE' => '', + 'MR_LANGUAGE' => '', + 'MR_WEIGHT_COEFFICIENT' => '', + 'MR_ORDER_STATE' => 3, + 'id_shop' => 1 + ); + + public $upgrade_detail = array(); + public function __construct() { $this->name = 'mondialrelay'; $this->tab = 'shipping_logistics'; - $this->version = '1.7.9'; + $this->version = '2.1.3'; + $this->installed_version = ''; + // $this->module_key = '366584e511d311cfaa899fc2d9ec1bd0'; + $this->author = 'PrestaShop'; parent::__construct(); - $this->page = basename(__FILE__, '.php'); $this->displayName = $this->l('Mondial Relay'); $this->description = $this->l('Deliver in Relay points'); - + + /** Backward compatibility */ + require(_PS_MODULE_DIR_.'/mondialrelay/backward_compatibility/backward.php'); + self::initModuleAccess(); - - // Call everytime to prevent the changement of the module by a recent one + + /* Call everytime to prevent the change of the module by a recent one */ $this->_updateProcess(); + $this->initAccount(); + + /* Check if it's a mondialrelay ajax query */ + $this->checkAJAX(); } - + public function install() { - global $cookie; - - $name = "shipping"; - $title = "Mondial Relay API"; + if (!function_exists('curl_version') || !extension_loaded('soap')) + { + $this->_errors[] = $this->l('Mondial Relay needs SOAP & cURL to be installed on your server.'); + return false; + } if (!parent::install()) return false; - Db::getInstance()->ExecuteS( - 'SELECT `name` - FROM `' . _DB_PREFIX_ . 'hook` - WHERE `name` = \''.$name.'\' - AND `title` = \''.$title.'\''); - - if (!Db::getInstance()->NumRows()) - Db::getInstance()->Execute('INSERT INTO ' . _DB_PREFIX_ . 'hook - (name, title, description, position) - VALUES(\''.$name.'\', \''.$title.'\', NULL, 0)'); - if (!$this->registerHookByVersion()) - return false; + return false; - if ((!file_exists(self::$modulePath.self::INSTALL_SQL_FILE)) || - (!$sql = file_get_contents(self::$modulePath.self::INSTALL_SQL_FILE))) + if ((!file_exists(MondialRelay::$modulePath.MondialRelay::INSTALL_SQL_FILE)) || + (!$sql = Tools::file_get_contents(MondialRelay::$modulePath.MondialRelay::INSTALL_SQL_FILE))) return false; $sql = str_replace('PREFIX_', _DB_PREFIX_, $sql); $sql = preg_split("/;\s*[\r\n]+/", $sql); - foreach($sql AS $k => $query) + foreach ($sql as $query) if (!empty($query)) - Db::getInstance()->Execute(trim($query)); + Db::getInstance()->execute(trim($query)); - $result = Db::getInstance()->getRow(' - SELECT id_tab - FROM `' . _DB_PREFIX_ . 'tab` - WHERE class_name="AdminMondialRelay"'); + // $result = Db::getInstance()->getRow(' + // SELECT id_tab + // FROM `'._DB_PREFIX_.'tab` + // WHERE class_name="AdminMondialRelay"'); - if (!$result) - { - // AdminOrders id_tab - $id_parent = 3; - - /*tab install */ - $result = Db::getInstance()->getRow(' - SELECT position - FROM `' . _DB_PREFIX_ . 'tab` - WHERE `id_parent` = '.(int)$id_parent.' - ORDER BY `'. _DB_PREFIX_ .'tab`.`position` DESC'); - - $pos = (isset($result['position'])) ? $result['position'] + 1 : 0; + // if (!$result) + // { + // $tab = new Tab(); + // $languages = Language::getLanguages(false); + // foreach ($languages as $language) + // $tab->name[$language['id_lang']] = 'Mondial Relay'; + // $tab->class_name = 'AdminMondialRelay'; + // $tab->module = 'mondialrelay'; + // $tab->id_parent = Tab::getIdFromClassName('AdminOrders'); - Db::getInstance()->Execute(' - INSERT INTO ' . _DB_PREFIX_ . 'tab - (id_parent, class_name, position, module) - VALUES('.(int)$id_parent.', "AdminMondialRelay", "'.(int)($pos).'", "mondialrelay")'); + // if (!$tab->add()) + // return false; - $id_tab = Db::getInstance()->Insert_ID(); - - $languages = Language::getLanguages(); - foreach ($languages as $language) - Db::getInstance()->Execute(' - INSERT INTO ' . _DB_PREFIX_ . 'tab_lang - (id_lang, id_tab, name) - VALUES("'.(int)($language['id_lang']).'", "'.(int)($id_tab).'", "Mondial Relay")'); + // if (is_dir(_PS_MODULE_DIR_.'mondialrelay/')) + // @copy(_PS_MODULE_DIR_.'mondialrelay/img/AdminMondialRelay.gif', _PS_IMG_DIR_.'/AdminMondialRelay.gif'); + // } - $profiles = Profile::getProfiles(Configuration::get('PS_LANG_DEFAULT')); - foreach ($profiles as $profile) - Db::getInstance()->Execute(' - INSERT INTO ' . _DB_PREFIX_ . 'access - (`id_profile`,`id_tab`,`view`,`add`,`edit`,`delete`) - VALUES('.$profile['id_profile'].', '.(int)($id_tab).', 1, 1, 1, 1)'); - - @copy(_PS_MODULE_DIR_.'mondialrelay/AdminMondialRelay.gif', _PS_IMG_DIR_.'/AdminMondialRelay.gif'); - } - - // If module isn't installed, set default value + /* If module isn't installed, set default value */ if (!Configuration::get('MONDIAL_RELAY')) { Configuration::updateValue('MONDIAL_RELAY', $this->version); - Configuration::updateValue('MONDIAL_RELAY_ORDER_STATE', 3); - Configuration::updateValue('MONDIAL_RELAY_SECURE_KEY', md5(time().rand(0,10))); - Configuration::updateValue('MR_GOOGLE_MAP', '1'); - Configuration::updateValue('MR_ENSEIGNE_WEBSERVICE', ''); - Configuration::updateValue('MR_CODE_MARQUE', ''); - Configuration::updateValue('MR_KEY_WEBSERVICE', ''); - Configuration::updateValue('MR_LANGUAGE', ''); - Configuration::updateValue('MR_WEIGHT_COEF', ''); + Configuration::updateValue('MONDIAL_RELAY_SECURE_KEY', md5( _COOKIE_KEY_.time())); + Configuration::updateValue('MONDIAL_RELAY_MODE', 'widget'); } - else + else { - // Reactive transport if database wasn't remove at the last uninstall - Db::getInstance()->Execute(' - UPDATE `'._DB_PREFIX_.'carrier` c, `'._DB_PREFIX_.'mr_method` m - SET `deleted` = 0 - WHERE c.id_carrier = m.id_carrier'); - if (Configuration::get('MONDIAL_RELAY') < $this->version) - ;// TODO : ADD upgrade process depending of the last and new version - } + $query = 'UPDATE `'._DB_PREFIX_.'carrier` c, `'._DB_PREFIX_.'mr_method` m + SET c.`deleted` = 0 + WHERE c.`id_carrier` = m.`id_carrier` + AND m.`is_deleted` = 0'; + + /* Reactive transport if database wasn't remove at the last uninstall */ + Db::getInstance()->execute($query); + } return true; } /* - ** Return the token depend of the type + ** Return the token depend of the type */ - static public function getToken($type = 'front') + public static function getToken($type = 'front') { - return ($type == 'front') ? self::$MRFrontToken : (($type == 'back') ? - self::$MRBackToken : NULL); + return ($type == 'front') ? MondialRelay::$MRFrontToken : (($type == 'back') ? + MondialRelay::$MRBackToken : null); } /* @@ -190,174 +175,118 @@ class MondialRelay extends Module */ private function registerHookByVersion() { - if (_PS_VERSION_ >= '1.3' && - (!$this->registerHook('shipping') || - !$this->registerHook('extraCarrier') || - !$this->registerHook('updateCarrier') || - !$this->registerHook('newOrder') || - !$this->registerHook('BackOfficeHeader'))) + if (version_compare(_PS_VERSION_, '1.3', '>=') && (!$this->registerHook('extraCarrier') || !$this->registerHook('updateCarrier') || !$this->registerHook('newOrder') || !$this->registerHook('BackOfficeHeader') || !$this->registerHook('header'))) return false; - - if (_PS_VERSION_ >= '1.4' && - (!$this->registerHook('processCarrier') || - !$this->registerHook('orderDetail') || - !$this->registerHook('orderDetailDisplayed') || - !$this->registerHook('paymentTop'))) + if (version_compare(_PS_VERSION_, '1.4', '>=') && (!$this->registerHook('processCarrier') || !$this->registerHook('orderDetailDisplayed'))) + return false; + if (version_compare(_PS_VERSION_, '1.6', '>=') && (!$this->registerHook('displayBackOfficeHeader'))) return false; return true; } - + public function uninstallCommonData() - { - // Tab uninstall - $result = Db::getInstance()->getRow(' - SELECT id_tab - FROM `' . _DB_PREFIX_ . 'tab` - WHERE class_name="AdminMondialRelay"'); - - if ($result) + { + /* Tab uninstall */ + if (($id_tab = Tab::getIdFromClassName('AdminMondialRelay'))) { - $id_tab = $result['id_tab']; - if (isset($id_tab) && !empty($id_tab)) - { - Db::getInstance()->Execute('DELETE FROM ' . _DB_PREFIX_ . 'tab WHERE id_tab = '.(int)($id_tab)); - Db::getInstance()->Execute('DELETE FROM ' . _DB_PREFIX_ . 'tab_lang WHERE id_tab = '.(int)($id_tab)); - Db::getInstance()->Execute('DELETE FROM ' . _DB_PREFIX_ . 'access WHERE id_tab = '.(int)($id_tab)); - } + $tab = new Tab($id_tab); + $tab->delete(); } - - if (_PS_VERSION_ >= '1.4' && - !Db::getInstance()->Execute(' - UPDATE '._DB_PREFIX_ .'carrier - SET `active` = 0, `deleted` = 1 - WHERE `external_module_name` = "mondialrelay"')) - return false; - else if (!Db::getInstance()->Execute(' - UPDATE '._DB_PREFIX_ .'carrier - SET `active` = 0, `deleted` = 1 - WHERE `name` = "mondialrelay"')) + + if (!Db::getInstance()->execute(' + UPDATE '._DB_PREFIX_.'carrier c, '._DB_PREFIX_.'mr_method m + SET c.`deleted` = 1 + WHERE c.`id_carrier` = m.`id_carrier`')) return false; + return true; } - + public function uninstall() { if (!parent::uninstall()) return false; - - // Uninstall data that doesn't need to be keep + + /* Uninstall data that doesn't need to be keep */ if (!$this->uninstallCommonData()) return false; - + if (Tools::getValue('keepDatabase')) - { - // Retro Compatibility for older Version than 1.7 - if (Configuration::get('MONDIAL_RELAY_1_4')) - { - Configuration::updateValue('MONDIAL_RELAY', '1.6'); - Configuration::deleteByName('MONDIAL_RELAY_1_4'); - Configuration::deleteByName('MONDIAL_RELAY_INSTALL_UPDATE_1'); - } return true; + + Configuration::deleteByName('MR_ACCOUNT_DETAIL'); + + /* Drop databases */ + if (!Db::getInstance()->execute(' + DROP TABLE + '._DB_PREFIX_.'mr_history, + '._DB_PREFIX_.'mr_method, + '._DB_PREFIX_.'mr_selected, + '._DB_PREFIX_.'mr_method_shop')) + { + /* If drop failed, try to turn off the carriers */ + Db::getInstance()->execute(' + UPDATE '._DB_PREFIX_.'carrier c, '._DB_PREFIX_.'mr_method m + SET c.`deleted` = 1 + WHERE c.`id_carrier` = m.`id_carrier`'); + return false; } - - // MondialRelay Configuration - if (!Configuration::deleteByName('MONDIAL_RELAY') || - !Configuration::deleteByName('MONDIAL_RELAY_INSTALL_UPDATE') || - !Configuration::deleteByName('MONDIAL_RELAY_SECURE_KEY') || - !Configuration::deleteByName('MONDIAL_RELAY_ORDER_STATE') || - !Configuration::deleteByName('MR_GOOGLE_MAP') || - !Configuration::deleteByName('MR_ENSEIGNE_WEBSERVICE') || - !Configuration::deleteByName('MR_CODE_MARQUE') || - !Configuration::deleteByName('MR_KEY_WEBSERVICE') || - !Configuration::deleteByName('MR_WEIGHT_COEF')) - return false; - - // Drop databases - if (!Db::getInstance()->Execute(' - DROP TABLE - '._DB_PREFIX_ .'mr_historique, - '._DB_PREFIX_ .'mr_method, - '._DB_PREFIX_ .'mr_selected')) - return false; - elseif (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'carrier SET `active` = 0, `deleted` = 1 WHERE `name` = "mondialrelay"')) - return false; - return true; } - + + /** + * Launch upgrade process for 1.3 and 1.4 + */ + public function runUpgrade() + { + /* List of upgraded version existing */ + $files_version = array('1.8.0', '1.8.3', '2.0.6'); + + $upgrade_path = dirname(__FILE__).'/upgrade/'; + + if (version_compare(_PS_VERSION_, '1.5', '<')) + { + foreach ($files_version as $version) + { + $file = $upgrade_path.'install-'.$version.'.php'; + if ($this->installed_version < $version && file_exists($file)) + { + include_once($file); + call_user_func('upgrade_module_'.str_replace('.', '_', $version), $this); + } + } + } + } + /* - ** UpdateProcess if merchant update the module without a + ** UpdateProcess if merchant update the module without a ** normal installation */ private function _updateProcess() { if (Module::isInstalled('mondialrelay') && - (($installedVersion = Configuration::get('MONDIAL_RELAY')) || - $installedVersion = Configuration::get('MONDIAL_RELAY_1_4')) - && $installedVersion < $this->version) - { - if ($installedVersion < '1.4') - $this->_update_v1_4(); - if ($installedVersion < '1.4.2') - $this->_update_v1_4_2(); - } - - // Process update done just try to update the new configuration value - if (Configuration::get('MONDIAL_RELAY_1_4')) - { - Configuration::updateValue('MONDIAL_RELAY', $this->version); - Configuration::deleteByName('MONDIAL_RELAY_1_4'); - } + (($this->installed_version = Configuration::get('MONDIAL_RELAY')) || + $this->installed_version = Configuration::get('MONDIAL_RELAY_1_4')) + && $this->installed_version < $this->version) + $this->runUpgrade(); } - - /* - ** Use if the mechant was using Prestashop 1.3 and - ** now use 1.4 or more recent - */ - private function _update_v1_4() - { - Db::getInstance()->Execute(' - UPDATE `'._DB_PREFIX_.'carrier` - SET - `shipping_external` = 0, - `need_range` = 1, - `external_module_name` = - "mondialrelay", - `shipping_method` = 1 - WHERE `id_carrier` - IN (SELECT `id_carrier` - FROM `'._DB_PREFIX_.'mr_method`)'); - } - - /* - ** Add new Hook for the last recent version >= 1.4.2 - */ - private function _update_v1_4_2() - { - if (!$this->isRegisteredInHook('newOrder')) - $this->registerHook('newOrder'); - if (!$this->isRegisteredInHook('BackOfficeHeader')) - $this->registerHook('BackOfficeHeader'); - } - + /* ** Get the content to ask for a backup of the database - */ + */ private function askForBackup($href) { - return 'targetButton = \''.$href.'\'; - PS_MRGetUninstallDetail();'; + return 'return PS_MRObject.uninstall(\''.$href.'\');'; } - + /* ** OnClick for input fields under the module list fields action */ public function onclickOption($type, $href = false) { $content = ''; - - switch($type) + + switch ($type) { case 'desactive': break; @@ -372,882 +301,919 @@ class MondialRelay extends Module } return $content; } - + + /** + * Init the account_shop variable with the account detail for this shop + */ + public function initAccount() + { + /* Get default value */ + $id_order_state = $this->account_shop['MR_ORDER_STATE']; + + if (($account_shop_stored = MondialRelay::getAccountDetail())) + $this->account_shop = $account_shop_stored; + + /* Normally, this can't happen... */ + if (empty($this->account_shop['MR_ORDER_STATE'])) + $this->account_shop['MR_ORDER_STATE'] = $id_order_state; + } + /* ** Init the access directory module for URL and file system ** Allow a compatibility for Presta < 1.4 */ public static function initModuleAccess() { - self::$modulePath = _PS_MODULE_DIR_. 'mondialrelay/'; - self::$MRFrontToken = sha1('mr'._COOKIE_KEY_.'Front'); - self::$MRBackToken = sha1('mr'._COOKIE_KEY_.'Back'); - - $protocol = (Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS']) - && strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://'; - - $endURL = __PS_BASE_URI__.'modules/mondialrelay/'; - - if (method_exists('Tools', 'getShopDomainSsl')) - self::$moduleURL = $protocol.Tools::getShopDomainSsl().$endURL; - else - self::$moduleURL = $protocol.$_SERVER['HTTP_HOST'].$endURL; + MondialRelay::$modulePath = _PS_MODULE_DIR_.'mondialrelay/'; + MondialRelay::$MRFrontToken = sha1('mr'._COOKIE_KEY_.'Front'); + MondialRelay::$MRBackToken = sha1('mr'._COOKIE_KEY_.'Back'); + MondialRelay::$moduleURL = __PS_BASE_URI__.'modules/mondialrelay/'; } - - /* - ** Override a jQuery version included by another one us. - ** Allow a compatibility for Presta < 1.4 - */ - public static function getJqueryCompatibility($overloadCurrent = false) + + public function fetchTemplate($path, $name) { - // Store the last inclusion into a variable and include the new one - if ($overloadCurrent) - return ' - - '; - - return ' - - '; + if (version_compare(_PS_VERSION_, '1.4', '<')) + $this->context->smarty->currentTemplate = $name; + if (file_exists(_PS_THEME_DIR_ . 'modules/' . $this->name . $path . $name . '.tpl')) + return $this->context->smarty->fetch(_PS_THEME_DIR_ . 'modules/' . $this->name . $path . $name . '.tpl'); + return $this->context->smarty->fetch(dirname(__FILE__) . $path . $name . '.tpl'); } - + public function hookNewOrder($params) { - DB::getInstance()->Execute(' - UPDATE `'._DB_PREFIX_.'mr_selected` - SET `id_order` = '.(int)$params['order']->id.' - WHERE `id_cart` = '.(int)$params['cart']->id); + if (!MondialRelay::isMondialRelayCarrier($params['cart']->id_carrier)) + return; + + $order = $params['order']; + $currency = $params['currency']; + $id_lang = (int)$order->id_lang; + $customer = new Customer($order->id_customer); + $carrier = new Carrier($order->id_carrier); + $invoice = new Address((int)($order->id_address_invoice)); + $invoice_state = $invoice->id_state ? new State($invoice->id_state) : false; + if (version_compare(_PS_VERSION_, '1.5', '<')) + $order_date_text = Tools::displayDate($order->date_add, (int)($id_lang)); + else + $order_date_text = Tools::displayDate($order->date_add, null); + + DB::getInstance()->execute(' + UPDATE `'._DB_PREFIX_.'mr_selected` + SET `id_order` = '.(int)$order->id.' + WHERE `id_cart` = '.(int)$params['cart']->id); + + /*============================================ + // GET MR INFOS + //============================================*/ + $sql = 'SELECT * FROM `'._DB_PREFIX_.'mr_selected` WHERE `id_cart` = '.(int)$params['cart']->id.' AND `id_order` = '.(int)$order->id.''; + $mr_point = DB::getInstance()->getRow($sql); + + if (!$mr_point['MR_Selected_Num']) return false; + + return; + + /*============================================ + // SEND MAIL + //============================================*/ + $template = 'mr_new_order'; + $subject = $this->l('New order', false, (int)$id_lang).' - '.sprintf('%06d', $order->id); + + $mr_address = ''; + if ($mr_point['MR_Selected_LgAdr2']) + $mr_address .= $mr_point['MR_Selected_LgAdr2'].''; + if ($mr_point['MR_Selected_LgAdr3']) + $mr_address .= $mr_point['MR_Selected_LgAdr3'].''; + if ($mr_point['MR_Selected_LgAdr4']) + $mr_address .= $mr_point['MR_Selected_LgAdr4'].''; + + $templateVars = array( + '{firstname}' => $customer->firstname, + '{lastname}' => $customer->lastname, + '{email}' => $customer->email, + '{delivery_company}' => $mr_point['MR_Selected_LgAdr1'], + '{delivery_address1}' => $mr_address, + '{delivery_city}' => $mr_point['MR_Selected_Ville'], + '{delivery_postal_code}' => $mr_point['MR_Selected_CP'], + '{delivery_country}' => $mr_point['MR_Selected_Pays'], + '{invoice_company}' => $invoice->company, + '{invoice_firstname}' => $invoice->firstname, + '{invoice_lastname}' => $invoice->lastname, + '{invoice_address2}' => $invoice->address2, + '{invoice_address1}' => $invoice->address1, + '{invoice_city}' => $invoice->city, + '{invoice_postal_code}' => $invoice->postcode, + '{invoice_country}' => $invoice->country, + '{invoice_state}' => $invoice->id_state ? $invoice_state->name : '', + '{invoice_phone}' => $invoice->phone, + '{invoice_other}' => $invoice->other, + '{order_name}' => sprintf('%06d', $order->id), + '{shop_name}' => Configuration::get('PS_SHOP_NAME'), + '{date}' => $order_date_text, + '{carrier}' => (($carrier->name == '0') ? Configuration::get('PS_SHOP_NAME') : $carrier->name), + '{payment}' => Tools::substr($order->payment, 0, 32), + '{currency}' => $currency->sign, + ); + + $iso = Language::getIsoById((int)$id_lang); + if (file_exists(dirname(__FILE__).'/mails/'.$iso.'/'.$template.'.txt') && file_exists(dirname(__FILE__).'/mails/'.$iso.'/'.$template.'.html')) + Mail::Send((int)$id_lang, $template, $subject, $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname, Configuration::get('PS_SHOP_EMAIL'), Configuration::get('PS_SHOP_NAME'), null, null, dirname(__FILE__).'/mails/'); } - + public function hookBackOfficeHeader() { - $cssFilePath = $this->_path.'style.css'; - $jsFilePath = $this->_path.'mondialrelay.js'; + if (Tools::getValue('tab') == 'AdminMondialRelay' || Tools::getValue('module_name') == 'mondialrelay' || Tools::strtolower(Tools::getValue('controller')) == 'adminmondialrelay' || Tools::getValue('configure') == 'mondialrelay') + { + $this->context->smarty->assign(array( + 'MR_token' => MondialRelay::$MRBackToken, 'MR_local_path' => MondialRelay::$modulePath, + 'MR_account_set' => MondialRelay::isAccountSet(), 'new_base_dir' => MondialRelay::$moduleURL)); - $ret = ''; - - if (Tools::getValue('tab') == 'AdminMondialRelay') - $ret .= self::getJqueryCompatibility(true); - - $ret .= ' - - '; - return $ret; - } - - private function _postValidation() - { - if (Tools::isSubmit('submitMR')) - { - if (Tools::getValue('mr_Enseigne_WebService') != '' AND !preg_match("#^[0-9A-Z]{2}[0-9A-Z ]{6}$#", Tools::getValue('mr_Enseigne_WebService'))) - $this->_postErrors[] = $this->l('Invalid Shop'); - if (Tools::getValue('mr_code_marque') != '' AND !preg_match("#^[0-9]{2}$#", Tools::getValue('mr_code_marque'))) - $this->_postErrors[] = $this->l('Invalid Mark code'); - if (Tools::getValue('mr_Key_WebService') != '' AND !preg_match("#^[0-9A-Za-z_\'., /\-]{2,32}$#", Tools::getValue('mr_Key_WebService'))) - $this->_postErrors[] = $this->l('Invalid Webservice Key'); - if (Tools::getValue('mr_Langage') != '' AND !preg_match("#^[A-Z]{2}$#", Tools::getValue('mr_Langage'))) - $this->_postErrors[] = $this->l('Invalid Language'); - if (!Tools::getValue('mr_weight_coef') OR !Validate::isInt(Tools::getValue('mr_weight_coef'))) - $this->_postErrors[] = $this->l('Invalid Weight Coefficient'); + return $this->fetchTemplate('/views/templates/admin/', 'bo-header'); } - elseif (Tools::isSubmit('submitMethod')) - { - if (Configuration::get('MR_ENSEIGNE_WEBSERVICE') == '' OR Configuration::get('MR_CODE_MARQUE') == '' OR - Configuration::get('MR_KEY_WEBSERVICE') == '' OR Configuration::get('MR_LANGUAGE') == '') - $this->_postErrors[] = $this->l('Please configure your Mondial Relay account settings before creating a carrier.'); - if (!preg_match("#^[0-9A-Za-z_\'., /\-]{2,32}$#", Tools::getValue('mr_Name'))) - $this->_postErrors[] = $this->l('Invalid carrier name'); - if (Tools::getValue('mr_ModeCol') != 'CCC') - $this->_postErrors[] = $this->l('Invalid Col mode'); - if (!preg_match("#^REL|24R|ESP|DRI|LDS|LDR|LD1$#", Tools::getValue('mr_ModeLiv'))) - $this->_postErrors[] = $this->l('Invalid delivery mode'); - if (!Validate::isInt(Tools::getValue('mr_ModeAss')) OR Tools::getValue('mr_ModeAss') > 5 OR Tools::getValue('mr_ModeAss') < 0) - $this->_postErrors[] = $this->l('Invalid Assurance mode'); - if (!Tools::getValue('mr_Pays_list')) - $this->_postErrors[] = $this->l('You must choose at least one delivery country.'); - } - elseif (Tools::isSubmit('submit_order_state')) - { - if (!Validate::isBool(Tools::getValue('mr_google_key'))) - $this->_postErrors[] = $this->l('Invalid google key'); - if (!Validate::isUnsignedInt(Tools::getValue('id_order_state'))) - $this->_postErrors[] = $this->l('Invalid order state'); - } - /* - elseif (Tools::isSubmit('PS_MRSubmitFieldPersonalization')) - { - $addr1 = Tools::getValue('Expe_ad1'); - if (!preg_match('#^[0-9A-Z_\-\'., /]{2,32}$#', strtoupper($addr1), $match)) - $this->_postErrors[] = $this->l('The Main address submited hasn\'t a good format'); - }*/ } - private function _postProcess() - { - foreach($_POST AS $key => $value) - { - $setArray[] = $value; - $keyArray[] = pSQL($key); - } - array_pop($setArray); - array_pop($keyArray); - - if (isset($_POST['submitMR']) AND $_POST['submitMR']) - self::mrUpdate('settings', $setArray, $keyArray); - elseif (isset($_POST['submitShipping']) AND $_POST['submitShipping']) - self::mrUpdate('shipping', $_POST, array()); - /*elseif (Tools::getValue('PS_MRSubmitFieldPersonalization')) - $this->updateFieldsPersonalization();*/ - elseif (isset($_POST['submitMethod']) AND $_POST['submitMethod']) - self::mrUpdate('addShipping', $setArray, $keyArray); - elseif (isset($_POST['submit_order_state']) AND $_POST['submit_order_state']) - { - Configuration::updateValue('MONDIAL_RELAY_ORDER_STATE', Tools::getValue('id_order_state')); - Configuration::updateValue('MR_GOOGLE_MAP', Tools::getValue('mr_google_key')); - $this->_html .= '
    '.$this->l('Settings updated').'
    '; - } - } - - public function hookOrderDetail($params) - { - global $smarty; - - $carrier = $params['carrier']; - $order = $params['order']; - - if ($carrier->is_module AND $order->shipping_number) - { - $module = $carrier->external_module_name; - include_once(_PS_MODULE_DIR_.$module.'/'.$module.'.php'); - $module_carrier = new $module(); - $smarty->assign('followup', $module_carrier->get_followup($order->shipping_number)); - } - elseif ($carrier->url AND $order->shipping_number) - $smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url)); - } - public function hookOrderDetailDisplayed($params) { - global $smarty; - - $res = Db::getInstance()->getRow(' - SELECT s.`MR_Selected_LgAdr1`, s.`MR_Selected_LgAdr2`, s.`MR_Selected_LgAdr3`, s.`MR_Selected_LgAdr4`, s.`MR_Selected_CP`, s.`MR_Selected_Ville`, s.`MR_Selected_Pays`, s.`MR_Selected_Num`, s.`url_suivi` - FROM `'._DB_PREFIX_.'mr_selected` s - WHERE s.`id_cart` = '.$params['order']->id_cart); - if ((!$res) OR ($res['MR_Selected_Num'] == 'LD1') OR ($res['MR_Selected_Num'] == 'LDS')) - return ''; - $smarty->assign('mr_addr', $res['MR_Selected_LgAdr1'].($res['MR_Selected_LgAdr1'] ? ' - ' : '').$res['MR_Selected_LgAdr2'].($res['MR_Selected_LgAdr2'] ? ' - ' : '').$res['MR_Selected_LgAdr3'].($res['MR_Selected_LgAdr3'] ? ' - ' : '').$res['MR_Selected_LgAdr4'].($res['MR_Selected_LgAdr4'] ? ' - ' : '').$res['MR_Selected_CP'].' '.$res['MR_Selected_Ville'].' - '.$res['MR_Selected_Pays']); - $smarty->assign('mr_url', $res['url_suivi']); - return $this->display(__FILE__, 'orderDetail.tpl'); + if (!Mondialrelay::isMondialRelayCarrier($params['order']->id_carrier)) + return; + + $sql = ' + SELECT s.`MR_Selected_LgAdr1`, s.`MR_Selected_LgAdr2`, s.`MR_Selected_LgAdr3`, s.`MR_Selected_LgAdr4`, + s.`MR_Selected_CP`, s.`MR_Selected_Ville`, s.`MR_Selected_Pays`, s.`MR_Selected_Num`, s.`url_suivi`, s.`exp_number`, m.dlv_mode + FROM `'._DB_PREFIX_.'mr_selected` s + INNER JOIN '._DB_PREFIX_.'mr_method m ON m.id_mr_method = s.id_method + WHERE s.`id_cart` = '.(int)$params['order']->id_cart; + $res = Db::getInstance()->getRow($sql); + + if (!$res) + return; + + $point_relais = $res['MR_Selected_LgAdr1']. + ($res['MR_Selected_LgAdr1'] ? '
    ' : '').$res['MR_Selected_LgAdr2']. + ($res['MR_Selected_LgAdr2'] ? '
    ' : '').$res['MR_Selected_LgAdr3']. + ($res['MR_Selected_LgAdr3'] ? '
    ' : '').$res['MR_Selected_LgAdr4']. + ($res['MR_Selected_LgAdr4'] ? '
    ' : '').$res['MR_Selected_CP'].' '. + $res['MR_Selected_Ville'].'
    '.$res['MR_Selected_Pays']; + + + if (($res['dlv_mode'] == 'LD1') || ($res['dlv_mode'] == 'LDS') || ($res['dlv_mode'] == 'HOM')) + $this->context->smarty->assign( + array( + 'mr_url' => $res['url_suivi'] + )); + else + $this->context->smarty->assign( + array( + 'mr_addr' => $point_relais, + 'mr_url' => $res['url_suivi'] + )); + + return $this->fetchTemplate('/views/templates/front/', 'order_detail'); } - - /* - ** No need anymore - */ - public function hookProcessCarrier($params) - { - } - + /* ** Update the carrier id to use the new one if changed - */ + */ public function hookupdateCarrier($params) { - if ((int)($params['id_carrier']) != (int)($params['carrier']->id)) + if ($params['id_carrier'] != $params['carrier']->id) { - Db::getInstance()->Execute(' + /* Get the old id_mr_method */ + $id_mr_method = Db::getInstance()->getValue(' + SELECT id_mr_method FROM `'._DB_PREFIX_.'mr_method` + WHERE id_carrier='.(int)$params['id_carrier']); + + /* Insert new entry keeping the last one linked to the id_carrier */ + $query = ' INSERT INTO `'._DB_PREFIX_.'mr_method` - (mr_Name, mr_Pays_list, mr_ModeCol, mr_ModeLiv, mr_ModeAss, id_carrier) + (name, country_list, col_mode, dlv_mode, insurance, id_carrier) ( - SELECT - mr_Name, - mr_Pays_list, - mr_ModeCol, - mr_ModeLiv, - mr_ModeAss, - "'.(int)$params['carrier']->id.'" - FROM `'._DB_PREFIX_.'mr_method` - WHERE id_carrier ='.(int)$params['id_carrier'].')'); - } + SELECT + "'.pSQL($params['carrier']->name).'", + country_list, + col_mode, + dlv_mode, + insurance, + '.(int)$params['carrier']->id.' + FROM `'._DB_PREFIX_.'mr_method` + WHERE id_carrier ='.(int)$params['id_carrier'].')'; + Db::getInstance()->execute($query); + + /* Do the same process for the multishop table */ + $query = ' + INSERT INTO `'._DB_PREFIX_.'mr_method_shop` + (id_mr_method, id_shop) + ( + SELECT + '.(int)Db::getInstance()->INSERT_ID().', + id_shop + FROM `'._DB_PREFIX_.'mr_method_shop` + WHERE id_mr_method ='.(int)$id_mr_method.')'; + Db::getInstance()->execute($query); + + /* Set the last mr_method to delete */ + Db::getInstance()->execute(' + UPDATE `'._DB_PREFIX_.'mr_method` SET `is_deleted` = 1 + WHERE `id_mr_method` = '.(int)$id_mr_method); + } } - - /* - ** Get a carrier list liable to the module - */ + + /** + * Get a carrier list liable to the module + * + * @return array + */ public function _getCarriers() { - global $cookie; - - $id_lang = (int)$cookie->id_lang; - - // Query don't use the external_module_name to keep the - // 1.3 compatibility - $carriers = Db::getInstance()->ExecuteS(' - SELECT - c.id_carrier, - c.range_behavior, - m.id_mr_method, - m.mr_ModeLiv, - cl.delay + /* Query don't use the external_module_name to keep the */ + /* 1.3 compatibility */ + $query = ' + SELECT c.id_carrier, c.range_behavior, m.id_mr_method, + m.dlv_mode, cl.delay FROM `'._DB_PREFIX_.'mr_method` m - LEFT JOIN `'._DB_PREFIX_.'carrier` c + LEFT JOIN `'._DB_PREFIX_.'carrier` c ON c.`id_carrier` = m.`id_carrier` - LEFT JOIN `'._DB_PREFIX_.'carrier_lang` cl + LEFT JOIN `'._DB_PREFIX_.'carrier_lang` cl ON c.`id_carrier` = cl.`id_carrier` + LEFT JOIN `'._DB_PREFIX_.'mr_method_shop` ms + ON m.`id_mr_method` = ms.`id_mr_method` WHERE c.`deleted` = 0 - AND c.active = 1'); - + AND ms.`id_shop` = '.$this->account_shop['id_shop'].' + AND cl.id_lang = '.$this->context->language->id.' + AND c.`active` = 1 + AND m.`is_deleted` = 0'; + + $carriers = Db::getInstance()->executeS($query); + if (!is_array($carriers)) $carriers = array(); return $carriers; } - - public function hookextraCarrier($params) - { - global $smarty, $cart, $cookie, $defaultCountry, $nbcarriers; - if (Configuration::get('MR_ENSEIGNE_WEBSERVICE') == '' || - Configuration::get('MR_CODE_MARQUE') == '' || - Configuration::get('MR_KEY_WEBSERVICE') == '' || - Configuration::get('MR_LANGUAGE') == '') + /** + * Get a specific method entry detail by a defined id_carrier + * + * @static + * @param $id_carrier + * @return array + */ + public static function getMethodByIdCarrier($id_carrier) + { + return Db::getInstance()->getRow(' + SELECT * FROM `'._DB_PREFIX_.'mr_method` m + WHERE m.`id_carrier` = '.(int)$id_carrier); + } + + /* + ** Added to be used properly with OPC + */ + public function hookHeader($params) + { + if (version_compare(_PS_VERSION_, '1.5', '>=')) + $this->context->controller->addJquery(); + + /*Configuration::updateValue('MONDIAL_RELAY_MODE', 'widget');*/ + if (!($file = basename(Tools::getValue('controller')))) + $file = str_replace('.php', '', basename($_SERVER['SCRIPT_NAME'])); + + if (in_array($file, array('order-opc', 'order', 'orderopc'))) + { + + $mr_valid_steps = array(2,3); + if (Tools::display_cart_v2()){ + $mr_valid_steps = array(1,2,3); + } + + if (!Tools::getValue('step') || + !in_array((int) Tools::getValue('step'), $mr_valid_steps)) + return ''; + + // CHECK MR_SELECTED + if ((int) Tools::getValue('step') == 3){ + global $cookie, $cart; + if (isset($cart->id_carrier) && $this->isMondialRelayCarrier($cart->id_carrier)){ + $mr_selected = Db::getInstance()->getRow('SELECT * FROM `' . _DB_PREFIX_ . 'mr_selected` WHERE `id_cart` = ' . (int) $cart->id); + if (!$mr_selected || !$mr_selected['MR_Selected_Num']){ + if (Tools::display_cart_v2()) + Tools::redirect('order.php?step=1&no_mr_selected=1'); + else + Tools::redirect('order.php?step=2&no_mr_selected=1'); + } + } + return ''; + } + + if (Tools::display_cart_v2()){ + if (!in_array((int) Tools::getValue('step'), array(1,2))) + return ''; + } + else{ + if ((int) Tools::getValue('step') != 2) + return ''; + } + + + // if (!Tools::getValue('id_address_delivery') || + // !Tools::getValue('step') || + // Tools::getValue('step') != 2) + // return ''; + + $this->context->smarty->assign(array( + 'one_page_checkout' => (Configuration::get('PS_ORDER_PROCESS_TYPE') ? Configuration::get('PS_ORDER_PROCESS_TYPE') : 0), + 'new_base_dir' => MondialRelay::$moduleURL, + 'MR_local_path' => MondialRelay::$modulePath, + 'MRToken' => MondialRelay::$MRFrontToken, + 'MR_MONDIAL_RELAY_MODE' => Configuration::get('MONDIAL_RELAY_MODE'), + ) + ); + + if($this->canAddJSViaController()) + $this->context->controller->addJS('https://maps.google.com/maps/api/js'); + else + $this->context->smarty->assign(array( + 'addJsInTemplate' => true + )); + + if (Tools::display_cart_v2()){ + return $this->fetchTemplate('/views/templates/front/', 'header_widget'); + } + + if (Configuration::get('MONDIAL_RELAY_MODE') == 'widget' && !_PS_MOBILE_) + return $this->fetchTemplate('/views/templates/front/', 'header_widget'); + else + return $this->fetchTemplate('/views/templates/front/', 'header'); + } + return ''; + } + + private function canAddJSViaController() + { + if(version_compare(_PS_VERSION_, '1.6', '>=')) + return true; + + if(Configuration::get('PS_JS_THEME_CACHE')) + return false; + + return true; + } + + public function hookExtraCarrier($params) + { + /* TODO : Makes it work with multi-shipping */ + if (!MondialRelay::isAccountSet()) return ''; - $address = new Address((int)($cart->id_address_delivery)); + $id_carrier = false; + $preSelectedRelay = $this->getRelayPointSelected($this->context->cart->id); + $carriersList = MondialRelay::_getCarriers(); + $address = new Address($this->context->cart->id_address_delivery); + $country = new Country($address->id_country); $id_zone = Address::getZoneById((int)($address->id)); - $carriersList = self::_getCarriers(); - - // Check if the defined carrier are ok + + /* Check if the defined carrier are ok */ foreach ($carriersList as $k => $row) { + /* For now works only with single shipping (>= 1.5 compatibility) */ + if (method_exists($this->context->cart, 'carrierIsSelected')) + { + if ($this->context->cart->carrierIsSelected($row['id_carrier'], $params['address']->id)) + $id_carrier = $row['id_carrier']; + } + + /* Temporary carrier for some test */ $carrier = new Carrier((int)($row['id_carrier'])); - if ((Configuration::get('PS_SHIPPING_METHOD') AND $carrier->getMaxDeliveryPriceByWeight($id_zone) === false) || - (!Configuration::get('PS_SHIPPING_METHOD') AND $carrier->getMaxDeliveryPriceByPrice($id_zone) === false)) + if ((($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT) && $carrier->getMaxDeliveryPriceByWeight($id_zone) === false) || (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE) && $carrier->getMaxDeliveryPriceByPrice($id_zone) === false)) unset($carriersList[$k]); else if ($row['range_behavior']) { - // Get id zone - $id_zone = (isset($cart->id_address_delivery) AND $cart->id_address_delivery) ? - Address::getZoneById((int)($cart->id_address_delivery)) : - (int)$defaultCountry->id_zone; - if ((Configuration::get('PS_SHIPPING_METHOD') AND (!Carrier::checkDeliveryPriceByWeight($row['id_carrier'], $cart->getTotalWeight(), $id_zone))) OR - (!Configuration::get('PS_SHIPPING_METHOD') AND (!Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $cart->getOrderTotal(true, self::BOTH_WITHOUT_SHIPPING), $id_zone, $cart->id_currency)))) - unset($carriersList[$k]); + /* Get id zone */ + $id_zone = (isset($this->context->cart->id_address_delivery) && $this->context->cart->id_address_delivery) ? + Address::getZoneById((int)$this->context->cart->id_address_delivery) : + (int)$this->context->country->id_zone; + + if (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT && (!Carrier::checkDeliveryPriceByWeight($row['id_carrier'], $this->context->cart->getTotalWeight(), $id_zone))) || + ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE && + (!Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $this->context->cart->getOrderTotal(true, MondialRelay::BOTH_WITHOUT_SHIPPING), $id_zone, $this->context->cart->id_currency) || + !Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $this->context->cart->getOrderTotal(true, MondialRelay::BOTH_WITHOUT_SHIPPING), $id_zone, $this->context->cart->id_currency)))) + unset($carriersList[$k]); } - } - - $preSelectedRelay = $this->getRelayPointSelected($params['cart']->id); - $smarty->assign(array( - 'one_page_checkout' => (Configuration::get('PS_ORDER_PROCESS_TYPE') ? Configuration::get('PS_ORDER_PROCESS_TYPE') : 0), - 'new_base_dir' => self::$moduleURL, - 'MRToken' => self::$MRFrontToken, - 'carriersextra' => $carriersList, - 'preSelectedRelay' => isset($preSelectedRelay['MR_selected_num']) ? $preSelectedRelay['MR_selected_num'] : '', - 'jQueryOverload' => self::getJqueryCompatibility(false))); - - return $this->display(__FILE__, 'mondialrelay.tpl'); + } + + $carrier = null; + if ($id_carrier && ($method = MondialRelay::getMethodByIdCarrier($id_carrier))) + { + $carrier = new Carrier((int)$id_carrier); + /* Add dynamically a new field */ + $carrier->id_mr_method = $method['id_mr_method']; + $carrier->mr_dlv_mode = $method['dlv_mode']; + } + + if (Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS']) && Tools::strtolower($_SERVER['HTTPS']) != 'off')) + $ssl = 'true'; + else $ssl = 'false'; + + $this->context->smarty->assign(array( + 'address' => $address, + 'account_shop' => $this->account_shop, + 'country' => $country, + 'ssl' => $ssl, + 'MR_Data'=> MRTools::jsonEncode(array( + 'carrier_list' => $carriersList, + 'carrier' => $carrier, + 'PS_VERSION' => _PS_VERSION_, + 'pre_selected_relay' => isset($preSelectedRelay['MR_selected_num']) ? $preSelectedRelay['MR_selected_num'] : -1, + )) + )); + if (Tools::display_cart_v2()){ + return $this->fetchTemplate('/views/templates/front/', 'checkout_process_widget'); + } + if (Configuration::get('MONDIAL_RELAY_MODE') == 'widget' && !_PS_MOBILE_) + return $this->fetchTemplate('/views/templates/front/', 'checkout_process_widget'); + else + return $this->fetchTemplate('/views/templates/front/', 'checkout_process'); } - + + /** + * Return the detailed account + * + * @static + * @return mixed + */ + public static function getAccountDetail() + { + return unserialize((string)Configuration::get('MR_ACCOUNT_DETAIL')); + } + + /** + * Check if the account is set + * + * @static + * @return bool + */ + public static function isAccountSet() + { + $details = MondialRelay::getAccountDetail(); + + if (!$details || !count($details)) + return false; + + foreach ($details as $value) + if (empty($value)) + return false; + + return true; + } + + /** + * Check any submitted form + */ + private function _postValidation() + { + if (Tools::isSubmit('submit_account_detail')) + { + if (Tools::getValue('MR_enseigne_webservice') == '' || !preg_match('#^[0-9A-Z]{2}[0-9A-Z ]{6}$#', Tools::getValue('MR_enseigne_webservice'))) + $this->_postErrors[] = $this->l('Invalid Enseigne'); + if (Tools::getValue('MR_code_marque') == '' || !preg_match('#^[0-9]{2}$#', Tools::getValue('MR_code_marque'))) + $this->_postErrors[] = $this->l('Invalid Mark code'); + if (Tools::getValue('MR_webservice_key') == '' || !preg_match("#^[0-9A-Za-z_\'., /\-]{2,32}$#", Tools::getValue('MR_webservice_key'))) + $this->_postErrors[] = $this->l('Invalid Webservice Key'); + if (Tools::getValue('MR_language') == '' || !preg_match('#^[A-Z]{2}$#', Tools::getValue('MR_language'))) + $this->_postErrors[] = $this->l('Invalid Language'); + if (!Tools::getValue('MR_weight_coefficient') || !Validate::isInt(Tools::getValue('MR_weight_coefficient'))) + $this->_postErrors[] = $this->l('Invalid Weight Coefficient'); + } + + /* Shipping form validation */ + else if (Tools::isSubmit('submitMethod')) + { + if (!preg_match("#^[0-9A-Za-z_\'., /\-]{2,32}$#", Tools::getValue('mr_Name'))) + $this->_postErrors[] = $this->l('Invalid carrier name'); + if (Tools::getValue('mr_ModeCol') != 'CCC') + $this->_postErrors[] = $this->l('Invalid Col mode'); + if (!preg_match('#^REL|24R|ESP|DRI|LDS|LDR|LD1|HOM$#', Tools::getValue('mr_ModeLiv'))) + $this->_postErrors[] = $this->l('Invalid delivery mode'); + if (!Validate::isInt(Tools::getValue('mr_ModeAss')) || Tools::getValue('mr_ModeAss') > 5 || Tools::getValue('mr_ModeAss') < 0) + $this->_postErrors[] = $this->l('Invalid Assurance mode'); + if (!Tools::getValue('mr_Pays_list')) + $this->_postErrors[] = $this->l('You must choose at least one delivery country.'); + } + + /* Order state form validation */ + else if (Tools::isSubmit('submit_order_state')) + { + if (!Validate::isUnsignedInt(Tools::getValue('id_order_state'))) + $this->_postErrors[] = $this->l('Invalid order state'); + } + + + } + + /** + * Update account shop + * + * @return bool + */ + public function updateAccountShop() + { + return Configuration::updateValue('MR_ACCOUNT_DETAIL', serialize($this->account_shop)); + } + + /** + * Post process + * + * @return array + */ + private function _postProcess() + { + $post_action = array( + 'type' =>Tools::safeOutput(Tools::getValue('MR_tab_name')), + 'message_success' => $this->l('Action Succeed'), + 'had_errors' => false + ); + + if (Tools::isSubmit('submitAdvancedSettings')) + Configuration::updateValue('MONDIAL_RELAY_MODE', Tools::getValue('mode', 'widget')); + else if (Tools::isSubmit('submit_account_detail')) + { + $this->account_shop = array( + 'MR_ENSEIGNE_WEBSERVICE' => Tools::safeOutput(Tools::getValue('MR_enseigne_webservice')), + 'MR_CODE_MARQUE' => Tools::safeOutput(Tools::getValue('MR_code_marque')), + 'MR_KEY_WEBSERVICE' =>Tools::safeOutput(Tools::getValue('MR_webservice_key')), + 'MR_LANGUAGE' => Tools::safeOutput(Tools::getValue('MR_language')), + 'MR_ORDER_STATE' => Tools::safeOutput($this->account_shop['MR_ORDER_STATE']), + 'MR_WEIGHT_COEFFICIENT' => Tools::safeOutput(Tools::getValue('MR_weight_coefficient')), + 'id_shop' => $this->context->shop->id + ); + if ($this->updateAccountShop()) + $post_action['message_success'] = $this->l('Account detail has been updated'); + else + $this->_postErrors[] = $this->l('Cannot Update the account shop'); + } + else if (Tools::isSubmit('submit_add_shipping')) + { + if (($this->addShippingMethod())) + $post_action['message_success'] = $this->l('Shipping method has been added'); + } + else if (Tools::isSubmit('submit_order_state')) + { + Configuration::updateValue('MONDIAL_RELAY_ORDER_STATE', Tools::getValue('id_order_state')); + $post_action['message_success'] = $this->l('Order state properly changed'); + } + else if (($id_mr_method = Tools::getValue('delete_mr')) && $this->disableCarrier((int)$id_mr_method)) + $post_action['message_success'] = $this->l('Carrier has been deleted (disabled under the prestashop database)'); + + if (count($this->_postErrors)) + $post_action['had_errors'] = true; + + return $post_action; + } + public function getContent() - { - global $cookie; - - $error = null; - - $html = ''; + { + $post_action = null; if (!empty($_POST)) { $this->_postValidation(); - if (!sizeof($this->_postErrors)) - $this->_postProcess(); - else - { - $nbErrors = sizeof($this->_postErrors); - $this->_html .= '

    '.$nbErrors.' '.($nbErrors > 1 ? $this->l('errors') : $this->l('error')).'

      '; - foreach ($this->_postErrors AS $error) - $this->_html .= '
    1. '.$error.'
    2. '; - $this->_html .= '
    '; - } + if (!count($this->_postErrors)) + $post_action = $this->_postProcess(); } - - if (isset($_GET['delete_mr']) && !empty($_GET['delete_mr'])) - self::mrDelete((int)($_GET['delete_mr'])); - - $this->_html .= '

    '.$this->l('Configure Mondial Relay Rate Module').'

    - -
    - - '.$this->l('Try to turn off the cache and put the force compilation to on').' - '.$this->l('if you have any problems with the module after an update').'. -
    -
    - '.$this->l('Have a look to the following HOW-TO to help you to configure the Mondial Relay module').' - -
    -
    -
    - - '.$this->l('To create a Mondial Relay carrier'). - ' - - '.$this->l('Enter and save your Mondial Relay account settings').'
    - - '.$this->l('Create a Carrier using the form "add a carrier" below').'
    - - '.$this->l('Define a price for your carrier on').' - '.$this->l('The Carrier page').'
    - - '.$this->l('To generate labels, you must have a valid and registered address of your store on your'). - ' '.$this->l('contact page').'
    -
    -
    -
    '. - $this->settingsForm(). - '
    -
    '. - $this->settingsstateorderForm(). - '
    -
    '. - $this->advancedSettings(). - '
    -
    '. - $this->addMethodForm(). - '
    -
    '. - $this->shippingForm(). - '

    '; - return $this->_html; - } - - /* - ** Update the new defined fields of the merchant - */ - public function updateFieldsPersonalization() - { - Configuration::updateValue('PS_MR_SHOP_NAME', Tools::getValue('Expe_ad1')); - $this->_html .= '
    '.$this->l('Settings updated').'
    '; - } - - public function mrDelete($id) - { - $id = Db::getInstance()->getValue('SELECT `id_carrier` FROM `'._DB_PREFIX_ .'mr_method` WHERE `id_mr_method` = "'.(int)($id).'"'); - Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_ .'carrier` SET `active` = 0, `deleted` = 1 WHERE `id_carrier` = "'.(int)($id).'"'); - $this->_html .= '
    '.$this->l('Delete successful').'
    '; - } - - public function mrUpdate($type, $array, $keyArray) - { - global $cookie; - - if ($type == 'settings') - { - Configuration::updateValue('MR_ENSEIGNE_WEBSERVICE', $array[0]); - Configuration::updateValue('MR_CODE_MARQUE', $array[1]); - Configuration::updateValue('MR_KEY_WEBSERVICE', $array[2]); - Configuration::updateValue('MR_LANGUAGE', $array[3]); - Configuration::updateValue('MR_WEIGHT_COEF', $array[4]); - } - elseif ($type == 'shipping') - { - array_pop($array); - foreach ($array AS $Key => $value) - { - $key = explode(',', $Key); - $id = Db::getInstance()->getValue('SELECT `id_carrier` FROM `'._DB_PREFIX_ .'mr_method` WHERE `id_mr_method` = "'.(int)($key[0]).'"'); - Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'carrier SET active = "'.(int)($value).'" WHERE `id_carrier` = "'.(int)($id).'"'); - } - } - elseif ($type == 'addShipping') - { - $query = 'INSERT INTO ' . _DB_PREFIX_ . 'mr_method ('; - - for ($q = 0; $q <= count($keyArray) - 1; $q++) - { - $end = ($q == count($keyArray) - 1) ? '' : ', '; - $query .= $keyArray[$q] . $end; - } - - $query .= ') VALUES('; - - for ($j = 0; $j <= count($array) - 1; $j++) - { - $var = $array[$j]; - if (is_array($var)) - $var = implode(",", $var); - $end = ($j == count($array) - 1) ? '' : ', '; - $query .= "'" . pSQL($var). "'" . $end; - } - $query .= ')'; - - Db::getInstance()->Execute($query); - - $mainInsert = mysql_insert_id(); - $default = Db::getInstance()->ExecuteS("SELECT * FROM " . _DB_PREFIX_ . "configuration WHERE name = 'PS_CARRIER_DEFAULT'"); - $check = Db::getInstance()->ExecuteS("SELECT * FROM " . _DB_PREFIX_ . "carrier"); - $checkD = array(); - - foreach($check AS $Key) - { - foreach($Key AS $key => $value) - if ($key == "id_carrier") - $checkD[] = $value; - } - - // Added for 1.3 compatibility to match with the right key - if (_PS_VERSION_ >= '1.4') - Db::getInstance()->Execute(' - INSERT INTO `' . _DB_PREFIX_ . 'carrier` - (`id_tax_rules_group`, `url`, `name`, `active`, `is_module`, `range_behavior`, `shipping_external`, `need_range`, `external_module_name`, `shipping_method`) - VALUES("0", NULL, "'.pSQL($array[1]).'", "1", "1", "1", "0", "1", "mondialrelay", "1")'); - else - Db::getInstance()->Execute(' - INSERT INTO `' . _DB_PREFIX_ . 'carrier` - (`url`, `name`, `active`, `is_module`, `range_behavior`) - VALUES(NULL, "'.pSQL('mondialrelay').'", "1", "0", "1")'); - - $get = Db::getInstance()->getRow('SELECT * FROM `' . _DB_PREFIX_ . 'carrier` WHERE `id_carrier` = "' . mysql_insert_id() . '"'); - Db::getInstance()->Execute('UPDATE `' . _DB_PREFIX_ . 'mr_method` SET `id_carrier` = "' . (int)($get['id_carrier']) . '" WHERE `id_mr_method` = "' . pSQL($mainInsert) . '"'); - $weight_coef = Configuration::get('MR_WEIGHT_COEF'); - $range_weight = array('24R' => array(0, 20000 / $weight_coef), 'DRI' => array(20000 / $weight_coef, 130000 / $weight_coef), 'LD1' => array(0, 60000 / $weight_coef), 'LDS' => array(30000 / $weight_coef, 130000 / $weight_coef)); - Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'range_weight` (`id_carrier`, `delimiter1`, `delimiter2`) - VALUES ('.(int)($get['id_carrier']).', '.$range_weight[$array[2]][0].', '.$range_weight[$array[2]][1].')'); - Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'range_price` (`id_carrier`, `delimiter1`, `delimiter2`) VALUES ('.(int)($get['id_carrier']).', 0.000000, 10000.000000)'); - $groups = Group::getGroups(Configuration::get('PS_LANG_DEFAULT')); - foreach ($groups as $group) - - Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'carrier_group` (id_carrier, id_group) VALUES('.(int)($get['id_carrier']).', '.(int)($group['id_group']).')'); - - $zones = Zone::getZones(); - foreach ($zones as $zone) - { - Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'carrier_zone` (id_carrier, id_zone) VALUES('.(int)($get['id_carrier']).', '.(int)($zone['id_zone']).')'); - $range_price_id = Db::getInstance()->getValue('SELECT id_range_price FROM ' . _DB_PREFIX_ . 'range_price WHERE id_carrier = "'.(int)($get['id_carrier']).'"'); - $range_weight_id = Db::getInstance()->getValue('SELECT id_range_weight FROM ' . _DB_PREFIX_ . 'range_weight WHERE id_carrier = "'.(int)($get['id_carrier']).'"'); - Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'delivery` (id_carrier, id_range_price, id_range_weight, id_zone, price) VALUES('.(int)($get['id_carrier']).', '.(int)($range_price_id).', NULL,'.(int)($zone['id_zone']).', 0.00)'); - Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'delivery` (id_carrier, id_range_price, id_range_weight, id_zone, price) VALUES('.(int)($get['id_carrier']).', NULL, '.(int)($range_weight_id).','.(int)($zone['id_zone']).', 0.00)'); - } - - if (!in_array($default[0]['value'], $checkD)) - $default = Db::getInstance()->ExecuteS("UPDATE " . _DB_PREFIX_ . "configuration SET value = '" . (int)($get['id_carrier']) . "' WHERE name = 'PS_CARRIER_DEFAULT'"); - } - else - return false; - - $this->_html .= '
    '.$this->l('Settings updated').'
    '; - return true; - } - - public function addMethodForm() - { - $zones = Db::getInstance()->ExecuteS("SELECT * FROM " . _DB_PREFIX_ . "zone WHERE active = 1"); - $output = ' -
    - -
    - '.$this->l('Add a Shipping Method').' -
      -
    • - * ' . $this->l('Required') . ' -
    • -
    • - - -
    • '; - /*
    • - - -
    • */ - - $output .= '
    • - - -
    • - -
    • - - -
    • - -
    • - - -
    • -
    • - -
    • -
    -
    -
    '; - - return $output; - } - - public function shippingForm() - { - global $cookie; - - $query = Db::getInstance()->ExecuteS(' + $carriers_list = Db::getInstance()->executeS(' SELECT m.* FROM `'._DB_PREFIX_.'mr_method` m - JOIN `'._DB_PREFIX_.'carrier` c + LEFT JOIN `'._DB_PREFIX_.'carrier` c ON (c.`id_carrier` = m.`id_carrier`) - WHERE c.`deleted` = 0'); - - $output = ' -
    -
    - '.$this->l('Shipping Method\'s list').' -
      '; - if (!sizeof($query)) - $output .= '
    • '.$this->l('No shipping methods created').'
    • '; - else - foreach ($query AS $Options) - { - $output .= ' -
    • - Delete' . str_replace('_', ' ', $Options['mr_Name']) . ' (' . $Options['mr_ModeCol'] . '-' . $Options['mr_ModeLiv'] . ' - ' . $Options['mr_ModeAss'] . ' : '.$Options['mr_Pays_list'].') - -
    • '; - } - $output .= ' -
    -
    -

    - '; + LEFT JOIN `'._DB_PREFIX_.'mr_method_shop` ms + ON ms.`id_mr_method` = m.`id_mr_method` + WHERE c.`deleted` = 0 AND ms.`id_shop` = '.(int)$this->account_shop['id_shop']); - return $output; - } - - /* - ** Display advanced settings form - */ - public function advancedSettings() - { - $form = ''; - - $form .= ' -
    - - '.$this->l('Advanced Settings'). ' - - - '.$this->l('Click to display / hide the options').' - '. - ' -
    -

    '. - $this->l('URL Cron Task:').' '.Tools::getHttpHost(true, true). - _MODULE_DIR_.$this->name.'/cron.php?secure_key='. - Configuration::get('MONDIAL_RELAY_SECURE_KEY'). - '

    -
    -
    '; - return $form; - } - - /* - ** Form to allow personalization fields sent for MondialRelay - ** Not used anymore but still present if needed - */ - public function personalizeFormFields() - { - $form = ''; - $warn = ''; - - // Load the Default value from the configuration - $addr1 = (Configuration::get('PS_MR_SHOP_NAME')) ? - Configuration::get('PS_MR_SHOP_NAME') : - Configuration::get('PS_SHOP_NAME'); - - // Check if a request exist and if errors occured, use the post variable - if (Tools::isSubmit('PS_MRSubmitFieldPersonalization') && count($this->_postErrors)) - $addr1 = Tools::safeOutput(Tools::getValue('Expe_ad1')); - + $controller = version_compare(_PS_VERSION_, '1.5', '<') ? 'AdminContact' : 'AdminStores'; - if (!Configuration::get('PS_MR_SHOP_NAME')) - $warn .= '
    '. - $this->l('Its seems you updated Mondialrelay without use the uninstall / install method, you have to set up this part to make working the generating ticket process'). - '
    '; - // Form - $form = '
    '; - $form .= ' -
    - - '.$this->l('Advanced Settings'). ' - - '.$this->l('Click to display / hide the options').' '. - ''. - $warn.' -
    -
    - - '.$this->l('This part allow to override the data sent at MondialRelay when you want to generate Ticket. Some fields are restricted by the length, or forbidden char').'. -
    - -
    -
    -

    '.$this->l('The key used by Mondialrelay is').' Expe_ad1 '.$this->l('and has this default value').' - : '.Configuration::get('PS_SHOP_NAME').'

    -
    - -
    - -
    -
    -
    -

    '; - return $form; + /* TODO : Fill an array with admi controller name */ + $this->context->smarty->assign(array( + 'MR_token_admin_performance' => Tools::getAdminToken('AdminPerformance'.(int)(Tab::getIdFromClassName('AdminPerformance')).(int)($this->context->cookie->id_employee)), + 'MR_token_admin_carriers' => (version_compare(_PS_VERSION_, '1.6', '<') ? Tools::getAdminToken('AdminCarriers'.(int)(Tab::getIdFromClassName('AdminCarriers')).(int)$this->context->employee->id) : Tools::getAdminToken('AdminCarrierWizard'.(int)(Tab::getIdFromClassName('AdminCarrierWizard')).(int)$this->context->employee->id)), + 'MR_token_admin_contact' => array( + 'controller_name' => $controller, + 'token' => Tools::getAdminToken($controller.(int)(Tab::getIdFromClassName($controller)).(int)$this->context->employee->id)), + 'MR_token_admin_mondialrelay' => Tools::getAdminToken('AdminMondialRelay'.(int)(Tab::getIdFromClassName('AdminMondialRelay')).(int)$this->context->employee->id), + 'MR_token_admin_module' => Tools::getAdminToken('AdminModules'.(int)(Tab::getIdFromClassName('AdminModules')).(int)$this->context->employee->id), + 'MR_enseigne_webservice' => Tools::getValue('MR_enseigne_webservice') ? Tools::getValue('MR_enseigne_webservice') : $this->account_shop['MR_ENSEIGNE_WEBSERVICE'], + 'MR_code_marque' => Tools::getValue('MR_code_marque') ? Tools::getValue('MR_code_marque') : $this->account_shop['MR_CODE_MARQUE'], + 'MR_webservice_key' => Tools::getValue('MR_webservice_key') ? Tools::getValue('MR_webservice_key') : $this->account_shop['MR_KEY_WEBSERVICE'], + 'MR_available_languages' => Language::getLanguages(), + 'MR_selected_language' => $this->account_shop['MR_LANGUAGE'], + 'MR_weight_coefficient' => Tools::getValue('MR_weight_coefficient') ? Tools::getValue('MR_weight_coefficient') : $this->account_shop['MR_WEIGHT_COEFFICIENT'], + 'MR_PS_WEIGHT_UNIT' => Configuration::get('PS_WEIGHT_UNIT'), + 'MR_order_states_list' => OrderState::getOrderStates($this->context->language->id), + 'MR_MONDIAL_RELAY_ORDER_STATE' => Configuration::get('MONDIAL_RELAY_ORDER_STATE'), + 'MR_CRON_URL' => Tools::getHttpHost(true, true)._MODULE_DIR_.$this->name.'/cron.php?secure_key='.Configuration::get('MONDIAL_RELAY_SECURE_KEY'), + 'MR_name' => Tools::getValue('MR_name') ? Tools::getValue('MR_name') : '', + 'MR_carriers_list' => $carriers_list, + 'MR_error_list' => $this->_postErrors, + 'MR_form_action' => $post_action, + 'MR_PS_ADMIN_IMG_' => _PS_ADMIN_IMG_, + 'MR_tab_selected' => Tools::getValue('MR_tab_name') ? Tools::getValue('MR_tab_name') : (MondialRelay::isAccountSet() ? 'account_form' : 'info_form'), + 'MR_delay' => Tools::getValue('MR_delay') ? Tools::getValue('MR_delay') : '', + 'MR_local_path' => MondialRelay::$modulePath, + 'MR_upgrade_detail' => $this->upgrade_detail, + 'MR_unit_weight_used' => Configuration::get('PS_WEIGHT_UNIT'), + 'MR_account_set' => MondialRelay::isAccountSet(), + 'MR_base_dir' => MondialRelay::$moduleURL, + 'MR_MONDIAL_RELAY_MODE' => Configuration::get('MONDIAL_RELAY_MODE'), + ) + ); + return $this->fetchTemplate('/views/templates/admin/', 'configuration'); } - - - public function settingsstateorderForm() - { - global $cookie; - - $this->orderState = Configuration::get('MONDIAL_RELAY_ORDER_STATE'); - $output = ''; - $output .= '
    '; - $output .= '
    '.$this->l('Settings').''; - $output .= ''; - $output .= '
    '; - $output .= ''; - $output .= '

    ' . $this->l('Choose the order state for labels. You can manage the labels on').' '; - $output .= ''. - $this->l('the Mondial Relay administration page').'

    '; - $output .= '
    -
    '; - $output .= '
    '; - $output .= '

    '; - - return $output; - } - - - public function settingsForm() - { - $output = ' -
    -
    - '.$this->l('Mondial Relay Account Settings').' -
    - - '.$this->l('These parameters are provided by Mondial Relay once you subscribed to their service').' -
    -
      -
    • - * ' . $this->l('Required') . ' -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    • - - - (' . $this->l('grammes = 1 ') . Configuration::get('PS_WEIGHT_UNIT').') -
    • -
    • - -
    • -
    -
    -
    '; - - return $output; + return $ret ? $carrier->id : false; } public function displayInfoByCart($id_cart) { $html = '

    '; - $simpleresul = Db::getInstance()->ExecuteS(' - SELECT * FROM ' . _DB_PREFIX_ . 'mr_selected + $simpleresul = Db::getInstance()->executeS(' + SELECT * FROM '._DB_PREFIX_.'mr_selected WHERE id_cart='.(int)($id_cart)); - - if (trim($simpleresul[0]['exp_number']) != '0') - $html .= $this->l('Nb expedition:').$simpleresul[0]['exp_number']."
    "; - if (trim($simpleresul[0]['url_etiquette']) != '0') - $html .= "".$this->l('Label URL')."
    "; - if (trim($simpleresul[0]['url_suivi']) != '0') - $html .= "".$this->l('Follow-up URL')."
    "; - if (trim($simpleresul[0]['MR_Selected_Num']) != '') - $html .= $this->l('Nb Point Relay :').$simpleresul[0]['MR_Selected_Num']."
    "; - if (trim($simpleresul[0]['MR_Selected_LgAdr1']) != '') - $html .= $simpleresul[0]['MR_Selected_LgAdr1']."
    "; - if (trim($simpleresul[0]['MR_Selected_LgAdr2']) != '') - $html .= $simpleresul[0]['MR_Selected_LgAdr2']."
    "; - if (trim($simpleresul[0]['MR_Selected_LgAdr3']) != '') - $html .= $simpleresul[0]['MR_Selected_LgAdr3']."
    "; - if (trim($simpleresul[0]['MR_Selected_LgAdr4']) != '') - $html .= $simpleresul[0]['MR_Selected_LgAdr4']."
    "; - if (trim($simpleresul[0]['MR_Selected_CP']) != '') - $html .= $simpleresul[0]['MR_Selected_CP']." "; - if (trim($simpleresul[0]['MR_Selected_Ville']) != '') - $html .= $simpleresul[0]['MR_Selected_Ville']."
    "; - if (trim($simpleresul[0]['MR_Selected_Pays']) != '') - $html .= $simpleresul[0]['MR_Selected_Pays']."
    "; + + if (isset($simpleresul[0])) + { + if (trim($simpleresul[0]['exp_number']) != '') + $html .= $this->l('Nb expedition:').$simpleresul[0]['exp_number'].'
    '; + if (trim($simpleresul[0]['url_etiquette']) != '') + $html .= ''.$this->l('Label URL').'
    '; + if (trim($simpleresul[0]['url_suivi']) != '') + $html .= ''.$this->l('Follow-up URL').'
    '; + if (trim($simpleresul[0]['MR_Selected_Num']) != '') + $html .= $this->l('Nb Point Relay :').$simpleresul[0]['MR_Selected_Num'].'
    '; + if (trim($simpleresul[0]['MR_Selected_LgAdr1']) != '') + $html .= $simpleresul[0]['MR_Selected_LgAdr1'].'
    '; + if (trim($simpleresul[0]['MR_Selected_LgAdr2']) != '') + $html .= $simpleresul[0]['MR_Selected_LgAdr2'].'
    '; + if (trim($simpleresul[0]['MR_Selected_LgAdr3']) != '') + $html .= $simpleresul[0]['MR_Selected_LgAdr3'].'
    '; + if (trim($simpleresul[0]['MR_Selected_LgAdr4']) != '') + $html .= $simpleresul[0]['MR_Selected_LgAdr4'].'
    '; + if (trim($simpleresul[0]['MR_Selected_CP']) != '') + $html .= $simpleresul[0]['MR_Selected_CP'].' '; + if (trim($simpleresul[0]['MR_Selected_Ville']) != '') + $html .= $simpleresul[0]['MR_Selected_Ville'].'
    '; + if (trim($simpleresul[0]['MR_Selected_Pays']) != '') + $html .= $simpleresul[0]['MR_Selected_Pays'].'
    '; + } $html .= '

    '; return $html; } - public function get_followup($shipping_number) + /** + * Set necessaries values to the created carrier + * + * @param $id_carrier + * @param $dlv_mode + * @return bool + */ + private function addDefaultCarrierValue($id_carrier, $dlv_mode) { - $query = 'SELECT url_suivi - FROM '._DB_PREFIX_ .'mr_selected - WHERE id_mr_selected=\''.(int)($shipping_number).'\';'; - - $settings = Db::getInstance()->ExecuteS($query); - if(!isset($settings[0]['url_suivi'])) - return null; - return $settings[0]['url_suivi']; + $weight_coef = $this->account_shop['MR_WEIGHT_COEFFICIENT']; + + /* Default Range value depending of the delivery mode */ + $range_weight = array( + '24R' => array(0, 30000 / $weight_coef), + 'DRI' => array(30000 / $weight_coef, 130000 / $weight_coef), + 'LD1' => array(0, 60000 / $weight_coef), + 'HOM' => array(0, 60000 / $weight_coef), + 'LDS' => array(30000 / $weight_coef, 130000 / $weight_coef) + ); + + /* Set range weight for a dlv_mode */ + if (!Db::getInstance()->execute( + 'INSERT INTO `'._DB_PREFIX_.'range_weight` + (`id_carrier`, `delimiter1`, `delimiter2`) + VALUES ('.(int)$id_carrier.', '.$range_weight[$dlv_mode][0].', '.$range_weight[$dlv_mode][1].')')) + { + $this->_postErrors[] = $this->l('Range weight can\'t be added'); + return false; + } + + $range_weight_id = Db::getInstance()->Insert_ID(); + + /* Set a range price */ + if (!Db::getInstance()->execute( + 'INSERT INTO `'._DB_PREFIX_.'range_price` + (`id_carrier`, `delimiter1`, `delimiter2`) + VALUES ('.(int)$id_carrier.', 0.000000, 10000.000000)')) + { + $this->_postErrors[] = $this->l('Range price can\'t be added'); + return false; + } + + $range_price_id = Db::getInstance()->Insert_ID(); + + $groups = Group::getGroups(Configuration::get('PS_LANG_DEFAULT')); + foreach ($groups as $group) + if (!Db::getInstance()->execute( + 'INSERT INTO `'._DB_PREFIX_.'carrier_group` + (id_carrier, id_group) + VALUES('.(int)$id_carrier.', '.(int)($group['id_group']).')')) + { + $this->_postErrors[] = $this->l('Default zone can\'t be added'); + return false; + } + + /* Set default zone */ + $zones = Zone::getZones(); + foreach ($zones as $zone) + { + if (!Db::getInstance()->execute( + 'INSERT INTO `'._DB_PREFIX_.'carrier_zone` + (id_carrier, id_zone) + VALUES('.(int)$id_carrier.', '.(int)($zone['id_zone']).')') || + !Db::getInstance()->execute( + 'INSERT INTO `'._DB_PREFIX_.'delivery` + (id_carrier, id_range_price, id_range_weight, id_zone, price) + VALUES('.(int)$id_carrier.', '.(int)($range_price_id).', NULL,'.(int)($zone['id_zone']).', 0.00)') || + !Db::getInstance()->execute( + 'INSERT INTO `'._DB_PREFIX_.'delivery` + (id_carrier, id_range_price, id_range_weight, id_zone, price) + VALUES('.(int)$id_carrier.', NULL, '.(int)($range_weight_id).','.(int)($zone['id_zone']).', 0.00)')) + { + $this->_postErrors[] = $this->l('Carrier zone or delivery data can\'t be added'); + return false; + } + } + return true; } - public function set_carrier($key, $value, $id_carrier) + /** + * Add new shipping method + * + * @return bool + */ + private function addShippingMethod() { - if ($key == 'name') - $key = 'mr_Name'; - - return Db::getInstance()->Execute(' - UPDATE ' . _DB_PREFIX_ . 'mr_method - SET '.pSQL($key).'="'.pSQL($value).'" - WHERE id_carrier=\''.(int)($id_carrier).'\' ; '); + /* Insert new carrier for under Prestashop */ + if (!($id_carrier = $this->addCarrier(Tools::getValue('MR_name'), Tools::getValue('MR_delay')))) + { + $this->_postErrors[] = $this->l('Carrier can\'t be created in PrestaShop'); + return false; + } + + $fields = $_POST; + + unset($fields['submit_add_shipping'], $fields['MR_tab_name'], $fields['tab'], $fields['MR_delay']); + + /* Force col mod to CCC */ + $fields['col_mode'] = 'CCC'; + $fields['id_carrier'] = $id_carrier; + + $query = 'INSERT INTO `'._DB_PREFIX_.'mr_method` (%s) VALUES(%s)'; + + $keys = array(); + $values = array(); + foreach ($fields as $key => $value) + { + $keys[] = '`'.str_replace('MR_', '', $key).'`'; + $values[] = '\''.(is_array($value) ? pSQL(implode(',', $value)) : pSQL($value)).'\''; + } + $query = sprintf($query, implode(',', $keys), implode(',', $values)); + + if (!Db::getInstance()->execute($query) || !Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'mr_method_shop` + (id_mr_method, id_shop) VALUES('.(int)Db::getInstance()->INSERT_ID().', '.(int)$this->account_shop['id_shop'].')')) + { + $this->l('Carrier method can\'t be added for the module'); + Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'carrier` WHERE id_carrier='.(int)$id_carrier); + return false; + } + return $this->addDefaultCarrierValue($id_carrier, $fields['MR_dlv_mode']); } - - // Add for 1.3 compatibility and avoid duplicate code - public static function jsonEncode($result) + + /** + * Disable carrier instead of delete to keep history + * + * @param $id_mr_method + */ + public function disableCarrier($id_mr_method) { - return (method_exists('Tools', 'jsonEncode')) ? - Tools::jsonEncode($result) : json_encode($result); + if (($id_carrier = Db::getInstance()->getValue( + 'SELECT `id_carrier` + FROM `'._DB_PREFIX_.'mr_method` + WHERE `id_mr_method` = '.(int)($id_mr_method))) && + Db::getInstance()->execute( + 'UPDATE `'._DB_PREFIX_.'carrier` c, `'._DB_PREFIX_.'mr_method` m + SET c.`active` = 0, c.`deleted` = 1, m.`is_deleted` = 1 + WHERE + c.`id_carrier` = m.`id_carrier` + AND c.`id_carrier` = '.(int)$id_carrier)) + return true; + + $this->_postErrors = $this->l('Carrier can\'t be deleted yet'); + return false; } - - public static function ordersSQLQuery1_4($id_order_state) + + /** + * Get the followup url + * + * @param $exp_number + * @return mixed + */ + public function get_followup($exp_number) { - return 'SELECT o.`id_address_delivery` as id_address_delivery, - o.`id_order` as id_order, + $query = ' + SELECT url_suivi + FROM '._DB_PREFIX_.'mr_selected + WHERE exp_number='.(int)$exp_number; + + return Db::getInstance()->getValue($query); + } + + /** + * Get the SQL query to fetch order with mr carrier + * + * @static + * @param $id_order_state + * @param $weight_coefficient + * @return string + */ + public static function getBaseOrdersSQLQuery($id_order_state, $weight_coefficient = 0) + { + return 'SELECT o.`id_address_delivery` as id_address_delivery, + o.`id_order` as id_order, o.`id_customer` as id_customer, o.`id_cart` as id_cart, o.`id_lang` as id_lang, mrs.`id_mr_selected` as id_mr_selected, - CONCAT(c.`firstname`, \' \', c.`lastname`) AS `customer`, + CONCAT(c.`firstname`, " ", c.`lastname`) AS `customer`, o.`total_paid_real` as total, o.`total_shipping` as shipping, o.`date_add` as date, o.`id_currency` as id_currency, o.`id_lang` as id_lang, - mrs.`MR_poids` as weight, mr.`mr_Name` as mr_Name, mrs.`MR_Selected_Num` as MR_Selected_Num, + mrs.`MR_poids` as mr_weight, + mrs.`MR_insurance` as mr_insurance, + mr.`name` as mr_Name, mrs.`MR_Selected_Num` as MR_Selected_Num, mrs.`MR_Selected_Pays` as MR_Selected_Pays, mrs.`exp_number` as exp_number, - mr.`mr_ModeCol` as mr_ModeCol, mr.`mr_ModeLiv` as mr_ModeLiv, mr.`mr_ModeAss` as mr_ModeAss - FROM `'._DB_PREFIX_.'orders` o - LEFT JOIN `'._DB_PREFIX_.'carrier` ca - ON (ca.`id_carrier` = o.`id_carrier` - AND ca.`external_module_name` = "mondialrelay") - LEFT JOIN `'._DB_PREFIX_.'mr_selected` mrs + mr.`col_mode` as mr_ModeCol, mr.`dlv_mode` as mr_ModeLiv, mr.`insurance` as mr_ModeAss, + ROUND(SUM(odt.`product_weight` * odt.`product_quantity`) * '.(int)$weight_coefficient.') AS "order_weight" + FROM + `'._DB_PREFIX_.'orders` o + LEFT JOIN + `'._DB_PREFIX_.'carrier` ca + ON (ca.`id_carrier` = o.`id_carrier`) + LEFT JOIN + `'._DB_PREFIX_.'mr_selected` mrs ON (mrs.`id_cart` = o.`id_cart`) - LEFT JOIN `'._DB_PREFIX_.'mr_method` mr - ON (mr.`id_mr_method` = mrs.`id_method`) - LEFT JOIN `'._DB_PREFIX_.'customer` c + LEFT JOIN + `'._DB_PREFIX_.'mr_method` mr + ON (mr.`id_carrier` = ca.`id_carrier`) + LEFT JOIN + `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = o.`id_customer`) + LEFT JOIN + `'._DB_PREFIX_.'order_detail` odt + ON odt.`id_order` = o.`id_order` WHERE ( - SELECT moh.`id_order_state` - FROM `'._DB_PREFIX_.'order_history` moh - WHERE moh.`id_order` = o.`id_order` + SELECT moh.`id_order_state` + FROM `'._DB_PREFIX_.'order_history` moh + WHERE moh.`id_order` = o.`id_order` ORDER BY moh.`date_add` DESC LIMIT 1) = '.(int)($id_order_state).' - AND ca.`external_module_name` = "mondialrelay"'; + AND o.`id_order` = mrs.`id_order`'; } - - public static function ordersSQLQuery1_3($id_order_state) + + /** + * Get orders details to create Tickets + * + * @static + * @param array $orderIdList + * @param int $filterEntries + * @param int $weight_coefficient + * @return array + */ + public static function getOrders($orderIdList = array(), $filterEntries = MondialRelay::NO_FILTER, $weight_coefficient = 0) { - return ' - SELECT o.`id_address_delivery` as id_address_delivery, - o.`id_order` as id_order, - o.`id_customer` as id_customer, - o.`id_cart` as id_cart, - mrs.`id_mr_selected` as id_mr_selected, - CONCAT(c.`firstname`, \' \', c.`lastname`) AS `customer`, - o.`total_paid_real` as total, o.`total_shipping` as shipping, - o.`date_add` as date, o.`id_currency` as id_currency, o.`id_lang` as id_lang, - mrs.`MR_poids` as weight, mr.`mr_Name` as mr_Name, mrs.`MR_Selected_Num` as MR_Selected_Num, - mrs.`MR_Selected_Pays` as MR_Selected_Pays, mrs.`exp_number` as exp_number, - mr.`mr_ModeCol` as mr_ModeCol, mr.`mr_ModeLiv` as mr_ModeLiv, mr.`mr_ModeAss` as mr_ModeAss - FROM `'._DB_PREFIX_.'orders` o - LEFT JOIN `'._DB_PREFIX_.'carrier` ca - ON (ca.`id_carrier` = o.`id_carrier` - AND ca.`name` = "mondialrelay") - LEFT JOIN `'._DB_PREFIX_.'mr_selected` mrs - ON (mrs.`id_cart` = o.`id_cart`) - LEFT JOIN `'._DB_PREFIX_.'mr_method` mr - ON (mr.`id_mr_method` = mrs.`id_method`) - LEFT JOIN `'._DB_PREFIX_.'customer` c - ON (c.`id_customer` = o.`id_customer`) - WHERE ( - SELECT moh.`id_order_state` - FROM `'._DB_PREFIX_.'order_history` moh - WHERE moh.`id_order` = o.`id_order` - ORDER BY moh.`date_add` DESC LIMIT 1) = '.(int)($id_order_state).' - AND ca.`name` = "mondialrelay"'; - } - - public static function getBaseOrdersSQLQuery($id_order_state) - { - if (_PS_VERSION_ >= '1.4') - return self::ordersSQLQuery1_4($id_order_state); - else - return self::ordersSQLQuery1_3($id_order_state); - } - - public static function getOrders($orderIdList = array(), $filterEntries = self::NO_FILTER) - { - $id_order_state = Configuration::get('MONDIAL_RELAY_ORDER_STATE'); - $sql = self::getBaseOrdersSQLQuery($id_order_state); + $account_shop = MondialRelay::getAccountDetail(); + $id_order_state = $account_shop['MR_ORDER_STATE']; + $sql = MondialRelay::getBaseOrdersSQLQuery($id_order_state, $weight_coefficient); if (count($orderIdList)) { @@ -1256,29 +1222,36 @@ class MondialRelay extends Module $sql .= (int)$id_order.', '; $sql = rtrim($sql, ', ').')'; } - switch($filterEntries) + switch ($filterEntries) { - case self::WITHOUT_HOME_DELIVERY: - $sql .= 'AND mr.mr_ModeLiv != "LD1" AND mr.mr_ModeLiv != "LDS"'; - break; - default: + case MondialRelay::WITHOUT_HOME_DELIVERY: + $sql .= 'AND mr.mr_ModeLiv != "LD1" AND mr.mr_ModeLiv != "LDS" AND mr.mr_ModeLiv != "HOM"'; break; } $sql .= ' GROUP BY o.`id_order` ORDER BY o.`date_add` ASC'; - return Db::getInstance()->ExecuteS($sql); + return Db::getInstance()->executeS($sql); } - + + /** + * Get Mondialrelay error code + * + * @param $code + * @return string + */ public function getErrorCodeDetail($code) { - global $statCode; - + include(dirname(__FILE__).'/errorCode.php'); if (isset($statCode[$code])) return $statCode[$code]; - return $this->l('This error isn\'t referred : ') . $code; + return $this->l('This error isn\'t referred : ').$code; } - + + /** + * @param $id_cart + * @return mixed + */ public function getRelayPointSelected($id_cart) { return Db::getInstance()->getRow(' @@ -1286,19 +1259,41 @@ class MondialRelay extends Module FROM `'._DB_PREFIX_.'mr_selected` s WHERE s.`id_cart` = '.(int)$id_cart); } - + + /** + * @param $id_carrier + * @return mixed + */ public function isMondialRelayCarrier($id_carrier) { return Db::getInstance()->getRow(' - SELECT `id_carrier` - FROM `'._DB_PREFIX_.'mr_method` + SELECT m.`id_mr_method` + FROM `'._DB_PREFIX_.'mr_method` m WHERE `id_carrier` = '.(int)$id_carrier); } - - public function hookpaymentTop($params) - { - if ($this->isMondialRelayCarrier($params['cart']->id_carrier) && - !$this->getRelayPointSelected($params['cart']->id)) - $params['cart']->id_carrier = 0; - } + + public function getMethodValueByIdCarier($id_carrier, $key) + { + $content = Db::getInstance()->executeS( + 'SELECT * + FROM `'._DB_PREFIX_.'mr_method` m + WHERE `id_carrier` = '.(int)$id_carrier); + + return isset($content[$key]) ? $content[$key] : ''; + } + + public function checkAJAX() + { + /* Avoid loop inclusion */ + static $is_included = false; + + /* TODO : Find a way to use it on front */ + if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && Tools::strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') + if (Tools::getValue('mrtoken') && !$is_included) + { + $is_included = true; + include(dirname(__FILE__).'/ajax.php'); + exit(0); + } + } } diff --git a/modules/mondialrelay/nl.php b/modules/mondialrelay/nl.php new file mode 100755 index 00000000..553acb2c --- /dev/null +++ b/modules/mondialrelay/nl.php @@ -0,0 +1,235 @@ +adminmondialrelay_e82faee1422140edd04b2f94c5051500'] = 'Actie geslaagd'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_3b2d373418745276ae6e207421245cdc'] = 'Bestelstatus geüpdatet'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_b4ac3d3f15bc0984d0906aff1202e701'] = 'Kan de account-winkel niet updaten'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_44585fcd617dce6416d8283b026714c1'] = 'Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ed4a3b96dc1f38c160775cac1f7bcd6d'] = 'Leveren in een afhaalpunt'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ec0cc3039fa07db6a4e83582d2796883'] = 'Mondial Relay vereist de installatie van SOAP & cURL op uw server.'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4c9120f1a5947445c0e9620254ceb30b'] = 'Nieuwe bestelling'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d2286c9c8c8f92cb0e805b17834591b0'] = 'Ongeldige handelsnaam'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_709b076565df5fa98cdb2528d897633d'] = 'Ongeldige merkcode'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c86508f5bc6b4456e7003d6a1868689d'] = 'Ongeldige sleutel'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ea9261a3dad976b40ff2088a19fda2c3'] = 'Ongeldige taal'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4eb287cc225ba0e1bcfe9cc1b8315def'] = 'Ongeldige wegingscoëfficiënt'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_70ff82d47f295f730c6accf07a2948e8'] = 'Ongeldige vervoerdersnaam'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e1f1787db2fee596f4c3bfaf1d098f8d'] = 'Ongeldige Col-modus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9414b7de379a09941e894d28f19949ae'] = 'Ongeldige Verzekeringsmodus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5eeb9ca7eee4be7192dd10d917f79a12'] = 'Ongeldige Verzekeringsmodus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8b446ac2013dc7085802de71cc342ead'] = 'U moet ten minste één land van levering kiezen.'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_979c6094728c14aac1b66d544dc5cebd'] = 'Ongeldige bestelstatus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e82faee1422140edd04b2f94c5051500'] = 'Actie geslaagd'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_672facd73d4aee44c116cfd95298db87'] = 'Accountgegevens geüpdatet'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b4ac3d3f15bc0984d0906aff1202e701'] = 'Kan de account-winkel niet updaten'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ea50be3d60be594e10e9e3560cb9159f'] = 'Verzendingsmethode toegevoegd'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d0cfdfcfb71029b561f5ebdc176d87ca'] = 'Bestelstatus correct gewijzigd'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_7534411af2e35bed1f79df5938f077f9'] = 'Label URL'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2673bca5ba0a7871770e69c962e6ce38'] = 'Nummer verzending:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dbe844fb964d5eca2f51be724e43294'] = 'URL de l\'étiquette'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6aefd5e2191e1210a2f50416812b517'] = 'Follow-up URL'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_61e70b58e38fd01daa254f44c4fa264b'] = 'Nummer Afhaalpunt:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_aa625fced6f01ae595b6a9ac499c2ecf'] = 'Gewichtspercentage kan niet worden toegevoegd'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_63d15383121b5bb5c53323f3f96bd1f2'] = 'Prijspercentage kan niet worden toegevoegd'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d4d197dd028e28ae56208971b564921a'] = 'Standaardzone kan niet worden toegevoegd'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_760ac6deb1c5b84321f65ba0c7f319f5'] = 'Vervoerderszone of leveringsgegevens kunnen niet worden toegevoegd'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8bf569ff65b32464e623ca9e9a10688d'] = 'Vervoerder kan niet worden aangemaakt in PrestaShop'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6ed26bdf3f9141ddca4ede91f943e567'] = 'Vervoermethode kan niet worden toegevoegd voor de module'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_af135815ccf731bcbffb522004762b57'] = 'Vervoerder kan nog niet worden verwijderd'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_bba366864d25056c941b72f18ef79e7c'] = 'Deze foutmelding is niet vermeld:'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_a1c3470a944b9625cfb924fd15c8bdbf'] = 'Kies ten minste één bestelling'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_dc41aac14af17f1d19fca5e3b9439e74'] = 'Deze sleutel'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_306b346c19017609403424203ea3d720'] = 'Is leeg en moet worden ingevoerd'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_c9b4de92f371ae545ad6f051c07d58ca'] = 'Er is een fout opgetreden:'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_ea5f761be4e4888eabf4e1501d7817d1'] = 'Details:'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_eabb11bf9623f08409a0a4c9d035a336'] = 'Verzendingsnummer:'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_b92c3d3319314513c547675924ceecd1'] = 'Ticket-URL:'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_66b793b6b4125e300717e8cf7449f533'] = 'Follop-up URL:'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_952a812236cabbd70b949ecb43f89c82'] = 'De Mondial Relay webdienst is momenteel niet betrouwbaar'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_26b6b6eaec970108c5e84286159fbf48'] = 'Controleer uw taal-configuratie'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_557595c2e17c9948a9448eb763ac1a88'] = 'Controleer uw winkelnaam-configuratie'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_017ca6b770ad53669a4eec82894dfcd3'] = 'Controleer uw adres 1-configuratie'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_3f79e1fc66b4f9cca7bd68cab176020d'] = 'Controleer uw stad-configuratie'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_404665d9b65239985d59b30b3dcb26b5'] = 'Controleer uw postcode-configuratie'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_0b8a30478b9572b86718989d483fd88d'] = 'Controleer uw land-configuratie'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_7ddf2d94bf037b7d1088c0600ea589c3'] = 'Controleer uw telefoonnummer-configuratie'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_9c7ce7be9a2c593b24d448edb4f804e0'] = 'Controleer uw e-mail-configuratie'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_85e6a18230d49abf8cfe912809185258'] = 'De postcode kan niet worden bevestigd met PrestaShop versies ouder dan 1.4'; +$_MODULE['<{mondialrelay}prestashop>mrdownloadpdf_dc41aac14af17f1d19fca5e3b9439e74'] = 'Deze sleutel'; +$_MODULE['<{mondialrelay}prestashop>mrdownloadpdf_135a7b9a62531e066a95093d8951b344'] = 'heeft geen geldig formaat'; +$_MODULE['<{mondialrelay}prestashop>mrdownloadpdf_c9b4de92f371ae545ad6f051c07d58ca'] = 'Er is een fout opgetreden:'; +$_MODULE['<{mondialrelay}prestashop>mrdownloadpdf_ea5f761be4e4888eabf4e1501d7817d1'] = 'Details:'; +$_MODULE['<{mondialrelay}prestashop>mrdownloadpdf_2653c23b8c0daac59571e4be5e8fa7d0'] = 'De Mondial Relay webdienst is momenteel niet betrouwbaar'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_14288d48d107056c1acf8aaae1bf282b'] = 'Het adres van de klant kan niet worden gevonden'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_dc41aac14af17f1d19fca5e3b9439e74'] = 'Deze sleutel'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_135a7b9a62531e066a95093d8951b344'] = 'heeft geen geldig formaat'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_c9b4de92f371ae545ad6f051c07d58ca'] = 'Er is een fout opgetreden:'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_ea5f761be4e4888eabf4e1501d7817d1'] = 'Details:'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_4e274658c9e97c2a336dde79dd0a7772'] = 'MondialRelay vindt geen enkel afhaalpunt in uw buurt. Misschien is uw adres niet correct ingevoerd?'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_2653c23b8c0daac59571e4be5e8fa7d0'] = 'De Mondial Relay webdienst is momenteel niet betrouwbaar'; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_dc41aac14af17f1d19fca5e3b9439e74'] = 'Deze sleutel'; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_135a7b9a62531e066a95093d8951b344'] = 'heeft geen geldig formaat'; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_c9b4de92f371ae545ad6f051c07d58ca'] = 'Er is een fout opgetreden:'; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_ea5f761be4e4888eabf4e1501d7817d1'] = 'Details:'; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_2653c23b8c0daac59571e4be5e8fa7d0'] = 'De Mondial Relay webdienst is momenteel niet betrouwbaar'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_38b4abe2f5860f034e315f2da648a3d6'] = 'Mondial Relay de-installeren'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_a4691c957e81a6f0b6f0ed44f8f2dfe8'] = 'U staat op het punt de module te de-installeren, wilt u de database verwijderen'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_09c081633d484a62a2f6940c12a0de36'] = 'Behouden en de-installeren'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_0b7f47fce1d82d53244771c64b1535c0'] = 'Verwijderen en de-installeren'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_ea4788705e6873b424c65e91c2846b19'] = 'Annuleren'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_a42bb0eaa485682166770a54469385f6'] = 'Sommige items kunnen niet worden verwijderd, probeer het opnieuw'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_11744bfebb33e52be37a66a530b7045d'] = 'Kies ten minste één element in de historiek'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_14288d48d107056c1acf8aaae1bf282b'] = 'Het adres van de klant kan niet worden gevonden'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_dc41aac14af17f1d19fca5e3b9439e74'] = 'Deze sleutel'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_306b346c19017609403424203ea3d720'] = 'Is leeg en moet worden ingevoerd'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_c9b4de92f371ae545ad6f051c07d58ca'] = 'Er is een fout opgetreden:'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_ea5f761be4e4888eabf4e1501d7817d1'] = 'Details:'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_6f8522e0610541f1ef215a22ffa66ff6'] = 'Maandag'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_5792315f09a5d54fb7e3d066672b507f'] = 'Dinsdag'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_796c163589f295373e171842f37265d5'] = 'Woensdag'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_78ae6f0cd191d25147e252dc54768238'] = 'Donderdag'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_c33b138a163847cdb6caeeb7c9a126b4'] = 'Vrijdag'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Zaterdag'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Zondag'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_2653c23b8c0daac59571e4be5e8fa7d0'] = 'De Mondial Relay webdienst is momenteel niet betrouwbaar'; +$_MODULE['<{mondialrelay}prestashop>install-1.8.0_315a8895cf7c458597be5cf3c5b18d0b'] = 'Kan geen methodetabel aanmaken'; +$_MODULE['<{mondialrelay}prestashop>install-1.8.0_e364c3962f360330a5d8084c3ef5cacf'] = 'Kan de naam van de methodetabel niet wijzigen'; +$_MODULE['<{mondialrelay}prestashop>install-1.8.0_6384826d8bae08ec0ca4d1cd386a32c8'] = 'Kan de historiektabel geen andere naam geven'; +$_MODULE['<{mondialrelay}prestashop>install-1.8.0_4c74bd0afa2a8ecb894674c9cd942da5'] = 'Kan de tabel mr_method_shop niet updaten'; +$_MODULE['<{mondialrelay}prestashop>install-1.8.3_665cc27f3a529d80315dd49378a6c2bf'] = 'Kan geen nieuw veld toevoegen in de methodetabel'; +$_MODULE['<{mondialrelay}prestashop>install-2.0.6_665cc27f3a529d80315dd49378a6c2bf'] = 'Kan geen nieuw veld toevoegen in de methodetabel'; +$_MODULE['<{mondialrelay}prestashop>configuration_0f27e5e9020f28e3f31b78376e11d4c7'] = 'Mondial Relay configuratie'; +$_MODULE['<{mondialrelay}prestashop>configuration_8bc212f48680748479bbd322d4d73d3f'] = 'Accountdetails'; +$_MODULE['<{mondialrelay}prestashop>configuration_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Verzending'; +$_MODULE['<{mondialrelay}prestashop>configuration_fe4c6a5e7bd6793b37370e4e46daf998'] = 'Geavanceerde instellingen'; +$_MODULE['<{mondialrelay}prestashop>configuration_326e057f57e830834c20d668e44627ef'] = 'Informatie'; +$_MODULE['<{mondialrelay}prestashop>configuration_02d4482d332e1aef3437cd61c9bcc624'] = 'Neem contact met ons op'; +$_MODULE['<{mondialrelay}prestashop>configuration_29141d2b5a484e8032ef64339733f0dc'] = 'Stel uw Mondial Relay accountinstellingen in'; +$_MODULE['<{mondialrelay}prestashop>configuration_ed4dac9dada37651967d305576326e07'] = 'De Mondial relay klantendienst helpt u met vragen betreffende vrachtvervoer. Voor algemene vragen of inschrijvingen, neem contact met ons op via:'; +$_MODULE['<{mondialrelay}prestashop>configuration_2f8531293ddfd4f30bb978e93d49f650'] = 'E-mail:'; +$_MODULE['<{mondialrelay}prestashop>configuration_d0398e90769ea6ed2823a3857bcc19ea'] = 'Telefoon:'; +$_MODULE['<{mondialrelay}prestashop>configuration_c276d381dccea7ac2d2e5060d52356c5'] = '09.69.322.332 (oproep zonder toeslag)'; +$_MODULE['<{mondialrelay}prestashop>configuration_5b303c899b89c35d9d3e3d7f6ff4e8ed'] = 'Voor bijkomende informatie, raadpleeg de FAQ van onze website:'; +$_MODULE['<{mondialrelay}prestashop>configuration_5a2355a42ba3ab265701183c914467f2'] = 'Probeer het cache(geheugen) uit te schakelen en schakel de force compilation-modus in'; +$_MODULE['<{mondialrelay}prestashop>configuration_3de769f9a81eed916583d5b35c58dbdd'] = 'Als u problemen hebt met de module na een update'; +$_MODULE['<{mondialrelay}prestashop>configuration_8f8b21bd013b38d1e3059557c22a57e7'] = 'Raadpleeg onderstaande METHODE voor het configureren van de Mondial Relay-module'; +$_MODULE['<{mondialrelay}prestashop>configuration_d21a9f93917604d5490ad529a7cf1ff9'] = 'Het aanmaken van een Mondial Relay vervoerder'; +$_MODULE['<{mondialrelay}prestashop>configuration_c6a2e6af5fff47adb3afd780b97d9b4b'] = 'Voer uw Mondial Relay accountinstellingen in en bewaar ze'; +$_MODULE['<{mondialrelay}prestashop>configuration_4695eb112007792d94d42c8a3755169f'] = 'Een vervoerder-gebruiksknop aanmaken '; +$_MODULE['<{mondialrelay}prestashop>configuration_0dbbe632f1eaf7b912714a1aab4578c9'] = 'Een verzendingsmethode toevoegen aan de vervoerdersknop'; +$_MODULE['<{mondialrelay}prestashop>configuration_b962d8fb95f5a439f50502152f3bad71'] = 'Bepaal een prijs voor uw vervoerder op'; +$_MODULE['<{mondialrelay}prestashop>configuration_faf1247ae6846a9955a466d4f301bbe4'] = 'De vervoerderspagina'; +$_MODULE['<{mondialrelay}prestashop>configuration_10d78806b84b97ebc774e9f6277af6ac'] = 'Om labels aan te maken, moet u beschikken over een geldig en geregistreerd adres voor uw winkel op uw'; +$_MODULE['<{mondialrelay}prestashop>configuration_af5efea250326c1c34d69aa9364b482c'] = 'contactpagina'; +$_MODULE['<{mondialrelay}prestashop>configuration_1ba3935c9858ffb8e19a35ca640b8505'] = 'Mondial Relay accountinstellingen'; +$_MODULE['<{mondialrelay}prestashop>configuration_a125105400f6e4ee4574da3793af5ef2'] = 'Deze parameters worden verstrekt door Mondial Relay zodra u bent geabonneerd op hun dienst'; +$_MODULE['<{mondialrelay}prestashop>configuration_12a3fbd35c1cab4b1101b91d708efd15'] = 'Handelsnaam van de webdienst:'; +$_MODULE['<{mondialrelay}prestashop>configuration_6f0434b67007b555dfd1201f4e0d5254'] = 'Merkcode:'; +$_MODULE['<{mondialrelay}prestashop>configuration_08f785193c96b2a78dec8d76a46648d6'] = 'Webdienst sleutel:'; +$_MODULE['<{mondialrelay}prestashop>configuration_0dae2d7c71f2daaedb00191af25dc28d'] = 'Etiquettetaal:'; +$_MODULE['<{mondialrelay}prestashop>configuration_a26329cba9723551cb8654deba32872b'] = 'Wegingscoëfficiënt:'; +$_MODULE['<{mondialrelay}prestashop>configuration_99244b234ec089eca40ff9e8ec343e87'] = 'Gram = 1'; +$_MODULE['<{mondialrelay}prestashop>configuration_61cbc2d26b4157292673c772ddd6c0f7'] = 'Update instellingen'; +$_MODULE['<{mondialrelay}prestashop>configuration_c7ad75acafd2cdc04bc168e30e9314fd'] = 'Controleer de verbinding'; +$_MODULE['<{mondialrelay}prestashop>configuration_70397c4b252a5168c5ec003931cea215'] = 'Vereiste velden'; +$_MODULE['<{mondialrelay}prestashop>configuration_9ffc3ccc968a96d902af963c6d7b4e97'] = 'Geavanceerde instellingen'; +$_MODULE['<{mondialrelay}prestashop>configuration_1ee1c44c2dc81681f961235604247b81'] = 'Modus:'; +$_MODULE['<{mondialrelay}prestashop>configuration_6ed562a0d4381eef12d92c87520f3208'] = 'Widget'; +$_MODULE['<{mondialrelay}prestashop>configuration_960b44c579bc2f6818d2daaf9e4c16f0'] = 'Normal'; +$_MODULE['<{mondialrelay}prestashop>configuration_fcf5b2122da1d5a5f5c7253b96a3f9d9'] = 'URL crontaak:'; +$_MODULE['<{mondialrelay}prestashop>configuration_6f9c467e60d98ac0bfa290ab83566ec0'] = 'Geavanceerde instellingen updaten'; +$_MODULE['<{mondialrelay}prestashop>configuration_66661dacf33146201b60dc16520ddd68'] = 'Een verzendingsmethode toevoegen'; +$_MODULE['<{mondialrelay}prestashop>configuration_531e144cc23ef08408b81cb4d9c641dc'] = 'Naam vervoerder'; +$_MODULE['<{mondialrelay}prestashop>configuration_8f497c1a3d15af9e0c215019f26b887d'] = 'Vertraging'; +$_MODULE['<{mondialrelay}prestashop>configuration_201bdb87f8e278b943d07ae924d5de6e'] = 'Leveringsmodus'; +$_MODULE['<{mondialrelay}prestashop>configuration_142ef02888af88b8b772335277d1c0c8'] = 'Levering in een afhaalpunt'; +$_MODULE['<{mondialrelay}prestashop>configuration_eeab8b7cf3c7a558a0e8a4050fa994ca'] = 'Levering met Colis Drive'; +$_MODULE['<{mondialrelay}prestashop>configuration_8f7794b107749728c3333ef38d2687e8'] = 'Levering aan huis op benedenverdieping (1 persoon)'; +$_MODULE['<{mondialrelay}prestashop>configuration_e451efc8ce05b96b214b4c2935f2c657'] = 'Speciale levering aan huis (2 personen)'; +$_MODULE['<{mondialrelay}prestashop>configuration_09a00f755c3b3d63bf62e14172c1e9a1'] = 'Speciale levering aan huis'; +$_MODULE['<{mondialrelay}prestashop>configuration_eaff1bdf24fcffe0e14e29a1bff51a12'] = 'Verzekering'; +$_MODULE['<{mondialrelay}prestashop>configuration_96ba408f20bc3e065f400c650d32fd1a'] = 'Geen verzekering'; +$_MODULE['<{mondialrelay}prestashop>configuration_e5a8fafb1dfb538c172e1e014e86b871'] = 'Aanvullende verzekering Lv1'; +$_MODULE['<{mondialrelay}prestashop>configuration_b02f8d6d4b6217cca317161c87f64065'] = 'Aanvullende verzekering Lv2'; +$_MODULE['<{mondialrelay}prestashop>configuration_90b95ae88150c6a34c4129dc4f1ebbd5'] = 'Aanvullende verzekering Lv3'; +$_MODULE['<{mondialrelay}prestashop>configuration_c15b40b8c535191f6f0b6f9beaced3cf'] = 'Aanvullende verzekering Lv4'; +$_MODULE['<{mondialrelay}prestashop>configuration_b67a442fff3ca0a03ea253b0668f946d'] = 'Aanvullende verzekering Lv5'; +$_MODULE['<{mondialrelay}prestashop>configuration_33cbd0d8b6476501f55a8320481ec0f1'] = 'Leveringslanden:'; +$_MODULE['<{mondialrelay}prestashop>configuration_aef71ba4fd060dea2e2c76d1b5076caf'] = 'U kunt meerdere landen selecteren door de Ctrl-toets in te drukken tijdens de selectie'; +$_MODULE['<{mondialrelay}prestashop>configuration_0309a6c666a7a803fdb9db95de71cf01'] = 'Frankrijk'; +$_MODULE['<{mondialrelay}prestashop>configuration_6c1674d14bf5f95742f572cddb0641a7'] = 'België'; +$_MODULE['<{mondialrelay}prestashop>configuration_06630c890abadde9228ea818ce52b621'] = 'Luxemburg'; +$_MODULE['<{mondialrelay}prestashop>configuration_907eba32d950bfab68227fd7ea22999b'] = 'Spanje'; +$_MODULE['<{mondialrelay}prestashop>configuration_d8b00929dec65d422303256336ada04f'] = 'Duitsland'; +$_MODULE['<{mondialrelay}prestashop>configuration_9891739094756d2605946c867b32ad28'] = 'Autriche'; +$_MODULE['<{mondialrelay}prestashop>configuration_89f9c9f489be2a83cf57e53b9197d288'] = 'Oostenrijk'; +$_MODULE['<{mondialrelay}prestashop>configuration_1007e1b7f894dfbf72a0eaa80f3bc57e'] = 'Verenigd Koninkrijk'; +$_MODULE['<{mondialrelay}prestashop>configuration_ea71b362e3ea9969db085abfccdeb10d'] = 'Portugal'; +$_MODULE['<{mondialrelay}prestashop>configuration_0c24ec05a02c710cedd400e3680d8b81'] = 'Lijst met verzendingsmethodes'; +$_MODULE['<{mondialrelay}prestashop>configuration_14039af96b01e718a9c9d9c1259b6472'] = 'Geen verzendingsmethodes aangemaakt'; +$_MODULE['<{mondialrelay}prestashop>configuration_59f7eec7440c6687288e747d4a7f40a0'] = 'ID_MR'; +$_MODULE['<{mondialrelay}prestashop>configuration_9cd59510f1c2c821657486bc4c0f7584'] = 'Vervoerder-ID'; +$_MODULE['<{mondialrelay}prestashop>configuration_914419aa32f04011357d3b604a86d7eb'] = 'Vervoerder'; +$_MODULE['<{mondialrelay}prestashop>configuration_aa9cd1f8c658c08a9ff87208e3b7ba17'] = 'Leveringslanden'; +$_MODULE['<{mondialrelay}prestashop>configuration_f2a6c498fb90ee345d997f888fce3b18'] = 'Verwijderen'; +$_MODULE['<{mondialrelay}prestashop>configuration_7dce122004969d56ae2e0245cb754d35'] = 'Bewerken'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_8d63728960e021f7632a11922685705e'] = 'Gelieve onderstaande fouten te corrigeren op'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_264f456c4202f0aba86e481a246a3ef1'] = 'de contactpagina:'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_7c5fd3d93bd19d81953db3b374997961'] = 'Kijk naar deze waarschuwing, misschien kan de bon niet worden aangemaakt'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_de21dc13e1ea638777fbfad49f88b332'] = 'Alle bestellingen met status'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_378116486b5a90bb50fd4f1557698d96'] = 'zijn beschikbaar voor het aanmaken van labels'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_5dadbd0ec9f0b182be4ead8dad39da79'] = 'Lijst met bestellingen'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_d79cf3f429596f77db95c65074663a54'] = 'Bestelling-ID'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_ce26601dac0dea138b7295f02b7620a7'] = 'Klant'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_0eede552438475bdfe820c13f24c9399'] = 'Totale prijs'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_c28e0582276cb6747e37d948e1727929'] = 'Totale verzendingskosten'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_44749712dbec183e983dcd78a7736c41'] = 'Datum'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_52150799c57e873360cca13c080a91b4'] = 'Voer gewicht (gram) in'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_353a5729c99abab9b3c8289317b7a0a4'] = 'Kies een verzekering'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_6ccc0fdff9995e1a0fce00c99e5b6085'] = 'MR-nummer'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_f9c50cba4de9032d7a6797a2458f8ed9'] = 'MR-land'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_428c091372d840900cf8536519fa0056'] = 'Expeditienummer'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_a254c25adc7d10d7e9c4889484f875a5'] = 'Detail'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_6d64e1c3efd87dde257ae83da23d7c05'] = 'Geen verzekering N0'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_23d246d67562088260e5629a39826a86'] = 'Aanvullende verzekering N1'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_ba98b5ad1ec30ae524c6332dcea740ee'] = 'Aanvullende verzekering N2'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_8b461a1d49779e5bb291b08b0bc7e21f'] = 'Aanvullende verzekering N3'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_31f29c5d469d45702b0559098359d27f'] = 'Aanvullende verzekering N4'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_5c509536a49ceed46f86b9efabde83ae'] = 'Aanvullende verzekering N5'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_4351cfebe4b61d8aa5efa1d020710005'] = 'Bekijken'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_2e01172e31495f41fcebcf3f831cc82c'] = 'Bewerking met succes uitgevoerd'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_37c85a61df6352af7285c307022c4413'] = 'Geen bestellingen met deze status.'; +$_MODULE['<{mondialrelay}prestashop>generate_tickets_32b919d18cfaca89383f6000dcc9c031'] = 'Aanmaken'; +$_MODULE['<{mondialrelay}prestashop>history_4f1a377c20ace646ddd303ad1e1d243d'] = 'Overzicht van label-aanmaak'; +$_MODULE['<{mondialrelay}prestashop>history_d79cf3f429596f77db95c65074663a54'] = 'Bestelling-ID'; +$_MODULE['<{mondialrelay}prestashop>history_e1a98101d56e29eeea312a0eb2748a92'] = 'Exp.num.'; +$_MODULE['<{mondialrelay}prestashop>history_aab39f783ba2e72eaad1770f4d9ad0c4'] = 'A4-label afdrukken'; +$_MODULE['<{mondialrelay}prestashop>history_3eb2bc1ee46258d2a166e89398756b3e'] = 'A5-label afdrukken'; +$_MODULE['<{mondialrelay}prestashop>history_beb01a974a6a87ef6eeaed92c4970405'] = '10x15-label afdrukken'; +$_MODULE['<{mondialrelay}prestashop>history_9e50665937cbb2f3c833d3626a9f9abb'] = 'Geen voormalige gegevens beschikbaar'; +$_MODULE['<{mondialrelay}prestashop>history_39a8c1a6d32fd2364eb3567967e4bd96'] = 'Geselecteerde A4-label afdrukken'; +$_MODULE['<{mondialrelay}prestashop>history_3d96962756b2dce870961e4658f8e8b5'] = 'Geselecteerde A5-label afdrukken'; +$_MODULE['<{mondialrelay}prestashop>history_e3743db648a23e969b0be5ef75639834'] = 'Geselecteerde 10x15-label afdrukken'; +$_MODULE['<{mondialrelay}prestashop>history_fa98e6528c9df7f26978c2beb7de3d99'] = 'De geselecteerde voormalige gegevens verwijderen'; +$_MODULE['<{mondialrelay}prestashop>post_action_466ec9f29b485204ef53818459da48af'] = 'Foutmelding(en)'; +$_MODULE['<{mondialrelay}prestashop>settings_0a4ee7474864081af12dba847fafdaa6'] = 'Instellingen tabblad Admin'; +$_MODULE['<{mondialrelay}prestashop>settings_d02bbc3cb147c272b0445ac5ca7d1a36'] = 'Bestelstatus'; +$_MODULE['<{mondialrelay}prestashop>settings_ca57625685f058f54d82c6e05876a131'] = 'Kies de bestelstatus voor labels.'; +$_MODULE['<{mondialrelay}prestashop>settings_c9cc8cce247e49bae79f15173ce97354'] = 'Opslaan'; +$_MODULE['<{mondialrelay}prestashop>settings_f4f70727dc34561dfde1a3c529b6205c'] = 'Instellingen'; +$_MODULE['<{mondialrelay}prestashop>checkout_process_836f6c949a2f2d61489bf410def82111'] = 'Mondia relay kan geen enkel afhaalpunt weergeven omwille van een fout in prestashop'; +$_MODULE['<{mondialrelay}prestashop>checkout_process_widget_ad3d06d03d94223fa652babc913de686'] = 'Bevestigen'; +$_MODULE['<{mondialrelay}prestashop>checkout_process_widget_b5cdf9b63fda35c33bb5e35cc3716b95'] = 'Geselecteerde afhaalpunt:'; +$_MODULE['<{mondialrelay}prestashop>header_e0626222614bdee31951d84c64e5e9ff'] = 'Selecteren'; +$_MODULE['<{mondialrelay}prestashop>header_91b442d385b54e1418d81adc34871053'] = 'Geselecteerd'; +$_MODULE['<{mondialrelay}prestashop>header_ef2a1f426c2c289ed5986c7636a5d696'] = 'Kies een afhaalpunt'; +$_MODULE['<{mondialrelay}prestashop>header_80a0c205cd57b22fca7f174253870300'] = 'Openingsuren'; +$_MODULE['<{mondialrelay}prestashop>header_2b56b60f878922093facd42284848a0c'] = 'Meer details'; +$_MODULE['<{mondialrelay}prestashop>header_widget_e0626222614bdee31951d84c64e5e9ff'] = 'Selecteren'; +$_MODULE['<{mondialrelay}prestashop>header_widget_91b442d385b54e1418d81adc34871053'] = 'Geselecteerd'; +$_MODULE['<{mondialrelay}prestashop>header_widget_ef2a1f426c2c289ed5986c7636a5d696'] = 'Kies een afhaalpunt'; +$_MODULE['<{mondialrelay}prestashop>header_widget_80a0c205cd57b22fca7f174253870300'] = 'Openingsuren'; +$_MODULE['<{mondialrelay}prestashop>header_widget_2b56b60f878922093facd42284848a0c'] = 'Meer details'; +$_MODULE['<{mondialrelay}prestashop>order_detail_a68825a6533d5eceea97b4426c7ceede'] = 'Levering in uw Point Relais®'; +$_MODULE['<{mondialrelay}prestashop>order_detail_c2d05abc7f5ebdc72b6656df35038b43'] = 'Mijn pakket volgen op de website van Mondial Relay'; diff --git a/modules/mondialrelay/selection.php b/modules/mondialrelay/selection.php new file mode 100755 index 00000000..9df7fcb3 --- /dev/null +++ b/modules/mondialrelay/selection.php @@ -0,0 +1,346 @@ +preProcess(); +$useSSL = TRUE; + +$mrSelection = new MrSelection(); +$mrSelection->run(); + +class MrSelection { + + private $mr_module = false; + private $id_lang = 2; + + public function run(){ + global $smarty; + + $this->displayHeader(); + $this->process(); + $this->displayFooter(); + } + + public function displayHeader(){ + Tools::addCSS(_THEME_CSS_DIR_.'addresses.css'); + Tools::addCSS(_PS_CSS_DIR_.'jquery.fancybox-1.3.4.css', 'screen'); + + // Adding JS files + Tools::addJS(_THEME_JS_DIR_.'tools.js'); + Tools::addJS(_PS_JS_DIR_.'jquery/jquery.fancybox-1.3.4.js'); + if ((int)(Configuration::get('PS_BLOCK_CART_AJAX')) OR Configuration::get('PS_ORDER_PROCESS_TYPE') == 1) + { + Tools::addJS(_THEME_JS_DIR_.'cart-summary.js'); + Tools::addJS(_PS_JS_DIR_.'jquery/jquery-typewatch.pack.js'); + } + + $_POST['controller'] = 'order'; + $_POST['step'] = 2; + + include(dirname(__FILE__).'/../../header.php'); + } + + public function displayHeaderMobile(){ + } + + public function hookExtraCarrier($address, $cart){ + global $smarty; + if (!MondialRelay::isAccountSet()) + return ''; + + $preSelectedRelay = $this->mr_module->getRelayPointSelected($cart->id); + $account_shop = MondialRelay::getAccountDetail(); + $id_carrier = (int) $cart->id_carrier; + $carriersList = $this->_getCarriers((int) $cart->id_carrier); + $country = new Country($address->id_country); + $id_zone = Address::getZoneById((int)($address->id)); + + /* Check if the defined carrier are ok */ + foreach ($carriersList as $k => $row) + { + /* For now works only with single shipping (>= 1.5 compatibility) */ + if (method_exists($cart, 'carrierIsSelected')) + { + if ($cart->carrierIsSelected($row['id_carrier'], $params['address']->id)) + $id_carrier = $row['id_carrier']; + } + + /* Temporary carrier for some test */ + $carrier = new Carrier((int)($row['id_carrier'])); + if ((($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT) && $carrier->getMaxDeliveryPriceByWeight($id_zone) === false) || (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE) && $carrier->getMaxDeliveryPriceByPrice($id_zone) === false)) + unset($carriersList[$k]); + else if ($row['range_behavior']) + { + /* Get id zone */ + $id_zone = Address::getZoneById((int) $address->id); + + if (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT && (!Carrier::checkDeliveryPriceByWeight($row['id_carrier'], $cart->getTotalWeight(), $id_zone))) || + ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE && + (!Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $cart->getOrderTotal(true, MondialRelay::BOTH_WITHOUT_SHIPPING), $id_zone, $cart->id_currency) || + !Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $cart->getOrderTotal(true, MondialRelay::BOTH_WITHOUT_SHIPPING), $id_zone, $cart->id_currency)))) + unset($carriersList[$k]); + } + } + + $carrier = null; + if ($id_carrier && ($method = MondialRelay::getMethodByIdCarrier($id_carrier))) + { + $carrier = new Carrier((int)$id_carrier); + /* Add dynamically a new field */ + $carrier->id_mr_method = $method['id_mr_method']; + $carrier->mr_dlv_mode = $method['dlv_mode']; + } + + if (Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS']) && Tools::strtolower($_SERVER['HTTPS']) != 'off')) + $ssl = 'true'; + else $ssl = 'false'; + + $smarty->assign(array( + 'id_cart' => (int) $cart->id, + 'address' => $address, + 'weight' => (float) $cart->getTotalWeight(), + 'id_address_delivery' => (int) $address->id, + 'account_shop' => $account_shop, + 'country' => $country, + 'ssl' => $ssl, + 'MR_Data'=> MRTools::jsonEncode(array( + 'carrier_list' => $carriersList, + 'carrier' => $carrier, + 'PS_VERSION' => _PS_VERSION_, + 'pre_selected_relay' => isset($preSelectedRelay['MR_selected_num']) ? $preSelectedRelay['MR_selected_num'] : -1, + )) + )); + + if (Configuration::get('MONDIAL_RELAY_MODE') == 'widget' && !_PS_MOBILE_) + return $this->mr_module->fetchTemplate('/views/templates/front/', 'selection_process_widget'); + else + return $this->mr_module->fetchTemplate('/views/templates/front/', 'selection_process'); + } + + + public function process(){ + global $cookie, $smarty; + $errors = array(); + + if (!$cookie->isLogged()) + Tools::redirect('authentication.php?back=/modules/mondialrelay/selection.php?id_order=' . Tools::getValue('id_order') . '&key=' . Tools::getValue('key')); + if (!Tools::getValue('id_order') || !Tools::getValue('key')){ + $smarty->assign(array('error' => 'Paramètres invalides.')); + return $this->display(); + } + + $order = new Order((int) Tools::getValue('id_order')); + if (!Validate::isLoadedObject($order) || $order->secure_key != Tools::getValue('key')){ + $smarty->assign(array('error' => 'Paramètres invalides.')); + return $this->display(); + } + + $mr_carriers = array(); + foreach (Db::getInstance()->executeS(' + SELECT c.id_carrier + FROM `'._DB_PREFIX_.'mr_method` m + LEFT JOIN `'._DB_PREFIX_.'carrier` c + ON c.`id_carrier` = m.`id_carrier` + ') as $row) { + $mr_carriers[] = (int) $row['id_carrier']; + } + + if (!in_array($order->id_carrier, $mr_carriers)){ + return $this->displayError('Un mode de livraison autre que Mondial Relay a été choisi pour cette commande.'); + } + + $this->id_lang = (int) $order->id_lang; + + $customer = new Customer((int) $order->id_customer); + if ((int) $customer->id != (int) $cookie->id_customer){ + $smarty->assign(array('error' => 'Merci de vous connecter avec le compte ayant passé cette commande afin de choisir votre point relais.')); + return $this->display(); + } + + $cart = new Cart((int) $order->id_cart); + + $this->mr_module = new MondialRelay(); + $address = new Address((int) $order->id_address_delivery); + $extraCarrier = $this->hookExtraCarrier($address, $cart); + + $groups = $customer->getGroups(); + $id_zone = Address::getZoneById((int)($address->id)); + + $carriers = array(); + $_carriers = $this->getCarriersForOrder($order->id_carrier, $cart); + foreach ($_carriers as $carrier) { + if(stristr($carrier['name'], 'Mondial Relay') !== FALSE){ + $carriers[] = $carrier; + } + } + + if (Tools::isSubmit('submit_mr_selection')){ + // update mr_selected + // $this->addMrSelected(); + if (!Db::getInstance()->getValue('SELECT `MR_Selected_Num` FROM `' . _DB_PREFIX_ . 'mr_selected` WHERE `id_cart` = ' . (int) $cart->id)){ + $smarty->assign(array( + 'error' => 'Vous devez sélectionner un point relais dans la liste.', + 'display_conf' => false, + )); + } + else{ + $smarty->assign(array( + 'display_conf' => true, + )); + return $this->display(); + } + } + + $smarty->assign(array( + 'mobile' => _PS_MOBILE_, + 'display_form' => true, + 'carriers' => $carriers, + 'id_order' => (int) Tools::getValue('id_order'), + 'key' => Tools::getValue('key'), + 'weight' => (float) $cart->getTotalWeight(), + 'id_address_delivery' => (int) $address->id, + 'id_cart' => (int) $order->id_cart, + 'extraCarrier' => $extraCarrier + )); + return $this->display(); + } + + public function displayError($error){ + global $smarty; + $smarty->assign(array('error' => $error)); + return $this->display(); + } + + public function display(){ + echo Module::display(dirname(__FILE__).'/mondialrelay.php', 'selection.tpl'); + } + + public function displayFooter(){ + include(dirname(__FILE__).'/../../footer.php'); + } + + public function addMrSelected(){ + return true; + $db = Db::getInstance(); + // insutance + $sql = 'SELECT insurance FROM '._DB_PREFIX_.'mr_method WHERE id_mr_method = '.(int)$this->_params['id_mr_method']; + $insurance = $db->getValue($sql); + + $query = 'SELECT `id_mr_selected` FROM `'._DB_PREFIX_.'mr_selected` WHERE `id_cart` = '.(int)$this->_params['id_cart'].' '; + + // Not exist and needed for database + unset($this->_params['relayPointInfo']['permaLinkDetail']); + + // Update if Exist else add a new entry + if ($db->getRow($query)) + { + $query = 'UPDATE `'._DB_PREFIX_.'mr_selected` + SET `id_method` = '.(int)$this->_params['id_mr_method'].', + `MR_insurance` = '.(int)$insurance.','; + if (is_array($this->_params['relayPointInfo'])) + foreach ($this->_params['relayPointInfo'] as $nameKey => $value) + $query .= '`MR_Selected_'.MRTools::bqSQL($nameKey).'` = "'.pSQL($value).'", '; + else // Clean the existing relay point data + $query .= ' + MR_Selected_Num = NULL, + MR_Selected_LgAdr1 = NULL, + MR_Selected_LgAdr2 = NULL, + MR_Selected_LgAdr3 = NULL, + MR_Selected_LgAdr4 = NULL, + MR_Selected_CP = NULL, + MR_Selected_Pays = NULL, + MR_Selected_Ville = NULL, '; + $query = rtrim($query, ', ').' WHERE `id_cart` = '.(int)$this->_params['id_cart']; + } + else + { + $query = 'INSERT INTO `'._DB_PREFIX_.'mr_selected` + (`id_customer`, `id_method`, `id_cart`, MR_insurance, '; + if (is_array($this->_params['relayPointInfo'])) + foreach ($this->_params['relayPointInfo'] as $nameKey => $value) + $query .= '`MR_Selected_'.MRTools::bqSQL($nameKey).'`, '; + $query = rtrim($query, ', ').') VALUES ( + '.(int)$this->_params['id_customer'].', + '.(int)$this->_params['id_mr_method'].', + '.(int)$this->_params['id_cart'].', + '.(int)$insurance.', '; + + if (is_array($this->_params['relayPointInfo'])) + foreach ($this->_params['relayPointInfo'] as $nameKey => $value) + $query .= '"'.pSQL($value).'", '; + $query = rtrim($query, ', ').')'; + } + $db->execute($query); + } + + public function _getCarriers($id_carrier){ + /* Query don't use the external_module_name to keep the */ + /* 1.3 compatibility */ + $query = ' + SELECT c.id_carrier, c.range_behavior, m.id_mr_method, + m.dlv_mode, cl.delay + FROM `'._DB_PREFIX_.'mr_method` m + LEFT JOIN `'._DB_PREFIX_.'carrier` c + ON c.`id_carrier` = m.`id_carrier` + LEFT JOIN `'._DB_PREFIX_.'carrier_lang` cl + ON c.`id_carrier` = cl.`id_carrier` + LEFT JOIN `'._DB_PREFIX_.'mr_method_shop` ms + ON m.`id_mr_method` = ms.`id_mr_method` + WHERE c.`id_carrier` = ' . (int) $id_carrier . ' + AND ms.`id_shop` = 1 + AND cl.id_lang = '.$this->id_lang.' + -- AND c.`active` = 1 + -- AND m.`is_deleted` = 0'; + + $carriers = Db::getInstance()->executeS($query); + + if (!is_array($carriers)) + $carriers = array(); + return $carriers; + } + + public function getCarriersForOrder($id_carrier, $cart) + { + $sql = ' + SELECT c.*, cl.delay + FROM `'._DB_PREFIX_.'carrier` c + LEFT JOIN `'._DB_PREFIX_.'carrier_lang` cl ON (c.`id_carrier` = cl.`id_carrier` AND cl.`id_lang` = '.(int)($id_lang).') + WHERE c.`id_carrier` = ' . $id_carrier; + + $result = Db::getInstance()->ExecuteS($sql); + + if (is_array($result) AND count($result)) + { + foreach ($result as $key => $carrier) + if ($carrier['name'] == '0') + $result[$key]['name'] = Configuration::get('PS_SHOP_NAME'); + } + else + $result = array(); + + $resultsArray = array(); + + foreach ($result AS $k => $row) + { + $carrier = new Carrier((int)$row['id_carrier']); + $shippingMethod = $carrier->getShippingMethod(); + + $row['name'] = (strval($row['name']) != '0' ? $row['name'] : Configuration::get('PS_SHOP_NAME')); + $row['price'] = ($shippingMethod == Carrier::SHIPPING_METHOD_FREE ? 0 : $cart->getOrderShippingCost((int)$row['id_carrier'])); + $row['price_tax_exc'] = ($shippingMethod == Carrier::SHIPPING_METHOD_FREE ? 0 : $cart->getOrderShippingCost((int)$row['id_carrier'], false)); + $row['img'] = file_exists(_PS_SHIP_IMG_DIR_.(int)($row['id_carrier']).'.jpg') ? _THEME_SHIP_DIR_.(int)($row['id_carrier']).'.jpg' : ''; + + // If price is false, then the carrier is unavailable (carrier module) + if ($row['price'] === false) + { + unset($result[$k]); + continue; + } + + $resultsArray[] = $row; + } + return $resultsArray; + } +} \ No newline at end of file diff --git a/modules/mondialrelay/selection.tpl b/modules/mondialrelay/selection.tpl new file mode 100755 index 00000000..635213eb --- /dev/null +++ b/modules/mondialrelay/selection.tpl @@ -0,0 +1,175 @@ +{capture name=path}{l s='Sélection de votre point retrait' mod='mondialrelay'}{/capture} +{include file="$tpl_dir./breadcrumb.tpl"} + + +
    +

    {l s='Sélection de votre point retrait' mod='mondialrelay'}

    +
    +
    +{if isset($error) && $error} +
    +

    {l s='Il y a une erreur :' mod='mondialrelay'}

    +
      +
    • {$error}
    • +
    +

    +{/if} + +{if isset($display_conf) && $display_conf} +

    {l s='Votre point relais a bien été enregistré.' mod='mondialrelay'}

    +{/if} + +{if isset($display_form) && $display_form} +
    + + + + + {if isset($mobile) && $mobile} + + + + + {if isset($carriers)} + {foreach from=$carriers item=carrier name=myLoop} + + + + + + {/foreach} + {$extraCarrier} + {/if} + +
    + + + + + {$carrier.delay|escape:'htmlall':'UTF-8'} + + {if $carrier.price} + {if $priceDisplay == 1} + {convertPrice price=$carrier.price_tax_exc} + {else} + {convertPrice price=$carrier.price} + {/if} + {if $use_taxes} + + {if $priceDisplay == 1} + {l s='HT'} + {else} + {l s='TTC'} + {/if} + + {/if} + {else} + {l s='Gratuit !'} + {/if} + +
    + + + + + {else} + + + + + + + + + + + + + + {if isset($carriers)} + {foreach from=$carriers item=carrier name=myLoop} + + + + + + + {/foreach} + {$extraCarrier} + {/if} + +
    {l s='Transporteur'}{l s='Information'}{l s='Prix'}
    + + + + {$carrier.delay|escape:'htmlall':'UTF-8'} + {if $carrier.price} + + {if $priceDisplay == 1}{convertPrice price=$carrier.price_tax_exc}{else}{convertPrice price=$carrier.price}{/if} + + {if $use_taxes}{if $priceDisplay == 1} {l s='HT'}{else} {l s='TTC'}{/if}{/if} + {else} + {l s='Gratuit!'} + {/if} +
    + + + {/if} + + + +

    {l s='Veuillez sélectionner votre transporteur puis sélectionner votre point retrait parmi la liste.'}

    +

    + + + +

    +
    +{/if} +
    \ No newline at end of file diff --git a/modules/mondialrelay/sql/index.php b/modules/mondialrelay/sql/index.php new file mode 100755 index 00000000..fc4110ff --- /dev/null +++ b/modules/mondialrelay/sql/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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; \ No newline at end of file diff --git a/modules/mondialrelay/upgrade/index.php b/modules/mondialrelay/upgrade/index.php new file mode 100755 index 00000000..fc4110ff --- /dev/null +++ b/modules/mondialrelay/upgrade/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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; \ No newline at end of file diff --git a/modules/mondialrelay/upgrade/install-1.8.0.php b/modules/mondialrelay/upgrade/install-1.8.0.php new file mode 100755 index 00000000..7d99093c --- /dev/null +++ b/modules/mondialrelay/upgrade/install-1.8.0.php @@ -0,0 +1,130 @@ + +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* File Example for upgrade */ + +if (!defined('_PS_VERSION_')) + exit; + +/* object module ($this) available */ +function upgrade_module_1_8_0($object) +{ + $upgrade_version = '1.8.0'; + + $object->upgrade_detail[$upgrade_version] = array(); + + /* Add new table to handle multi-shop for a carrier */ + $query = ' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'mr_method_shop` ( + `id_mr_method_shop` int(10) unsigned NOT NULL auto_increment, + `id_mr_method` int(10) unsigned NOT NULL, + `id_shop` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_mr_method_shop`) + ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'; + + if (!Db::getInstance()->execute($query)) + $object->upgrade_detail[$upgrade_version][] = $object->l('Can\'t create method shop table'); + + /* Refacto name */ + $query = ' + ALTER TABLE `'._DB_PREFIX_.'mr_method` CHANGE `id_mr_method` `id_mr_method` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT , + CHANGE `mr_Name` `name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , + CHANGE `mr_Pays_list` `country_list` VARCHAR( 1000 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , + CHANGE `mr_ModeCol` `col_mode` VARCHAR( 3 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , + CHANGE `mr_ModeLiv` `dlv_mode` VARCHAR( 3 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL , + CHANGE `mr_ModeAss` `insurance` VARCHAR( 3 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT \'0\', + CHANGE `id_carrier` `id_carrier` INT( 10 ) NOT NULL'; + + if (!Db::getInstance()->execute($query)) + $object->upgrade_detail[$upgrade_version][] = $object->l('Can\'t change name of the method table'); + + $query = 'RENAME TABLE `'._DB_PREFIX_.'mr_historique` TO `'._DB_PREFIX_.'mr_history`'; + + if (!Db::getInstance()->execute($query)) + $object->upgrade_detail[$upgrade_version][] = $object->l('Can\'t rename the history table'); + + $object->account_shop['MR_ENSEIGNE_WEBSERVICE'] = Configuration::get('MR_ENSEIGNE_WEBSERVICE'); + $object->account_shop['MR_CODE_MARQUE'] = Configuration::get('MR_CODE_MARQUE'); + $object->account_shop['MR_KEY_WEBSERVICE'] = Configuration::get('MR_KEY_WEBSERVICE'); + $object->account_shop['MR_LANGUAGE'] = Configuration::get('MR_LANGUAGE'); + $object->account_shop['MR_WEIGHT_COEFFICIENT'] = Configuration::get('MR_WEIGHT_COEF'); + $object->account_shop['MR_ORDER_STATE'] = Configuration::get('MONDIAL_RELAY_ORDER_STATE'); + $object->updateAccountShop(); + + Configuration::deleteByName('MONDIAL_RELAY_INSTALL_UPDATE'); + Configuration::deleteByName('MONDIAL_RELAY_ORDER_STATE'); + Configuration::deleteByName('MR_ENSEIGNE_WEBSERVICE'); + Configuration::deleteByName('MR_CODE_MARQUE'); + Configuration::deleteByName('MR_KEY_WEBSERVICE'); + Configuration::deleteByName('MR_WEIGHT_COEF'); + Configuration::deleteByName('MR_LANGUAGE'); + Configuration::deleteByName('MONDIAL_RELAY_1_4'); + Configuration::deleteByName('MONDIAL_RELAY_INSTALL_UPDATE_1'); + + Configuration::updateValue('MONDIAL_RELAY', $upgrade_version); + + $methods = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'mr_method`'); + if (count($methods)) + { + $query = ' + INSERT INTO `'._DB_PREFIX_.'mr_method_shop` + (id_mr_method, id_shop) VALUES '; + + foreach ($methods as $method) + $query .= '('.(int)$method['id_mr_method'].', '.(int)$object->account_shop['id_shop'].'),'; + $query = trim($query, ','); + if (!Db::getInstance()->execute($query)) + $object->upgrade_detail[$upgrade_version][] = $object->l('Can\'t update table mr_method_shop'); + + } + + if (!empty($object->installed_version)) + { + if ($object->installed_version < '1.4') + Db::getInstance()->execute(' + UPDATE `'._DB_PREFIX_.'carrier` + SET + `shipping_external` = 0, + `need_range` = 1, + `external_module_name` = "mondialrelay", + `shipping_method` = 1 + WHERE `id_carrier` + IN (SELECT `id_carrier` + FROM `'._DB_PREFIX_.'mr_method`)'); + } + + /* Try to register the new hook since 1.7 */ + if (!$object->isRegisteredInHook('newOrder')) + $object->registerHook('newOrder'); + if (!$object->isRegisteredInHook('BackOfficeHeader')) + $object->registerHook('BackOfficeHeader'); + + if (!$object->isRegisteredInHook('header')) + $object->registerHook('header'); + + return (bool)count($object->upgrade_detail[$upgrade_version]); +} \ No newline at end of file diff --git a/modules/mondialrelay/upgrade/install-1.8.3.php b/modules/mondialrelay/upgrade/install-1.8.3.php new file mode 100755 index 00000000..d416e1c6 --- /dev/null +++ b/modules/mondialrelay/upgrade/install-1.8.3.php @@ -0,0 +1,45 @@ + +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) + exit; + +/** +* object module available +*/ +function upgrade_module_1_8_3($object) +{ + $upgrade_version = '1.8.3'; + + $object->upgrade_detail[$upgrade_version] = array(); + + if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'mr_method` ADD `is_deleted` INT NOT NULL')) + $object->upgrade_detail[$upgrade_version][] = $object->l('Can\'t add new field in methodtable'); + + Configuration::updateValue('MONDIAL_RELAY', $upgrade_version); + return (bool)count($object->upgrade_detail[$upgrade_version]); +} \ No newline at end of file diff --git a/modules/mondialrelay/upgrade/install-2.0.6.php b/modules/mondialrelay/upgrade/install-2.0.6.php new file mode 100755 index 00000000..ff4f9fd4 --- /dev/null +++ b/modules/mondialrelay/upgrade/install-2.0.6.php @@ -0,0 +1,48 @@ + +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) + exit; + +/** +* object module available +*/ +function upgrade_module_2_0_6($object) +{ + $upgrade_version = '2.0.6'; + + $object->upgrade_detail[$upgrade_version] = array(); + + try { + if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'mr_selected` ADD `MR_insurance` INT( 11 ) NOT NULL AFTER `MR_poids`')) + $object->upgrade_detail[$upgrade_version][] = $object->l('Can\'t add new field in methodtable'); + } + catch (Exception $e) { } + + Configuration::updateValue('MONDIAL_RELAY', $upgrade_version); + return (bool)count($object->upgrade_detail[$upgrade_version]); +} \ No newline at end of file diff --git a/modules/mondialrelay/views/index.php b/modules/mondialrelay/views/index.php new file mode 100755 index 00000000..0bfbc8e9 --- /dev/null +++ b/modules/mondialrelay/views/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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; \ No newline at end of file diff --git a/modules/mondialrelay/views/templates/admin/bo-header.tpl b/modules/mondialrelay/views/templates/admin/bo-header.tpl new file mode 100755 index 00000000..877ca6cd --- /dev/null +++ b/modules/mondialrelay/views/templates/admin/bo-header.tpl @@ -0,0 +1,35 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 10285 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + + + \ No newline at end of file diff --git a/modules/mondialrelay/views/templates/admin/configuration.tpl b/modules/mondialrelay/views/templates/admin/configuration.tpl new file mode 100755 index 00000000..afb63568 --- /dev/null +++ b/modules/mondialrelay/views/templates/admin/configuration.tpl @@ -0,0 +1,390 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 6844 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +

    {l s='Mondial Relay Configuration' mod='mondialrelay'}

    + +{include file="$MR_local_path/views/templates/admin/post_action.tpl"} + +{* +** Menu bar +*} + + +
    +{l s='Please set your Mondial Relay account settings' mod='mondialrelay'} +
    + +{if $MR_upgrade_detail|count} +
    +
      + {foreach from=$MR_upgrade_detail item=message} +
    • {$message|escape:'htmlall':'UTF-8'}
    • + {/foreach} +
    +
    +{/if} + +{* +** Contact +*} +
    +
    + + {l s='Contact us' mod='mondialrelay'} + +
      +
    • + {l s='Mondial Relay Customer Service Team is available to assist you with freight enquiries. For general enquiries or to book please contact us by: ' mod='mondialrelay'} +
      +
      - {l s='Mail:' mod='mondialrelay'} servicecommercial@mondialrelay.com +
      - {l s='Tel:' mod='mondialrelay'} {l s='09.69.322.332 (appel non surtaxé)' mod='mondialrelay'} +
      +
      +
      + {l s='For further information please see the FAQ section of our website:' mod='mondialrelay'} +
      http://www.mondialrelay.fr +
    • + +
    +
    +
    +
    +{* +** General information +*} +
    +
    + + {l s='Try to turn off the cache and put the force compilation to on' mod='mondialrelay'} + + {l s='if you have any problems with the module after an update' mod='mondialrelay'} +
    + +
    + {l s='Have a look to the following HOW-TO to help you to configure the Mondial Relay module' mod='mondialrelay'} + + + + + +
    + +
    + +
    + + {l s='To create a Mondial Relay carrier' mod='mondialrelay'} + + - {l s='Enter and save your Mondial Relay account settings' mod='mondialrelay'}
    + - {l s='Create a Carrier using button' mod='mondialrelay'} {l s='Add shipping method with carrier button' mod='mondialrelay'}
    + - {l s='Define a price for your carrier on' mod='mondialrelay'} + {l s='The Carrier page' mod='mondialrelay'}
    + - {l s='To generate labels, you must have a valid and registered address of your store on your' mod='mondialrelay'} + {l s='contact page' mod='mondialrelay'}
    +
    +
    + +{* +** Account settings form +*} +
    +
    +
    + {l s='Mondial Relay Account Settings' mod='mondialrelay'} +
    + {l s='These parameters are provided by Mondial Relay once you subscribed to their service' mod='mondialrelay'} +
    +
      +
    • + + + * +
    • +
    • + + + * +
    • +
    • + + + * +
    • +
    • + + + * +
    • +
    • + + + * + {l s='grammes = 1 ' mod='mondialrelay'} +
    • +
    • + + {if $MR_webservice_key && $MR_code_marque && $MR_enseigne_webservice} + + {/if} +
    • +
    +
    *{l s='Required fields' mod='mondialrelay'}
    +
    + +
    +
    + +{if $MR_account_set} + +{* + ** Advanced settings + *} +
    +
    +
    + + {l s='Advanced Settings' mod='mondialrelay'} + + +
      +
    • + + {l s='Widget' mod='mondialrelay'} + {l s='Normal' mod='mondialrelay'} +
    • + +
    • + {l s='URL Cron Task:' mod='mondialrelay'} +
      + {$MR_CRON_URL|escape:'htmlall':'UTF-8'} +
    • + +
    • + +
    • +
    +
    + + +
    +
    + +{* + ** Add new shipping form + *} +
    +
    +
    + {l s='Add a Shipping Method' mod='mondialrelay'} +
      +
    • + + + * +
    • + +
    • + + + * +
    • + +
    • + + + * +
    • + +
    • + + + * +
    • + +
    • + + + * +
    • + +
    • + +
    • +
    +
    *{l s='Required fields' mod='mondialrelay'}
    +
    + +
    + +
    + +{* + ** Shipping List + *} +
    + {l s='Shipping Method\'s list' mod='mondialrelay'} + + {if $MR_carriers_list|count == 0} +
    • {l s='No shipping methods created' mod='mondialrelay'}
    + {else} + + + + + + + + + + + + + + + {foreach from=$MR_carriers_list key=num_carrier item=carrier} + + + + + + + + + + + {/foreach} + {/if} +
    {l s='ID_MR' mod='mondialrelay'}{l s='ID carrier' mod='mondialrelay'}{l s='Carrier' mod='mondialrelay'}{l s='Delivery mode' mod='mondialrelay'}{l s='Insurance' mod='mondialrelay'}{l s='Delivery countries' mod='mondialrelay'}{l s='Delete' mod='mondialrelay'}{l s='Edit' mod='mondialrelay'}
    + {$carrier.id_mr_method|intval} + + {$carrier.id_carrier|intval} + + {$carrier.name|escape:'htmlall':'UTF-8'} ({$carrier.col_mode|escape:'htmlall':'UTF-8'}) + + {$carrier.dlv_mode|escape:'htmlall':'UTF-8'} + + {$carrier.insurance|escape:'htmlall':'UTF-8'} + + {$carrier.country_list|escape:'htmlall':'UTF-8'} + +
    + + + {l s='Delete' mod='mondialrelay'} + +
    +
    + {if version_compare($smarty.const._PS_VERSION_,'1.6','<')} + + {l s='Edit' mod='mondialrelay'} + + {else} + + {l s='Edit' mod='mondialrelay'} + + {/if} +
    +
    +
    +{/if} diff --git a/modules/mondialrelay/views/templates/admin/generate_tickets.tpl b/modules/mondialrelay/views/templates/admin/generate_tickets.tpl new file mode 100755 index 00000000..63ef564d --- /dev/null +++ b/modules/mondialrelay/views/templates/admin/generate_tickets.tpl @@ -0,0 +1,136 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 10285 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $MR_errors_type.error|count} +
    + {l s='Please kindly correct the following errors on' mod='mondialrelay'} + + {l s='the contact page:' mod='mondialrelay'} + +
      + {foreach from=$MR_errors_type.error key=name item=message} +
    • {$name|escape:'htmlall':'UTF-8'}: {$message|escape:'htmlall':'UTF-8'}
    • + {/foreach} +
    +
    +{/if} +{if $MR_errors_type.warn|count} +
    + {l s='Please take a look to this following warning, maybe the ticket won\'t be generated' mod='mondialrelay'} +
      + {foreach from=$MR_errors_type.warn key=name item=message} +
    • {$name|escape:'htmlall':'UTF-8'}: {$message|escape:'htmlall':'UTF-8'}
    • + {/foreach} +
    +
    +{/if} + +

    +{l s='All orders which have the state' mod='mondialrelay'} "{$MR_order_state.name|escape:'htmlall':'UTF-8'}" {l s='will be available for creation of labels' mod='mondialrelay'} +

    +
    +
    + +
    +
    + +
    + {l s='Orders list' mod='mondialrelay'} +
    + + + + + + + + + + + + + + + + {foreach from=$MR_orders key=case_num item=order} + + + + + + + + + + + + + + + + + + + + + + + {/foreach} +
    {l s='Order ID' mod='mondialrelay'}{l s='Customer' mod='mondialrelay'}{l s='Total price' mod='mondialrelay'}{l s='Total shipping costs' mod='mondialrelay'}{l s='Date' mod='mondialrelay'}{l s='Insert weight (grams)' mod='mondialrelay'}{l s='Choose an insurance' mod='mondialrelay'}{l s='MR Number' mod='mondialrelay'}{l s='MR Country' mod='mondialrelay'}{l s='Exp Number' mod='mondialrelay'}{l s='Detail' mod='mondialrelay'}
    {$order.id_order|intval}{$order.customer|escape:'htmlall':'UTF-8'}{$order.display_total_price|floatval}{$order.display_shipping_price|floatval}{$order.display_date|escape:'htmlall':'UTF-8'} + + + + {$order.MR_Selected_Num|escape:'htmlall':'UTF-8'}{$order.MR_Selected_Pays|escape:'htmlall':'UTF-8'}{$order.exp_number|escape:'htmlall':'UTF-8'} + + {l s='View' mod='mondialrelay'} + +
    + {if !$MR_orders|count} +

    {l s='No orders with this state.' mod='mondialrelay'}

    + {else} +
    +
    + +
    +
    +
    + {/if} + +
    + +
    \ No newline at end of file diff --git a/modules/mondialrelay/views/templates/admin/history.tpl b/modules/mondialrelay/views/templates/admin/history.tpl new file mode 100755 index 00000000..a94e0a68 --- /dev/null +++ b/modules/mondialrelay/views/templates/admin/history.tpl @@ -0,0 +1,81 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 10285 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
    + {l s='History of labels creation' mod='mondialrelay'} +
    +
    + + + + + + + + + + + {foreach from=$MR_histories key=num_history item=history} + + + + + + + + + {/foreach} + +
    {l s='Order ID' mod='mondialrelay'}{l s='Exp num' mod='mondialrelay'}{l s='Print stick A4' mod='mondialrelay'}{l s='Print stick A5' mod='mondialrelay'}{l s='Print stick 10x15' mod='mondialrelay'}
    + + {$history.order|intval} + {$history.exp|escape:'htmlall':'UTF-8'} + + + + + + +
    + {if !$MR_histories|count} +
    +

    {l s='No histories available' mod='mondialrelay'}

    +
    + {/if} +
    + + + + +
    + +
    + +
    +
    + +
    \ No newline at end of file diff --git a/modules/mondialrelay/views/templates/admin/index.php b/modules/mondialrelay/views/templates/admin/index.php new file mode 100755 index 00000000..4deda527 --- /dev/null +++ b/modules/mondialrelay/views/templates/admin/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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; \ No newline at end of file diff --git a/modules/mondialrelay/views/templates/admin/post_action.tpl b/modules/mondialrelay/views/templates/admin/post_action.tpl new file mode 100755 index 00000000..2d40c9a5 --- /dev/null +++ b/modules/mondialrelay/views/templates/admin/post_action.tpl @@ -0,0 +1,42 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 10285 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
    +{if $MR_error_list|count} +
    + {$MR_error_list|count} {l s='error(s)' mod='mondialrelay'} +
      + {foreach from=$MR_error_list key=error_num item=error_message} +
    • {$error_message|escape:'htmlall':'UTF-8'}
    • + {/foreach} +
    +
    + {elseif $MR_form_action.type|strlen != 0} +
    + {$MR_form_action.message_success|escape:'htmlall':'UTF-8'} +
    +{/if} +
    \ No newline at end of file diff --git a/modules/mondialrelay/views/templates/admin/settings.tpl b/modules/mondialrelay/views/templates/admin/settings.tpl new file mode 100755 index 00000000..ef96590e --- /dev/null +++ b/modules/mondialrelay/views/templates/admin/settings.tpl @@ -0,0 +1,61 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 10285 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{include file="$MR_local_path/views/templates/admin/post_action.tpl"} + +{* +** Basic Settings +*} +
    +
    +
    + {l s='Admin Tab Settings' mod='mondialrelay'} + +
    + +

    + {l s='Choose the order state for labels.' mod='mondialrelay'} +

    +
    + +
    +
    + +
    +
    + +
    +
    + +
    \ No newline at end of file diff --git a/modules/mondialrelay/views/templates/front/checkout_process.tpl b/modules/mondialrelay/views/templates/front/checkout_process.tpl new file mode 100755 index 00000000..e221b9e6 --- /dev/null +++ b/modules/mondialrelay/views/templates/front/checkout_process.tpl @@ -0,0 +1,38 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 16067 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +{*if $MR_Data.PS_VERSION >= '1.5' && !$MR_Data.carrier} + {l s='Mondial relay can\'t fetch any replay point due to prestashop error' mod='mondialrelay'} +{/if*} \ No newline at end of file diff --git a/modules/mondialrelay/views/templates/front/checkout_process_widget.tpl b/modules/mondialrelay/views/templates/front/checkout_process_widget.tpl new file mode 100755 index 00000000..5bb9716b --- /dev/null +++ b/modules/mondialrelay/views/templates/front/checkout_process_widget.tpl @@ -0,0 +1,192 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 16067 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +{if $smarty.get.no_mr_selected} +

    + {l s='You have to select a relay point to use this delivery method.' mod='mondialrelay'} +

    +{/if} + +
    +   +
    +
    +
    +
    + {l s='Selected pickup location:' mod='mondialrelay'} +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/modules/mondialrelay/views/templates/front/header.tpl b/modules/mondialrelay/views/templates/front/header.tpl new file mode 100755 index 00000000..28add6c5 --- /dev/null +++ b/modules/mondialrelay/views/templates/front/header.tpl @@ -0,0 +1,55 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 10285 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + + +{if isset($addJsInTemplate)} + + +{/if} + + + +{if isset($page_name) && $page_name != 'module-mondialrelay-selection'} + +{/if} + diff --git a/modules/mondialrelay/views/templates/front/header_widget.tpl b/modules/mondialrelay/views/templates/front/header_widget.tpl new file mode 100755 index 00000000..040c1bdc --- /dev/null +++ b/modules/mondialrelay/views/templates/front/header_widget.tpl @@ -0,0 +1,51 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 16067 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} +{if isset($addJsInTemplate)} + + +{/if} + + + + + + + \ No newline at end of file diff --git a/modules/mondialrelay/views/templates/front/index.php b/modules/mondialrelay/views/templates/front/index.php new file mode 100755 index 00000000..7752dc5f --- /dev/null +++ b/modules/mondialrelay/views/templates/front/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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; \ No newline at end of file diff --git a/modules/mondialrelay/views/templates/front/jquery-overload.tpl b/modules/mondialrelay/views/templates/front/jquery-overload.tpl new file mode 100755 index 00000000..fc031815 --- /dev/null +++ b/modules/mondialrelay/views/templates/front/jquery-overload.tpl @@ -0,0 +1,37 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 10285 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $MR_overload_current_jquery} + + +{else} + + +{/if} diff --git a/modules/mondialrelay/views/templates/front/order_detail.tpl b/modules/mondialrelay/views/templates/front/order_detail.tpl new file mode 100755 index 00000000..9911271c --- /dev/null +++ b/modules/mondialrelay/views/templates/front/order_detail.tpl @@ -0,0 +1,38 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 14011 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +
    diff --git a/modules/mondialrelay/views/templates/front/selection_process.tpl b/modules/mondialrelay/views/templates/front/selection_process.tpl new file mode 100755 index 00000000..5c351a4e --- /dev/null +++ b/modules/mondialrelay/views/templates/front/selection_process.tpl @@ -0,0 +1,1368 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 16067 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + +{literal} + + + +{/literal} + + + +{*if $MR_Data.PS_VERSION >= '1.5' && !$MR_Data.carrier} + {l s='Mondial relay can\'t fetch any replay point due to prestashop error' mod='mondialrelay'} +{/if*} \ No newline at end of file diff --git a/modules/mondialrelay/views/templates/front/selection_process_widget.tpl b/modules/mondialrelay/views/templates/front/selection_process_widget.tpl new file mode 100755 index 00000000..4117e9ac --- /dev/null +++ b/modules/mondialrelay/views/templates/front/selection_process_widget.tpl @@ -0,0 +1,196 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 16067 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +{if $smarty.get.no_mr_selected} +

    + {l s='You have to select a relay point to use this delivery method.' mod='mondialrelay'} +

    +{/if} + +
    +   +
    +
    +
    +
    + {l s='Selected pickup location:' mod='mondialrelay'} +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/modules/mondialrelay/views/templates/index.php b/modules/mondialrelay/views/templates/index.php new file mode 100755 index 00000000..fc4110ff --- /dev/null +++ b/modules/mondialrelay/views/templates/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2015 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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; \ No newline at end of file diff --git a/modules/mondialrelay_old/AdminMondialRelay.gif b/modules/mondialrelay_old/AdminMondialRelay.gif new file mode 100755 index 00000000..7550096d Binary files /dev/null and b/modules/mondialrelay_old/AdminMondialRelay.gif differ diff --git a/modules/mondialrelay_old/AdminMondialRelay.php b/modules/mondialrelay_old/AdminMondialRelay.php new file mode 100755 index 00000000..ad725f05 --- /dev/null +++ b/modules/mondialrelay_old/AdminMondialRelay.php @@ -0,0 +1,243 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 9538 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once(dirname(__FILE__).'/classes/MondialRelayClass.php'); +require_once(dirname(__FILE__).'/classes/MRCreateTickets.php'); +require_once(dirname(__FILE__).'/mondialrelay.php'); + +class AdminMondialRelay extends AdminTab +{ + private $mondialrelay = NULL; + + public function __construct() + { + MondialRelay::initModuleAccess(); + + $this->table = 'mr_selected'; + $this->className = 'MondialRelayClass'; + + parent::__construct(); + } + + private function displayOrdersTable() + { + global $cookie; + + $mondialrelay = new MondialRelay(); + $order_state = new OrderState((int)(Configuration::get('MONDIAL_RELAY_ORDER_STATE')), $cookie->id_lang); + $mr_weight_coef = (int)(Configuration::get('MR_WEIGHT_COEF')); + + $html = ''; + + // Simulate a ticket generation + $MRCreateTicket = new MRCreateTickets(array( + 'orderIdList' => NULL, + 'totalOrder' => NULL, + 'weightList' => NULL)); + + $errorListTicket = $MRCreateTicket->checkPreValidation(); + + $titleType = array( + 'error' => $this->l('Thanks to kindly correct the following errors on '). + ' '. + $this->l('the contact page').':
      ', + 'warn' => $this->l('Please take a look to this following warning, maybe the ticket won\'t be generated')); + + foreach($errorListTicket as $errorType => $errorList) + { + if (count($errorList)) + { + $html .= '
      '.$titleType[$errorType]; + foreach($errorList as $type => $error) + $html .= '
    • '.$type.': '.$error.'
    • '; + $html .= '
    '; + } + } + + $html .= '

    '.$this->l('All orders which have the state').' "'.$order_state->name.'" '. + $this->l('will be available for sticker creation'); + $html .= '. ' . $this->l('Change configuration') . '

    +
    + + +
    '; + + $orders = MondialRelay::getOrders(array()); + if (empty($orders)) + $html.= '

    ' . $this->l('No orders with this state.') . '

    '; + else + { + $html.= '
    '; + $html.= "\n"; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + $html.= ''; + + foreach ($orders as $order) + { + if ($order['weight'] == 0) + { + $result_weight = Db::getInstance()->getRow(' + SELECT SUM(product_weight * product_quantity) as weight + FROM '._DB_PREFIX_.'order_detail + WHERE id_order = '.(int)($order['id_order'])); + $order['weight'] = round($mr_weight_coef * $result_weight['weight']); + } + + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ' + + + + + + + + + '; + } + $html .= ' +
    '.$this->l('Order ID').''.$this->l('Customer').''.$this->l('Total price').''.$this->l('Total shipping').''.$this->l('Date').''.$this->l('Put a Weight (grams)').''.$this->l('MR Number').''.$this->l('MR Country').''.$this->l('Exp Number').''.$this->l('Detail').'
    '.$order['id_order'].''.$order['customer'].''.Tools::displayPrice($order['total'], new Currency($order['id_currency'])) . ''.Tools::displayPrice($order['shipping'], new Currency($order['id_currency'])) . ''.Tools::displayDate($order['date'], $order['id_lang']).''.$order['MR_Selected_Num'].''.$order['MR_Selected_Pays'].''.$order['exp_number'].' + + '.$this->l('View').' +
    '; + $html .= ' +
    +
    + +
    +
    +
    '; + $html .= ''; + } + unset($mondialrelay); + unset($order_state); + return $html; + } + + public function displayhistoriqueForm() + { + $mondialrelay = new MondialRelay(); + $_html = ''; + $query = "SELECT * FROM `" . _DB_PREFIX_ ."mr_historique` ORDER BY `id` DESC ;"; + $query = Db::getInstance()->ExecuteS($query); + + $_html.= ' +
    + ' . $this->l('History of labels creation') . ' +
    +
    + + + + + + + + + '; + foreach ($query AS $k => $row) + { + $_html.= ' + + + + + + + '; + } + $_html .= ' + +
    ' . $this->l('Order ID') . '' . $this->l('Exp num') . '' . $this->l('Print stick A4') . '' . $this->l('Print stick A5') . '
    + + '.$row['order'].''.$row['exp'].' + + + +
    +
    + +
    + +
    +
    '; + + return $_html; + } + + public function display() + { + $html = ''; + + // Allow to override the older jquery to use a new one :) + // Added for the 1.3 compatibility to keep using the recent code + if (_PS_VERSION_ < '1.4') + $html .= MondialRelay::getjQueryCompatibility(); + + $html .= ' + '; + + $html .= $this->displayOrdersTable(); + $html .= '

    '; + $html .= $this->displayhistoriqueForm(); + echo $html; + } +} + +?> diff --git a/modules/mondialrelay_old/ajax.php b/modules/mondialrelay_old/ajax.php new file mode 100755 index 00000000..68230760 --- /dev/null +++ b/modules/mondialrelay_old/ajax.php @@ -0,0 +1,135 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 9219 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* + * File called by ajax. It's like a controler, you have to send the +* method name of the webservice and implement it. + * Each Name method allow to instanciate an object containing +* methods to manage correctly the data and name fields + */ + +require_once(realpath(dirname(__FILE__).'/../../config/config.inc.php')); +require_once(realpath(dirname(__FILE__).'/../../init.php')); +require(dirname(__FILE__).'/mondialrelay.php'); +require(dirname(__FILE__).'/classes/MRCreateTickets.php'); +require(dirname(__FILE__).'/classes/MRGetTickets.php'); +require(dirname(__FILE__).'/classes/MRGetRelayPoint.php'); +require(dirname(__FILE__).'/classes/MRRelayDetail.php'); +require(dirname(__FILE__).'/classes/MRManagement.php'); + + +global $cookie, $cart, $customer; + +MondialRelay::initModuleAccess(); + +// Access page List liable to the generated token +$accessPageList = array( + MondialRelay::getToken('front') => array( + 'MRGetRelayPoint', + 'addSelectedCarrierToDB'), + MondialRelay::getToken('back') => array( + 'MRGetTickets', + 'MRCreateTickets', + 'MRDeleteHistory', + 'uninstallDetail', + 'DeleteHistory')); + +$method = Tools::getValue('method'); +$token = Tools::getValue('mrtoken'); +$params = array(); +$result = array(); + +// If the method name assoacited to the token received doesn't match with +// the list, then we kill the request +if (!isset($accessPageList[$token]) || !in_array($method, $accessPageList[$token])) + exit(); + +// Method name allow to instanciate his object to properly call the +// implemented interface method and do his job +switch($method) +{ + case 'MRCreateTickets': + $params['orderIdList'] = Tools::getValue('order_id_list'); + $params['totalOrder'] = Tools::getValue('numSelected'); + $params['weightList'] = Tools::getValue('weight_list'); + break; + case 'MRGetTickets': + $params['detailedExpeditionList'] = Tools::getValue('detailedExpeditionList'); + break; + case 'DeleteHistory': + $params['historyIdList'] = Tools::getValue('history_id_list'); + break; + case 'uninstallDetail': + $params['action'] = Tools::getValue('action'); + break; + case 'MRGetRelayPoint': + $params['id_carrier'] = Tools::getValue('id_carrier'); + $params['weight'] = $cart->getTotalWeight(); + $params['id_address_delivery'] = $cart->id_address_delivery; + break; + case 'addSelectedCarrierToDB': + $params['id_carrier'] = Tools::getValue('id_carrier'); + $params['id_cart'] = $cart->id; + $params['id_customer'] = $cookie->id_customer; + $params['id_mr_method'] = Tools::getValue('id_mr_method'); + $params['relayPointInfo'] = Tools::getValue('relayPointInfo'); + break; + default: +} + +// Try to instanciate the method object name and call the necessaries method +try +{ + if (class_exists($method, false)) + { + $obj = new $method($params); + + // Verify that the class implement correctly the interface + // Else use a Management class to do some ajax stuff + if (($obj instanceof IMondialRelayWSMethod)) + { + $obj->init(); + $obj->send(); + $result = $obj->getResult(); + } + unset($obj); + } + elseif (($management = new MRManagement($params)) && + method_exists($management, $method)) + $result = $management->{$method}(); + else + throw new Exception('Method Class : '.$method.' can\'t be found'); + unset($management); +} +catch(Exception $e) +{ + echo MondialRelay::jsonEncode(array('other' => array('error' => array($e->getMessage())))); + exit(-1); +} +echo MondialRelay::jsonEncode($result); +exit(0); +?> diff --git a/modules/mondialrelay_old/classes/IMondialRelayWSMethod.php b/modules/mondialrelay_old/classes/IMondialRelayWSMethod.php new file mode 100755 index 00000000..18a38bc2 --- /dev/null +++ b/modules/mondialrelay_old/classes/IMondialRelayWSMethod.php @@ -0,0 +1,60 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 6594 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once(dirname(__FILE__).'/../errorCode.php'); +require_once(realpath(dirname(__FILE__).'/../mondialrelay.php')); +require_once(realpath(dirname(__FILE__).'/../lib/nusoap/nusoap.php')); + +/* + * This method allow to create any method object to dial more + * easyly with the Mondial Reelay WebService + */ +interface IMondialRelayWSMethod +{ + /* + * Initiate the data needed to be send properly + * Can manage a list of data for multiple request + */ + public function init(); + + /* + * Send one or multiple request to the webservice + */ + public function send(); + + /* + * Get the values with associated fields name + */ + public function getFieldsList(); + + /* + * Get the result of one or multiple send request + */ + public function getResult(); +} + +?> diff --git a/modules/mondialrelay/classes/JSMin.php b/modules/mondialrelay_old/classes/JSMin.php similarity index 100% rename from modules/mondialrelay/classes/JSMin.php rename to modules/mondialrelay_old/classes/JSMin.php diff --git a/modules/mondialrelay_old/classes/MRCreateTickets.php b/modules/mondialrelay_old/classes/MRCreateTickets.php new file mode 100755 index 00000000..9c22b14c --- /dev/null +++ b/modules/mondialrelay_old/classes/MRCreateTickets.php @@ -0,0 +1,608 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 10348 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* + * Interface + */ +require_once(dirname(__FILE__).'/IMondialRelayWSMethod.php'); + +/* + * Allow to create tickets - 'WSI2_CreationEtiquette' + */ +class MRCreateTickets implements IMondialRelayWSMethod +{ + private $_fields = array( + 'id_mr_selected' => 0, + 'list' => array( + 'Enseigne' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z]{2}[0-9A-Z ]{6}$#'), + 'ModeCol' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^(CCC|CDR|CDS|REL)$#'), + 'ModeLiv' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^(LCC|LD1|LDS|24R|ESP|DRI)$#'), + 'NDossier' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|[0-9A-Z_ -]{0,15})$#'), + 'NClient' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|[0-9A-Z]{0,9})$#'), + 'Expe_Langage' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[A-Z]{2}$#'), + 'Expe_Ad1' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z_\-\'., /]{2,32}$#'), + 'Expe_Ad2' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z_\-\'., /]{0,32}$#'), + 'Expe_Ad3' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z_\-\'., /]{0,32}$#'), + 'Expe_Ad4' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z]{2}[0-9A-Z ]{6}$#'), + 'Expe_Ville' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[A-Z_\-\' ]{2,26}$#'), + 'Expe_CP' => array( + 'required' => true, + 'value' => '', + 'params' => array(), + 'methodValidation' => 'checkZipcodeByCountry'), + 'Expe_Pays' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[A-Z]{2}$#'), + 'Expe_Tel1' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^((00|\+)[1-9]{2}|0)[0-9][0-9]{7,8}$#'), + 'Expe_Tel2' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^((00|\+)[1-9]{2}|0)[0-9][0-9]{7,8}$#'), + 'Expe_Mail' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[\w\-\.\@_]{0,70}$#'), + 'Dest_Langage' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[A-Z]{2}$#'), + 'Dest_Ad1' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z_\-\'., /]{2,32}$#'), + 'Dest_Ad2' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z_\-\'., /]{2,32}$#'), + 'Dest_Ad3' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z_\-\'., /]{2,32}$#'), + 'Dest_Ad4' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z_\-\'., /]{0,32}$#'), + 'Dest_Ville' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[A-Z_\-\' ]{2,26}$#'), + 'Dest_CP' => array( + 'required' => true, + 'value' => '', + 'params' => array(), + 'methodValidation' => 'checkZipcodeByCountry'), + 'Dest_Pays' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[A-Z]{2}$#'), + 'Dest_Tel1' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^((00|\+)[1-9]{2}|0)[0-9][0-9]{7,8}$#'), + 'Dest_Tel2' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^((00|\+)[1-9]{2}|0)[0-9][0-9]{7,8}$#'), + 'Dest_Mail' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[\w\-\.\@_]{0,70}$#'), + 'Poids' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9]{3,7}$#'), + 'Longueur' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[0-9]{0,3}$#'), + 'Taille' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(XS|S|M|L|XL|XXL|3XL)$#'), + 'NbColis' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9]{1,2}$#'), + 'CRT_Valeur' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9]{1,7}$#'), + 'CRT_Devise' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|EUR)$#'), + 'Exp_Valeur' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[0-9]{0,7}$#'), + 'Exp_Devise' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|EUR)$#'), + 'COL_Rel_Pays' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[A-Z]{2}$#'), + 'COL_Rel' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|[0-9]{6})$#'), + 'LIV_Rel_Pays' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[A-Z]{2}$#'), + 'LIV_Rel' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|[0-9]{6})$#'), + 'TAvisage' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|O|N)$#'), + 'TReprise' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|O|N)$#'), + 'Montage' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|[0-9]{1,3})$#'), + 'TRDV' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|O|N)$#'), + 'Assurance' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(|[0-9A-Z]{1})$#'), + 'Instructions' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z_\-\'., /]{0,31}#'), + 'Security' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z]{32}$#'), + 'Texte' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^([^<>&\']{3,30})(\(cr\)[^<>&\']{0,30}){0,9}$#'))); + + private $_orderListId = NULL; + private $_totalOrder = 0; + private $_weightList = NULL; + private $_mondialRelay = NULL; + private $_fieldsList = array(); + private $_webServiceKey = ''; + private $_markCode = ''; + + private $_resultList = array( + 'error' => array(), + 'success' => array()); + + private $_webserviceURL = 'http://www.mondialrelay.fr/webservice/Web_Services.asmx?WSDL'; + + public function __construct($params) + { + $this->_orderListId = $params['orderIdList']; + $this->_totalOrder = $params['totalOrder']; + $this->_weightList = $params['weightList']; + $this->_webServiceKey = Configuration::get('MR_KEY_WEBSERVICE'); + $this->_markCode = Configuration::get('MR_CODE_MARQUE'); + } + + public function __destruct() + { + unset($this->_mondialRelay); + } + + /* + * Build a correct weight format (NNNNN) + */ + private function _weightFormat($weight) + { + while (strlen($weight) != 5) + $weight = '0'.$weight; + return $weight; + } + + /* + * Set the default value to the order paramaters + */ + private function _setRequestDefaultValue() + { + $this->_fields['list']['Enseigne']['value'] = Configuration::get('MR_ENSEIGNE_WEBSERVICE'); + $this->_fields['list']['Expe_Langage']['value'] = Configuration::get('MR_LANGUAGE'); + $this->_fields['list']['Expe_Ad1']['value'] = Configuration::get('PS_SHOP_NAME'); + $this->_fields['list']['Expe_Ad3']['value'] = Configuration::get('PS_SHOP_ADDR1'); + // Deleted, cause to many failed for the process + // $this->_fields['list']['Expe_Ad4']['value'] = Configuration::get('PS_SHOP_ADDR2'); + $this->_fields['list']['Expe_Ville']['value'] = Configuration::get('PS_SHOP_CITY'); + $this->_fields['list']['Expe_CP']['value'] = Configuration::get('PS_SHOP_CODE'); + $this->_fields['list']['Expe_CP']['params']['id_country'] = Configuration::get('PS_COUNTRY_DEFAULT'); + + if (_PS_VERSION_ >= '1.4') + $this->_fields['list']['Expe_Pays']['value'] = Country::getIsoById(Configuration::get('PS_SHOP_COUNTRY_ID')); + else + $this->_fields['list']['Expe_Pays']['value'] = substr(Configuration::get('PS_SHOP_COUNTRY'), 0, 2); + + $this->_fields['list']['Expe_Tel1']['value'] = str_replace(array('.', ' ', '-', '_'), '', Configuration::get('PS_SHOP_PHONE')); + $this->_fields['list']['Expe_Mail']['value'] = Configuration::get('PS_SHOP_EMAIL'); + $this->_fields['list']['NbColis']['value'] = 1; + $this->_fields['list']['CRT_Valeur']['value'] = 0; + $this->_fields['list']['CRT_Devise']['value'] = 'EUR'; + } + + /* + * Initiate the data needed to be send properly + * Can manage a list of data for multiple request + */ + public function init() + { + $this->_mondialRelay = new MondialRelay(); + + if ($this->_totalOrder == 0) + throw new Exception($this->_mondialRelay->l('Please select at least one order')); + + $this->_setRequestDefaultValue(); + if (count($orderListDetails = $this->_mondialRelay->getOrders($this->_orderListId))) + { + foreach ($orderListDetails as $orderDetail) + { + // Storage temporary + $base = $this->_fields; + $tmp = &$base['list']; + + $deliveriesAddress = new Address($orderDetail['id_address_delivery']); + $customer = new Customer($orderDetail['id_customer']); + + // Store the weight order set by the user + foreach($this->_weightList as $orderWeightInfos) + { + $detail = explode('-', $orderWeightInfos); + if (count($detail) == 2 && $detail[1] == $orderDetail['id_order']) + $tmp['Poids']['value'] = $this->_weightFormat($detail[0]); + } + + $destIsoCode = Country::getIsoById($deliveriesAddress->id_country); + $tmp['ModeCol']['value'] = $orderDetail['mr_ModeCol']; + $tmp['ModeLiv']['value'] = $orderDetail['mr_ModeLiv']; + $tmp['NDossier']['value'] = $orderDetail['id_order']; + $tmp['NClient']['value'] = $orderDetail['id_customer']; + $tmp['Dest_Langage']['value'] = 'FR'; //Language::getIsoById($orderDetail['id_lang']); + $tmp['Dest_Ad1']['value'] = substr($deliveriesAddress->firstname.' '.$deliveriesAddress->lastname, 0, 32);; + $tmp['Dest_Ad2']['value'] = substr($deliveriesAddress->address2, 0, 32); + $tmp['Dest_Ad3']['value'] = substr($deliveriesAddress->address1, 0, 32); + $tmp['Dest_Ville']['value'] = $deliveriesAddress->city; + $tmp['Dest_CP']['value'] = $deliveriesAddress->postcode; + $tmp['Dest_CP']['params']['id_country'] = $deliveriesAddress->id_country; + $tmp['Dest_Pays']['value'] = $destIsoCode; + $tmp['Dest_Tel1']['value'] = str_replace(array('.', ' ', '-', '_'), '', $deliveriesAddress->phone); + $tmp['Dest_Tel2']['value'] = str_replace(array('.', ' ', '-', '_'), '', $deliveriesAddress->phone_mobile); + $tmp['Dest_Mail']['value'] = $customer->email; + $tmp['Assurance']['value'] = $orderDetail['mr_ModeAss']; + if ($orderDetail['MR_Selected_Num'] != 'LD1' && $orderDetail['MR_Selected_Num'] != 'LDS') + { + $tmp['LIV_Rel_Pays']['value'] = $orderDetail['MR_Selected_Pays']; + $tmp['LIV_Rel']['value'] = $orderDetail['MR_Selected_Num']; + } + + // Store the necessary information to the root case table + $base['id_mr_selected'] = $orderDetail['id_mr_selected']; + + // Add the temporary values to a field list for multiple request + $this->_fieldsList[] = $base; + unset($deliveriesAddress); + unset($customer); + } + $this->_generateMD5SecurityKey(); + } + } + + /* + * Generate the MD5 key for each param list + */ + private function _generateMD5SecurityKey() + { + // RootCase is the array case where the main information are stored + // it's an array containing id_mr_selected and an array with the necessary fields + foreach($this->_fieldsList as &$rootCase) + { + $concatenationValue = ''; + foreach($rootCase['list'] as $paramName => &$valueDetailed) + if ($paramName != 'Texte' && $paramName != 'Security') + { + // Mac server make an empty string instead of a cleaned string + // TODO : test on windows and linux server + $cleanedString = MRTools::replaceAccentedCharacters($valueDetailed['value']); + $valueDetailed['value'] = !empty($cleanedString) ? strtoupper($cleanedString) : strtoupper($valueDetailed['value']); + + // Call a pointer function if exist to do different test + if (isset($valueDetailed['methodValidation']) && + method_exists('MRTools', $valueDetailed['methodValidation']) && + isset($valueDetailed['params']) && + MRTools::$valueDetailed['methodValidation']($valueDetailed['value'], $valueDetailed['params'])) + $concatenationValue .= $valueDetailed['value']; + // Use simple Regex test given by MondialRelay + else if (isset($valueDetailed['regexValidation']) && + preg_match($valueDetailed['regexValidation'], $valueDetailed['value'], $matches)) + $concatenationValue .= $valueDetailed['value']; + // If the key is required, we set an error, else it's skipped + else if ((!strlen($valueDetailed['value']) && $valueDetailed['required']) || strlen($valueDetailed['value'])) + { + if (empty($valueDetailed['value'])) + $error = $this->_mondialRelay->l('This key').' ['.$paramName.'] '.$this->_mondialRelay->l('is empty and need to be filled'); + else + $error = 'This key ['.$paramName.'] hasn\'t a valid value format : '.$valueDetailed['value']; + $this->_resultList['error'][$rootCase['list']['NDossier']['value']][] = $error; + } + } + $concatenationValue .= $this->_webServiceKey; + $rootCase['list']['Security']['value' ] = strtoupper(md5($concatenationValue)); + } + } + + /* + * Update the tables used and send mail with the order history + */ + private function _updateTable($params, $expeditionNum, $ticketURL, $trackingURL, $id_mr_selected) + { + global $cookie; + + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'mr_selected` + SET `MR_poids` = \''.pSQL($params['Poids']).'\', + `exp_number` = \''.pSQL($expeditionNum).'\', + `url_etiquette` = \''.pSQL($ticketURL).'\', + `url_suivi` = \''.pSQL($trackingURL).'\' + WHERE id_mr_selected = '.(int)$id_mr_selected); + + // NDossier contains the id_order + $order = new Order($params['NDossier']); + + // Update the database for order and orderHistory + $order->shipping_number = $expeditionNum; + $order->update(); + + $templateVars = array('{followup}' => $trackingURL); + $orderState = (Configuration::get('PS_OS_SHIPPING')) ? + Configuration::get('PS_OS_SHIPPING') : + _PS_OS_SHIPPING_; + + $history = new OrderHistory(); + $history->id_order = (int)$params['NDossier']; + $history->changeIdOrderState($orderState, (int)$params['NDossier']); + $history->id_employee = (int)$cookie->id_employee; + $history->addWithemail(true, $templateVars); + + unset($order); + unset($history); + } + + /* + * Manage the return value of the webservice, handle the errors or build the + * succeed message + */ + private function _parseResult($client, $result, $params, $id_mr_selected) + { + $errors = &$this->_resultList['error'][$params['NDossier']]; + $success = &$this->_resultList['success'][$params['NDossier']]; + + if ($client->fault) + $errors[] = $this->_mondialRelay->l('It seems the request isn\'t valid:'). + $result; + + $result = $result['WSI2_CreationEtiquetteResult']; + if (($errorNumber = $result['STAT']) != 0) + { + $errors[] = $this->_mondialRelay->l('There is an error number : ').$errorNumber; + $errors[] = $this->_mondialRelay->l('Details : '). + $this->_mondialRelay->getErrorCodeDetail($errorNumber); + } + else + { + $baseURL = 'http://www.mondialrelay.fr/'; + $expedition = $result['ExpeditionNum']; + $securityKey = strtoupper(md5('<'.$params['Enseigne'].$this->_markCode. + '>'.$expedition.'<'.$this->_webServiceKey.'>')); + $ticketURL = $baseURL.$result['URL_Etiquette']; + $trackingURL = $baseURL. + 'lg_fr/espaces/url/popup_exp_details.aspx?cmrq='.$params['Enseigne']. + $this->_markCode.'&nexp='.$expedition.'&crc='.$securityKey; + + $success['displayExpedition'] = $this->_mondialRelay->l('Expedition Number : ') . $expedition; + $success['displayTicketURL'] = $this->_mondialRelay->l('Ticket URL : ') . $ticketURL; + $success['displayTrackingURL'] = $this->_mondialRelay->l('Tracking URL: ') . $trackingURL; + $success['expeditionNumber'] = $expedition; + + $this->_updateTable($params, $expedition, $ticketURL, $trackingURL, $id_mr_selected); + } + } + + /* + * Send one or multiple request to the webservice + */ + public function send() + { + if ($client = new nusoap_client($this->_webserviceURL, true)) + { + $client->soap_defencoding = 'UTF-8'; + $client->decode_utf8 = false; + + foreach($this->_fieldsList as $rootCase) + { + $params = $this->_getSimpleParamArray($rootCase['list']); + $result = $client->call( + 'WSI2_CreationEtiquette', + $params, + 'http://www.mondialrelay.fr/webservice/', + 'http://www.mondialrelay.fr/webservice/WSI2_CreationEtiquette'); + + $this->_parseResult($client, $result, $params, $rootCase['id_mr_selected']); + } + unset($client); + } + else + throw new Exception($this->_mondialRelay->l('The Mondial Relay webservice isn\'t currently reliable')); + } + + /* + ** Check if the shop parameter are currently well configured + */ + public function checkPreValidation() + { + $errorList = array('error' => array(), 'warn' => array()); + + if (!$this->_mondialRelay) + $this->_mondialRelay = new MondialRelay(); + + $list = array( + 'Expe_Langage' => array( + 'value' => Configuration::get('MR_LANGUAGE'), + 'error' => $this->_mondialRelay->l('Please check your language configuration')), + 'Expe_Ad1' => array( + 'value' => Configuration::get('PS_SHOP_NAME'), + 'error' => $this->_mondialRelay->l('Please check your shop name configuration')), + 'Expe_Ad3' => array( + 'value' => Configuration::get('PS_SHOP_ADDR1'), + 'error' => $this->_mondialRelay->l('Please check your address 1 configuration')), + 'Expe_Ville' => array( + 'value' => Configuration::get('PS_SHOP_CITY'), + 'error' => $this->_mondialRelay->l('Please check your city configuration')), + 'Expe_CP' => array( + 'value' => Configuration::get('PS_SHOP_CODE'), + 'error' => $this->_mondialRelay->l('Please check your zipcode configuration'), + 'warn' => $this->_mondialRelay->l('It seems the layout of your zipcode country is not configured or you didn\'t set a right zipcode')), + 'Expe_Pays' => array( + 'value' => ((_PS_VERSION_ >= '1.4') ? + Country::getIsoById(Configuration::get('PS_SHOP_COUNTRY_ID')) : + substr(Configuration::get('PS_SHOP_COUNTRY'), 0, 2)), + 'error' => $this->_mondialRelay->l('Please check your country configuration')), + 'Expe_Tel1' => array( + 'value' => str_replace(array('.', ' ', '-'), '', Configuration::get('PS_SHOP_PHONE')), + 'error' => $this->_mondialRelay->l('Please check your Phone configuration')), + 'Expe_Mail' => array( + 'value' => Configuration::get('PS_SHOP_EMAIL'), + 'error' => $this->_mondialRelay->l('Please check your mail configuration'))); + + foreach($list as $name => $tab) + { + // Mac server make an empty string instead of a cleaned string + // TODO : test on windows and linux server + $cleanedString = MRTools::replaceAccentedCharacters($tab['value']); + $tab['value'] = !empty($cleanedString) ? strtoupper($cleanedString) : strtoupper($tab['value']); + + if ($name == 'Expe_CP') + { + if (!($zipcodeError = MRTools::checkZipcodeByCountry($tab['value'], array( + 'id_country' => Configuration::get('PS_COUNTRY_DEFAULT'))))) + $errorList['error'][$name] = $tab['error']; + else if ($zipcodeError < 0) + $errorList['warn'][$name] = $tab['warn']; + } + else if (isset($this->_fields['list'][$name]['regexValidation']) && + (!preg_match($this->_fields['list'][$name]['regexValidation'], $tab['value'], $matches))) + $errorList['error'][$name] = $tab['error']; + } + return $errorList; + } + + /* + * Get the values with associated fields name + * @fields : array containing multiple values information + */ + private function _getSimpleParamArray($fields) + { + $params = array(); + + foreach($fields as $keyName => $valueDetailed) + $params[$keyName] = $valueDetailed['value']; + return $params; + } + + /* + * Return the fields list + */ + public function getFieldsList() + { + return $this->_fieldsList['list']; + } + + /* + * Return the result of one or multiple sent requests + */ + public function getResult() + { + return $this->_resultList; + } + + /* + * Return which number order of the list is currently managed + */ + public static function getCurrentRequestUnderTraitment() + { + // TODO: Build a SQL Query to know how many request have been executed + } +} +?> diff --git a/modules/mondialrelay_old/classes/MRGetRelayPoint.php b/modules/mondialrelay_old/classes/MRGetRelayPoint.php new file mode 100755 index 00000000..6ba8e773 --- /dev/null +++ b/modules/mondialrelay_old/classes/MRGetRelayPoint.php @@ -0,0 +1,297 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 7086 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* + * Interface + */ +require_once(dirname(__FILE__).'/IMondialRelayWSMethod.php'); + +/* + * Allow to fetch relay point - 'WSI2_RecherchePointRelais' + */ +class MRGetRelayPoint implements IMondialRelayWSMethod +{ + // Params is required if you use a pointer function + private $_fields = array( + 'list' => array( + 'Enseigne' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z]{2}[0-9A-Z ]{6}$#'), + 'Pays' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[A-Z]{2}$#'), + 'Ville' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[A-Z_\-\' ]{2,25}$#'), + 'CP' => array( + 'required' => false, + 'value' => '', + 'params' => array(), + 'methodValidation' => 'checkZipcodeByCountry'), + 'Taille' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(XS|S|M|L|XL|XXL|3XL)$#'), + 'Poids' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^[0-9]{1,6}$#'), + 'Action' => array( + 'required' => false, + 'value' => '', + 'regexValidation' => '#^(REL|24R|ESP|DRI)$#'), + 'Security' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z]{32}$#'))); + + private $_id_address_delivery = 0; + private $_weight = 0; + private $_webServiceKey = ''; + private $_mondialRelay = NULL; + private $_id_carrier = 0; + private $_id_delivery_country = 0; + + private $_resultList = array( + 'error' => array(), + 'success' => array()); + + private $_webserviceURL = 'http://www.mondialrelay.fr/webservice/Web_Services.asmx?WSDL'; + + public function __construct($params) + { + $this->_id_address_delivery = (int)($params['id_address_delivery']); + $this->_id_carrier = (int)($params['id_carrier']); + $this->_weight = (float)($params['weight']); + $this->_webServiceKey = Configuration::get('MR_KEY_WEBSERVICE'); + } + + public function __destruct() + { + unset($this->_mondialRelay); + } + + public function init() + { + $this->_mondialRelay = new MondialRelay(); + $address = new Address($this->_id_address_delivery); + + if (!$address) + throw new Exception($this->_mondialrelay->l('Customer address can\'t be found')); + + $this->_fields['list']['Enseigne']['value'] = Configuration::get('MR_ENSEIGNE_WEBSERVICE'); + $this->_fields['list']['Poids']['value'] = Configuration::get('MR_WEIGHT_COEF') * $this->_weight; + $this->_fields['list']['Pays']['value'] = Country::getIsoById($address->id_country); + $this->_fields['list']['Ville']['value'] = $address->city; + $this->_fields['list']['CP']['value'] = $address->postcode; + $this->_fields['list']['CP']['params']['id_country'] = $address->id_country; + + $this->_generateMD5SecurityKey(); + unset($address); + } + + /* + * Generate the MD5 key for each param list + */ + private function _generateMD5SecurityKey() + { + $concatenationValue = ''; + foreach($this->_fields['list'] as $paramName => &$valueDetailed) + if ($paramName != 'Texte' && $paramName != 'Security') + { + // Mac server make an empty string instead of a cleaned string + // TODO : test on windows and linux server + $cleanedString = MRTools::replaceAccentedCharacters($valueDetailed['value']); + $valueDetailed['value'] = !empty($cleanedString) ? strtoupper($cleanedString) : strtoupper($valueDetailed['value']); + + $valueDetailed['value'] = strtoupper($valueDetailed['value']); + // Call a pointer function if exist to do different test + if (isset($valueDetailed['methodValidation']) && + method_exists('MRTools', $valueDetailed['methodValidation']) && + isset($valueDetailed['params']) && + MRTools::$valueDetailed['methodValidation']($valueDetailed['value'], $valueDetailed['params'])) + $concatenationValue .= $valueDetailed['value']; + // Use simple Regex test given by MondialRelay + else if (isset($valueDetailed['regexValidation']) && + preg_match($valueDetailed['regexValidation'], $valueDetailed['value'], $matches)) + $concatenationValue .= $valueDetailed['value']; + // If the key is required, we set an error, else it's skipped + else if ((!strlen($valueDetailed['value']) && $valueDetailed['required']) || strlen($valueDetailed['value'])) + { + $error = $this->_mondialRelay->l('This key').' ['.$paramName.'] '. + $this->_mondialRelay->l('hasn\'t a valide value format').' : '.$valueDetailed['value']; + $this->_resultList['error'][] = $error; + } + } + $concatenationValue .= $this->_webServiceKey; + $this->_fields['list']['Security']['value'] = strtoupper(md5($concatenationValue)); + } + + /* + * Get the values with associated fields name + * @fields : array containing multiple values information + */ + private function _getSimpleParamArray($fields) + { + $params = array(); + + foreach($fields as $keyName => $valueDetailed) + $params[$keyName] = $valueDetailed['value']; + return $params; + } + + /* + ** Get detail information for each relay + */ + private function _getRelayPointDetails($relayPointList) + { + $relayPointNumList = array(); + foreach($relayPointList as $num => $relayPoint) + $relayPointNumList[] = $relayPoint['Num']; + + $MRRelayDetail = new MRRelayDetail(array( + 'relayPointNumList' => $relayPointNumList, + 'id_address_delivery' => $this->_id_address_delivery)); + $MRRelayDetail->init(); + $MRRelayDetail->send(); + return $MRRelayDetail->getResult(); + } + + /* + ** Generate a perman link to view relay detail on their website + */ + private function _addLinkHoursDetail(&$relayPointList) + { + $relayPointNumList = array(); + foreach($relayPointList as $num => $relayPoint) + $relayPointNumList[] = $relayPoint['Num']; + $permaList = MRRelayDetail::getPermaLink($relayPointNumList, $this->_id_address_delivery); + foreach($relayPointList as $num => &$relayPoint) + { + $relayPoint['permaLinkDetail'] = ''; + if (array_key_exists($relayPoint['Num'], $permaList)) + $relayPoint['permaLinkDetail'] = $permaList[$relayPoint['Num']]; + } + return $relayPointList; + } + + /* + * Manage the return value of the webservice, handle the errors or build the + * succeed message + */ + private function _parseResult($client, $result, $params) + { + $errors = array(); + $success = array(); + + if ($client->fault) + $errors[$errorTotal++] = $this->_mondialRelay->l('It seems the request isn\'t valid:'). + $result; + + $result = $result['WSI2_RecherchePointRelaisResult']; + if (($errorNumber = $result['STAT']) != 0) + { + $errors[] = $this->_mondialRelay->l('There is an error number : ').$errorNumber; + $errors[] = $this->_mondialRelay->l('Details : '). + $this->_mondialRelay->getErrorCodeDetail($errorNumber); + } + else + { + unset($result['STAT']); + + // Clean Content + foreach($result as $num => $relayPoint) + { + $totalEmptyFields = 0; + foreach ($relayPoint as $key => &$value) + { + $value = trim($value); + if (empty($value)) + ++$totalEmptyFields; + } + if ($totalEmptyFields == count($relayPoint)) + unset($result[$num]); + } + if (!count($result)) + $errors[] = $this->_mondialRelay->l('MondialRelay can\'t find any relay point near your address. Maybe your address isn\'t properly filled ?'); + else + { + $this->_addLinkHoursDetail($result); + + // Fetch detail info using webservice (not used anymore) + // $this->_generateLinkHoursDetail($result); + // $result = (count($relayDetail['success'])) ? $relayDetail['success'] : $result; + } + $success = $result; + } + $this->_resultList['error'] = $errors; + $this->_resultList['success'] = $success; + } + + /* + * Send one or multiple request to the webservice + */ + public function send() + { + if ($client = new nusoap_client($this->_webserviceURL, true)) + { + $client->soap_defencoding = 'UTF-8'; + $client->decode_utf8 = false; + + $params = $this->_getSimpleParamArray($this->_fields['list']); + $result = $client->call( + 'WSI2_RecherchePointRelais', + $params, + 'http://www.mondialrelay.fr/webservice/', + 'http://www.mondialrelay.fr/webservice/WSI2_RecherchePointRelais'); + + $this->_parseResult($client, $result, $params); + unset($client); + } + else + throw new Exception($this->_mondialRelay->l('The Mondial Relay webservice isn\'t currently reliable')); + } + + /* + * Get the values with associated fields name + */ + public function getFieldsList() + { + return $this->_fieldsList['list']; + } + + /* + * Get the result of one or multiple send request + */ + public function getResult() + { + return $this->_resultList; + } +} diff --git a/modules/mondialrelay_old/classes/MRGetTickets.php b/modules/mondialrelay_old/classes/MRGetTickets.php new file mode 100755 index 00000000..b082c384 --- /dev/null +++ b/modules/mondialrelay_old/classes/MRGetTickets.php @@ -0,0 +1,263 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 8783 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* + * Interface + */ +require_once(dirname(__FILE__).'/IMondialRelayWSMethod.php'); + +/* + * Allow to retrieve tickets - 'WSI2_GetEtiquettes' + */ +class MRGetTickets implements IMondialRelayWSMethod +{ + private $_fields = array( + 'list' => array( + 'Enseigne' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z]{2}[0-9A-Z ]{6}$#'), + 'Expeditions' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9]{8}(;[0-9]{8})*$#'), + 'Langue' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[A-Z]{2}$#'), + 'Security' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z]{32}$#'))); + + private $_detailedExpeditionList = array(); + private $_webServiceKey = ''; + private $_mondialRelay = NULL; + + private $_resultList = array( + 'error' => array(), + 'success' => array()); + + private $_webserviceURL = 'http://www.mondialrelay.fr/webservice/Web_Services.asmx?WSDL'; + + public function __construct($params) + { + $this->_detailedExpeditionList = $params['detailedExpeditionList']; + $this->_webServiceKey = Configuration::get('MR_KEY_WEBSERVICE'); + } + + public function __destruct() + { + unset($this->_mondialRelay); + } + + public function init() + { + $this->_mondialRelay = new MondialRelay(); + + $this->_fields['list']['Enseigne']['value'] = Configuration::get('MR_ENSEIGNE_WEBSERVICE'); + $this->_fields['list']['Langue']['value'] = Configuration::get('MR_LANGUAGE'); + + foreach ($this->_detailedExpeditionList as $detailedExpedition) + { + // Storage temporary + $base = $this->_fields; + $tmp = &$base['list']; + + $tmp['Expeditions']['value'] = $detailedExpedition['expeditionNumber']; + $this->_fieldsList[] = $base; + } + $this->_generateMD5SecurityKey(); + } + + /* + * Generate the MD5 key for each param list + */ + private function _generateMD5SecurityKey() + { + // RootCase is the array case where the main information are stored + // it's an array containing id_mr_selected and an array with the necessary fields + foreach($this->_fieldsList as &$rootCase) + { + $concatenationValue = ''; + foreach($rootCase['list'] as $paramName => &$valueDetailed) + if ($paramName != 'Texte' && $paramName != 'Security') + { + $valueDetailed['value'] = strtoupper($valueDetailed['value']); + if (preg_match($valueDetailed['regexValidation'], $valueDetailed['value'], $matches)) + $concatenationValue .= $valueDetailed['value']; + elseif ((!strlen($valueDetailed['value']) && $valueDetailed['required']) || strlen($valueDetailed['value'])) + { + $error = $this->_mondialRelay->l('This key').' ['.$paramName.'] '.$this->_mondialRelay->l('hasn\'t a valide value format').' : '.$valueDetailed['value']; + $id_order = $this->_getOrderIdWithExpeditionNumber($rootCase['list']['Expeditions']['value']); + $this->_resultList['error'][$id_order][] = $error; + } + } + $concatenationValue .= $this->_webServiceKey; + $rootCase['list']['Security']['value' ] = strtoupper(md5($concatenationValue)); + } + } + + /* + * Get the values with associated fields name + * @fields : array containing multiple values information + */ + private function _getSimpleParamArray($fields) + { + $params = array(); + + foreach($fields as $keyName => $valueDetailed) + $params[$keyName] = $valueDetailed['value']; + return $params; + } + + /* + * Update the history tables + */ + private function _updateTable($id_order, $expeditionNumber, $URLA4, $URLA5, &$success) + { + $query = ' + SELECT id FROM `'._DB_PREFIX_.'mr_historique` + WHERE `order`='.(int)$id_order; + + $row = Db::getInstance()->getRow($query); + if ($row) + { + $query = ' + UPDATE `'._DB_PREFIX_.'mr_historique` + SET + `exp` = \''.(int)$expeditionNumber.'\', + `url_a4` = \''.pSQL((string)$URLA4).'\', + `url_a5` = \''.pSQL((string)$URLA5).'\' + WHERE `order` = '.(int)$id_order; + } + else + { + $query = ' + INSERT INTO '._DB_PREFIX_.'mr_historique + (`order`, `exp`, `url_a4`, `url_a5`) + VALUES ( + '.(int)$id_order.', + '.(int)$expeditionNumber.', + \''.pSQL((string)$URLA4).'\', + \''.pSQL((string)$URLA5).'\')'; + } + Db::getInstance()->Execute($query); + $success['id_mr_history'] = isset($row['id']) ? $row['id'] : Db::getInstance()->Insert_ID(); + } + + /* + * Manage the return value of the webservice, handle the errors or build the + * succeed message + */ + private function _parseResult($client, $result, $params) + { + $errors = array(); + $success = array(); + + $id_order = $this->_getOrderIdWithExpeditionNumber($params['Expeditions']); + if ($client->fault) + $errors[$errorTotal++] = $this->_mondialRelay->l('It seems the request isn\'t valid:'). + $result; + + $result = $result['WSI2_GetEtiquettesResult']; + if (($errorNumber = $result['STAT']) != 0) + { + $errors[] = $this->_mondialRelay->l('There is an error number : ').$errorNumber; + $errors[] = $this->_mondialRelay->l('Details : '). + $this->_mondialRelay->getErrorCodeDetail($errorNumber); + } + else + { + $baseURL = 'http://www.mondialrelay.fr'; + $URLPDF_A4 = $baseURL.$result['URL_PDF_A4']; + $URLPDF_A5 = $baseURL.$result['URL_PDF_A5']; + + $success['id_order'] = $id_order; + $success['expeditionNumber'] = $params['Expeditions']; + $success['URLPDF_A4'] = $URLPDF_A4; + $success['URLPDF_A5'] = $URLPDF_A5; + $this->_updateTable($id_order, $params['Expeditions'], $URLPDF_A4, $URLPDF_A5, $success); + } + $this->_resultList['error'][$id_order] = $errors; + $this->_resultList['success'][$id_order] = $success; + } + + /* + * Get the order id using the expedition number + */ + private function _getOrderIdWithExpeditionNumber($expeditionNumber) + { + foreach($this->_detailedExpeditionList as $detailedExpedition) + if ($detailedExpedition['expeditionNumber'] == $expeditionNumber) + return $detailedExpedition['id_order']; + return 0; + } + + /* + * Send one or multiple request to the webservice + */ + public function send() + { + if ($client = new nusoap_client($this->_webserviceURL, true)) + { + $client->soap_defencoding = 'UTF-8'; + $client->decode_utf8 = false; + + foreach($this->_fieldsList as $rootCase) + { + $params = $this->_getSimpleParamArray($rootCase['list']); + $result = $client->call( + 'WSI2_GetEtiquettes', + $params, + 'http://www.mondialrelay.fr/webservice/', + 'http://www.mondialrelay.fr/webservice/WSI2_GetEtiquettes'); + + $this->_parseResult($client, $result, $params); + } + unset($client); + } + else + throw new Exception($this->_mondialRelay->l('The Mondial Relay webservice isn\'t currently reliable')); + } + + /* + * Get the values with associated fields name + */ + public function getFieldsList() + { + return $this->_fieldsList['list']; + } + + /* + * Get the result of one or multiple send request + */ + public function getResult() + { + return $this->_resultList; + } +} \ No newline at end of file diff --git a/modules/mondialrelay_old/classes/MRManagement.php b/modules/mondialrelay_old/classes/MRManagement.php new file mode 100755 index 00000000..bf373082 --- /dev/null +++ b/modules/mondialrelay_old/classes/MRManagement.php @@ -0,0 +1,171 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 9219 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +require_once(realpath(dirname(__FILE__).'/../mondialrelay.php')); + +class MRManagement extends MondialRelay +{ + private $_params = array(); + + private $_resultList = array( + 'error' => array(), + 'success' => array()); + + public function __construct($params) + { + $this->_params = $params; + + parent::__construct(); + } + + public function __destruct() + { + + } + + /* + ** This method fill the database with the selected carrier + */ + public function addSelectedCarrierToDB() + { + $query = 'SELECT `id_mr_selected` + FROM `' . _DB_PREFIX_ . 'mr_selected` + WHERE `id_cart` = '.(int)$this->_params['id_cart']; + + // Not exist and needed for database + unset($this->_params['relayPointInfo']['permaLinkDetail']); + + // Update if Exist else add a new entry + if (Db::getInstance()->getRow($query)) + { + $query = 'UPDATE `'._DB_PREFIX_.'mr_selected` + SET `id_method` = '.(int)$this->_params['id_mr_method'].', '; + if (is_array($this->_params['relayPointInfo'])) + foreach($this->_params['relayPointInfo'] as $nameKey => $value) + $query .= '`MR_Selected_'.MRTools::bqSQL($nameKey).'` = "'.pSQL($value).'", '; + else // Clean the existing relay point data + $query .= ' + MR_Selected_Num = NULL, + MR_Selected_LgAdr1 = NULL, + MR_Selected_LgAdr2 = NULL, + MR_Selected_LgAdr3 = NULL, + MR_Selected_LgAdr4 = NULL, + MR_Selected_CP = NULL, + MR_Selected_Pays = NULL, + MR_Selected_Ville = NULL, '; + $query = rtrim($query, ', ').' WHERE `id_cart` = '.(int)$this->_params['id_cart']; + } + else + { + $query = 'INSERT INTO `'._DB_PREFIX_.'mr_selected` + (`id_customer`, `id_method`, `id_cart`, '; + if (is_array($this->_params['relayPointInfo'])) + foreach($this->_params['relayPointInfo'] as $nameKey => $value) + $query .= '`MR_Selected_'.MRTools::bqSQL($nameKey).'`, '; + $query = rtrim($query, ', ').') VALUES ( + '.(int)$this->_params['id_customer'].', + '.(int)$this->_params['id_mr_method'].', + '.(int)$this->_params['id_cart'].', '; + if (is_array($this->_params['relayPointInfo'])) + foreach($this->_params['relayPointInfo'] as $nameKey => $value) + $query .= '"'.pSQL($value).'", '; + $query = rtrim($query, ', ').')'; + } + Db::getInstance()->Execute($query); + } + + public function uninstallDetail() + { + $html = ''; + + switch($this->_params['action']) + { + case 'showFancy': + $html .= ' +
    +

    '.$this->l('Uninstalling Mondial Relay').'

    +
    + '.$this->l('You\'re attempt to uninstall the module, do you want to remove the database').' ? +

    + +
    + +
    + +
    +

    +
    +
    + '; + $this->_resultList['html'] = $html; + break; + case 'backupAndUninstall': + + break; + default: + } + return $this->_resultList; + } + + public function DeleteHistory() + { + $success = array(); + $error = array(); + + if (is_array($this->_params['historyIdList']) && count($this->_params['historyIdList'])) + { + $query = ' + DELETE FROM `'._DB_PREFIX_.'mr_historique` + WHERE id IN('; + foreach($this->_params['historyIdList'] as $id) + $query .= (int)$id.', '; + $query = trim($query, ', ').')'; + + $success['deletedListId'] = $this->_params['historyIdList']; + $totalDeleted = Db::getInstance()->Execute($query); + if (count($success['deletedListId']) != $totalDeleted) + { + $error[] = $this->l('Some items can\'t be removed, please try to remove it again'); + foreach($success['deletedListId'] as $id) + { + $query = ' + SELECT id FROM `'._DB_PREFIX_.'mr_historique` + WHERE id='.(int)$id; + if (Db::getInstance()->getRow($query) && + ($key = array_search($id, $success['deletedListId'])) !== FALSE) + unset($success['deletedListId'][$key]); + } + } + $this->_resultList['success'] = $success; + $this->_resultList['other']['error'] = $error; + } + else + throw new Exception($this->l('Please select at least one history element')); + return $this->_resultList; + } +} +?> diff --git a/modules/mondialrelay_old/classes/MRRelayDetail.php b/modules/mondialrelay_old/classes/MRRelayDetail.php new file mode 100755 index 00000000..d7ca77b4 --- /dev/null +++ b/modules/mondialrelay_old/classes/MRRelayDetail.php @@ -0,0 +1,274 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 8783 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* + * Interface + */ +require_once(dirname(__FILE__).'/IMondialRelayWSMethod.php'); + +/* + * Allow to retrieve relay point details - 'WSI2_DetailPointRelais' + */ +class MRRelayDetail implements IMondialRelayWSMethod +{ + private $_fields = array( + 'list' => array( + 'Enseigne' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z]{2}[0-9A-Z ]{6}$#'), + 'Num' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9]{6}$#'), + 'Pays' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[A-Z]{2}$#'), + 'Security' => array( + 'required' => true, + 'value' => '', + 'regexValidation' => '#^[0-9A-Z]{32}$#'))); + + private $_relayPointNumList = array(); + private $_id_address_delivery = 0; + private $_webServiceKey = ''; + private $_mondialRelay = NULL; + private $_markCode = ''; + + private $_resultList = array( + 'error' => array(), + 'success' => array()); + + private $_webserviceURL = 'http://www.mondialrelay.fr/webservice/Web_Services.asmx?WSDL'; + + public function __construct($params) + { + $this->_relayPointNumList = $params['relayPointNumList']; + $this->_id_address_delivery = (int)($params['id_address_delivery']); + $this->_webServiceKey = Configuration::get('MR_KEY_WEBSERVICE'); + $this->_markCode = Configuration::get('MR_CODE_MARQUE'); + } + + public function __destruct() + { + unset($this->_mondialRelay); + } + + public function init() + { + $this->_mondialRelay = new MondialRelay(); + $address = new Address($this->_id_address_delivery); + + if (!$address) + throw new Exception($this->_mondialrelay->l('Customer address can\'t be found')); + + $this->_fields['list']['Enseigne']['value'] = Configuration::get('MR_ENSEIGNE_WEBSERVICE'); + $this->_fields['list']['Pays']['value'] = Country::getIsoById($address->id_country); + + foreach ($this->_relayPointNumList as $num) + { + // Storage temporary + $base = $this->_fields; + $tmp = &$base['list']; + + $tmp['Num']['value'] = $num; + $this->_fieldsList[] = $base; + } + $this->_generateMD5SecurityKey(); + unset($address); + } + + /* + * Generate the MD5 key for each param list + */ + private function _generateMD5SecurityKey() + { + // RootCase is the array case where the main information are stored + // it's an array containing id_mr_selected and an array with the necessary fields + foreach($this->_fieldsList as &$rootCase) + { + $concatenationValue = ''; + foreach($rootCase['list'] as $paramName => &$valueDetailed) + if ($paramName != 'Texte' && $paramName != 'Security') + { + // Mac server make an empty string instead of a cleaned string + // TODO : test on windows and linux server + $cleanedString = MRTools::replaceAccentedCharacters($valueDetailed['value']); + $valueDetailed['value'] = !empty($cleanedString) ? strtoupper($cleanedString) : strtoupper($valueDetailed['value']); + + // Call a pointer function if exist to do different test + if (isset($valueDetailed['methodValidation']) && + method_exists('MRTools', $valueDetailed['methodValidation']) && + isset($valueDetailed['params']) && + MRTools::$valueDetailed['methodValidation']($valueDetailed['value'], $valueDetailed['params'])) + $concatenationValue .= $valueDetailed['value']; + // Use simple Regex test given by MondialRelay + else if (isset($valueDetailed['regexValidation']) && + preg_match($valueDetailed['regexValidation'], $valueDetailed['value'], $matches)) + $concatenationValue .= $valueDetailed['value']; + // If the key is required, we set an error, else it's skipped + else if ((!strlen($valueDetailed['value']) && $valueDetailed['required']) || strlen($valueDetailed['value'])) + { + if (empty($valueDetailed['value'])) + $error = $this->_mondialRelay->l('This key').' ['.$paramName.'] '.$this->_mondialRelay->l('is empty and need to be filled'); + else + $error = 'This key ['.$paramName.'] hasn\'t a valid value format : '.$valueDetailed['value']; + $this->_resultList['error'][$rootCase['list']['Num']['value']] = $error; + } + } + $concatenationValue .= $this->_webServiceKey; + $rootCase['list']['Security']['value' ] = strtoupper(md5($concatenationValue)); + } + } + + /* + * Get the values with associated fields name + * @fields : array containing multiple values information + */ + private function _getSimpleParamArray($fields) + { + $params = array(); + + foreach($fields as $keyName => $valueDetailed) + $params[$keyName] = $valueDetailed['value']; + return $params; + } + + /* + * Manage the return value of the webservice, handle the errors or build the + * succeed message + */ + private function _parseResult($client, $result, $params) + { + $errors = array(); + + if ($client->fault) + $errors[$errorTotal++] = $this->_mondialRelay->l('It seems the request isn\'t valid:'). + $result; + $result = $result['WSI2_DetailPointRelaisResult']; + if (($errorNumber = $result['STAT']) != 0) + { + $errors[] = $this->_mondialRelay->l('There is an error number : ').$errorNumber; + $errors[] = $this->_mondialRelay->l('Details : '). + $this->_mondialRelay->getErrorCodeDetail($errorNumber); + } + else + { + $HDayList = array( + 'Horaires_Lundi' => $this->_mondialRelay->l('Monday'), + 'Horaires_Mardi' => $this->_mondialRelay->l('Tuesday'), + 'Horaires_Mercredi' => $this->_mondialRelay->l('Wednesday'), + 'Horaires_Jeudi' => $this->_mondialRelay->l('Thursday'), + 'Horaires_Vendredi' => $this->_mondialRelay->l('Friday'), + 'Horaires_Samedi' => $this->_mondialRelay->l('Saturday'), + 'Horaires_Dimanche' => $this->_mondialRelay->l('Sunday')); + + $orderedDate = array(); + // Format hour properly + $priority = 0; + foreach($HDayList as $day => $tradDayName) + { + foreach($result[$day]['string'] as $num => &$value) + if ($value == '0000') + $value = ''; + else + $value = implode('h', str_split($value, 2)); + $orderedDate[$priority++] = array('name' => $tradDayName, 'list' => $result[$day]); + unset($result[$day]); + } + $result['orderedDate'] = $orderedDate; + $this->_resultList['success'][$result['Num']] = $result; + } + $this->_resultList['error'][] = $errors; + } + + /* + * Send one or multiple request to the webservice + */ + public function send() + { + if ($client = new nusoap_client($this->_webserviceURL, true)) + { + $client->soap_defencoding = 'UTF-8'; + $client->decode_utf8 = false; + + foreach($this->_fieldsList as $rootCase) + { + $params = $this->_getSimpleParamArray($rootCase['list']); + $result = $client->call( + 'WSI2_DetailPointRelais', + $params, + 'http://www.mondialrelay.fr/webservice/', + 'http://www.mondialrelay.fr/webservice/WSI2_GetEtiquettes'); + + $this->_parseResult($client, $result, $params); + } + unset($client); + } + else + throw new Exception($this->_mondialRelay->l('The Mondial Relay webservice isn\'t currently reliable')); + } + + /* + ** Generate a list of perma link + */ + static public function getPermaLink($relayList, $id_address_delivery) + { + if (!($address = new Address($id_address_delivery))) + return array(); + + $permaList = array(); + $iso = strtoupper(Country::getIsoById($address->id_country)); + $ens = strtoupper(Configuration::get('MR_ENSEIGNE_WEBSERVICE').Configuration::get('MR_CODE_MARQUE')); + $url = 'http://www.mondialrelay.com/public/permanent/details_relais.aspx?ens='. + Configuration::get('MR_ENSEIGNE_WEBSERVICE').Configuration::get('MR_CODE_MARQUE'); + foreach($relayList as $num => $relayNum) + { + $crc = strtoupper(MD5('<'.$ens.'>'.$relayNum.$iso.'<'.Configuration::get('MR_KEY_WEBSERVICE').'>')); + $permaList[$relayNum] = $url.'&num='.$relayNum.'&pays='.$iso.'&crc='.$crc; + } + unset($address); + return $permaList; + } + + /* + * Get the values with associated fields name + */ + public function getFieldsList() + { + return $this->_fieldsList['list']; + } + + /* + * Get the result of one or multiple send request + */ + public function getResult() + { + return $this->_resultList; + } +} \ No newline at end of file diff --git a/modules/mondialrelay_old/classes/MRTools.php b/modules/mondialrelay_old/classes/MRTools.php new file mode 100755 index 00000000..823ee028 --- /dev/null +++ b/modules/mondialrelay_old/classes/MRTools.php @@ -0,0 +1,89 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 6839 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/* +** Some tools using used in the module +*/ +class MRTools +{ + /* + ** Replace all accented chars to normal + */ + static public function replaceAccentedCharacters($string) + { + if (function_exists('iconv')) + { + $currentLocale = setlocale(LC_ALL, NULL); + setlocale(LC_ALL, 'en_US.UTF8'); + $cleanedString = iconv('UTF-8','ASCII//TRANSLIT', $string); + setLocale(LC_ALL, $currentLocale); + } + else + $cleanedString = strtr($string, + 'àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ', + 'aaaaaceeeeiiiinooooouuuuyyAAAAACEEEEIIIINOOOOOUUUUY'); + return $cleanedString; + } + + /* + ** Fix security and compatibility for PS < 1.4.5 + */ + static function bqSQL($string) + { + return str_replace('`', '\`', pSQL($string)); + } + + /* + ** Check zip code by country + */ + static public function checkZipcodeByCountry($zipcode, $params) + { + $id_country = $params['id_country']; + + $zipcodeFormat = Db::getInstance()->getValue(' + SELECT `zip_code_format` + FROM `'._DB_PREFIX_.'country` + WHERE `id_country` = '.(int)$id_country); + + // -1 to warn user that no layout exist + if (!$zipcodeFormat) + return -1; + + $regxMask = str_replace( + array('N', 'C', 'L'), + array( + '[0-9]', + Country::getIsoById((int)$id_country), + '[a-zA-Z]'), + $zipcodeFormat); + if (preg_match('/'.$regxMask.'/', $zipcode)) + return true; + return false; + } +} + +?> diff --git a/modules/mondialrelay/classes/MondialRelayClass.php b/modules/mondialrelay_old/classes/MondialRelayClass.php similarity index 100% rename from modules/mondialrelay/classes/MondialRelayClass.php rename to modules/mondialrelay_old/classes/MondialRelayClass.php diff --git a/modules/mondialrelay/images/index.php b/modules/mondialrelay_old/classes/index.php similarity index 100% rename from modules/mondialrelay/images/index.php rename to modules/mondialrelay_old/classes/index.php diff --git a/modules/mondialrelay_old/cron.php b/modules/mondialrelay_old/cron.php new file mode 100755 index 00000000..5fd4222b --- /dev/null +++ b/modules/mondialrelay_old/cron.php @@ -0,0 +1,76 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 7835 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +include_once('../../config/config.inc.php'); +include_once('mondialrelay.php'); + +if (Tools::getValue('secure_key') != Configuration::get('MONDIAL_RELAY_SECURE_KEY')) + exit; + +$expeditions = Db::getInstance()->ExecuteS(' +SELECT ms.`exp_number`, ms.`id_cart`, o.`id_order` +FROM `'._DB_PREFIX_.'mr_selected` ms +LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_cart` = ms.`id_cart`) +WHERE `exp_number` != 0'); + +if (empty($expeditions)) + exit; + +$params = array( +'Enseigne' => Configuration::get('MR_ENSEIGNE_WEBSERVICE'), +'Langue' => 'FR' +); + +require_once(dirname(__FILE__).'/lib/nusoap/lib/nusoap.php'); +$client_mr = new nusoap_client("http://www.mondialrelay.fr/webservice/Web_Services.asmx?WSDL", true); +$client_mr->soap_defencoding = 'UTF-8'; +$client_mr->decode_utf8 = false; + +foreach ($expeditions as $expedition) +{ + if ($expedition['id_order'] == NULL) + continue; + if (OrderHistory::getLastOrderState((int)($expedition['id_order']))->id == Configuration::get('PS_OS_DELIVERED')) + continue; + $params['Expedition'] = $expedition['exp_number']; + $params['Security'] = strtoupper(md5($params['Enseigne'].$params['Expedition'].'FR'.Configuration::get('MR_KEY_WEBSERVICE'))); + + $is_delivered = 0; + $result_mr = $client_mr->call('WSI2_TracingColisDetaille', $params, 'http://www.mondialrelay.fr/webservice/', 'http://www.mondialrelay.fr/webservice/WSI2_TracingColisDetaille'); + if (isset($result_mr['WSI2_TracingColisDetailleResult']['Tracing']['ret_WSI2_sub_TracingColisDetaille'])) + foreach ($result_mr['WSI2_TracingColisDetailleResult']['Tracing']['ret_WSI2_sub_TracingColisDetaille'] as $result) + if (isset($result['Libelle']) AND $result['Libelle'] == 'COLIS LIVRÉ') + $is_delivered = 1; + + if ($is_delivered == 1) + { + $history = new OrderHistory(); + $history->id_order = (int)($expedition['id_order']); + $history->changeIdOrderState((int)(Configuration::get('PS_OS_DELIVERED')), (int)($expedition['id_order'])); + $history->addWithemail(); + } +} diff --git a/modules/mondialrelay_old/de.php b/modules/mondialrelay_old/de.php new file mode 100755 index 00000000..b18fbe52 --- /dev/null +++ b/modules/mondialrelay_old/de.php @@ -0,0 +1,176 @@ +mondialrelay_e0626222614bdee31951d84c64e5e9ff'] = 'Auswählen'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_91b442d385b54e1418d81adc34871053'] = 'Ausgewählt'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ef2a1f426c2c289ed5986c7636a5d696'] = 'Bitte wählen Sie einen Paketstützpunkt'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_80a0c205cd57b22fca7f174253870300'] = 'Öffnungszeiten'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2b56b60f878922093facd42284848a0c'] = 'Mehr...'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_44585fcd617dce6416d8283b026714c1'] = 'Mondial Relay'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ed4a3b96dc1f38c160775cac1f7bcd6d'] = 'An Mondial Relay Stützpunkte liefern.'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_70d70ce314f545b7c500a086f147f64b'] = 'Ungültiger Shop'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_709b076565df5fa98cdb2528d897633d'] = 'Ungültiger Mark-Code'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c86508f5bc6b4456e7003d6a1868689d'] = 'Ungültiger Webservice Schlüssel'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_ea9261a3dad976b40ff2088a19fda2c3'] = 'Ungültige Sprache'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_4eb287cc225ba0e1bcfe9cc1b8315def'] = 'Ungültiger Gewichtskoeffizient'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_f82576de014726e9ef9b4ed2a9eb947b'] = 'Bitte konfigurieren Sie Ihre Mondial Relay-Konto-Einstellungen vor dem Erstellen eines Lieferanten'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_70ff82d47f295f730c6accf07a2948e8'] = 'Ungültiger Versanddienstnamen'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e1f1787db2fee596f4c3bfaf1d098f8d'] = 'Ungültiger Col-Modus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9414b7de379a09941e894d28f19949ae'] = 'Ungültiger Liefermodus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5eeb9ca7eee4be7192dd10d917f79a12'] = 'Ungültiger Assurance-Modus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8b446ac2013dc7085802de71cc342ead'] = 'Sie müssen mindestens ein Zustellungsland angeben'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b9a85d87ae6dd77f2107734a4cd0bb15'] = 'Ungültiger Google-Schlüssel'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_979c6094728c14aac1b66d544dc5cebd'] = 'Ungültiger Bestellstatus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_808fb4e3a637a759565de1d314ea526f'] = 'Die übermittelte Hauptadresse hat ein ungültiges Format'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen erfolgreich aktualisiert'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_07213a0161f52846ab198be103b5ab43'] = 'Fehler'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_cb5e100e5a9a3e7f6d1fd97512215282'] = 'Fehler'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_350c1cc4343826a89f08a33bb49c6d98'] = 'Mondial Relay Bewertungsmodul konfigurieren'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5a2355a42ba3ab265701183c914467f2'] = 'Versuchen Sie den Cache und Kompilierung auf AUS zu stellen'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_3de769f9a81eed916583d5b35c58dbdd'] = 'falls Sie mit dem Modul nach einer Aktualisierung Probleme haben sollten'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8f8b21bd013b38d1e3059557c22a57e7'] = 'Nutzen Sie die folgende Kurzanleitung, um das Mondial Relay Modul zu konfigurieren.'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d21a9f93917604d5490ad529a7cf1ff9'] = 'So erstellen Sie eine Mondial Relay Lieferanten'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6a2e6af5fff47adb3afd780b97d9b4b'] = 'Geben Sie Ihre Mondial Relay-Konto-Einstellungen ein und speichern Sie sie'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_94fbe32464fcfa902feed9f256439833'] = 'Erstellen sie einen Versanddienst mit dem nachstehenden Formular \"Neuen Versanddienst erstellen\"'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b962d8fb95f5a439f50502152f3bad71'] = 'Definieren Sie einen Preis für Ihren Lieferanten auf'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_faf1247ae6846a9955a466d4f301bbe4'] = 'Der Lieferanten-Seite'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_10d78806b84b97ebc774e9f6277af6ac'] = 'Um Etiketten zu generieren, müssen Sie eine gültige und registrierte Adresse Ihres Shops auf Ihrer'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_af5efea250326c1c34d69aa9364b482c'] = 'Kontakt-Seite haben'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_362dff77f7403550e886db901404856c'] = 'Löschen erfolgreich'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_66661dacf33146201b60dc16520ddd68'] = 'Fügen Sie eine Versandart hinzu'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b651efdb98a5d6bd2b3935d0c3f4a5e2'] = 'Erforderlich'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_531e144cc23ef08408b81cb4d9c641dc'] = 'Lieferantenname'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c9b415ea1576b19d10d42b332798cd16'] = 'Sammel-Modus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d24262afca47ba80b691c878243441e8'] = 'Sammeln im Shop'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_201bdb87f8e278b943d07ae924d5de6e'] = 'Liefer-Modus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_142ef02888af88b8b772335277d1c0c8'] = 'Lieferung an einen Abholpunkt'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_eeab8b7cf3c7a558a0e8a4050fa994ca'] = 'Colis Drive Lieferung'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8f7794b107749728c3333ef38d2687e8'] = 'Hauslieferung RDC (1 Person)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e451efc8ce05b96b214b4c2935f2c657'] = 'Besondere Hauslieferung (2 Personen)'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_eaff1bdf24fcffe0e14e29a1bff51a12'] = 'Versicherung'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_96ba408f20bc3e065f400c650d32fd1a'] = 'Keine Versicherung'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_e5a8fafb1dfb538c172e1e014e86b871'] = 'Zusatzversicherung Lv1'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b02f8d6d4b6217cca317161c87f64065'] = 'Zusatzversicherung Lv2'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_90b95ae88150c6a34c4129dc4f1ebbd5'] = 'Zusatzversicherung Lv3'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c15b40b8c535191f6f0b6f9beaced3cf'] = 'Zusatzversicherung LV4'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_b67a442fff3ca0a03ea253b0668f946d'] = 'Zusatzversicherung Lv5'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_33cbd0d8b6476501f55a8320481ec0f1'] = 'Zustellländer:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_aef71ba4fd060dea2e2c76d1b5076caf'] = 'Halten Sie die die STRG-Taste gedrückt, um mehrere Länder zu wählen'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0309a6c666a7a803fdb9db95de71cf01'] = 'Frankreich'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6c1674d14bf5f95742f572cddb0641a7'] = 'Belgien'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_06630c890abadde9228ea818ce52b621'] = 'Luxemburg'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_907eba32d950bfab68227fd7ea22999b'] = 'Spanien'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0c24ec05a02c710cedd400e3680d8b81'] = 'Versandart-Liste'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_14039af96b01e718a9c9d9c1259b6472'] = 'Keine Versandmethoden erstellt'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_8596361cec00f8d2438d264827eee737'] = 'Versand konfigurieren'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9ffc3ccc968a96d902af963c6d7b4e97'] = 'Erweiterte Einstellungen'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_1d1d57f5840e1da871622295ba206b30'] = 'Klicken um Optionen anzuzeigen oder zu verbergen'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_fcf5b2122da1d5a5f5c7253b96a3f9d9'] = 'URL Cron Task:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_759e1f68a70bbe8c48eb30fa4b512de8'] = 'Sei haben Mondialrelay nicht durch die Installationsmethode aktualisiert. Führen Sie bitte folgende Einstellungen manuell durch, damit der Ticket-Prozess reibungslos funktioniert'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_bbd9bc77f1f5b6a9edce6db062b607c9'] = 'Dieser Teil erlaubt Ihnen die Daten zwischenzuspeichern, nachdem Sie ein MondialRelay Ticket generiert haben. Einige Felder sind in der Länge und nur auf Buchstaben beschränkt.'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_9127fe218b2cac7f0c8aecd7016a891d'] = 'Shopname'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_7e9bbecd32836500b557db33c3b3e93b'] = 'Der veon Mondialrelay genutzte Schlüssel lautet'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_32963eea43914b6a418fb2fd9850beb9'] = 'und hat folgenden Standard-Wert'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_d02bbc3cb147c272b0445ac5ca7d1a36'] = 'Bestellstatus'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_818f954f4838ecad839c5dcbd287d291'] = 'Wählen Sie den Bestellstatus für Marken. Sie können die Marken auf'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_5117e194c641ad4fc55417b554aead3c'] = 'der Mondial Relay Verwaltungsseite verwalten'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_1ba3935c9858ffb8e19a35ca640b8505'] = 'Mondial Relay Kontoeinstellungen'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_a125105400f6e4ee4574da3793af5ef2'] = 'Diese Parameter werden Ihnen von Mondialrelay mitgeteilt, sobald Sie den Dienst abonniert haben'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_12a3fbd35c1cab4b1101b91d708efd15'] = 'mr_marke_WebService:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_6f0434b67007b555dfd1201f4e0d5254'] = 'mr_code_marke:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_08f785193c96b2a78dec8d76a46648d6'] = 'mr_Schlüssel_WebService:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dae2d7c71f2daaedb00191af25dc28d'] = 'mr_Sprache:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_a26329cba9723551cb8654deba32872b'] = 'mr_Gewicht_koef:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_99244b234ec089eca40ff9e8ec343e87'] = 'Gramm = 1'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_61cbc2d26b4157292673c772ddd6c0f7'] = 'Einstellungen aktualisieren'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_2673bca5ba0a7871770e69c962e6ce38'] = 'Nb Versand:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_0dbe844fb964d5eca2f51be724e43294'] = 'Label URL'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_c6aefd5e2191e1210a2f50416812b517'] = 'Follow-up-URL'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_61e70b58e38fd01daa254f44c4fa264b'] = 'Nb Abholpunkt:'; +$_MODULE['<{mondialrelay}prestashop>mondialrelay_bba366864d25056c941b72f18ef79e7c'] = 'Dieser Fehler ist nicht bekannt :'; +$_MODULE['<{mondialrelay}prestashop>orderdetail_81b7b4587a2a3ea7a0d6bb1df3fbba54'] = 'Lieferung nach'; +$_MODULE['<{mondialrelay}prestashop>orderdetail_c2d05abc7f5ebdc72b6656df35038b43'] = 'Meine Sendung auf der Mondial Relay Webseite verfolgen'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_a1c3470a944b9625cfb924fd15c8bdbf'] = 'Bitte mindestens eine Bestellung auswählen'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_dc41aac14af17f1d19fca5e3b9439e74'] = 'Dieser Schlüssel'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_306b346c19017609403424203ea3d720'] = 'ist leer und muss angegeben werden'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Die Anfrage scheint ungültig zu sein'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_c9b4de92f371ae545ad6f051c07d58ca'] = 'Fehler Nummer:'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_ea5f761be4e4888eabf4e1501d7817d1'] = 'Detail:'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_eabb11bf9623f08409a0a4c9d035a336'] = 'Versand-Nummer:'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_b92c3d3319314513c547675924ceecd1'] = 'Ticket URL : '; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_66b793b6b4125e300717e8cf7449f533'] = 'Tracking URL: '; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_2653c23b8c0daac59571e4be5e8fa7d0'] = 'Der Webservice von Mondial Relay ist zu r Zeit nicht erreichbar'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_26b6b6eaec970108c5e84286159fbf48'] = 'Bitte prüfen Sie Ihre Spracheinstellungen'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_557595c2e17c9948a9448eb763ac1a88'] = 'Bitte prüfen Sie Ihre Namenseinstellungen'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_017ca6b770ad53669a4eec82894dfcd3'] = 'Bitte prüfen Sie Ihre Adresseneinstellungen'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_3f79e1fc66b4f9cca7bd68cab176020d'] = 'Bitte prüfen Sie Ihre Städteeinstellungen'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_404665d9b65239985d59b30b3dcb26b5'] = 'Bitte prüfen Sie Ihre PLZ-Einstellungen'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_74cb73eddbe6eaf556023f943fc7e1fd'] = 'Das Format Ihrer PLZ entspricht nicht dem Länderformat oder Sie haben keine entsprechende PLZ angegeben.'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_0b8a30478b9572b86718989d483fd88d'] = 'Bitte prüfen Sie Ihre Ländereinstellungen'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_7ddf2d94bf037b7d1088c0600ea589c3'] = 'Bitte prüfen Sie Ihre Telefonnummer-Einstellungen'; +$_MODULE['<{mondialrelay}prestashop>mrcreatetickets_9c7ce7be9a2c593b24d448edb4f804e0'] = 'Bitte prüfen Sie Ihre Maileinstellungen'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_14288d48d107056c1acf8aaae1bf282b'] = 'Kudenadresse nicht gefunden'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_dc41aac14af17f1d19fca5e3b9439e74'] = 'Der Schlüssel'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_135a7b9a62531e066a95093d8951b344'] = 'hat kein gültiges Datenformat'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Die Anfrage ist ungültig:'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_c9b4de92f371ae545ad6f051c07d58ca'] = 'Fehler: '; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_ea5f761be4e4888eabf4e1501d7817d1'] = 'Details:'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_4e274658c9e97c2a336dde79dd0a7772'] = 'Mondial Relay kann in Ihrer Nähe leider keinen Stützpunkt finden. Haben Sie Ihre Adresse korrekt angegeben ?'; +$_MODULE['<{mondialrelay}prestashop>mrgetrelaypoint_2653c23b8c0daac59571e4be5e8fa7d0'] = 'Mondial Relay Seite ist im Moment nicht verfügbar.'; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_dc41aac14af17f1d19fca5e3b9439e74'] = 'Der Schlüssel'; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_135a7b9a62531e066a95093d8951b344'] = 'hat kein gültiges Datenformat'; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Die Anfrage ist ungültig:'; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_c9b4de92f371ae545ad6f051c07d58ca'] = 'Fehler:'; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_ea5f761be4e4888eabf4e1501d7817d1'] = 'Details: '; +$_MODULE['<{mondialrelay}prestashop>mrgettickets_2653c23b8c0daac59571e4be5e8fa7d0'] = 'Der Webservice von Mondial Relay ist zu r Zeit nicht erreichbar'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_38b4abe2f5860f034e315f2da648a3d6'] = 'Mondial Relay Uninstall'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_77bad09c976ec16f38381dc220139367'] = 'Sie versuchen das Modul zu deinstallieren, alle Datenbankeinträge werden ebenso entfernt'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_09c081633d484a62a2f6940c12a0de36'] = 'Daten belassen und deinstallieren'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_0b7f47fce1d82d53244771c64b1535c0'] = 'Deaktivieren (alle Daten löschen) und deinstallieren'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_ea4788705e6873b424c65e91c2846b19'] = 'stornieren'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_a42bb0eaa485682166770a54469385f6'] = 'Einige Einträge konnten nicht entfernt werden, bitte versuchen Sie es noch einmal.'; +$_MODULE['<{mondialrelay}prestashop>mrmanagement_11744bfebb33e52be37a66a530b7045d'] = 'Bitte wählen Sie mindestens ein Verlaufselement aus'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_14288d48d107056c1acf8aaae1bf282b'] = 'Kundenadresse konnte nicht gefunden werden'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_dc41aac14af17f1d19fca5e3b9439e74'] = 'Dieser Schlüssel'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_306b346c19017609403424203ea3d720'] = 'ist leer und muss angegeben werden'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_e6940b76f045c8bc0aaaa5b2476cdaf7'] = 'Die Anfrage ist ungültig:'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_c9b4de92f371ae545ad6f051c07d58ca'] = 'Es ist ein Fehler in der Nummer vorhanden:'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_ea5f761be4e4888eabf4e1501d7817d1'] = 'Details:'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_6f8522e0610541f1ef215a22ffa66ff6'] = 'Montag'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_5792315f09a5d54fb7e3d066672b507f'] = 'Dienstag'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_796c163589f295373e171842f37265d5'] = 'Mittwoch'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_78ae6f0cd191d25147e252dc54768238'] = 'Donnerstag'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_c33b138a163847cdb6caeeb7c9a126b4'] = 'Freitag'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_8b7051187b9191cdcdae6ed5a10e5adc'] = 'Samstag'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_9d1a0949c39e66a0cd65240bc0ac9177'] = 'Sonntag'; +$_MODULE['<{mondialrelay}prestashop>mrrelaydetail_2653c23b8c0daac59571e4be5e8fa7d0'] = 'Modial Relay Webservice ist im Moment nicht verfügbar.'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_d1908b9b04e81c4b6112e38b608c49af'] = 'Sie haben den Fehler korrigiert. Besten Dank.'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_ccce63109db30895153094de05c60fa5'] = 'Kontaktseite'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_7c5fd3d93bd19d81953db3b374997961'] = 'Bitte überprüfen Sie diese Warnung, es kann sein dass die Generierung Ihres Tickets deshalb fehlschlägt'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_de21dc13e1ea638777fbfad49f88b332'] = 'Alle Bestellugen, die den Status haben'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_a0bf3c9ac2d785f053d883b8746e91ba'] = 'wird für die Erstellung Ihres Aufklebers verfügbar sein'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_2345e28c9b93f368968be4781ed70f5c'] = 'Konfiguration ändern'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_37c85a61df6352af7285c307022c4413'] = 'Keine Bestelungen mit diesem Status'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_d79cf3f429596f77db95c65074663a54'] = 'Bestell ID'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_ce26601dac0dea138b7295f02b7620a7'] = 'Kunde'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_0eede552438475bdfe820c13f24c9399'] = 'Gesamtpreis'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_f4e8b53a114e5a17d051ab84d326cae5'] = 'Versandkosten Gesamt'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_44749712dbec183e983dcd78a7736c41'] = 'Datum'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_3715c824cbc0f966c61a72254f248a2e'] = 'Gewicht (Gramm)'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_6ccc0fdff9995e1a0fce00c99e5b6085'] = 'MR Nummer'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_f9c50cba4de9032d7a6797a2458f8ed9'] = 'MR Land'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_428c091372d840900cf8536519fa0056'] = 'Exp Nummer'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_a254c25adc7d10d7e9c4889484f875a5'] = 'Detail'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_4351cfebe4b61d8aa5efa1d020710005'] = 'Ansicht'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_2e01172e31495f41fcebcf3f831cc82c'] = 'Erfolgreich abgeschlossen'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_32b919d18cfaca89383f6000dcc9c031'] = 'generieren'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_4f1a377c20ace646ddd303ad1e1d243d'] = 'Aufkleber Verlauf'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_e1a98101d56e29eeea312a0eb2748a92'] = 'Exp Nr.'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_aab39f783ba2e72eaad1770f4d9ad0c4'] = 'A4 Aufkleber drucken'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_3eb2bc1ee46258d2a166e89398756b3e'] = 'A5 Aufkleber drucken'; +$_MODULE['<{mondialrelay}prestashop>adminmondialrelay_fa98e6528c9df7f26978c2beb7de3d99'] = 'Verlauf löschen'; + +?> \ No newline at end of file diff --git a/modules/mondialrelay_old/docs/install.pdf b/modules/mondialrelay_old/docs/install.pdf new file mode 100755 index 00000000..1565f494 Binary files /dev/null and b/modules/mondialrelay_old/docs/install.pdf differ diff --git a/modules/mondialrelay_old/errorCode.php b/modules/mondialrelay_old/errorCode.php new file mode 100755 index 00000000..7b0e39c8 --- /dev/null +++ b/modules/mondialrelay_old/errorCode.php @@ -0,0 +1,79 @@ + 'Enseigne invalide', + '2' => 'Numéro d\'enseigne vide ou inexistant', + '3' => 'Numéro de compte enseigne invalide', + '5' => 'Numéro de dossier enseigne invalide', + '7' => 'Numéro de client enseigne invalide', + '9' => 'Nom de ville non reconnu ou non unique', + '10' => 'Type de collecte invalide ou incorrect (1/D > Domicile -- 3/R > Relais)', + '11' => 'Numéro de Point Relais de collecte invalide', + '12' => 'Pays du Point Relais de collecte invalide', + '13' => 'Type de livraison invalide ou incorrect (1/D > Domicile -- 3/R > Relais)', + '14' => 'Numéro du Point Relais de livraison invalide', + '15' => 'Pays du Point Relais de livraison invalide', + '16' => 'Code pays invalide', + '17' => 'Adresse invalide', + '18' => 'Ville invalide', + '19' => 'Code postal invalide', + '20' => 'Poids du colis invalide', + '21' => 'Taille (Longueur + Hauteur) du colis invalide', + '22' => 'Taille du Colis invalide', + '24' => 'Numéro de Colis Mondial Relay invalide', + '29' => 'Mode de livraison invalide', + '30' => 'Adresse (L1) de l\'expéditeur invalide', + '31' => 'Adresse (L2) de l\'expéditeur invalide', + '33' => 'Adresse (L3) de l\'expéditeur invalide', + '34' => 'Adresse (L4) de l\'expéditeur invalide', + '35' => 'Ville de l\'expéditeur invalide', + '36' => 'Code postal de l\'expéditeur invalide', + '37' => 'Pays de l\'expéditeur invalide', + '38' => 'Numéro de téléphone de l\'expéditeur invalide', + '39' => 'Adresse e-mail de l\'expéditeur invalide', + '40' => 'Action impossible sans ville ni code postal', + '41' => 'Mode de livraison invalide', + '42' => 'Montant CRT invalide', + '43' => 'Devise CRT invalide', + '44' => 'Valeur du colis invalide', + '45' => 'Devise de la valeur du colis invalide', + '46' => 'Plage de numéro d\'expédition épuisée', + '47' => 'Nombre de colis invalide', + '48' => 'Multi-colis en Point Relais Interdit', + '49' => 'Mode de collecte ou de livraison invalide', + '50' => 'Adresse (L1) du destinataire invalide', + '51' => 'Adresse (L2) du destinataire invalide', + '53' => 'Adresse (L3) du destinataire invalide', + '54' => 'Adresse (L4) du destinataire invalide', + '55' => 'Ville du destinataire invalide', + '56' => 'Code postal du destinataire invalide', + '57' => 'Pays du destinataire invalide', + '58' => 'Numéro de téléphone du destinataire invalide', + '59' => 'Adresse e-mail du destinataire invalide', + '60' => 'Champ texte libre invalide', + '61' => 'Top avisage invalide', + '62' => 'Instruction de livraison invalide', + '63' => 'Assurance invalide ou incorrecte', + '64' => 'Temps de montage invalide', + '65' => 'Top rendez-vous invalide', + '66' => 'Top reprise invalide', + '70' => 'Numéro de Point Relais invalide', + '72' => 'Langue expéditeur invalide', + '73' => 'Langue destinataire invalide', + '74' => 'Langue invalide', + '80' => 'Code tracing : Colis enregistré', + '81' => 'Code tracing : Colis en traitement chez Mondial Relay', + '82' => 'Code tracing : Colis livré', + '83' => 'Code tracing : Anomalie', + '90' => 'AS400 indisponible', + '91' => 'Numéro d\'expédition invalide', + '94' => 'Colis Inexistant', + '95' => 'Compte Enseigne non activé', + '96' => 'Type d\'enseigne incorrect en Base', + '97' => 'Clé de sécurité invalide', + '98' => 'Service Indisponible', + '99' => 'Erreur générique du service. Cette erreur peut être dû autant à un problème technique du service qu\'à des données incorrectes ou inexistantes dans la Base de Données. Lorsque vous avez cette erreur veuillez la notifier à Mondial Relay en précisant la date et l\'heure de la connexion ainsi que les informations envoyés au WebService afin d\'effectuer une vérification.'); + +?> diff --git a/modules/mondialrelay_old/images/getTickets.gif b/modules/mondialrelay_old/images/getTickets.gif new file mode 100755 index 00000000..b4c8c376 Binary files /dev/null and b/modules/mondialrelay_old/images/getTickets.gif differ diff --git a/modules/mondialrelay_old/images/help.png b/modules/mondialrelay_old/images/help.png new file mode 100755 index 00000000..04d4851d Binary files /dev/null and b/modules/mondialrelay_old/images/help.png differ diff --git a/modules/mondialrelay/lib/nusoap/index.php b/modules/mondialrelay_old/images/index.php similarity index 100% rename from modules/mondialrelay/lib/nusoap/index.php rename to modules/mondialrelay_old/images/index.php diff --git a/modules/mondialrelay_old/images/loader.gif b/modules/mondialrelay_old/images/loader.gif new file mode 100755 index 00000000..afc385a2 Binary files /dev/null and b/modules/mondialrelay_old/images/loader.gif differ diff --git a/modules/mondialrelay_old/images/logo.gif b/modules/mondialrelay_old/images/logo.gif new file mode 100755 index 00000000..06f84711 Binary files /dev/null and b/modules/mondialrelay_old/images/logo.gif differ diff --git a/modules/mondialrelay_old/images/pdf_icon.jpg b/modules/mondialrelay_old/images/pdf_icon.jpg new file mode 100755 index 00000000..81712ce7 Binary files /dev/null and b/modules/mondialrelay_old/images/pdf_icon.jpg differ diff --git a/modules/mondialrelay_old/images/selectRelayPoint.png b/modules/mondialrelay_old/images/selectRelayPoint.png new file mode 100755 index 00000000..b6462f07 Binary files /dev/null and b/modules/mondialrelay_old/images/selectRelayPoint.png differ diff --git a/modules/mondialrelay_old/index.php b/modules/mondialrelay_old/index.php new file mode 100755 index 00000000..b559f985 --- /dev/null +++ b/modules/mondialrelay_old/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 7233 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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; \ No newline at end of file diff --git a/modules/mondialrelay/it.php b/modules/mondialrelay_old/it.php similarity index 100% rename from modules/mondialrelay/it.php rename to modules/mondialrelay_old/it.php diff --git a/modules/mondialrelay_old/js/gmap.js b/modules/mondialrelay_old/js/gmap.js new file mode 100755 index 00000000..e1a8d53e --- /dev/null +++ b/modules/mondialrelay_old/js/gmap.js @@ -0,0 +1,2222 @@ +/* + * GMAP3 Plugin for JQuery + * Version : 4.1 + * Date : 2011-11-18 + * Licence : GPL v3 : http://www.gnu.org/licenses/gpl.html + * Author : DEMONTE Jean-Baptiste + * Contact : jbdemonte@gmail.com + * Web site : http://gmap3.net + * + * Copyright (c) 2010-2011 Jean-Baptiste DEMONTE + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * - Neither the name of the author nor the names of its contributors + * may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + + (function ($) { + + /***************************************************************************/ + /* STACK */ + /***************************************************************************/ + function Stack (){ + var st = []; + this.empty = function (){ + for(var i = 0; i < st.length; i++){ + if (st[i]){ + return false + } + } + return true; + } + this.add = function(v){ + st.push(v); + } + this.addNext = function ( v){ + var t=[], i, k = 0; + for(i = 0; i < st.length; i++){ + if (!st[i]){ + continue; + } + if (k == 1) { + t.push(v); + } + t.push(st[i]); + k++; + } + if (k < 2) { + t.push(v); + } + st = t; + } + this.get = function (){ + for(var i = 0; i < st.length; i++){ + if (st[i]) { + return st[i]; + } + } + return false; + } + this.ack = function (){ + for(var i = 0; i < st.length; i++){ + if (st[i]) { + delete st[i]; + break; + } + } + if (this.empty()){ + st = []; + } + } + } + + /***************************************************************************/ + /* STORE */ + /***************************************************************************/ + function Store(){ + var store = {}; + + /** + * add a mixed to the store + **/ + this.add = function(name, obj, todo){ + name = name.toLowerCase(); + if (!store[name]){ + store[name] = []; + } + store[name].push({obj:obj, tag:ival(todo, 'tag')}); + return name + '-' + (store[name].length-1); + } + + /** + * return a stored mixed + **/ + this.get = function(name, last, tag){ + var i, idx, add; + name = name.toLowerCase(); + if (!store[name] || !store[name].length){ + return null; + } + idx = last ? store[name].length : -1; + add = last ? -1 : 1; + for(i=0; i= 0; idx--){ + if ( (store[name][idx] !== undefined) && (store[name][idx].tag !== undefined) && ($.inArray(store[name][idx].tag, tag) >= 0) ){ + break; + } + } + } else { + for(idx = 0; idx < store[name].length; idx++){ + if ( (store[name][idx] !== undefined) && (store[name][idx].tag !== undefined) && ($.inArray(store[name][idx].tag, tag) >= 0) ){ + break; + } + } + } + } else { + idx = pop ? store[name].length - 1 : 0; + } + if ( !(idx in store[name]) ) { + return false; + } + // Google maps element + if (typeof(store[name][idx].obj.setMap) === 'function') { + store[name][idx].obj.setMap(null); + } + // jQuery + if (typeof(store[name][idx].obj.remove) === 'function') { + store[name][idx].obj.remove(); + } + // internal (cluster) + if (typeof(store[name][idx].obj.free) === 'function') { + store[name][idx].obj.free(); + } + delete store[name][idx].obj; + if (tag !== undefined){ + tmp = []; + for(i=0; i= 0){ + same[j] = true; + } else { + this.freeIndex(i); + } + } + return same; + } + + this.add = function(latLng, marker){ + markers.push({latLng:latLng, marker:marker}); + } + + this.get = function(i){ + return markers[i]; + } + + this.clusters = function(map, radius, maxZoom, force){ + var proj = map.getProjection(), + nwP = proj.fromLatLngToPoint( + new google.maps.LatLng( + map.getBounds().getNorthEast().lat(), + map.getBounds().getSouthWest().lng() + ) + ), + i, j, j2, p, x, y, k, k2, + z = map.getZoom(), + pos = {}, + saved = {}, + unik = {}, + clusters = [], + cluster, + chk, + lat, lng, keys, cnt, + bounds = map.getBounds(), + noClusters = maxZoom && (maxZoom <= map.getZoom()), + chkContain = map.getZoom() > 2; + + cnt = 0; + keys = {}; + for(i = 0; i < markers.length; i++){ + if (chkContain && !bounds.contains(markers[i].latLng)){ + continue; + } + p = proj.fromLatLngToPoint(markers[i].latLng); + pos[i] = [ + Math.floor((p.x - nwP.x) * Math.pow(2, z)), + Math.floor((p.y - nwP.y) * Math.pow(2, z)) + ]; + keys[i] = true; + cnt++; + } + // check if visible markers have changed + if (!force && !noClusters){ + for(k = 0; k < latest.length; k++){ + if( k in keys ){ + cnt--; + } else { + break; + } + } + if (!cnt){ + return false; // no change + } + } + + // save current keys to check later if an update has been done + latest = keys; + + keys = []; + for(i in pos){ + x = pos[i][0]; + y = pos[i][1]; + if ( !(x in saved) ){ + saved[x] = {}; + } + if (!( y in saved[x]) ) { + saved[x][y] = i; + unik[i] = {}; + keys.push(i); + } + unik[ saved[x][y] ][i] = true; + } + radius = Math.pow(radius, 2); + delete(saved); + + k = 0; + while(1){ + while((k 1; + saved = cluster; + } else { + chk = cluster.idx.length > saved.idx.length; + if (chk){ + saved = cluster; + } + } + if (chk){ + p = proj.fromLatLngToPoint( new google.maps.LatLng(saved.lat, saved.lng) ); + lat = Math.floor((p.x - nwP.x) * Math.pow(2, z)); + lng = Math.floor((p.y - nwP.y) * Math.pow(2, z)); + } + } while(chk); + } + + for(k2 = 0; k2 < saved.idx.length; k2++){ + if (saved.idx[k2] in unik){ + delete(unik[saved.idx[k2]]); + } + } + clusters.push(saved); + } + return clusters; + } + + this.getBounds = function(){ + var i, bounds = new google.maps.LatLngBounds(); + for(i=0; i { eventName => function, } + * onces => { eventName => function, } + * data => mixed data + * ] + **/ + this._attachEvents = function(sender, todo){ + var name; + if (!todo) { + return + } + if (todo.events){ + for(name in todo.events){ + if (typeof(todo.events[name]) === 'function'){ + this._attachEvent(sender, name, todo.events[name], todo.data, false); + } + } + } + if (todo.onces){ + for(name in todo.onces){ + if (typeof(todo.onces[name]) === 'function'){ + this._attachEvent(sender, name, todo.onces[name], todo.data, true); + } + } + } + } + + /** + * execute callback functions + **/ + this._callback = function(result, todo){ + if (typeof(todo.callback) === 'function') { + todo.callback.apply($this, [result]); + } else if (typeof(todo.callback) === 'object') { + for(var i=0; i bounds not available + // wait for map + google.maps.event.addListenerOnce( + map, + 'bounds_changed', + function() { + that._addclusteredmarkers(todo); + } + ); + return; + } + + if (typeof(radius) === 'number'){ + clusterer = new Clusterer(); + for(i=0 ; i 1){ + // look for the cluster design to use + m = 0; + for(k in styles){ + if ( (k > m) && (k <= cluster.idx.length) ){ + m = k; + } + } + if (styles[m]){ // cluster defined for the current markers count + w = ival(styles[m], 'width'); + h = ival(styles[m], 'height'); + + // create a custom _addOverlay command + atodo = {}; + $.extend( + true, + atodo, + ctodo, + { options:{ + pane: 'overlayLayer', + content:styles[m].content.replace('CLUSTER_COUNT', cluster.idx.length), + offset:{ + x: -w/2, + y: -h/2 + } + } + } + ); + obj = this._addOverlay(atodo, toLatLng(cluster), true); + atodo.options.pane = 'floatShadow'; + atodo.options.content = $('
    '); + atodo.options.content.width(w); + atodo.options.content.height(h); + shadow = this._addOverlay(atodo, toLatLng(cluster), true); + + // store data to the clusterer + ctodo.data = { + latLng: toLatLng(cluster), + markers:[] + }; + for(ii=0; ii
    '), + listeners = []; + + $div + .css('border', 'none') + .css('borderWidth', '0px') + .css('position', 'absolute'); + $div.append(opts.content); + + function f() { + _default.classes.OverlayView.call(this); + this.setMap(map); + } + + f.prototype = new _default.classes.OverlayView(); + + f.prototype.onAdd = function() { + var panes = this.getPanes(); + if (opts.pane in panes) { + $(panes[opts.pane]).append($div); + } + } + f.prototype.draw = function() { + var overlayProjection = this.getProjection(), + ps = overlayProjection.fromLatLngToDivPixel(latLng), + that = this; + + $div + .css('left', (ps.x+opts.offset.x) + 'px') + .css('top' , (ps.y+opts.offset.y) + 'px'); + + $.each( ("dblclick click mouseover mousemove mouseout mouseup mousedown").split(" "), function( i, name ) { + listeners.push( + google.maps.event.addDomListener($div[0], name, function(e) { + google.maps.event.trigger(that, name); + }) + ); + }); + listeners.push( + google.maps.event.addDomListener($div[0], "contextmenu", function(e) { + google.maps.event.trigger(that, "rightclick"); + }) + ); + } + f.prototype.onRemove = function() { + for (var i = 0; i < listeners.length; i++) { + google.maps.event.removeListener(listeners[i]); + } + $div.remove(); + } + f.prototype.hide = function() { + $div.hide(); + } + f.prototype.show = function() { + $div.show(); + } + f.prototype.toggle = function() { + if ($div) { + if ($div.is(':visible')){ + this.show(); + } else { + this.hide(); + } + } + } + f.prototype.toggleDOM = function() { + if (this.getMap()) { + this.setMap(null); + } else { + this.setMap(map); + } + } + f.prototype.getDOMElement = function() { + return $div[0]; + } + ov = new f(); + if (!internal){ + store.add('overlay', ov, o); + this._manageEnd(ov, o); + } + return ov; + } + + /** + * add a fix panel to a map + **/ + this.addfixpanel = function(todo){ + var o = getObject('fixpanel', todo), + x=y=0, $c, $div; + if (o.options.content){ + $c = $(o.options.content); + + if (o.options.left !== undefined){ + x = o.options.left; + } else if (o.options.right !== undefined){ + x = $this.width() - $c.width() - o.options.right; + } else if (o.options.center){ + x = ($this.width() - $c.width()) / 2; + } + + if (o.options.top !== undefined){ + y = o.options.top; + } else if (o.options.bottom !== undefined){ + y = $this.height() - $c.height() - o.options.bottom; + } else if (o.options.middle){ + y = ($this.height() - $c.height()) / 2 + } + + $div = $('
    ') + .css('position', 'absolute') + .css('top', y+'px') + .css('left', x+'px') + .css('z-index', '1000') + .append($c); + + $this.first().prepend($div); + this._attachEvents(map, o); + store.add('fixpanel', $div, o); + this._callback($div, o); + } + this._end(); + } + + /** + * add a direction renderer to a map + **/ + this.adddirectionsrenderer = function(todo, internal){ + var dr, o = getObject('directionrenderer', todo, 'panelId'); + o.options.map = map; + dr = new google.maps.DirectionsRenderer(o.options); + if (o.panelId) { + dr.setPanel(document.getElementById(o.panelId)); + } + store.add('directionrenderer', dr, o); + this._manageEnd(dr, o, internal); + return dr; + } + + /** + * set a direction panel to a dom element from its ID + **/ + this.setdirectionspanel = function(todo){ + var dr = store.get('directionrenderer'), + o = getObject('directionpanel', todo, 'id'); + if (dr && o.id) { + dr.setPanel(document.getElementById(o.id)); + } + this._manageEnd(dr, o); + } + + /** + * set directions on a map (create Direction Renderer if needed) + **/ + this.setdirections = function(todo){ + var dr = store.get('directionrenderer'), + o = getObject('directions', todo); + if (todo) { + o.options.directions = todo.directions ? todo.directions : (todo.options && todo.options.directions ? todo.options.directions : null); + } + if (o.options.directions) { + if (!dr) { + dr = this.adddirectionsrenderer(o, true); + } else { + dr.setDirections(o.options.directions); + } + } + this._manageEnd(dr, o); + } + + /** + * set a streetview to a map + **/ + this.setstreetview = function(todo){ + var panorama, + o = getObject('streetview', todo, 'id'); + if (o.options.position){ + o.options.position = toLatLng(o.options.position); + } + panorama = new _default.classes.StreetViewPanorama(document.getElementById(o.id),o.options); + if (panorama){ + map.setStreetView(panorama); + } + this._manageEnd(panorama, o); + } + + /** + * add a kml layer to a map + **/ + this.addkmllayer = function(todo){ + var kml, + o = getObject('kmllayer', todo, 'url'); + o.options.map = map; + if (typeof(o.url) === 'string'){ + kml = new _default.classes.KmlLayer(o.url, o.options); + } + store.add('kmllayer', kml, o); + this._manageEnd(kml, o); + } + + /** + * add a traffic layer to a map + **/ + this.addtrafficlayer = function(todo){ + var o = getObject('trafficlayer', todo), + tl = store.get('trafficlayer'); + if (!tl){ + tl = new _default.classes.TrafficLayer(); + tl.setMap(map); + store.add('trafficlayer', tl, o); + } + this._manageEnd(tl, o); + } + + /** + * add a bicycling layer to a map + **/ + this.addbicyclinglayer = function(todo){ + var o = getObject('bicyclinglayer', todo), + bl = store.get('bicyclinglayer'); + if (!bl){ + bl = new _default.classes.BicyclingLayer(); + bl.setMap(map); + store.add('bicyclinglayer', bl, o); + } + this._manageEnd(bl, o); + } + + /** + * add a ground overlay to a map + **/ + this.addgroundoverlay = function(todo){ + var ov, + o = getObject('groundoverlay', todo, ['bounds', 'url']); + o.bounds = toLatLngBounds(o.bounds); + if (o.bounds && (typeof(o.url) === 'string')){ + ov = new _default.classes.GroundOverlay(o.url, o.bounds); + ov.setMap(map); + store.add('groundoverlay', ov, o); + } + this._manageEnd(ov, o); + } + + /** + * geolocalise the user and return a LatLng + **/ + this.geolatlng = function(todo){ + var callback = ival(todo, 'callback'); + if (typeof(callback) === 'function') { + if(navigator.geolocation) { + navigator.geolocation.getCurrentPosition( + function(position) { + var out = new google.maps.LatLng(position.coords.latitude,position.coords.longitude); + callback.apply($this, [out]); + }, + function() { + var out = false; + callback.apply($this, [out]); + } + ); + } else if (google.gears) { + google.gears.factory.create('beta.geolocation').getCurrentPosition( + function(position) { + var out = new google.maps.LatLng(position.latitude,position.longitude); + callback.apply($this, [out]); + }, + function() { + out = false; + callback.apply($this, [out]); + } + ); + } else { + callback.apply($this, [false]); + } + } + this._end(); + } + + /** + * add a style to a map + **/ + this.addstyledmap = function(todo, internal){ + var o = getObject('styledmap', todo, ['id', 'style']); + if (o.style && o.id && !styles[o.id]) { + styles[o.id] = new _default.classes.StyledMapType(o.style, o.options); + if (map) { + map.mapTypes.set(o.id, styles[o.id]); + } + } + this._manageEnd(styles[o.id], o, internal); + } + + /** + * set a style to a map (add it if needed) + **/ + this.setstyledmap = function(todo){ + var o = getObject('styledmap', todo, ['id', 'style']); + if (o.id) { + this.addstyledmap(o, true); + if (styles[o.id]) { + map.setMapTypeId(o.id); + this._callback(styles[o.id], todo); + } + } + this._manageEnd(styles[o.id], o); + } + + /** + * remove objects from a map + **/ + this.clear = function(todo){ + var list = array(ival(todo, 'list') || ival(todo, 'name')), + last = ival(todo, 'last', false), + first = ival(todo, 'first', false), + tag = ival(todo, 'tag'); + if (tag !== undefined){ + tag = array(tag); + } + store.clear(list, last, first, tag); + this._end(); + } + + /** + * return objects previously created + **/ + this.get = function(todo){ + var name = ival(todo, 'name') || 'map', + first= ival(todo, 'first'), + all = ival(todo, 'all'), + tag = ival(todo, 'tag'); + name = name.toLowerCase(); + if (name === 'map'){ + return map; + } + if (tag !== undefined){ + tag = array(tag); + } + if (first){ + return store.get(name, false, tag); + } else if (all){ + return store.all(name, tag); + } else { + return store.get(name, true, tag); + } + } + + /** + * return the max zoom of a location + **/ + this.getmaxzoom = function(todo){ + this._resolveLatLng(todo, '_getMaxZoom'); + } + + this._getMaxZoom = function(todo, latLng){ + var callback = ival(todo, 'callback'), + that = this; + if (callback && typeof(callback) === 'function') { + getMaxZoomService().getMaxZoomAtLatLng( + latLng, + function(result) { + var zoom = result.status === google.maps.MaxZoomStatus.OK ? result.zoom : false; + callback.apply($this, [zoom, result.status]); + that._end(); + } + ); + } else { + this._end(); + } + } + + /** + * modify default values + **/ + this.setdefault = function(todo){ + setDefault(todo); + this._end(); + } + + /** + * autofit a map using its overlays (markers, rectangles ...) + **/ + this.autofit = function(todo, internal){ + var names, list, obj, i, j, + empty = true, + bounds = new google.maps.LatLngBounds(), + maxZoom = ival(todo, 'maxZoom', null); + + names = store.names(); + for(i=0; i detect zoom level and check maxZoom + google.maps.event.addListenerOnce( + map, + 'bounds_changed', + function() { + if (this.getZoom() > maxZoom){ + this.setZoom(maxZoom); + } + } + ); + } + map.fitBounds(bounds); + } + if (!internal){ + this._manageEnd(empty ? false : bounds, todo, internal); + } + } + + }; + + //-----------------------------------------------------------------------// + // jQuery plugin + //-----------------------------------------------------------------------// + + $.fn.gmap3 = function(){ + var i, args, list = [], empty = true, results = []; + // store all arguments in a todo list + for(i=0; i").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cq(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cp(){cn=b}function co(){setTimeout(cp,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bv(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bl(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bd,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bk(a){f.nodeName(a,"input")?bj(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bj)}function bj(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bi(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bh(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bg(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function U(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function M(a,b){return(a&&a!=="*"?a+".":"")+b.replace(y,"`").replace(z,"&")}function L(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function J(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function D(){return!0}function C(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(K,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.4",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;B.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
    a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-1000px",top:"-1000px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
    ",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
    t
    ",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i=f.expando,j=typeof c=="string",k=a.nodeType,l=k?f.cache:a,m=k?a[f.expando]:a[f.expando]&&f.expando;if((!m||e&&m&&l[m]&&!l[m][i])&&j&&d===b)return;m||(k?a[f.expando]=m=++f.uuid:m=f.expando),l[m]||(l[m]={},k||(l[m].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?l[m][i]=f.extend(l[m][i],c):l[m]=f.extend(l[m],c);g=l[m],e&&(g[i]||(g[i]={}),g=g[i]),d!==b&&(g[f.camelCase(c)]=d);if(c==="events"&&!g[c])return g[i]&&g[i].events;j?(h=g[c],h==null&&(h=g[f.camelCase(c)])):h=g;return h}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e=f.expando,g=a.nodeType,h=g?f.cache:a,i=g?a[f.expando]:f.expando;if(!h[i])return;if(b){d=c?h[i][e]:h[i];if(d){d[b]||(b=f.camelCase(b)),delete d[b];if(!l(d))return}}if(c){delete h[i][e];if(!l(h[i]))return}var j=h[i][e];f.support.deleteExpando||!h.setInterval?delete h[i]:h[i]=null,j?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=j):g&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=v:u&&(i=u)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.attr(a,b,""),a.removeAttribute(b),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(u&&f.nodeName(a,"button"))return u.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(u&&f.nodeName(a,"button"))return u.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==null?g:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabIndex=f.propHooks.tabIndex,v={get:function(a,c){var d;return f.prop(a,c)===!0||(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(u=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var w=/\.(.*)$/,x=/^(?:textarea|input|select)$/i,y=/\./g,z=/ /g,A=/[^\w\s.|`]/g,B=function(a){return a.replace(A,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=C;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=C);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),B).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},I=function(c){var d=c.target,e,g;if(!!x.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=H(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:I,beforedeactivate:I,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&I.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&I.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",H(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in G)f.event.add(this,c+".specialChange",G[c]);return x.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return x.test(this.nodeName)}},G=f.event.special.change.filters,G.focus=G.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=S.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(U(c[0])||U(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=R.call(arguments);N.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!T[a]?f.unique(e):e,(this.length>1||P.test(d))&&O.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]};be.optgroup=be.option,be.tbody=be.tfoot=be.colgroup=be.caption=be.thead,be.th=be.td,f.support.htmlSerialize||(be._default=[1,"div
    ","
    "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!be[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bh(a,d),e=bi(a),g=bi(d);for(h=0;e[h];++h)g[h]&&bh(e[h],g[h])}if(b){bg(a,d);if(c){e=bi(a),g=bi(d);for(h=0;e[h];++h)bg(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=be[l]||be._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bn.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bm,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bm.test(g)?g.replace(bm,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bv(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bw=function(a,c){var d,e,g;c=c.replace(bo,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bx=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bp.test(d)&&bq.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bv=bw||bx,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bz=/%20/g,bA=/\[\]$/,bB=/\r?\n/g,bC=/#.*$/,bD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bE=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bF=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bG=/^(?:GET|HEAD)$/,bH=/^\/\//,bI=/\?/,bJ=/)<[^<]*)*<\/script>/gi,bK=/^(?:select|textarea)/i,bL=/\s+/,bM=/([?&])_=[^&]*/,bN=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bO=f.fn.load,bP={},bQ={},bR,bS,bT=["*/"]+["*"];try{bR=e.href}catch(bU){bR=c.createElement("a"),bR.href="",bR=bR.href}bS=bN.exec(bR.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bO)return bO.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
    ").append(c.replace(bJ,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bK.test(this.nodeName)||bE.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bB,"\r\n")}}):{name:b.name,value:c.replace(bB,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?bX(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),bX(a,b);return a},ajaxSettings:{url:bR,isLocal:bF.test(bS[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bT},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bV(bP),ajaxTransport:bV(bQ),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?bZ(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=b$(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bD.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bC,"").replace(bH,bS[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bL),d.crossDomain==null&&(r=bN.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bS[1]&&r[2]==bS[2]&&(r[3]||(r[1]==="http:"?80:443))==(bS[3]||(bS[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bW(bP,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bG.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bI.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bM,"$1_="+x);d.url=y+(y===d.url?(bI.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bT+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bW(bQ,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bz,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cq("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
    ";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=ct.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!ct.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cu(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cu(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNaN(j)?i:j}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/modules/mondialrelay/lib/index.php b/modules/mondialrelay_old/lib/index.php similarity index 100% rename from modules/mondialrelay/lib/index.php rename to modules/mondialrelay_old/lib/index.php diff --git a/modules/mondialrelay/lib/nusoap/class.nusoap_base.php b/modules/mondialrelay_old/lib/nusoap/class.nusoap_base.php similarity index 100% rename from modules/mondialrelay/lib/nusoap/class.nusoap_base.php rename to modules/mondialrelay_old/lib/nusoap/class.nusoap_base.php diff --git a/modules/mondialrelay/lib/nusoap/class.soap_fault.php b/modules/mondialrelay_old/lib/nusoap/class.soap_fault.php similarity index 100% rename from modules/mondialrelay/lib/nusoap/class.soap_fault.php rename to modules/mondialrelay_old/lib/nusoap/class.soap_fault.php diff --git a/modules/mondialrelay/lib/nusoap/class.soap_parser.php b/modules/mondialrelay_old/lib/nusoap/class.soap_parser.php similarity index 100% rename from modules/mondialrelay/lib/nusoap/class.soap_parser.php rename to modules/mondialrelay_old/lib/nusoap/class.soap_parser.php diff --git a/modules/mondialrelay/lib/nusoap/class.soap_server.php b/modules/mondialrelay_old/lib/nusoap/class.soap_server.php similarity index 100% rename from modules/mondialrelay/lib/nusoap/class.soap_server.php rename to modules/mondialrelay_old/lib/nusoap/class.soap_server.php diff --git a/modules/mondialrelay/lib/nusoap/class.soap_transport_http.php b/modules/mondialrelay_old/lib/nusoap/class.soap_transport_http.php similarity index 100% rename from modules/mondialrelay/lib/nusoap/class.soap_transport_http.php rename to modules/mondialrelay_old/lib/nusoap/class.soap_transport_http.php diff --git a/modules/mondialrelay/lib/nusoap/class.soap_val.php b/modules/mondialrelay_old/lib/nusoap/class.soap_val.php similarity index 100% rename from modules/mondialrelay/lib/nusoap/class.soap_val.php rename to modules/mondialrelay_old/lib/nusoap/class.soap_val.php diff --git a/modules/mondialrelay/lib/nusoap/class.soapclient.php b/modules/mondialrelay_old/lib/nusoap/class.soapclient.php similarity index 100% rename from modules/mondialrelay/lib/nusoap/class.soapclient.php rename to modules/mondialrelay_old/lib/nusoap/class.soapclient.php diff --git a/modules/mondialrelay/lib/nusoap/class.wsdl.php b/modules/mondialrelay_old/lib/nusoap/class.wsdl.php similarity index 100% rename from modules/mondialrelay/lib/nusoap/class.wsdl.php rename to modules/mondialrelay_old/lib/nusoap/class.wsdl.php diff --git a/modules/mondialrelay/lib/nusoap/class.wsdlcache.php b/modules/mondialrelay_old/lib/nusoap/class.wsdlcache.php similarity index 100% rename from modules/mondialrelay/lib/nusoap/class.wsdlcache.php rename to modules/mondialrelay_old/lib/nusoap/class.wsdlcache.php diff --git a/modules/mondialrelay/lib/nusoap/class.xmlschema.php b/modules/mondialrelay_old/lib/nusoap/class.xmlschema.php similarity index 100% rename from modules/mondialrelay/lib/nusoap/class.xmlschema.php rename to modules/mondialrelay_old/lib/nusoap/class.xmlschema.php diff --git a/modules/mondialrelay_old/lib/nusoap/index.php b/modules/mondialrelay_old/lib/nusoap/index.php new file mode 100755 index 00000000..b559f985 --- /dev/null +++ b/modules/mondialrelay_old/lib/nusoap/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 7233 $ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +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; \ No newline at end of file diff --git a/modules/mondialrelay/lib/nusoap/nusoap.php b/modules/mondialrelay_old/lib/nusoap/nusoap.php similarity index 100% rename from modules/mondialrelay/lib/nusoap/nusoap.php rename to modules/mondialrelay_old/lib/nusoap/nusoap.php diff --git a/modules/mondialrelay/lib/nusoap/nusoapmime.php b/modules/mondialrelay_old/lib/nusoap/nusoapmime.php similarity index 100% rename from modules/mondialrelay/lib/nusoap/nusoapmime.php rename to modules/mondialrelay_old/lib/nusoap/nusoapmime.php diff --git a/modules/mondialrelay_old/logo.gif b/modules/mondialrelay_old/logo.gif new file mode 100755 index 00000000..06f84711 Binary files /dev/null and b/modules/mondialrelay_old/logo.gif differ diff --git a/modules/mondialrelay_old/logo_hd.png b/modules/mondialrelay_old/logo_hd.png new file mode 100755 index 00000000..e919c703 Binary files /dev/null and b/modules/mondialrelay_old/logo_hd.png differ diff --git a/modules/mondialrelay/mondialrelay.js b/modules/mondialrelay_old/mondialrelay.js similarity index 100% rename from modules/mondialrelay/mondialrelay.js rename to modules/mondialrelay_old/mondialrelay.js diff --git a/modules/mondialrelay_old/mondialrelay.php b/modules/mondialrelay_old/mondialrelay.php new file mode 100755 index 00000000..c7abe4dd --- /dev/null +++ b/modules/mondialrelay_old/mondialrelay.php @@ -0,0 +1,1304 @@ + +* @copyright 2007-2011 PrestaShop SA +* @version Release: $Revision: 10545 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) + exit; + +require_once(_PS_MODULE_DIR_.'mondialrelay/classes/MondialRelayClass.php'); +require_once(_PS_MODULE_DIR_.'mondialrelay/classes/MRTools.php'); + +class MondialRelay extends Module +{ + const INSTALL_SQL_FILE = 'mrInstall.sql'; + + private $_postErrors; + + public static $modulePath = ''; + public static $moduleURL = ''; + static public $MRFrontToken = ''; + static public $MRBackToken = ''; + + // Added for 1.3 compatibility + const ONLY_PRODUCTS = 1; + const ONLY_DISCOUNTS = 2; + const BOTH = 3; + const BOTH_WITHOUT_SHIPPING = 4; + const ONLY_SHIPPING = 5; + const ONLY_WRAPPING = 6; + const ONLY_PRODUCTS_WITHOUT_SHIPPING = 7; + + // SQL FILTER ORDER + const NO_FILTER = 0; + const WITHOUT_HOME_DELIVERY = 1; + + public function __construct() + { + $this->name = 'mondialrelay'; + $this->tab = 'shipping_logistics'; + $this->version = '1.7.9'; + + parent::__construct(); + + $this->page = basename(__FILE__, '.php'); + $this->displayName = $this->l('Mondial Relay'); + $this->description = $this->l('Deliver in Relay points'); + + self::initModuleAccess(); + + // Call everytime to prevent the changement of the module by a recent one + $this->_updateProcess(); + } + + public function install() + { + global $cookie; + + $name = "shipping"; + $title = "Mondial Relay API"; + + if (!parent::install()) + return false; + + Db::getInstance()->ExecuteS( + 'SELECT `name` + FROM `' . _DB_PREFIX_ . 'hook` + WHERE `name` = \''.$name.'\' + AND `title` = \''.$title.'\''); + + if (!Db::getInstance()->NumRows()) + Db::getInstance()->Execute('INSERT INTO ' . _DB_PREFIX_ . 'hook + (name, title, description, position) + VALUES(\''.$name.'\', \''.$title.'\', NULL, 0)'); + + if (!$this->registerHookByVersion()) + return false; + + if ((!file_exists(self::$modulePath.self::INSTALL_SQL_FILE)) || + (!$sql = file_get_contents(self::$modulePath.self::INSTALL_SQL_FILE))) + return false; + + $sql = str_replace('PREFIX_', _DB_PREFIX_, $sql); + $sql = preg_split("/;\s*[\r\n]+/", $sql); + foreach($sql AS $k => $query) + if (!empty($query)) + Db::getInstance()->Execute(trim($query)); + + $result = Db::getInstance()->getRow(' + SELECT id_tab + FROM `' . _DB_PREFIX_ . 'tab` + WHERE class_name="AdminMondialRelay"'); + + if (!$result) + { + // AdminOrders id_tab + $id_parent = 3; + + /*tab install */ + $result = Db::getInstance()->getRow(' + SELECT position + FROM `' . _DB_PREFIX_ . 'tab` + WHERE `id_parent` = '.(int)$id_parent.' + ORDER BY `'. _DB_PREFIX_ .'tab`.`position` DESC'); + + $pos = (isset($result['position'])) ? $result['position'] + 1 : 0; + + Db::getInstance()->Execute(' + INSERT INTO ' . _DB_PREFIX_ . 'tab + (id_parent, class_name, position, module) + VALUES('.(int)$id_parent.', "AdminMondialRelay", "'.(int)($pos).'", "mondialrelay")'); + + $id_tab = Db::getInstance()->Insert_ID(); + + $languages = Language::getLanguages(); + foreach ($languages as $language) + Db::getInstance()->Execute(' + INSERT INTO ' . _DB_PREFIX_ . 'tab_lang + (id_lang, id_tab, name) + VALUES("'.(int)($language['id_lang']).'", "'.(int)($id_tab).'", "Mondial Relay")'); + + $profiles = Profile::getProfiles(Configuration::get('PS_LANG_DEFAULT')); + foreach ($profiles as $profile) + Db::getInstance()->Execute(' + INSERT INTO ' . _DB_PREFIX_ . 'access + (`id_profile`,`id_tab`,`view`,`add`,`edit`,`delete`) + VALUES('.$profile['id_profile'].', '.(int)($id_tab).', 1, 1, 1, 1)'); + + @copy(_PS_MODULE_DIR_.'mondialrelay/AdminMondialRelay.gif', _PS_IMG_DIR_.'/AdminMondialRelay.gif'); + } + + // If module isn't installed, set default value + if (!Configuration::get('MONDIAL_RELAY')) + { + Configuration::updateValue('MONDIAL_RELAY', $this->version); + Configuration::updateValue('MONDIAL_RELAY_ORDER_STATE', 3); + Configuration::updateValue('MONDIAL_RELAY_SECURE_KEY', md5(time().rand(0,10))); + Configuration::updateValue('MR_GOOGLE_MAP', '1'); + Configuration::updateValue('MR_ENSEIGNE_WEBSERVICE', ''); + Configuration::updateValue('MR_CODE_MARQUE', ''); + Configuration::updateValue('MR_KEY_WEBSERVICE', ''); + Configuration::updateValue('MR_LANGUAGE', ''); + Configuration::updateValue('MR_WEIGHT_COEF', ''); + } + else + { + // Reactive transport if database wasn't remove at the last uninstall + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'carrier` c, `'._DB_PREFIX_.'mr_method` m + SET `deleted` = 0 + WHERE c.id_carrier = m.id_carrier'); + if (Configuration::get('MONDIAL_RELAY') < $this->version) + ;// TODO : ADD upgrade process depending of the last and new version + } + return true; + } + + /* + ** Return the token depend of the type + */ + static public function getToken($type = 'front') + { + return ($type == 'front') ? self::$MRFrontToken : (($type == 'back') ? + self::$MRBackToken : NULL); + } + + /* + ** Register hook depending of the Prestashop version used + */ + private function registerHookByVersion() + { + if (_PS_VERSION_ >= '1.3' && + (!$this->registerHook('shipping') || + !$this->registerHook('extraCarrier') || + !$this->registerHook('updateCarrier') || + !$this->registerHook('newOrder') || + !$this->registerHook('BackOfficeHeader'))) + return false; + + if (_PS_VERSION_ >= '1.4' && + (!$this->registerHook('processCarrier') || + !$this->registerHook('orderDetail') || + !$this->registerHook('orderDetailDisplayed') || + !$this->registerHook('paymentTop'))) + return false; + return true; + } + + public function uninstallCommonData() + { + // Tab uninstall + $result = Db::getInstance()->getRow(' + SELECT id_tab + FROM `' . _DB_PREFIX_ . 'tab` + WHERE class_name="AdminMondialRelay"'); + + if ($result) + { + $id_tab = $result['id_tab']; + if (isset($id_tab) && !empty($id_tab)) + { + Db::getInstance()->Execute('DELETE FROM ' . _DB_PREFIX_ . 'tab WHERE id_tab = '.(int)($id_tab)); + Db::getInstance()->Execute('DELETE FROM ' . _DB_PREFIX_ . 'tab_lang WHERE id_tab = '.(int)($id_tab)); + Db::getInstance()->Execute('DELETE FROM ' . _DB_PREFIX_ . 'access WHERE id_tab = '.(int)($id_tab)); + } + } + + if (_PS_VERSION_ >= '1.4' && + !Db::getInstance()->Execute(' + UPDATE '._DB_PREFIX_ .'carrier + SET `active` = 0, `deleted` = 1 + WHERE `external_module_name` = "mondialrelay"')) + return false; + else if (!Db::getInstance()->Execute(' + UPDATE '._DB_PREFIX_ .'carrier + SET `active` = 0, `deleted` = 1 + WHERE `name` = "mondialrelay"')) + return false; + return true; + } + + public function uninstall() + { + if (!parent::uninstall()) + return false; + + // Uninstall data that doesn't need to be keep + if (!$this->uninstallCommonData()) + return false; + + if (Tools::getValue('keepDatabase')) + { + // Retro Compatibility for older Version than 1.7 + if (Configuration::get('MONDIAL_RELAY_1_4')) + { + Configuration::updateValue('MONDIAL_RELAY', '1.6'); + Configuration::deleteByName('MONDIAL_RELAY_1_4'); + Configuration::deleteByName('MONDIAL_RELAY_INSTALL_UPDATE_1'); + } + return true; + } + + // MondialRelay Configuration + if (!Configuration::deleteByName('MONDIAL_RELAY') || + !Configuration::deleteByName('MONDIAL_RELAY_INSTALL_UPDATE') || + !Configuration::deleteByName('MONDIAL_RELAY_SECURE_KEY') || + !Configuration::deleteByName('MONDIAL_RELAY_ORDER_STATE') || + !Configuration::deleteByName('MR_GOOGLE_MAP') || + !Configuration::deleteByName('MR_ENSEIGNE_WEBSERVICE') || + !Configuration::deleteByName('MR_CODE_MARQUE') || + !Configuration::deleteByName('MR_KEY_WEBSERVICE') || + !Configuration::deleteByName('MR_WEIGHT_COEF')) + return false; + + // Drop databases + if (!Db::getInstance()->Execute(' + DROP TABLE + '._DB_PREFIX_ .'mr_historique, + '._DB_PREFIX_ .'mr_method, + '._DB_PREFIX_ .'mr_selected')) + return false; + elseif (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'carrier SET `active` = 0, `deleted` = 1 WHERE `name` = "mondialrelay"')) + return false; + + return true; + } + + /* + ** UpdateProcess if merchant update the module without a + ** normal installation + */ + private function _updateProcess() + { + if (Module::isInstalled('mondialrelay') && + (($installedVersion = Configuration::get('MONDIAL_RELAY')) || + $installedVersion = Configuration::get('MONDIAL_RELAY_1_4')) + && $installedVersion < $this->version) + { + if ($installedVersion < '1.4') + $this->_update_v1_4(); + if ($installedVersion < '1.4.2') + $this->_update_v1_4_2(); + } + + // Process update done just try to update the new configuration value + if (Configuration::get('MONDIAL_RELAY_1_4')) + { + Configuration::updateValue('MONDIAL_RELAY', $this->version); + Configuration::deleteByName('MONDIAL_RELAY_1_4'); + } + } + + /* + ** Use if the mechant was using Prestashop 1.3 and + ** now use 1.4 or more recent + */ + private function _update_v1_4() + { + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'carrier` + SET + `shipping_external` = 0, + `need_range` = 1, + `external_module_name` = + "mondialrelay", + `shipping_method` = 1 + WHERE `id_carrier` + IN (SELECT `id_carrier` + FROM `'._DB_PREFIX_.'mr_method`)'); + } + + /* + ** Add new Hook for the last recent version >= 1.4.2 + */ + private function _update_v1_4_2() + { + if (!$this->isRegisteredInHook('newOrder')) + $this->registerHook('newOrder'); + if (!$this->isRegisteredInHook('BackOfficeHeader')) + $this->registerHook('BackOfficeHeader'); + } + + /* + ** Get the content to ask for a backup of the database + */ + private function askForBackup($href) + { + return 'targetButton = \''.$href.'\'; + PS_MRGetUninstallDetail();'; + } + + /* + ** OnClick for input fields under the module list fields action + */ + public function onclickOption($type, $href = false) + { + $content = ''; + + switch($type) + { + case 'desactive': + break; + case 'reset': + break; + case 'delete': + break; + case 'uninstall': + $content = $this->askForBackup($href); + break; + default: + } + return $content; + } + + /* + ** Init the access directory module for URL and file system + ** Allow a compatibility for Presta < 1.4 + */ + public static function initModuleAccess() + { + self::$modulePath = _PS_MODULE_DIR_. 'mondialrelay/'; + self::$MRFrontToken = sha1('mr'._COOKIE_KEY_.'Front'); + self::$MRBackToken = sha1('mr'._COOKIE_KEY_.'Back'); + + $protocol = (Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS']) + && strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://'; + + $endURL = __PS_BASE_URI__.'modules/mondialrelay/'; + + if (method_exists('Tools', 'getShopDomainSsl')) + self::$moduleURL = $protocol.Tools::getShopDomainSsl().$endURL; + else + self::$moduleURL = $protocol.$_SERVER['HTTP_HOST'].$endURL; + } + + /* + ** Override a jQuery version included by another one us. + ** Allow a compatibility for Presta < 1.4 + */ + public static function getJqueryCompatibility($overloadCurrent = false) + { + // Store the last inclusion into a variable and include the new one + if ($overloadCurrent) + return ' + + '; + + return ' + + '; + } + + public function hookNewOrder($params) + { + DB::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'mr_selected` + SET `id_order` = '.(int)$params['order']->id.' + WHERE `id_cart` = '.(int)$params['cart']->id); + } + + public function hookBackOfficeHeader() + { + $cssFilePath = $this->_path.'style.css'; + $jsFilePath = $this->_path.'mondialrelay.js'; + + $ret = ''; + + if (Tools::getValue('tab') == 'AdminMondialRelay') + $ret .= self::getJqueryCompatibility(true); + + $ret .= ' + + '; + return $ret; + } + + private function _postValidation() + { + if (Tools::isSubmit('submitMR')) + { + if (Tools::getValue('mr_Enseigne_WebService') != '' AND !preg_match("#^[0-9A-Z]{2}[0-9A-Z ]{6}$#", Tools::getValue('mr_Enseigne_WebService'))) + $this->_postErrors[] = $this->l('Invalid Shop'); + if (Tools::getValue('mr_code_marque') != '' AND !preg_match("#^[0-9]{2}$#", Tools::getValue('mr_code_marque'))) + $this->_postErrors[] = $this->l('Invalid Mark code'); + if (Tools::getValue('mr_Key_WebService') != '' AND !preg_match("#^[0-9A-Za-z_\'., /\-]{2,32}$#", Tools::getValue('mr_Key_WebService'))) + $this->_postErrors[] = $this->l('Invalid Webservice Key'); + if (Tools::getValue('mr_Langage') != '' AND !preg_match("#^[A-Z]{2}$#", Tools::getValue('mr_Langage'))) + $this->_postErrors[] = $this->l('Invalid Language'); + if (!Tools::getValue('mr_weight_coef') OR !Validate::isInt(Tools::getValue('mr_weight_coef'))) + $this->_postErrors[] = $this->l('Invalid Weight Coefficient'); + } + elseif (Tools::isSubmit('submitMethod')) + { + if (Configuration::get('MR_ENSEIGNE_WEBSERVICE') == '' OR Configuration::get('MR_CODE_MARQUE') == '' OR + Configuration::get('MR_KEY_WEBSERVICE') == '' OR Configuration::get('MR_LANGUAGE') == '') + $this->_postErrors[] = $this->l('Please configure your Mondial Relay account settings before creating a carrier.'); + if (!preg_match("#^[0-9A-Za-z_\'., /\-]{2,32}$#", Tools::getValue('mr_Name'))) + $this->_postErrors[] = $this->l('Invalid carrier name'); + if (Tools::getValue('mr_ModeCol') != 'CCC') + $this->_postErrors[] = $this->l('Invalid Col mode'); + if (!preg_match("#^REL|24R|ESP|DRI|LDS|LDR|LD1$#", Tools::getValue('mr_ModeLiv'))) + $this->_postErrors[] = $this->l('Invalid delivery mode'); + if (!Validate::isInt(Tools::getValue('mr_ModeAss')) OR Tools::getValue('mr_ModeAss') > 5 OR Tools::getValue('mr_ModeAss') < 0) + $this->_postErrors[] = $this->l('Invalid Assurance mode'); + if (!Tools::getValue('mr_Pays_list')) + $this->_postErrors[] = $this->l('You must choose at least one delivery country.'); + } + elseif (Tools::isSubmit('submit_order_state')) + { + if (!Validate::isBool(Tools::getValue('mr_google_key'))) + $this->_postErrors[] = $this->l('Invalid google key'); + if (!Validate::isUnsignedInt(Tools::getValue('id_order_state'))) + $this->_postErrors[] = $this->l('Invalid order state'); + } + /* + elseif (Tools::isSubmit('PS_MRSubmitFieldPersonalization')) + { + $addr1 = Tools::getValue('Expe_ad1'); + if (!preg_match('#^[0-9A-Z_\-\'., /]{2,32}$#', strtoupper($addr1), $match)) + $this->_postErrors[] = $this->l('The Main address submited hasn\'t a good format'); + }*/ + } + + private function _postProcess() + { + foreach($_POST AS $key => $value) + { + $setArray[] = $value; + $keyArray[] = pSQL($key); + } + array_pop($setArray); + array_pop($keyArray); + + if (isset($_POST['submitMR']) AND $_POST['submitMR']) + self::mrUpdate('settings', $setArray, $keyArray); + elseif (isset($_POST['submitShipping']) AND $_POST['submitShipping']) + self::mrUpdate('shipping', $_POST, array()); + /*elseif (Tools::getValue('PS_MRSubmitFieldPersonalization')) + $this->updateFieldsPersonalization();*/ + elseif (isset($_POST['submitMethod']) AND $_POST['submitMethod']) + self::mrUpdate('addShipping', $setArray, $keyArray); + elseif (isset($_POST['submit_order_state']) AND $_POST['submit_order_state']) + { + Configuration::updateValue('MONDIAL_RELAY_ORDER_STATE', Tools::getValue('id_order_state')); + Configuration::updateValue('MR_GOOGLE_MAP', Tools::getValue('mr_google_key')); + $this->_html .= '
    '.$this->l('Settings updated').'
    '; + } + } + + public function hookOrderDetail($params) + { + global $smarty; + + $carrier = $params['carrier']; + $order = $params['order']; + + if ($carrier->is_module AND $order->shipping_number) + { + $module = $carrier->external_module_name; + include_once(_PS_MODULE_DIR_.$module.'/'.$module.'.php'); + $module_carrier = new $module(); + $smarty->assign('followup', $module_carrier->get_followup($order->shipping_number)); + } + elseif ($carrier->url AND $order->shipping_number) + $smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url)); + } + + public function hookOrderDetailDisplayed($params) + { + global $smarty; + + $res = Db::getInstance()->getRow(' + SELECT s.`MR_Selected_LgAdr1`, s.`MR_Selected_LgAdr2`, s.`MR_Selected_LgAdr3`, s.`MR_Selected_LgAdr4`, s.`MR_Selected_CP`, s.`MR_Selected_Ville`, s.`MR_Selected_Pays`, s.`MR_Selected_Num`, s.`url_suivi` + FROM `'._DB_PREFIX_.'mr_selected` s + WHERE s.`id_cart` = '.$params['order']->id_cart); + if ((!$res) OR ($res['MR_Selected_Num'] == 'LD1') OR ($res['MR_Selected_Num'] == 'LDS')) + return ''; + $smarty->assign('mr_addr', $res['MR_Selected_LgAdr1'].($res['MR_Selected_LgAdr1'] ? ' - ' : '').$res['MR_Selected_LgAdr2'].($res['MR_Selected_LgAdr2'] ? ' - ' : '').$res['MR_Selected_LgAdr3'].($res['MR_Selected_LgAdr3'] ? ' - ' : '').$res['MR_Selected_LgAdr4'].($res['MR_Selected_LgAdr4'] ? ' - ' : '').$res['MR_Selected_CP'].' '.$res['MR_Selected_Ville'].' - '.$res['MR_Selected_Pays']); + $smarty->assign('mr_url', $res['url_suivi']); + return $this->display(__FILE__, 'orderDetail.tpl'); + } + + /* + ** No need anymore + */ + public function hookProcessCarrier($params) + { + } + + /* + ** Update the carrier id to use the new one if changed + */ + public function hookupdateCarrier($params) + { + if ((int)($params['id_carrier']) != (int)($params['carrier']->id)) + { + Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'mr_method` + (mr_Name, mr_Pays_list, mr_ModeCol, mr_ModeLiv, mr_ModeAss, id_carrier) + ( + SELECT + mr_Name, + mr_Pays_list, + mr_ModeCol, + mr_ModeLiv, + mr_ModeAss, + "'.(int)$params['carrier']->id.'" + FROM `'._DB_PREFIX_.'mr_method` + WHERE id_carrier ='.(int)$params['id_carrier'].')'); + } + } + + /* + ** Get a carrier list liable to the module + */ + public function _getCarriers() + { + global $cookie; + + $id_lang = (int)$cookie->id_lang; + + // Query don't use the external_module_name to keep the + // 1.3 compatibility + $carriers = Db::getInstance()->ExecuteS(' + SELECT + c.id_carrier, + c.range_behavior, + m.id_mr_method, + m.mr_ModeLiv, + cl.delay + FROM `'._DB_PREFIX_.'mr_method` m + LEFT JOIN `'._DB_PREFIX_.'carrier` c + ON c.`id_carrier` = m.`id_carrier` + LEFT JOIN `'._DB_PREFIX_.'carrier_lang` cl + ON c.`id_carrier` = cl.`id_carrier` + WHERE c.`deleted` = 0 + AND c.active = 1'); + + if (!is_array($carriers)) + $carriers = array(); + return $carriers; + } + + public function hookextraCarrier($params) + { + global $smarty, $cart, $cookie, $defaultCountry, $nbcarriers; + + if (Configuration::get('MR_ENSEIGNE_WEBSERVICE') == '' || + Configuration::get('MR_CODE_MARQUE') == '' || + Configuration::get('MR_KEY_WEBSERVICE') == '' || + Configuration::get('MR_LANGUAGE') == '') + return ''; + + $address = new Address((int)($cart->id_address_delivery)); + $id_zone = Address::getZoneById((int)($address->id)); + $carriersList = self::_getCarriers(); + + // Check if the defined carrier are ok + foreach ($carriersList as $k => $row) + { + $carrier = new Carrier((int)($row['id_carrier'])); + if ((Configuration::get('PS_SHIPPING_METHOD') AND $carrier->getMaxDeliveryPriceByWeight($id_zone) === false) || + (!Configuration::get('PS_SHIPPING_METHOD') AND $carrier->getMaxDeliveryPriceByPrice($id_zone) === false)) + unset($carriersList[$k]); + else if ($row['range_behavior']) + { + // Get id zone + $id_zone = (isset($cart->id_address_delivery) AND $cart->id_address_delivery) ? + Address::getZoneById((int)($cart->id_address_delivery)) : + (int)$defaultCountry->id_zone; + if ((Configuration::get('PS_SHIPPING_METHOD') AND (!Carrier::checkDeliveryPriceByWeight($row['id_carrier'], $cart->getTotalWeight(), $id_zone))) OR + (!Configuration::get('PS_SHIPPING_METHOD') AND (!Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $cart->getOrderTotal(true, self::BOTH_WITHOUT_SHIPPING), $id_zone, $cart->id_currency)))) + unset($carriersList[$k]); + } + } + + $preSelectedRelay = $this->getRelayPointSelected($params['cart']->id); + $smarty->assign(array( + 'one_page_checkout' => (Configuration::get('PS_ORDER_PROCESS_TYPE') ? Configuration::get('PS_ORDER_PROCESS_TYPE') : 0), + 'new_base_dir' => self::$moduleURL, + 'MRToken' => self::$MRFrontToken, + 'carriersextra' => $carriersList, + 'preSelectedRelay' => isset($preSelectedRelay['MR_selected_num']) ? $preSelectedRelay['MR_selected_num'] : '', + 'jQueryOverload' => self::getJqueryCompatibility(false))); + + return $this->display(__FILE__, 'mondialrelay.tpl'); + } + + public function getContent() + { + global $cookie; + + $error = null; + + $html = ''; + if (!empty($_POST)) + { + $this->_postValidation(); + if (!sizeof($this->_postErrors)) + $this->_postProcess(); + else + { + $nbErrors = sizeof($this->_postErrors); + $this->_html .= '

    '.$nbErrors.' '.($nbErrors > 1 ? $this->l('errors') : $this->l('error')).'

      '; + foreach ($this->_postErrors AS $error) + $this->_html .= '
    1. '.$error.'
    2. '; + $this->_html .= '
    '; + } + } + + if (isset($_GET['delete_mr']) && !empty($_GET['delete_mr'])) + self::mrDelete((int)($_GET['delete_mr'])); + + $this->_html .= '

    '.$this->l('Configure Mondial Relay Rate Module').'

    + +
    + + '.$this->l('Try to turn off the cache and put the force compilation to on').' + '.$this->l('if you have any problems with the module after an update').'. +
    +
    + '.$this->l('Have a look to the following HOW-TO to help you to configure the Mondial Relay module').' + +
    +
    +
    + + '.$this->l('To create a Mondial Relay carrier'). + ' + - '.$this->l('Enter and save your Mondial Relay account settings').'
    + - '.$this->l('Create a Carrier using the form "add a carrier" below').'
    + - '.$this->l('Define a price for your carrier on').' + '.$this->l('The Carrier page').'
    + - '.$this->l('To generate labels, you must have a valid and registered address of your store on your'). + ' '.$this->l('contact page').'
    +
    +
    +
    '. + $this->settingsForm(). + '
    +
    '. + $this->settingsstateorderForm(). + '
    +
    '. + $this->advancedSettings(). + '
    +
    '. + $this->addMethodForm(). + '
    +
    '. + $this->shippingForm(). + '

    '; + return $this->_html; + } + + /* + ** Update the new defined fields of the merchant + */ + public function updateFieldsPersonalization() + { + Configuration::updateValue('PS_MR_SHOP_NAME', Tools::getValue('Expe_ad1')); + $this->_html .= '
    '.$this->l('Settings updated').'
    '; + } + + public function mrDelete($id) + { + $id = Db::getInstance()->getValue('SELECT `id_carrier` FROM `'._DB_PREFIX_ .'mr_method` WHERE `id_mr_method` = "'.(int)($id).'"'); + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_ .'carrier` SET `active` = 0, `deleted` = 1 WHERE `id_carrier` = "'.(int)($id).'"'); + $this->_html .= '
    '.$this->l('Delete successful').'
    '; + } + + public function mrUpdate($type, $array, $keyArray) + { + global $cookie; + + if ($type == 'settings') + { + Configuration::updateValue('MR_ENSEIGNE_WEBSERVICE', $array[0]); + Configuration::updateValue('MR_CODE_MARQUE', $array[1]); + Configuration::updateValue('MR_KEY_WEBSERVICE', $array[2]); + Configuration::updateValue('MR_LANGUAGE', $array[3]); + Configuration::updateValue('MR_WEIGHT_COEF', $array[4]); + } + elseif ($type == 'shipping') + { + array_pop($array); + foreach ($array AS $Key => $value) + { + $key = explode(',', $Key); + $id = Db::getInstance()->getValue('SELECT `id_carrier` FROM `'._DB_PREFIX_ .'mr_method` WHERE `id_mr_method` = "'.(int)($key[0]).'"'); + Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'carrier SET active = "'.(int)($value).'" WHERE `id_carrier` = "'.(int)($id).'"'); + } + } + elseif ($type == 'addShipping') + { + $query = 'INSERT INTO ' . _DB_PREFIX_ . 'mr_method ('; + + for ($q = 0; $q <= count($keyArray) - 1; $q++) + { + $end = ($q == count($keyArray) - 1) ? '' : ', '; + $query .= $keyArray[$q] . $end; + } + + $query .= ') VALUES('; + + for ($j = 0; $j <= count($array) - 1; $j++) + { + $var = $array[$j]; + if (is_array($var)) + $var = implode(",", $var); + $end = ($j == count($array) - 1) ? '' : ', '; + $query .= "'" . pSQL($var). "'" . $end; + } + $query .= ')'; + + Db::getInstance()->Execute($query); + + $mainInsert = mysql_insert_id(); + $default = Db::getInstance()->ExecuteS("SELECT * FROM " . _DB_PREFIX_ . "configuration WHERE name = 'PS_CARRIER_DEFAULT'"); + $check = Db::getInstance()->ExecuteS("SELECT * FROM " . _DB_PREFIX_ . "carrier"); + $checkD = array(); + + foreach($check AS $Key) + { + foreach($Key AS $key => $value) + if ($key == "id_carrier") + $checkD[] = $value; + } + + // Added for 1.3 compatibility to match with the right key + if (_PS_VERSION_ >= '1.4') + Db::getInstance()->Execute(' + INSERT INTO `' . _DB_PREFIX_ . 'carrier` + (`id_tax_rules_group`, `url`, `name`, `active`, `is_module`, `range_behavior`, `shipping_external`, `need_range`, `external_module_name`, `shipping_method`) + VALUES("0", NULL, "'.pSQL($array[1]).'", "1", "1", "1", "0", "1", "mondialrelay", "1")'); + else + Db::getInstance()->Execute(' + INSERT INTO `' . _DB_PREFIX_ . 'carrier` + (`url`, `name`, `active`, `is_module`, `range_behavior`) + VALUES(NULL, "'.pSQL('mondialrelay').'", "1", "0", "1")'); + + $get = Db::getInstance()->getRow('SELECT * FROM `' . _DB_PREFIX_ . 'carrier` WHERE `id_carrier` = "' . mysql_insert_id() . '"'); + Db::getInstance()->Execute('UPDATE `' . _DB_PREFIX_ . 'mr_method` SET `id_carrier` = "' . (int)($get['id_carrier']) . '" WHERE `id_mr_method` = "' . pSQL($mainInsert) . '"'); + $weight_coef = Configuration::get('MR_WEIGHT_COEF'); + $range_weight = array('24R' => array(0, 20000 / $weight_coef), 'DRI' => array(20000 / $weight_coef, 130000 / $weight_coef), 'LD1' => array(0, 60000 / $weight_coef), 'LDS' => array(30000 / $weight_coef, 130000 / $weight_coef)); + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'range_weight` (`id_carrier`, `delimiter1`, `delimiter2`) + VALUES ('.(int)($get['id_carrier']).', '.$range_weight[$array[2]][0].', '.$range_weight[$array[2]][1].')'); + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'range_price` (`id_carrier`, `delimiter1`, `delimiter2`) VALUES ('.(int)($get['id_carrier']).', 0.000000, 10000.000000)'); + $groups = Group::getGroups(Configuration::get('PS_LANG_DEFAULT')); + foreach ($groups as $group) + + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'carrier_group` (id_carrier, id_group) VALUES('.(int)($get['id_carrier']).', '.(int)($group['id_group']).')'); + + $zones = Zone::getZones(); + foreach ($zones as $zone) + { + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'carrier_zone` (id_carrier, id_zone) VALUES('.(int)($get['id_carrier']).', '.(int)($zone['id_zone']).')'); + $range_price_id = Db::getInstance()->getValue('SELECT id_range_price FROM ' . _DB_PREFIX_ . 'range_price WHERE id_carrier = "'.(int)($get['id_carrier']).'"'); + $range_weight_id = Db::getInstance()->getValue('SELECT id_range_weight FROM ' . _DB_PREFIX_ . 'range_weight WHERE id_carrier = "'.(int)($get['id_carrier']).'"'); + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'delivery` (id_carrier, id_range_price, id_range_weight, id_zone, price) VALUES('.(int)($get['id_carrier']).', '.(int)($range_price_id).', NULL,'.(int)($zone['id_zone']).', 0.00)'); + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'delivery` (id_carrier, id_range_price, id_range_weight, id_zone, price) VALUES('.(int)($get['id_carrier']).', NULL, '.(int)($range_weight_id).','.(int)($zone['id_zone']).', 0.00)'); + } + + if (!in_array($default[0]['value'], $checkD)) + $default = Db::getInstance()->ExecuteS("UPDATE " . _DB_PREFIX_ . "configuration SET value = '" . (int)($get['id_carrier']) . "' WHERE name = 'PS_CARRIER_DEFAULT'"); + } + else + return false; + + $this->_html .= '
    '.$this->l('Settings updated').'
    '; + return true; + } + + public function addMethodForm() + { + $zones = Db::getInstance()->ExecuteS("SELECT * FROM " . _DB_PREFIX_ . "zone WHERE active = 1"); + $output = ' +
    + +
    + '.$this->l('Add a Shipping Method').' +
      +
    • + * ' . $this->l('Required') . ' +
    • +
    • + + +
    • '; + /*
    • + + +
    • */ + + $output .= '
    • + + +
    • + +
    • + + +
    • + +
    • + + +
    • +
    • + +
    • +
    +
    +
    '; + + return $output; + } + + public function shippingForm() + { + global $cookie; + + $query = Db::getInstance()->ExecuteS(' + SELECT m.* + FROM `'._DB_PREFIX_.'mr_method` m + JOIN `'._DB_PREFIX_.'carrier` c + ON (c.`id_carrier` = m.`id_carrier`) + WHERE c.`deleted` = 0'); + + $output = ' +
    +
    + '.$this->l('Shipping Method\'s list').' +
      '; + if (!sizeof($query)) + $output .= '
    • '.$this->l('No shipping methods created').'
    • '; + else + foreach ($query AS $Options) + { + $output .= ' +
    • + Delete' . str_replace('_', ' ', $Options['mr_Name']) . ' (' . $Options['mr_ModeCol'] . '-' . $Options['mr_ModeLiv'] . ' - ' . $Options['mr_ModeAss'] . ' : '.$Options['mr_Pays_list'].') + +
    • '; + } + $output .= ' +
    +
    +

    + '; + + return $output; + } + + /* + ** Display advanced settings form + */ + public function advancedSettings() + { + $form = ''; + + $form .= ' +
    + + '.$this->l('Advanced Settings'). ' - + + '.$this->l('Click to display / hide the options').' + '. + ' +
    +

    '. + $this->l('URL Cron Task:').' '.Tools::getHttpHost(true, true). + _MODULE_DIR_.$this->name.'/cron.php?secure_key='. + Configuration::get('MONDIAL_RELAY_SECURE_KEY'). + '

    +
    +
    '; + return $form; + } + + /* + ** Form to allow personalization fields sent for MondialRelay + ** Not used anymore but still present if needed + */ + public function personalizeFormFields() + { + $form = ''; + $warn = ''; + + // Load the Default value from the configuration + $addr1 = (Configuration::get('PS_MR_SHOP_NAME')) ? + Configuration::get('PS_MR_SHOP_NAME') : + Configuration::get('PS_SHOP_NAME'); + + // Check if a request exist and if errors occured, use the post variable + if (Tools::isSubmit('PS_MRSubmitFieldPersonalization') && count($this->_postErrors)) + $addr1 = Tools::safeOutput(Tools::getValue('Expe_ad1')); + + + if (!Configuration::get('PS_MR_SHOP_NAME')) + $warn .= '
    '. + $this->l('Its seems you updated Mondialrelay without use the uninstall / install method, you have to set up this part to make working the generating ticket process'). + '
    '; + // Form + $form = '
    '; + $form .= ' +
    + + '.$this->l('Advanced Settings'). ' - + '.$this->l('Click to display / hide the options').' '. + ''. + $warn.' +
    +
    + - '.$this->l('This part allow to override the data sent at MondialRelay when you want to generate Ticket. Some fields are restricted by the length, or forbidden char').'. +
    + +
    +
    +

    '.$this->l('The key used by Mondialrelay is').' Expe_ad1 '.$this->l('and has this default value').' + : '.Configuration::get('PS_SHOP_NAME').'

    +
    + +
    + +
    +
    +
    +

    '; + return $form; + } + + + public function settingsstateorderForm() + { + global $cookie; + + $this->orderState = Configuration::get('MONDIAL_RELAY_ORDER_STATE'); + $output = ''; + $output .= '
    '; + $output .= '
    '.$this->l('Settings').''; + $output .= ''; + $output .= '
    '; + $output .= ''; + $output .= '

    ' . $this->l('Choose the order state for labels. You can manage the labels on').' '; + $output .= ''. + $this->l('the Mondial Relay administration page').'

    '; + $output .= '
    +
    '; + $output .= '
    '; + $output .= '

    '; + + return $output; + } + + + public function settingsForm() + { + $output = ' +
    +
    + '.$this->l('Mondial Relay Account Settings').' +
    + - '.$this->l('These parameters are provided by Mondial Relay once you subscribed to their service').' +
    +
      +
    • + * ' . $this->l('Required') . ' +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    • + + + (' . $this->l('grammes = 1 ') . Configuration::get('PS_WEIGHT_UNIT').') +
    • +
    • + +
    • +
    +
    +
    '; + + return $output; + } + + public function displayInfoByCart($id_cart) + { + $html = '

    '; + $simpleresul = Db::getInstance()->ExecuteS(' + SELECT * FROM ' . _DB_PREFIX_ . 'mr_selected + WHERE id_cart='.(int)($id_cart)); + + if (trim($simpleresul[0]['exp_number']) != '0') + $html .= $this->l('Nb expedition:').$simpleresul[0]['exp_number']."
    "; + if (trim($simpleresul[0]['url_etiquette']) != '0') + $html .= "".$this->l('Label URL')."
    "; + if (trim($simpleresul[0]['url_suivi']) != '0') + $html .= "".$this->l('Follow-up URL')."
    "; + if (trim($simpleresul[0]['MR_Selected_Num']) != '') + $html .= $this->l('Nb Point Relay :').$simpleresul[0]['MR_Selected_Num']."
    "; + if (trim($simpleresul[0]['MR_Selected_LgAdr1']) != '') + $html .= $simpleresul[0]['MR_Selected_LgAdr1']."
    "; + if (trim($simpleresul[0]['MR_Selected_LgAdr2']) != '') + $html .= $simpleresul[0]['MR_Selected_LgAdr2']."
    "; + if (trim($simpleresul[0]['MR_Selected_LgAdr3']) != '') + $html .= $simpleresul[0]['MR_Selected_LgAdr3']."
    "; + if (trim($simpleresul[0]['MR_Selected_LgAdr4']) != '') + $html .= $simpleresul[0]['MR_Selected_LgAdr4']."
    "; + if (trim($simpleresul[0]['MR_Selected_CP']) != '') + $html .= $simpleresul[0]['MR_Selected_CP']." "; + if (trim($simpleresul[0]['MR_Selected_Ville']) != '') + $html .= $simpleresul[0]['MR_Selected_Ville']."
    "; + if (trim($simpleresul[0]['MR_Selected_Pays']) != '') + $html .= $simpleresul[0]['MR_Selected_Pays']."
    "; + $html .= '

    '; + return $html; + } + + public function get_followup($shipping_number) + { + $query = 'SELECT url_suivi + FROM '._DB_PREFIX_ .'mr_selected + WHERE id_mr_selected=\''.(int)($shipping_number).'\';'; + + $settings = Db::getInstance()->ExecuteS($query); + if(!isset($settings[0]['url_suivi'])) + return null; + return $settings[0]['url_suivi']; + } + + public function set_carrier($key, $value, $id_carrier) + { + if ($key == 'name') + $key = 'mr_Name'; + + return Db::getInstance()->Execute(' + UPDATE ' . _DB_PREFIX_ . 'mr_method + SET '.pSQL($key).'="'.pSQL($value).'" + WHERE id_carrier=\''.(int)($id_carrier).'\' ; '); + } + + // Add for 1.3 compatibility and avoid duplicate code + public static function jsonEncode($result) + { + return (method_exists('Tools', 'jsonEncode')) ? + Tools::jsonEncode($result) : json_encode($result); + } + + public static function ordersSQLQuery1_4($id_order_state) + { + return 'SELECT o.`id_address_delivery` as id_address_delivery, + o.`id_order` as id_order, + o.`id_customer` as id_customer, + o.`id_cart` as id_cart, + o.`id_lang` as id_lang, + mrs.`id_mr_selected` as id_mr_selected, + CONCAT(c.`firstname`, \' \', c.`lastname`) AS `customer`, + o.`total_paid_real` as total, o.`total_shipping` as shipping, + o.`date_add` as date, o.`id_currency` as id_currency, o.`id_lang` as id_lang, + mrs.`MR_poids` as weight, mr.`mr_Name` as mr_Name, mrs.`MR_Selected_Num` as MR_Selected_Num, + mrs.`MR_Selected_Pays` as MR_Selected_Pays, mrs.`exp_number` as exp_number, + mr.`mr_ModeCol` as mr_ModeCol, mr.`mr_ModeLiv` as mr_ModeLiv, mr.`mr_ModeAss` as mr_ModeAss + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'carrier` ca + ON (ca.`id_carrier` = o.`id_carrier` + AND ca.`external_module_name` = "mondialrelay") + LEFT JOIN `'._DB_PREFIX_.'mr_selected` mrs + ON (mrs.`id_cart` = o.`id_cart`) + LEFT JOIN `'._DB_PREFIX_.'mr_method` mr + ON (mr.`id_mr_method` = mrs.`id_method`) + LEFT JOIN `'._DB_PREFIX_.'customer` c + ON (c.`id_customer` = o.`id_customer`) + WHERE ( + SELECT moh.`id_order_state` + FROM `'._DB_PREFIX_.'order_history` moh + WHERE moh.`id_order` = o.`id_order` + ORDER BY moh.`date_add` DESC LIMIT 1) = '.(int)($id_order_state).' + AND ca.`external_module_name` = "mondialrelay"'; + } + + public static function ordersSQLQuery1_3($id_order_state) + { + return ' + SELECT o.`id_address_delivery` as id_address_delivery, + o.`id_order` as id_order, + o.`id_customer` as id_customer, + o.`id_cart` as id_cart, + mrs.`id_mr_selected` as id_mr_selected, + CONCAT(c.`firstname`, \' \', c.`lastname`) AS `customer`, + o.`total_paid_real` as total, o.`total_shipping` as shipping, + o.`date_add` as date, o.`id_currency` as id_currency, o.`id_lang` as id_lang, + mrs.`MR_poids` as weight, mr.`mr_Name` as mr_Name, mrs.`MR_Selected_Num` as MR_Selected_Num, + mrs.`MR_Selected_Pays` as MR_Selected_Pays, mrs.`exp_number` as exp_number, + mr.`mr_ModeCol` as mr_ModeCol, mr.`mr_ModeLiv` as mr_ModeLiv, mr.`mr_ModeAss` as mr_ModeAss + FROM `'._DB_PREFIX_.'orders` o + LEFT JOIN `'._DB_PREFIX_.'carrier` ca + ON (ca.`id_carrier` = o.`id_carrier` + AND ca.`name` = "mondialrelay") + LEFT JOIN `'._DB_PREFIX_.'mr_selected` mrs + ON (mrs.`id_cart` = o.`id_cart`) + LEFT JOIN `'._DB_PREFIX_.'mr_method` mr + ON (mr.`id_mr_method` = mrs.`id_method`) + LEFT JOIN `'._DB_PREFIX_.'customer` c + ON (c.`id_customer` = o.`id_customer`) + WHERE ( + SELECT moh.`id_order_state` + FROM `'._DB_PREFIX_.'order_history` moh + WHERE moh.`id_order` = o.`id_order` + ORDER BY moh.`date_add` DESC LIMIT 1) = '.(int)($id_order_state).' + AND ca.`name` = "mondialrelay"'; + } + + public static function getBaseOrdersSQLQuery($id_order_state) + { + if (_PS_VERSION_ >= '1.4') + return self::ordersSQLQuery1_4($id_order_state); + else + return self::ordersSQLQuery1_3($id_order_state); + } + + public static function getOrders($orderIdList = array(), $filterEntries = self::NO_FILTER) + { + $id_order_state = Configuration::get('MONDIAL_RELAY_ORDER_STATE'); + $sql = self::getBaseOrdersSQLQuery($id_order_state); + + if (count($orderIdList)) + { + $sql .= ' AND o.id_order IN ('; + foreach ($orderIdList as $id_order) + $sql .= (int)$id_order.', '; + $sql = rtrim($sql, ', ').')'; + } + switch($filterEntries) + { + case self::WITHOUT_HOME_DELIVERY: + $sql .= 'AND mr.mr_ModeLiv != "LD1" AND mr.mr_ModeLiv != "LDS"'; + break; + default: + break; + } + $sql .= ' + GROUP BY o.`id_order` + ORDER BY o.`date_add` ASC'; + return Db::getInstance()->ExecuteS($sql); + } + + public function getErrorCodeDetail($code) + { + global $statCode; + + if (isset($statCode[$code])) + return $statCode[$code]; + return $this->l('This error isn\'t referred : ') . $code; + } + + public function getRelayPointSelected($id_cart) + { + return Db::getInstance()->getRow(' + SELECT s.`MR_selected_num` + FROM `'._DB_PREFIX_.'mr_selected` s + WHERE s.`id_cart` = '.(int)$id_cart); + } + + public function isMondialRelayCarrier($id_carrier) + { + return Db::getInstance()->getRow(' + SELECT `id_carrier` + FROM `'._DB_PREFIX_.'mr_method` + WHERE `id_carrier` = '.(int)$id_carrier); + } + + public function hookpaymentTop($params) + { + if ($this->isMondialRelayCarrier($params['cart']->id_carrier) && + !$this->getRelayPointSelected($params['cart']->id)) + $params['cart']->id_carrier = 0; + } +} diff --git a/modules/mondialrelay/mondialrelay.tpl b/modules/mondialrelay_old/mondialrelay.tpl similarity index 100% rename from modules/mondialrelay/mondialrelay.tpl rename to modules/mondialrelay_old/mondialrelay.tpl diff --git a/modules/mondialrelay/orderDetail.tpl b/modules/mondialrelay_old/orderDetail.tpl similarity index 100% rename from modules/mondialrelay/orderDetail.tpl rename to modules/mondialrelay_old/orderDetail.tpl diff --git a/modules/mondialrelay/page_iso.php b/modules/mondialrelay_old/page_iso.php similarity index 100% rename from modules/mondialrelay/page_iso.php rename to modules/mondialrelay_old/page_iso.php diff --git a/modules/mondialrelay/style.css b/modules/mondialrelay_old/style.css similarity index 100% rename from modules/mondialrelay/style.css rename to modules/mondialrelay_old/style.css diff --git a/modules/philea_magistor/script/send_commande.php b/modules/philea_magistor/script/send_commande.php index f11affe6..2693fc64 100644 --- a/modules/philea_magistor/script/send_commande.php +++ b/modules/philea_magistor/script/send_commande.php @@ -186,6 +186,8 @@ if($magistorModule->active) { continue; }*/ $carriers_socol = array(67,87,88,89); + $carriers_mr = array(90); + $customer = new Customer($order->id_customer); $address_invoice = new Address($order->id_address_invoice); $address_delivery = new Address($order->id_address_delivery); @@ -197,7 +199,7 @@ if($magistorModule->active) { WHERE `id_cart` = '.(int) $order->id_cart.' AND `delivery_mode` != "" '); - + /* SOCOL */ if($delivery_info) { if($delivery_info['cecountry'] != 'FR') { $carrier_value = $socol_to_magistor['DOMINTER']; @@ -206,8 +208,23 @@ if($magistorModule->active) { } $prid = $delivery_info['prid']; } + } elseif(in_array((int) $order->id_carrier, $carriers_mr) { + /* MONDIAL RELAY */ + $delivery_info = $db->getRow(' + SELECT mr_m.`col_mode`, mr_m.`dlv_mode`, mr_s.* + FROM `'._DB_PREFIX_.'mr_selected` mr_s + LEFT JOIN `'._DB_PREFIX_.'mr_method` mr_m ON (mr_m.`id_mr_method` = mr_s.`id_method`) + WHERE mr_s.`id_cart` = '.(int) $order->id_cart.' + AND mr_m.`id_carrier` = '.(int) $order->id_carrier.' + AND `MR_Selected_Num` IS NOT NULL + '); + if($delivery_info) { + $carrier_value = $mr_to_magistor[$delivery_info['dlv_mode']]; + $prid = substr($delivery_info['MR_Selected_Num'], -5); + } } + if(!$carrier_value) { if((int)$address_delivery->id_country == 8) { $carrier_value = $tab_conversion_carrier[$order->id_carrier.':']; @@ -240,13 +257,23 @@ if($magistorModule->active) { $data .= str_pad( (!empty($address_invoice->phone_mobile)?$address_invoice->phone_mobile:$address_invoice->phone), 50, ' ', STR_PAD_RIGHT ); $data .= str_pad( substr(utf8_decode($customer->email), 0, 50), 50, ' ', STR_PAD_RIGHT ); + // LIVRAISON DOMICILE SOCOL if(in_array((int) $order->id_carrier, $carriers_socol) && $delivery_info && $delivery_info['delivery_mode'] == 'DOM' ) { $data .= str_pad(substr(utf8_decode(cleanChar($address_delivery->lastname)), 0, 50), 50, ' ', STR_PAD_RIGHT); $data .= str_pad(substr(utf8_decode(cleanChar($address_invoice->firstname.' '.$address_invoice->lastname)), 0, 50), 50, ' ', STR_PAD_RIGHT); - } else { + } + // LIVRAISON DOMICILE MONDIAL RELAY + elseif(in_array((int) $order->id_carrier, $carriers_mr) + && $delivery_info + && in_array($delivery_info['dlv_mode'], array('LD1', 'LDS', 'HOM')) + ) { + $data .= str_pad(substr(utf8_decode(cleanChars($address_delivery->lastname)), 0, 50), 50, ' ', STR_PAD_RIGHT); + $data .= str_pad(substr(utf8_decode(cleanChars($address_invoice->firstname.' '.$address_invoice->lastname)), 0, 50), 50, ' ', STR_PAD_RIGHT); + } + else { $data .= str_pad(substr(utf8_decode(cleanChar($address_delivery->firstname.' '.$address_delivery->lastname)), 0, 50), 50, ' ', STR_PAD_RIGHT); $data .= str_pad(substr(utf8_decode(cleanChar($address_delivery->company)), 0, 50), 50, ' ', STR_PAD_RIGHT); } @@ -277,6 +304,25 @@ if($magistorModule->active) { $data .= str_pad((isset($address_delivery->phone_mobile)?$address_delivery->phone_mobile:$address_delivery->phone), 50, ' ', STR_PAD_RIGHT); $data .= str_pad('', 50, ' ', STR_PAD_RIGHT); } + // LIVRAISON MONDIAL RELAY + elseif (in_array((int) $order->id_carrier, $carriers_mr) && $delivery_info) { + // MR DOMICILE + if (in_array($delivery_info['dlv_mode'], array('LD1', 'LDS', 'HOM'))){ + $data .= str_pad( substr(utf8_decode(cleanChars($address_delivery->firstname.' '.$address_delivery->lastname)), 0, 50), 50, ' ', STR_PAD_RIGHT); + $data .= str_pad( substr(utf8_decode(cleanChars($address_delivery->company)), 0, 50), 50, ' ', STR_PAD_RIGHT); + } else { + $data .= str_pad( substr(utf8_decode(cleanChars($address_delivery->lastname)), 0, 50), 50, ' ', STR_PAD_RIGHT); + $data .= str_pad( substr(utf8_decode(cleanChars($address_invoice->firstname.' '.$address_invoice->lastname)), 0, 50), 50, ' ', STR_PAD_RIGHT); + } + $data .= str_pad( substr(utf8_decode($address_delivery->address1),0,50), 50, ' ', STR_PAD_RIGHT ); + $data .= str_pad( substr(utf8_decode($address_delivery->address2),0,50), 50, ' ', STR_PAD_RIGHT ); + $data .= str_pad( substr(utf8_decode(cleanChar($address_delivery->other)),0,50), 50, ' ', STR_PAD_RIGHT );//ADRESSE 3 + $data .= str_pad( substr(utf8_decode($address_delivery->postcode),0,8), 8, ' ', STR_PAD_RIGHT ); + $data .= str_pad( substr(utf8_decode($address_delivery->city),0,50), 50, ' ', STR_PAD_RIGHT ); + $data .= str_pad( utf8_decode($db->getValue('SELECT iso_code FROM `'._DB_PREFIX_.'country` WHERE id_country = '.$address_delivery->id_country)), 50, ' ', STR_PAD_RIGHT ); + $data .= str_pad( (isset($address_delivery->phone_mobile)?$address_delivery->phone_mobile:$address_delivery->phone), 50, ' ', STR_PAD_RIGHT ); + $data .= str_pad( '', 50, ' ', STR_PAD_RIGHT ); + } // LIVRAISON DOMICILE else{ $data .= str_pad( '', 50, ' ', STR_PAD_RIGHT);