PointRetrait : OK sur création de créneau et modification
Il reste : - suppression d'un créneau - liste des jours dans places-list.html
This commit is contained in:
@@ -8,10 +8,10 @@ use Thelia\Form\BaseForm;
|
||||
use Symfony\Component\Validator\Constraints;
|
||||
|
||||
/**
|
||||
* Class CreateForm
|
||||
* Class CreatePlaceForm
|
||||
* @package PointRetrait\Form
|
||||
*/
|
||||
class CreateForm extends BaseForm
|
||||
class CreatePlaceForm extends BaseForm
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
@@ -91,6 +91,6 @@ class CreateForm extends BaseForm
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return "place_create";
|
||||
return "pdr-place-create";
|
||||
}
|
||||
}
|
||||
61
local/modules/PointRetrait/Form/CreateScheduleForm.php
Normal file
61
local/modules/PointRetrait/Form/CreateScheduleForm.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace PointRetrait\Form;
|
||||
|
||||
use PointRetrait\PointRetrait;
|
||||
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" => PointRetrait::getDayLabel(null),
|
||||
"label" => $this->translator->trans("Withdrawal day", [], PointRetrait::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("Withdrawal beginning time", [], PointRetrait::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("Withdrawal ending time", [], PointRetrait::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 "pdr-place-create-schedule";
|
||||
}
|
||||
}
|
||||
68
local/modules/PointRetrait/Form/UpdateScheduleForm.php
Normal file
68
local/modules/PointRetrait/Form/UpdateScheduleForm.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace PointRetrait\Form;
|
||||
|
||||
use PointRetrait\PointRetrait;
|
||||
use Thelia\Form\BaseForm;
|
||||
use Symfony\Component\Validator\Constraints;
|
||||
|
||||
/**
|
||||
* Class UpdateScheduleForm
|
||||
* @package PointRetrait\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" => PointRetrait::getDayLabel(null),
|
||||
"label" => $this->translator->trans("Withdrawal day", [], PointRetrait::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("Withdrawal beginning time", [], PointRetrait::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("Withdrawal ending time", [], PointRetrait::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 "pdr-place-update-schedule";
|
||||
}
|
||||
}
|
||||
@@ -9,10 +9,10 @@ use Thelia\Form\BaseForm;
|
||||
|
||||
|
||||
/**
|
||||
* Class MainForm
|
||||
* Class ViewMainForm
|
||||
* @package PointRetrait\Form
|
||||
*/
|
||||
class MainForm extends BaseForm
|
||||
class ViewMainForm extends BaseForm
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
@@ -31,7 +31,7 @@ class MainForm extends BaseForm
|
||||
[
|
||||
"required" => true,
|
||||
"constraints" => [new Constraints\NotBlank(), new Constraints\NotNull()],
|
||||
"label" => $this->translator->trans('Place', [], PointRetrait::DOMAIN_NAME),
|
||||
"label" => $this->translator->trans('Place name', [], PointRetrait::DOMAIN_NAME),
|
||||
"label_attr" => ['for' => 'title']
|
||||
])
|
||||
->add(
|
||||
@@ -114,6 +114,6 @@ class MainForm extends BaseForm
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return "pdr-place-main-update";
|
||||
return "pdr-place-view-main";
|
||||
}
|
||||
}
|
||||
61
local/modules/PointRetrait/Form/ViewScheduleForm.php
Normal file
61
local/modules/PointRetrait/Form/ViewScheduleForm.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace PointRetrait\Form;
|
||||
|
||||
use PointRetrait\PointRetrait;
|
||||
use Thelia\Form\BaseForm;
|
||||
use Symfony\Component\Validator\Constraints;
|
||||
|
||||
/**
|
||||
* Class ViewScheduleForm
|
||||
* @package PointRetrait\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" => PointRetrait::getDayLabel(null),
|
||||
"label" => $this->translator->trans("Delivery day", [], PointRetrait::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", [], PointRetrait::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", [], PointRetrait::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 "pdr-place-view-schedule";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user