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 @@ - - -Dear {$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.
'), -(@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.{$ERRMES} {$ERRFILE} | {intl d='colissimo.bo.default' l="Please change the access rights"}.
-{intl d='colissimo.bo.default' l="Colissimo Module allows to send your products all around the world with La Poste."}
-