public function changeFreeShippingAction()
 {
     if (null !== ($response = $this->checkAuth([AdminResources::MODULE], ["dpdclassic"], AccessManager::UPDATE))) {
         return $response;
     }
     $form = new FreeShippingForm($this->getRequest());
     $response = null;
     try {
         $vform = $this->validateForm($form);
         $data = $vform->get('freeshipping')->getData();
         DpdClassic::setConfigValue('freeshipping', $data ? 'true' : 'false');
         $response = Response::create('');
     } catch (\Exception $e) {
         $response = JsonResponse::create(array("error" => $e->getMessage()), 500);
     }
     return $response;
 }
 public function configureAction()
 {
     if (null !== ($response = $this->checkAuth([AdminResources::MODULE], ['DpdClassic'], [AccessManager::CREATE, AccessManager::UPDATE]))) {
         return $response;
     }
     $baseForm = $this->createForm("config_form");
     $errorMessage = null;
     try {
         $form = $this->validateForm($baseForm);
         $data = $form->getData();
         // Save data
         DpdClassic::setConfigValue('default_status', $data["default_status"]);
     } catch (FormValidationException $ex) {
         $errorMessage = $this->createStandardFormValidationErrorMessage($ex);
     } catch (\Exception $ex) {
         $errorMessage = $this->getTranslator()->trans('Sorry, an error occurred: %err', ['%err' => $ex->getMessage()], DpdClassic::DOMAIN_NAME);
     }
     if ($errorMessage !== null) {
         $this->setupFormErrorContext(Translator::getInstance()->trans("Error while updating status", [], DpdClassic::DOMAIN_NAME), $errorMessage, $baseForm);
     }
     return $this->generateRedirectFromRoute("admin.module.configure", [], ['module_code' => "DpdClassic", 'current_tab' => "config", '_controller' => 'Thelia\\Controller\\Admin\\ModuleController::configureAction']);
 }