ClickAndCollect : quasiment terminé

This commit is contained in:
2021-03-12 20:09:57 +01:00
parent 57e69ddd2f
commit 27d98adf28
37 changed files with 771 additions and 226 deletions

View File

@@ -14,6 +14,7 @@ class ClickAndCollect extends AbstractDeliveryModule
{
/** @var string */
const DOMAIN_NAME = 'clickandcollect';
const MESSAGE_DOMAIN = 'clickandcollect';
const MODULE_URL = '/admin/module/ClickAndCollect';

View File

@@ -29,4 +29,12 @@
</hook>
</hooks>
<forms>
<form name="cnc.place.view.main" class="ClickAndCollect\Form\ViewMainForm"/>
<form name="cnc.place.view.schedule" class="ClickAndCollect\Form\ViewScheduleForm"/>
<form name="cnc.place.create" class="ClickAndCollect\Form\CreatePlaceForm"/>
<form name="cnc.place.create.schedule" class="ClickAndCollect\Form\CreateScheduleForm"/>
<form name="cnc.place.update.schedule" class="ClickAndCollect\Form\UpdateScheduleForm"/>
</forms>
</config>

View File

@@ -7,33 +7,33 @@
<route id="cnc.places.list" path="/admin/module/ClickAndCollect" methods="get">
<default key="_controller">ClickAndCollect\Controller\backOffice\ListController::viewAction</default>
</route>
<!-- <route id="cnc.toggle.active" path="/admin/module/ClickAndCollect/toggle-online/{id}" methods="post">-->
<!-- <default key="_controller">ClickAndCollect\Controller\backOffice\ListController::toggleActive</default>-->
<!-- <requirement key="id">\d+</requirement>-->
<!-- </route>-->
<route id="cnc.toggle.active" path="/admin/module/ClickAndCollect/toggle-online/{id}" methods="post">
<default key="_controller">ClickAndCollect\Controller\backOffice\ListController::toggleActive</default>
<requirement key="id">\d+</requirement>
</route>
<!-- <route id="cnc.place.create" path="/admin/module/ClickAndCollect" methods="post">-->
<!-- <default key="_controller">ClickAndCollect\Controller\backOffice\PlaceController::createPlace</default>-->
<!-- </route>-->
<!-- <route id="cnc.place.view" path="/admin/module/ClickAndCollect/edit" methods="get">-->
<!-- <default key="_controller">ClickAndCollect\Controller\backOffice\PlaceController::viewPlace</default>-->
<!-- </route>-->
<!-- <route id="cnc.place.edit" path="/admin/module/ClickAndCollect/edit" methods="post">-->
<!-- <default key="_controller">ClickAndCollect\Controller\backOffice\PlaceController::editPlace</default>-->
<!-- </route>-->
<route id="cnc.place.create" path="/admin/module/ClickAndCollect" methods="post">
<default key="_controller">ClickAndCollect\Controller\backOffice\PlaceController::createPlace</default>
</route>
<route id="cnc.place.view" path="/admin/module/ClickAndCollect/edit" methods="get">
<default key="_controller">ClickAndCollect\Controller\backOffice\PlaceController::viewPlace</default>
</route>
<route id="cnc.place.edit" path="/admin/module/ClickAndCollect/edit" methods="post">
<default key="_controller">ClickAndCollect\Controller\backOffice\PlaceController::editPlace</default>
</route>
<!-- <route id="cnc.place.delete" path="/admin/module/ClickAndCollect/delete" methods="post">-->
<!-- <default key="_controller">ClickAndCollect\Controller\backOffice\PlaceController::deletePlace</default>-->
<!-- </route>-->
<route id="cnc.place.delete" path="/admin/module/ClickAndCollect/delete" methods="post">
<default key="_controller">ClickAndCollect\Controller\backOffice\PlaceController::deletePlace</default>
</route>
<!-- <route id="cnc.schedule.create" path="admin/module/ClickAndCollect/schedule/create" methods="post">-->
<!-- <default key="_controller">ClickAndCollect\Controller\backOffice\ScheduleController::createSchedule</default>-->
<!-- </route>-->
<!-- <route id="cnc.schedule.update" path="admin/module/ClickAndCollect/schedule/update" methods="post">-->
<!-- <default key="_controller">ClickAndCollect\Controller\backOffice\ScheduleController::updateSchedule</default>-->
<!-- </route>-->
<!-- <route id="cnc.schedule.delete" path="/admin/module/ClickAndCollect/schedule/delete" methods="post">-->
<!-- <default key="_controller">ClickAndCollect\Controller\backOffice\ScheduleController::deleteSchedule</default>-->
<!-- </route>-->
<route id="cnc.schedule.create" path="admin/module/ClickAndCollect/schedule/create" methods="post">
<default key="_controller">ClickAndCollect\Controller\backOffice\ScheduleController::createSchedule</default>
</route>
<route id="cnc.schedule.update" path="admin/module/ClickAndCollect/schedule/update" methods="post">
<default key="_controller">ClickAndCollect\Controller\backOffice\ScheduleController::updateSchedule</default>
</route>
<route id="cnc.schedule.delete" path="/admin/module/ClickAndCollect/schedule/delete" methods="post">
<default key="_controller">ClickAndCollect\Controller\backOffice\ScheduleController::deleteSchedule</default>
</route>
</routes>

View File

@@ -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");
}
}

View File

@@ -1,10 +1,10 @@
<?php
namespace PointRetrait\Controller\backOffice;
namespace ClickAndCollect\Controller\backOffice;
use PointRetrait\Model\PdrPlaces;
use ClickAndCollect\ClickAndCollect;
use PointRetrait\Model\PdrPlacesQuery;
use PointRetrait\PointRetrait;
use PointRetrait\Model\PdrPlaces;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Propel;
use Symfony\Component\HttpFoundation\RedirectResponse;
@@ -16,7 +16,7 @@ use Thelia\Tools\URL;
/**
* Class PlaceController
* @package PointRetrait\Controller
* @package ClickAndCollect\Controller
*/
class PlaceController extends BaseAdminController
{
@@ -25,7 +25,7 @@ class PlaceController extends BaseAdminController
{
$selectedPlace = PdrPlacesQuery::create()->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")));
}

View File

@@ -1,14 +1,10 @@
<?php
namespace PointRetrait\Controller\backOffice;
namespace ClickAndCollect\Controller\backOffice;
use LivraisonParSecteurs\LivraisonParSecteurs;
use LivraisonParSecteurs\Model\LpsAreaSchedule;
use LivraisonParSecteurs\Model\LpsAreaScheduleQuery;
use PointRetrait\Model\PdrPlacesQuery;
use ClickAndCollect\ClickAndCollect;
use PointRetrait\Model\PdrSchedule;
use PointRetrait\Model\PdrScheduleQuery;
use PointRetrait\PointRetrait;
use Propel\Runtime\Map\TableMap;
use Propel\Runtime\Propel;
use Symfony\Component\HttpFoundation\RedirectResponse;
@@ -20,7 +16,7 @@ use Thelia\Tools\URL;
/**
* Class ScheduleController
* @package PointRetrait\Controller
* @package ClickAndCollect\Controller
*/
class ScheduleController extends BaseAdminController
{
@@ -31,13 +27,13 @@ class ScheduleController extends BaseAdminController
public function deleteSchedule()
{
// 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;
$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);
}

View File

@@ -0,0 +1,99 @@
<?php
namespace ClickAndCollect\Form;
use ClickAndCollect\ClickAndCollect;
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
use Thelia\Form\BaseForm;
use Symfony\Component\Validator\Constraints;
/**
* Class CreatePlaceForm
* @package ClickAndCollect\Form
*/
class CreatePlaceForm extends BaseForm
{
/**
* @inheritDoc
*/
protected function buildForm()
{
$this->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";
}
}

View File

@@ -0,0 +1,62 @@
<?php
namespace ClickAndCollect\Form;
use PlanificationLivraison\PlanificationLivraison;
use ClickAndCollect\ClickAndCollect;
use Thelia\Form\BaseForm;
use Symfony\Component\Validator\Constraints;
/**
* Class CreateScheduleForm
* @package LivraisonParSecteurs\Form
*/
class CreateScheduleForm extends BaseForm
{
/**
* @inheritDoc
*/
protected function buildForm()
{
$this->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";
}
}

View File

@@ -0,0 +1,69 @@
<?php
namespace ClickAndCollect\Form;
use PlanificationLivraison\PlanificationLivraison;
use ClickAndCollect\ClickAndCollect;
use Thelia\Form\BaseForm;
use Symfony\Component\Validator\Constraints;
/**
* Class UpdateScheduleForm
* @package ClickAndCollect\Form
*/
class UpdateScheduleForm extends BaseForm
{
/**
* @inheritDoc
*/
protected function buildForm()
{
$this->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";
}
}

View File

@@ -0,0 +1,127 @@
<?php
namespace ClickAndCollect\Form;
use ClickAndCollect\ClickAndCollect;
use Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
use Thelia\Form\BaseForm;
/**
* Class ViewMainForm
* @package ClickAndCollect\Form
*/
class ViewMainForm extends BaseForm
{
/**
* @inheritDoc
*/
protected function buildForm()
{
$this->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";
}
}

View File

@@ -0,0 +1,62 @@
<?php
namespace ClickAndCollect\Form;
use PlanificationLivraison\PlanificationLivraison;
use ClickAndCollect\ClickAndCollect;
use Thelia\Form\BaseForm;
use Symfony\Component\Validator\Constraints;
/**
* Class ViewScheduleForm
* @package ClickAndCollect\Form
*/
class ViewScheduleForm extends BaseForm
{
/**
* @inheritDoc
*/
protected function buildForm()
{
$this->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";
}
}

View File

@@ -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");
}
}

View File

@@ -1,11 +1,48 @@
<?php
return array(
'Access comment' => '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',
'' => '',
);

View File

@@ -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"}
<link rel="stylesheet"
@@ -19,36 +19,36 @@
<div class="general-block-decorator">
<div class="title title-without-tabs">
{intl l="Edit a place" d="pointretrait"}&nbsp;: <b>{loop name="places" type="pdr_places" id={$place_id}}{$TITLE}{/loop}</b>
{intl l="Edit a place" d="clickandcollect"}&nbsp;: <b>{loop name="places" type="pdr_places" id={$place_id}}{$TITLE}{/loop}</b>
</div>
<ul class="nav nav-tabs" id="tabbed-menu">
{loop name="auth-general" type="auth" role="ADMIN" resource="admin" access="VIEW" module="ClickAndCollect"}
<li class="active"><a href="#main" data-toggle="tab">{intl l="Main" d="pointretrait"}</a></li>
<li class="active"><a href="#main" data-toggle="tab">{intl l="Main" d="clickandcollect"}</a></li>
{/loop}
{loop name="auth-schedule" type="auth" role="ADMIN" resource="admin.schedule" access="VIEW" module="ClickAndCollect"}
<li><a href="#schedule" data-toggle="tab">{intl l="Schedule" d="pointretrait"}</a></li>
<li><a href="#schedule" data-toggle="tab">{intl l="Schedule" d="clickandcollect"}</a></li>
{/loop}
</ul>
<div class="tab-content">
{loop name="auth-general-tab" type="auth" role="ADMIN" resource="admin" access="VIEW" module="ClickAndCollect"}
<div class="tab-pane fade in active" id="main">
{include file="includes/main.html"}
{include file="includes/cnc-main.html"}
</div>
{/loop}
{loop name="auth-schedule-tab" type="auth" role="ADMIN" resource="admin.schedule" access="VIEW" module="ClickAndCollect"}
<div class="tab-pane fade" id="schedule">
{include file="includes/schedule.html"}
{include file="includes/cnc-schedule.html"}
</div>
{/loop}
</div>
</div>
<input type="hidden" id="message-pas-de-coordonnees" value="{intl l='Message no location' d='pointretrait'}" />
<input type="hidden" id="message-pas-de-coordonnees" value="{intl l='Message no location' d='clickandcollect'}" />
</div>
{include file="modal/schedule-modal.html"}
{include file="modal/cnc-schedule-modal.html"}
{/block}
@@ -77,6 +77,6 @@
});
</script>
{/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}

View File

@@ -23,7 +23,7 @@
<div class="table-responsive">
<table class="table table-striped table-condensed" id="areas-table">
<caption class="clearfix">
{intl l='My deposit places' d='clickandcollect'}
{intl l='My Click and Collect places' d='clickandcollect'}
</caption>
<thead>
@@ -51,7 +51,7 @@
</caption>
<tbody>
{loop name="places" type="pdr_places"}
{loop name="places" type="pdr_places" click_and_collect=1}
<tr>
<td><a href="{url path="/admin/module/ClickAndCollect/edit?place_id=$ID"}">{$TITLE}</a></td>
<td>
@@ -61,16 +61,24 @@
<input type="checkbox" class="link" {if $ACTIVE == 1}checked="checked"{/if}>
</div>
</td>
<td>{$ADDRESS1}<br>{$ZIPCODE} {$CITY}{if $LATITUDE eq '' or $LONGITUDE eq ''}<img src="{image file='assets/img/pin.svg' source='PointRetrait'}" title="Pas de coordonnées pour ce point de retrait" alt="Pas de coordonnées" class="pin-pdr" />{/if}</td>
<td>{$DELIVERY_DAYS}{if $DELIVERY_DAYS eq ''}<i>{intl l="There is no schedule for this place" d='clickandcollect'}</i>{/if}</td>
<td>{$ADDRESS1}<br>{$ZIPCODE} {$CITY}{if $LATITUDE eq '' or $LONGITUDE eq ''}<img src="{image file='assets/img/pin.svg' source='ClickAndCollect'}" title="Pas de coordonnées pour ce point de retrait" alt="Pas de coordonnées" class="pin-pdr" />{/if}</td>
<td>
{if $DELIVERY_DAYS eq ''}
<i>{intl l="There is no schedule for this place" d='clickandcollect'}</i>
{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"}<br>
{/loop}
{/if}
</td>
<td>{$PRICE} €</td>
<td>{$MINIMUM_AMOUNT} €</td>
<td class="actions">
<div class="btn-group" role="group">
<a class="btn btn-info btn-responsive" title="{intl l='Edit this place'}" href="{url path="/admin/module/ClickAndCollect/edit?place_id=$ID"}">
<a class="btn btn-info btn-responsive" title="{intl l='Edit this place' d='clickandcollect'}" href="{url path="/admin/module/ClickAndCollect/edit?place_id=$ID"}">
<i class="glyphicon glyphicon-edit"></i>
</a>
<a class="btn btn-danger btn-responsive place-delete" title="{intl l='Delete this place'}" data-target="#place-delete" data-toggle="modal" data-id="{$ID}">
<a class="btn btn-danger btn-responsive place-delete" title="{intl l='Delete this place' d='clickandcollect'}" data-target="#place-delete" data-toggle="modal" data-id="{$ID}">
<i class="glyphicon glyphicon-trash"></i>
</a>
</div>
@@ -85,14 +93,14 @@
</div>
{* 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"}
<input type="hidden" name="attr-place-id" id="attr-place-id" value="999"/>
<input type="hidden" name="success_url" value="{url path='/admin/module/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"}

View File

@@ -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"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d="pointretrait"}
{intl l=$label d="clickandcollect"}
{if $required}<span class="required">*</span>{/if}
</label>
@@ -18,7 +18,7 @@
{form_field form=$form field="price"}
<div class="form-group form-inline">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d="pointretrait"}
{intl l=$label d="clickandcollect"}
{if $required}<span class="required">*</span>{/if}
</label>
@@ -30,7 +30,7 @@
{form_field form=$form field="minimum_amount"}
<div class="form-group form-inline">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d="pointretrait"}
{intl l=$label d="clickandcollect"}
{if $required}<span class="required">*</span>{/if}
</label>
@@ -42,7 +42,7 @@
{form_field form=$form field="address1"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d="pointretrait"}
{intl l=$label d="clickandcollect"}
{if $required}<span class="required">*</span>{/if}
</label>
@@ -56,7 +56,7 @@
{form_field form=$form field="address2"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d="pointretrait"}
{intl l=$label d="clickandcollect"}
{if $required}<span class="required">*</span>{/if}
</label>
@@ -70,7 +70,7 @@
{form_field form=$form field="zipcode"}
<div class="form-group form-inline">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d="pointretrait"}
{intl l=$label d="clickandcollect"}
{if $required}<span class="required">*</span>{/if}
</label>
@@ -84,7 +84,7 @@
{form_field form=$form field="city"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d="pointretrait"}
{intl l=$label d="clickandcollect"}
{if $required}<span class="required">*</span>{/if}
</label>
@@ -99,4 +99,8 @@
<input type="hidden" id="{$label_attr.for}" name="{$name}" value="1"/>
{/form_field}
{form_field form=$form field="click_and_collect"}
<input type="hidden" id="{$label_attr.for}" name="{$name}" value="1"/>
{/form_field}
{/form}

View File

@@ -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"}
<div class="form-group hidden">
@@ -50,7 +50,7 @@
{form_error form=$form field="begin_time"}{$message}{/form_error}
<div class='input-group time' id="{$label_attr.for}">
<input type='text' class="form-control" name="{$name}" value="{$BEGIN|default:"14:00"}"/>
<input type='text' class="form-control" name="{$name}" value="{$BEGIN|default:"08:00"}"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>
@@ -66,7 +66,7 @@
{form_error form=$form field="end_time"}{$message}{/form_error}
<div class='input-group time' id="{$label_attr.for}">
<input type='text' class="form-control" name="{$name}" value="{$END|default:"16:00"}"/>
<input type='text' class="form-control" name="{$name}" value="{$END|default:"18:00"}"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>

View File

@@ -1,4 +1,4 @@
{form name='pdr.place.view.main'}
{form name='cnc.place.view.main'}
<div class="form-container">
{if $form_error}
@@ -6,14 +6,14 @@
{/if}
{loop name="places" type="pdr_places" id="$place_id"}
<form action="{url path='/admin/module/PointRetrait/edit' place_id=$place_id}" method="POST" class="clearfix" {form_enctype form=$form}>
<form action="{url path='/admin/module/ClickAndCollect/edit' place_id=$place_id}" method="POST" class="clearfix" {form_enctype form=$form}>
{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'}"
close_url = "{url path='/admin/module/PointRetrait'}"
page_url = "{url path='/admin/module/ClickAndCollect/edit&place_id=$place_id'}"
close_url = "{url path='/admin/module/ClickAndCollect'}"
current_tab = "main"
}
@@ -26,7 +26,7 @@
{form_field form=$form field="title"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d='pointretrait'}
{intl l=$label d='clickandcollect'}
</label>
<input type="text" id="{$label_attr.for}" class="form-control large" name="{$name}" value="{$TITLE}" {if $required}required{/if} />&nbsp
</div>
@@ -38,7 +38,7 @@
{form_field form=$form field="active"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d="pointretrait"}
{intl l=$label d="clickandcollect"}
</label>
<div class="make-switch switch-small toggle-active" data-id="{$ID}" data-on="success"
@@ -49,17 +49,21 @@
<input type="hidden" id="{$label_attr.for}" name="{$name}" value="{$ACTIVE}"/>
</div>
{/form_field}
{form_field form=$form field="click_and_collect"}
<input type="hidden" value="1" id="{$label_attr.for}" name="{$name}">
{/form_field}
</div>
<div class="col-md-2">
{form_field form=$form field="price"}
<div class="form-group form-inline">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d="pointretrait"}
{intl l=$label d="clickandcollect"}
{if $required}<span class="required">*</span>{/if}
</label>
<input type="text" id="{$label_attr.for}" class="form-control etroit" name="{$name}" value="{$PRICE}" {if $required}required{/if} />&nbsp;
<input type="text" id="{$label_attr.for}" class="form-control etroit" name="{$name}" value="{$PRICE}" {if $required}required{/if} />
</div>
{form_error form=$form field="price"}{$message}{/form_error}
{/form_field}
@@ -69,11 +73,11 @@
{form_field form=$form field="minimum_amount"}
<div class="form-group form-inline">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d="pointretrait"}
{intl l=$label d="clickandcollect"}
{if $required}<span class="required">*</span>{/if}
</label>
<input type="text" id="{$label_attr.for}" class="form-control etroit" name="{$name}" value="{$MINIMUM_AMOUNT}" {if $required}required{/if} />&nbsp;
<input type="text" id="{$label_attr.for}" class="form-control etroit" name="{$name}" value="{$MINIMUM_AMOUNT}" {if $required}required{/if} />
</div>
{form_error form=$form field="minimum_amount"}{$message}{/form_error}
{/form_field}
@@ -86,7 +90,7 @@
{form_field form=$form field="address1"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d="pointretrait"}
{intl l=$label d="clickandcollect"}
{if $required}<span class="required">*</span>{/if}
</label>
@@ -104,7 +108,7 @@
{form_field form=$form field="address2"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d="pointretrait"}
{intl l=$label d="clickandcollect"}
{if $required}<span class="required">*</span>{/if}
</label>
@@ -122,7 +126,7 @@
{form_field form=$form field="zipcode"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d="pointretrait"}
{intl l=$label d="clickandcollect"}
{if $required}<span class="required">*</span>{/if}
</label>
@@ -137,7 +141,7 @@
{form_field form=$form field="city"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d="pointretrait"}
{intl l=$label d="clickandcollect"}
{if $required}<span class="required">*</span>{/if}
</label>
@@ -155,22 +159,22 @@
{form_field form=$form field="access_comment"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d="pointretrait"}
{intl l=$label d="clickandcollect"}
{if $required}<span class="required">*</span>{/if}
</label>
<div class="control-input">
<textarea id="{$label_attr.for}" name="{$name}" maxlength="400" class="form-control">{if $form_error}{$value}{/if}{$ACCESS_COMMENT}</textarea>
</div>
<span class="help-block">{intl l="Access comment help" d="pointretrait"}</span>
<span class="help-block">{intl l="Access comment help" d="clickandcollect"}</span>
</div>
{form_error form=$form field="access_comment"}{$message}{/form_error}
{/form_field}
</div>
<div class="col-md-4">
<div class="bouton-geoloc">
<img src="{image file='assets/img/compass.svg' source='PointRetrait'}" alt="Geolocate" id="submit-geoloc"/>
<span>{intl l="Recenter map" d="pointretrait"}</span>
<img src="{image file='assets/img/compass.svg' source='ClickAndCollect'}" alt="Geolocate" id="submit-geoloc"/>
<span>{intl l="Recenter map" d="clickandcollect"}</span>
</div>
{form_field form=$form field="latitude"}
<input type="hidden" value="{$LATITUDE}" id="{$label_attr.for}" name="{$name}">

View File

@@ -1,18 +1,18 @@
{form name='pdr.place.view.schedule'}
{form name='cnc.place.view.schedule'}
<div class="form-container">
{if $form_error}
<div class="alert alert-danger">{$form_error_message}</div>
{/if}
<form action="{url path="/admin/module/PointRetrait/edit?place_id={$place_id}"}" method="POST" class="clearfix" {form_enctype form=$form}>
<form action="{url path="/admin/module/ClickAndCollect/edit?place_id={$place_id}"}" method="POST" class="clearfix" {form_enctype form=$form}>
{form_hidden_fields form=$form}
{include
file = "includes/inner-form-toolbar.html"
hide_flags = true
hide_submit_buttons = true
close_url = "{url path='/admin/module/PointRetrait'}"
close_url = "{url path='/admin/module/ClickAndCollect'}"
current_tab = "schedule"
}
@@ -26,10 +26,10 @@
<table class="table table-striped table-condensed">
<caption class="clearfix">
{loop name="auth-create" type="auth" role="ADMIN" resource="admin.pdr.schedule" access="CREATE" module="ClickAndCollect"}
{loop name="auth-create" type="auth" role="ADMIN" resource="admin.cnc.schedule" access="CREATE" module="ClickAndCollect"}
<div class="pull-right">
<a class="btn btn-default btn-primary place-schedule-create"
title="{intl l='Add a new withdrawal day' d='pointretrait'}"
title="{intl l='Add a new opening day' d='clickandcollect'}"
data-target="#place-schedule-create" data-toggle="modal">
<i class="glyphicon glyphicon-plus-sign"></i>
</a>
@@ -39,10 +39,10 @@
<thead>
<tr>
<th>{intl l="Withdrawal day" d="pointretrait"}</th>
<th>{intl l="Withdrawal beginning time" d="pointretrait"}</th>
<th>{intl l="Withdrawal ending time" d="pointretrait"}</th>
<th>{intl l="Actions" d="pointretrait"}</th>
<th>{intl l="Working day" d="clickandcollect"}</th>
<th>{intl l="Start time" d="clickandcollect"}</th>
<th>{intl l="End time" d="clickandcollect"}</th>
<th>{intl l="Actions" d="clickandcollect"}</th>
</tr>
</thead>
@@ -55,9 +55,9 @@
{* Actions *}
<td>
<div class="btn-group">
{loop name="auth-edit" type="auth" role="ADMIN" resource="admin.pdr.schedule" access="UPDATE" module="ClickAndCollect"}
{loop name="auth-edit" type="auth" role="ADMIN" resource="admin.cnc.schedule" access="UPDATE" module="ClickAndCollect"}
<a class="btn btn-info btn-responsive place-schedule-update-default"
title="{intl l='Edit this withdrawal day' d='pointretrait'}"
title="{intl l='Edit this working day' d='clickandcollect'}"
data-target="#place-schedule-update" data-toggle="modal" data-id="{$ID}"
data-day="{$DAY}"
data-begin="{format_date date=$BEGIN format='H:i'}"
@@ -65,9 +65,9 @@
<i class="glyphicon glyphicon-edit"></i>
</a>
{/loop}
{loop name="auth-delete" type="auth" role="ADMIN" resource="admin.pdr.schedule" access="DELETE" module="ClickAndCollect"}
{loop name="auth-delete" type="auth" role="ADMIN" resource="admin.cnc.schedule" access="DELETE" module="ClickAndCollect"}
<a class="btn btn-danger btn-responsive place-schedule-delete"
title="{intl l='Delete this withdrawal day' d='pointretrait'}"
title="{intl l='Delete this working day' d='clickandcollect'}"
data-target="#place-schedule-delete" data-toggle="modal" data-id="{$ID}">
<i class="glyphicon glyphicon-trash"></i>
</a>
@@ -81,7 +81,7 @@
<tr>
<td colspan="1000">
<div class="alert alert-info">
{intl l="There is no schedule for this place" d="pointretrait"}
{intl l="There is no schedule for this place" d="clickandcollect"}
</div>
</td>
</tr>

View File

@@ -33,7 +33,6 @@
marker = new google.maps.Marker({
position: new google.maps.LatLng($("#latitude").val(), $("#longitude").val()),
map: map,
draggable: true,
title: $(document.getElementById("title")).val()
});
}
@@ -53,8 +52,7 @@
resultsMap.setCenter(results[0].geometry.location);
marker = new google.maps.Marker({
map: resultsMap,
position: results[0].geometry.location,
draggable: true
position: results[0].geometry.location
});
$("#latitude").val(results[0].geometry.location.lat);
$("#longitude").val(results[0].geometry.location.lng);

View File

@@ -1,3 +1,3 @@
<li class="{if $admin_current_location == 'clickandcollect'}active{/if}" id="clickandcollect">
<a title="{intl l='Module name' d='clickandcollect'}" href="{url path='/admin/module/ClickAndCollect'}" ><span class="glyphicon glyphicon-pushpin"></span> {intl l='Module name' d='clickandcollect'}</a>
<a title="{intl l='Module name' d='clickandcollect'}" href="{url path='/admin/module/ClickAndCollect'}" ><span class="glyphicon glyphicon-home"></span> {intl l='Module name' d='clickandcollect'}</a>
</li>

View File

@@ -1,23 +1,23 @@
{* DELETE modal *}
{capture "schedule_delete"}
{intl l="Do you really want to remove this schedule entry ?" d="pointretrait"}
{intl l="Do you really want to remove this schedule entry ?" d="clickandcollect"}
<input type="hidden" name="schedule_id" id="attr-place-schedule-id-delete" value=""/>
<input type="hidden" name="place_id" value="{$smarty.get.place_id}"/>
<input type="hidden" name="success_url" value="{url path="/admin/module/PointRetrait/edit?area_id={$area_id}#schedule"}"/>
<input type="hidden" name="success_url" value="{url path="/admin/module/ClickAndCollect/edit?area_id={$area_id}#schedule"}"/>
{/capture}
{include file="includes/generic-confirm-dialog.html"
dialog_id = "place-schedule-delete"
dialog_title = {intl l="Delete an entry of schedule" d="pointretrait"}
dialog_title = {intl l="Delete an entry of schedule" d="clickandcollect"}
dialog_message = {$smarty.capture.schedule_delete nofilter}
dialog_ok_label = {intl l="Delete"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {token_url path='/admin/module/PointRetrait/schedule/delete'}
form_action = {token_url path='/admin/module/ClickAndCollect/schedule/delete'}
}
{* UPDATE Modal*}
{form name="pdr.place.update.schedule"}
{form name="cnc.place.update.schedule"}
{capture "schedule_update"}
{form_field form=$form field="place-schedule_id"}
<input type="hidden" name="schedule_id" id="attr-place-schedule-id-update" value=""/>
@@ -26,34 +26,34 @@
<input type="hidden" name="place_id" id="place_id" value="{$smarty.get.place_id}"/>
{/form_field}
{include file="form/place-schedule-create.html" form_name="pdr.place.update.schedule" update=true}
{include file="form/cnc-place-schedule-create.html" form_name="cnc.place.update.schedule" update=true}
{/capture}
{include file="includes/generic-create-dialog.html"
dialog_id = "place-schedule-update"
dialog_title = {intl l="Edit this withdrawal day" d="pointretrait"}
dialog_title = {intl l="Edit this opening day" d="clickandcollect"}
dialog_body = {$smarty.capture.schedule_update nofilter}
dialog_ok_label = {intl l="Save"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {url path='admin/module/PointRetrait/schedule/update'}
form_action = {url path='admin/module/ClickAndCollect/schedule/update'}
form_enctype = {form_enctype form=$form}
}
{/form}
{* CREATE Modal *}
{form name="pdr.place.create.schedule"}
{form name="cnc.place.create.schedule"}
{capture "schedule_create"}
{include file="form/place-schedule-create.html" form_name="pdr.place.create.schedule" place_id=$smarty.get.place_id}
{include file="form/cnc-place-schedule-create.html" form_name="cnc.place.create.schedule" place_id=$smarty.get.place_id}
{/capture}
{include file="includes/generic-create-dialog.html"
dialog_id = "place-schedule-create"
dialog_title = {intl l="Add a new withdrawal day" d="pointretrait"}
dialog_title = {intl l="Add a new opening day" d="clickandcollect"}
dialog_body = {$smarty.capture.schedule_create nofilter}
dialog_ok_label = {intl l="Create"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {url path="admin/module/PointRetrait/schedule/create"}
form_action = {url path="admin/module/ClickAndCollect/schedule/create"}
form_enctype = {form_enctype form=$form}
}
{/form}

View File

@@ -18,20 +18,41 @@
height:450px;
width:100%;
}
/********************************************/
tr.ligne-cnc {
border-top: 2px solid gray !important;
border-bottom: 1px solid gray !important;
}
tr.ligne-cnc:nth-child(1) {
background-color: #f5f5f5;
}
tr.ligne-cnc:nth-child(1) .creneau > td {
background-color: white;
}
tr.ligne-cnc:nth-child(2) {
background-color: white;
}
tr.ligne-cnc > td:first-child {
border-left: 1px solid gray !important;
}
tr.ligne-cnc > td:last-child {
border-right: 1px solid gray !important;
}
tr.ligne-cnc td {
padding: 5px !important;
}
tr.ligne-pdr > td {
border: 1px solid gray !important;
}
.ligne-pdr > td {
padding: 5px !important;
}
.creneau > td {
text-align: left !important;
font-size: 1.2rem;
padding: 2px 0 2px 20px !important;
}
.creneau:first-child > td {
padding-top: 10px !important;
}
div.titre-pdr {
div.titre-cnc {
font-size: 1.6rem;
color: #e74c3c;
font-weight: 600;
@@ -46,7 +67,11 @@ div.titre-pdr {
}
.table-schedule {
background-color: #f5f5f5 !important;
border-color: white !important;
border: none !important;
}
.cnc-bouton-radio {
vertical-align:middle !important;
text-align: center !important;
}
.img-pin {
@@ -63,3 +88,11 @@ span.pin-number {
color: #e74c3c;
font-weight: 600;
}
.next-date {
color: #e74c3c;
font-weight: 400;
}
.next-date .b {
font-weight: 900;
}

View File

@@ -2,7 +2,7 @@
<div class="panel panel-default col-sm-6">
{loop type="pdr_places" name="place-loop" id={$place_id}}
<div class="panel-heading">{intl l="Order to withdraw" d="pointretrait"}</div>
<div class="panel-heading">{intl l="Order to withdraw" d="clickandcollect"}</div>
<div class="panel-body">
<span class="org"><strong>{$TITLE}</strong></span>
<address class="adr">
@@ -15,9 +15,9 @@
</div>
{/loop}
<div class="panel-heading">{intl l="Scheduled date" d="clickandcollect"}</div>
<div class="panel-heading">{intl l="Starting date" d="clickandcollect"}</div>
<div class="panel-body">
<span>{$day} entre {format_date date=$begin_time format="H\hi"} et {format_date date=$end_time format="H\hi"}</span>
<span>{$day}</span>
</div>
</div>

View File

@@ -1,16 +1,17 @@
<script type="text/html" id="pdr_ui">
<script type="text/html" id="cnc_ui">
{loop type="pdr_places" name="places-first-loop"}
{assign var=module_id value=$MODULE_ID}
{loop type="delivery" name="cnc-delivery-loop" code="clickandcollect"}
{assign var=cnc_module_id value=$ID}
{/loop}
<td colspan="3">
<div class="row">
<div class="col-sm-4">
{form name="thelia.order.delivery"}
{form_field field='delivery-module'}
<label for="delivery-method_{$module_id}">
<input type="radio" delivery-mode="cnc" name="{$name}" id="delivery-method_{$module_id}" value="{$module_id}">
<label for="delivery-method_{$cnc_module_id}">
<input type="radio" delivery-mode="cnc" name="{$name}" id="delivery-method_{$cnc_module_id}" value="{$cnc_module_id}">
<strong>{intl l="Module name - customer" d="clickandcollect"}</strong>
<br>
</label>
@@ -20,15 +21,17 @@
<div class="col-sm-4">&nbsp;</div>
</div>
<div class="row message-explicatif">{intl l="Message explicatif" d="clickandcollect"}</div>
<div class="row" id="select-cnc">
<div class="col-md-5">
{form name="thelia.order.delivery"}
<div class="table-responsive" style="border: 0px solid gray">
<table class="table table-condensed table-main">
{loop type="pdr_places" name="places-loop" active=true click_and_collect=1 order="city"}
<tr class="ligne-pdr">
{loop type="pdr_places" name="places-loop-cnc" active=true click_and_collect=1 order="city"}
<tr class="ligne-cnc">
<td>
<div class="titre-pdr"><img src="{image file='assets/img/pin.png' source='ClickAndCollect'}" class="img-pin"><span class="pin-number">{$ID}</span>{$TITLE}</div>
<div class="titre-cnc"><img src="{image file='assets/img/pin.png' source='ClickAndCollect'}" class="img-pin"><span class="pin-number">{$ID}</span>{$TITLE}</div>
<span class="adresse">{$ADDRESS1}</span><br>
<span class="adresse">{$ZIPCODE} {$CITY}</span><br>
{if {cart attr='total_taxed_price_without_discount'} < $MINIMUM_AMOUNT}
@@ -37,15 +40,22 @@
</div>
{else}
<table class="table table-schedule">
{assign var="nextDate" value=""}
{loop type="pdr_schedule" name="schedule-loop" place_id={$ID}}
<tr class="creneau">
<td style="padding:10px; text-align: center">{$DAY_LABEL} {$CALCULATED_DAY} {format_date date=$BEGIN format="H\hi"} à {format_date date=$END format="H\hi"}</td>
<td style="padding:10px; text-align: center"><input type="radio" name="pdr-choosen-day" value="{$ID}"{if {cart attr='total_taxed_price_without_discount'} < $MINIMUM_AMOUNT} disabled{/if} /></td>
<td>{$DAY_LABEL}</td>
<td>{format_date date=$BEGIN format="H\hi"}</td>
<td>{format_date date=$END format="H\hi"}</td>
</tr>
{if $nextDate eq ''}
{assign var="nextDate" value="$DAY_LABEL $CALCULATED_DAY"}
{/if}
{/loop}
</table>
{/if}
<div class="next-date">{intl l="Message availability" d="clickandcollect"}&nbsp;<b>{$nextDate}</b></div>
<div class="price">
{if $PRICE > 0}
{format_number number=$PRICE}
@@ -54,6 +64,7 @@
{/if}
</div>
</td>
<td class="cnc-bouton-radio"><input type="radio" name="cnc-choosen-place" value="{$ID}"{if {cart attr='total_taxed_price_without_discount'} < $MINIMUM_AMOUNT} disabled{/if} /></td>
</tr>
{/loop}
</table>
@@ -61,11 +72,11 @@
{/form}
</div>
<div class="col-md-7">
<input type="hidden" id="map-center-lat" value={{module_config module='PlanificationLivraison' key='map_center_latitude' locale='en_US'}|default:50.75075530537203} />
<input type="hidden" id="map-center-lon" value={{module_config module='PlanificationLivraison' key='map_center_longitude' locale='en_US'}|default:2.252608244005041} />
<input type="hidden" id="map-center-lat-cnc" value={{module_config module='PlanificationLivraison' key='map_center_latitude' locale='en_US'}|default:50.75075530537203} />
<input type="hidden" id="map-center-lon-cnc" value={{module_config module='PlanificationLivraison' key='map_center_longitude' locale='en_US'}|default:2.252608244005041} />
<table id="coordinates" class="hidden">
{loop type="pdr_places" name="places-loop" active=true order="city"}
<table id="coordinates-cnc" class="hidden">
{loop type="pdr_places" name="places-loop-cnc" active=true click_and_collect=1 order="city"}
<tr>
<td>{$ID}
<td>{$LATITUDE}</td>
@@ -84,28 +95,20 @@
<script>
// Masquer par défaut les options du mode PDR
// Masquer par défaut les options du mode CNC
$(document).ready(function(){
$("#delivery-module-{$module_id}").html($('#cnc_ui').html());
$("#delivery-module-{$cnc_module_id}").html($('#cnc_ui').html());
$('#select-cnc').slideUp('fast');
});
// Gestion du pliage/dépliage du mode PDR
// Gestion du pliage/dépliage du mode CNC
$('input[type=radio][delivery-mode]').click(function() {
$('div[id^="select"]').not($('#select-' + $(this).attr('delivery-mode'))).slideUp();
$('#select-' + $(this).attr('delivery-mode')).slideDown('fast');
});
function loadScript() {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = "https://maps.googleapis.com/maps/api/js?callback=initMap" +
"&key={module_config module='PlanificationLivraison' key='googlemap_api_key' locale='en_US'}";
document.body.appendChild(script);
}
function initMap() {
function initMapCnc() {
const LIMITES = {
north: 50.85043724044059,
east: 2.6869845409159923,
@@ -114,7 +117,7 @@
};
var opt = {
center: new google.maps.LatLng($("#map-center-lat").val(), $("#map-center-lon").val()),
center: new google.maps.LatLng($("#map-center-lat-cnc").val(), $("#map-center-lon-cnc").val()),
zoom: 12,
streetViewControl: true,
mapTypeControl: true,
@@ -124,21 +127,21 @@
}
};
Data.map = new google.maps.Map(document.getElementById('cnc_map'), opt);
DataCnc.map = new google.maps.Map(document.getElementById('cnc_map'), opt);
displayPins();
displayPinsCnc();
}
function displayPins() {
function displayPinsCnc() {
var arrays = [];
$('#coordinates').eq(0).find('tr').each((r,row) => arrays.push($(row).find('td,th').map((c,cell) => $(cell).text()).toArray()))
$('#coordinates-cnc').eq(0).find('tr').each((r,row) => arrays.push($(row).find('td,th').map((c,cell) => $(cell).text()).toArray()))
arrays.forEach(function(place) {
var marker = new google.maps.Marker({
title: place[3],
label: place[0],
position: new google.maps.LatLng(place[1], place[2]),
map: Data.map
map: DataCnc.map
});
});
@@ -147,17 +150,12 @@
/*********************************************************/
var Data = {
var DataCnc = {
markers: [],
map: null,
geocoder: null,
bounds: null
};
if (typeof(google) === 'undefined') {
loadScript();
} else {
initMap();
}
</script>

View File

@@ -52,7 +52,6 @@ class AreaLoop extends BaseLoop implements PropelSearchLoopInterface
->set("MINIMUM_AMOUNT", $lps_area->getMinimumAmount())
->set("DELIVERY_DAYS", $deliveryDays)
->set("COVERED_CITIES_NUMBER", $citiesCount)
->set("MODULE_ID", LivraisonParSecteurs::getModuleId())
;
$loopResult->addRow($loopResultRow);
}

View File

@@ -1,3 +1,3 @@
<li class="{if $admin_current_location == 'livraisonparsecteurs'}active{/if}" id="livraisonparsecteurs">
<a title="{intl l='Module name' d='livraisonparsecteurs'}" href="{url path='/admin/module/LivraisonParSecteurs'}" ><span class="glyphicon glyphicon-home"></span> {intl l='Module name' d='livraisonparsecteurs'}</a>
<a title="{intl l='Module name' d='livraisonparsecteurs'}" href="{url path='/admin/module/LivraisonParSecteurs'}" ><span class="glyphicon glyphicon-road"></span> {intl l='Module name' d='livraisonparsecteurs'}</a>
</li>

View File

@@ -5,15 +5,18 @@
{loop type="lps_area" name="area-loop" id={$area_id}}
{assign var=livraison value=$PRICE}
{assign var=minimum value=$MINIMUM_AMOUNT}
{assign var=module_id value=$MODULE_ID}
{/loop}
{loop type="delivery" name="lps-delivery-loop" code="livraisonparsecteurs"}
{assign var=lps_module_id value=$ID}
{/loop}
<div class="row">
<div class="col-sm-4">
{form name="thelia.order.delivery"}
{form_field field='delivery-module'}
<label for="delivery-method_{$module_id}">
<input type="radio" delivery-mode="lps" name="{$name}" id="delivery-method_{$module_id}" value="{$module_id}">
<label for="delivery-method_{$lps_module_id}">
<input type="radio" delivery-mode="lps" name="{$name}" id="delivery-method_{$lps_module_id}" value="{$lps_module_id}">
<strong>{intl l="Module name - customer" d="livraisonparsecteurs"}</strong>
<br>
</label>
@@ -71,7 +74,7 @@
// Masquer par défaut les options du mode LPS
$(document).ready(function(){
$("#delivery-module-{$module_id}").html($('#lps_ui').html());
$("#delivery-module-{$lps_module_id}").html($('#lps_ui').html());
$('#select-lps').slideUp('fast');
});

View File

@@ -2,6 +2,7 @@
namespace PlanificationLivraison\EventListeners;
use ClickAndCollect\ClickAndCollect;
use DateTime;
use LivraisonParSecteurs\LivraisonParSecteurs;
use LivraisonParSecteurs\Model\LpsAreaScheduleQuery;
@@ -94,6 +95,24 @@ class DeliveryListener extends BaseAction implements EventSubscriberInterface
$session->set('pdrData', $sessionData);
}
}
if ($module == ClickAndCollect::getModuleId()) {
if (null !== $placeId = $request->get('cnc-choosen-place', null)) {
$sessionData = new SessionData();
$sessionData->setPlaceId($placeId);
// On sauvegarde la date de disponibilité, pour affichage ultérieur.
$now = new DateTime();
$today = $now->format('w');
$chosenDate = PlanificationLivraison::calculateRelativeDate($today);
$completeDay = PlanificationLivraison::getDayLabel($today);
$completeDay .= " " . $chosenDate->format(PlanificationLivraison::FORMAT_DATES);
$sessionData->setDeliveryDate($completeDay);
$session->set('cncData', $sessionData);
}
}
}
}
@@ -110,15 +129,23 @@ class DeliveryListener extends BaseAction implements EventSubscriberInterface
$deliveryModuleId = $order->getDeliveryModuleId();
if ($deliveryModuleId == LivraisonParSecteurs::getModuleId()
|| $deliveryModuleId == PointRetrait::getModuleId())
|| $deliveryModuleId == PointRetrait::getModuleId()
|| $deliveryModuleId == ClickAndCollect::getModuleId())
{
if ($deliveryModuleId == LivraisonParSecteurs::getModuleId())
$sessionData = $session->get('lpsData');
else
$sessionData = $session->get('pdrData');
switch ($deliveryModuleId) {
case LivraisonParSecteurs::getModuleId() :
$sessionData = $session->get('lpsData');
break;
case PointRetrait::getModuleId() :
$sessionData = $session->get('pdrData');
break;
case ClickAndCollect::getModuleId() :
$sessionData = $session->get('cncData');
break;
}
if ($sessionData === null)
throw new TheliaProcessException("PlanificationLivraison : Données de session vides : " . $event->getMessage());
throw new TheliaProcessException("PlanificationLivraison : Données de session vides : ");
$con = Propel::getConnection();
$con->beginTransaction();

View File

@@ -12,6 +12,8 @@ class PlanificationLivraison extends BaseModule
{
/** @var string */
const DOMAIN_NAME = 'planificationlivraison';
const FORMAT_DATES = 'd/m/Y';
const FORMAT_DATE_COMPLETE = 'Y-m-d H:i:s';
const CONFIG_API_KEY = 'googlemap_api_key';
const CONFIG_MAP_CENTER_LAT = 'map_center_latitude';
@@ -20,9 +22,6 @@ class PlanificationLivraison extends BaseModule
const CONFIG_ORANGE_ALERT = 'delay_orange_alert';
const CONFIG_PREPARATION_DELAY = 'orders_preparation_delay';
const FORMAT_DATES = 'd/m/Y';
const FORMAT_DATE_COMPLETE = 'Y-m-d H:i:s';
/**
* @param ConnectionInterface|null $con

View File

@@ -20,7 +20,8 @@ return array(
'Free' => 'Gratuit',
'Location set' => 'Coordonnées GPS présentes ?',
'Main' => 'Généralités',
'Message no location' => 'Ce point de retrait ne possède pas de coordonnées GPS : pour vos clients, il est conseillé de géolocaliser l\'adresse.',
'Message explicatif' => 'Il est possible de récupérer votre commande directement auprès de nous, lors d\'une de nos tournées.',
'Message no location' => 'Ce point de retrait ne possède pas de coordonnées GPS : pour vos clients, il est conseillé de géolocaliser son adresse.',
'Message info minimum de commande' => 'Vous n\'avez pas atteint le minimum de commande de %minimum € sur ce point de retrait.',
'Minimum amount' => 'Minimum de commande',
'Module name' => 'Point de retrait AuxBieauxLegumes',

View File

@@ -59,7 +59,6 @@ class GeneralLoop extends BaseLoop implements PropelSearchLoopInterface
->set("ZIPCODE", $places->getZipcode())
->set("CITY", $places->getCity())
->set("ACCESS_COMMENT", $places->getAccessComment())
->set("MODULE_ID", PointRetrait::getModuleId())
;
$loopResult->addRow($loopResultRow);
}

View File

@@ -67,10 +67,10 @@
<td>{$MINIMUM_AMOUNT} €</td>
<td class="actions">
<div class="btn-group" role="group">
<a class="btn btn-info btn-responsive" title="{intl l='Edit this place'}" href="{url path="/admin/module/PointRetrait/edit?place_id=$ID"}">
<a class="btn btn-info btn-responsive" title="{intl l='Edit this place' d='pointretrait'}" href="{url path="/admin/module/PointRetrait/edit?place_id=$ID"}">
<i class="glyphicon glyphicon-edit"></i>
</a>
<a class="btn btn-danger btn-responsive place-delete" title="{intl l='Delete this place'}" data-target="#place-delete" data-toggle="modal" data-id="{$ID}">
<a class="btn btn-danger btn-responsive place-delete" title="{intl l='Delete this place' d='pointretrait'}" data-target="#place-delete" data-toggle="modal" data-id="{$ID}">
<i class="glyphicon glyphicon-trash"></i>
</a>
</div>

View File

@@ -63,3 +63,11 @@ span.pin-number {
color: #e74c3c;
font-weight: 600;
}
.message-explicatif {
font-style: italic;
font-weight: 400;
margin: auto 60px 15px 30px;
text-align: left;
white-space: nowrap;
}

View File

@@ -1,18 +1,17 @@
<script type="text/html" id="pdr_ui">
{loop type="pdr_places" name="places-first-loop"}
{assign var=module_id value=$MODULE_ID}
{loop type="delivery" name="pdr-delivery-loop" code="pointretrait"}
{assign var=pdr_module_id value=$ID}
{/loop}
<td colspan="3">
<td colspan="3">
<div class="row">
<div class="col-sm-4">
{form name="thelia.order.delivery"}
{form_field field='delivery-module'}
<label for="delivery-method_{$module_id}">
<input type="radio" delivery-mode="pdr" name="{$name}" id="delivery-method_{$module_id}" value="{$module_id}">
<strong>{intl l="Module name - customer" d="pointretrait"}</strong>
<br>
<label for="delivery-method_{$pdr_module_id}">
<input type="radio" delivery-mode="pdr" name="{$name}" id="delivery-method_{$pdr_module_id}" value="{$pdr_module_id}">
<strong>{intl l="Module name - customer" d="pointretrait"}</strong><br>
</label>
{/form_field}
{/form}
@@ -20,6 +19,8 @@
<div class="col-sm-4">&nbsp;</div>
</div>
<div class="row message-explicatif">{intl l="Message explicatif" d="pointretrait"}</div>
<div class="row" id="select-pdr">
<div class="col-md-5">
{form name="thelia.order.delivery"}
@@ -86,7 +87,7 @@
// Masquer par défaut les options du mode PDR
$(document).ready(function(){
$("#delivery-module-{$module_id}").html($('#pdr_ui').html());
$("#delivery-module-{$pdr_module_id}").html($('#pdr_ui').html());
$('#select-pdr').slideUp('fast');
});
@@ -100,11 +101,17 @@
function loadScript() {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = "https://maps.googleapis.com/maps/api/js?callback=initMap" +
script.src = "https://maps.googleapis.com/maps/api/js?callback=initMaps" +
"&key={module_config module='PlanificationLivraison' key='googlemap_api_key' locale='en_US'}";
document.body.appendChild(script);
}
function initMaps() {
initMap();
initMapCnc();
}
function initMap() {
const LIMITES = {
north: 50.85043724044059,
@@ -157,7 +164,7 @@
if (typeof(google) === 'undefined') {
loadScript();
} else {
initMap();
initMaps();
}
</script>

View File

@@ -272,6 +272,7 @@
{* delivery module can customize the delivery address *}
{hook name="order-invoice.delivery-address" modulecode="LivraisonParSecteurs"}
{hook name="order-invoice.delivery-address" modulecode="PointRetrait"}
{hook name="order-invoice.delivery-address" modulecode="ClickAndCollect"}
{/ifhook}
{elsehook rel="order-invoice.delivery-address"}
<div class="panel panel-default col-sm-6">