| 1 |
<?php |
| 2 |
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- View file, its variables are local to the include scope, not true globals. |
| 3 |
defined('ABSPATH') || die('Restricted Access'); |
| 4 |
?> |
| 5 |
<div class="intext_select_automation cell"> |
| 6 |
<?php |
| 7 |
acym_select( |
| 8 |
$userFields, |
| 9 |
'acym_action[actions][__and__][acy_user_value][field]', |
| 10 |
null, |
| 11 |
['class' => 'acym__select acym__automation__actions__fields__dropdown'], |
| 12 |
'value', |
| 13 |
'text', |
| 14 |
null, |
| 15 |
false, |
| 16 |
true |
| 17 |
); |
| 18 |
?> |
| 19 |
</div> |
| 20 |
<div class="intext_select_automation cell"> |
| 21 |
<?php |
| 22 |
acym_select( |
| 23 |
$userOperator, |
| 24 |
'acym_action[actions][__and__][acy_user_value][operator]', |
| 25 |
null, |
| 26 |
['class' => 'acym__select acym__automation__actions__operator__dropdown'], |
| 27 |
'value', |
| 28 |
'text', |
| 29 |
null, |
| 30 |
false, |
| 31 |
true |
| 32 |
); |
| 33 |
?> |
| 34 |
</div> |
| 35 |
<input type="text" |
| 36 |
name="acym_action[actions][__and__][acy_user_value][value]" |
| 37 |
class="intext_input_automation cell acym__automation__one-field acym__automation__action__regular-field"> |
| 38 |
<?php |
| 39 |
foreach ($customFields as $field) { |
| 40 |
if (in_array($field->type, ['single_dropdown', 'radio', 'checkbox', 'multiple_dropdown']) && !empty($field->value)) { |
| 41 |
$values = []; |
| 42 |
$field->value = json_decode($field->value, true); |
| 43 |
foreach ($field->value as $value) { |
| 44 |
$valueTmp = new stdClass(); |
| 45 |
$valueTmp->text = $value['title']; |
| 46 |
$valueTmp->value = $value['value']; |
| 47 |
if ($value['disabled'] == 'y') $valueTmp->disable = true; |
| 48 |
$values[$value['value']] = $valueTmp; |
| 49 |
} |
| 50 |
echo '<div class="acym__automation__one-field intext_select_automation cell" style="display: none">'; |
| 51 |
acym_select( |
| 52 |
$values, |
| 53 |
'[actions][__and__][acy_user_value][value]', |
| 54 |
null, |
| 55 |
[ |
| 56 |
'class' => 'acym__select acym__automation__actions__fields__select', |
| 57 |
'data-action-field' => $field->id, |
| 58 |
], |
| 59 |
'value', |
| 60 |
'text', |
| 61 |
null, |
| 62 |
false, |
| 63 |
true |
| 64 |
); |
| 65 |
echo '</div>'; |
| 66 |
} elseif ('date' == $field->type) { |
| 67 |
acym_tooltip( |
| 68 |
[ |
| 69 |
'hoveredText' => '<input class="acym__automation__one-field acym__automation__actions__fields__select intext_input_automation cell" |
| 70 |
type="text" |
| 71 |
name="[actions][__and__][acy_user_value][value]" |
| 72 |
style="display: none" |
| 73 |
data-action-field="'.intval($field->id).'">', |
| 74 |
'textShownInTooltip' => acym_translation('ACYM_DATE_FORMAT_FILTER'), |
| 75 |
'classContainer' => 'intext_select_automation cell', |
| 76 |
] |
| 77 |
); |
| 78 |
} |
| 79 |
} |
| 80 |
|