Création du module FedEx
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
|
||||
namespace Colissimo\Controller;
|
||||
|
||||
use Colissimo\Colissimo;
|
||||
use Colissimo\Model\Config\ColissimoConfigValue;
|
||||
use Colissimo\FedEx;
|
||||
use Colissimo\Model\Config\FedExConfigValue;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Thelia\Controller\Admin\BaseAdminController;
|
||||
use Thelia\Core\Security\AccessManager;
|
||||
@@ -32,7 +32,7 @@ class Configuration extends BaseAdminController
|
||||
{
|
||||
if (null !== $response = $this->checkAuth(
|
||||
AdminResources::MODULE,
|
||||
[Colissimo::DOMAIN_NAME],
|
||||
[FedEx::DOMAIN_NAME],
|
||||
AccessManager::UPDATE
|
||||
)) {
|
||||
return $response;
|
||||
@@ -45,8 +45,8 @@ class Configuration extends BaseAdminController
|
||||
$validateForm = $this->validateForm($form);
|
||||
$data = $validateForm->getData();
|
||||
|
||||
Colissimo::setConfigValue(
|
||||
ColissimoConfigValue::ENABLED,
|
||||
FedEx::setConfigValue(
|
||||
FedExConfigValue::ENABLED,
|
||||
is_bool($data["enabled"]) ? (int) ($data["enabled"]) : $data["enabled"]
|
||||
);
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
namespace Colissimo\Controller;
|
||||
|
||||
use Colissimo\Colissimo;
|
||||
use Colissimo\Model\Config\ColissimoConfigValue;
|
||||
use Colissimo\FedEx;
|
||||
use Colissimo\Model\Config\FedExConfigValue;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Thelia\Model\AreaQuery;
|
||||
use Thelia\Controller\Admin\BaseAdminController;
|
||||
@@ -44,7 +44,7 @@ class EditPrices extends BaseAdminController
|
||||
->findPK($area);
|
||||
if ($exists !== null) {
|
||||
|
||||
if (null !== $data = Colissimo::getConfigValue(ColissimoConfigValue::PRICES, null)) {
|
||||
if (null !== $data = FedEx::getConfigValue(FedExConfigValue::PRICES, null)) {
|
||||
$json_data = json_decode(
|
||||
$data,
|
||||
true
|
||||
@@ -62,7 +62,7 @@ class EditPrices extends BaseAdminController
|
||||
}
|
||||
ksort($json_data[$area]['slices']);
|
||||
|
||||
Colissimo::setConfigValue(ColissimoConfigValue::PRICES, json_encode($json_data));
|
||||
FedEx::setConfigValue(FedExConfigValue::PRICES, json_encode($json_data));
|
||||
|
||||
} else {
|
||||
throw new \Exception("Area not found");
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
namespace Colissimo\Controller;
|
||||
|
||||
use Colissimo\Colissimo;
|
||||
use Colissimo\Model\ColissimoQuery;
|
||||
use Colissimo\FedEx;
|
||||
use Colissimo\Model\FedExQuery;
|
||||
use Thelia\Controller\Admin\BaseAdminController;
|
||||
use Thelia\Core\Event\Order\OrderEvent;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
@@ -56,7 +56,7 @@ class Export extends BaseAdminController
|
||||
->findOne();
|
||||
|
||||
// Get Colissimo orders
|
||||
$orders = ColissimoQuery::getOrders()->find();
|
||||
$orders = FedExQuery::getOrders()->find();
|
||||
|
||||
$export = "";
|
||||
$store_name = ConfigQuery::getStoreName();
|
||||
@@ -149,7 +149,7 @@ class Export extends BaseAdminController
|
||||
|
||||
} catch (FormValidationException $e) {
|
||||
$this->setupFormErrorContext(
|
||||
Translator::getInstance()->trans("colissimo expeditor export", [], Colissimo::DOMAIN_NAME),
|
||||
Translator::getInstance()->trans("colissimo expeditor export", [], FedEx::DOMAIN_NAME),
|
||||
$e->getMessage(),
|
||||
$form,
|
||||
$e
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
namespace Colissimo\Controller;
|
||||
|
||||
use Colissimo\Colissimo;
|
||||
use Colissimo\Model\Config\ColissimoConfigValue;
|
||||
use Colissimo\FedEx;
|
||||
use Colissimo\Model\Config\FedExConfigValue;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Thelia\Controller\Admin\BaseAdminController;
|
||||
@@ -30,7 +30,7 @@ class FreeShipping extends BaseAdminController
|
||||
{
|
||||
public function set()
|
||||
{
|
||||
$response = $this->checkAuth(AdminResources::MODULE, [Colissimo::DOMAIN_NAME], AccessManager::UPDATE);
|
||||
$response = $this->checkAuth(AdminResources::MODULE, [FedEx::DOMAIN_NAME], AccessManager::UPDATE);
|
||||
if (null !== $response) {
|
||||
return $response;
|
||||
}
|
||||
@@ -42,7 +42,7 @@ class FreeShipping extends BaseAdminController
|
||||
$validateForm = $this->validateForm($form);
|
||||
$data = $validateForm->getData();
|
||||
|
||||
Colissimo::setConfigValue(ColissimoConfigValue::FREE_SHIPPING, (int) ($data["freeshipping"]));
|
||||
FedEx::setConfigValue(FedExConfigValue::FREE_SHIPPING, (int) ($data["freeshipping"]));
|
||||
return $this->redirectToConfigurationPage();
|
||||
|
||||
} catch (\Exception $e) {
|
||||
|
||||
Reference in New Issue
Block a user