Skip to content

Commit

Permalink
Fix set 0 for required keys
Browse files Browse the repository at this point in the history
  • Loading branch information
kuzmany committed Oct 8, 2018
1 parent 5794b15 commit 5857cda
Showing 1 changed file with 52 additions and 1 deletion.
53 changes: 52 additions & 1 deletion Integration/HinditIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
namespace MauticPlugin\MauticHinditBundle\Integration;

use Mautic\PluginBundle\Integration\AbstractIntegration;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Validator\Constraints\NotBlank;

/**
* Class HinditIntegration.
Expand Down Expand Up @@ -50,11 +52,60 @@ public function getRequiredKeyFields()
'loginID' => 'mautic.plugin.hindit.login.id',
'password' => 'mautic.plugin.hindit.password',
'senderid' => 'mautic.plugin.hindit.sender.id',
'Unicode' => 'mautic.plugin.hindit.unicode',
'route_id' => 'mautic.plugin.hindit.route.id',
];
}

/**
* @param \Mautic\PluginBundle\Integration\Form|FormBuilder $builder
* @param array $data
* @param string $formArea
*/
public function appendToForm(&$builder, $data, $formArea)
{
if ($formArea == 'keys') {

/* @var FormBuilder $builder */
$builder->add(
'Unicode',
TextType::class,
[
'label' => 'mautic.plugin.hindit.unicode',
'required' => true,
'attr' => [
'class' => 'form-control',
],
'constraints' => [
new NotBlank(
[
'message' => 'mautic.core.value.required',
]
),
],
]
);

$builder->add(
'route_id',
TextType::class,
[
'label' => 'mautic.plugin.hindit.route.id',
'required' => true,
'attr' => [
'class' => 'form-control',
],
'constraints' => [
new NotBlank(
[
'message' => 'mautic.core.value.required',
]
),
],
]
);
}
}

/**
* @return array
*/
Expand Down

0 comments on commit 5857cda

Please sign in to comment.