Skip to content

Commit

Permalink
Add missing placeholder in the Private Note textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiix committed Oct 25, 2019
1 parent 6fb9739 commit fc65574
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/PrestaShopBundle/Form/Admin/Sell/Customer/PrivateNoteType.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,28 @@
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Translation\TranslatorInterface;

/**
* Class PrivateNoteType is used to add private notes about customer.
*/
class PrivateNoteType extends AbstractType
{
/**
* @var TranslatorInterface
*/
private $translator;

/**
* PrivateNoteType constructor.
*
* @param TranslatorInterface $translator
*/
public function __construct(TranslatorInterface $translator)
{
$this->translator = $translator;
}

/**
* {@inheritdoc}
*/
Expand All @@ -44,6 +60,9 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add('note', TextareaType::class, [
'required' => false,
'empty_data' => '',
'attr' => [
'placeholder' => $this->translator->trans('Add a note on this customer. It will only be visible to you.', [], 'Admin.Orderscustomers.Feature'),
],
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,13 @@ services:
tags:
- { name: form.type }

form.type.sell.customer.private_note:
class: 'PrestaShopBundle\Form\Admin\Sell\Customer\PrivateNoteType'
arguments:
- "@translator"
tags:
- { name: form.type }

form.type.order.add_order_cart_rule:
class: 'PrestaShopBundle\Form\Admin\Sell\Order\AddOrderCartRuleType'
arguments:
Expand Down

0 comments on commit fc65574

Please sign in to comment.