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