diff --git a/local/modules/ClickAndCollect/ClickAndCollect.php b/local/modules/ClickAndCollect/ClickAndCollect.php index eb12e7e0..3bd88505 100644 --- a/local/modules/ClickAndCollect/ClickAndCollect.php +++ b/local/modules/ClickAndCollect/ClickAndCollect.php @@ -14,6 +14,7 @@ class ClickAndCollect extends AbstractDeliveryModule { /** @var string */ const DOMAIN_NAME = 'clickandcollect'; + const MESSAGE_DOMAIN = 'clickandcollect'; const MODULE_URL = '/admin/module/ClickAndCollect'; diff --git a/local/modules/ClickAndCollect/Config/config.xml b/local/modules/ClickAndCollect/Config/config.xml index 43630ce7..233bbc6d 100644 --- a/local/modules/ClickAndCollect/Config/config.xml +++ b/local/modules/ClickAndCollect/Config/config.xml @@ -29,4 +29,12 @@ + +
+ + + + + + diff --git a/local/modules/ClickAndCollect/Config/routing.xml b/local/modules/ClickAndCollect/Config/routing.xml index 202a56d9..04825fd7 100644 --- a/local/modules/ClickAndCollect/Config/routing.xml +++ b/local/modules/ClickAndCollect/Config/routing.xml @@ -7,33 +7,33 @@ ClickAndCollect\Controller\backOffice\ListController::viewAction - - - - + + ClickAndCollect\Controller\backOffice\ListController::toggleActive + \d+ + - - - - - - - - - + + ClickAndCollect\Controller\backOffice\PlaceController::createPlace + + + ClickAndCollect\Controller\backOffice\PlaceController::viewPlace + + + ClickAndCollect\Controller\backOffice\PlaceController::editPlace + - - - + + ClickAndCollect\Controller\backOffice\PlaceController::deletePlace + - - - - - - - - - + + ClickAndCollect\Controller\backOffice\ScheduleController::createSchedule + + + ClickAndCollect\Controller\backOffice\ScheduleController::updateSchedule + + + ClickAndCollect\Controller\backOffice\ScheduleController::deleteSchedule + diff --git a/local/modules/ClickAndCollect/Controller/backOffice/ListController.php b/local/modules/ClickAndCollect/Controller/backOffice/ListController.php index a7c43c5b..1d76d9e4 100644 --- a/local/modules/ClickAndCollect/Controller/backOffice/ListController.php +++ b/local/modules/ClickAndCollect/Controller/backOffice/ListController.php @@ -29,6 +29,6 @@ class ListController extends BaseAdminController $place = PdrPlacesQuery::create()->findOneById(($id)); $place->setActive($place->getActive() ? 0 : 1)->save(); - return $this->render("places-list"); + return $this->render("cnc-places-list"); } } \ No newline at end of file diff --git a/local/modules/ClickAndCollect/Controller/backOffice/PlaceController.php b/local/modules/ClickAndCollect/Controller/backOffice/PlaceController.php index 73a8c88f..719f1160 100644 --- a/local/modules/ClickAndCollect/Controller/backOffice/PlaceController.php +++ b/local/modules/ClickAndCollect/Controller/backOffice/PlaceController.php @@ -1,10 +1,10 @@ findOneById($this->getRequest()->query->get("place_id")); - return $this->render("place-edit", array('module_code' => PointRetrait::getModuleCode(), + return $this->render("cnc-place-edit", array('module_code' => ClickAndCollect::getModuleCode(), 'place_id' => $selectedPlace)); } @@ -33,14 +33,14 @@ class PlaceController extends BaseAdminController public function editPlace() { // Check current user authorization - if (null !== $response = $this->checkAuth(AdminResources::MODULE, PointRetrait::getModuleCode(), AccessManager::VIEW)) + if (null !== $response = $this->checkAuth(AdminResources::MODULE, ClickAndCollect::getModuleCode(), AccessManager::VIEW)) return $response; $con = Propel::getConnection(); $con->beginTransaction(); $error_msg = ""; - $changeForm = $this->createForm("pdr.place.view.main", "form"); + $changeForm = $this->createForm("cnc.place.view.main", "form"); try { $form = $this->validateForm($changeForm, "POST"); @@ -48,7 +48,7 @@ class PlaceController extends BaseAdminController $data = $form->getData(); $place = PdrPlacesQuery::create()->findOneById($data['place_id']); if ($place === null) { - $error_msg = "Withdrawal place not found by Id"; + $error_msg = "Click and Collect place not found by Id"; } else { $place->fromArray($data, TableMap::TYPE_FIELDNAME); @@ -60,23 +60,23 @@ class PlaceController extends BaseAdminController } if ($this->getRequest()->get('save_mode') == 'stay') - return $this->render("place-edit"); + return $this->render("cnc-place-edit"); - return $this->render("places-list"); + return $this->render("cnc-places-list"); } public function createPlace() { // Check current user authorization - if (null !== $response = $this->checkAuth(AdminResources::MODULE, PointRetrait::getModuleCode(), AccessManager::VIEW)) + if (null !== $response = $this->checkAuth(AdminResources::MODULE, ClickAndCollect::getModuleCode(), AccessManager::VIEW)) return $response; $con = Propel::getConnection(); $con->beginTransaction(); $error_msg = ""; - $createForm = $this->createForm("pdr.place.create", "form"); + $createForm = $this->createForm("cnc.place.create", "form"); try { $form = $this->validateForm($createForm, "POST"); @@ -92,7 +92,7 @@ class PlaceController extends BaseAdminController } if ($this->getRequest()->request->get("success_url") == null) { - return new RedirectResponse(URL::getInstance()->absoluteUrl(PointRetrait::MODULE_URL)); + return new RedirectResponse(URL::getInstance()->absoluteUrl(ClickAndCollect::MODULE_URL)); } else { return new RedirectResponse(URL::getInstance()->absoluteUrl($this->getRequest()->request->get("success_url"))); } @@ -102,7 +102,7 @@ class PlaceController extends BaseAdminController public function deletePlace() { // Check current user authorization - if (null !== $response = $this->checkAuth(AdminResources::MODULE, PointRetrait::getModuleCode(), AccessManager::VIEW)) + if (null !== $response = $this->checkAuth(AdminResources::MODULE, ClickAndCollect::getModuleCode(), AccessManager::VIEW)) return $response; $placeId = $this->getRequest()->get('attr-place-id'); @@ -118,7 +118,7 @@ class PlaceController extends BaseAdminController } if ($this->getRequest()->request->get("success_url") == null) { - return new RedirectResponse(URL::getInstance()->absoluteUrl(PointRetrait::MODULE_URL)); + return new RedirectResponse(URL::getInstance()->absoluteUrl(ClickAndCollect::MODULE_URL)); } else { return new RedirectResponse(URL::getInstance()->absoluteUrl($this->getRequest()->request->get("success_url"))); } diff --git a/local/modules/ClickAndCollect/Controller/backOffice/ScheduleController.php b/local/modules/ClickAndCollect/Controller/backOffice/ScheduleController.php index 6428031b..fd1d2f56 100644 --- a/local/modules/ClickAndCollect/Controller/backOffice/ScheduleController.php +++ b/local/modules/ClickAndCollect/Controller/backOffice/ScheduleController.php @@ -1,14 +1,10 @@ checkAuth(AdminResources::MODULE, PointRetrait::getModuleCode(), AccessManager::UPDATE)) + if (null !== $response = $this->checkAuth(AdminResources::MODULE, ClickAndCollect::getModuleCode(), AccessManager::UPDATE)) return $response; $placeScheduleId = $this->getRequest()->get('schedule_id'); $query = PdrScheduleQuery::create()->findById($placeScheduleId); if ($query === null) - $error_msg = "Delivery area schedule not found by Id"; + $error_msg = "Click and Collect schedule not found by Id"; else { $con = Propel::getConnection(); @@ -47,7 +43,7 @@ class ScheduleController extends BaseAdminController } if ($this->getRequest()->request->get("success_url") == null) { - return new RedirectResponse(URL::getInstance()->absoluteUrl(MODULE_URL)); + return new RedirectResponse(URL::getInstance()->absoluteUrl(ClickAndCollect::MODULE_URL)); } else { return new RedirectResponse(URL::getInstance()->absoluteUrl($this->getRequest()->request->get("success_url"))); } @@ -60,14 +56,14 @@ class ScheduleController extends BaseAdminController public function updateSchedule() { // Check current user authorization - if (null !== $response = $this->checkAuth(AdminResources::MODULE, PointRetrait::getModuleCode(), AccessManager::UPDATE)) + if (null !== $response = $this->checkAuth(AdminResources::MODULE, ClickAndCollect::getModuleCode(), AccessManager::UPDATE)) return $response; $con = Propel::getConnection(); $con->beginTransaction(); $error_msg = ""; - $changeForm = $this->createForm("pdr.place.update.schedule", "form"); + $changeForm = $this->createForm("cnc.place.update.schedule", "form"); try { $form = $this->validateForm($changeForm, "POST"); $data = $form->getData(); @@ -75,7 +71,7 @@ class ScheduleController extends BaseAdminController $placeScheduleId = $this->getRequest()->get('schedule_id'); $query = PdrScheduleQuery::create()->findOneById($placeScheduleId); if ($query === null) - $error_msg = "Withdrawal place schedule not found by Id"; + $error_msg = "Click and Collect schedule not found by Id"; else { $query->fromArray($data, TableMap::TYPE_FIELDNAME); @@ -98,7 +94,7 @@ class ScheduleController extends BaseAdminController } if ($data['success_url'] == null) { - return new RedirectResponse(URL::getInstance()->absoluteUrl(MODULE_URL)); + return new RedirectResponse(URL::getInstance()->absoluteUrl(ClickAndCollect::MODULE_URL)); } else { return $this->generateSuccessRedirect($changeForm); } @@ -111,14 +107,14 @@ class ScheduleController extends BaseAdminController public function createSchedule() { // Check current user authorization - if (null !== $response = $this->checkAuth(AdminResources::MODULE, PointRetrait::getModuleCode(), AccessManager::UPDATE)) + if (null !== $response = $this->checkAuth(AdminResources::MODULE, ClickAndCollect::getModuleCode(), AccessManager::UPDATE)) return $response; $con = Propel::getConnection(); $con->beginTransaction(); $error_msg = ""; - $changeForm = $this->createForm("pdr.place.create.schedule", "form"); + $changeForm = $this->createForm("cnc.place.create.schedule", "form"); try { $form = $this->validateForm($changeForm, "POST"); $data = $form->getData(); @@ -145,7 +141,7 @@ class ScheduleController extends BaseAdminController } if ($data['success_url'] == null) { - return new RedirectResponse(URL::getInstance()->absoluteUrl(MODULE_URL)); + return new RedirectResponse(URL::getInstance()->absoluteUrl(ClickAndCollect::MODULE_URL)); } else { return $this->generateSuccessRedirect($changeForm); } diff --git a/local/modules/ClickAndCollect/Form/CreatePlaceForm.php b/local/modules/ClickAndCollect/Form/CreatePlaceForm.php new file mode 100644 index 00000000..04d633c7 --- /dev/null +++ b/local/modules/ClickAndCollect/Form/CreatePlaceForm.php @@ -0,0 +1,99 @@ +formBuilder + ->add( + "title", + "text", + [ + "required" => true, + "constraints" => [new Constraints\NotBlank()], + "label" => $this->translator->trans('Place name', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'title'] + ]) + ->add( + "price", + "number", + [ + "required" => true, + "constraints" => [new GreaterThanOrEqual(["value" => 0])], + "label" => $this->translator->trans('Additional cost', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'price'] + ]) + ->add( + "minimum_amount", + "number", + [ + "required" => true, + "constraints" => [new GreaterThanOrEqual(["value" => 0])], + "label" => $this->translator->trans('Minimum amount', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'minimum_amount'] + ]) + ->add( + "address1","text", + [ + "required" => true, + "constraints" => [new Constraints\NotBlank()], + "label" => $this->translator->trans('Address1', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'address1'] + ]) + ->add( + "address2","text", + [ + "required" => false, + "label" => $this->translator->trans('Address2', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'address2'] + ]) + ->add( + "zipcode","text", + [ + "required" => true, + "constraints" => [new Constraints\NotBlank()], + "label" => $this->translator->trans('Zipcode', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'zipcode'] + ]) + ->add( + "city","text", + [ + "required" => true, + "constraints" => [new Constraints\NotBlank()], + "label" => $this->translator->trans('City', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'city'] + ]) + ->add( + "active", + "number", + [ "required" => true ] + ) + ->add( + "click_and_collect", + "number", + [ "required" => true ] + ); + } + + /** + * @inheritDoc + */ + public function getName() + { + return "cnc-place-create"; + } +} diff --git a/local/modules/ClickAndCollect/Form/CreateScheduleForm.php b/local/modules/ClickAndCollect/Form/CreateScheduleForm.php new file mode 100644 index 00000000..7a1448c6 --- /dev/null +++ b/local/modules/ClickAndCollect/Form/CreateScheduleForm.php @@ -0,0 +1,62 @@ +formBuilder + ->add( + "place_id","integer", [ + "label_attr" => ["for" => "attr-place-id"], + "required" => true, + "constraints" => [new Constraints\NotBlank()] + ]) + ->add("day", "choice", [ + "choices" => PlanificationLivraison::getDayLabel(null), + "label" => $this->translator->trans("Working day", [], ClickAndCollect::MESSAGE_DOMAIN), + "label_attr" => ["for" => "attr-place-schedule-day"], + "required" => true, + "multiple" => false, + "constraints" => [new Constraints\NotBlank()], + "attr" => array() + ]) + ->add("begin_time", "time", [ + "label" => $this->translator->trans("Start time", [], ClickAndCollect::MESSAGE_DOMAIN), + "label_attr" => ["for" => "attr-place-schedule-start"], + "input" => "string", + "widget" => "single_text", + "required" => true,"constraints" => [new Constraints\NotBlank(), new Constraints\NotNull()], + "attr" => array() + ]) + ->add("end_time", "time", [ + "label" => $this->translator->trans("End time", [], ClickAndCollect::MESSAGE_DOMAIN), + "label_attr" => ["for" => "attr-place-schedule-end"], + "input" => "string", + "widget" => "single_text", + "required" => true,"constraints" => [new Constraints\NotBlank(), new Constraints\NotNull()], + "attr" => array() + ]); + } + + /** + * @inheritDoc + */ + public function getName() + { + return "cnc-place-create-schedule"; + } +} diff --git a/local/modules/ClickAndCollect/Form/UpdateScheduleForm.php b/local/modules/ClickAndCollect/Form/UpdateScheduleForm.php new file mode 100644 index 00000000..e0de8725 --- /dev/null +++ b/local/modules/ClickAndCollect/Form/UpdateScheduleForm.php @@ -0,0 +1,69 @@ +formBuilder + ->add( + "place_id","integer", [ + "label_attr" => ["for" => "attr-place-id"], + "required" => true, + "constraints" => [new Constraints\NotBlank()] + ]) + ->add( + "place-schedule_id","integer", [ + "label_attr" => ["for" => "attr-place-schedule-id"], + "required" => true, + "constraints" => [new Constraints\NotBlank()] + ]) + ->add("day", "choice", [ + "choices" => PlanificationLivraison::getDayLabel(null), + "label" => $this->translator->trans("Working day", [], ClickAndCollect::MESSAGE_DOMAIN), + "label_attr" => ["for" => "attr-place-schedule-day"], + "required" => true, + "multiple" => false, + "constraints" => [new Constraints\NotBlank()], + "attr" => array() + ]) + ->add("begin_time", "time", [ + "label" => $this->translator->trans("Start time", [], ClickAndCollect::MESSAGE_DOMAIN), + "label_attr" => ["for" => "attr-place-schedule-begin"], + "input" => "string", + "widget" => "single_text", + "required" => true, + "constraints" => [new Constraints\NotBlank(), new Constraints\NotNull()], + "attr" => array() + ]) + ->add("end_time", "time", [ + "label" => $this->translator->trans("End time", [], ClickAndCollect::MESSAGE_DOMAIN), + "label_attr" => ["for" => "attr-place-schedule-end"], + "input" => "string", + "widget" => "single_text", + "required" => true,"constraints" => [new Constraints\NotBlank(), new Constraints\NotNull()], + "attr" => array() + ]); + } + + /** + * @inheritDoc + */ + public function getName() + { + return "cnc-place-update-schedule"; + } +} diff --git a/local/modules/ClickAndCollect/Form/ViewMainForm.php b/local/modules/ClickAndCollect/Form/ViewMainForm.php new file mode 100644 index 00000000..2541f2c9 --- /dev/null +++ b/local/modules/ClickAndCollect/Form/ViewMainForm.php @@ -0,0 +1,127 @@ +formBuilder + ->add( + "place_id","integer", + [ + "required" => true, + "constraints" => [new Constraints\NotBlank()] + ]) + ->add( + "title","text", + [ + "required" => true, + "constraints" => [new Constraints\NotBlank(), new Constraints\NotNull()], + "label" => $this->translator->trans('Place name', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'title'] + ]) + ->add( + "price","number", + [ + "required" => true, + "constraints" => [new GreaterThanOrEqual(["value" => 0])], + "label" => $this->translator->trans('Additional cost', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'price'] + ]) + ->add( + "minimum_amount","number", + [ + "required" => true, + "constraints" => [new GreaterThanOrEqual(["value" => 0])], + "label" => $this->translator->trans('Minimum amount', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'minimum_amount'] + ]) + ->add("latitude", "number", [ + "label" => $this->translator->trans("Latitude", [], ClickAndCollect::MESSAGE_DOMAIN), + "label_attr" => ["for" => "latitude"], + "required" => false + ]) + ->add("longitude", "number", [ + "label" => $this->translator->trans("Longitude", [], ClickAndCollect::MESSAGE_DOMAIN), + "label_attr" => ["for" => "longitude"], + "required" => false + ]) + ->add( + "active","number", + [ + "required" => true, + "constraints" => [new Constraints\NotBlank()], + "label" => $this->translator->trans('Active', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'active'] + ]) + ->add( + "click_and_collect","number", + [ + "required" => true, + "constraints" => [new Constraints\NotBlank()], + "label" => $this->translator->trans('Click and Collect', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'click_and_collect'] + ]) + ->add( + "address1","text", + [ + "required" => true, + "constraints" => [new Constraints\NotBlank()], + "label" => $this->translator->trans('Address1', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'address1'] + ]) + ->add( + "address2","text", + [ + "required" => false, + "label" => $this->translator->trans('Address2', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'address2'] + ]) + ->add( + "zipcode","text", + [ + "required" => true, + "constraints" => [new Constraints\NotBlank()], + "label" => $this->translator->trans('Zipcode', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'zipcode'] + ]) + ->add( + "city","text", + [ + "required" => true, + "constraints" => [new Constraints\NotBlank()], + "label" => $this->translator->trans('City', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'city'] + ]) + ->add( + "access_comment","textarea", + [ + "required" => false, + "label" => $this->translator->trans('Access comment', [], ClickAndCollect::DOMAIN_NAME), + "label_attr" => ['for' => 'access_comment'] + ] + ); + } + + /** + * @inheritDoc + */ + public function getName() + { + return "cnc-place-view-main"; + } +} diff --git a/local/modules/ClickAndCollect/Form/ViewScheduleForm.php b/local/modules/ClickAndCollect/Form/ViewScheduleForm.php new file mode 100644 index 00000000..b0c0079f --- /dev/null +++ b/local/modules/ClickAndCollect/Form/ViewScheduleForm.php @@ -0,0 +1,62 @@ +formBuilder + ->add( + "place_id","integer", [ + "label_attr" => ["for" => "attr-place-id"], + "required" => true, + "constraints" => [new Constraints\NotBlank()] + ]) + ->add("day", "choice", [ + "choices" => PlanificationLivraison::getDayLabel(null), + "label" => $this->translator->trans("Delivery day", [], ClickAndCollect::MESSAGE_DOMAIN), + "label_attr" => ["for" => "attr-place-schedule-day"], + "required" => true, + "multiple" => false, + "constraints" => [new Constraints\NotBlank()], + "attr" => array() + ]) + ->add("begin_time", "time", [ + "label" => $this->translator->trans("Delivery beginning time", [], ClickAndCollect::MESSAGE_DOMAIN), + "label_attr" => ["for" => "attr-place-schedule-start"], + "input" => "string", + "widget" => "single_text", + "required" => true,"constraints" => [new Constraints\NotBlank(), new Constraints\NotNull()], + "attr" => array() + ]) + ->add("end_time", "time", [ + "label" => $this->translator->trans("Delivery ending time", [], ClickAndCollect::MESSAGE_DOMAIN), + "label_attr" => ["for" => "attr-place-schedule-end"], + "input" => "string", + "widget" => "single_text", + "required" => true,"constraints" => [new Constraints\NotBlank(), new Constraints\NotNull()], + "attr" => array() + ]); + } + + /** + * @inheritDoc + */ + public function getName() + { + return "cnc-place-view-schedule"; + } +} diff --git a/local/modules/ClickAndCollect/Hook/FrontHook.php b/local/modules/ClickAndCollect/Hook/FrontHook.php index 04264d96..5801123f 100644 --- a/local/modules/ClickAndCollect/Hook/FrontHook.php +++ b/local/modules/ClickAndCollect/Hook/FrontHook.php @@ -3,7 +3,6 @@ namespace ClickAndCollect\Hook; use ClickAndCollect\ClickAndCollect; -use PointRetrait\PointRetrait; use Thelia\Core\Event\Hook\HookRenderEvent; use Thelia\Core\Hook\BaseHook; use Thelia\Exception\TheliaProcessException; @@ -27,27 +26,23 @@ class FrontHook extends BaseHook public function displayWithdrawalDate(HookRenderEvent $event) { $order = $this->getSession()->getOrder(); - if ((null !== $order) && $order->getDeliveryModuleId() == PointRetrait::getModuleId()) + if ((null !== $order) && $order->getDeliveryModuleId() == ClickAndCollect::getModuleId()) { $sessionData = $this->getSession()->get('cncData'); $selectedDay = $sessionData->getDeliveryDate(); - $beginTime = $sessionData->getDeliveryStartTime(); - $endTime = $sessionData->getDeliveryEndTime(); - if ( (null !== $selectedDay) && (null !== $beginTime) && (null !== $endTime) ) + if (null !== $selectedDay) { $event->add( $this->render( 'delivery-address.html', [ 'day' => $selectedDay, - 'begin_time' => $beginTime, - 'end_time' => $endTime, 'place_id' => $sessionData->getPlaceId() ]) ); } else - throw new TheliaProcessException("PointRetrait : Impossible de récupérer les données de session sessionData"); + throw new TheliaProcessException("ClickAndCollect : Impossible de récupérer les données de session sessionData"); } } diff --git a/local/modules/ClickAndCollect/I18n/fr_FR.php b/local/modules/ClickAndCollect/I18n/fr_FR.php index 4a961042..79dd7899 100644 --- a/local/modules/ClickAndCollect/I18n/fr_FR.php +++ b/local/modules/ClickAndCollect/I18n/fr_FR.php @@ -1,11 +1,48 @@ 'Commentaire d\'accès', + 'Access comment help' => 'Ce commentaire d\'accès sera visible de vos clients, pour les aider à mieux localiser le point de retrait', + 'Active' => 'Actif', + 'Add a new place' => 'Ajouter un nouveau point', + 'Add a new opening day' => 'Ajouter un jour d\'ouverture', + 'Additional cost' => 'Coût supplémentaire', + 'Address1' => 'Adresse', + 'Address2' => 'Complément d\'adresse', + 'Address' => 'Adresse', + 'City' => 'Commune', + 'Create a new place' => 'Créer un nouveau point', 'Delay' => 'Délai avant dépôt', + 'Delete a place' => 'Supprimer un point Click and Collect', + 'Delete this place' => 'Supprimer ce point', + 'Do you really want to remove this place ?' => 'Voulez-vous réellement supprimer ce point Click and Collect ?', + 'Edit a place' => 'Modifier un point Click and Collect', + 'Edit this place' => 'Modifier ce point Click and Collect', + 'Edit this opening day' => 'Modifier ce jour d\'ouverture', + 'End time' => 'Horaire de fermeture', + 'Free' => 'Gratuit', + 'Main' => 'Généralités', + 'Message availability' => 'Retrait possible à partir du', + 'Message explicatif' => 'Nous pouvons déposer votre commande chez un de nos partenaires Click and Collect : vous pourrez ensuite la récupérer à votre convenance.', + 'Message no location' => 'Ce point Click and Collect ne possède pas de coordonnées GPS : pour vos clients, il est conseillé de géolocaliser son adresse.', + 'Minimum amount' => 'Minimum de commande', 'Module name' => 'Point Click and Collect', + 'Module name - customer' => 'Retirez en point Click and Collect', + 'My places' => 'Mes points Click and Collect', + 'My Click and Collect places' => 'Mes points Click and Collect', + 'Opening hours' => 'Horaires d\'ouverture', 'Order number' => 'Commande', + 'Order to withdraw' => 'Point Click and Collect de retrait', 'Place name' => 'Nom du point de dépôt', + 'Recenter map' => 'Géolocaliser le point Click and Collect', + 'Schedule' => 'Horaires d\'ouverture', 'Scheduled date' => 'A déposer pour le', 'Scheduled click and collect' => 'Commandes à déposer en Click & Collect', + 'Start time' => 'Horaire d\'ouverture', + 'Starting date' => 'Vous pourrez récupérer votre commande à partir du', 'There is no order to deliver' => 'Aucune commande à déposer', + 'There is no schedule for this place' => 'Aucun jour d\'ouverture pour ce point click and Collect', + 'Title of config view' => 'Point Click and Collect - Configuration', + 'Working day' => 'Jour d\'ouverture', + 'Zipcode' => 'Code postal', '' => '', ); diff --git a/local/modules/ClickAndCollect/templates/backOffice/default/place-edit.html b/local/modules/ClickAndCollect/templates/backOffice/default/cnc-place-edit.html similarity index 79% rename from local/modules/ClickAndCollect/templates/backOffice/default/place-edit.html rename to local/modules/ClickAndCollect/templates/backOffice/default/cnc-place-edit.html index 50cddea0..32c43eb0 100644 --- a/local/modules/ClickAndCollect/templates/backOffice/default/place-edit.html +++ b/local/modules/ClickAndCollect/templates/backOffice/default/cnc-place-edit.html @@ -1,9 +1,9 @@ {extends file="admin-layout.tpl"} -{block name="page-title"}{intl l='My places' d="pointretrait"}{/block} +{block name="page-title"}{intl l='My places' d="clickandcollect"}{/block} {block name="check-access"}update{/block} -{block name="check-module"}PointRetrait{/block} +{block name="check-module"}ClickAndCollect{/block} {block name="after-bootstrap-css"}
- {intl l="Edit a place" d="pointretrait"} : {loop name="places" type="pdr_places" id={$place_id}}{$TITLE}{/loop} + {intl l="Edit a place" d="clickandcollect"} : {loop name="places" type="pdr_places" id={$place_id}}{$TITLE}{/loop}
{loop name="auth-general-tab" type="auth" role="ADMIN" resource="admin" access="VIEW" module="ClickAndCollect"}
- {include file="includes/main.html"} + {include file="includes/cnc-main.html"}
{/loop} {loop name="auth-schedule-tab" type="auth" role="ADMIN" resource="admin.schedule" access="VIEW" module="ClickAndCollect"}
- {include file="includes/schedule.html"} + {include file="includes/cnc-schedule.html"}
{/loop}
- + -{include file="modal/schedule-modal.html"} +{include file="modal/cnc-schedule-modal.html"} {/block} @@ -77,6 +77,6 @@ }); {/javascripts} -{include file="js/main-js.html"} -{include file="js/schedule-js.html"} +{include file="js/cnc-main-js.html"} +{include file="js/cnc-schedule-js.html"} {/block} diff --git a/local/modules/ClickAndCollect/templates/backOffice/default/cnc-places-list.html b/local/modules/ClickAndCollect/templates/backOffice/default/cnc-places-list.html index 24067cc9..a2c89cc5 100644 --- a/local/modules/ClickAndCollect/templates/backOffice/default/cnc-places-list.html +++ b/local/modules/ClickAndCollect/templates/backOffice/default/cnc-places-list.html @@ -23,7 +23,7 @@
@@ -51,7 +51,7 @@ - {loop name="places" type="pdr_places"} + {loop name="places" type="pdr_places" click_and_collect=1} - - + +
- {intl l='My deposit places' d='clickandcollect'} + {intl l='My Click and Collect places' d='clickandcollect'}
{$TITLE} @@ -61,16 +61,24 @@ {$ADDRESS1}
{$ZIPCODE} {$CITY}{if $LATITUDE eq '' or $LONGITUDE eq ''}Pas de coordonnées{/if}
{$DELIVERY_DAYS}{if $DELIVERY_DAYS eq ''}{intl l="There is no schedule for this place" d='clickandcollect'}{/if}{$ADDRESS1}
{$ZIPCODE} {$CITY}{if $LATITUDE eq '' or $LONGITUDE eq ''}Pas de coordonnées{/if}
+ {if $DELIVERY_DAYS eq ''} + {intl l="There is no schedule for this place" d='clickandcollect'} + {else} + {loop name="schedules-loop" type="pdr_schedule" place_id={$ID}} + {$DAY_LABEL} de {format_date date=$BEGIN format="H\hi"} à {format_date date=$END format="H\hi"}
+ {/loop} + {/if} +
{$PRICE} € {$MINIMUM_AMOUNT} € @@ -85,14 +93,14 @@ {* CREATE Modal *} - {form name="pdr.place.create"} + {form name="cnc.place.create"} {capture "place_create"} - {include file="form/place-create.html" form_name="pdr.place.create"} + {include file="form/cnc-place-create.html" form_name="cnc.place.create"} {/capture} {include file="includes/generic-create-dialog.html" dialog_id = "place-create-modal" - dialog_title = {intl l="Create a new place" d="pointretrait"} + dialog_title = {intl l="Create a new place" d="clickandcollect"} dialog_body = {$smarty.capture.place_create nofilter} dialog_ok_label = {intl l="Create"} dialog_cancel_label = {intl l="Cancel"} @@ -103,14 +111,14 @@ {* DELETE modal *} {capture "place_delete"} - {intl l="Do you really want to remove this place ?" d="pointretrait"} + {intl l="Do you really want to remove this place ?" d="clickandcollect"} {/capture} {include file="includes/generic-confirm-dialog.html" dialog_id = "place-delete" - dialog_title = {intl l="Delete a place" d="pointretrait"} + dialog_title = {intl l="Delete a place" d="clickandcollect"} dialog_message = {$smarty.capture.place_delete nofilter} dialog_ok_label = {intl l="Delete"} dialog_cancel_label = {intl l="Cancel"} diff --git a/local/modules/ClickAndCollect/templates/backOffice/default/form/place-create.html b/local/modules/ClickAndCollect/templates/backOffice/default/form/cnc-place-create.html similarity index 86% rename from local/modules/ClickAndCollect/templates/backOffice/default/form/place-create.html rename to local/modules/ClickAndCollect/templates/backOffice/default/form/cnc-place-create.html index 69e6527d..8a51908f 100644 --- a/local/modules/ClickAndCollect/templates/backOffice/default/form/place-create.html +++ b/local/modules/ClickAndCollect/templates/backOffice/default/form/cnc-place-create.html @@ -1,12 +1,12 @@ {form name=$form_name} {form_hidden_fields form=$form} - {render_form_field form=$form field="success_url" value={$success_url|default:{url path='/admin/module/PointRetrait'}}} + {render_form_field form=$form field="success_url" value={$success_url|default:{url path='/admin/module/ClickAndCollect'}}} {form_field form=$form field="title"}
@@ -18,7 +18,7 @@ {form_field form=$form field="price"}
@@ -30,7 +30,7 @@ {form_field form=$form field="minimum_amount"}
@@ -42,7 +42,7 @@ {form_field form=$form field="address1"}
@@ -56,7 +56,7 @@ {form_field form=$form field="address2"}
@@ -70,7 +70,7 @@ {form_field form=$form field="zipcode"}
@@ -84,7 +84,7 @@ {form_field form=$form field="city"}
@@ -99,4 +99,8 @@ {/form_field} + {form_field form=$form field="click_and_collect"} + + {/form_field} + {/form} \ No newline at end of file diff --git a/local/modules/ClickAndCollect/templates/backOffice/default/form/place-schedule-create.html b/local/modules/ClickAndCollect/templates/backOffice/default/form/cnc-place-schedule-create.html similarity index 95% rename from local/modules/ClickAndCollect/templates/backOffice/default/form/place-schedule-create.html rename to local/modules/ClickAndCollect/templates/backOffice/default/form/cnc-place-schedule-create.html index dba5f757..6d605ec9 100644 --- a/local/modules/ClickAndCollect/templates/backOffice/default/form/place-schedule-create.html +++ b/local/modules/ClickAndCollect/templates/backOffice/default/form/cnc-place-schedule-create.html @@ -1,8 +1,8 @@ {form name=$form_name} {form_hidden_fields form=$form} -{render_form_field form=$form field="success_url" value={url path="/admin/module/PointRetrait/edit?place_id={$place_id}#schedule"}} -{render_form_field form=$form field="error_url" value={url path="/admin/module/PointRetrait/edit?place_id={$place_id}#schedule"}} +{render_form_field form=$form field="success_url" value={url path="/admin/module/ClickAndCollect/edit?place_id={$place_id}#schedule"}} +{render_form_field form=$form field="error_url" value={url path="/admin/module/ClickAndCollect/edit?place_id={$place_id}#schedule"}} {form_field form=$form field="place_id"}