| 1 |
<form id="acym_form" action="<?php echo acym_completeLink(acym_getVar('cmd', 'ctrl')); ?>" method="post" name="acyForm" data-abide novalidate> |
| 2 |
<input type="hidden" name="id" value="<?php echo empty($data['id']) ? '' : intval($data['id']); ?>"> |
| 3 |
<input type="hidden" id="conditions" value="<?php echo acym_escape($data['condition']->conditions); ?>"> |
| 4 |
<input type="hidden" name="stepAutomationId" value="<?php echo empty($data['step_automation_id']) ? '' : intval($data['step_automation_id']); ?>"> |
| 5 |
<input type="hidden" name="conditionId" value="<?php echo empty($data['condition']->id) ? '' : intval($data['condition']->id); ?>"> |
| 6 |
<input type="hidden" id="acym__automation__conditions__count__and" value="0"> |
| 7 |
<input type="hidden" id="acym__automation__conditions__count__or" value="0"> |
| 8 |
|
| 9 |
<div class="acym__content grid-x cell" id="acym__automation__conditions"> |
| 10 |
<?php |
| 11 |
if ('[]' == $data['condition']->conditions) { |
| 12 |
$data['workflowHelper']->disabledAfter = 'condition'; |
| 13 |
} |
| 14 |
echo $data['workflowHelper']->display($this->steps, 'condition'); |
| 15 |
?> |
| 16 |
<div id="acym__automation__or__example" style="display: none;"> |
| 17 |
<h6 class="cell acym__title acym__title__secondary margin-top-1"><?php echo acym_translation('ACYM_OR'); ?></h6> |
| 18 |
<div class="cell grid-x acym__content acym__automation__group__condition" data-condition-number="0"> |
| 19 |
<div class="acym__automation__new__or cell grid-x"> |
| 20 |
<div class="cell auto"></div> |
| 21 |
<i class="acymicon-close acym__color__red acym__automation__delete__group__condition shrink cell cursor-pointer"></i> |
| 22 |
</div> |
| 23 |
<div class="cell grid-x margin-top-2"> |
| 24 |
<button data-condition-type="" type="button" class="button-secondary button medium-shrink acym__automation__add-condition"> |
| 25 |
<?php echo acym_translation('ACYM_ADD_CONDITION'); ?> |
| 26 |
</button> |
| 27 |
</div> |
| 28 |
</div> |
| 29 |
</div> |
| 30 |
<div class="cell grid-x acym__automation__one__condition" id="acym__automation__and__example" style="display: none;"> |
| 31 |
<div class="acym__automation__and cell grid-x margin-top-2"> |
| 32 |
<h6 class="cell medium-shrink small-11 acym__title acym__title__secondary"><?php echo acym_translation('ACYM_AND'); ?></h6> |
| 33 |
<div class="cell medium-4 hide-for-small-only"></div> |
| 34 |
<i class="cell medium-shrink small-1 cursor-pointer acymicon-close acym__color__red acym__automation__delete__one__condition"></i> |
| 35 |
</div> |
| 36 |
<div class="medium-5 cell acym__automation__and__example__classic__select" style="display: none;"> |
| 37 |
<?php |
| 38 |
echo acym_select( |
| 39 |
$data['classic_name'], |
| 40 |
'conditions_name', |
| 41 |
null, |
| 42 |
[ |
| 43 |
'class' => 'acym__automation__select__classic__condition', |
| 44 |
'data-class' => 'acym__select', |
| 45 |
] |
| 46 |
); |
| 47 |
?> |
| 48 |
</div> |
| 49 |
<div class="medium-5 cell acym__automation__and__example__user__select" style="display: none;"> |
| 50 |
<?php |
| 51 |
echo acym_select( |
| 52 |
$data['user_name'], |
| 53 |
'conditions_name', |
| 54 |
null, |
| 55 |
[ |
| 56 |
'class' => 'acym__automation__select__user__condition', |
| 57 |
'data-class' => 'acym__select', |
| 58 |
] |
| 59 |
); |
| 60 |
?> |
| 61 |
</div> |
| 62 |
</div> |
| 63 |
|
| 64 |
<h6 class="acym__title acym__title__secondary cell"> |
| 65 |
<?php echo acym_translation('ACYM_SELECT_YOUR_CONDITIONS').acym_info('ACYM_CONDITIONS_DESC'); ?> |
| 66 |
</h6> |
| 67 |
<div class="cell grid-x grid-margin-x margin-bottom-2" <?php echo $data['type_trigger'] == 'classic' ? 'style="display: none;"' : ''; ?>> |
| 68 |
<div class="cell auto"></div> |
| 69 |
<input type="hidden" name="type_condition" id="acym__automation__type-condition__input" value="<?php echo acym_escape($data['type_condition']); ?>"> |
| 70 |
<p data-condition="user" class="acym__automation__choose__condition medium-shrink cell <?php echo $data['type_condition'] == 'classic' ? '' : 'selected-condition'; ?>"> |
| 71 |
<?php echo acym_translation('ACYM_EXECUTE_CONDITIONS_ON_ONE_SUBSCRIBER'); ?> |
| 72 |
</p> |
| 73 |
<p data-condition="classic" |
| 74 |
class="acym__automation__choose__condition medium-shrink cell <?php echo $data['type_condition'] == 'classic' ? 'selected-condition' : ''; ?>"> |
| 75 |
<?php echo acym_translation('ACYM_EXECUTE_CONDITIONS_ON_ALL_SUBSCRIBERS'); ?> |
| 76 |
</p> |
| 77 |
<div class="cell auto"></div> |
| 78 |
</div> |
| 79 |
|
| 80 |
<div class="cell grid-x acym__automation__condition__container" |
| 81 |
id="acym__automation__conditions__type__classic" <?php echo $data['type_condition'] == 'classic' ? '' : 'style="display:none;"'; ?>> |
| 82 |
<input type="hidden" value="<?php echo acym_escape($data['classic_option']); ?>" id="acym__automation__condition__classic__options"> |
| 83 |
<div class="cell grid-x acym__content acym__automation__group__condition" data-condition-number="0"> |
| 84 |
<div class="cell grid-x acym__automation__one__condition acym__automation__one__condition__classic"> |
| 85 |
<div class="medium-5 cell"> |
| 86 |
<?php |
| 87 |
echo acym_select( |
| 88 |
$data['classic_name'], |
| 89 |
'conditions_name', |
| 90 |
null, |
| 91 |
['class' => 'acym__select acym__automation__select__classic__condition'] |
| 92 |
); |
| 93 |
?> |
| 94 |
</div> |
| 95 |
</div> |
| 96 |
<div class="cell grid-x margin-top-2"> |
| 97 |
<button data-condition-type="classic" |
| 98 |
data-block="0" |
| 99 |
type="button" |
| 100 |
class="button-secondary button medium-shrink acym__automation__add-condition"><?php echo acym_translation('ACYM_ADD_CONDITION'); ?></button> |
| 101 |
</div> |
| 102 |
</div> |
| 103 |
<button data-condition-type="classic" type="button" class="acym__automation__conditions__or margin-top-1 button button-secondary"><?php echo acym_translation( |
| 104 |
'ACYM_OR' |
| 105 |
); ?></button> |
| 106 |
</div> |
| 107 |
|
| 108 |
<div class="cell grid-x acym__automation__condition__container" |
| 109 |
id="acym__automation__conditions__type__user" <?php echo $data['type_condition'] == 'classic' ? 'style="display:none;"' : ''; ?>> |
| 110 |
<input type="hidden" value="<?php echo acym_escape($data['user_option']); ?>" id="acym__automation__condition__user__options"> |
| 111 |
<div class="cell grid-x acym__content acym__automation__group__condition" data-condition-number="0"> |
| 112 |
<div class="cell grid-x acym__automation__one__condition acym__automation__one__condition__user"> |
| 113 |
<div class="medium-5 cell"> |
| 114 |
<?php |
| 115 |
echo acym_select( |
| 116 |
$data['user_name'], |
| 117 |
'conditions_name', |
| 118 |
null, |
| 119 |
['class' => 'acym__select acym__automation__select__user__condition'] |
| 120 |
); |
| 121 |
?> |
| 122 |
</div> |
| 123 |
</div> |
| 124 |
<div class="cell grid-x margin-top-2"> |
| 125 |
<button data-condition-type="user" |
| 126 |
data-block="0" |
| 127 |
type="button" |
| 128 |
class="button-secondary button medium-shrink acym__automation__add-condition"><?php echo acym_translation('ACYM_ADD_CONDITION'); ?></button> |
| 129 |
</div> |
| 130 |
</div> |
| 131 |
<button data-condition-type="user" type="button" class="acym__automation__conditions__or margin-top-1 button button-secondary"><?php echo acym_translation( |
| 132 |
'ACYM_OR' |
| 133 |
); ?></button> |
| 134 |
</div> |
| 135 |
|
| 136 |
<div class="cell grid-x grid-margin-x margin-top-2"> |
| 137 |
<?php if (empty($data['id'])) { ?> |
| 138 |
<div class="cell medium-auto grid-x grid-margin-x text-right"> |
| 139 |
<div class="cell auto"></div> |
| 140 |
<button |
| 141 |
type="button" |
| 142 |
class="button button-secondary acy_button_submit medium-shrink cell" |
| 143 |
data-task="listing" |
| 144 |
data-condition="cleanCondition" |
| 145 |
> |
| 146 |
<?php echo acym_translation('ACYM_CANCEL'); ?> |
| 147 |
</button> |
| 148 |
<button type="button" |
| 149 |
class="button acy_button_submit medium-shrink cell" |
| 150 |
data-task="edit" |
| 151 |
data-step="setConditionMassAction" |
| 152 |
data-condition="cleanCondition"> |
| 153 |
<?php echo acym_translation('ACYM_SET_FILTERS'); ?> |
| 154 |
</button> |
| 155 |
</div> |
| 156 |
<?php } else { ?> |
| 157 |
<div class="cell medium-shrink medium-margin-bottom-0 margin-bottom-1 text-left"> |
| 158 |
<?php echo acym_backToListing('automation'); ?> |
| 159 |
</div> |
| 160 |
<div class="cell medium-auto grid-x grid-margin-x text-right"> |
| 161 |
<div class="cell auto"></div> |
| 162 |
<button type="button" |
| 163 |
class="button button-secondary acy_button_submit medium-shrink medium-margin-bottom-0 margin-bottom-1 cell" |
| 164 |
data-task="edit" |
| 165 |
data-step="saveExitConditions" |
| 166 |
data-condition="cleanCondition" |
| 167 |
> |
| 168 |
<?php echo acym_translation('ACYM_SAVE_EXIT'); ?> |
| 169 |
</button> |
| 170 |
<button |
| 171 |
type="button" |
| 172 |
class="button acy_button_submit medium-shrink medium-margin-bottom-0 cell" |
| 173 |
data-task="edit" |
| 174 |
data-step="saveConditions" |
| 175 |
data-condition="cleanCondition" |
| 176 |
> |
| 177 |
<?php echo acym_translation('ACYM_SAVE_CONTINUE'); ?> |
| 178 |
</button> |
| 179 |
</div> |
| 180 |
<?php } ?> |
| 181 |
</div> |
| 182 |
</div> |
| 183 |
<?php acym_formOptions(); ?> |
| 184 |
</form> |
| 185 |
|