| 1 |
<?php if (empty($data['allCampaigns'])) { ?> |
| 2 |
<h1 class="cell acym__listing__empty__search__title text-center"><?php echo acym_translation('ACYM_NO_RESULTS_FOUND'); ?></h1> |
| 3 |
<?php } else { ?> |
| 4 |
<div class="cell margin-bottom-1 acym__listing__actions grid-x"> |
| 5 |
<?php |
| 6 |
$actions = [ |
| 7 |
'duplicate' => acym_translation('ACYM_DUPLICATE'), |
| 8 |
'delete' => acym_translation('ACYM_DELETE'), |
| 9 |
]; |
| 10 |
echo acym_listingActions($actions); |
| 11 |
?> |
| 12 |
</div> |
| 13 |
<div class="cell grid-x"> |
| 14 |
<div class="grid-x acym__listing__actions cell auto"> |
| 15 |
<?php |
| 16 |
if ($data['campaign_type'] === 'campaigns_auto') { |
| 17 |
$options = [ |
| 18 |
'' => ['ACYM_AUTOMATICS_CAMPAIGNS', $data['allStatusFilter']->all], |
| 19 |
'generated' => [ |
| 20 |
'ACYM_GENERATED', |
| 21 |
$data['allStatusFilter']->generated, |
| 22 |
$data['generatedPending'] ? 'pending' : '', |
| 23 |
], |
| 24 |
]; |
| 25 |
} else { |
| 26 |
$options = [ |
| 27 |
'' => ['ACYM_ALL', $data['allStatusFilter']->all], |
| 28 |
'scheduled' => ['ACYM_SCHEDULED', $data['allStatusFilter']->scheduled], |
| 29 |
'sent' => ['ACYM_SENT', $data['allStatusFilter']->sent], |
| 30 |
'draft' => ['ACYM_DRAFT', $data['allStatusFilter']->draft], |
| 31 |
]; |
| 32 |
} |
| 33 |
if (isset($data['campaign_type'])) { |
| 34 |
echo acym_filterStatus($options, $data['status'], $data['campaign_type'].'_status'); |
| 35 |
} |
| 36 |
?> |
| 37 |
</div> |
| 38 |
<div class="grid-x cell auto"> |
| 39 |
<div class="cell acym_listing_sort-by"> |
| 40 |
<?php echo acym_sortBy( |
| 41 |
[ |
| 42 |
'id' => acym_strtolower(acym_translation('ACYM_ID')), |
| 43 |
'name' => acym_translation('ACYM_NAME'), |
| 44 |
'sending_date' => acym_translation('ACYM_SENDING_DATE'), |
| 45 |
'creation_date' => acym_translation('ACYM_DATE_CREATED'), |
| 46 |
'draft' => acym_translation('ACYM_DRAFT'), |
| 47 |
'active' => acym_translation('ACYM_ACTIVE'), |
| 48 |
'sent' => acym_translation('ACYM_SENT'), |
| 49 |
'visible' => acym_translation('ACYM_VISIBLE'), |
| 50 |
], |
| 51 |
$data['campaign_type'], |
| 52 |
$data['ordering'], |
| 53 |
$data['orderingSortOrder'] |
| 54 |
); ?> |
| 55 |
</div> |
| 56 |
</div> |
| 57 |
</div> |
| 58 |
<div class="grid-x acym__listing"> |
| 59 |
<div class="grid-x cell acym__listing__header"> |
| 60 |
<div class="medium-shrink small-1 cell"> |
| 61 |
<input id="checkbox_all" type="checkbox"> |
| 62 |
</div> |
| 63 |
<div class="grid-x medium-auto small-11 cell acym__listing__header__title__container"> |
| 64 |
<div class="medium-auto small-11 cell acym__listing__header__title"> |
| 65 |
<?php echo acym_translation('ACYM_CAMPAIGNS'); ?> |
| 66 |
</div> |
| 67 |
<div class="<?php echo $data['campaign_type'] == 'campaigns_auto' ? 'large-1' : 'large-2'; ?> medium-3 hide-for-small-only cell acym__listing__header__title"> |
| 68 |
<?php echo acym_translation('ACYM_LISTS'); ?> |
| 69 |
</div> |
| 70 |
<div class="large-2 medium-4 hide-for-small-only cell acym__listing__header__title text-center"> |
| 71 |
<?php echo acym_translation($data['campaign_type'] == 'campaigns_auto' ? 'ACYM_FREQUENCY' : 'ACYM_STATUS'); ?> |
| 72 |
</div> |
| 73 |
<?php if ($data['campaign_type'] == 'campaigns_auto') { ?> |
| 74 |
<div class="large-1 hide-for-small-only hide-for-medium-only text-center cell acym__listing__header__title acym__campaign__auto__generation"> |
| 75 |
<?php echo acym_translation('ACYM_LAST_GENERATION'); ?> |
| 76 |
</div> |
| 77 |
<div class="large-1 hide-for-small-only hide-for-medium-only text-center cell acym__listing__header__title acym__campaign__auto__generation"> |
| 78 |
<?php echo acym_translation('ACYM_NEXT_TRIGGER'); ?> |
| 79 |
</div> |
| 80 |
<?php } ?> |
| 81 |
<div class="large-1 hide-for-small-only hide-for-medium-only text-center cell acym__listing__header__title"> |
| 82 |
<?php echo acym_translation('ACYM_OPEN'); ?> |
| 83 |
</div> |
| 84 |
<div class="large-1 hide-for-small-only hide-for-medium-only text-center cell acym__listing__header__title"> |
| 85 |
<?php echo acym_translation('ACYM_CLICK'); ?> |
| 86 |
</div> |
| 87 |
<?php if (acym_isTrackingSalesActive()) { ?> |
| 88 |
<div class="large-1 hide-for-small-only hide-for-medium-only text-center cell acym__listing__header__title"> |
| 89 |
<?php echo acym_translation('ACYM_INCOME'); ?> |
| 90 |
</div> |
| 91 |
<?php } ?> |
| 92 |
<?php if (acym_isAdmin()) { ?> |
| 93 |
<div class="large-1 cell hide-for-small-only hide-for-medium-only text-center acym__listing__header__title"> |
| 94 |
<?php |
| 95 |
echo acym_translation('ACYM_VISIBLE'); |
| 96 |
echo acym_info( |
| 97 |
[ |
| 98 |
'textShownInTooltip' => 'ACYM_VISIBLE_CAMPAIGN_DESC', |
| 99 |
'classIcon' => 'acym__tooltip__in__listing__header', |
| 100 |
] |
| 101 |
); |
| 102 |
?> |
| 103 |
</div> |
| 104 |
<?php } ?> |
| 105 |
<div class="large-1 cell hide-for-small-only hide-for-medium-only text-center acym__listing__header__title"> |
| 106 |
<?php echo acym_translation('ACYM_ACTIONS'); ?> |
| 107 |
</div> |
| 108 |
<div class="large-1 cell hide-for-small-only hide-for-medium-only text-center acym__listing__header__title"> |
| 109 |
<?php echo acym_translation('ACYM_ID'); ?> |
| 110 |
</div> |
| 111 |
</div> |
| 112 |
</div> |
| 113 |
<?php |
| 114 |
foreach ($data['allCampaigns'] as $campaign) { |
| 115 |
if (isset($campaign->display) && !$campaign->display) continue; |
| 116 |
$specialIcon = ''; |
| 117 |
$specialText = ''; |
| 118 |
if (is_array($campaign->sending_params) && array_key_exists('abtest', $campaign->sending_params)) { |
| 119 |
$specialIcon = '<i class="acymicon-flask acym__selection__card__icon"></i> '; |
| 120 |
if (empty($campaign->sending_params['abtest']['abtest_finished']) && empty($campaign->draft)) { |
| 121 |
$specialText = ' ('.acym_translation('ACYM_PROCESSING').')'; |
| 122 |
} |
| 123 |
} |
| 124 |
|
| 125 |
?> |
| 126 |
<div class="grid-x cell align-middle acym__listing__row"> |
| 127 |
<div class="medium-shrink small-1 cell"> |
| 128 |
<input id="checkbox_<?php echo acym_escape($campaign->id); ?>" type="checkbox" name="elements_checked[]" value="<?php echo acym_escape($campaign->id); ?>"> |
| 129 |
</div> |
| 130 |
<div class="grid-x medium-auto small-11 cell align-middle acym__campaign__listing acym__listing__title__container"> |
| 131 |
<div class="cell medium-auto small-7 acym__listing__title acym__campaign__title"> |
| 132 |
<?php $linkTask = 'generated' == $data['status'] ? 'summaryGenerated' : 'edit&step=editEmail'; |
| 133 |
$linkCampaign = acym_completeLink(acym_getVar('cmd', 'ctrl').'&task='.$linkTask.'&campaignId='.intval($campaign->id)); |
| 134 |
?> |
| 135 |
<a class="cell auto" href="<?php echo $linkCampaign; ?>"> |
| 136 |
<h6 class='acym__listing__title__primary acym_text_ellipsis' style="display:flex; align-items:center;"> |
| 137 |
<?php echo $specialIcon.acym_escape($campaign->name).$specialText; ?> |
| 138 |
</h6> |
| 139 |
</a> |
| 140 |
<p class='acym__listing__title__secondary'> |
| 141 |
<?php |
| 142 |
if (!empty($campaign->sending_date) && (!$campaign->scheduled || $campaign->sent)) { |
| 143 |
echo acym_translation('ACYM_SENDING_DATE').' : '.acym_date($campaign->sending_date, acym_getDateTimeFormat('ACYM_DATE_FORMAT_LC3')); |
| 144 |
} elseif ($data['statusAuto'] === $campaign->sending_type) { |
| 145 |
$numberCampaignsGenerated = empty($campaign->sending_params['number_generated']) ? '0' : $campaign->sending_params['number_generated']; |
| 146 |
echo acym_translationSprintf('ACYM_X_CAMPAIGN_GENERATED', $numberCampaignsGenerated); |
| 147 |
} |
| 148 |
?> |
| 149 |
</p> |
| 150 |
</div> |
| 151 |
<div class="<?php echo $data['campaign_type'] == 'campaigns_auto' ? 'large-1' : 'large-2'; ?> acym__campaign__recipients medium-3 small-5 cell"> |
| 152 |
<?php |
| 153 |
if (!empty($campaign->lists)) { |
| 154 |
$subscriptionsCount = count($campaign->lists); |
| 155 |
$counter = 0; |
| 156 |
foreach ($campaign->lists as $list) { |
| 157 |
$classes = 'acym_subscription acymicon-circle'; |
| 158 |
if ($counter >= 5 && $subscriptionsCount !== 6) $classes .= ' acym_subscription_more'; |
| 159 |
|
| 160 |
echo acym_tooltip( |
| 161 |
[ |
| 162 |
'hoveredText' => '<i class="'.$classes.'" style="color:'.acym_escape($list->color).'"></i>', |
| 163 |
'textShownInTooltip' => acym_escape($list->name), |
| 164 |
] |
| 165 |
); |
| 166 |
$counter++; |
| 167 |
} |
| 168 |
|
| 169 |
if ($counter > 5 && $subscriptionsCount !== 6) { |
| 170 |
$counter = $counter - 5; |
| 171 |
echo '<span class="acym__campaign__show-subscription acymicon-stack" data-iscollapsed="0" acym-data-value="'.$counter.'"> |
| 172 |
<i class="acym__campaign__button__showsubscription acymicon-circle acymicon-stack-2x"></i> |
| 173 |
<span class="acym__listing__text acym__campaign__show-subscription-bt acymicon-stack-1x">+'.$counter.'</span> |
| 174 |
</span>'; |
| 175 |
} |
| 176 |
} else { |
| 177 |
echo '<div class="cell medium-12">'; |
| 178 |
echo acym_translation(empty($campaign->automation) ? 'ACYM_NO_LIST_SELECTED' : 'ACYM_SENT_WITH_AUTOMATION'); |
| 179 |
echo '</div>'; |
| 180 |
} |
| 181 |
?> |
| 182 |
</div> |
| 183 |
<div class="large-2 medium-4 small-11 text-center cell acym__campaign__status"> |
| 184 |
<div class="grid-x text-center"> |
| 185 |
<?php |
| 186 |
if ($campaign->sent) { |
| 187 |
if (!isset($campaign->subscribers)) $campaign->subscribers = 'x'; |
| 188 |
echo '<div class="cell acym__campaign__status__status acym__background-color__green"><span>'; |
| 189 |
echo acym_translation('ACYM_SENT').' : '.acym_escape($campaign->subscribers).' '.acym_translation('ACYM_RECIPIENTS'); |
| 190 |
echo '</span></div>'; |
| 191 |
} elseif ($campaign->scheduled && !$campaign->draft) { |
| 192 |
echo '<div class="cell acym__campaign__status__status acym__background-color__orange"><span>'; |
| 193 |
echo acym_escape(acym_translation('ACYM_SCHEDULED').' : '); |
| 194 |
echo acym_tooltip( |
| 195 |
[ |
| 196 |
'hoveredText' => acym_date( |
| 197 |
$campaign->sending_date, |
| 198 |
acym_getDateTimeFormat('ACYM_DATE_FORMAT_LC3') |
| 199 |
), |
| 200 |
'textShownInTooltip' => acym_date( |
| 201 |
$campaign->sending_date, |
| 202 |
acym_getDateTimeFormat('ACYM_DATE_FORMAT_LC2') |
| 203 |
), |
| 204 |
] |
| 205 |
); |
| 206 |
echo '</span></div>'; |
| 207 |
$target = '<div class="acym__campaign__listing__scheduled__stop grid-x cell xlarge-shrink acym_vcenter" data-campaignid="'.acym_escape( |
| 208 |
$campaign->id |
| 209 |
).'"><i class="acymicon-times-circle cell shrink show-for-xlarge"></i><span class="cell xlarge-shrink">'.acym_translation( |
| 210 |
'ACYM_CANCEL_SCHEDULING' |
| 211 |
).'</span></div>'; |
| 212 |
echo '<div class="cell acym__campaign__listing__status__controls"><div class="grid-x text-center"><div class="cell auto"></div>'.acym_tooltip( |
| 213 |
[ |
| 214 |
'hoveredText' => $target, |
| 215 |
'textShownInTooltip' => acym_translation('ACYM_STOP_THE_SCHEDULING_AND_SET_CAMPAIGN_AS_DRAFT'), |
| 216 |
] |
| 217 |
).'<div class="cell auto"></div></div></div>'; |
| 218 |
} elseif ($data['statusAuto'] === $campaign->sending_type && !$campaign->draft) { |
| 219 |
$numberCampaignsGenerated = empty($campaign->sending_params['number_generated']) ? '0' : $campaign->sending_params['number_generated']; |
| 220 |
$tooltip = acym_translationSprintf('ACYM_X_CAMPAIGN_GENERATED', $numberCampaignsGenerated); |
| 221 |
|
| 222 |
$nextTrigger = empty($campaign->sending_params['trigger_text']) ? '' : $campaign->sending_params['trigger_text']; |
| 223 |
echo acym_tooltip( |
| 224 |
[ |
| 225 |
'hoveredText' => '<div class="cell acym__campaign__status__status acym__background-color__purple"> |
| 226 |
<span class="acym__color__white">'.$nextTrigger.'</span> |
| 227 |
</div>', |
| 228 |
'textShownInTooltip' => $tooltip, |
| 229 |
'classContainer' => 'cell', |
| 230 |
] |
| 231 |
); |
| 232 |
|
| 233 |
$target = '<div class="acym__campaign__listing__automatic__deactivate grid-x cell xlarge-shrink acym_vcenter" data-campaignid="'.acym_escape( |
| 234 |
$campaign->id |
| 235 |
).'"> |
| 236 |
<i class="'.($campaign->active ? 'acymicon-times-circle' : 'acymicon-power-off').' cell shrink show-for-xlarge"></i> |
| 237 |
<span class="cell xlarge-shrink">'.($campaign->active |
| 238 |
? acym_translation('ACYM_DEACTIVATE') |
| 239 |
: acym_translation( |
| 240 |
'ACYM_ACTIVATE' |
| 241 |
)).'</span> |
| 242 |
</div>'; |
| 243 |
echo '<div class="cell acym__campaign__listing__status__controls"> |
| 244 |
<div class="grid-x text-center"> |
| 245 |
<div class="cell auto"></div>'.$target.'<div class="cell auto"></div> |
| 246 |
</div> |
| 247 |
</div>'; |
| 248 |
} elseif ('generated' == $data['status'] && $campaign->draft) { |
| 249 |
echo '<div class="cell acym__campaign__status__status acym__background-color__orange"><span>'.acym_translation( |
| 250 |
'ACYM_WAITING_FOR_CONFIRMATION' |
| 251 |
).'</span></div>'; |
| 252 |
} elseif ('generated' == $data['status'] && !$campaign->active) { |
| 253 |
echo '<div class="cell acym__campaign__status__status acym__background-color__red"><span class="acym__color__white">'.acym_translation( |
| 254 |
'ACYM_DISABLED' |
| 255 |
).'</span></div>'; |
| 256 |
} elseif ($campaign->draft) { |
| 257 |
echo '<div class="cell acym__campaign__status__status acym__campaign__status__draft"><span>'.acym_translation('ACYM_DRAFT').'</span></div>'; |
| 258 |
} |
| 259 |
?> |
| 260 |
</div> |
| 261 |
</div> |
| 262 |
<?php if ($data['campaign_type'] == 'campaigns_auto') { ?> |
| 263 |
<div class="large-1 hide-for-small-only hide-for-medium-only cell text-center acym__campaign__auto__generation"> |
| 264 |
<?php |
| 265 |
if (empty($campaign->last_generated)) { |
| 266 |
echo '-'; |
| 267 |
} else { |
| 268 |
echo acym_date($campaign->last_generated, acym_getDateTimeFormat()); |
| 269 |
} |
| 270 |
?> |
| 271 |
</div> |
| 272 |
<div class="large-1 hide-for-small-only hide-for-medium-only cell text-center acym__campaign__auto__generation"> |
| 273 |
<?php |
| 274 |
if (empty($campaign->next_trigger)) { |
| 275 |
echo '-'; |
| 276 |
} else { |
| 277 |
echo acym_date($campaign->next_trigger, acym_getDateTimeFormat()); |
| 278 |
} |
| 279 |
?> |
| 280 |
</div> |
| 281 |
<?php } ?> |
| 282 |
<div class="large-1 hide-for-small-only hide-for-medium-only cell text-center"> |
| 283 |
<?php |
| 284 |
if (($campaign->sent || $data['campaign_type'] == 'campaigns_auto') && !empty($campaign->subscribers) && isset($campaign->open)) { |
| 285 |
echo $campaign->open.'%'; |
| 286 |
} else { |
| 287 |
echo '-'; |
| 288 |
} |
| 289 |
?> |
| 290 |
</div> |
| 291 |
<div class="large-1 hide-for-small-only hide-for-medium-only cell text-center"> |
| 292 |
<?php |
| 293 |
if (($campaign->sent || $data['campaign_type'] == 'campaigns_auto') && !empty($campaign->subscribers) && isset($campaign->click)) { |
| 294 |
echo $campaign->click.'%'; |
| 295 |
} else { |
| 296 |
echo '-'; |
| 297 |
} |
| 298 |
?> |
| 299 |
</div> |
| 300 |
<?php if (acym_isTrackingSalesActive()) { ?> |
| 301 |
<div class="large-1 hide-for-small-only hide-for-medium-only cell text-center"> |
| 302 |
<?php |
| 303 |
if (!empty($campaign->tracking_sale) && !empty($campaign->currency)) { |
| 304 |
acym_trigger('getCurrency', [&$campaign->currency]); |
| 305 |
echo round($campaign->tracking_sale, 2).' '.$campaign->currency; |
| 306 |
} else { |
| 307 |
echo '-'; |
| 308 |
} |
| 309 |
?> |
| 310 |
</div> |
| 311 |
<?php } ?> |
| 312 |
<?php if (acym_isAdmin()) { ?> |
| 313 |
<div class="large-1 hide-for-small-only hide-for-medium-only cell text-center acym__icon__table"> |
| 314 |
<?php |
| 315 |
if ($campaign->visible == 1) { |
| 316 |
$class = 'acymicon-eye" data-acy-newvalue="0'; |
| 317 |
$tooltip = 'ACYM_VISIBLE'; |
| 318 |
} else { |
| 319 |
$class = 'acymicon-eye-slash acym__color__dark-gray" data-acy-newvalue="1'; |
| 320 |
$tooltip = 'ACYM_INVISIBLE'; |
| 321 |
} |
| 322 |
echo acym_tooltip( |
| 323 |
[ |
| 324 |
'hoveredText' => '<i data-acy-table="campaign" data-acy-field="visible" data-acy-elementid="'.acym_escape( |
| 325 |
$campaign->id |
| 326 |
).'" class="acym_toggleable '.$class.'"></i>', |
| 327 |
'textShownInTooltip' => acym_translation($tooltip), |
| 328 |
] |
| 329 |
); |
| 330 |
?> |
| 331 |
</div> |
| 332 |
<?php |
| 333 |
} ?> |
| 334 |
<div class="large-1 hide-for-small-only hide-for-medium-only cell text-center acym__icon__table"> |
| 335 |
<a href="<?php echo $linkCampaign; ?>"><i class="acymicon-pencil" title="<?php echo acym_translation('ACYM_EDIT'); ?>"></i></a> |
| 336 |
<a><i class="acymicon-content-copy fastActions" |
| 337 |
data-action="duplicate" |
| 338 |
data-acy-elementid="<?php echo acym_escape($campaign->id); ?>" |
| 339 |
title="<?php echo acym_translation('ACYM_DUPLICATE'); ?>"></i></a> |
| 340 |
<?php |
| 341 |
$isFront = !acym_isAdmin() && ACYM_CMS == 'joomla'; |
| 342 |
if (!acym_escape($campaign->draft) && !$isFront) { ?> |
| 343 |
<a href="<?php echo acym_completeLink('stats&mail_ids='.acym_escape($campaign->mail_id)); |
| 344 |
?>"><i class="acymicon-rectangle-bar-chart" title="<?php echo acym_translation('ACYM_STATISTICS'); ?>"></i></a> |
| 345 |
<?php } ?> |
| 346 |
<i class="cursor-pointer acymicon-delete fastActions deleteFastAction" |
| 347 |
data-action="delete" |
| 348 |
data-acy-elementid="<?php echo acym_escape($campaign->id); ?>" |
| 349 |
title="<?php echo acym_translation('ACYM_DELETE'); ?>"></i> |
| 350 |
</div> |
| 351 |
<h6 class="large-1 hide-for-medium-only hide-for-small-only cell text-center acym__listing__text acym__campaign__listing__id"> |
| 352 |
<?php |
| 353 |
echo acym_tooltip( |
| 354 |
[ |
| 355 |
'hoveredText' => $campaign->id, |
| 356 |
'textShownInTooltip' => acym_translationSprintf('ACYM_MAIL_ID_X', $campaign->mail_id), |
| 357 |
] |
| 358 |
); |
| 359 |
?> |
| 360 |
</h6> |
| 361 |
</div> |
| 362 |
</div> |
| 363 |
<?php |
| 364 |
} |
| 365 |
?> |
| 366 |
</div> |
| 367 |
<?php echo $data['pagination']->display('campaigns'); |
| 368 |
} |
| 369 |
|