89 lines
3.3 KiB
PHP
89 lines
3.3 KiB
PHP
<?php
|
|
|
|
namespace PlanificationLivraison\Form;
|
|
|
|
use PlanificationLivraison\PlanificationLivraison;
|
|
use Thelia\Form\BaseForm;
|
|
|
|
/**
|
|
* Class Configuration
|
|
* @package PlanificationLivraison\Form
|
|
*/
|
|
class Configuration extends BaseForm
|
|
{
|
|
|
|
protected function buildForm()
|
|
{
|
|
$this->formBuilder
|
|
->add(
|
|
"google_api_key","text",
|
|
array(
|
|
"label" => $this->translator->trans("GoogleMap API key", [], PlanificationLivraison::DOMAIN_NAME),
|
|
"label_attr" => [
|
|
"for" => "attr-google-api-key"
|
|
],
|
|
"required" => true
|
|
))
|
|
->add(
|
|
"map_center_lat","text",
|
|
array(
|
|
"label" => $this->translator->trans("Map Center latitude", [], PlanificationLivraison::DOMAIN_NAME),
|
|
"label_attr" => [
|
|
"for" => "attr-map-center-lat",
|
|
"help" => "Format 99.99999999 ou -99.9999999"
|
|
],
|
|
"required" => true
|
|
))
|
|
->add(
|
|
"map_center_lng","text",
|
|
array(
|
|
"label" => $this->translator->trans("Map Center longitude", [], PlanificationLivraison::DOMAIN_NAME),
|
|
"label_attr" => [
|
|
"for" => "attr-map-center-lng",
|
|
"help" => "Format 99.99999999 ou -99.9999999"
|
|
|
|
],
|
|
"required" => true
|
|
))
|
|
->add(
|
|
"delay_red_alert","number",
|
|
array(
|
|
"label" => $this->translator->trans("Red alert delay", [], PlanificationLivraison::DOMAIN_NAME),
|
|
"label_attr" => [
|
|
"for" => "attr-map-center-lat",
|
|
"help" => $this->translator->trans("Help for red alert", [], PlanificationLivraison::DOMAIN_NAME)
|
|
],
|
|
"required" => true
|
|
))
|
|
->add(
|
|
"delay_orange_alert","number",
|
|
array(
|
|
"label" => $this->translator->trans("Orange alert delay", [], PlanificationLivraison::DOMAIN_NAME),
|
|
"label_attr" => [
|
|
"for" => "attr-delay_orange_alert",
|
|
"help" => $this->translator->trans("Help for orange alert", [], PlanificationLivraison::DOMAIN_NAME)
|
|
],
|
|
"required" => true
|
|
))
|
|
->add(
|
|
"orders_preparation_delay","number",
|
|
array(
|
|
"label" => $this->translator->trans("Number of days needed for preparation", [], PlanificationLivraison::DOMAIN_NAME),
|
|
"label_attr" => [
|
|
"for" => "attr-orders-preparation-delay",
|
|
"help" => $this->translator->trans("Help for preparation delay", [], PlanificationLivraison::DOMAIN_NAME)
|
|
],
|
|
"required" => true
|
|
)
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @return string the name of you form. This name must be unique
|
|
*/
|
|
public function getName()
|
|
{
|
|
return "planiflivraison_configuration";
|
|
}
|
|
}
|