[11/05/2025] On remplace les modules Colissimo par le combo ColissimoHomeDelivery + ColissimoPickupPoint + ColissimoLabel
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* Copyright (c) Franck Allimant, CQFDev */
|
||||
/* email : thelia@cqfdev.fr */
|
||||
/* web : http://www.cqfdev.fr */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************/
|
||||
|
||||
/**
|
||||
* Created by Franck Allimant, CQFDev <franck@cqfdev.fr>
|
||||
* Date: 17/08/2019 12:26
|
||||
*/
|
||||
namespace ColissimoHomeDelivery\Form;
|
||||
|
||||
use ColissimoHomeDelivery\ColissimoHomeDelivery;
|
||||
use SimpleDhl\SimpleDhl;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Thelia\Form\BaseForm;
|
||||
|
||||
class ConfigurationForm extends BaseForm
|
||||
{
|
||||
protected function buildForm()
|
||||
{
|
||||
$this->formBuilder
|
||||
->add(
|
||||
ColissimoHomeDelivery::COLISSIMO_USERNAME,
|
||||
'text',
|
||||
[
|
||||
'constraints' => [
|
||||
new NotBlank(),
|
||||
],
|
||||
'label' => $this->translator->trans('Colissimo username', [], ColissimoHomeDelivery::DOMAIN_NAME),
|
||||
'label_attr' => [
|
||||
'help' => $this->translator->trans(
|
||||
'Nom d\'utilisateur Colissimo. C\'est l\'identifiants qui vous permet d’accéder à votre espace client à l\'adresse https://www.colissimo.fr/entreprise',
|
||||
[],
|
||||
ColissimoHomeDelivery::DOMAIN_NAME
|
||||
)
|
||||
]
|
||||
]
|
||||
)
|
||||
->add(
|
||||
ColissimoHomeDelivery::COLISSIMO_PASSWORD,
|
||||
'text',
|
||||
[
|
||||
'constraints' => [
|
||||
new NotBlank(),
|
||||
],
|
||||
'label' => $this->translator->trans('Colissimo password', [], ColissimoHomeDelivery::DOMAIN_NAME),
|
||||
'label_attr' => [
|
||||
'help' => $this->translator->trans(
|
||||
'Le mot de passe qui vous permet d’accéder à votre espace client à l\'adresse https://www.colissimo.fr/entreprise',
|
||||
[],
|
||||
ColissimoHomeDelivery::DOMAIN_NAME
|
||||
)
|
||||
]
|
||||
]
|
||||
)
|
||||
->add(
|
||||
ColissimoHomeDelivery::AFFRANCHISSEMENT_ENDPOINT_URL,
|
||||
'url',
|
||||
[
|
||||
'constraints' => [
|
||||
new NotBlank(),
|
||||
],
|
||||
'label' => $this->translator->trans('Endpoint du web service d\'affranchissement', [], ColissimoHomeDelivery::DOMAIN_NAME),
|
||||
'label_attr' => [
|
||||
'help' => $this->translator->trans(
|
||||
'Indiquez le endpoint de base à utiliser, par exemple https://domain.tld/transactionaldata/api/v1',
|
||||
[],
|
||||
ColissimoHomeDelivery::DOMAIN_NAME
|
||||
)
|
||||
]
|
||||
]
|
||||
)
|
||||
->add(
|
||||
ColissimoHomeDelivery::ACTIVATE_DETAILED_DEBUG,
|
||||
'checkbox',
|
||||
[
|
||||
'required' => false,
|
||||
'label' => $this->translator->trans('Activer les logs détaillés', [], ColissimoHomeDelivery::DOMAIN_NAME),
|
||||
'label_attr' => [
|
||||
'help' => $this->translator->trans(
|
||||
'Si cette case est cochée, le texte complet des requêtes et des réponses figurera dans le log Thelia',
|
||||
[],
|
||||
ColissimoHomeDelivery::DOMAIN_NAME
|
||||
)
|
||||
]
|
||||
]
|
||||
)
|
||||
;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace ColissimoHomeDelivery\Form;
|
||||
|
||||
use ColissimoHomeDelivery\ColissimoHomeDelivery;
|
||||
use ColissimoHomeDelivery\Model\Base\ColissimoHomeDeliveryFreeshippingQuery;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Form\BaseForm;
|
||||
|
||||
class FreeShippingForm extends BaseForm
|
||||
{
|
||||
/**
|
||||
*
|
||||
* in this function you add all the fields you need for your Form.
|
||||
* Form this you have to call add method on $this->formBuilder attribute :
|
||||
*
|
||||
* $this->formBuilder->add("name", "text")
|
||||
* ->add("email", "email", array(
|
||||
* "attr" => array(
|
||||
* "class" => "field"
|
||||
* ),
|
||||
* "label" => "email",
|
||||
* "constraints" => array(
|
||||
* new \Symfony\Component\Validator\Constraints\NotBlank()
|
||||
* )
|
||||
* )
|
||||
* )
|
||||
* ->add('age', 'integer');
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
protected function buildForm()
|
||||
{
|
||||
$this->formBuilder
|
||||
->add(
|
||||
'freeshipping',
|
||||
CheckboxType::class,
|
||||
[
|
||||
'label' => Translator::getInstance()->trans("Activate free shipping: ", [], ColissimoHomeDelivery::DOMAIN_NAME)
|
||||
]
|
||||
)
|
||||
->add(
|
||||
'freeshipping_from',
|
||||
NumberType::class,
|
||||
[
|
||||
'required' => false,
|
||||
'label' => Translator::getInstance()->trans("Free shipping from: ", [], ColissimoHomeDelivery::DOMAIN_NAME),
|
||||
'data' => ColissimoHomeDeliveryFreeshippingQuery::create()->findOneById(1)->getFreeshippingFrom(),
|
||||
'scale' => 2,
|
||||
]
|
||||
)
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string the name of you form. This name must be unique
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return "colissimohomedeliveryfreeshipping";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user