| 1 |
<form id="acym_form" action="<?php echo acym_completeLink(acym_getVar('cmd', 'ctrl')); ?>" method="post" name="acyForm"> |
| 2 |
<?php |
| 3 |
$isEmpty = empty($data['allAutomations']) && empty($data['search']) && empty($data['tag']) && empty($data['status']); |
| 4 |
if (!$isEmpty) { |
| 5 |
$data['toolbar']->displayToolbar($data); |
| 6 |
} |
| 7 |
?> |
| 8 |
<div id="acym__automation" class="acym__content"> |
| 9 |
<?php if ($isEmpty) { ?> |
| 10 |
<div class="grid-x text-center acym__listing__empty"> |
| 11 |
<h1 class="cell acym__listing__empty__title"><?php echo acym_translation('ACYM_YOU_DONT_HAVE_ANY_AUTOMATION'); ?></h1> |
| 12 |
<h1 class="cell acym__listing__empty__subtitle"><?php echo acym_translation('ACYM_CREATE_ONE_AND_LET_ACYMAILING_DO_IT'); ?></h1> |
| 13 |
<div class="cell medium-4 hide-for-small-only"></div> |
| 14 |
<div class="cell medium-4 grid-x grid-margin-x align-center"> |
| 15 |
<div class="cell small-6 padding-bottom-1"> |
| 16 |
<button type="button" class="button button-secondary acy_button_submit" data-task="edit" data-step="action"> |
| 17 |
<?php echo acym_translation('ACYM_NEW_MASS_ACTION'); ?> |
| 18 |
</button> |
| 19 |
</div> |
| 20 |
<div class="cell small-6 padding-bottom-1"> |
| 21 |
<button type="button" class="button acy_button_submit" data-task="edit" data-step="info"> |
| 22 |
<?php echo acym_translation('ACYM_CREATE_AUTOMATION'); ?> |
| 23 |
</button> |
| 24 |
</div> |
| 25 |
</div> |
| 26 |
</div> |
| 27 |
<?php } else { ?> |
| 28 |
<?php if (empty($data['allAutomations'])) { ?> |
| 29 |
<h1 class="cell acym__listing__empty__search__title text-center"><?php echo acym_translation('ACYM_NO_RESULTS_FOUND'); ?></h1> |
| 30 |
<?php } else { ?> |
| 31 |
<div class="cell grid-x margin-top-1"> |
| 32 |
<div class="grid-x acym__listing__actions cell margin-bottom-1"> |
| 33 |
<?php |
| 34 |
$actions = [ |
| 35 |
'setActive' => acym_translation('ACYM_ENABLE'), |
| 36 |
'setInactive' => acym_translation('ACYM_DISABLE'), |
| 37 |
'duplicate' => acym_translation('ACYM_DUPLICATE'), |
| 38 |
'delete' => acym_translation('ACYM_DELETE'), |
| 39 |
]; |
| 40 |
echo acym_listingActions($actions, acym_translation('ACYM_BE_CAREFUL_THIS_DELETE_ELEMENTS_LINKED_AUTOMATION')); |
| 41 |
?> |
| 42 |
</div> |
| 43 |
<div class="grid-x cell align-justify"> |
| 44 |
<div class="cell grid-x large-shrink acym_vcenter"> |
| 45 |
<?php |
| 46 |
$options = [ |
| 47 |
'' => ['ACYM_ALL', $data["automationNumberPerStatus"]["all"]], |
| 48 |
'active' => ['ACYM_ACTIVE', $data["automationNumberPerStatus"]["active"]], |
| 49 |
'inactive' => ['ACYM_INACTIVE', $data["automationNumberPerStatus"]["inactive"]], |
| 50 |
]; |
| 51 |
echo acym_filterStatus($options, $data["status"], 'automation_status'); |
| 52 |
?> |
| 53 |
</div> |
| 54 |
<div class="cell large-shrink acym_listing_sort-by"> |
| 55 |
<?php echo acym_sortBy( |
| 56 |
[ |
| 57 |
'id' => acym_strtolower(acym_translation('ACYM_ID')), |
| 58 |
'name' => acym_translation('ACYM_NAME'), |
| 59 |
'active' => acym_translation('ACYM_ACTIVE'), |
| 60 |
], |
| 61 |
"automation", |
| 62 |
$data['ordering'], |
| 63 |
'asc' |
| 64 |
); ?> |
| 65 |
</div> |
| 66 |
</div> |
| 67 |
</div> |
| 68 |
<div class="grid-x acym__listing"> |
| 69 |
<div class="grid-x cell acym__listing__header"> |
| 70 |
<div class="medium-shrink small-1 cell"> |
| 71 |
<input id="checkbox_all" type="checkbox" name="checkbox_all"> |
| 72 |
</div> |
| 73 |
<div class="grid-x medium-auto small-11 cell acym__listing__header__title__container"> |
| 74 |
<div class="medium-5 small-9 cell acym__listing__header__title"> |
| 75 |
<?php echo acym_translation('ACYM_AUTOMATION'); ?> |
| 76 |
</div> |
| 77 |
<div class="medium-auto hide-for-small-only cell acym__listing__header__title"> |
| 78 |
<?php echo acym_translation('ACYM_DESCRIPTION'); ?> |
| 79 |
</div> |
| 80 |
<div class="xxlarge-2 medium-3 text-center hide-for-small-only cell acym__listing__header__title"> |
| 81 |
<?php echo acym_translation('ACYM_ACTIVE'); ?> |
| 82 |
</div> |
| 83 |
<div class="medium-1 text-center hide-for-small-only cell acym__listing__header__title"> |
| 84 |
<?php echo acym_translation('ACYM_ID'); ?> |
| 85 |
</div> |
| 86 |
</div> |
| 87 |
</div> |
| 88 |
<?php foreach ($data['allAutomations'] as $automation) { ?> |
| 89 |
<div data-acy-elementid="<?php echo acym_escape($automation->id); ?>" class="grid-x cell align-middle acym__listing__row"> |
| 90 |
<div class="medium-shrink small-1 cell"> |
| 91 |
<input id="checkbox_<?php echo acym_escape($automation->id); ?>" |
| 92 |
type="checkbox" |
| 93 |
name="elements_checked[]" |
| 94 |
value="<?php echo acym_escape($automation->id); ?>"> |
| 95 |
</div> |
| 96 |
<div class="grid-x medium-auto small-11 cell acym__listing__title__container"> |
| 97 |
<div class="grid-x medium-5 small-9 cell acym__listing__title"> |
| 98 |
<a class="cell auto" href="<?php echo acym_completeLink('automation&task=edit&step=info&id=').acym_escape($automation->id); ?>"> |
| 99 |
<h6><?php echo acym_escape(acym_translation($automation->name)); ?></h6> |
| 100 |
</a> |
| 101 |
</div> |
| 102 |
<div class="medium-auto hide-for-small-only cell grid-x"> |
| 103 |
<h6 class="cell acym__listing__text"> |
| 104 |
<?php |
| 105 |
$automation->description = acym_escape(acym_translation($automation->description)); |
| 106 |
if (strlen($automation->description) >= 50) { |
| 107 |
echo acym_tooltip( |
| 108 |
[ |
| 109 |
'hoveredText' => substr($automation->description, 0, 50), |
| 110 |
'textShownInTooltip' => $automation->description, |
| 111 |
] |
| 112 |
).'...'; |
| 113 |
} else { |
| 114 |
echo $automation->description; |
| 115 |
} |
| 116 |
?> |
| 117 |
</h6> |
| 118 |
</div> |
| 119 |
<div class="xxlarge-2 small-3 cell acym__listing__controls grid-x"> |
| 120 |
<div class="text-center cell"> |
| 121 |
<?php |
| 122 |
$class = $automation->active == 1 ? 'acymicon-check-circle acym__color__green" data-acy-newvalue="0' |
| 123 |
: 'acymicon-times-circle acym__color__red" data-acy-newvalue="1'; |
| 124 |
echo '<i data-acy-table="automation" data-acy-field="active" data-acy-elementid="'.acym_escape( |
| 125 |
$automation->id |
| 126 |
).'" class="acym_toggleable '.$class.'"></i>'; |
| 127 |
?> |
| 128 |
</div> |
| 129 |
</div> |
| 130 |
<div class="medium-1 hide-for-small-only grid-x"> |
| 131 |
<h6 class="cell text-center acym__listing__text"><?php echo acym_escape($automation->id); ?></h6> |
| 132 |
</div> |
| 133 |
</div> |
| 134 |
</div> |
| 135 |
<?php } ?> |
| 136 |
<?php echo $data['pagination']->display('automation'); ?> |
| 137 |
</div> |
| 138 |
<?php } |
| 139 |
} ?> |
| 140 |
</div> |
| 141 |
<?php acym_formOptions(); ?> |
| 142 |
</form> |
| 143 |
|