-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4800 from kuzmany/date-added-to-campaign-condition
New campaign condition: Contacts campaign
- Loading branch information
Showing
6 changed files
with
198 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
app/bundles/LeadBundle/Form/Type/CampaignEventLeadCampaignsType.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<?php | ||
|
||
/* | ||
* @copyright 2014 Mautic Contributors. All rights reserved | ||
* @author Mautic | ||
* | ||
* @link http://mautic.org | ||
* | ||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html | ||
*/ | ||
|
||
namespace Mautic\LeadBundle\Form\Type; | ||
|
||
use Mautic\LeadBundle\Model\ListModel; | ||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\FormBuilderInterface; | ||
|
||
/** | ||
* Class CampaignEventLeadCampaignsType. | ||
*/ | ||
class CampaignEventLeadCampaignsType extends AbstractType | ||
{ | ||
/** | ||
* @var ListModel | ||
*/ | ||
protected $listModel; | ||
|
||
/** | ||
* CampaignEventLeadCampaignsType constructor. | ||
* | ||
* @param ListModel $listModel | ||
*/ | ||
public function __construct(ListModel $listModel) | ||
{ | ||
$this->listModel = $listModel; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function buildForm(FormBuilderInterface $builder, array $options) | ||
{ | ||
$builder->add('campaigns', | ||
'campaign_list', [ | ||
'label' => 'mautic.lead.lead.events.campaigns.membership', | ||
'label_attr' => ['class' => 'control-label'], | ||
'attr' => [ | ||
'class' => 'form-control', | ||
], | ||
'required' => true, | ||
]); | ||
|
||
$builder->add( | ||
'dataAddedLimit', | ||
'yesno_button_group', | ||
[ | ||
'label' => 'mautic.lead.lead.events.campaigns.date.added.filter', | ||
'data' => (isset($options['data']['dataAddedLimit'])) ? $options['data']['dataAddedLimit'] : false, | ||
] | ||
); | ||
|
||
$builder->add( | ||
'expr', | ||
'choice', | ||
[ | ||
'label' => 'mautic.lead.lead.events.campaigns.expression', | ||
'multiple' => false, | ||
'choices' => $this->listModel->getOperatorsForFieldType( | ||
[ | ||
'include' => [ | ||
'gt', | ||
'lt', | ||
], | ||
]), | ||
'required' => false, | ||
'label_attr' => ['class' => 'control-label'], | ||
'attr' => [ | ||
'class' => 'form-control', | ||
'data-show-on' => '{"campaignevent_properties_dataAddedLimit_1":"checked"}', | ||
], | ||
] | ||
); | ||
|
||
$builder->add('dateAdded', 'text', [ | ||
'label' => 'mautic.lead.lead.events.campaigns.date', | ||
'label_attr' => ['class' => 'control-label'], | ||
'attr' => [ | ||
'class' => 'form-control', | ||
'data-toggle' => 'datetime', | ||
'data-show-on' => '{"campaignevent_properties_dataAddedLimit_1":"checked"}', | ||
], | ||
'required' => false, | ||
]); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getName() | ||
{ | ||
return 'campaignevent_lead_campaigns'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...le/Views/FormTheme/ContactCampaignsCondition/campaignevent_lead_campaigns_widget.html.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/* | ||
* @copyright 2014 Mautic Contributors. All rights reserved | ||
* @author Mautic | ||
* | ||
* @link http://mautic.org | ||
* | ||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html | ||
*/ | ||
?> | ||
|
||
<div class="row condition-row"> | ||
<div class="col-xs-12"> | ||
<?php echo $view['form']->row($form['campaigns']); ?> | ||
</div> | ||
</div> | ||
|
||
<div class="row condition-row"> | ||
<div class="col-xs-5"> | ||
<?php echo $view['form']->row($form['dataAddedLimit']); ?> | ||
</div> | ||
<div class="col-xs-3"> | ||
<?php echo $view['form']->row($form['expr']); ?> | ||
</div> | ||
<div class="col-xs-4"> | ||
<?php echo $view['form']->row($form['dateAdded']); ?> | ||
</div> | ||
</div> |