modif soflex

This commit is contained in:
Marion Muszynski 2016-05-09 17:43:57 +02:00
parent e8f0026211
commit ffbb3232b9
201 changed files with 14737 additions and 10 deletions

View File

@ -298,6 +298,9 @@ class AdminCarriers extends AdminTab
$object->update();
$objectNew = new $this->className();
$this->copyFromPost($objectNew, $this->table);
if (isset($object->external_module_name)) {
$objectNew->external_module_name = $object->external_module_name;
}
$result = $objectNew->add();
if (Validate::isLoadedObject($objectNew))
{

View File

@ -0,0 +1,122 @@
NOTICE OF LICENSE
This source file is subject to a commercial license from Common-Services Co., Ltd.
Use, copy, modification or distribution of this source file without written
license agreement from the SARL SMC is strictly forbidden.
In order to obtain a license, please contact us: contact@common-services.com
INFORMATION SUR LA LICENCE D'UTILISATION
L'utilisation de ce fichier source est soumise a une licence commerciale concedee par la societe Common-Services Co., Ltd.
Toute utilisation, reproduction, modification ou distribution du present fichier source sans contrat de licence ecrit de la part de la
Common-Services Co. Ltd. est expressement interdite.
Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
@package So Colissimo Flexibilite
@copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
@author Alexandre D.
@license Commercial license
-----------------------------------------------------------------------------------------------------------------------------------------------------
####################################
# v3.1.05 - (2016-03-28)
####################################
Fixed bugs:
[*] FIX : Display error with deliveries at home in Order sheet
Improved/changed features:
[*] CORE : N/A
[*] BO : N/A
####################################
# v3.1.04 - (2016-03-21)
####################################
Fixed bugs:
[*] FIX : Bug with table `cart_product` and `customization` on PS 1.4
[*] FIX : Bug with delivery point not found if address is in Belgium
[*] FIX : Country ISO code when customer create an account on the order page
Improved/changed features:
[*] CORE : N/A
[*] BO : It is now possible to change the relay on the order sheet, a Google Map is displayed and merchant selects the relay
[*] BO : It is now possible to change the phone number on the order sheet
[*] BO : It is now possible to automatically set the carriers' delivery price for each country, a documentation is given to properly set it
[*] FO : N/A
####################################
# v3.1.03 - (2016-02-16)
####################################
Fixed bugs:
[*] FIX : add field `cecountry` in table `socolissimo_delivery_info` if it does not exist
[*] FIX : variable containing table name in SoFlexibiliteDelivery.php
[*] FIX : id_country while creating address
Improved/changed features:
[*] CORE : N/A
[*] BO : N/A
[*] FO : N/A
####################################
# v3.1.02 - (2016-02-10)
####################################
Fixed bugs:
[*] FIX : Customer phone on FO
Improved/changed features:
[*] CORE : New SoFlexibiliteDelivery class (SoFlexibiliteDelivery.php)
[*] CORE : Removed file SoColissimo.class.php
[*] BO : Admin order now uses same template from PS 1.4 to PS 1.6
[*] BO : Admin order template updated and placed under "Delivery" section
[*] FO : CSS in front-office
[*] FO : Screen display < 700px, clic on relay div now select the point
####################################
# v3.1.01 - (2016-01-05)
####################################
Fixed bugs:
[*] FIX : Colissimo sumup in order sheet
Improved/changed features:
[*] BO : N/A
####################################
# v3.1.0 - (2016-01-05)
####################################
Fixed bugs:
[*] FIX : Updated to use the new Coliposte Web Service
[*] FIX : Compliant for new Colissimo API
Improved/changed features:
[*] BO : Add Google Maps design option
[*] BO : Configuration now uses same JS and CSS from PS 1.4 to PS 1.6
[*] BO : Possible to lower the So Colissimo Flexibilité bloc in the order page
[*] FO : Order page now uses same JS and CSS from PS 1.4 to PS 1.6
[*] FO : Design compliant with new Colissimo branding

View File

@ -0,0 +1,83 @@
# So Colissimo Flexibilité
## A propos
So Colissimo Flexibilité - Module Officiel recommandé par Coliposte permet d'offrir une page conviviale de sélection de modes de transports sans altérer son tunnel de conversion.
## Les "+" pour vous
SoColissimo Flexibilité permet à vos clients de se faire livrer via le Web Service SoColissimo Flexibilité de La Poste.
L'option Flexibilité se différencie de l'option simplicité par le fait qu'il n'y ait pas de page interstitielle tel que sur l'offre Simplicité.
Le module So Colissimo Flexibilité version 2 est multitarif, il offre la possibilité de définir un tarif par méthode de livraison (Domicile, Rendez Vous, Point de Retrait etc..).
Grâce au thème mobile du module vous ne ratez plus de ventes à cause d'un mauvais support sur appareil mobile. Un autre point fort du module est qu'il rentre parfaitement dans les dimensions de la page PrestaShop.
Le support est gratuit et garanti jusqu'à la mise en ligne service complète du module ce qui vous confère sécurité et paisibilité.
__Le module Flexibilité est l'alternative professionnnelle du module gratuit utilisé pour les sites de faible envergure.
Le module Flexibilité a été audité et validé par Coliposte.__
Ce module a été développé par Common-Services, agence partenaire Prestashop, présente sur Prestashop Addons depuis 2010 et qui édite également 15 autres modules best-seller commercialisés uniquement sur Prestashop Addons.
## Fonctionnalités
Ce service offert par la Poste vous permet d'offrir à vos clients 5 méthodes de livraison :
* A domicile
* Dans un Espace Cityssimo
* Dans un Bureau de Poste
* Dans un Commerce du Réseau SoColissimo
* A Domicile, sur rendez-vous (Paris uniquement)
__Fonctionnement :__
Le module SoColissimo Flexibilité pour Prestashop est basé sur l'offre SoColissimo Flexibilité du groupe Coliposte.
Deux offres existent Liberté et Flexibilité, cette dernière et la dernière version de Coliposte et évite les mises à jour régulière, le principe du module étant d'obtenir les données par un WebService (SOAP/XML).
L'option Flexibilité se différencie avec l'option simplicité par le fait qu'il n'y ai pas de page externe au site (Pas de page sandwich ou page interstitielle), la transaction est réalisée via le Web Service Flexibilité de Coliposte.
La différence avec le module Liberté est que ce module ne nécessite pas d'import de fichiers, il affiche une liste de point de retrait obtenue depuis le web/service de Coliposte.
__Compatibilité :__
- SoColissimo Flexibilité version 2 est compatible de Prestashop de 1.3 à 1.4 avec ou sans OPC (OnePageCheckout)
- SoColissimo Flexibilité version 2 est compatible de Prestashop à partir de la version 1.5 et Prestashop 1.6 avec ou sans OPC (OnePageCheckout) et sur mobile.
- Compatible avec toutes les solutions Expéditor Inet du marché.
- Compatible avec la suite backoffice "SoNice" disponible sur Prestashop Addons
- Le support technique est gratuit et garanti jusqu'à la mise en production du module
__Thèmes & Interfaces :__
* Support du thème Prestashop
* Support des thèmes Responsive
* Support du thème Mobile de Prestashop
* Support de OPC, OPC Mobile
__Démonstration:__
http://flexibilite.prestashop150.common-services.com/
Note : Vous devez avoir souscrit un contrat professionnel auprès de Coliposte pour accéder à ce service
## Les "+" pour vos clients
Proposer à vos client une interface simple, claire et conviviale :
* Une grande carte Google Maps avec les points de retrait les plus proches de vos clients
* Options de filtrage des points de retrait
* Information sur les points de retrait (horaires, fermetures, distance du domicile)
* Itinéraire du domicile jusqu'au point de retrait, en voiture ou à pied
* Navigation virtuelle dans la rue du point de retrait grâce au mode StreetView de Google
* Rechercher les points de retrait à proximité d'une adresse
* Une charte graphique neutre, adaptée à toutes les boutiques et personnalisable
* Livraison en Belgique
* Support Multi-Tarif : Une tarification différente par méthode de livraison, livraison gratuite possible, règles panier applicables
* Assurance Ad Valorem (optionnel, configurable dans le module)
* Remise avec ou Sans Signature en Front Office (optionnel, configurable dans le module)
__NB: Ce module s'adresse aux marchands disposant d'un numéro SIRET.__
### Requirements
- Vous devez avoir souscrit un contrat professionnel (option Flexibilité) auprès de la Poste pour accéder à ce service ou demander une simple modification de celui ci si vous êtes sous "Simplicité"
- Nous recommandons vivement l'utilisation d'un hébergement recommandé par Prestashop pour un fonctionnement optimal du module. Le choix d'un tel hébergement vous garanti le bon fonctionnement du module et un support optimal en cas de nécessité.

View File

@ -0,0 +1,347 @@
<?php
/*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 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/osl-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 <contact@prestashop.com>
* @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;
}
}

View File

@ -0,0 +1,48 @@
<?php
/*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 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/osl-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 <contact@prestashop.com>
* @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);
}
}

View File

@ -0,0 +1 @@
version = 0.4

View File

@ -0,0 +1,55 @@
<?php
/*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 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/osl-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 <contact@prestashop.com>
* @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;

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 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/osl-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 <contact@prestashop.com>
* @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;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,11 @@
<?php
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;

View File

@ -0,0 +1,691 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package soflexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
class SoFlexibiliteDelivery
{
const MODE_PRESTASHOP = 1;
const MODE_THIRDPARTY = 2;
public $mode;
public $id;
public $id_order;
public $id_cart;
public $id_point;
public $id_customer;
public $firstname;
public $lastname;
public $company;
public $telephone;
public $email;
public $type;
public $libelle;
public $indice;
public $postcode;
public $city;
public $country;
public $address1;
public $address2;
public $lieudit;
public $informations;
protected $database_mapping_fields = array(
'id' => array('prid', 'point_id'),
'id_order' => array('order_id'),
'id_cart' => array('id_cart', 'cart_id'),
'id_point' => array('prid', 'point_id'),
'id_customer' => array('id_customer', 'customer_id'),
'firstname' => array('cefirstname', 'firstname'),
'lastname' => array('cename', 'lastname'),
'company' => array('cecompanyname', 'company'),
'telephone' => array('cephonenumber', 'telephone'),
'email' => array('ceemail', 'email'),
'type' => array('delivery_mode', 'type'),
'libelle' => array('prname', 'libelle'),
'indice' => array('prcompladress', 'indice'),
'postcode' => array('przipcode', 'code_postal'),
'city' => array('prtown', 'commune'),
'country' => array('cecountry', 'pays'),
'address1' => array('pradress1', 'adresse1'),
'address2' => array('pradress2', 'adresse2'),
'lieudit' => array('pradress3', 'lieudit'),
'informations' => array('cedeliveryinformation', 'informations'),
);
public $validation = array(
'company' => '/[<>=#{}]*/',
'firstname' => '/[0-9!<>,;?=+()@#"°{}_$%:]*/',
'lastname' => '/[0-9!<>,;?=+()@#"°{}_$%:]*/',
'address1' => '/[!<>?=+@{}_$%]*/',
'address2' => '/[!<>?=+@{}_$%]*/',
'postcode' => '/[^a-zA-Z 0-9-]/',
'city' => '/[!<>;?=+@#"°{}_$%]*/',
'phone' => '/[a-zA-Z^%$#@!-]/',
'phone_mobile' => '/[a-zA-Z^%$#@!-]/'
);
public function __construct($id_cart = null, $id_customer = null)
{
$this->mode = max(1, (int)Configuration::get('SOFLEXIBILITE_MODE')) == 1 ?
self::MODE_PRESTASHOP : self::MODE_THIRDPARTY;
if ($id_cart) {
$this->id_cart = (int)$id_cart;
}
if ($id_customer) {
$this->id_customer = (int)$id_customer;
}
}
public function loadDelivery()
{
if (!$this->isInitSoFlexibiliteDelivery()) {
return (false);
}
$id_cart = 'id_cart';
$id_customer = 'id_customer';
$table_name = 'socolissimo_delivery_info';
if ($this->mode == self::MODE_THIRDPARTY) {
$id_cart = 'cart_id';
$id_customer = 'customer_id';
$table_name = 'so_delivery';
}
if (!$this->tableExists($table_name)) {
return (false);
}
$result = Db::getInstance()->getRow(
'SELECT *
FROM `'._DB_PREFIX_.$table_name.'`
WHERE `'.$id_cart.'` = '.(int)$this->id_cart.'
AND `'.$id_customer.'` = '.(int)$this->id_customer
);
if (!isset($result[$id_cart]) || !(int)$result[$id_cart]) {
return (false);
}
foreach ($this->database_mapping_fields as $k => $arr) {
foreach ($result as $idx => $val) {
if (in_array($idx, $arr)) {
$this->{$k} = $val;
}
}
}
return (true);
}
public function isLoadedObject()
{
return ($this instanceof SoFlexibiliteDelivery && $this->id_cart && $this->id_customer);
}
public function createAddressForPickupPoint($id_address_delivery = null)
{
if (!$this->isInitSoFlexibiliteDelivery()) {
return (false);
}
if ($id_address_delivery) {
$customer_address = new Address($id_address_delivery);
} else {
$customer_address = null;
}
$address = new Address();
$address_rules = Address::getValidationRules('Address');
$this->country = ($this->country && Tools::strlen($this->country) === 2) ?
$this->country : Country::getIsoById($customer_address->id_country);
$this->id_customer = $this->id_customer ? $this->id_customer : $customer_address->id_customer;
$address->id_country = (int)Country::getByIso($this->country);
$address->id_customer = (int)$this->id_customer;
$address->firstname = $customer_address->firstname;
$address->lastname = $customer_address->lastname;
$address->company = $this->libelle;
$address->address1 = $this->address1 ? $this->address1 : $customer_address->address1;
$address->address2 = $this->address2;
$address->postcode = $this->postcode ? $this->postcode : $customer_address->postcode;
$address->city = $this->city ? $this->city : $customer_address->city;
$address->phone_mobile = $this->telephone ? $this->telephone : $customer_address->phone_mobile;
$address->phone = $this->telephone ? $this->telephone : $customer_address->phone;
if (!$address->phone_mobile) {
$address->phone_mobile = '0661123456';
}
$address_fields = array(
'company',
'firstname',
'lastname',
'address1',
'address2',
'postcode',
'city',
'phone',
'phone_mobile'
);
foreach ($address_fields as $field) {
$address->{$field} = preg_replace($this->validation[$field], '', $address->{$field});
if (isset($address_rules['required'][$field]) && $address_rules['required'][$field]) {
if (empty($address->{$field})) {
$address->{$field} = '-';
}
}
if (isset($address_rules['size'][$field]) && $address_rules['size'][$field]) {
$address->{$field} = Tools::substr($address->{$field}, 0, $address_rules['size'][$field]);
}
}
$address->alias = 'So Colissimo - '.date('d-m-Y');
$address->active = 1;
$address->deleted = 1;
$address->add();
if (!Validate::isLoadedObject($address)) {
return (false);
}
return ((int)$address->id);
}
public function tableExists($table_name)
{
try {
$result = Db::getInstance()->ExecuteS('SHOW TABLES LIKE "'._DB_PREFIX_.pSQL($table_name).'"');
} catch (Exception $e) {
return (false);
}
if (!count($result)) {
return (false);
}
try {
$result = Db::getInstance()->ExecuteS('SHOW COLUMNS FROM `'._DB_PREFIX_.pSQL($table_name).'`');
} catch (Exception $e) {
return (false);
}
if (!count($result)) {
return (false);
}
return (true);
}
public function isInitSoFlexibiliteDelivery()
{
return ($this instanceof SoFlexibiliteDelivery && $this->id_cart && $this->id_customer);
}
public function removeDelivery($id_cart_to_delete)
{
if (!$id_cart_to_delete || !is_numeric($id_cart_to_delete)) {
return false;
}
$id_cart = 'id_cart';
$table_name = 'socolissimo_delivery_info';
if ($this->mode == self::MODE_THIRDPARTY) {
$id_cart = 'cart_id';
$table_name = 'so_delivery';
}
return (Db::getInstance()->delete(_DB_PREFIX_.$table_name, '`'.$id_cart.'` = '.(int)$id_cart_to_delete));
}
public function saveDelivery()
{
$this->installDeliveryTable();
if ($this->existsDelivery()) {
$result = $this->updateDelivery();
} else {
$result = $this->createDelivery();
}
return ($result);
}
public function updateDelivery()
{
if (!$this->isInitSoFlexibiliteDelivery()) {
return (false);
}
if ($this->mode == self::MODE_PRESTASHOP) {
$table_name = 'socolissimo_delivery_info';
$where = '`id_cart` = '.(int)$this->id_cart;
$values = array(
'id_cart' => (int)$this->id_cart,
'id_customer' => (int)$this->id_customer,
'delivery_mode' => pSQL($this->type),
'prid' => pSQL($this->id_point),
'prname' => pSQL($this->libelle),
// pSQL($this->lastname),
'prfirstname' => pSQL($this->firstname),
'prcompladress' => pSQL($this->indice),
'pradress4' => null,
'przipcode' => pSQL($this->postcode),
'prtown' => pSQL($this->city),
'cephonenumber' => pSQL(str_replace(' ', '', $this->telephone)),
'ceemail' => pSQL($this->email),
'cecompanyname' => pSQL($this->company),
'cedeliveryinformation' => pSQL($this->informations),
'cedoorcode1' => null,
'cedoorcode2' => null,
'cename' => pSQL($this->lastname),
'cefirstname' => pSQL($this->firstname),
'cecountry' => pSQL($this->country),
'codereseau' => in_array($this->type, array('CMT', 'BDP', 'BOM', 'BOS')) ? 'R12' : ''
);
if (in_array($this->type, array('DOM', 'DOS', 'RDV'))) {
$values['pradress1'] = pSQL($this->address2);
$values['pradress2'] = pSQL($this->lieudit);
$values['pradress3'] = pSQL($this->address1);
$values['prname'] = pSQL($this->lastname);
} else {
$values['pradress1'] = pSQL($this->address1);
$values['pradress2'] = pSQL($this->address2);
$values['pradress3'] = pSQL($this->lieudit);
}
} else {
$table_name = 'so_delivery';
$where = '`cart_id` = '.(int)$this->id_cart;
$values = array(
'cart_id' => (int)$this->id_cart,
'order_id' => (int)$this->id_order,
'customer_id' => (int)$this->id_customer,
'type' => pSQL($this->type),
'point_id' => pSQL($this->id_point),
'libelle' => pSQL($this->libelle),
'firstname' => pSQL($this->firstname),
'lastname' => pSQL($this->lastname),
'indice' => pSQL($this->indice),
'adresse1' => pSQL($this->address1),
'adresse2' => pSQL($this->address2),
'lieudit' => pSQL($this->lieudit),
'code_postal' => pSQL($this->postcode),
'commune' => pSQL($this->city),
'pays' => in_array($this->country, array('Belgique', 'BE')) ? 'BE' : 'FR',
'telephone' => pSQL(str_replace(' ', '', $this->telephone)),
'email' => pSQL($this->email),
'company' => pSQL($this->company),
'codereseau' => in_array($this->type, array('CMT', 'BDP', 'BOM', 'BOS')) ? 'R12' : ''
);
if (in_array($values['type'], array('DOM', 'DOS')) && $values['pays'] == 'BE') {
$values['codereseau'] = 'R12';
}
}
if (version_compare(_PS_VERSION_, '1.5', '>=')) {
$result = Db::getInstance()->update($table_name, $values, $where);
} else {
$result = Db::getInstance()->autoExecute(_DB_PREFIX_.$table_name, $values, 'UPDATE', $where);
}
return ($result);
}
public function createDelivery()
{
if (!$this->isInitSoFlexibiliteDelivery()) {
return (false);
}
if ($this->mode == self::MODE_PRESTASHOP) {
$table_name = 'socolissimo_delivery_info';
$values = array(
'id_cart' => (int)$this->id_cart,
'id_customer' => (int)$this->id_customer,
'delivery_mode' => pSQL($this->type),
'prid' => pSQL($this->id_point),
'prname' => pSQL($this->libelle),
// pSQL($this->lastname),
'prfirstname' => pSQL($this->firstname),
'prcompladress' => pSQL($this->indice),
'pradress4' => null,
'przipcode' => pSQL($this->postcode),
'prtown' => pSQL($this->city),
'cephonenumber' => pSQL(str_replace(' ', '', $this->telephone)),
'ceemail' => pSQL($this->email),
'cecompanyname' => pSQL($this->company),
'cedeliveryinformation' => null,
'cedoorcode1' => null,
'cedoorcode2' => null,
'cename' => pSQL($this->lastname),
'cefirstname' => pSQL($this->firstname),
'cecountry' => pSQL($this->country),
'codereseau' => in_array($this->type, array('CMT', 'BDP', 'BOM', 'BOS')) ? 'R12' : ''
);
if (in_array($this->type, array('DOM', 'DOS')) && $values['cecountry'] == 'BE') {
$values['codereseau'] = 'R12';
$values['delivery_mode'] = ($this->type == 'DOM') ? 'BOM' : 'BOS';
}
if ($this->type == 'CMT' && in_array($this->country, array('DE', 'ES', 'GB', 'LU', 'NL'))) {
$values['codereseau'] = 'R09';
} elseif (in_array($this->type, array('BDP', 'PCS')) && in_array($this->country, array('DE', 'ES', 'NL'))) {
$values['codereseau'] = 'X00';
}
if (in_array($this->type, array('DOM', 'DOS'))) {
$values['pradress1'] = pSQL($this->address2);
$values['pradress2'] = pSQL($this->lieudit);
$values['pradress3'] = pSQL($this->address1);
$values['prname'] = pSQL($this->lastname);
} else {
$values['pradress1'] = pSQL($this->address1);
$values['pradress2'] = pSQL($this->address2);
$values['pradress3'] = pSQL($this->lieudit);
}
} else {
$table_name = 'so_delivery';
$values = array(
'cart_id' => (int)$this->id_cart,
'order_id' => -(int)time(),
'customer_id' => (int)$this->id_customer,
'type' => pSQL($this->type),
'point_id' => pSQL($this->id_point),
'libelle' => pSQL($this->libelle),
'firstname' => pSQL($this->firstname),
'lastname' => pSQL($this->lastname),
'indice' => pSQL($this->indice),
'adresse1' => pSQL($this->address1),
'adresse2' => pSQL($this->address2),
'lieudit' => pSQL($this->lieudit),
'code_postal' => pSQL($this->postcode),
'commune' => pSQL($this->city),
'pays' => $this->country,
'telephone' => pSQL(str_replace(' ', '', $this->telephone)),
'email' => pSQL($this->email),
'company' => pSQL($this->company),
'codereseau' => in_array($this->type, array('CMT', 'BDP', 'BOM', 'BOS')) ? 'R12' : ''
);
if (in_array($values['type'], array('DOM', 'DOS')) && $values['pays'] == 'BE') {
$values['codereseau'] = 'R12';
$values['type'] = ($this->type == 'DOM') ? 'BOM' : 'BOS';
}
if ($this->type == 'CMT' && in_array($this->country, array('DE', 'ES', 'GB', 'LU', 'NL'))) {
$values['codereseau'] = 'R09';
} elseif (in_array($this->type, array('BDP', 'PCS')) && in_array($this->country, array('DE', 'ES', 'NL'))) {
$values['codereseau'] = 'X00';
}
}
if (version_compare(_PS_VERSION_, '1.5', '>=')) {
$result = Db::getInstance()->insert($table_name, $values);
} else {
$result = Db::getInstance()->autoExecute(_DB_PREFIX_.$table_name, $values, 'INSERT');
}
return ($result);
}
public function existsDelivery()
{
$id_cart = 'id_cart';
$id_customer = 'id_customer';
$table_name = 'socolissimo_delivery_info';
if ($this->mode == self::MODE_THIRDPARTY) {
$id_cart = 'cart_id';
$id_customer = 'customer_id';
$table_name = 'so_delivery';
}
if ($this->isInitSoFlexibiliteDelivery()) {
$result = Db::getInstance()->getRow(
'SELECT `'.$id_cart.'`
FROM `'._DB_PREFIX_.$table_name.'`
WHERE `'.$id_cart.'` = '.(int)$this->id_cart.'
AND `'.$id_customer.'` = '.(int)$this->id_customer
);
return (isset($result[$id_cart]) && (int)$result[$id_cart]);
}
return (false);
}
public function installDeliveryTable()
{
$pass = true;
$tables = array();
$query = Db::getInstance()->ExecuteS('SHOW TABLES');
foreach ($query as $rows) {
foreach ($rows as $table) {
$tables[$table] = 1;
}
}
if ($this->mode == self::MODE_PRESTASHOP) {
if (isset($tables[_DB_PREFIX_.'socolissimo_delivery_info'])) {
$pass = true;
$sqls = array();
$fields = array();
$query = Db::getInstance()->ExecuteS('SHOW COLUMNS FROM `'._DB_PREFIX_.'socolissimo_delivery_info`');
// Check existing field
if ($query) {
foreach ($query as $row) {
if ($row['Field'] === 'cephonenumber' &&
filter_var($row['Type'], FILTER_SANITIZE_NUMBER_INT) < 15
) {
Db::getInstance()->execute(
'ALTER TABLE `'._DB_PREFIX_.'socolissimo_delivery_info`
MODIFY `cephonenumber` VARCHAR(15)'
);
}
}
}
if ($query) {
foreach ($query as $row) {
$fields[$row['Field']] = 1;
}
}
// Add new field sample
if (!isset($fields['codereseau'])) {
$sqls[] =
'ALTER TABLE `'._DB_PREFIX_.'socolissimo_delivery_info`
ADD `codereseau` VARCHAR(3) NOT NULL AFTER `cedoorcode2`';
}
if (!isset($fields['cename'])) {
$sqls[] =
'ALTER TABLE `'._DB_PREFIX_.'socolissimo_delivery_info`
ADD `cename` VARCHAR(64) DEFAULT NULL';
}
if (!isset($fields['cefirstname'])) {
$sqls[] =
'ALTER TABLE `'._DB_PREFIX_.'socolissimo_delivery_info`
ADD `cefirstname` VARCHAR(64) DEFAULT NULL';
}
if (!isset($fields['cecountry'])) {
$sqls[] =
'ALTER TABLE `'._DB_PREFIX_.'socolissimo_delivery_info`
ADD `cecountry` VARCHAR(10) DEFAULT NULL AFTER `prtown`';
}
if (count($sqls)) {
foreach ($sqls as $sql) {
$pass = Db::getInstance()->Execute($sql) && $pass;
}
}
} else {
$sql = '
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'socolissimo_delivery_info` (
`id_cart` INT(10) NOT NULL,
`id_customer` INT(10) NOT NULL,
`delivery_mode` VARCHAR(3) NOT NULL,
`prid` TEXT(10) NOT NULL,
`prname` VARCHAR(64) NOT NULL,
`prfirstname` VARCHAR(64) NOT NULL,
`prcompladress` TEXT NOT NULL,
`pradress1` TEXT NOT NULL,
`pradress2` TEXT NOT NULL,
`pradress3` TEXT NOT NULL,
`pradress4` TEXT NOT NULL,
`przipcode` TEXT(10) NOT NULL,
`prtown` VARCHAR(64) NOT NULL,
`cecountry` VARCHAR(10) NOT NULL,
`cephonenumber` VARCHAR(15) NOT NULL,
`ceemail` VARCHAR(64) NOT NULL,
`cecompanyname` VARCHAR(64) NOT NULL,
`cedeliveryinformation` TEXT NOT NULL,
`cedoorcode1` VARCHAR(10) NOT NULL,
`cedoorcode2` VARCHAR(10) NOT NULL,
`codereseau` VARCHAR(3) DEFAULT NULL,
`cename` VARCHAR(64) DEFAULT NULL,
`cefirstname` VARCHAR(64) DEFAULT NULL,
PRIMARY KEY (`id_cart`,`id_customer`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;';
$pass = Db::getInstance()->execute($sql);
}
} else {
$pass = true;
// Laisser les champs de type TEXT a la fin pour des raisons d'optimisation SQL
$sql = '
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'so_delivery`(
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) DEFAULT NULL,
`cart_id` int(11) DEFAULT NULL,
`point_id` int(11) NOT NULL,
`customer_id` int(11) NOT NULL,
`firstname` varchar(38) DEFAULT NULL,
`lastname` varchar(38) DEFAULT NULL,
`company` varchar(38) DEFAULT NULL,
`telephone` varchar(10) DEFAULT NULL,
`email` varchar(64) DEFAULT NULL,
`type` varchar(3) DEFAULT NULL,
`libelle` varchar(50) DEFAULT NULL,
`indice` varchar(70) DEFAULT NULL,
`code_postal` varchar(5) DEFAULT NULL,
`commune` varchar(32) DEFAULT NULL,
`pays` varchar(32) NOT NULL,
`adresse1` varchar(38) DEFAULT NULL,
`adresse2` varchar(38) DEFAULT NULL,
`lieudit` varchar(38) DEFAULT NULL,
`codereseau` varchar(3) DEFAULT NULL,
`informations` text,
PRIMARY KEY (`id`),
UNIQUE KEY `u_order_id` (`order_id`),
UNIQUE KEY `u_cart_id` (`cart_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=10000000 ;';
if (!Db::getInstance()->Execute($sql)) {
return false;
}
$sqls = array();
// Alter the table to reflect new approach and add some
// REFIX: Add Fields
$query = Db::getInstance()->ExecuteS('SHOW COLUMNS FROM `'._DB_PREFIX_.'so_delivery`');
$fields = array();
foreach ($query as $row) {
$fields[$row['Field']] = 1;
}
if (!isset($fields['cart_id'])) {
$sqls[] = sprintf(
'ALTER TABLE `%s` ADD `cart_id` int(11) NULL AFTER `order_id`',
_DB_PREFIX_.'so_delivery'
);
}
if (!isset($fields['pays'])) {
$sqls[] = sprintf(
'ALTER TABLE `%s` ADD `pays` int(11) NULL AFTER `commune`',
_DB_PREFIX_.'so_delivery'
);
}
if (!isset($fields['codereseau'])) {
$sqls[] = sprintf(
'ALTER TABLE `%s` ADD `codereseau` varchar(3) DEFAULT NULL',
_DB_PREFIX_.'so_delivery'
);
}
// REFIX: Add Indexes
$query = Db::getInstance()->ExecuteS('SHOW INDEX FROM `'._DB_PREFIX_.'so_delivery`');
$fields = array();
foreach ($query as $row) {
$fields[$row['Key_name']] = 1;
}
if (!isset($fields['u_order_id'])) {
$sqls[] = sprintf(
'ALTER TABLE `%s` ADD UNIQUE `u_order_id` (`order_id`)',
_DB_PREFIX_.$this->_delivery
);
}
if (!isset($fields['u_order_id'])) {
$sqls[] = sprintf(
'ALTER TABLE `%s` ADD UNIQUE `u_cart_id` (`cart_id`)',
_DB_PREFIX_.$this->_delivery
);
}
// REFIX: Change Fields
$sqls[] = sprintf(
'ALTER TABLE `%s` CHANGE `order_id` `order_id` int(11) NULL',
_DB_PREFIX_.'so_delivery'
);
if ($sqls) {
foreach ($sqls as $sql) {
try {
if (!Db::getInstance()->Execute($sql)) {
$pass = false;
}
} catch (Exception $e) {
$pass = false;
echo $e->getMessage();
}
}
}
}
return $pass;
}
}

View File

@ -0,0 +1,49 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package soflexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
class SoFlexibiliteRangeWeight extends RangeWeight
{
/**
* Override add to create delivery value for selected zones without call to addDeliveryPrice
* @see classes/ObjectModelCore::add()
*
* @param bool $null_values
* @param bool $autodate
* @return bool Insertion result
*/
public function addWithoutCallToAddDeliveryPrice($autodate = true, $null_values = false)
{
if (!ObjectModel::add($autodate, $null_values) || !Validate::isLoadedObject($this)) {
return false;
}
if (defined('PS_INSTALLATION_IN_PROGRESS')) {
return true;
}
return true;
}
}

View File

@ -0,0 +1,163 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
class SoFlexibiliteTools
{
public static function file_get_contents($url, $use_include_path = false, $stream_context = null, $curl_timeout = 30)
{
if ($stream_context == null && preg_match('/^https?:\/\//', $url)) {
if (preg_match('/^https:\/\//', $url)) {
$contextOptions = array(
'ssl' => array(
'verify_peer' => true,
'cafile' => sprintf('%s/%s', dirname(dirname(__FILE__)), 'cert/cacert.pem'),
)
);
} else {
$contextOptions = array();
}
$stream_context = @stream_context_create(array('http' => array('timeout' => $curl_timeout)), $contextOptions);
}
if (in_array(ini_get('allow_url_fopen'), array('On', 'on', '1')) || !preg_match('/^https?:\/\//', $url)) {
//TODO Validation: http://forge.prestashop.com/browse/PSCSX-7758
return file_get_contents($url, $use_include_path, $stream_context);
} elseif (function_exists('curl_init')) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($curl, CURLOPT_TIMEOUT, $curl_timeout);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 2);
curl_setopt($curl, CURLOPT_CAINFO, sprintf('%s/%s', dirname(dirname(__FILE__)), 'cert/cacert.pem'));
if ($stream_context != null) {
$opts = stream_context_get_options($stream_context);
if (isset($opts['http']['method']) && Tools::strtolower($opts['http']['method']) == 'post') {
curl_setopt($curl, CURLOPT_POST, true);
if (isset($opts['http']['content'])) {
parse_str($opts['http']['content'], $post_data);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
}
}
}
$content = curl_exec($curl);
curl_close($curl);
return $content;
} else {
return false;
}
}
public static function moduleIsInstalled($module_name)
{
if (method_exists('Module', 'isInstalled')) {
return (Module::isInstalled($module_name));
} else {
Db::getInstance()->ExecuteS('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = \''.pSQL($module_name).'\'');
return (bool)Db::getInstance()->NumRows();
}
}
public static function copy($source, $destination, $stream_context = null)
{
if (is_null($stream_context) && !preg_match('/^https?:\/\//', $source)) {
return @copy($source, $destination);
}
return @file_put_contents($destination, Tools::file_get_contents($source, false, $stream_context));
}
public static function carrierIsEnabled($id_carrier)
{
return ((bool)Db::getInstance()->getValue('SELECT `active` FROM `'._DB_PREFIX_.'carrier` WHERE `id_carrier` = '.(int)$id_carrier));
}
public static function checkTables($compat_type = 1, $tables = array())
{
if ($compat_type == 1 && !isset($tables[_DB_PREFIX_.'socolissimo_delivery_info'])) {
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'socolissimo_delivery_info` (
`id_cart` INT(10) NOT NULL,
`id_customer` INT(10) NOT NULL,
`delivery_mode` VARCHAR(3) NOT NULL,
`prid` TEXT(10) NOT NULL,
`prname` VARCHAR(64) NOT NULL,
`prfirstname` VARCHAR(64) NOT NULL,
`prcompladress` TEXT NOT NULL,
`pradress1` TEXT NOT NULL,
`pradress2` TEXT NOT NULL,
`pradress3` TEXT NOT NULL,
`pradress4` TEXT NOT NULL,
`przipcode` TEXT(10) NOT NULL,
`prtown` VARCHAR(64) NOT NULL,
`cecountry` VARCHAR(10) NOT NULL,
`cephonenumber` VARCHAR(15) NOT NULL,
`ceemail` VARCHAR(64) NOT NULL,
`cecompanyname` VARCHAR(64) NOT NULL,
`cedeliveryinformation` TEXT NOT NULL,
`cedoorcode1` VARCHAR(10) NOT NULL,
`cedoorcode2` VARCHAR(10) NOT NULL,
PRIMARY KEY (`id_cart`,`id_customer`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;';
if (!Db::getInstance()->Execute($sql)) {
ConfigureMessage::error('Error while creating table socolissimo_delivery_info');
}
} elseif ($compat_type == 2 && !isset($tables[_DB_PREFIX_.'so_delivery'])) {
$sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'so_delivery` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`order_id` INT(11) DEFAULT NULL,
`cart_id` INT(11) DEFAULT NULL,
`point_id` INT(11) NOT NULL,
`customer_id` INT(11) NOT NULL,
`firstname` VARCHAR(38) DEFAULT NULL,
`lastname` VARCHAR(38) DEFAULT NULL,
`company` VARCHAR(38) DEFAULT NULL,
`telephone` VARCHAR(10) DEFAULT NULL,
`email` VARCHAR(64) DEFAULT NULL,
`type` VARCHAR(3) DEFAULT NULL,
`libelle` VARCHAR(50) DEFAULT NULL,
`indice` VARCHAR(70) DEFAULT NULL,
`code_postal` VARCHAR(5) DEFAULT NULL,
`commune` VARCHAR(32) DEFAULT NULL,
`pays` VARCHAR(32) NOT NULL,
`adresse1` VARCHAR(38) DEFAULT NULL,
`adresse2` VARCHAR(38) DEFAULT NULL,
`lieudit` VARCHAR(38) DEFAULT NULL,
`informations` TEXT,
PRIMARY KEY (`id`),
UNIQUE KEY `u_order_id` (`order_id`),
UNIQUE KEY `u_cart_id` (`cart_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=10000000;';
if (!Db::getInstance()->Execute($sql)) {
ConfigureMessage::error('Error while creating table so_delivery');
}
}
}
}

View File

@ -0,0 +1,217 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package soflexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.spartoo@common-services.com
*/
class SoFlexibiliteWebService
{
protected $debug;
private $ws;
private $login;
private $password;
public $options;
/**
* SoFlexibiliteWebService constructor.
*/
public function __construct()
{
$this->debug = false;
$this->params = null;
$this->ws = Configuration::get('SOFLEXIBILITE_WS');
$this->login = Configuration::get('SOFLEXIBILITE_LOGIN');
$this->password = Configuration::get('SOFLEXIBILITE_PASSWORD');
$this->options = array(
'trace' => true,
'exceptions' => true,
'soap_version' => 'SOAP_1_1',
'encoding' => 'utf-8'
);
}
/**
* Call web service.
*
* @param $method
* @param $params
* @return bool|mixed|null
*/
private function call($method, $params)
{
ini_set('soap.wsdl_cache_enabled', 0);
ini_set('soap.wsdl_cache_ttl', 0);
libxml_disable_entity_loader(false);
$options = $this->options;
$debug = $this->debug;
try {
$client = new SoapClient($this->ws, $options);
} catch (Exception $e) {
if ($debug) {
echo '<pre>'.print_r(libxml_get_errors(), true)."\n".
var_dump(libxml_get_last_error())."\n".
$e->getMessage().
'</pre>';
}
return false;
}
try {
$result = $client->__call($method, array($params));
} catch (SoapFault $fault) {
if ($debug) {
echo 'Request : <br/><xmp>'.$client->__getLastRequest().'</xmp><br/>Response : <br/>
<xmp>'.$client->__getLastResponse().'</xmp><br/>Error Message : <br/>'.$fault->getMessage().'<br/>\n';
echo $fault->getMessage().'\n';
}
$result = null;
}
return ($result);
}
/**
* Get the delivery mode available.
*
* @return array
*/
protected function getSelectedDeliveryMode()
{
$delivery_mode = array();
$relay_carrier = new Carrier((int)Configuration::get('SOFLEXIBILITE_A2P_ID'));
$bpr_carrier = new Carrier((int)Configuration::get('SOFLEXIBILITE_BPR_ID'));
if (Validate::isLoadedObject($relay_carrier) && $relay_carrier->active) {
$delivery_mode = array_merge($delivery_mode, array('A2P', 'CMT'));
}
if (Validate::isLoadedObject($bpr_carrier) && $bpr_carrier->active) {
$delivery_mode = array_merge($delivery_mode, array('BPR', 'BDP', 'CDI'));
}
return ($delivery_mode);
}
/**
* Get a list of relay pickup based on the address.
*
* @param $address
* @param int $filter_relay Filter relay pickup, set 0 not to get PickUp relays
* @return bool|mixed|null
*/
public function getRelays($address, $filter_relay = 1)
{
$method = 'findRDVPointRetraitAcheminement';
$request_id = md5(date('Ymdhis'));
if (isset($address['country']) && Tools::strlen($address['country']) > 2) {
$address['country'] = Country::getIsoById((int)Country::getIdByName(null, $address['country']));
}
$params = array(
'accountNumber' => $this->login,
'password' => $this->password,
'address' => $this->cleanup($address['address']),
'zipCode' => sprintf('%s', ($address['postcode'])),
'city' => $this->cleanup($address['city']),
'countryCode' => (isset($address['country']) && $address['country']) ? $address['country'] : 'FR',
'optionInter' => (isset($address['country']) && !in_array($address['country'], array('FR'))) ? 1 : 0,
'weight' => $address['weight'],
'shippingDate' => $address['date'],
'filterRelay' => (int)$filter_relay,
'requestId' => $request_id.$request_id
);
return ($this->call($method, $params));
}
/**
* Get Information about a relay based on its ID.
*
* @param $id
* @param string|null $date
* @return stdClass|null
*/
public function getRelay($id, $date = null)
{
$method = 'findPointRetraitAcheminementByID';
if (!$date) {
$date = date('d/m/Y', time() + 86400 * 2);
}
$params = array(
'accountNumber' => $this->login,
'password' => $this->password,
'id' => $id,
'date' => $date
);
$result = $this->call($method, $params);
if (!$result->return->errorCode) {
return ($result->return->pointRetraitAcheminement);
} else {
return null;
}
}
/**
* Get Information about a relay based on its ID.
* Static function.
*
* @param $id
* @param string|null $date
* @return stdClass|null
*/
public static function getRelayStatic($id, $date = null)
{
$web_service = new SoFlexibiliteWebService();
return $web_service->getRelay($id, $date);
}
/**
* Santize string for web service call
*
* @param $text
* @return string
*/
private function cleanup($text)
{
$text = mb_convert_encoding($text, 'HTML-ENTITIES', 'UTF-8');
$text = preg_replace(
array('/&szlig;/', '/&(..)lig;/', '/&([aouAOU])uml;/', '/&(.)[^;]*;/'),
array('ss', '$1', '$1e', '$1'),
$text
);
$text = str_replace('_', '/', $text);
$text = preg_replace('/[\x00-\x1F\x21-\x2E\x3A-\x3F\x5B-\x60\x7B-\x7F]/', ' ', $text);
return (Tools::strtoupper($text));
}
}

View File

@ -0,0 +1,11 @@
<?php
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;

View File

@ -0,0 +1,166 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
.hint {
display: block !important;
padding: 10px 15px !important;
background: #DDE9F7 !important;
font-weight: 700 !important;
line-height: 20px !important;
}
/* QTIP */
form label.tip span {
text-decoration: none;
font-style: inherit;
border-bottom: 1px dashed rgba(255, 150, 0, 0.40);
padding-bottom: 2px;
cursor: pointer;
}
#module_form {
font-family: Arial,Verdana,Helvetica,sans-serif;
}
#conf-param input[type="text"] {
width: 200px;
display: inline;
}
#so_readme {
display: none;
position: absolute;
margin-top: 40px;
left: 735px;
}
#so_readme div {
color: black;
font-family: "Comic Sans MS", cursive, sans-serif;
font-style: italic;
font-weight: bold;
font-size: 1em;
margin-left: 20px;
}
.cleaner {
clear:both;
}
#conf-import {
position: relative;
}
#import-loader {
position: absolute;
top: 0;
left: 550px;
}
#import-loader img {
width: 30px;
height: 30px;
}
.so-warning {
font-size: 12px;
margin-top: 5px;
display: block;
color:navy;
}
.so-alert {
font-size: 12px;
margin-top: 5px;
display: block;
color:red;
}
#conf-so-param input[type="text"] {
width: 50%;
background-color: #EBEDF4;
}
.descriptionList {
list-style: disc;
list-style-position: inside;
padding-left: 10px;
}
.descriptionBold {
font-weight: bold;
}
.descriptionLogo {
position: relative;
float:right;
}
.Licence {
color: brown;
font-weight: bold;
}
.urlLike {
color: black;
}
.defaultURL {
text-decoration: underline;
color: blue;
}
.submitconf
{
float:right;
margin:20px;
}
#import-loader {
position: absolute;
top: 15px;
left: 565px;
}
.col-lg-1 {
text-align: center;
}
.alert.alert-info {
line-height: 1.6em;
border: 1px solid transparent !important;
border-left: 3px solid #81cfe6 !important;
}
.alert.alert-info a {
font-weight: bold;
}
.bootstrap .form-group .control-label.col-lg-3 {
font-weight: bold;
margin-top: -2px;
}
.socolissimo_carriers_table a, .socolissimo_carriers_table a:hover {
color: initial;
text-decoration: none;
}

View File

@ -0,0 +1,11 @@
<?php
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;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,892 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
/* PrestaShop Fix */
#columns {
z-index: 10;
}
/* !PrestaShop Fix */
.soflexibilite_overlay {
position: fixed;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
z-index: 6000;
}
.so_box {
display: none;
box-sizing: border-box;
font-family: "Trebuchet MS", Helvetica, sans-serif;
position: fixed;
top: 50%;
left: 50%;
right: 50%;
z-index: 6001;
}
#gmap #uniform-so_constraint {
width: 15px !important;
display: inline-block !important;
}
#points::-webkit-scrollbar {
width: 10px;
}
#points::-webkit-scrollbar-track {
background-color: #eaeaea;
border-left: 1px solid #ccc;
}
#points::-webkit-scrollbar-thumb {
background-color: #ccc;
}
#points::-webkit-scrollbar-thumb:hover {
background-color: #aaa;
}
.row #soflexibilite_carrierList li img {
float: right;
margin-top: -15px;
}
.soflexibilite_addr_sumup input {
padding-left: 5px;
width: 50%;
min-height: 30px;
}
#infoCommande {
padding-left: 5px;
}
/* IE plus de cadre degue parce que src='' */
img[src=''] {
display: none;
}
a.tooltip {
outline: none;
margin-left: 5px;
text-decoration: none;
cursor: pointer;
}
a.tooltip:hover {
text-decoration: none;
}
a.tooltip span {
z-index: 10;
display: none;
}
#prevent_note {
width: 525px;
}
#soflexibilite_description_address #infoCommande {
width: 100%;
max-width: 100%;
}
/* CSS from default PS theme */
#so_box_hors {
font: normal 11px/14px Arial, Verdana, sans-serif;
color: #222;
}
#so_box_hors input,
#so_box_hors textarea {
-webkit-writing-mode: horizontal-tb;
}
#so_box_hors input,
#so_box_hors textarea {
margin: 0;
color: initial;
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0;
text-shadow: none;
display: inline-block;
}
#so_box_hors input[type="text"],
#so_box_hors input[type="email"],
#so_box_hors input[type="password"],
#so_box_hors input[type="submit"],
#so_box_hors input[type="image"] {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
-webkit-border-radius: 0 !important;
-moz-border-radius: 0 !important;
border-radius: 0 !important;
}
/* !CSS from default PS theme */
#soflex-loader {
width: 150px;
margin-left: auto;
margin-right: auto;
margin-top: 30%;
text-align: center;
}
#soflex-loader img {
width: 20px;
height: 20px;
}
#soflex-loader p {
margin-top: 10px;
}
#so_box_hors a.boxclose {
float: right;
width: 15px;
height: 15px;
background-color: transparent;
background-position: top left;
margin-top: -5px;
margin-right: 5px;
cursor: pointer;
}
#so_box_hors a.boxclose:hover {
background-position: -15px 0;
}
.float-left {
float: left;
display: block;
}
.keep-left {
margin-top: 10px;
width: 350px;
height: 423px;
}
.float-right {
float: right;
display: block;
}
#so-h3-recap-horsdom {
display: none;
}
.myAdress {
font-weight: bold;
font-size: 24px;
margin: 20px 0 20px;
}
#myContent2 {
display: block;
margin-left: auto;
margin-right: auto;
width: 550px;
/*border: 1px solid black;*/
}
.centrageInfo {
display: block;
margin-left: auto;
margin-right: auto;
width: 400px;
}
.so_info {
margin-bottom: 40px;
}
.telephone {
border: 1px solid silver;
font-weight: bold;
padding: 5px 5px 5px 5px;
}
.validation {
float: right;
padding: 5px 7px;
font-weight: bold;
color: #fff;
background-color: #ff6a00;
cursor: pointer;
}
#so_box_hors .lookup {
height: 32px;
width: 60%;
font-size: 18px;
padding-left: 5px;
}
#soflex-search {
position: relative;
width: 150px;
height: 30px;
text-align: center;
margin-left: 615px;
margin-top: -42px;
}
#soflex-search input {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
#soflex-search img {
display: none;
margin-top: 7px;
}
#so_box_hors #search-btn-pending {
display: none;
opacity: 0.2;
}
#so_recherche_loader {
vertical-align: -7px;
}
#so_box_hors .so-home {
float: left;
}
#so_box_hors .so-home img {
margin: 5px 15px 5px 5px;
}
#so-search {
height: 36px;
vertical-align: 3px;
margin: 5px;
}
#so_box_hors button, #so_box_hors input[type="button"] {
border: 1px solid #cc9900;
background: #f4b61b;
color: black !important;
}
#so-search .so-search-button {
font-weight: normal;
width: 135px;
height: 33px;
vertical-align: 1px;
margin: 9px;
text-align: center;
font-size: 1.4em;
padding: 5px 7px;
white-space: normal;
background-image: none;
}
#so_box_hors .so-hd-search {
font-size: 1.8em;
position: relative;
top: -3px;
width: 80%;
}
#so_box_hors .so-dt-search {
font-size: 1.8em;
margin: 0 0 9px;
padding: 0;
}
#so_box_hors #super-selector {
margin: 0;
}
#so_box_hors .so-separator {
border-bottom: 1px solid #CFCECE;
margin: 15px auto 15px auto;
width: 100%;
height: 5px;
background-color: gainsboro;
opacity: 0.37;
-moz-opacity: 0.37;
-khtml-opacity: 0.37;
filter: alpha(opacity=37);
}
.valideDomRdv {
position: absolute;
right: 40px;
bottom: 40px;
}
#gmap {
border: 1px solid silver;
width: 60%;
height: 493px;
float: right;
}
#information-pr {
box-sizing: border-box;
position: relative;
display: none;
height: 100%;
width: 100%;
background: #fff;
border: 1px solid gainsboro;
padding: 10px
}
#so_box_hors .choixPR {
width: 170px;
height: 35px;
}
#so-no-points {
display: inline-block;
line-height: 1.3em;
font-size: 1.3em;
text-align: center;
margin-top: 50%;
padding: 15px;
color: grey;
}
#so_box_hors .pickup-point {
display: none;
cursor: pointer;
border-bottom: 1px solid silver;
}
#so_box_hors .picto {
float: left;
display: inline-block;
height: 60px;
margin: 5px 0 0 5px;
}
#so_box_hors .libelle {
padding-left: 10px;
font-weight: bold;
font-size: 1.2em;
display: inline-block;
width: 265px;
}
#so_box_hors .customName {
padding-left: 10px;
}
#so_box_hors .address1 {
padding-left: 10px;
white-space: nowrap;
}
#so_box_hors .code_postal {
padding-left: 10px;
}
#so_box_hors .commune {
padding-left: 10px;
}
#so_box_hors .point-choose {
float: right;
width: 24px;
height: 24px;
margin: -2px 15px 5px 0;
}
#so_box_hors table {
margin: 0;
}
#so_box_hors table td {
border: none;
}
#so_box_hors .hoLeft {
float: left;
border: 0px solid transparent;
font-family: "Lucida Console", Monaco, monospace;
background: none;
width: 98px;
}
#so_box_hors .hoLeft thead tr {
height: 35px;
}
#so_box_hors .hoLeft tbody tr td {
text-align: right;
height: 20px;
padding-right: 3px;
font-size: 11px;
}
#so_box_hors .hoClean {
clear: both;
width: 100%;
border: 2px solid whitesmoke;
}
#so_box_hors .tableHoFe {
/*float:left;*/
text-align: center;
border: 1px solid transparent;
font-family: "Lucida Console", "Courier New";
font-size: 10px;
background: none;
width: 230px;
}
#so_box_hors .tableHoFe tbody tr {
height: 60px;
}
#so_box_hors .tableHoFe thead {
color: black;
background-color: whitesmoke;
}
#so_box_hors .tableHoFe thead tr {
height: 25px;
}
#so_box_hors .tableHoFe thead tr td {
border: 1px solid white;
padding: 5px;
}
#so_box_hors .horaires {
background-color: white;
border: none;
}
#so_box_hors .tableHoFe tbody td {
width: 10%;
border: 1px solid transparent;
}
#so_box_hors .hoOpen {
background-color: darkseagreen;
color: white;
width: 100%;
height: 5px;
margin: 15px 0 15px 0;
}
#so_box_hors .hoClose {
background-color: salmon;
color: white;
width: 100%;
height: 5px;
margin: 15px 0 15px 0;
}
#main-selector {
width: 100%;
height: 100%;
position: absolute;
/*background-position-x: 0%;*/
/*background-position-y: 120%;*/
/*background-position: 0% 120%;*/
background-repeat: no-repeat;
}
#main-selector:hover {
background-color: gainsboro;
}
#button-selector {
position: absolute;
top: 0;
left: 0;
font-style: normal;
cursor: pointer;
border: 2px outset buttonface;
width: 350px;
height: 60px;
background-color: transparent;
background-repeat: no-repeat;
background-position-x: 95%;
background-position-y: 50%;
background-position: 95% 50%;
margin-left: 0;
}
#selector {
background-color: whitesmoke;
border: 1px solid #ccc;
width: 100%;
position: relative;
top: 65px;
overflow: hidden;
display: none;
z-index: 1600;
}
#selector ul {
list-style-type: none;
padding: 0;
margin: 0;
width: 350px;
}
#selector ul li:hover {
background-color: gainsboro;
cursor: pointer;
}
#handicappedAccess {
width: 430px;
}
#so_box_hors .handiOp {
margin-left: 10%;
margin-right: 10%;
}
#so_box_hors #mapPanel {
position: absolute;
top: 85%;
left: 44%;
z-index: 5;
background-color: white;
padding: 5px;
border: 1px solid #999;
opacity: 0.75;
-moz-opacity: 0.75;
-khtml-opacity: 0.75;
filter: alpha(opacity=75);
}
#nbPoint {
width: auto;
background-color: whitesmoke;
}
#so_box_hors .choosethePR {
padding: 5px;
}
#so_box_hors .choosethePR:hover {
z-index: 3000;
background-color: lightgray;
border: 1px solid grey;
}
#so_box_hors .so-info-libelle {
color: #138913;
font-weight: bold;
margin-bottom: 10px;
padding-top: 5px;
line-height: 1.1em;
}
#so_box_hors .prez {
font-size: 1.4em;
line-height: 1.2em;
}
.so-prez-libelle {
font-size: 1.2em;
line-height: 1.3em;
color: #138913;
font-weight: bold;
margin-bottom: 10px;
}
#so_box_hors .so-infoWindow {
min-width: 300px;
}
#so_box_hors .so-info-close {
border: 1px solid whitesmoke;
cursor: pointer;
}
#so_box_hors .so-info-close:hover {
border: 1px solid gainsboro;
background-color: whitesmoke;
}
#so_box_hors table td, #so_box_hors table th {
padding: 0;
}
#so_box_hors .so-info-itinerary {
/*margin-left: 15px;*/
background: none;
border: none;
}
#so_box_hors .so-info-itinerary td {
background: none;
border: none;
}
#so_box_hors .so-info-itinerary input {
margin-right: 10px;
width: 100px;
text-align: center;
opacity: 0.6;
-moz-opacity: 0.6;
-khtml-opacity: 0.6;
filter: alpha(opacity=60);
}
#so_box_hors .so-info-itinerary-title {
font-weight: bold;
display: inline-block;
margin: 20px 0 10px 0;
}
#so_box_hors .so-info-schedule-title {
font-weight: bold;
display: inline-block;
margin: 20px 0 10px 0;
}
#so_box_hors .so-info-closing-title {
font-weight: bold;
display: inline-block;
margin: 20px 0 10px 0;
}
#fermeture {
font-weight: bold;
margin-left: auto;
margin-right: auto;
width: 200px;
text-align: center;
}
#so-info-buttons {
position: absolute;
height: 30px;
width: 320px;
padding: 15px;
/*bottom: 25px;*/
left:0;
}
.soflexibiliteStar {
color: red;
font-size: 2em;
vertical-align: -7px;
margin-left: 5px;
}
#soflexibilite_speech {
width: 500px;
text-align: center;
margin: 10px auto 0 auto;
}
#soflexibilite_desc_pr td {
width: 270px;
}
#soflexibilite_desc_pr input, .choiceDomOrDos {
width: 70%;
border-radius: 5px;
border: 1px solid silver;
padding: 5px;
}
#soflexibilite_info_cust td {
width: 25%;
height: 80px;
}
#adresseFinal {
/*border: 1px dashed black;*/
/*padding: 10px;*/
/*width: 100%;*/
/*margin-top: 15px;*/
}
.soTabInfo {
width: 120px;
display: inline-block;
margin-bottom: 5px;
}
#infofofo {
margin: 5px 5px 5px 10px;
}
#table_so_info input, #infofofo input {
width: 50%;
border-radius: 5px;
border: 1px solid silver;
padding: 5px;
}
#table_so_info {
width: 100%;
}
#infofofo input {
width: 98%;
}
#soflexibilite_carrierList {
/*font: normal 12px/14px Arial, Verdana, sans-serif;*/
/*background-color: #F1F2F4;*/
/*border: 1px solid #BDC2C9;*/
/*padding: 5px;*/
}
#soflexibilite_cust {
border: 1px dashed black;
padding: 10px;
width: 300px;
alignment-adjust: central;
}
.soflex_leger_decal {
padding-left: 10px;
font-size: 15px;
font-weight: bold;
}
.so-bold {
font-weight: bold;
height: 25px;
}
#so_box_hors .so_distance {
position: relative;
color: grey;
margin-right: 15px;
top: -2px;
}
.delivery_option_title a:hover {
text-decoration: none;
}
#so_constraint {
vertical-align: -2px;
}
#so_box_hors .so-pipe-separator {
margin: 0 5px 0 5px;
color: black;
font-size: 14px;
}
#so_box_hors .so-info-cpt {
margin-bottom: 30px;
}
#so_box_hors .enConges {
color: #bd4931;
font-size: 1.7em;
font-weight: bolder;
float: right;
}
#custMail, #sl_phone {
min-height: 30px;
}
@media (max-width: 1024px), (max-height: 660px) {
#table_so_info > tbody td:nth-child(3) {
display: none;
}
#so_box_hors a.boxclose {
margin-top: 13px;
margin-right: 10px;
}
#so_box_hors .hoLeft tbody tr td {
font-size: 9px;
}
#button-selector {
background-repeat: no-repeat;
}
}
@media (max-width: 991px) {
#table_so_info {
width: 97%;
}
}
@media (max-width: 700px) {
#soflexibilite_desc_pr > tbody > tr > td:nth-child(1) {
display: none;
}
img[alt^="mon "] {
width: 40px;
}
.tooltip {
display: none !important;
}
#gmap {
display: none;
}
#so_box_hors #super-selector {
width: 100% !important;
}
#so_box_hors .keep-left {
width: 100% !important;
height: 80% !important;
}
#so_box_hors {
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
}
#so_box_hors .soflexibilite_addr_sumup .col-lg-6 {
float: none;
}
}

View File

@ -0,0 +1,212 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
.soflexibilite_overlay {
background-color: black;
opacity: 0.7;
-moz-opacity: 0.7;
-khtml-opacity: 0.7;
filter: alpha(opacity=70);
}
.so_box {
width: 950px;
height: 645px;
height: auto;
margin-left: -475px;
margin-top: -350px;
background-color: #E9E9E9;
padding: 20px;
border: 2px solid #ccc;
-moz-box-shadow: 0 1px 5px #333;
-webkit-box-shadow: 0 1px 5px #333;
text-align: left;
}
#so_box_hors .selectBox {
width: 350px;
height: 425px;
overflow: auto;
background-color: white;
}
#so_box_hors #points div {
border-bottom: 1px solid whitesmoke;
}
#so_box_hors #points div:hover {
background-color: whitesmoke;
cursor:pointer;
}
/* LE CSS DU SELECT */
#so_box_hors #super-selector {
position:relative;
width:350px;
height:60px;
}
#so_box_hors #selector {
background-color: #fff;
border: 1px solid #ccc;
width:100%;
position:relative;
top:65px;
overflow:hidden;
display:none;
z-index:1600;
}
#so_box_hors #selector ul li:hover {
background-color:whitesmoke;
cursor:pointer;
}
.so-bold {
font-weight: bold;
height: 25px;
}
#so_box_hors #gmap div {
font-family: "Trebuchet MS", Helvetica, sans-serif;
}
#so_box_hors #gmap .so-info-libelle {
font-weight: bold;
font-size: 1.2em;
}
#so_box_hors #gmap .so-info-adresse, #so_box_hors #gmap .so-info-cpt {
font-weight: normal;
}
/***********************
** Responsive / Mobile
***********************/
@media (max-width: 800px) {
#so_box_hors .infoButton {
visibility: hidden;
display: none;
}
}
@media (max-width: 1024px), (max-height: 660px) {
.so_box {
display: none;
position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
z-index: 1500;
top: 0;
width: 100%;
height:100%;
margin: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
background-clip: padding-box;
border: none;
padding: 5px;
}
#so_box_hors .socolissimoLogo {
display: none;
visibility: hidden;
}
#so_box_hors #super-selector {
position: relative;
width: 35%;
height: 60px;
background-color: whitesmoke;
float: none;
top: 0;
}
#so_box_hors #button-selector {
position: relative;
top: 0px;
font-style: normal;
cursor: pointer;
border: 2px outset buttonface;
width: 100%;
height: 60px;
background: transparent;
}
#so_box_hors .keep-left {
width: 35%;
height: 75%;
}
#so_box_hors .so-dt-search, #so_box_hors .so-home, #so_box_hors .so-separator,
#so_box_hors .picto, #so_box_hors #mapPanel, #so_box_hors .so-hd-search {
display: none;
}
#so_box_hors #so-search .so-search-button {
font-weight: normal;
width: 100px;
height: 34px;
margin: 5px 0px 0 -150px;
font-size: 1.4em;
}
#so_box_hors .selectBox {
width: 100%;
height: 100%;
overflow-x: hidden;
}
#so_box_hors #information-pr {
width: 94%;
height: 98%;
overflow-x: hidden;
}
#so_box_hors #gmap {
position: fixed;
border: 1px solid silver;
width: 60%;
height: 87%;
right: 5px;
}
#so_box_hors .so-info-itinerary {
margin: 0;
}
#so_box_hors #soflex-search {
position: relative;
text-align: center;
margin-left: 615px;
margin-top: -42px;
margin-left: 85%;
width: 0;
height: 0;
}
}

View File

@ -0,0 +1,218 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
.soflexibilite_overlay {
background-color: white;
opacity: 0.6;
-moz-opacity: 0.6;
-khtml-opacity: 0.6;
filter: alpha(opacity=60);
}
.so_box {
-webkit-box-shadow: 1px 1px 12px black;
-moz-box-shadow: 1px 1px 12px black;
box-shadow: 1px 1px 12px black;
background: #fbfbfb;
background-clip: padding-box;
border: 1px solid #acacac;
border: 1px solid rgba(0,0,0,.333);
outline: 0;
width: 950px;
height: 645px;
margin-left: -475px;
margin-top: -350px;
padding: 20px;
text-align: left;
font: normal 11px/14px Arial, Verdana, sans-serif;
}
#so_box_hors .selectBox {
width: 350px;
height: 425px;
overflow: auto;
background-color: whitesmoke;
border: 1px solid gainsboro;
}
#so_box_hors #points div {
border-bottom: 1px solid gainsboro;
}
#so_box_hors #points div:hover {
background-color: gainsboro;
cursor:pointer;
}
/* LE CSS DU SELECT */
#so_box_hors #super-selector {
position:relative;
width:350px;
height:60px;
background-color: whitesmoke;
}
#so_box_hors #selector {
background-color: whitesmoke;
border: 1px solid #ccc;
width:100%;
position:relative;
top:65px;
overflow:hidden;
display:none;
z-index:1600;
}
#so_box_hors #selector ul li:hover {
background-color: gainsboro;
cursor:pointer;
}
.so-bold {
font-weight: bold;
height: 25px;
}
#so_box_hors #gmap div {
font-family: "Trebuchet MS", Helvetica, sans-serif;
}
#so_box_hors #gmap .so-info-libelle {
font-weight: bold;
font-size: 1.2em;
}
#so_box_hors #gmap .so-info-adresse, #so_box_hors #gmap .so-info-cpt {
font-weight: normal;
}
/***********************
** Responsive / Mobile
***********************/
@media (max-width: 800px) {
#so_box_hors .infoButton {
visibility: hidden;
display: none;
}
}
@media (max-width: 1024px), (max-height: 660px) {
.so_box {
display: none;
position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
z-index: 6001;
top: 0;
width: 100%;
height:100%;
margin: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
background-clip: padding-box;
border: none;
padding: 5px;
}
#so_box_hors .socolissimoLogo {
display: none;
visibility: hidden;
}
#so_box_hors #super-selector {
position: relative;
width: 35%;
height: 60px;
background-color: whitesmoke;
float: none;
top: 0;
}
#so_box_hors #button-selector {
position: relative;
top: 0px;
font-style: normal;
cursor: pointer;
border: 2px outset buttonface;
width: 100%;
height: 60px;
background: transparent;
}
#so_box_hors .keep-left {
width: 35%;
height: 75%;
}
#so_box_hors .so-dt-search, #so_box_hors .so-home, #so_box_hors .so-separator,
#so_box_hors .picto, #so_box_hors #mapPanel, #so_box_hors .so-hd-search {
display: none;
}
#so_box_hors #so-search .so-search-button {
font-weight: normal;
width: 100px;
height: 34px;
margin: 5px 0px 0 -150px;
font-size: 1.4em;
}
#so_box_hors .selectBox {
width: 100%;
height: 100%;
overflow-x: hidden;
}
#so_box_hors #information-pr {
width: 94%;
height: 98%;
overflow-x: hidden;
}
#so_box_hors #gmap {
position: fixed;
border: 1px solid silver;
width: 60%;
height: 87%;
right: 5px;
}
#so_box_hors .so-info-itinerary {
margin: 0;
}
#so_box_hors #soflex-search {
position: relative;
text-align: center;
margin-left: 615px;
margin-top: -42px;
margin-left: 85%;
width: 0;
height: 0;
}
}

View File

@ -0,0 +1,242 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
.soflexibilite_overlay {
background-color: black;
opacity: 0.75;
-moz-opacity: 0.75;
-khtml-opacity: 0.75;
filter: alpha(opacity=75);
}
.so_box {
background: #fbfbfb;
width: 950px;
height: 645px;
height: auto;
margin-left: -475px;
margin-top: -350px;
padding: 20px;
text-align: left;
font: normal 11px/14px Arial, Verdana, sans-serif;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
#button-selector, #gmap {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
#main-selector:hover, #so_box_hors #selector ul li:hover {
background-color: #fbfbfb;
}
#so_box_hors, #so-search > input {
color: #777777;
}
#so_box_hors .so-separator {
height: 1px;
}
#information-pr {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
#so_box_hors .selectBox {
width: 350px;
height: 425px;
overflow: auto;
background-color: white;
border: 1px solid gainsboro;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
#so_box_hors #points div {
border-bottom: 1px solid gainsboro;
}
#so_box_hors #points div:hover {
background-color: gainsboro;
cursor:pointer;
}
/* LE CSS DU SELECT */
#so_box_hors #super-selector {
position:relative;
width:350px;
height:60px;
background-color: white;
}
#so_box_hors #selector {
background-color: white;
border: 1px solid #ccc;
width:100%;
position:relative;
top:65px;
overflow:hidden;
display:none;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
#so_box_hors #selector ul li:hover {
background-color: gainsboro;
cursor:pointer;
}
.so-bold {
font-weight: bold;
height: 25px;
}
#so_box_hors #gmap div {
font-family: "Trebuchet MS", Helvetica, sans-serif;
}
#so_box_hors #gmap .so-info-libelle {
font-weight: bold;
font-size: 1.2em;
}
#so_box_hors #gmap .so-info-adresse, #so_box_hors #gmap .so-info-cpt {
font-weight: normal;
}
/***********************
Responsive / Mobile
***********************/
@media (max-width: 800px) {
#so_box_hors .infoButton {
visibility: hidden;
display: none;
}
}
@media (max-width: 1024px), (max-height: 660px) {
.so_box {
display: none;
position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
top: 0;
width: 100%;
height:100%;
margin: 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
background-clip: padding-box;
border: none;
padding: 5px;
}
#so_box_hors .socolissimoLogo {
display: none;
visibility: hidden;
}
#so_box_hors #super-selector {
position: relative;
width: 35%;
height: 60px;
background-color: whitesmoke;
float: none;
top: 0;
}
#so_box_hors #button-selector {
position: relative;
top: 0px;
font-style: normal;
cursor: pointer;
border: 2px outset buttonface;
width: 100%;
height: 60px;
background: transparent;
}
#so_box_hors .keep-left {
width: 35%;
height: 75%;
}
#so_box_hors .so-dt-search, #so_box_hors .so-home, #so_box_hors .so-separator,
#so_box_hors .picto, #so_box_hors #mapPanel, #so_box_hors .so-hd-search {
display: none;
}
#so_box_hors #so-search .so-search-button {
font-weight: normal;
width: 100px;
height: 34px;
margin: 8px 0px 0 -80px;
font-size: 1.4em;
}
#so_box_hors .selectBox {
width: 100%;
height: 100%;
overflow-x: hidden;
}
#so_box_hors #information-pr {
width: 94%;
height: 98%;
overflow-x: hidden;
}
#so_box_hors #gmap {
position: fixed;
border: 1px solid silver;
width: 60%;
height: 87%;
right: 5px;
}
#so_box_hors .so-info-itinerary {
margin: 0;
}
#so_box_hors #soflex-search {
position: relative;
text-align: center;
margin-top: -42px;
margin-left: 85%;
width: 0;
height: 0;
}
}

View File

@ -0,0 +1,137 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
#soflexibilite_logo_area {
float: right;
text-align: right;
}
#soflexibilite_em {
color: red;
font-weight: bold;
}
.soflexibilite_desc {
font-weight: bold;
}
.sf_slider_trigger {
cursor: pointer;
}
.float-left {
float: left;
}
#sf_panel {
margin-bottom: 0;
}
#sf_panel div.float-left:first-child {
text-align: center;
}
#sf_panel div.float-left {
width: 50%;
}
#sf_panel .sf_delivery_mode {
color: #fb4f14;
font-weight: bold;
}
/*
* GMAP
*/
.soflexibilite_overlay {
display: none;
position: fixed;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
z-index: 6000;
background-color: black;
opacity: 0.75;
-moz-opacity: 0.75;
-khtml-opacity: 0.75;
filter: alpha(opacity=75);
}
#so_box {
color: #000;
display: none;
box-sizing: border-box;
position: fixed;
top: 50%;
left: 50%;
right: 50%;
z-index: 6001;
background: #fbfbfb;
width: 950px;
height: 645px;
margin-left: -475px;
margin-top: -350px;
padding: 20px;
text-align: left;
font: normal 11px/14px Arial, Verdana, sans-serif;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
#so_box .col-lg-10 {
width: 83.33333%;
}
#so_box .col-lg-2 {
width: 16.66667%;
}
#so_box #sf_address.sf_loading {
background-image: url("../img/import-loader.gif");
background-repeat: no-repeat;
background-position-x: 100%;
background-position-y: 1px;
background-size: 26px;
}
#so_box #sf_address {
width: 82%;
}
#so_box .float-right {
float: right;
}
#sf_map {
border: 1px solid silver;
height: 565px;
}
#sf_map .sf_active {
background-color: gainsboro;
}

View File

@ -0,0 +1,11 @@
<?php
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;

Binary file not shown.

View File

@ -0,0 +1,108 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
ob_start();
require_once(dirname(__FILE__).'/../../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../../init.php');
require_once(_PS_MODULE_DIR_.'soflexibilite/soflexibilite.php');
require_once(_PS_MODULE_DIR_.'soflexibilite/classes/SoFlexibiliteWebService.php');
$id_pickup = Tools::getValue('id_pickup');
$id_customer = Tools::getValue('id_customer');
$id_cart = Tools::getValue('id_cart');
$id_order = Tools::getValue('id_order');
if (!$id_pickup) {
die('No pickup ID retrieved');
}
if (!$id_customer) {
die('No customer ID retrieved');
}
if (!$id_cart) {
die('No cart ID retrieved');
}
if (!$id_order) {
die('No order ID retrieved');
}
$id_pickup = sprintf('%06s', $id_pickup);
$soflexibilite_api = new SoFlexibiliteWebService();
$relay = $soflexibilite_api->getRelay($id_pickup);
if ($relay instanceof stdClass && $relay->identifiant) {
$customer = new Customer($id_customer);
$order = new Order($id_order);
$invoice_address = new Address($order->id_address_invoice);
$delivery_address = new Address($order->id_address_delivery);
$so_delivery = new SoFlexibiliteDelivery();
$so_delivery->id_cart = (int)$id_cart;
$so_delivery->id_customer = (int)$id_customer;
$so_delivery->loadDelivery();
$so_delivery->id_order = $id_order;
$so_delivery->type = $relay->typeDePoint;
$so_delivery->id_point = $relay->identifiant;
$so_delivery->libelle = $relay->nom;
$so_delivery->firstname = $invoice_address->firstname;
$so_delivery->address1 = $invoice_address->address1;
$so_delivery->address2 = $invoice_address->address2;
$so_delivery->address3 = '';
$so_delivery->company = $invoice_address->company;
$so_delivery->indice = '';
$so_delivery->postcode = $invoice_address->postcode;
$so_delivery->city = $invoice_address->city;
$so_delivery->country = Country::getIsoById($invoice_address->id_country);
$so_delivery->lieudit = '';
$status = $so_delivery->saveDelivery() ? true : false;
// $delivery_address->company = $relay->nom;
// $delivery_address->address1 = $relay->adresse1;
// $delivery_address->address2 = $relay->adresse2;
// $delivery_address->postcode = $relay->codePostal;
// $delivery_address->city = $relay->localite;
// $delivery_address->country = $relay->libellePays;
// $delivery_address->id_country = Country::getByIso($relay->codePays);
//
// $status &= $delivery_address->save();
$json = array(
'output' => ob_get_clean(),
'status' => $status
);
die(Tools::jsonEncode($json));
}
$json = array(
'output' => ob_get_clean(),
'status' => false
);
die(Tools::jsonEncode($json));

View File

@ -0,0 +1,74 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
require_once(dirname(__FILE__).'/../../../config/config.inc.php');
class SoFlexibiliteCheckPointSelectedOPC extends Module
{
public function save()
{
ob_start();
$retValue = 'NO';
if (Tools::getValue('check'))
{
$check = Tools::getValue('check');
if ($check === '0')
$this->context->cookie->soflexibilite_checkOPC = 42;
else if ($check === '1' && $this->context->cookie->soflexibilite_checkOPC === '42')
$retValue = 'OK';
else if ($check === '42')
$retValue = $this->context->cookie->soflexibilite_checkOPC;
else
$retValue = $this->context->cookie->soflexibilite_checkOPC = $check;
}
else
return (false);
$result = ob_get_clean();
if ($result)
$output = $result;
else
$output = null;
$json = array(
'output' => $output,
'status' => true,
'ret' => $retValue
);
die(Tools::jsonEncode($json));
}
}
$_soflexibilite_checkPointSelectedOPC = new SoFlexibiliteCheckPointSelectedOPC();
$_soflexibilite_checkPointSelectedOPC->save();

View File

@ -0,0 +1,112 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
require_once(dirname(__FILE__).'/../../../config/config.inc.php');
class CheckLogin
{
public $options = array();
public $params = array();
public $method = 'findRDVPointRetraitAcheminement';
public $request;
public $client;
public $ws;
public function __construct()
{
// SOAP
$this->options['trace'] = true;
$this->options['exceptions'] = true;
$this->options['soap_version'] = 'SOAP_1_1';
$this->options['encoding'] = 'utf-8';
$this->ws = Tools::getValue('ws');
// Params
$this->request = md5(date('Ymdhis'));
$this->params['accountNumber'] = Tools::getValue('login');
$this->params['password'] = Tools::getValue('pwd');
$this->params['address'] = '129 avenue des compagnons';
$this->params['zipCode'] = '34170';
$this->params['city'] = 'CASTELNAU LE LEZ';
$this->params['countryCode'] = 'FR';
$this->params['optionInter'] = 1;
$this->params['weight'] = '30';
$this->params['shippingDate'] = date('d/m/Y', time() + 86400 * 2);
$this->params['filterRelay'] = '0';
$this->params['requestId'] = $this->request.$this->request;
}
public function checkLog()
{
try {
$this->client = new SoapClient($this->ws, $this->options);
} catch (Exception $e) {
$callback = Tools::getValue('callback');
die($callback.'('.Tools::jsonEncode(array(
'status' => false,
'error_id' => 0,
'error' => '<pre>'.print_r(libxml_get_errors(), true).'<br>'.
var_dump(libxml_get_last_error()).'<br>'.$e->getMessage().'</pre>'
)).')');
}
try {
$result = $this->client->__call($this->method, array($this->params));
} catch (SoapFault $fault) {
$callback = Tools::getValue('callback');
die($callback.'('.Tools::jsonEncode(array(
'status' => false,
'error_id' => 0,
'error' => '<pre>Request : <br/><xmp>'.$this->client->__getLastRequest().'</xmp><br/>'.
'Response : <br/><xmp>'.$this->client->__getLastResponse().'</xmp><br/>'.
'Error Message : <br/>'.$fault->getMessage().'<br/>'.$fault->getMessage().'</pre>'
)).')');
}
if (isset($result->return->listePointRetraitAcheminement) &&
is_array($result->return->listePointRetraitAcheminement) &&
count($result->return->listePointRetraitAcheminement)) {
$status = true;
} else {
$status = false;
}
$callback = Tools::getValue('callback');
die($callback.'('.Tools::jsonEncode(array(
'status' => $status,
'error_id' => (string)$result->return->errorCode,
'error' => (string)$result->return->errorMessage,
)).')');
}
}
$checker = new CheckLogin();
$checker->checkLog();

View File

@ -0,0 +1,91 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
require_once(dirname(__FILE__).'/../../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../../init.php');
require_once(dirname(__FILE__).'/../soflexibilite.php');
class InitSoflexibiliteEnv extends SoFlexibilite
{
public function initEnvSoflexibilite()
{
ob_start();
$this->parser_url = $this->url.'/functions/parser.php';
$this->checkPointSelectedOPC_url = $this->url.'/functions/checkPointSelectedOPC.php';
if ($this->ps15x)
{
$customerAddresses = $this->context->customer->getAddresses((int)$this->context->cookie->id_lang);
$id_delivery_address = (int)$this->context->cart->id_address_delivery;
}
else
{
$customerAddresses = Db::getInstance()->ExecuteS('SELECT * FROM '._DB_PREFIX_.'address WHERE id_customer='.(int)$this->context->cookie->id_customer);
$id_delivery_address = (int)$this->context->cart->id_address_delivery;
}
$html = '';
foreach ($customerAddresses as $address)
{
if ((int)$address['id_address'] === $id_delivery_address)
{
$html .= '<input type="hidden" id="sl-0-company" value="'.$address['company'].'">';
$html .= '<input type="hidden" id="sl-0-firstname" value="'.$address['firstname'].'">';
$html .= '<input type="hidden" id="sl-0-lastname" value="'.$address['lastname'].'">';
$html .= '<input type="hidden" id="sl-0-address1" value="'.$address['address1'].'">';
$html .= '<input type="hidden" id="sl-0-address2" value="'.$address['address2'].'">';
$html .= '<input type="hidden" id="sl-0-postcode" value="'.$address['postcode'].'">';
$html .= '<input type="hidden" id="sl-0-city" value="'.$address['city'].'">';
$html .= '<input type="hidden" id="sl-0-country" value="'.Country::getNameById($this->id_lang, $address['id_country']).'">';
$html .= '<input type="hidden" id="sl-0-mail" value="'.$this->context->customer->email.'">';
if (isset($address['phone_mobile']))
{
$tel = preg_replace('[^\x30-\x39]', '', $address['phone_mobile']);
$tel = Tools::substr($address['phone_mobile'], Tools::strlen($address['phone_mobile']) - 9);
$tel = sprintf('%010s', $tel);
if (Tools::substr($tel, 1, 1) == 6 || Tools::substr($tel, 1, 1) == 7 || Tools::substr($tel, 1, 1) == 4)
$html .= '<input type="hidden" id="sl-0-phone" value="'.$tel.'">';
}
}
}
$result = $html.ob_get_clean();
print ($result);
die;
}
}
$SoflexibiliteEnv = new InitSoflexibiliteEnv();
$SoflexibiliteEnv->initEnvSoflexibilite();

View File

@ -0,0 +1,11 @@
<?php
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;

View File

@ -0,0 +1,123 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
require_once(dirname(__FILE__).'/../../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../../init.php');
require_once(dirname(__FILE__).'/../soflexibilite.php');
class InitSoflexibiliteEnv extends Module
{
public function initEnvSoflexibilite()
{
ob_start();
$this->name = 'soflexibilite';
$this->protocol = Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://';
$this->url = $this->protocol.htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/'.$this->name;
$this->parser_url = $this->url.'/functions/parser.php';
$this->point_list_url = $this->url.'/functions/point_list.php';
$this->saveDelivery_url = $this->url.'/functions/saveDeliveryPoint.php';
$this->initSoflexibiliteEnv_url = $this->url.'/functions/initSoflexibiliteEnv.php';
$this->checkPointSelectedOPC_url = $this->url.'/functions/checkPointSelectedOPC.php';
$customerAddresses = $this->context->customer->getAddresses((int)$this->context->cookie->id_lang);
$mobile = '';
$inputs = null;
$id_delivery_address = (int)$this->context->cart->id_address_delivery;
foreach ($customerAddresses as $address)
{
if ((int)$address['id_address'] === $id_delivery_address)
{
$inputs[] = array(
'id_address' => $address['id_address'],
'alias' => $address['alias'],
'company' => $address['company'],
'firstname' => $address['firstname'],
'lastname' => $address['lastname'],
'address1' => $address['address1'],
'address2' => $address['address2'],
'postcode' => $address['postcode'],
'city' => $address['city'],
'phone' => $address['phone_mobile'],
'country' => $address['country'],
'abdefault' => $address['id_address'] == $this->context->cart->id_address_delivery ? '1' : '0'
);
if (isset($address['phone_mobile']))
{
$tel = sprintf('%010s', preg_replace('[^\x30-\x39]', '', $address['phone_mobile']));
if (Tools::substr($tel, 1, 1) == 6 || Tools::substr($tel, 1, 1) == 7)
$mobile = $tel;
}
}
}
$this->context->smarty->assign(
array(
'soflexibilite_dom_id' => Configuration::get('SOFLEXIBILITE_DOM_ID'),
'soflexibilite_rdv_id' => Configuration::get('SOFLEXIBILITE_RDV_ID'),
'soflexibilite_bpr_id' => Configuration::get('SOFLEXIBILITE_BPR_ID'),
'soflexibilite_a2p_id' => Configuration::get('SOFLEXIBILITE_A2P_ID'),
'soflexibilite_cit_id' => Configuration::get('SOFLEXIBILITE_CIT_ID'),
'soflexibilite_cust_id' => $id_delivery_address,
'inputs' => $inputs,
'soflexibilite_mobile' => $mobile,
'soflexibilite_point_list_url' => $this->point_list_url,
'parser_url' => $this->parser_url,
'saveDeliveryPoint' => $this->saveDelivery_url,
'checkPointSelectedOPC' => $this->checkPointSelectedOPC_url,
'protocol' => $this->protocol,
'soflexibilite_cart_id' => $this->context->cookie->soflexibilite_cart_id
)
);
$html = $this->context->smarty->fetch(dirname(__FILE__).'/../views/templates/hook/displayBeforeCarrierMobile.tpl');
$result = ob_get_clean();
if ($result)
$output = $result;
else
$output = null;
$json = array(
'output' => $output,
'status' => true,
'html' => $html
);
die(Tools::jsonEncode($json));
}
}
$SoflexibiliteEnv = new InitSoflexibiliteEnv();
$SoflexibiliteEnv->initEnvSoflexibilite();

View File

@ -0,0 +1,297 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
require_once(dirname(__FILE__).'/../../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../../init.php');
require_once(_PS_MODULE_DIR_.'soflexibilite'.DIRECTORY_SEPARATOR.'soflexibilite.php');
require_once(_PS_MODULE_DIR_.'soflexibilite'.DIRECTORY_SEPARATOR.'classes'.DIRECTORY_SEPARATOR.'SoFlexibiliteWebService.php');
class SoFlexibilitePointList extends Module
{
private $soflexibilite = null;
public function __construct()
{
$this->soflexibilite = new SoFlexibilite();
parent::__construct();
}
public function l($string, $specific = false, $id_lang = null)
{
if (!$specific) {
$specific = 'point_list';
}
return ($this->soflexibilite->l($string, $specific, $id_lang));
}
protected function getActiveSoColissimoPickupCarriers()
{
$relay = Configuration::get('SOFLEXIBILITE_A2P_ID');
$cityssimo = Configuration::get('SOFLEXIBILITE_CIT_ID');
$bpr = Configuration::get('SOFLEXIBILITE_BPR_ID');
$relay_types = array_filter(array((int)$relay, (int)$cityssimo, (int)$bpr));
$active_carriers = Db::getInstance()->executeS('
SELECT `id_carrier`, `active`
FROM `'._DB_PREFIX_.'carrier`
WHERE `id_carrier` IN ('.implode(', ', $relay_types).')'
);
$carriers = array();
if (is_array($active_carriers) && count($active_carriers)) {
foreach ($active_carriers as $carrier) {
$carriers[$carrier['id_carrier']] = $carrier['active'];
}
} else {
$carriers = array(
$relay => false,
$cityssimo => false,
$bpr => false
);
}
return ($carriers);
}
public function dispatch()
{
$error = '';
$horaires = array();
$fermetures_relay = array();
$test = null;
$ferme_relay = null;
$points = array();
$point = null;
$relay = Configuration::get('SOFLEXIBILITE_A2P_ID');
$cityssimo = Configuration::get('SOFLEXIBILITE_CIT_ID');
$bpr = Configuration::get('SOFLEXIBILITE_BPR_ID');
$active_carriers = $this->getActiveSoColissimoPickupCarriers();
$relay = isset($active_carriers[$relay]) ? (bool)$active_carriers[$relay] : false;
$cityssimo = isset($active_carriers[$cityssimo]) ? (bool)$active_carriers[$cityssimo] : false;
$bpr = isset($active_carriers[$bpr]) ? (bool)$active_carriers[$bpr] : false;
ob_start();
$pass = true;
if (Tools::getValue('adresseRecherche') && Tools::getValue('address') && Tools::getValue('postcode') && Tools::getValue('city')) {
$address = array(
'address' => pSQL(Tools::getValue('address')),
'postcode' => (Tools::getValue('postcode')),
'city' => pSQL(Tools::getValue('city')),
'country' => pSQL(Tools::getValue('country')),
'weight' => '1',
'date' => date('d/m/Y', time() + 86400 * 2)
);
} else {
$error = $this->l('Invalid Query');
$pass = false;
}
if ($pass) {
$so_colissimo = new SoFlexibiliteWebService();
$point = $so_colissimo->getRelays($address, $relay);
}
if (isset($point->return->listePointRetraitAcheminement) && is_array($point->return->listePointRetraitAcheminement) && count($point->return->listePointRetraitAcheminement)) {
$listePointRetraitAcheminement = $point->return->listePointRetraitAcheminement;
$i = 0;
foreach ($listePointRetraitAcheminement as $pointRetraitAcheminement) {
if (!$pointRetraitAcheminement instanceof StdClass) {
continue;
} elseif (!$cityssimo && $pointRetraitAcheminement->typeDePoint == 'CIT') {
continue;
} elseif (!$bpr && ($pointRetraitAcheminement->typeDePoint == 'BPR' || $pointRetraitAcheminement->typeDePoint == 'BDP' || $pointRetraitAcheminement->typeDePoint == 'CDI')) {
continue;
}
$points[$i] = $pointRetraitAcheminement;
$horaires[$i] = $pointRetraitAcheminement->horairesOuvertureLundi.' '
.$pointRetraitAcheminement->horairesOuvertureMardi.' '
.$pointRetraitAcheminement->horairesOuvertureMercredi.' '
.$pointRetraitAcheminement->horairesOuvertureJeudi.' '
.$pointRetraitAcheminement->horairesOuvertureVendredi.' '
.$pointRetraitAcheminement->horairesOuvertureSamedi.' '
.$pointRetraitAcheminement->horairesOuvertureDimanche;
if (isset($pointRetraitAcheminement->listeConges->calendarDeDebut)) {
$fermetures_relay[$i] = Tools::substr(str_replace('-', '/', $pointRetraitAcheminement->listeConges->calendarDeDebut), 0, 10)
.'-'.Tools::substr(str_replace('-', '/', $pointRetraitAcheminement->listeConges->calendarDeFin), 0, 10);
} else {
$fermetures_relay[$i] = null;
}
$i++;
}
} elseif (isset($point->return->errorCode) && $point->return->errorCode) {
$error = sprintf('%s (%d): %s', $this->l('Error'), $point->return->errorCode, $point->return->errorMessage);
} else {
$error = sprintf('%s: %s', $this->l('Error'), $this->l('Web Service call failed'));
}
foreach ($horaires as $str) {
$html = '<table class="tableHoFe"><thead><td>'.$this->l('Mon').'</td><td>'.$this->l('Tue').'</td><td>'.$this->l('Wed')
.'</td><td>'.$this->l('Thu').'</td><td>'.$this->l('Fri').'</td><td>'.$this->l('Sat').'</td><td>'.$this->l('Sun').'</td></thead>';
$tps = explode(' ', $str);
for ($i = 0, $j = 0; $i < 14; $i += 2, $j += 1) {
$matin = explode('-', $tps[$i]);
$aprem = explode('-', $tps[$i + 1]);
$o_matin = $matin[0];
$c_matin = $matin[1];
$o_aprem = $aprem[0];
$c_aprem = $aprem[1];
$tranche1_ouverture = strtotime('Monday') + 80000 + strtotime($o_matin);
$tranche1_fermeture = strtotime('Monday') + 80000 + strtotime($c_matin);
$tranche2_ouverture = strtotime('Monday') + 80000 + strtotime($o_aprem);
$tranche2_fermeture = strtotime('Monday') + 80000 + strtotime($c_aprem);
$jour = date('l', (strtotime('Monday') + 80000 + (86400 * $j)));
$jours = array();
$jours['Monday'] = $this->l('Monday');
$jours['Tuesday'] = $this->l('Tuesday');
$jours['Wednesday'] = $this->l('Wednesday');
$jours['Thursday'] = $this->l('Thursday');
$jours['Friday'] = $this->l('Friday');
$jours['Saturday'] = $this->l('Saturday');
$jours['Sunday'] = $this->l('Sunday');
$jour = $jours[$jour];
if ($tranche1_fermeture - $tranche1_ouverture) {
$debutMat = $o_matin;
$finMat = $c_matin;
$debutAprem = $o_aprem;
$finAprem = $c_aprem;
if ($tranche2_fermeture - $tranche2_ouverture) {
$class = 'hoClose';
$ranges_html = '<table class="hoLeft"><thead>'.
'<tr><td>&nbsp;</td></tr></thead>'.
'<tbody>'.
'<tr><td>'.$debutMat.' - '.$finMat.'</td></tr>'.
'<tr><td>'.$finMat.' - '.$debutAprem.'</td></tr>'.
'<tr><td>'.$debutAprem.' - '.$finAprem.'</td></tr>'.
'</tbody>'.
'</table>';
} else {
$class = 'hoOpen';
$ranges_html = '<table class="hoLeft"><thead>'.
'<tr><td>&nbsp;</td></tr></thead>'.
'<tbody>'.
'<tr><td>'.$debutMat.' - 12h00</td></tr>'.
'<tr><td>12h00 - 14h00</td></tr>'.
'<tr><td>14h00 - '.$finMat.'</td></tr>'.
'</tbody>'.
'</table>';
}
$html .= '<td><div class="hoOpen">&nbsp;</div><div class="'.$class.'">&nbsp;<br></div><div class="hoOpen">&nbsp;</div></td>';
} else {
$html .= '<td><div class="hoClose">&nbsp;</div><div class="hoClose">&nbsp;<br></div><div class="hoClose">&nbsp;</div></td>';
$ranges_html = '<table class="hoLeft"><thead>'.
'<tr><td>&nbsp;</td></tr></thead>'.
'<tbody>'.
'<tr><td>08h00 - 12h00</td></tr>'.
'<tr><td>12h00 - 14h00</td></tr>'.
'<tr><td>14h00 - 18h00</td></tr>'.
'</tbody>'.
'</table>';
}
}
$html .= '</tr>';
$html .= '</table>';
$end_html = '<div class="hoClean"></div>';
$test[] .= $ranges_html.$html.$end_html;
}
// Formatage des fermetures
$html = null;
foreach ($fermetures_relay as $val) {
if ($val) {
$ho = explode('-', $val);
$today = date('Y/m/d');
if (strtotime($today) >= strtotime($ho[0]) && strtotime($today.' +3 days') <= strtotime($ho[1])) {
$html = 'disabled';
} else {
$ho[0] = date('d/m/Y', strtotime($ho[0]));
$ho[1] = date('d/m/Y', strtotime($ho[1]));
$html = '<span style="font-weight: bold;">'.$this->l('from').' '.$ho[0].' '.$this->l('to').' '.$ho[1].'</span>';
}
$ferme_relay[] .= $html;
} else {
$ferme_relay[] .= 'N/A';
}
}
$result = ob_get_clean();
if ($result) {
$output = $result;
} else {
$output = null;
}
$points ? $status = true : $status = false;
$json = array(
'output' => $output,
'status' => $status,
'points' => $points,
'error' => $error,
'horaires' => $test,
'fermetures' => $ferme_relay
);
die(Tools::jsonEncode($json));
}
}
$_soFlexibilite_PointList = new SoFlexibilitePointList();
$_soFlexibilite_PointList->dispatch();

View File

@ -0,0 +1,130 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
require_once(dirname(__FILE__).'/../../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../../init.php');
require_once(_PS_MODULE_DIR_.'soflexibilite/soflexibilite.php');
require_once(_PS_MODULE_DIR_.'soflexibilite/classes/SoFlexibiliteDelivery.php');
class SoFlexibiliteDeliverySave extends SoFlexibilite
{
public function save()
{
ob_start();
$id = null;
$type = null;
$pass = true;
$debug = FALSE;//Tools::getValue('debug');
// Ocarat change to invoice address
$address = new Address((int)$this->context->cart->id_address_invoice);
if (!Validate::isLoadedObject($address)) {
if ($debug) {
die(sprintf(
'%s(#%d): Validate::isLoadedObject(%d) failed'."\n",
basename(__FILE__),
__LINE__,
(int)$this->context->cart->id_address_delivery
));
}
$pass = false;
}
if (!(Tools::getValue('id') && Tools::getValue('type') && Tools::getValue('id_cart') &&
Tools::getValue('libelle') && Tools::getValue('adresse1') && Tools::getValue('code_postal')
&& Tools::getValue('commune'))) {
if ($debug) {
die(sprintf(
'%s(#%d): Missing Parameter'."\n",
basename(__FILE__),
__LINE__,
(int)$this->context->cart->id_address_delivery
));
}
$pass = false;
}
if ($pass) {
$id = (int)Tools::getValue('id');
$type = Tools::getValue('type');
$id_cart = (int)Tools::getValue('id_cart');
$phone = Tools::getValue('phone');
$libelle = Tools::getValue('libelle');
$indice = Tools::getValue('indice');
$codePostal = Tools::getValue('code_postal');
$commune = Tools::getValue('commune');
$adresse1 = Tools::getValue('adresse1');
// TODO sent country
$soDelivery = new SoFlexibiliteDelivery();
$soDelivery->id_cart = (int)$id_cart;
$soDelivery->id_order = -time();
$soDelivery->id_point = pSQL(sprintf('%06s', $id));
$soDelivery->id_customer = (int)$this->context->customer->id;
$soDelivery->firstname = $address->firstname;
$soDelivery->lastname = $address->lastname;
$soDelivery->company = $address->company;
$soDelivery->telephone = pSQL($phone);
$soDelivery->email = pSQL($this->context->customer->email);
$soDelivery->type = $type;
$soDelivery->libelle = pSQL($libelle);
$soDelivery->indice = pSQL($indice);
$soDelivery->postcode = pSQL($codePostal);
$soDelivery->city = pSQL($commune);
$soDelivery->country = (($type == 'CMT' || $type == 'BDP') ? pSQL('BE') : pSQL('FR'));
$soDelivery->address1 = pSQL($adresse1);
$soDelivery->address2 = pSQL('');
$soDelivery->lieudit = pSQL('');
$status = $soDelivery->saveDelivery() ? true : false;
} else {
$status = false;
}
$result = ob_get_clean();
if ($result) {
$output = $result;
} else {
$output = null;
}
$json = array(
'output' => $output,
'status' => $status
);
die(Tools::jsonEncode($json));
}
}
$so_flexibilite_delivery_save = new SoFlexibiliteDeliverySave();
$so_flexibilite_delivery_save->save();

View File

@ -0,0 +1,105 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
require_once(dirname(__FILE__).'/../../../config/config.inc.php');
if (version_compare(_PS_VERSION_, '1.5', '<')) {
require_once(dirname(__FILE__).'/../../../init.php');
}
require_once(_PS_MODULE_DIR_.'soflexibilite/soflexibilite.php');
require_once(_PS_MODULE_DIR_.'soflexibilite/classes/SoFlexibiliteDelivery.php');
class SoFlexibiliteSaveInfoCommande extends SoFlexibilite
{
public function save()
{
ob_start();
$id_cart = (int)Tools::getValue('cart');
$phone = null;
$info = null;
$status = true;
$update_required = false;
$soDelivery = new SoFlexibiliteDelivery();
$soDelivery->id_cart = (int)$id_cart;
$soDelivery->id_customer = (int)$this->context->customer->id;
$soDelivery->loadDelivery();
$phone = trim(Tools::getValue('phone'));
$info = trim(Tools::getValue('infoDelivery'));
$email = trim(Tools::getValue('email'));
$delivery_mode = Tools::strtoupper(trim(Tools::getValue('delivery_mode')));
if ($phone && $soDelivery->telephone != $phone) {
$soDelivery->telephone = pSQL(str_replace(' ', '', $phone));
$update_required = true;
}
if ($info && $soDelivery->informations != $info) {
$soDelivery->informations = pSQL($info);
$update_required = true;
}
if ($email && $soDelivery->email != $email) {
$soDelivery->email = pSQL($email);
$update_required = true;
}
if ($delivery_mode && $soDelivery->type != $delivery_mode) {
$soDelivery->type = pSQL($delivery_mode);
$update_required = true;
}
if ($update_required) {
$status = $soDelivery->saveDelivery() ? true : false;
}
$result = ob_get_clean();
if ($result) {
$output = $result;
} else {
$output = null;
}
$json = array(
'output' => $output,
'status' => $status,
'phone' => $phone,
'mail' => $email,
'info' => $info
);
die(Tools::jsonEncode($json));
}
}
$soflexibilite_saveinfocommande = new SoFlexibiliteSaveInfoCommande();
$soflexibilite_saveinfocommande->save();

View File

@ -0,0 +1,160 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package soflexibilite
* @author Alexandre D. <debuss-a>
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
require_once(dirname(__FILE__).'/../../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../../init.php');
require_once dirname(__FILE__).'/../classes/SoFlexibiliteTools.php';
require_once dirname(__FILE__).'/../classes/SoFlexibiliteRangeWeight.php';
ob_start();
Context::getContext()->shop->setContext(Shop::CONTEXT_ALL);
/*$shipping_cost_json_link = 'https://dl.dropboxusercontent.com/u/60698220/tarifs.json';
$shipping_cost = SoFlexibiliteTools::file_get_contents($shipping_cost_json_link);
$status = true;
try {
$shipping_cost = Tools::jsonDecode($shipping_cost, true);
} catch (Exception $e) {*/
$status = false;
$shipping_cost = null;
/*}*/
if (is_array($shipping_cost) && count($shipping_cost)) {
$id_carriers = Configuration::getMultiple(
array('SOFLEXIBILITE_DOM_ID', 'SOFLEXIBILITE_DOS_ID', 'SOFLEXIBILITE_BPR_ID', 'SOFLEXIBILITE_A2P_ID'),
null,
null,
null
);
if (!is_array($id_carriers) || !count($id_carriers)) {
$status = false;
} else {
foreach ($id_carriers as $key => $id_carrier) {
switch ($key) {
case 'SOFLEXIBILITE_DOM_ID':
$mode = 'DOM';
break;
case 'SOFLEXIBILITE_DOS_ID':
$mode = 'DOS';
break;
case 'SOFLEXIBILITE_BPR_ID':
$mode = 'BPR';
break;
case 'SOFLEXIBILITE_A2P_ID':
$mode = 'A2P';
break;
default:
$mode = null;
}
$carrier = new Carrier((int)$id_carrier);
if (!Validate::isLoadedObject($carrier)) {
printf('Impossible de charger le transporteur [%s].<br>', $mode);
continue;
}
// Delete carrier previous range weight
$range_weights = RangeWeight::getRanges($carrier->id);
foreach ($range_weights as $range_weight) {
$range = new RangeWeight((int)$range_weight['id_range_weight']);
if (Validate::isLoadedObject($range)) {
$range->delete();
}
}
// Add the new range weight
foreach ($shipping_cost as $iso_country => $ranges) {
if (!in_array($iso_country, array('FR', 'BE', 'LU', 'NL', 'DE', 'GB', 'ES'))) {
printf('[%s] not an accepted ISO', $iso_country);
continue;
}
$id_zone = Country::getIdZone((int)Country::getByIso($iso_country));
if (!$id_zone) {
printf('Error, unable to get id_zone for country [%s] ==> Skipped<br>', $iso_country);
continue;
} elseif ($id_zone && !$carrier->getZone((int)$id_zone)) {
$carrier->addZone((int)$id_zone);
}
$price_list = array();
$previous_range = 0;
foreach ($ranges as $weight => $costs) {
if (!RangeWeight::rangeExist($carrier->id, $previous_range, min(30, $weight + 0.001))) {
$range_w = new SoFlexibiliteRangeWeight();
$range_w->id_carrier = $carrier->id;
$range_w->delimiter1 = (float)$previous_range;
$range_w->delimiter2 = (float)min(30, $weight + 0.001);
$range_w->addWithoutCallToAddDeliveryPrice();
$previous_range = $range_w->delimiter2;
} else {
$range_w = new stdClass();
$range_w->id = (int)Db::getInstance()->getValue(
'SELECT `id_range_weight`
FROM `'._DB_PREFIX_.'range_weight` rw
WHERE `id_carrier` = '.(int)$carrier->id.'
AND `delimiter1` = '.(float)$previous_range.'
AND `delimiter2` = '.(float)min(30, $weight + 0.001)
);
$previous_range = (float)min(30, $weight + 0.001);
}
// Add price to range
if (Validate::isLoadedObject($range_w)) {
$price_list[] = array(
'id_shop' => null,
'id_shop_group' => null,
'id_range_price' => null,
'id_range_weight' => (int)$range_w->id,
'id_carrier' => (int)$carrier->id,
'id_zone' => (int)$id_zone,
'price' => (float)$costs[$mode]
);
}
}
$carrier->addDeliveryPrice($price_list, true);
}
}
}
}
$output = ob_get_clean();
$callback = Tools::getValue('callback');
$json = array(
'output' => $output,
'status' => $status
);
die($callback.'('.Tools::jsonEncode($json).')');

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

View File

@ -0,0 +1,11 @@
<?php
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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -0,0 +1,11 @@
<?php
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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 902 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,11 @@
<?php
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;

View File

@ -0,0 +1,534 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
$(document).ready(function () {
/*
* CHANGE PHONE
*/
$('#sf_modify_phone').click(function () {
var change_phone = prompt('Nouveau numéro de téléphone :');
change_phone = change_phone.split(' ').join('').replace(/\D/g, '');
$.ajax({
type: 'POST',
url: $('#soflexibilite_save_info_commande_url').val(),
dataType: 'json',
data: {
email: null,
phone: change_phone,
infoDelivery: null,
cart: $('#soflexibilite_id_cart').val()
},
success: function (data) {
//window.console && console.log(data);
if (data.status === true) {
$('#sf_phone').text(betterPhoneNumber(change_phone));
typeof showSuccessMessage === 'function' && showSuccessMessage('Le numéro de téléphone a été changé avec succès !')
} else {
//window.console && console.log('Error', data);
}
},
error: function (er) {
//window.console && console.log(er);
var error_msg = 'Une erreur est survenue lors du changement de téléphone...';
typeof showErrorMessage === 'function' ?
showErrorMessage(error_msg) :
alert(error_msg);
}
});
});
function betterPhoneNumber(nb) {
var prefix = '';
var prefix_length = 0;
var ret_nb = '';
if (nb.match(/^((\+)33)/i)) {
prefix = '+33 (0)';
prefix_length = 3;
} else if (nb.match(/^((00)33)/i)) {
prefix = '0033 (0)';
prefix_length = 4;
} else if (nb.match(/^((\+)32)/i)) {
prefix = '+32 (0)';
prefix_length = 3;
} else if (nb.match(/^((00)32)/i)) {
prefix = '0032 (0)';
prefix_length = 4;
}
if (prefix.length) {
nb = nb.substr(prefix_length);
}
nb = nb.split('').reverse().join('');
var length = nb.length;
for (i = 0; i < length; i += 1) {
if (i % 2 === 0) {
ret_nb += ' ';
}
ret_nb += nb[i];
}
ret_nb = ret_nb.split('').reverse().join('');
return (prefix + ret_nb);
}
/*
* CHANGE DELIVERY POINT
*/
$('.soflexibilite_overlay').click(function () {
$('.soflexibilite_overlay').fadeOut('fast', function () {
$('#so_box').fadeOut('slow');
setTimeout(resetOverlay, 300);
});
});
$('#sf_address').keypress(function (e) {
if (e.keyCode === 13) {
e.preventDefault();
$('#sf_lookup_address').click();
}
});
$('#sf_modify_relay').click(function () {
$('.soflexibilite_overlay').fadeIn('fast', function () {
$('#so_box').fadeIn(1000);
if (typeof (sf_map) !== 'undefined' && sf_map !== null) {
google.maps.event.trigger(sf_map, 'resize');
sf_map.fitBounds(sf_bounds);
}
});
});
var sf_customer_address = $('#sf_address').val();
var soflex_image_url = $('#sf_panel').find('img[alt="Colissimo"]').attr('src').split('img/')[0] + 'img/';
var sf_customer_lat = null;
var sf_customer_lng = null;
var sf_map = null;
var sf_map_zoom = 14;
var sf_map_options = null;
var sf_customer_house = null;
var sf_markers = [];
var sf_info_windows = [];
var sf_bounds = null;
var search_address_parameters = [];
var sf_mapping_relay_marker = [];
var sf_icon_home = new google.maps.MarkerImage(
soflex_image_url + 'home.png',
null,
null,
null,
new google.maps.Size(32, 32)
);
var sf_icon_relay = new google.maps.MarkerImage(
soflex_image_url + 'picto.png',
null,
null,
null,
new google.maps.Size(32, 32)
);
if (typeof google.maps === 'object') {
try {
var geocoder = new google.maps.Geocoder();
}
catch (e) {
window.console && console.log('Erreur GeoCODER', e);
alert($('#geocoder_failed').val());
}
geocoder.geocode({'address': sf_customer_address, 'region': 'FR'}, function (results, status) {
/*if (window.console) {
console.log('Address : ' + sf_customer_address || 'N/A');
if (results[0])
console.log('Google Map Api value : ' + results[0].geometry.location_type);
}*/
if (status === google.maps.GeocoderStatus.OK) {
sf_customer_lat = parseFloat(results[0].geometry.location.lat());
sf_customer_lng = parseFloat(results[0].geometry.location.lng());
}
/*else if (window.console)
window.console && console.log('google.maps.GeocoderStatus != OK', status, results);*/
$.ajax({
type: 'POST',
url: $('#soflexibilite_point_list_url').val(),
dataType: 'json',
data: {
adresseRecherche: $('#sf_address1').text(),
address: $('#sf_address1').text(),
postcode: $('#sf_postcode').text(),
city: $('#sf_city').text(),
country: $('#sf_iso_country').val()
},
success: function (data) {
//window.console && console.log(data);
if (data.status === true) {
sf_bounds = new google.maps.LatLngBounds();
sf_latlng = new google.maps.LatLng(sf_customer_lat, sf_customer_lng);
sf_map_options = {
zoom: sf_map_zoom,
center: sf_latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
styles: (typeof(sf_map_style) === 'object') ? sf_map_style : null
};
sf_map = new google.maps.Map(document.getElementById('sf_map'), sf_map_options);
sf_relay_control_div = document.createElement('div');
setControlRelay(sf_relay_control_div);
sf_relay_control_div.index = 1;
sf_map.controls[google.maps.ControlPosition.LEFT_TOP].push(sf_relay_control_div);
sf_customer_house = new google.maps.Marker({
map: sf_map,
position: new google.maps.LatLng(sf_customer_lat, sf_customer_lng),
icon: sf_icon_home
});
sf_bounds.extend(sf_customer_house.position);
fillPR(data.points, data.horaires, data.fermetures);
}
},
error: function (er) {
/*if (window.console)
console.log('Erreur geocoder.geocode()', er);*/
}
});
});
function setControlRelay(controlDiv) {
// Set CSS for the control center border.
var controlCenterMap = document.createElement('div');
controlCenterMap.style.backgroundColor = '#fff';
controlCenterMap.style.border = '2px solid #fff';
controlCenterMap.style.borderRadius = '3px';
controlCenterMap.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';
controlCenterMap.style.cursor = 'pointer';
controlCenterMap.style.margin = '10px';
controlCenterMap.style.textAlign = 'left';
//controlCenterMap.title = 'Recentrer la carte et les points de retrait';
controlDiv.appendChild(controlCenterMap);
// Set CSS for the control BPR interior.
var controlBPRText = document.createElement('div');
controlBPRText.style.color = 'rgb(0, 0, 0)';
controlBPRText.style.fontFamily = 'Roboto, Arial, sans-serif';
controlBPRText.style.fontSize = '11px';
controlBPRText.style.padding = '8px';
controlBPRText.innerHTML = 'Bureau de poste';
controlBPRText.id = 'sf_filter_bpr';
controlCenterMap.appendChild(controlBPRText);
// Set CSS for the control A2P interior.
var controlA2PText = document.createElement('div');
controlA2PText.style.color = 'rgb(0, 0, 0)';
controlA2PText.style.fontFamily = 'Roboto, Arial, sans-serif';
controlA2PText.style.fontSize = '11px';
controlA2PText.style.padding = '8px';
controlA2PText.innerHTML = 'PickUp Station';
controlA2PText.id = 'sf_filter_a2p';
controlCenterMap.appendChild(controlA2PText);
// Setup the click event listeners
$('#so_box').delegate('#sf_filter_bpr, #sf_filter_a2p', 'click', function () {
var mode = $(this).attr('id').split('_')[2].toUpperCase();
if ($(this).hasClass('sf_active')) {
$('#sf_filter_bpr, #sf_filter_a2p').removeClass('sf_active');
for (var x in sf_markers) {
sf_markers[x].setMap(sf_map);
}
} else {
$('#sf_filter_bpr, #sf_filter_a2p').removeClass('sf_active');
$(this).addClass('sf_active');
for (var x in sf_markers) {
if (sf_mapping_relay_marker[x] == mode) {
sf_markers[x].setMap(sf_map);
} else {
sf_markers[x].setMap(null);
}
}
}
closeSFInfoWindows();
});
}
function fillPR(points, horaires, fermetures) {
deleteMarkers();
$.each(points, function (p, point) {
//var point_div = $('#model-points').clone().appendTo('div#points').attr('id', 'PR' + p).attr('class', point.typeDePoint);
var distance = null;
var position = new google.maps.LatLng(point.coordGeolocalisationLatitude, point.coordGeolocalisationLongitude);
sf_mapping_relay_marker[p] = in_array(point.typeDePoint, ['BPR', 'BDP', 'CDI']) ? 'BPR' : 'A2P';
if (point.distanceEnMetre < 1000)
distance = '(env ' + point.distanceEnMetre + 'm)';
else
distance = '(env ' + (point.distanceEnMetre / 1000).toFixed(2) + 'Km)';
// Markers
sf_markers[p] = new google.maps.Marker({
map: sf_map,
position: position,
icon: sf_icon_relay
});
sf_bounds.extend(sf_markers[p].position);
google.maps.event.addListener(sf_markers[p], 'click', function () {
closeSFInfoWindows();
sf_info_windows[p].open(sf_map, sf_markers[p]);
if ($('#information-pr').is(':visible')) {
$('.infoButton').click();
}
});
// Info windows
var content_string = '<div class="so-infoWindow" rel="' + point.identifiant + '" style="min-width: 300px;">' +
'<strong>' + point.nom + '</strong><span class="float-right">' + distance + '</span><br><br>' +
point.adresse1 + '<br>' +
point.codePostal + ', ' + point.localite + '<br>' +
point.libellePays +
'</div><br>' +
'<u>Horaires :</u><br><br>';
content_string += '<table>';
var horaires_ws = {
lundi: point.horairesOuvertureLundi,
mardi: point.horairesOuvertureMardi,
mercredi: point.horairesOuvertureMercredi,
jeudi: point.horairesOuvertureJeudi,
vendredi: point.horairesOuvertureVendredi,
samedi: point.horairesOuvertureSamedi,
dimance: point.horairesOuvertureDimanche
};
for (var day in horaires_ws) {
horaires_ws[day] = horaires_ws[day].split(' ');
if (horaires_ws[day][0] === '00:00-00:00' && horaires_ws[day][1] === '00:00-00:00') {
horaires_ws[day][0] = 'Fermé';
horaires_ws[day][1] = '';
} else {
if (horaires_ws[day][0] === '00:00-00:00') {
horaires_ws[day][0] = '';
}
if (horaires_ws[day][1] === '00:00-00:00') {
horaires_ws[day][1] = '';
}
}
content_string += '<tr><td><strong>' + day.charAt(0).toUpperCase() + day.slice(1) + ' :</strong>&nbsp;&nbsp;&nbsp;</td><td style="padding-right: 10px;">' + horaires_ws[day][0] + '</td><td>' + horaires_ws[day][1] + '</td>';
}
content_string += '</table><br><br><button type="button" class="button btn btn-default float-right">Choisir</button><img src="' + soflex_image_url + 'import-loader.gif" class="float-right" width="26" style="display: none; margin-right: 10px;">';
if (fermetures[p] === 'disabled') {
content_string += '<strong>Fermé</strong>';
} else {
content_string += '';
}
sf_info_windows[p] = new google.maps.InfoWindow({
content: content_string,
maxWidth: 500
});
// Close when clic on map
google.maps.event.addListener(sf_map, 'click', function () {
sf_info_windows[p].close();
});
});
}
$('#sf_lookup_address').click(function () {
$('#sf_address').addClass('sf_loading');
var adresse_de_recherche = $('#sf_address').val().toUpperCase();
adresse_de_recherche = adresse_de_recherche.split('FRANCE').length > 1 ?
adresse_de_recherche.split('FRANCE')[0] + 'FRANCE' : adresse_de_recherche;
//window.console && window.console.log('Adresse de recherche : ' + adresse_de_recherche);
geocoder.geocode({'address': adresse_de_recherche, 'region': 'fr'}, function (results, status) {
if (status === google.maps.GeocoderStatus.OK) {
sf_customer_lat = parseFloat(results[0].geometry.location.lat());
sf_customer_lng = parseFloat(results[0].geometry.location.lng());
codeLatLng(results[0].geometry.location.lat(), results[0].geometry.location.lng());
setTimeout(function () {
$.ajax({
type: 'POST',
url: $('#soflexibilite_point_list_url').val(),
dataType: 'json',
data: {
adresseRecherche: adresse_de_recherche,
address: search_address_parameters['address'],
postcode: search_address_parameters['postcode'],
city: search_address_parameters['city'],
country: search_address_parameters['country']
},
success: function (data) {
$('#sf_address').removeClass('sf_loading');
//window.console && console.log(data);
if (typeof (data) === 'undefined' || data === null || typeof (data.points) === 'undefined' || data.points === null || data.points.length === 0)
$('#gmap').text('Une erreur est survenue.');
$('#sf_map *').length <= 1 && (sf_map = new google.maps.Map(document.getElementById('sf_map'), sf_map_options));
if (data.status === true) {
sf_bounds = new google.maps.LatLngBounds();
sf_bounds.extend(new google.maps.LatLng(sf_customer_lat, sf_customer_lng));
sf_customer_house && sf_customer_house.setMap(null);
sf_customer_house = new google.maps.Marker({
map: sf_map,
position: new google.maps.LatLng(sf_customer_lat, sf_customer_lng),
icon: sf_icon_home
});
fillPR(data.points, data.horaires, data.fermetures);
setLocationGeoCode(sf_customer_lat, sf_customer_lng);
}
},
error: function (e) {
$('#sf_address').removeClass('sf_loading');
//window.console && console.log('error recherche adresse', e);
}
});
}, 800);
}
else {
$('#sf_address').removeClass('sf_loading');
$('#gmap').html('<p style="width: 210px;height: 20px;margin: 200px auto;">L\'adresse recherchée est incorrecte.</p>');
//window.console && console.log('google.maps.GeocoderStatus != OK', results, status);
}
});
});
function selectPoint(id) {
//window.console && console.log('selectPoint : ' + id);
$('.so-infoWindow').parent().find('img.float-right').show();
$.ajax({
type: 'POST',
url: $('#soflexibilite_change_pickup_url').val(),
dataType: 'json',
data: {
id_pickup: id,
id_customer: id_customer,
id_order: id_order,
id_cart: $('#soflexibilite_id_cart').val()
},
success: function (data) {
$('.so-infoWindow').parent().find('img.float-right').hide();
//window.console && console.log(data, 'SelectPoint Succeed');
if (data.status) {
window.location.reload();
} else {
alert('Une erreur est survenue lors de l\'enregistrement du point de retrait, contactez le webmaster de la boutique.\n\n' + data.responseText);
}
},
error: function (er) {
$('.so-infoWindow').parent().find('img.float-right').hide();
alert('Une erreur est survenue lors de l\'enregistrement du point de retrait, contacter le webmaster de la boutique.');
//window.console && console.log('une erreur sur selectpoint ! ' + er.debug, er);
}
});
}
$('#sf_map').delegate('button.float-right', 'click', function () {
var id_point = $(this).parent().find('.so-infoWindow').attr('rel');
selectPoint(id_point);
});
function setLocationGeoCode(lat, lng) {
google.maps.event.trigger(sf_map, 'resize');
sf_map.fitBounds(sf_bounds);
}
function closeSFInfoWindows() {
for (var x in sf_info_windows)
if (typeof (sf_info_windows[x]) === 'object')
sf_info_windows[x].close();
}
function resetOverlay() {
if (typeof (infoWindow) !== 'undefined' && infoWindow !== null)
for (var x in infoWindow)
if (typeof (infoWindow[x]) === 'object')
infoWindow[x].close();
}
function deleteMarkers() {
for (var x in sf_markers)
if (typeof (sf_markers[x]) === 'object')
sf_markers[x].setMap(null);
sf_markers = [];
}
function codeLatLng(lat, lng) {
var latlng = new google.maps.LatLng(lat, lng);
geocoder.geocode({'latLng': latlng, 'region': 'fr'}, function (res, stat) {
if (stat === google.maps.GeocoderStatus.OK) {
if (res[0]) {
var elt = res[0].address_components;
var i = null;
for (i in elt) {
if (elt[i].types[0] === 'postal_code' || elt[i].types[0] === 'postal_code_prefix')
search_address_parameters['postcode'] = elt[i].long_name;
else if (elt[i].types[0] === 'locality')
search_address_parameters['city'] = elt[i].long_name;
else if (elt[i].types[0] === 'route')
search_address_parameters['address'] = elt[i].long_name;
else if (elt[i].types[0] === 'country')
search_address_parameters['country'] = elt[i].short_name;
}
}
}
else {
/*window.console && console.log(res, stat);
alert("Erreur de geolocalisation: " + stat);*/
}
});
}
} else {
$('#sf_modify_relay').hide();
}
});

View File

@ -0,0 +1,180 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
$(document).ready(function() {
function DisplayPrice(obj)
{
var price = obj.val();
if (price <= 0 || !price)
return;
price = parseFloat(price.replace(',', '.'));
if (isNaN(price))
price = 0;
price = price.toFixed(2);
obj.val(price);
}
$('.insurrance_conf').blur(function() {
DisplayPrice($(this));
});
$('#soflex_ws_checker').click(function() {
if (window.console)
console.log('Checking Web Service');
$('#wsFail, #wsSuccess').hide();
$('#soflex_ws_checker span').hide();
$('#soflex_ws_checker img').show();
$.ajax({
type: 'POST',
url: $('#soflexibilite_point_list_url').val(),
dataType: 'jsonp',
data: {
login : $('#user_login').val(),
pwd : $('#user_pwd').val(),
ws : $('#soflex_ws').val()
},
success: function(data) {
/*if (window.console)
console.log(data);*/
if ( data.status === true )
$('#wsSuccess').fadeIn('slow');
else
{
$('#wsFail').fadeIn('slow');
$('#ws_error_code').text(data.error_id);
$('#ws_error_msg').text(data.error);
}
$('#soflex_ws_checker span').show();
$('#soflex_ws_checker img').hide();
},
error: function(data) {
/*if (window.console)
console.log(data);*/
$('#wsFail').fadeIn('slow').prepend(data.responseText);
$('#soflex_ws_checker span').show();
$('#soflex_ws_checker img').hide();
}
});
});
$('#set_shipping_cost').click(function() {
if (!$('#soflexibilite_set_shiiping_cost_modal').length && confirm($('#soflexibilite_set_shiiping_cost_warning').val()))
setShippingCost();
});
$('#set_shipping_cost_modal_action').click(function () {
$('#soflexibilite_set_shiiping_cost_modal').modal('hide');
setShippingCost();
});
function setShippingCost() {
$('#set_shipping_yes, #set_shipping_no').hide();
$('#set_shipping_cost span').hide();
$('#set_shipping_cost img').show();
var set_shipping_cost_url = $('#soflexibilite_set_shiiping_cost_url').val();
$.ajax({
type: 'POST',
url: set_shipping_cost_url,
dataType: 'jsonp',
success: function(data) {
window.console && console.log(data);
$('#set_shipping_cost span').show();
$('#set_shipping_cost img').hide();
if (data.status === true)
$('#set_shipping_yes').fadeIn('slow');
else
$('#set_shipping_no').fadeIn('slow').find('pre').html(data.output ? data.output : 'N/A');
},
error: function(data) {
window.console && console.log(data);
$('#set_shipping_cost span').show();
$('#set_shipping_cost img').hide();
$('#set_shipping_no').fadeIn('slow').find('pre').html(data.responseText ? data.responseText : 'N/A');
}
});
}
if ($.fn.jquery === '1.11.0' && $('#conf-informations .alert-warning, #conf-informations .alert-danger, #conf-informations .warn, #conf-informations .error').length)
{
$('#menu-informations a').css({
"color": "red",
"font-weight": "bold"
}).find('span').append(' <img src="' + $('#images_url').val() + 'exclamation.png" alt="!" style="vertical-align: super;">');
setTimeout(function(){$('#menu-informations').click();}, 800);
}
$('#psinfo').unbind('click').click(function() {
$('#phpinfo_div').hide();
$('#psinfo_div').toggle();
});
$('#phpinfo').unbind('click').click(function() {
$('#psinfo_div').hide();
$('#phpinfo_div').toggle();
});
// qTip
if (typeof(jQuery.qtip) === 'function')
{
$('label[rel]').each(function () {
var target_glossary_key = $(this).attr('rel');
var target_glossary_div = $('#glossary div.' + target_glossary_key);
if (target_glossary_div && target_glossary_div.length) {
var title = $(this).text() || null;
var content = target_glossary_div.html().trim() || 'N/A';
$(this).addClass('tip').html('<span>' + title + '</span>').find('span').qtip({
content: {
text: content,
title: title
},
hide: {
fixed: true,
delay: 300
}
});
}
});
}
$('#conf-carriers sup')
});

View File

@ -0,0 +1,103 @@
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
SoFlexibilite = {
selectRightCarrier: function(relay_class) {
var bpr_id = $('input#soflexibilite_bpr_id').val() + ',';
var a2p_id = $('input#soflexibilite_a2p_id').val() + ',';
var cit_id = $('input#soflexibilite_cit_id').val() + ',';
$('#picFinalColissimo').show();
if (relay_class === 'BPR' || relay_class === 'BDP' || relay_class === 'CDI')
{
$('.delivery_option_radio').each(function() {
if ($(this).val() === bpr_id)
{
$('.delivery_option_radio').attr('checked', false).parent().removeClass('checked');
$(this).attr('checked', true).parent().addClass('checked');
}
});
}
else if (relay_class === 'A2P' || relay_class === 'CMT')
{
$('.delivery_option_radio').each(function() {
if ($(this).val() === a2p_id)
{
$('.delivery_option_radio').attr('checked', false).parent().removeClass('checked');
$(this).attr('checked', true).parent().addClass('checked');
}
});
}
else if (relay_class === 'CIT')
{
$('.delivery_option_radio').each(function() {
if ($(this).val() === cit_id)
{
$('.delivery_option_radio').attr('checked', false).parent().removeClass('checked');
$(this).attr('checked', true).parent().addClass('checked');
}
});
}
if (typeof(updateCarrierSelectionAndGift) === 'function')
updateCarrierSelectionAndGift();
},
hideAllForOverlay: function() {
$('#picStreetView').hide();
$('#infofofo').hide();
$('.onlyForDom').hide();
$('#picFinalBpr').hide();
$('#picFinalA2p').hide();
$('#picFinalDom').hide();
$('#picFinalRdv').hide();
$('#picFinalCit').hide();
$('#so-h3-recap-horsdom').hide();
$('#so-h3-recap-dom').hide();
},
buildFinalAddress: function(address_chunk) {
var final_address = '<div class="so-prez-libelle">';
if (address_chunk.libelle)
final_address += address_chunk.libelle + '<br>';
if (address_chunk.company)
final_address += address_chunk.company + '<br>';
final_address += address_chunk.firstname + ' ' + address_chunk.lastname + '</div>';
final_address += address_chunk.address1 + '<br>';
if (address_chunk.address2)
final_address += address_chunk.address2 + '<br>';
final_address += address_chunk.postcode + ' ' + address_chunk.city + '<br>' + address_chunk.country;
return (final_address);
},
updateCarrierSelectionAndGift: function() {
if (typeof(updateCarrierSelectionAndGift) === 'function')
updateCarrierSelectionAndGift();
}
};

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,11 @@
<?php
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;

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -0,0 +1,226 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from SARL SMC
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe SMC
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la SARL SMC est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter la SARL SMC a l'adresse:
* contact@common-services.com
* ...........................................................................
*
* @author Debusschere A.
* @copyright Copyright(c) 2010-2015 S.A.R.L S.M.C - http://www.common-services.com
* @package Shared
* @license Commercial license
*/
if (!defined('_PS_VERSION_'))
exit;
/**
* Class generating configuration message
*/
class ConfigureMessage
{
const _MESSAGE_ = '<div class="%s">%s</div>';
const _DEBUG_ = '<div class="%s"><pre>%s</pre></div>';
const _CLASS_ERROR_15_ = 'error';
const _CLASS_WARNING_15_ = 'warn';
const _CLASS_SUCCESS_15_ = 'conf';
const _CLASS_INFO_15_ = 'info hint';
const _CLASS_ERROR_16_ = 'alert alert-danger';
const _CLASS_WARNING_16_ = 'alert alert-warning';
const _CLASS_SUCCESS_16_ = 'alert alert-success';
const _CLASS_INFO_16_ = 'alert alert-info';
protected static $msg_list = array();
protected static $has_error_msg = false;
protected static $has_warning_msg = false;
protected static $has_success_msg = false;
protected static $has_info_msg = false;
/**
* Generate the HTML code corresponding to an error message
*
* @param String $msg
*/
public static function error($msg = 'Error')
{
$error_msg = null;
if (version_compare(_PS_VERSION_, '1.6', '<'))
$error_msg = sprintf(self::_MESSAGE_, self::_CLASS_ERROR_15_, $msg);
else
$error_msg = '<div class="bootstrap">'.sprintf(self::_MESSAGE_, self::_CLASS_ERROR_16_, $msg).'</div>';
self::$has_error_msg = true;
self::$msg_list[] = $error_msg;
}
/**
* Generate the HTML code corresponding to a warning message
*
* @param String $msg
*/
public static function warning($msg = 'Warning')
{
$warning_msg = null;
if (version_compare(_PS_VERSION_, '1.6', '<'))
$warning_msg = sprintf(self::_MESSAGE_, self::_CLASS_WARNING_15_, $msg);
else
$warning_msg = '<div class="bootstrap">'.sprintf(self::_MESSAGE_, self::_CLASS_WARNING_16_, $msg).'</div>';
self::$has_warning_msg = true;
self::$msg_list[] = $warning_msg;
}
/**
* Generate the HTML code corresponding to a success message
*
* @param String $msg
*/
public static function success($msg = 'Success')
{
$success_msg = null;
if (version_compare(_PS_VERSION_, '1.6', '<'))
$success_msg = sprintf(self::_MESSAGE_, self::_CLASS_SUCCESS_15_, $msg);
else
$success_msg = '<div class="bootstrap">'.sprintf(self::_MESSAGE_, self::_CLASS_SUCCESS_16_, $msg).'</div>';
self::$has_success_msg = true;
self::$msg_list[] = $success_msg;
}
/**
* Generate the HTML code corresponding to an information message
*
* @param String $msg
*/
public static function info($msg = 'Success')
{
$info_msg = null;
if (version_compare(_PS_VERSION_, '1.6', '<'))
$info_msg = sprintf(self::_MESSAGE_, self::_CLASS_INFO_15_, $msg);
else
$info_msg = '<div class="bootstrap">'.sprintf(self::_MESSAGE_, self::_CLASS_INFO_16_, $msg).'</div>';
self::$has_info_msg = true;
self::$msg_list[] = $info_msg;
}
/**
* Generate the HTML code corresponding to a debug message
*
* @param String $msg
*/
public static function debug($msg = 'Debug')
{
$info_msg = null;
if (version_compare(_PS_VERSION_, '1.6', '<'))
$info_msg = sprintf(self::_DEBUG_, self::_CLASS_INFO_15_, $msg);
else
$info_msg = '<div class="bootstrap">'.sprintf(self::_DEBUG_, self::_CLASS_INFO_16_, $msg).'</div>';
self::$msg_list[] = $info_msg;
}
/**
* Return the html code of all messages to be displayed
*
* @return String
*/
public static function display()
{
$html = '';
if (count(self::$msg_list))
foreach (self::$msg_list as $msg)
$html .= $msg;
return ($html);
}
/**
* Return the list of message
*
* @return Array
*/
public static function getMessageList()
{
return (self::$msg_list);
}
/**
* Return true if the message list contain at least 1 error message
*
* @return Boolean
*/
public static function hasErrorMessage()
{
return (self::$has_error_msg);
}
/**
* Return true if the message list contain at least 1 warning message
*
* @return Boolean
*/
public static function hasWarningMessage()
{
return (self::$has_warning_msg);
}
/**
* Return true if the message list contain at least 1 success message
*
* @return Boolean
*/
public static function hasSuccessMessage()
{
return (self::$has_success_msg);
}
/**
* Return true if the message list contain at least 1 information message
*
* @return Boolean
*/
public static function hasInfoMessage()
{
return (self::$has_info_msg);
}
}

View File

@ -0,0 +1,99 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from SARL SMC
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe SMC
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la SARL SMC est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter la SARL SMC a l'adresse:
* contact@common-services.com
* ...........................................................................
*
* @author Debusschere A.
* @copyright Copyright(c) 2010-2015 S.A.R.L S.M.C - http://www.common-services.com
* @package Shared
* @license Commercial license
*/
if (!defined('_PS_VERSION_'))
exit;
/**
* Class generating configuration tabs
*/
class ConfigureTab
{
public static function generateTabs($tab_list, $module_name = '')
{
//$protocol = Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://';
if (!Tools::strlen($module_name))
$module_name = self::getModuleName();
//commented out by O.B. on 2015-03-10: cause cross domain redirection issue
//$url = $protocol.htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/'.$module_name.'/';
$url = __PS_BASE_URI__.'modules/'.$module_name.'/';
$context = Context::getContext();
$context->smarty->assign(array(
'tab_list' => $tab_list,
'img_dir' => $url.'shared/img/tab/',
'module_url' => $url,
'module_name' => $module_name,
'ps16x' => version_compare(_PS_VERSION_, '1.6', '>='),
'ps15x' => version_compare(_PS_VERSION_, '1.5', '>='),
'has_line' => self::hasLine($tab_list),
'line_number' => self::getLineNumber($tab_list)
));
$html = $context->smarty->fetch(dirname(__FILE__).'/../tpl/tabs.tpl');
return ($html);
}
public static function getModuleName($addslash = false)
{
$e = new Exception();
$trace = $e->getTrace();
$caller = $trace[2];
if (!isset($caller['class']))
return (false);
return (Tools::strtolower($caller['class']).($addslash ? '/' : ''));
}
public static function hasLine($tab_list)
{
if (is_array($tab_list) && count($tab_list))
foreach ($tab_list as $tab)
if (isset($tab['line']) && $tab['line'])
return (true);
return (false);
}
public static function getLineNumber($tab_list)
{
$line_number = array();
if (is_array($tab_list) && count($tab_list))
foreach ($tab_list as $tab)
if (isset($tab['line']) && $tab['line'])
$line_number[$tab['line']] = 1;
return (count($line_number));
}
}

View File

@ -0,0 +1,11 @@
<?php
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;

View File

@ -0,0 +1,129 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from SARL SMC
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe SMC
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la SARL SMC est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter la SARL SMC a l'adresse:
* contact@common-services.com
* ...........................................................................
*
* @author Debusschere A.
* @copyright Copyright(c) 2010-2015 S.A.R.L S.M.C - http://www.common-services.com
* @package Shared
* @license Commercial license
*/
/**
* Class generating module tabs
*/
class CommonServicesTab extends Tab
{
const ADD = 'a';
const REMOVE = 'd';
const UPDATE = 'u';
public static function Setup($action, $class, $name, $parent, $debug = false)
{
switch ($action)
{
case self::ADD :
if (!Tab::getIdFromClassName($class))
if (!self::installModuleTab($class, $name, $parent))
{
if ($debug)
printf('%s(#%d): Unable to install: %s', basename(__FILE__), __LINE__, $class);
return false;
}
break;
case self::UPDATE :
if (self::Setup(self::REMOVE, $class, $name, $parent, $debug))
return (self::Setup(self::ADD, $class, $name, $parent, $debug));
break;
case self::REMOVE :
if (Tab::getIdFromClassName($class))
if (!self::uninstallModuleTab($class))
{
if ($debug)
printf('%s(#%d): Unable to uninstall: %s', basename(__FILE__), __LINE__, $class);
return false;
}
break;
}
return true;
}
private static function installModuleTab($tabClass, $tabName, $tabParent)
{
$module = self::getModuleName();
$pass = true;
$tabNameLang = array();
foreach (Language::getLanguages() as $language)
$tabNameLang[$language['id_lang']] = $tabName;
$tab = new Tab();
$tab->name = $tabNameLang;
$tab->class_name = $tabClass;
$tab->module = $module;
$tab->id_parent = Tab::getIdFromClassName($tabParent);
// For Prestashop 1.2
//
if (version_compare(_PS_VERSION_, '1.3', '<'))
$pass = $tab->add();
else
$pass = $tab->save();
return ($pass);
}
public static function getModuleName()
{
$trace = debug_backtrace();
$caller = $trace[4];
if (!isset($caller['class']))
return (false);
else
return (Tools::strtolower($caller['class']));
}
private static function uninstallModuleTab($tabClass)
{
$pass = true;
$idTab = Tab::getIdFromClassName($tabClass);
// Big Bug PS 1.4 - cached entry is not removed on delete() ...
if (version_compare(_PS_VERSION_, '1.5.5', '<'))
{
if (isset(Tab::$_getIdFromClassName[Tools::strtolower($tabClass)]))
unset(Tab::$_getIdFromClassName[Tools::strtolower($tabClass)]);
if (isset(Tab::$_getIdFromClassName[($tabClass)]))
unset(Tab::$_getIdFromClassName[($tabClass)]);
}
if ($idTab != 0)
{
$tab = new Tab($idTab);
$pass = $tab->delete();
}
return ($pass);
}
}

View File

@ -0,0 +1,11 @@
<?php
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;

View File

@ -0,0 +1,99 @@
h2 {
font-size: 1.3em;
text-align: start;
}
.label-checkbox {
text-align: left;
float: none;
font-size: 1.2em;
color: navy;
opacity: 0.8;
padding: 5px;
}
#menuTab {
float: left;
margin: 0;
text-align: left;
background-color: #efefef;
padding: 10px;
border-top: 1px solid #CCC;
border-right: 1px solid #CCC;
border-left: 1px solid #CCC;
}
#menuTab li {
text-align: left;
float: left;
min-width: 150px;
height: 35px;
display: inline;
padding: 0 10px 15px 15px;
margin: 5px;
background: #EFEFEF;
font-weight: bold;
cursor: pointer;
}
#menuTab li span {
position: relative;
top: 10px;
font-weight: bold;
letter-spacing: 1px;
color: gray;
}
#menuTab li.menuTabButton.selected {
border-bottom: 3px solid #6495ED;
margin-bottom: 2px;
}
#menuTab li.menuTabButton:hover {
cursor: pointer;
background: #6495ED;
opacity: 0.7;
}
#ps16_tabs_separator {
clear:both;
}
#tabList div:first-child ul {
list-style-type: disc;
margin: 0 0 0 20px;
padding: 1em;
}
#tabList div:first-child hr {
width: 30%;
}
.row {
background: none;
}
div.col-lg-1 {
width: 8.33333%;
float: left;
text-align: center;
}
div.col-lg-11 {
width: 91.66667%;
float: left;
margin-bottom: 15px;
}
.form-group {
margin-bottom: 15px;
}
/* info class for PS 14x */
body:not([style]) .info {
font-weight: 700;
margin: 0 0 10px 0;
line-height: 20px;
}

View File

@ -0,0 +1,26 @@
#menuTab li {
max-width: 210px;
min-width: 160px;
display: inline-block !important;
border-bottom: 3px solid transparent;
margin-right: 20px;
height: 55px;
}
#menuTab li.menuTabButton.selected {
border-bottom: 3px solid #6495ED;
}
#menuTab li a:focus, #menuTab li a:visited {
background: none;
}
#ps16_tabs_separator {
clear:both;
border-bottom: 4px solid whitesmoke;
margin: 10px 0;
}
div.col-lg-1 {
text-align: center;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@ -0,0 +1,11 @@
<?php
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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Some files were not shown because too many files have changed in this diff Show More