diff --git a/local/modules/PointRetrait/Config/routing.xml b/local/modules/PointRetrait/Config/routing.xml index 39c388d1..e5765136 100644 --- a/local/modules/PointRetrait/Config/routing.xml +++ b/local/modules/PointRetrait/Config/routing.xml @@ -4,34 +4,35 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> - + PointRetrait\Controller\backOffice\ListController::viewAction - + PointRetrait\Controller\backOffice\ListController::toggleActive \d+ - - PointRetrait\Controller\backOffice\PlaceController::viewPlace - - + PointRetrait\Controller\backOffice\PlaceController::createPlace - + + PointRetrait\Controller\backOffice\PlaceController::viewPlace + + PointRetrait\Controller\backOffice\PlaceController::editPlace - + + PointRetrait\Controller\backOffice\PlaceController::deletePlace - + PointRetrait\Controller\backOffice\ScheduleController::createSchedule - + PointRetrait\Controller\backOffice\ScheduleController::updateSchedule - + PointRetrait\Controller\backOffice\ScheduleController::deleteSchedule diff --git a/local/modules/PointRetrait/Controller/backOffice/PlaceController.php b/local/modules/PointRetrait/Controller/backOffice/PlaceController.php index b02dcede..73a8c88f 100644 --- a/local/modules/PointRetrait/Controller/backOffice/PlaceController.php +++ b/local/modules/PointRetrait/Controller/backOffice/PlaceController.php @@ -5,7 +5,6 @@ namespace PointRetrait\Controller\backOffice; use PointRetrait\Model\PdrPlaces; use PointRetrait\Model\PdrPlacesQuery; use PointRetrait\PointRetrait; -use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\Map\TableMap; use Propel\Runtime\Propel; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -41,7 +40,7 @@ class PlaceController extends BaseAdminController $con->beginTransaction(); $error_msg = ""; - $changeForm = $this->createForm("pointretrait.place.view.main", "form"); + $changeForm = $this->createForm("pdr.place.view.main", "form"); try { $form = $this->validateForm($changeForm, "POST"); @@ -77,7 +76,7 @@ class PlaceController extends BaseAdminController $con->beginTransaction(); $error_msg = ""; - $createForm = $this->createForm("pointretrait.place.create", "form"); + $createForm = $this->createForm("pdr.place.create", "form"); try { $form = $this->validateForm($createForm, "POST"); diff --git a/local/modules/PointRetrait/Controller/backOffice/ScheduleController.php b/local/modules/PointRetrait/Controller/backOffice/ScheduleController.php index 1fb43cb1..6428031b 100644 --- a/local/modules/PointRetrait/Controller/backOffice/ScheduleController.php +++ b/local/modules/PointRetrait/Controller/backOffice/ScheduleController.php @@ -34,8 +34,8 @@ class ScheduleController extends BaseAdminController if (null !== $response = $this->checkAuth(AdminResources::MODULE, PointRetrait::getModuleCode(), AccessManager::UPDATE)) return $response; - $placeScheduleId = $this->getRequest()->get('place-schedule_id'); - $query = PdrPlacesQuery::create()->findById($placeScheduleId); + $placeScheduleId = $this->getRequest()->get('schedule_id'); + $query = PdrScheduleQuery::create()->findById($placeScheduleId); if ($query === null) $error_msg = "Delivery area schedule not found by Id"; else @@ -72,7 +72,7 @@ class ScheduleController extends BaseAdminController $form = $this->validateForm($changeForm, "POST"); $data = $form->getData(); - $placeScheduleId = $this->getRequest()->get('place-schedule_id'); + $placeScheduleId = $this->getRequest()->get('schedule_id'); $query = PdrScheduleQuery::create()->findOneById($placeScheduleId); if ($query === null) $error_msg = "Withdrawal place schedule not found by Id"; diff --git a/local/modules/PointRetrait/I18n/fr_FR.php b/local/modules/PointRetrait/I18n/fr_FR.php index a1cf21a7..e98b8b79 100644 --- a/local/modules/PointRetrait/I18n/fr_FR.php +++ b/local/modules/PointRetrait/I18n/fr_FR.php @@ -9,10 +9,12 @@ return array( 'Address2' => 'Complément d\'adresse', 'City' => 'Commune', 'Create a new place' => 'Créer un nouveau point de retrait', - 'Do you really want to remove this place ?' => 'Voulez-vous réellement supprimer ce point de retrait ?', 'Delete a place' => 'Supprimer un point de retrait', + 'Delete an entry of schedule' => 'Supprimer un créneau de retrait', 'Delete this withdrawal day' => 'Supprimer ce jour de retrait', 'Delivery delay' => 'Délai avant retrait', + 'Do you really want to remove this place ?' => 'Voulez-vous réellement supprimer ce point de retrait ?', + 'Do you really want to remove this schedule entry ?' => 'Voulez-vous réellement supprimer ce créneau de retrait ?', 'Edit a place' => 'Modifier un lieu de retrait', 'Edit this withdrawal day' => 'Modifier ce jour de retrait', 'Location set' => 'Coordonnées GPS présentes ?', diff --git a/local/modules/PointRetrait/Loop/GeneralLoop.php b/local/modules/PointRetrait/Loop/GeneralLoop.php index 0c976288..59672aa7 100644 --- a/local/modules/PointRetrait/Loop/GeneralLoop.php +++ b/local/modules/PointRetrait/Loop/GeneralLoop.php @@ -34,7 +34,9 @@ class GeneralLoop extends BaseLoop implements PropelSearchLoopInterface $loopResultRow = new LoopResultRow($places); - $schedule = PdrScheduleQuery::create()->findById($places->getId()); + $schedule = PdrScheduleQuery::create() + ->filterByIdPlace($places->getId()) + ->orderByDay(); $deliveryDays = ""; foreach ($schedule as $day) { $deliveryDays .= PointRetrait::getDayLabel($day->getDay()) . ', '; diff --git a/local/modules/PointRetrait/templates/backOffice/default/includes/main.html b/local/modules/PointRetrait/templates/backOffice/default/includes/main.html index 9b2ac6a6..76690e24 100644 --- a/local/modules/PointRetrait/templates/backOffice/default/includes/main.html +++ b/local/modules/PointRetrait/templates/backOffice/default/includes/main.html @@ -6,13 +6,13 @@ {/if} {loop name="places" type="pdr_places" id="$place_id"} -
+ {form_hidden_fields form=$form} {include file = "includes/inner-form-toolbar.html" hide_flags = true hide_submit_buttons = false - page_url = "{url path="/admin/module/PointRetrait/edit&place_id=$place_id"}" + page_url = "{url path='/admin/module/PointRetrait/edit&place_id=$place_id'}" close_url = "{url path='/admin/module/PointRetrait'}" current_tab = "main" } diff --git a/local/modules/PointRetrait/templates/backOffice/default/js/main-js.html b/local/modules/PointRetrait/templates/backOffice/default/js/main-js.html index 7b2ab7cf..09dd6e7a 100644 --- a/local/modules/PointRetrait/templates/backOffice/default/js/main-js.html +++ b/local/modules/PointRetrait/templates/backOffice/default/js/main-js.html @@ -23,7 +23,6 @@ displayPlace(); addListener(); - const geocoder = new google.maps.Geocoder(); document.getElementById("submit-geoloc").addEventListener("click", () => { geocodeAddress(geocoder, map); @@ -73,5 +72,4 @@ }); } - \ No newline at end of file diff --git a/local/modules/PointRetrait/templates/backOffice/default/js/schedule-js.html b/local/modules/PointRetrait/templates/backOffice/default/js/schedule-js.html index 43f6650f..bfdee772 100644 --- a/local/modules/PointRetrait/templates/backOffice/default/js/schedule-js.html +++ b/local/modules/PointRetrait/templates/backOffice/default/js/schedule-js.html @@ -17,6 +17,7 @@ }); $('a.place-schedule-create').click(function (ev) { + $('#attr-place-id').val($(this).data('id')); $("#attr-place-schedule-begin input, #attr-place-schedule-end input").prop('required', true); $("#attr-place-schedule-day").prop('required', true); }); diff --git a/local/modules/PointRetrait/templates/backOffice/default/modal/schedule-modal.html b/local/modules/PointRetrait/templates/backOffice/default/modal/schedule-modal.html index a0930126..d13c6de1 100644 --- a/local/modules/PointRetrait/templates/backOffice/default/modal/schedule-modal.html +++ b/local/modules/PointRetrait/templates/backOffice/default/modal/schedule-modal.html @@ -1,13 +1,13 @@ {* DELETE modal *} {capture "schedule_delete"} - {intl l="Do you really want to delete this delivery day ?" d="pointretrait"} - + {intl l="Do you really want to remove this schedule entry ?" d="pointretrait"} + {/capture} {include file="includes/generic-confirm-dialog.html" - dialog_id = "area-schedule-delete" + dialog_id = "place-schedule-delete" dialog_title = {intl l="Delete an entry of schedule" d="pointretrait"} dialog_message = {$smarty.capture.schedule_delete nofilter} dialog_ok_label = {intl l="Delete"} @@ -20,10 +20,10 @@ {form name="pdr.place.update.schedule"} {capture "schedule_update"} {form_field form=$form field="place-schedule_id"} - + {/form_field} {form_field form=$form field="place_id"} - + {/form_field} {include file="form/place-schedule-create.html" form_name="pdr.place.update.schedule" update=true} @@ -31,7 +31,7 @@ {include file="includes/generic-create-dialog.html" dialog_id = "place-schedule-update" - dialog_title = {intl l="Modify a withdrawal day" d="pointretrait"} + dialog_title = {intl l="Edit this withdrawal day" d="pointretrait"} dialog_body = {$smarty.capture.schedule_update nofilter} dialog_ok_label = {intl l="Save"} dialog_cancel_label = {intl l="Cancel"}