diff --git a/.well-known/setup/faker.php b/.well-known/setup/faker.php index 3a7743ea..b7017e42 100644 --- a/.well-known/setup/faker.php +++ b/.well-known/setup/faker.php @@ -991,7 +991,7 @@ function generateCouponFixtures(\Thelia\Core\Thelia $thelia) /** @var $container ContainerInterface Service Container */ $container = $thelia->getContainer(); /** @var FacadeInterface $adapter */ - $adapter = $container->get('thelia.facade');w + $adapter = $container->get('thelia.facade'); // Coupons $coupon1 = new Thelia\Model\Coupon(); diff --git a/local/modules/CadeauBienvenue/CadeauBienvenue.php b/local/modules/CadeauBienvenue/CadeauBienvenue.php index 386edd50..d059a589 100644 --- a/local/modules/CadeauBienvenue/CadeauBienvenue.php +++ b/local/modules/CadeauBienvenue/CadeauBienvenue.php @@ -1,14 +1,4 @@ - + \ No newline at end of file diff --git a/local/modules/CadeauBienvenue/EventListeners/NewCustomerListener.php b/local/modules/CadeauBienvenue/EventListeners/NewCustomerListener.php index 80b3b67f..02365722 100644 --- a/local/modules/CadeauBienvenue/EventListeners/NewCustomerListener.php +++ b/local/modules/CadeauBienvenue/EventListeners/NewCustomerListener.php @@ -9,9 +9,9 @@ use Thelia\Core\Event\Coupon\CouponCreateOrUpdateEvent; use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent; use Thelia\Core\Event\TheliaEvents; use Thelia\Core\HttpFoundation\Request; -use Thelia\Core\HttpFoundation\Response; use Thelia\Mailer\MailerFactory; use Thelia\Model\ConfigQuery; +use Thelia\Log\Tlog; class NewCustomerListener implements EventSubscriberInterface @@ -35,7 +35,7 @@ class NewCustomerListener implements EventSubscriberInterface { return array( TheliaEvents::CUSTOMER_CREATEACCOUNT => array( - 'createAccount', 100 + 'createCadeauBienvenue', 100 ), ); } @@ -45,7 +45,7 @@ class NewCustomerListener implements EventSubscriberInterface * @param $eventName * @param EventDispatcherInterface $dispatcher */ - public function createAccount(CustomerCreateOrUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher) + public function createCadeauBienvenue(CustomerCreateOrUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher) { $customer = $event->getCustomer(); @@ -82,9 +82,10 @@ class NewCustomerListener implements EventSubscriberInterface [ 'customer_id' => $customer->getId(), 'montant' => $discountAmount, - 'date_validite' => $dateExpiration, 'code_promo' => $couponCode ] ); + + Tlog::getInstance()->debug("Coupon de bienvenue envoyé à cette adresse email : " . $customer->getEmail()); } } diff --git a/local/modules/CadeauBienvenue/templates/email/default/code-promo-bienvenue.html b/local/modules/CadeauBienvenue/templates/email/default/code-promo-bienvenue.html index 871b44bf..ea09b557 100644 --- a/local/modules/CadeauBienvenue/templates/email/default/code-promo-bienvenue.html +++ b/local/modules/CadeauBienvenue/templates/email/default/code-promo-bienvenue.html @@ -15,9 +15,8 @@ {block name="email-content"} {loop type="customer" name="client" current="false" id=$customer_id limit=1}

Bonjour {$FIRSTNAME} {$LASTNAME},

{/loop} -

Pour fêter votre arrivée sur notre site {config key="store_name"} et vous remercier de votre inscription, nous vous offrons un bon de réduction d'une valeur de {$montant}€, utilisable dès maintenant !

-

Ce bon est valable jusqu'au {format_date date={$date_validite} output="date"}.
- Pour l'utiliser, il vous suffira de saisir le code {$code_promo} lors de l'étape 3 de votre prochaine commande.

+

Pour fêter votre arrivée sur notre site {config key="store_name"} et vous remercier de votre inscription, nous vous offrons un bon de réduction d'une valeur de {$montant}€, utilisable dès maintenant et sans limite de temps !


+

Pour utiliser ce bon, il vous suffira de saisir le code {$code_promo} lors de l'étape 3 de votre prochaine commande.

Rendez-vous très bientôt sur {url path="/"}

Très cordialement,

{config key="store_name"}

diff --git a/local/modules/CadeauBienvenue/templates/email/default/code-promo-bienvenue.txt b/local/modules/CadeauBienvenue/templates/email/default/code-promo-bienvenue.txt index 66d60835..c183111b 100644 --- a/local/modules/CadeauBienvenue/templates/email/default/code-promo-bienvenue.txt +++ b/local/modules/CadeauBienvenue/templates/email/default/code-promo-bienvenue.txt @@ -1,9 +1,8 @@ {loop type="customer" name="client" current="false" id=$customer_id limit=1}Bonjour {$FIRSTNAME} {$LASTNAME},{/loop} -Pour fêter votre arrivée sur notre site {config key="store_name"} et vous remercier de votre inscription, nous vous offrons un bon de réduction d'une valeur de {$montant}€, utilisable dès à présent ! +Pour fêter votre arrivée sur notre site {config key="store_name"} et vous remercier de votre inscription, nous vous offrons un bon de réduction d'une valeur de {$montant}€, utilisable dès à présent et sans limite de temps ! -Ce bon est valable jusqu'au {format_date date={$date_validite} output="date"}. -Pour l'utiliser, il vous suffira de saisir le code {$code_promo} lors de l'étape 3 de votre prochaine commande. +Pour utiliser ce bon, il vous suffira de saisir le code {$code_promo} lors de l'étape 3 de votre prochaine commande. Rendez-vous très bientôt sur {url path="/"} diff --git a/local/modules/Colissimo/Colissimo.php b/local/modules/Colissimo/Colissimo.php deleted file mode 100755 index fd232b63..00000000 --- a/local/modules/Colissimo/Colissimo.php +++ /dev/null @@ -1,179 +0,0 @@ -insertSql(null, array(__DIR__ . '/Config/thelia.sql')); - } - - - public function isValidDelivery(Country $country, State $state = null) - { - if (0 == self::getConfigValue(ColissimoConfigValue::ENABLED, 1)) { - return false; - } - - if (null !== $area = $this->getAreaForCountry($country, $state)) { - $areaId = $area->getId(); - - $prices = self::getPrices(); - - /* Check if Colissimo delivers the area */ - if (isset($prices[$areaId]) && isset($prices[$areaId]["slices"])) { - // Yes ! Check if the cart weight is below slice limit - $areaPrices = $prices[$areaId]["slices"]; - ksort($areaPrices); - - /* Check cart weight is below the maximum weight */ - end($areaPrices); - $maxWeight = key($areaPrices); - - $cartWeight = $this->getRequest()->getSession()->getSessionCart($this->getDispatcher())->getWeight(); - - if ($cartWeight <= $maxWeight) { - return true; - } - } - } - return false; - } - - /** - * @param $areaId - * @param $weight - * - * @return mixed - * @throws \Thelia\Exception\OrderException - */ - public static function getPostageAmount($areaId, $weight) - { - $freeshipping = Colissimo::getConfigValue(ColissimoConfigValue::FREE_SHIPPING); - $postage = 0; - if (!$freeshipping) { - $prices = self::getPrices(); - - /* check if Colissimo delivers the asked area */ - if (!isset($prices[$areaId]) || !isset($prices[$areaId]["slices"])) { - throw new DeliveryException( - Translator::getInstance()->trans( - "Colissimo delivery unavailable for the delivery country", - [], - self::DOMAIN_NAME - ) - ); - } - - $areaPrices = $prices[$areaId]["slices"]; - ksort($areaPrices); - - /* Check cart weight is below the maximum weight */ - end($areaPrices); - $maxWeight = key($areaPrices); - if ($weight > $maxWeight) { - throw new DeliveryException( - Translator::getInstance()->trans( - "Colissimo delivery unavailable for this cart weight (%weight kg)", - array("%weight" => $weight), - self::DOMAIN_NAME - ) - ); - } - - $postage = current($areaPrices); - - while (prev($areaPrices)) { - if ($weight > key($areaPrices)) { - break; - } - - $postage = current($areaPrices); - } - } - return $postage; - - } - - /** - * - * calculate and return delivery price - * - * @param Country $country - * @param State $state - * @return mixed - */ - public function getPostage(Country $country, State $state = null) - { - $cartWeight = $this->getRequest()->getSession()->getSessionCart($this->getDispatcher())->getWeight(); - - $postage = self::getPostageAmount( - $this->getAreaForCountry($country, $state)->getId(), - $cartWeight - ); - - return $postage; - } - - public function update($currentVersion, $newVersion, ConnectionInterface $con = null) - { - $uploadDir = __DIR__ . '/Config/prices.json'; - - $database = new Database($con); - - $tableExists = $database->execute("SHOW TABLES LIKE 'colissimo_freeshipping'")->rowCount(); - - if (Colissimo::getConfigValue(ColissimoConfigValue::FREE_SHIPPING, null) == null && $tableExists) { - $result = $database->execute('SELECT active FROM colissimo_freeshipping WHERE id=1')->fetch()["active"]; - Colissimo::setConfigValue(ColissimoConfigValue::FREE_SHIPPING, $result); - $database->execute("DROP TABLE `colissimo_freeshipping`"); - } - - if (is_readable($uploadDir) && Colissimo::getConfigValue(ColissimoConfigValue::PRICES, null) == null) { - Colissimo::setConfigValue(ColissimoConfigValue::PRICES, file_get_contents($uploadDir)); - } - } -} diff --git a/local/modules/Colissimo/Config/config.xml b/local/modules/Colissimo/Config/config.xml deleted file mode 100755 index fb02632e..00000000 --- a/local/modules/Colissimo/Config/config.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/local/modules/Colissimo/Config/module.xml b/local/modules/Colissimo/Config/module.xml deleted file mode 100755 index 2fb9e2ba..00000000 --- a/local/modules/Colissimo/Config/module.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - Colissimo\Colissimo - - Colissimo delivery - - - Livraison par Colissimo - - 2.4.3 - - Manuel Raynaud - manu@raynaud.io - - delivery - 2.4.3 - alpha - diff --git a/local/modules/Colissimo/Config/prices.json b/local/modules/Colissimo/Config/prices.json deleted file mode 100755 index 53eacc3b..00000000 --- a/local/modules/Colissimo/Config/prices.json +++ /dev/null @@ -1,64 +0,0 @@ -{"1": { - "_info": "area 1 : France", - "slices": { - "0.25": 5.23, - "0.5": 6.13, - "0.75": 6.89, - "1": 7.51, - "2": 8.50, - "5": 10.93, - "10": 15.68, - "30": 23.28 - } -}, "2": { - "_info": "area 2 : A Zone - Union Europ\u00e9enne et Suisse", - "slices": { - "0.5": 11.54, - "1": 14.11, - "2": 15.68, - "5": 20.14, - "10": 33.25, - "20": 55.10, - "30": 55.10 - } -}, "3": { - "_info": "area 3 : B Zone - Pays de l\u2019Europe de l\u2019Est (hors Union Europ\u00e9enne et Russie), Norv\u00e8ge, Maghreb", - "slices": { - "0.5": 15.39, - "1": 18.38, - "2": 20.00, - "5": 25.65, - "10": 42.75, - "20": 66.50 - } -}, "4": { - "_info": "area 4 : C Zone - Autres destinations", - "slices": { - "0.5": 22.52, - "1": 24.99, - "2": 34.30, - "5": 50.35, - "10": 95.00, - "20": 152.00 - } -}, "5": { - "_info": "area 5 : France OM1", - "slices": { - "0.5": 8.69, - "1": 13.16, - "2": 17.96, - "5": 26.60, - "10": 42.75, - "30": 95.95 - } -}, "6": { - "_info": "area 6 : France OM2", - "slices": { - "0.5": 10.40, - "1": 15.72, - "2": 27.74, - "5": 46.08, - "10": 90.25, - "30": 237.50 - } -}} diff --git a/local/modules/Colissimo/Config/routing.xml b/local/modules/Colissimo/Config/routing.xml deleted file mode 100755 index 4edcf64d..00000000 --- a/local/modules/Colissimo/Config/routing.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - Colissimo\Controller\EditPrices::editprices - - - - Colissimo\Controller\FreeShipping::set - - - - Colissimo\Controller\Export::exportAction - - - - Colissimo\Controller\Configuration::editConfiguration - - diff --git a/local/modules/Colissimo/Config/thelia.sql b/local/modules/Colissimo/Config/thelia.sql deleted file mode 100644 index d44ef9fa..00000000 --- a/local/modules/Colissimo/Config/thelia.sql +++ /dev/null @@ -1,32 +0,0 @@ -# This is a fix for InnoDB in MySQL >= 4.1.x -# It "suspends judgement" for fkey relationships until are tables are set. -SET FOREIGN_KEY_CHECKS = 0; - --- --------------------------------------------------------------------- --- Mail templates for colissimo --- --------------------------------------------------------------------- - --- First, delete existing entries -SET @var := 0; -SELECT @var := `id` FROM `message` WHERE name="mail_colissimo"; -DELETE FROM `message` WHERE `id`=@var; --- Try if ON DELETE constraint isn't set -DELETE FROM `message_i18n` WHERE `id`=@var; - --- Then add new entries -SELECT @max := MAX(`id`) FROM `message`; -SET @max := @max+1; --- insert message -INSERT INTO `message` (`id`, `name`, `secured`) VALUES -(@max, -'mail_colissimo', -'0' -); - --- and template fr_FR -INSERT INTO `message_i18n` (`id`, `locale`, `title`, `subject`, `text_message`, `html_message`) VALUES -(@max, 'en_US', 'Colissimo shipping message', 'Your order {$order_ref} has been shipped', '{loop type="customer" name="customer.order" current="false" id="$customer_id" backend_context="1"}\r\nDear {$FIRSTNAME} {$LASTNAME},\r\n{/loop}\r\nThank you for your order on our online store {config key="store_name"}.\r\nYour order {$order_ref} dated {format_date date=$order_date} has been shipped on {format_date date=$update_date}.\r\nThe tracking number for this delivery is {$package}. Please check the La Poste website for tracking your parcel: www.coliposte.net.\r\nYou can use this tracking number to get your parcel in your local La Poste office. If don''t get an advice in your mailbox after two working days, claim your parcel at your local La Poste office, using this tracking number.\r\nFeel free to contact us for any forther information\r\nBest Regards.', '{loop type="customer" name="customer.order" current="false" id="$customer_id" backend_context="1"}\r\n

Dear {$FIRSTNAME} {$LASTNAME},

\r\n{/loop}\r\n

Thank you for your order on our online store {config key="store_name"}.

\r\n

Your order {$order_ref} dated {format_date date=$order_date} has been shipped on {format_date date=$update_date}.\r\nThe tracking number for this delivery is {$package}. Please check the La Poste website for tracking your parcel: www.coliposte.net.

\r\n

You can use this tracking number to get your parcel in your local La Poste office. If don''t get an advice in your mailbox after two working days, claim your parcel at your local La Poste office, using this tracking number.

\r\n

Feel free to contact us for any forther information

\r\n

Best Regards.

'), -(@max, 'fr_FR', 'Message d''expédition de colissimo', 'Suivi colissimo commande : {$order_ref}', '{loop type="customer" name="customer.order" current="false" id="$customer_id" backend_context="1"}\r\n{$LASTNAME} {$FIRSTNAME},\r\n{/loop}\r\nNous vous remercions de votre commande sur notre site {config key="store_name"}\r\nUn colis concernant votre commande {$order_ref} du {format_date date=$order_date} a quitté nos entrepôts pour être pris en charge par La Poste le {format_date date=$update_date}.\r\nSon numéro de suivi est le suivant : {$package}\r\nIl vous permet de suivre votre colis en ligne sur le site de La Poste : www.coliposte.net\r\nIl vous sera, par ailleurs, très utile si vous étiez absent au moment de la livraison de votre colis : en fournissant ce numéro de Colissimo Suivi, vous pourrez retirer votre colis dans le bureau de Poste le plus proche.\r\nATTENTION ! Si vous ne trouvez pas l''avis de passage normalement déposé dans votre boîte aux lettres au bout de 48 Heures jours ouvrables, n''hésitez pas à aller le réclamer à votre bureau de Poste, muni de votre numéro de Colissimo Suivi.\r\nNous restons à votre disposition pour toute information complémentaire.\r\nCordialement', '{loop type="customer" name="customer.order" current="false" id="$customer_id" backend_context="1"}\r\n{$LASTNAME} {$FIRSTNAME},\r\n{/loop}\r\nNous vous remercions de votre commande sur notre site {config key="store_name"}\r\nUn colis concernant votre commande {$order_ref} du {format_date date=$order_date} a quitté nos entrepôts pour être pris en charge par La Poste le {format_date date=$update_date}.\r\nSon numéro de suivi est le suivant : {$package}\r\nIl vous permet de suivre votre colis en ligne sur le site de La Poste : www.coliposte.net\r\nIl vous sera, par ailleurs, très utile si vous étiez absent au moment de la livraison de votre colis : en fournissant ce numéro de Colissimo Suivi, vous pourrez retirer votre colis dans le bureau de Poste le plus proche.\r\nATTENTION ! Si vous ne trouvez pas l''avis de passage normalement déposé dans votre boîte aux lettres au bout de 48 Heures jours ouvrables, n''hésitez pas à aller le réclamer à votre bureau de Poste, muni de votre numéro de Colissimo Suivi.\r\nNous restons à votre disposition pour toute information complémentaire.\r\nCordialement'); - -# This restores the fkey checks, after having unset them earlier -SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file diff --git a/local/modules/Colissimo/Controller/Configuration.php b/local/modules/Colissimo/Controller/Configuration.php deleted file mode 100755 index 52f99df8..00000000 --- a/local/modules/Colissimo/Controller/Configuration.php +++ /dev/null @@ -1,77 +0,0 @@ - - */ -class Configuration extends BaseAdminController -{ - public function editConfiguration() - { - if (null !== $response = $this->checkAuth( - AdminResources::MODULE, - [Colissimo::DOMAIN_NAME], - AccessManager::UPDATE - )) { - return $response; - } - - $form = $this->createForm('colissimo.configuration'); - $error_message = null; - - try { - $validateForm = $this->validateForm($form); - $data = $validateForm->getData(); - - Colissimo::setConfigValue( - ColissimoConfigValue::ENABLED, - is_bool($data["enabled"]) ? (int) ($data["enabled"]) : $data["enabled"] - ); - - return $this->redirectToConfigurationPage(); - - } catch (FormValidationException $e) { - $error_message = $this->createStandardFormValidationErrorMessage($e); - } - - if (null !== $error_message) { - $this->setupFormErrorContext( - 'configuration', - $error_message, - $form - ); - $response = $this->render("module-configure", ['module_code' => 'Colissimo']); - } - return $response; - } - - /** - * Redirect to the configuration page - */ - protected function redirectToConfigurationPage() - { - return RedirectResponse::create(URL::getInstance()->absoluteUrl('/admin/module/Colissimo')); - } -} diff --git a/local/modules/Colissimo/Controller/EditPrices.php b/local/modules/Colissimo/Controller/EditPrices.php deleted file mode 100755 index a4ed5083..00000000 --- a/local/modules/Colissimo/Controller/EditPrices.php +++ /dev/null @@ -1,84 +0,0 @@ - - */ -class EditPrices extends BaseAdminController -{ - public function editprices() - { - // Get data & treat - $post = $this->getRequest(); - $operation = $post->get('operation'); - $area = $post->get('area'); - $weight = $post->get('weight'); - $price = $post->get('price'); - - if (preg_match("#^add|delete$#", $operation) && - preg_match("#^\d+$#", $area) && - preg_match("#^\d+\.?\d*$#", $weight) - ) { - // check if area exists in db - $exists = AreaQuery::create() - ->findPK($area); - if ($exists !== null) { - - if (null !== $data = Colissimo::getConfigValue(ColissimoConfigValue::PRICES, null)) { - $json_data = json_decode( - $data, - true - ); - } - if ((float) $weight > 0 && $operation == "add" - && preg_match("#\d+\.?\d*#", $price)) { - $json_data[$area]['slices'][$weight] = $price; - } elseif ($operation == "delete") { - if (isset($json_data[$area]['slices'][$weight])) { - unset($json_data[$area]['slices'][$weight]); - } - } else { - throw new \Exception("Weight must be superior to 0"); - } - ksort($json_data[$area]['slices']); - - Colissimo::setConfigValue(ColissimoConfigValue::PRICES, json_encode($json_data)); - - } else { - throw new \Exception("Area not found"); - } - } else { - throw new \ErrorException("Arguments are missing or invalid"); - } - - return $this->redirectToConfigurationPage(); - } - - /** - * Redirect to the configuration page - */ - protected function redirectToConfigurationPage() - { - return RedirectResponse::create(URL::getInstance()->absoluteUrl('/admin/module/Colissimo')); - } -} diff --git a/local/modules/Colissimo/Controller/Export.php b/local/modules/Colissimo/Controller/Export.php deleted file mode 100644 index ca82a68e..00000000 --- a/local/modules/Colissimo/Controller/Export.php +++ /dev/null @@ -1,166 +0,0 @@ - - */ -class Export extends BaseAdminController -{ - const DEFAULT_PHONE = "0100000000"; - const DEFAULT_CELLPHONE = "0600000000"; - - public function exportAction() - { - if (null !== $response = $this->checkAuth(array(AdminResources::MODULE), array('Colissimo'), AccessManager::UPDATE)) { - return $response; - } - - $form = new FormExport($this->getRequest()); - - try { - $exportForm = $this->validateForm($form); - - // Get new status - $status_id = $exportForm->get('status_id')->getData(); - $status = OrderStatusQuery::create() - ->filterByCode($status_id) - ->findOne(); - - // Get Colissimo orders - $orders = ColissimoQuery::getOrders()->find(); - - $export = ""; - $store_name = ConfigQuery::getStoreName(); - - /** @var $order \Thelia\Model\Order */ - foreach ($orders as $order) { - - $value = $exportForm->get('order_'.$order->getId())->getData(); - - if ($value) { - - // Get order information - $customer = $order->getCustomer(); - $locale = $order->getLang()->getLocale(); - $address = $order->getOrderAddressRelatedByDeliveryOrderAddressId(); - $country = CountryQuery::create()->findPk($address->getCountryId()); - $country->setLocale($locale); - $customerTitle = CustomerTitleQuery::create()->findPk($address->getCustomerTitleId()); - $customerTitle->setLocale($locale); - $weight = $exportForm->get('order_weight_'.$order->getId())->getData(); - - if ($weight == 0) { - /** @var \Thelia\Model\OrderProduct $product */ - foreach ($order->getOrderProducts() as $product) { - $weight += (double)$product->getWeight(); - } - } - - /** - * Get user's phone & cellphone - * First get invoice address phone, - * If empty, try to get default address' phone. - * If still empty, set default value - */ - $phone = $address->getPhone(); - if (empty($phone)) { - $phone = $customer->getDefaultAddress()->getPhone(); - - if (empty($phone)) { - $phone = self::DEFAULT_PHONE; - } - } - - // Cellphone - $cellphone = $customer->getDefaultAddress()->getCellphone(); - - if (empty($cellphone)) { - $cellphone = $customer->getDefaultAddress()->getCellphone(); - - if (empty($cellphone)) { - $cellphone = self::DEFAULT_CELLPHONE; - } - } - - - $export .= - "\"".$order->getRef() - ."\";\"".$address->getLastname() - ."\";\"".$address->getFirstname() - ."\";\"".$address->getAddress1() - ."\";\"".$address->getAddress2() - ."\";\"".$address->getAddress3() - ."\";\"".$address->getZipcode() - ."\";\"".$address->getCity() - ."\";\"".$country->getIsoalpha2() - ."\";\"".$phone - ."\";\"".$cellphone - ."\";\"".$weight - ."\";\"".$customer->getEmail() - ."\";\"\";\"".$store_name - ."\";\"DOM\";\r\n"; - - if ($status) { - $event = new OrderEvent($order); - $event->setStatus($status->getId()); - $this->getDispatcher()->dispatch(TheliaEvents::ORDER_UPDATE_STATUS, $event); - } - } - } - - return Response::create( - utf8_decode($export), - 200, - array( - "Content-Encoding"=>"ISO-8889-1", - "Content-Type"=>"application/csv-tab-delimited-table", - "Content-disposition"=>"filename=export.csv" - ) - ); - - } catch (FormValidationException $e) { - $this->setupFormErrorContext( - Translator::getInstance()->trans("colissimo expeditor export", [], Colissimo::DOMAIN_NAME), - $e->getMessage(), - $form, - $e - ); - - return $this->render( - "module-configure", - array( - "module_code" => "Colissimo", - ) - ); - } - } -} diff --git a/local/modules/Colissimo/Controller/FreeShipping.php b/local/modules/Colissimo/Controller/FreeShipping.php deleted file mode 100644 index 10d46e6f..00000000 --- a/local/modules/Colissimo/Controller/FreeShipping.php +++ /dev/null @@ -1,62 +0,0 @@ - - */ -class FreeShipping extends BaseAdminController -{ - public function set() - { - $response = $this->checkAuth(AdminResources::MODULE, [Colissimo::DOMAIN_NAME], AccessManager::UPDATE); - if (null !== $response) { - return $response; - } - - $form = $this->createForm('colissimo.freeshipping.form'); - - - try { - $validateForm = $this->validateForm($form); - $data = $validateForm->getData(); - - Colissimo::setConfigValue(ColissimoConfigValue::FREE_SHIPPING, (int) ($data["freeshipping"])); - return $this->redirectToConfigurationPage(); - - } catch (\Exception $e) { - $response = JsonResponse::create(array("error"=>$e->getMessage()), 500); - } - - return $response; - } - - /** - * Redirect to the configuration page - */ - protected function redirectToConfigurationPage() - { - return RedirectResponse::create(URL::getInstance()->absoluteUrl('/admin/module/Colissimo')); - } -} diff --git a/local/modules/Colissimo/EventListener/AreaDeletedListener.php b/local/modules/Colissimo/EventListener/AreaDeletedListener.php deleted file mode 100644 index c1eb3e41..00000000 --- a/local/modules/Colissimo/EventListener/AreaDeletedListener.php +++ /dev/null @@ -1,53 +0,0 @@ - - */ -class AreaDeletedListener implements EventSubscriberInterface -{ - /** - * @param AreaDeleteEvent $event - */ - public function updateConfig(AreaDeleteEvent $event) - { - if (null !== $data = Colissimo::getConfigValue(ColissimoConfigValue::PRICES, null)) { - $areaId = $event->getAreaId(); - $json_data = json_decode($data, true); - unset($json_data[$areaId]); - - Colissimo::setConfigValue(ColissimoConfigValue::PRICES, json_encode($json_data, true)); - } - } - - /** - * @return array - */ - public static function getSubscribedEvents() - { - return [ - TheliaEvents::AREA_DELETE => [ - 'updateConfig', 128 - ] - ]; - } -} diff --git a/local/modules/Colissimo/Form/Configuration.php b/local/modules/Colissimo/Form/Configuration.php deleted file mode 100644 index bc9c58b3..00000000 --- a/local/modules/Colissimo/Form/Configuration.php +++ /dev/null @@ -1,59 +0,0 @@ - - */ -class Configuration extends BaseForm -{ - - protected function buildForm() - { - $this->formBuilder - ->add( - "enabled", - "checkbox", - array( - "label" => "Enabled", - "label_attr" => [ - "for" => "enabled", - "help" => Translator::getInstance()->trans( - 'Check if you want to activate Colissimo', - [], - Colissimo::DOMAIN_NAME - ) - ], - "required" => false, - "constraints" => array( - ), - "value" => Colissimo::getConfigValue(ColissimoConfigValue::ENABLED, 1), - ) - ); - } - - /** - * @return string the name of you form. This name must be unique - */ - public function getName() - { - return "colissimo_enable"; - } -} diff --git a/local/modules/Colissimo/Form/Export.php b/local/modules/Colissimo/Form/Export.php deleted file mode 100644 index 47c8fddf..00000000 --- a/local/modules/Colissimo/Form/Export.php +++ /dev/null @@ -1,122 +0,0 @@ - - */ -class Export extends BaseForm -{ - - /** - * - * in this function you add all the fields you need for your Form. - * Form this you have to call add method on $this->formBuilder attribute : - * - * $this->formBuilder->add("name", "text") - * ->add("email", "email", array( - * "attr" => array( - * "class" => "field" - * ), - * "label" => "email", - * "constraints" => array( - * new \Symfony\Component\Validator\Constraints\NotBlank() - * ) - * ) - * ) - * ->add('age', 'integer'); - * - * @return null - */ - protected function buildForm() - { - $orders = ColissimoQuery::getOrders() - ->find(); - - $this->formBuilder - ->add( - 'status_id', - 'text', - [ - 'constraints' => [ - new NotBlank(), - new Callback( - array("methods" => array(array($this, "verifyValue"))) - ) - ], - 'label' => Translator::getInstance()->trans( - 'Modify status export after export', - [], - Colissimo::DOMAIN_NAME - ), - 'label_attr' => [ - 'for' => 'status_id' - ] - ] - ); - - /** @var \Thelia\Model\Order $order */ - foreach ($orders as $order) { - $this->formBuilder - ->add( - "order_".$order->getId(), - "checkbox", - array( - 'label'=>$order->getRef(), - 'label_attr'=>array( - 'for'=>'export_'.$order->getId() - ) - ) - ) - ->add( - "order_nb_pkg_".$order->getId(), - 'number' - ) - ->add( - "order_weight_".$order->getId(), - 'number' - ); - } - } - - public function verifyValue($value, ExecutionContextInterface $context) - { - if (!preg_match("#^nochange|processing|sent$#", $value)) { - $context->addViolation( - Translator::getInstance()->trans( - 'select a valid status', - [], - Colissimo::DOMAIN_NAME - ) - ); - } - } - - /** - * @return string the name of you form. This name must be unique - */ - public function getName() - { - return "colissimo_export"; - } -} diff --git a/local/modules/Colissimo/Form/FreeShipping.php b/local/modules/Colissimo/Form/FreeShipping.php deleted file mode 100644 index baea56e0..00000000 --- a/local/modules/Colissimo/Form/FreeShipping.php +++ /dev/null @@ -1,62 +0,0 @@ -formBuilder attribute : - * - * $this->formBuilder->add("name", "text") - * ->add("email", "email", array( - * "attr" => array( - * "class" => "field" - * ), - * "label" => "email", - * "constraints" => array( - * new \Symfony\Component\Validator\Constraints\NotBlank() - * ) - * ) - * ) - * ->add('age', 'integer'); - * - * @return null - */ - protected function buildForm() - { - $this->formBuilder - ->add( - "freeshipping", - "checkbox", - array( - "label" => Translator::getInstance()->trans("Activate free shipping: ", [], Colissimo::DOMAIN_NAME), - "value" => Colissimo::getConfigValue(ColissimoConfigValue::FREE_SHIPPING, false), - ) - ); - } - - /** - * @return string the name of you form. This name must be unique - */ - public function getName() - { - return "colissimofreeshipping"; - } -} diff --git a/local/modules/Colissimo/Hook/HookManager.php b/local/modules/Colissimo/Hook/HookManager.php deleted file mode 100644 index 7c8b15bb..00000000 --- a/local/modules/Colissimo/Hook/HookManager.php +++ /dev/null @@ -1,31 +0,0 @@ - - */ -class HookManager extends BaseHook -{ - public function onModuleConfiguration(HookRenderEvent $event) - { - $module_id = self::getModule()->getModuleId(); - - $event->add($this->render("module_configuration.html", ['module_id' => $module_id])); - } -} diff --git a/local/modules/Colissimo/I18n/backOffice/default/de_DE.php b/local/modules/Colissimo/I18n/backOffice/default/de_DE.php deleted file mode 100644 index 10ed342f..00000000 --- a/local/modules/Colissimo/I18n/backOffice/default/de_DE.php +++ /dev/null @@ -1,25 +0,0 @@ - '*Wenn Sie diese Option auswählen, sind die exportierten Bestellungen auf dieser Seite nicht mehr verfügbar', - 'Actions' => 'Aktionen', - 'An error occured' => 'Ein Fehler ist aufgetreten', - 'Area : ' => 'Bereich : ', - 'Cancel' => 'Abbrechen', - 'Change orders status after export' => 'Status der Bestellung nach dem Export ändern', - 'Colissimo Module allows to send your products all around the world with La Poste.' => 'Colissimo Modul ermöglicht, Ihre Produkte mit La Poste weltweit zu versenden.', - 'Create' => 'Erstellen', - 'Date' => 'Datum', - 'Delete' => 'Löschen', - 'Do not change' => 'Nicht ändern', - 'Edit' => 'Ändern', - 'Export' => 'Export', - 'Please change the access rights' => 'Bitte ändern Sie die Zugriffsrechte', - 'Price (€)' => 'Preis (€)', - 'Processing' => 'Bearbeitung', - 'REF' => 'REF', - 'Sent' => 'Gesendet', - 'There is currently not orders to export' => 'Es gibt derzeit keine Bestellungen, die exportiert werden können', - 'Total taxed amount' => 'Gesamter besteuerter Betrag', - 'Weight up to ... (kg)' => 'Gewicht bis zu ... (kg)', -]; diff --git a/local/modules/Colissimo/I18n/backOffice/default/en_US.php b/local/modules/Colissimo/I18n/backOffice/default/en_US.php deleted file mode 100644 index 0d48057a..00000000 --- a/local/modules/Colissimo/I18n/backOffice/default/en_US.php +++ /dev/null @@ -1,36 +0,0 @@ - '*If you choose this option, the exported orders would not be available on this page anymore', - 'Actions' => 'Actions', - 'An error occured' => 'An error occured', - 'Area : ' => 'Area : ', - 'Cancel' => 'Cancel', - 'Change orders status after export' => 'Change orders status after export', - 'Colissimo Module allows to send your products all around the world with La Poste.' => 'Colissimo Module allows to send your products all around the world with La Poste.', - 'Create' => 'Create', - 'Create a new price slice' => 'Create a new price slice', - 'Create a price slice' => 'Create a price slice', - 'Date' => 'Date', - 'Delete' => 'Delete', - 'Delete a price slice' => 'Delete a price slice', - 'Delete this price slice' => 'Delete this price slice', - 'Do not change' => 'Do not change', - 'Do you really want to delete this slice ?' => 'Do you really want to delete this slice ?', - 'Edit' => 'Edit', - 'Edit a price slice' => 'Edit a price slice', - 'Edit this price slice' => 'Edit this price slice', - 'Export' => 'Export', - 'Export expeditor inet file' => 'Export expeditor inet file', - 'Please change the access rights' => 'Please change the access rights', - 'Price (€)' => 'Price (€)', - 'Price slices' => 'Price slices', - 'Processing' => 'Processing', - 'REF' => 'REF', - 'Sent' => 'Sent', - 'There is currently not orders to export' => 'There is currently no orders to export', - 'Total taxed amount' => 'Total taxed amount', - 'Weight up to ... (kg)' => 'Weight up to ... (kg)', - 'Number of packages' => 'Number of packages', - 'Packages weight' => 'Packages weight' -); diff --git a/local/modules/Colissimo/I18n/backOffice/default/fr_FR.php b/local/modules/Colissimo/I18n/backOffice/default/fr_FR.php deleted file mode 100644 index d7237509..00000000 --- a/local/modules/Colissimo/I18n/backOffice/default/fr_FR.php +++ /dev/null @@ -1,37 +0,0 @@ - '* Si vous choisissez cette option, les commandes exportées ne seront plus affichée sur cette page.', - 'Actions' => 'Actions', - 'An error occured' => 'Une erreur est survenue', - 'Area : ' => 'Zone de livraison : ', - 'Cancel' => 'Annuler', - 'Change orders status after export' => 'Modification du statut des commande après l\'export', - 'Colissimo Module allows to send your products all around the world with La Poste.' => 'Colissimo vous permet d’expédier vos colis dans le monde entier avec La Poste', - 'Create' => 'Créer', - 'Create a new price slice' => 'Créer une nouvelle tranche de prix', - 'Create a price slice' => 'Créer une tranche de prix', - 'Customer' => 'Client', - 'Date' => 'Date', - 'Delete' => 'Supprimer', - 'Delete a price slice' => 'Supprimer une tranche de prix', - 'Delete this price slice' => 'Supprimer cette tranche de prix', - 'Do not change' => 'Ne pas modifier', - 'Do you really want to delete this slice ?' => 'Confirmez-vous la suppression de cette tranche de prix', - 'Edit' => 'Modifier', - 'Edit a price slice' => 'Modifier une tranche de prix', - 'Edit this price slice' => 'Modifier cette tranche de prix', - 'Export' => 'Export', - 'Export expeditor inet file' => 'Exporter le fichier Expeditor INET', - 'Number of packages' => 'Nombre de colis', - 'Packages weight' => 'Poids des colis', - 'Please change the access rights' => 'Merci de modifier les droits d\'accès', - 'Price (€)' => 'Prix (€)', - 'Price slices' => 'Prix et poids', - 'Processing' => 'Traitement', - 'REF' => 'REF', - 'Sent' => 'Envoyée', - 'There is currently not orders to export' => 'Il n\'y a pas de commande à exporter pour le moment', - 'Total taxed amount' => 'Total TTC', - 'Weight up to ... (kg)' => 'Jusqu\'au poids (Kg)', -]; diff --git a/local/modules/Colissimo/I18n/backOffice/default/it_IT.php b/local/modules/Colissimo/I18n/backOffice/default/it_IT.php deleted file mode 100644 index 58e711dc..00000000 --- a/local/modules/Colissimo/I18n/backOffice/default/it_IT.php +++ /dev/null @@ -1,13 +0,0 @@ - 'Azioni', - 'Cancel' => 'Annulla', - 'Create' => 'Creare', - 'Date' => 'Data', - 'Delete' => 'Cancellare', - 'Edit' => 'Modifica', - 'Export' => 'Esporta', - 'Number of packages' => 'Numero di pacchetti', - 'Packages weight' => 'Peso pacchi', -]; diff --git a/local/modules/Colissimo/I18n/backOffice/default/ru_RU.php b/local/modules/Colissimo/I18n/backOffice/default/ru_RU.php deleted file mode 100644 index dc3e7306..00000000 --- a/local/modules/Colissimo/I18n/backOffice/default/ru_RU.php +++ /dev/null @@ -1,38 +0,0 @@ - '*Если вы выберите эту опцию, экспортированные заказы больше не будут доступны на этой странице', - 'Actions' => 'Действия', - 'An error occured' => 'Произошла ошибка', - 'Area : ' => 'Зона :', - 'Cancel' => 'Отменить', - 'Change orders status after export' => 'Изменить статус заказа после экспорта', - 'Colissimo Module allows to send your products all around the world with La Poste.' => 'Модуль Colissimo позволяет отсылать ваши товары по всему миру, с помощью почтовой компании Франции La Poste.', - 'Create' => 'Создать', - 'Create a new price slice' => 'Создать новый разрез цены', - 'Create a price slice' => 'Создать разрез цены', - 'Customer' => 'Клиент', - 'Date' => 'Дата', - 'Delete' => 'Удалить', - 'Delete a price slice' => 'Удалить разрез цены', - 'Delete this price slice' => 'Удалить этот разрез цены', - 'Do not change' => 'Не изменять', - 'Do you really want to delete this slice ?' => 'Вы действительно хотите удалить этот разрез ?', - 'Edit' => 'Редактировать', - 'Edit a price slice' => 'Редактировать разрез цены', - 'Edit this price slice' => 'Редактировать этот разрез цены', - 'Export' => 'Экспорт', - 'Export expeditor inet file' => 'Экспортировать inet file экспедитора', - 'Number of packages' => 'Количество комплектов', - 'Packages weight' => 'Вес комплектов', - 'Please change the access rights' => 'Пожалуйста, измените права доступа', - 'Price (€)' => 'Цена (€)', - 'Price slices' => 'Разрезы цен', - 'Processing' => 'В обработке', - 'REF' => 'REF', - 'Save' => 'Сохранить', - 'Sent' => 'Отправлен', - 'There is currently not orders to export' => 'Сейчас нет заказов для экспорта', - 'Total taxed amount' => 'Итого', - 'Weight up to ... (kg)' => 'Вес до ... (кг)', -); diff --git a/local/modules/Colissimo/I18n/backOffice/default/tr_TR.php b/local/modules/Colissimo/I18n/backOffice/default/tr_TR.php deleted file mode 100644 index a777927b..00000000 --- a/local/modules/Colissimo/I18n/backOffice/default/tr_TR.php +++ /dev/null @@ -1,34 +0,0 @@ - '* Bu seçeneği seçerseniz, ihracat siparişleri artık bu sayfadaki müsait olmaz', - 'Actions' => 'Eylemler', - 'An error occured' => 'Bir hata meydana geldi', - 'Area : ' => 'Alanı: ', - 'Cancel' => 'Vazgeç', - 'Change orders status after export' => 'İhracat sonra sipariş durumunu değiştir', - 'Colissimo Module allows to send your products all around the world with La Poste.' => 'Colissimo modülü sağlar ürünlerinizi göndermek için La Poste ile dünyanın her yerinden.', - 'Create' => 'Oluştur', - 'Create a new price slice' => 'Yeni fiyat dilimi oluşturmak', - 'Create a price slice' => 'Bir fiyat dilim oluşturma', - 'Date' => 'Tarih', - 'Delete' => 'sil', - 'Delete a price slice' => 'Bir fiyat dilim silmek', - 'Delete this price slice' => 'Bu fiyat dilim silmek', - 'Do not change' => 'Değiştirme', - 'Do you really want to delete this slice ?' => 'Gerçekten bu dosyayı silmek istiyor musunuz ?', - 'Edit' => 'Düzenle', - 'Edit a price slice' => 'Bir fiyat dilim Düzenle', - 'Edit this price slice' => 'Bu fiyat dilim Düzenle', - 'Export' => 'Dışa aktarma', - 'Export expeditor inet file' => 'Expeditor inet dosyası dışa aktarma', - 'Please change the access rights' => 'Lütfen erişim haklarını Değiştir', - 'Price (€)' => 'Fiyat (TL)', - 'Price slices' => 'Fiyat dilimleri', - 'Processing' => 'İşlem devam ediyor', - 'REF' => 'ÜRÜN KODU', - 'Sent' => 'Gönder', - 'There is currently not orders to export' => 'Şu anda hiçbir emir vermek için', - 'Total taxed amount' => 'Toplam Kdvtutarı', - 'Weight up to ... (kg)' => 'Fazla kilo... (kg)', -]; diff --git a/local/modules/Colissimo/I18n/de_DE.php b/local/modules/Colissimo/I18n/de_DE.php deleted file mode 100644 index 5198cfbd..00000000 --- a/local/modules/Colissimo/I18n/de_DE.php +++ /dev/null @@ -1,14 +0,0 @@ - 'Kostenlose Lieferung aktivieren: ', - 'Can\'t read Config directory' => 'Config-Verzeichnis kann nicht gelesen werden', - 'Can\'t read file' => 'Datei kann nicht gelesen werden', - 'Can\'t write Config directory' => 'Config-Verzeichnis kann nicht beschrieben werden', - 'Can\'t write file' => 'Datei kann nicht geschrieben werden', - 'Colissimo delivery unavailable for the delivery country' => 'Eine Lieferung mit Colissimo ist für das Land nicht verfügbar', - 'Colissimo delivery unavailable for this cart weight (%weight kg)' => 'Eine Lieferung mit Colissimo ist für Warenkörbe mit diesem Gewicht (%weight kg) nicht verfügbar', - 'Modify status export after export' => 'Status der Bestellung nach dem Export ändern', - 'colissimo expeditor export' => 'Colissimo expeditor export', - 'select a valid status' => 'Wählen Sie einen gültigen Bestellungsstatus aus', -]; diff --git a/local/modules/Colissimo/I18n/en_US.php b/local/modules/Colissimo/I18n/en_US.php deleted file mode 100644 index c060ae29..00000000 --- a/local/modules/Colissimo/I18n/en_US.php +++ /dev/null @@ -1,14 +0,0 @@ - 'Activate free shipping: ', - 'Can\'t read Config directory' => 'Can\'t read Config directory', - 'Can\'t read file' => 'Can\'t read file', - 'Can\'t write Config directory' => 'Can\'t write Config directory', - 'Can\'t write file' => 'Can\'t write file', - 'Colissimo delivery unavailable for the delivery country' => 'Colissimo delivery unavailable for the delivery country', - 'Colissimo delivery unavailable for this cart weight (%weight kg)' => 'Colissimo delivery unavailable for this cart weight (%weight kg)', - 'Modify status export after export' => 'Change orders status after export', - 'colissimo expeditor export' => 'Colissimo Expeditor export', - 'select a valid status' => 'Select a valid order status', -); diff --git a/local/modules/Colissimo/I18n/fr_FR.php b/local/modules/Colissimo/I18n/fr_FR.php deleted file mode 100644 index 92634b2c..00000000 --- a/local/modules/Colissimo/I18n/fr_FR.php +++ /dev/null @@ -1,14 +0,0 @@ - 'Activer la livraison offerte: ', - 'Can\'t read Config directory' => 'Le dossier Config ne peut être lu', - 'Can\'t read file' => 'Le fichier suivant ne peut être lu', - 'Can\'t write Config directory' => 'Le dossier Config ne peut être écrit', - 'Can\'t write file' => 'Le fichier suivant ne peut être écrit', - 'Colissimo delivery unavailable for the delivery country' => 'La livraison par Colissimo n\'est pas disponible dans ce pays', - 'Colissimo delivery unavailable for this cart weight (%weight kg)' => 'La livraison par Colissimo n\'est pas disponible pour un panier de %weight Kg', - 'Modify status export after export' => 'Modification du statut des commandes après l\'export', - 'colissimo expeditor export' => 'Export pour le logiciel Expeditor', - 'select a valid status' => 'Choisissez un statut de commande valide.', -]; diff --git a/local/modules/Colissimo/I18n/ru_RU.php b/local/modules/Colissimo/I18n/ru_RU.php deleted file mode 100644 index 325adc85..00000000 --- a/local/modules/Colissimo/I18n/ru_RU.php +++ /dev/null @@ -1,15 +0,0 @@ - 'Активировать бесплатную доставку:', - 'Can\'t read Config directory' => 'Невозможно прочитать директорию Config', - 'Can\'t read file' => 'Невозможно прочитать файл', - 'Can\'t write Config directory' => 'Невозможно записать в директорию Config', - 'Can\'t write file' => 'Невозможно записать файл', - 'Check if you want to activate Colissimo' => 'Выберите если хотите активировать Colissimo', - 'Colissimo delivery unavailable for the delivery country' => 'Доставка Colissimo не доступна для страны доставки', - 'Colissimo delivery unavailable for this cart weight (%weight kg)' => 'Доставка Colissimo не доступна для этого веса корзины (%weight кг)', - 'Modify status export after export' => 'Изменить статус экспорта после экспорта', - 'colissimo expeditor export' => 'Colissimo экспорт экспедитора', - 'select a valid status' => 'Выберите правильный статус', -); diff --git a/local/modules/Colissimo/I18n/tr_TR.php b/local/modules/Colissimo/I18n/tr_TR.php deleted file mode 100644 index 4d4ef3c5..00000000 --- a/local/modules/Colissimo/I18n/tr_TR.php +++ /dev/null @@ -1,14 +0,0 @@ - 'Ücretsiz nakliye etkinleştirmek için: ', - 'Can\'t read Config directory' => 'Yapılandırma dizini okunamıyor', - 'Can\'t read file' => 'Dosyayı okuyamıyor', - 'Can\'t write Config directory' => 'Dosyayı okuyamıyor', - 'Can\'t write file' => 'Dosyaya yazılamıyor', - 'Colissimo delivery unavailable for the delivery country' => 'Bu Teslimat Bu ülke için kullanılamaz Colissimo teslim', - 'Colissimo delivery unavailable for this cart weight (%weight kg)' => 'Colissimo teslimat için bu sepeti ağırlık (%weight kg) kullanılamaz', - 'Modify status export after export' => 'İhracat sonra sipariş durumunu değiştir', - 'colissimo expeditor export' => 'Colissimo Expeditor verme', - 'select a valid status' => 'Geçerli sipariş durumunu seçin', -]; diff --git a/local/modules/Colissimo/LICENSE.txt b/local/modules/Colissimo/LICENSE.txt deleted file mode 100644 index 65c5ca88..00000000 --- a/local/modules/Colissimo/LICENSE.txt +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/local/modules/Colissimo/Listener/SendMail.php b/local/modules/Colissimo/Listener/SendMail.php deleted file mode 100755 index e9db80ae..00000000 --- a/local/modules/Colissimo/Listener/SendMail.php +++ /dev/null @@ -1,104 +0,0 @@ - - */ -class SendMail implements EventSubscriberInterface -{ - - protected $parser; - - protected $mailer; - - public function __construct(ParserInterface $parser, MailerFactory $mailer) - { - $this->parser = $parser; - $this->mailer = $mailer; - } - - public function updateStatus(OrderEvent $event) - { - $order = $event->getOrder(); - $colissimo = new Colissimo(); - - if ($order->isSent() && $order->getDeliveryModuleId() == $colissimo->getModuleModel()->getId()) { - $contact_email = ConfigQuery::getStoreEmail(); - - if ($contact_email) { - $order = $event->getOrder(); - $customer = $order->getCustomer(); - - $this->mailer->sendEmailToCustomer( - 'mail_colissimo', - $customer, - [ - 'customer_id' => $customer->getId(), - 'order_ref' => $order->getRef(), - 'order_date' => $order->getCreatedAt(), - 'update_date' => $order->getUpdatedAt(), - 'package' => $order->getDeliveryRef() - ] - ); - - Tlog::getInstance()->debug("Colissimo shipping message sent to customer ".$customer->getEmail()); - } else { - $customer = $order->getCustomer(); - Tlog::getInstance()->debug("Colissimo shipping message no contact email customer_id", $customer->getId()); - } - } - } - - /** - * Returns an array of event names this subscriber wants to listen to. - * - * The array keys are event names and the value can be: - * - * * The method name to call (priority defaults to 0) - * * An array composed of the method name to call and the priority - * * An array of arrays composed of the method names to call and respective - * priorities, or 0 if unset - * - * For instance: - * - * * array('eventName' => 'methodName') - * * array('eventName' => array('methodName', $priority)) - * * array('eventName' => array(array('methodName1', $priority), array('methodName2')) - * - * @return array The event names to listen to - * - * @api - */ - public static function getSubscribedEvents() - { - return array( - TheliaEvents::ORDER_UPDATE_STATUS => array("updateStatus", 128) - ); - } -} diff --git a/local/modules/Colissimo/Loop/CheckRightsLoop.php b/local/modules/Colissimo/Loop/CheckRightsLoop.php deleted file mode 100755 index d655f1ad..00000000 --- a/local/modules/Colissimo/Loop/CheckRightsLoop.php +++ /dev/null @@ -1,100 +0,0 @@ - - */ -class CheckRightsLoop extends BaseLoop implements ArraySearchLoopInterface -{ - protected function getArgDefinitions() - { - return new ArgumentCollection(); - } - - public function buildArray() - { - $ret = array(); - $dir = __DIR__."/../Config/"; - if (!is_readable($dir)) { - - $ret[] = array( - "ERRMES"=>Translator::getInstance()->trans( - "Can't read Config directory", - [], - Colissimo::DOMAIN_NAME - ), - "ERRFILE"=>"" - ); - } - if (!is_writable($dir)) { - $ret[] = array( - "ERRMES"=>Translator::getInstance()->trans( - "Can't write Config directory", - [], - Colissimo::DOMAIN_NAME - ), - "ERRFILE"=>"" - ); - - } - if ($handle = opendir($dir)) { - while (false !== ($file = readdir($handle))) { - if (strlen($file) > 5 && substr($file, -5) === ".json") { - if (!is_readable($dir.$file)) { - - $ret[] = array( - "ERRMES"=>Translator::getInstance()->trans( - "Can't read file", - [], - Colissimo::DOMAIN_NAME - ), - "ERRFILE"=>"Colissimo/Config/".$file - ); - } - if (!is_writable($dir.$file)) { - $ret[] = array( - "ERRMES"=>Translator::getInstance()->trans( - "Can't write file", - [], - Colissimo::DOMAIN_NAME - ), - "ERRFILE"=>"Colissimo/Config/".$file - ); - - } - } - } - } - return $ret; - } - public function parseResults(LoopResult $loopResult) - { - foreach ($loopResult->getResultDataCollection() as $arr) { - $loopResultRow = new LoopResultRow(); - $loopResultRow->set("ERRMES", $arr["ERRMES"]) - ->set("ERRFILE", $arr["ERRFILE"]); - $loopResult->addRow($loopResultRow); - } - return $loopResult; - } -} diff --git a/local/modules/Colissimo/Loop/NotSendLoop.php b/local/modules/Colissimo/Loop/NotSendLoop.php deleted file mode 100644 index b504924e..00000000 --- a/local/modules/Colissimo/Loop/NotSendLoop.php +++ /dev/null @@ -1,74 +0,0 @@ - - */ -class NotSendLoop extends Order -{ - /** - * - * define all args used in your loop - * - * - * example : - * - * public function getArgDefinitions() - * { - * return new ArgumentCollection( - * Argument::createIntListTypeArgument('id'), - * new Argument( - * 'ref', - * new TypeCollection( - * new Type\AlphaNumStringListType() - * ) - * ), - * Argument::createIntListTypeArgument('category'), - * Argument::createBooleanTypeArgument('new'), - * Argument::createBooleanTypeArgument('promo'), - * Argument::createFloatTypeArgument('min_price'), - * Argument::createFloatTypeArgument('max_price'), - * Argument::createIntTypeArgument('min_stock'), - * Argument::createFloatTypeArgument('min_weight'), - * Argument::createFloatTypeArgument('max_weight'), - * Argument::createBooleanTypeArgument('current'), - * - * ); - * } - * - * @return \Thelia\Core\Template\Loop\Argument\ArgumentCollection - */ - public function getArgDefinitions() - { - return new ArgumentCollection(Argument::createBooleanTypeArgument('with_prev_next_info', false)); - } - - /** - * this method returns a Propel ModelCriteria - * - * @return \Propel\Runtime\ActiveQuery\ModelCriteria - */ - public function buildModelCriteria() - { - return ColissimoQuery::getOrders(); - } -} diff --git a/local/modules/Colissimo/Loop/Price.php b/local/modules/Colissimo/Loop/Price.php deleted file mode 100755 index 014f5eef..00000000 --- a/local/modules/Colissimo/Loop/Price.php +++ /dev/null @@ -1,73 +0,0 @@ - - */ -class Price extends BaseLoop implements ArraySearchLoopInterface -{ - /* set countable to false since we need to preserve keys */ - protected $countable = false; - - /** - * @return ArgumentCollection - */ - protected function getArgDefinitions() - { - return new ArgumentCollection( - Argument::createIntTypeArgument('area', null, true) - ); - } - - public function buildArray() - { - $area = $this->getArea(); - $prices = Colissimo::getPrices(); - - if (!isset($prices[$area]) || !isset($prices[$area]["slices"])) { - return array(); - } - - $areaPrices = $prices[$area]["slices"]; - ksort($areaPrices); - - return $areaPrices; - } - - public function parseResults(LoopResult $loopResult) - { - foreach ($loopResult->getResultDataCollection() as $maxWeight => $price) { - $loopResultRow = new LoopResultRow(); - $loopResultRow->set("MAX_WEIGHT", $maxWeight) - ->set("PRICE", $price); - - $loopResult->addRow($loopResultRow); - } - return $loopResult; - } -} diff --git a/local/modules/Colissimo/Model/ColissimoQuery.php b/local/modules/Colissimo/Model/ColissimoQuery.php deleted file mode 100644 index 2fb634c7..00000000 --- a/local/modules/Colissimo/Model/ColissimoQuery.php +++ /dev/null @@ -1,66 +0,0 @@ -. */ -/* */ -/*************************************************************************************/ - -namespace Colissimo\Model; - -use Colissimo\Colissimo; -use Propel\Runtime\ActiveQuery\Criteria; -use Thelia\Model\OrderQuery; -use Thelia\Model\OrderStatus; -use Thelia\Model\OrderStatusQuery; - -/** - * Class ColissimoQuery - * @package Colissimo\Model - * @author Manuel Raynaud - */ -class ColissimoQuery -{ - /** - * @return OrderQuery - */ - public static function getOrders() - { - $status = OrderStatusQuery::create() - ->filterByCode( - array( - OrderStatus::CODE_PAID, - OrderStatus::CODE_PROCESSING, - ), - Criteria::IN - ) - ->find() - ->toArray("code"); - - $query = OrderQuery::create() - ->filterByDeliveryModuleId((new Colissimo())->getModuleModel()->getId()) - ->filterByStatusId( - array( - $status[OrderStatus::CODE_PAID]['Id'], - $status[OrderStatus::CODE_PROCESSING]['Id']), - Criteria::IN - ); - - return $query; - } -} diff --git a/local/modules/Colissimo/Model/Config/Base/ColissimoConfigValue.php b/local/modules/Colissimo/Model/Config/Base/ColissimoConfigValue.php deleted file mode 100644 index c481a36a..00000000 --- a/local/modules/Colissimo/Model/Config/Base/ColissimoConfigValue.php +++ /dev/null @@ -1,25 +0,0 @@ - - */ -class ColissimoConfigValue -{ - const FREE_SHIPPING = "free_shipping"; - const PRICES = "prices"; - const ENABLED = "enabled"; -} diff --git a/local/modules/Colissimo/Model/Config/ColissimoConfigValue.php b/local/modules/Colissimo/Model/Config/ColissimoConfigValue.php deleted file mode 100644 index d0cb0be1..00000000 --- a/local/modules/Colissimo/Model/Config/ColissimoConfigValue.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ -class ColissimoConfigValue extends BaseColissimoConfigValue -{ -} diff --git a/local/modules/Colissimo/THELIA_INET.FMT b/local/modules/Colissimo/THELIA_INET.FMT deleted file mode 100644 index 2d3a67b6..00000000 --- a/local/modules/Colissimo/THELIA_INET.FMT +++ /dev/null @@ -1,23 +0,0 @@ -[GENERAL] -DELIMITE=O -SEPARATEUR=59 -DELIMITEUR=34 -FINDELIGNE=CRLF -Unité poids=KG -[CHAMPS] -ReferenceExpedition=1 -NomDestinataire=2 -Prenom=3 -Adresse1=4 -Adresse2=5 -Adresse3=6 -CodePostal=7 -Commune=8 -CodePays=9 -Telephone=10 -Portable=11 -Poids=12 -Mail=13 -CodePointRetrait=14 -CodeProduit=15 -NomCommercialChargeur=16 diff --git a/local/modules/Colissimo/composer.json b/local/modules/Colissimo/composer.json deleted file mode 100644 index d84be8fd..00000000 --- a/local/modules/Colissimo/composer.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "thelia/colissimo-module", - "license": "LGPL-3.0+", - "type": "thelia-module", - "require": { - "thelia/installer": "~1.1" - }, - "extra": { - "installer-name": "Colissimo" - } -} diff --git a/local/modules/Colissimo/documentation/TarifsAvril2013.pdf b/local/modules/Colissimo/documentation/TarifsAvril2013.pdf deleted file mode 100755 index 886a9983..00000000 Binary files a/local/modules/Colissimo/documentation/TarifsAvril2013.pdf and /dev/null differ diff --git a/local/modules/Colissimo/documentation/readme.txt b/local/modules/Colissimo/documentation/readme.txt deleted file mode 100755 index b673e196..00000000 --- a/local/modules/Colissimo/documentation/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -Colissimo prices based on April 2013 pdf. -TarifsAvril2013.pdf is available in this module documentation folder. -You may update prices in Config/prices.json file. \ No newline at end of file diff --git a/local/modules/Colissimo/templates/backOffice/default/assets/js/module-configuration-js.html b/local/modules/Colissimo/templates/backOffice/default/assets/js/module-configuration-js.html deleted file mode 100644 index a51dac94..00000000 --- a/local/modules/Colissimo/templates/backOffice/default/assets/js/module-configuration-js.html +++ /dev/null @@ -1,36 +0,0 @@ -{javascripts file="assets/js/bootstrap-switch/bootstrap-switch.js"} - -{/javascripts} - - \ No newline at end of file diff --git a/local/modules/Colissimo/templates/backOffice/default/module_configuration.html b/local/modules/Colissimo/templates/backOffice/default/module_configuration.html deleted file mode 100755 index 3c495353..00000000 --- a/local/modules/Colissimo/templates/backOffice/default/module_configuration.html +++ /dev/null @@ -1,316 +0,0 @@ -
- - {loop name="checkrights.colissimo" type="colissimo.check.rights"} -
-

{$ERRMES} {$ERRFILE} | {intl d='colissimo.bo.default' l="Please change the access rights"}.

-
- {/loop} -
- -{elseloop rel="checkrights.colissimo"} - -
-

{intl d='colissimo.bo.default' l="Colissimo Module allows to send your products all around the world with La Poste."}

-
- - - -
-
-
- {form name="colissimo.configuration"} - - {form_hidden_fields form=$form} - - {form_field form=$form field="enabled"} -
- - {if ! empty($label_attr.help)} - {$label_attr.help} - {/if} -
- {/form_field} - - - - {/form} -
-
-
- -
-
-
- - - -
- - -
- {form name="colissimo.export.form"} - {if $form_error}
{$form_error_message}
{/if} -
- {form_hidden_fields} -
- -
- {intl d='colissimo.bo.default' l="Change orders status after export"} -
- -
- - {form_field field="status_id"} - - - - - - - - - - - - - {/form_field} -
-   - - -
-   - - -
-   - - -
- - {intl d='colissimo.ai' l="*If you choose this option, the exported orders would not be available on this page anymore"} -
-
- - - - - - - - - - - - - - - {loop name="colissimo.notsend.loop" type="colissimo.notsend.loop"} - - - - - - - - - - {/loop} - {elseloop rel="colissimo.notsend.loop"} - - - - {/elseloop} - -
- {intl d='colissimo.ai' l="REF"} - - {intl d='colissimo.ai' l="Customer"} - - {intl d='colissimo.ai' l="Date"} - - {intl d='colissimo.ai' l="Total taxed amount"} - - {intl d='colissimo.ai' l="Number of packages"} - - {intl d='colissimo.ai' l="Packages weight"} - - {intl d='colissimo.ai' l="Export"} -
- {$REF} - - {loop type='customer' name='colissimo.customer' id=$CUSTOMER current='false'} - {$LASTNAME} {$FIRSTNAME} - {/loop} - - {$CREATE_DATE|date_format} - - {$TOTAL_TAXED_AMOUNT} {loop name="list.socolissimo.getcurrency" type="currency" id=$CURRENCY}{$SYMBOL}{/loop} - - {form_field form=$form field="order_nb_pkg_"|cat:$ID} - - {/form_field} - - {form_field form=$form field="order_weight_"|cat:$ID} - - {/form_field} - - {form_field field="order_"|cat:$ID} - - {/form_field} -
-
-
{intl d='colissimo.ai' l="There is currently not orders to export"}
-
- - {ifloop rel="colissimo.notsend.loop"} - - {/ifloop} -
- {/form} -
- -
- - {assign var="isColissimoFreeShipping" value=0} - {form name="colissimo.freeshipping.form"} -
-
- {form_hidden_fields} - - {form_field field="freeshipping"} - - -
- -
- {/form_field} -
- {/form} - -
-
-
-
-
-{/elseloop} diff --git a/templates/frontOffice/custom/register.html b/templates/frontOffice/custom/register.html index eeaf3531..0dd133a7 100644 --- a/templates/frontOffice/custom/register.html +++ b/templates/frontOffice/custom/register.html @@ -140,9 +140,9 @@ {/form_field} {form_field field="cellphone"}
- +
- + {if $error } {$message} {assign var="error_focus" value="true"}