| @@ -1,212 +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 | -if (!empty($data['user-information']->id)) { ?> | |
| 5 | - <div class="cell grid-x acym__users__display__history acym__content"> | |
| 6 | - <div class="cell grid-x acym__users__history__toggle"> | |
| 7 | - <button type="button" | |
| 8 | - class="cell small-6 acym__users__history__toggle-button acym__users__history__toggle-button-selected" | |
| 9 | - data-acym-toggle-history="mail"><?php echo esc_html(acym_translation('ACYM_EMAIL_HISTORY')); ?></button> | |
| 10 | - <button type="button" class="cell small-6 acym__users__history__toggle-button" data-acym-toggle-history="user"> | |
| 11 | - <?php echo esc_html(acym_translation('ACYM_USER_HISTORY')); ?> | |
| 12 | - </button> | |
| 13 | - </div> | |
| 14 | - <div class="cell grid-x align-middle" data-acym-type="mail"> | |
| 15 | - <?php if (empty($data['userMailHistory'])) { | |
| 16 | - echo '<h2 class="cell acym__title__primary__color text-center">'.esc_html(acym_translation('ACYM_YOU_DIDNT_SENT_EMAIL_SUBSCRIBER')).'</h2>'; | |
| 17 | - } else { | |
| 18 | - $showStats = empty($data['anonymousStats']); | |
| 19 | - $subjectClass = $showStats ? 'medium-4' : 'medium-8'; | |
| 20 | - ?> | |
| 21 | - <div class="grid-x cell grid-margin-x acym__listing__header acym__listing__header__user_history text-center"> | |
| 22 | - <div class="<?php echo esc_attr($subjectClass); ?> hide-for-small-only cell acym__listing__header__title"> | |
| 23 | - <?php echo esc_html(acym_translation('ACYM_EMAIL_SUBJECT')); ?> | |
| 24 | - </div> | |
| 25 | - <div class="medium-2 hide-for-small-only cell acym__listing__header__title"> | |
| 26 | - <?php echo esc_html(acym_translation('ACYM_SEND_DATE')); ?> | |
| 27 | - </div> | |
| 28 | - <?php if ($showStats) { ?> | |
| 29 | - <div class="medium-1 hide-for-small-only cell acym__listing__header__title"> | |
| 30 | - <?php echo esc_html(acym_translation('ACYM_OPEN')); ?> | |
| 31 | - </div> | |
| 32 | - <div class="medium-2 hide-for-small-only cell acym__listing__header__title"> | |
| 33 | - <?php echo esc_html(acym_translation('ACYM_OPEN_DATE')); ?> | |
| 34 | - </div> | |
| 35 | - <div class="medium-1 hide-for-small-only cell acym__listing__header__title"> | |
| 36 | - <?php echo esc_html(acym_translation('ACYM_CLICK')); ?> | |
| 37 | - </div> | |
| 38 | - <div class="medium-2 hide-for-small-only cell acym__listing__header__title"> | |
| 39 | - <?php echo esc_html(acym_translation('ACYM_BOUNCES')); ?> | |
| 40 | - </div> | |
| 41 | - <?php } ?> | |
| 42 | - </div> | |
| 43 | - <div class="acym__users__display__history__listing grid-x cell"> | |
| 44 | - <?php foreach ($data['userMailHistory'] as $oneMailHistory) { ?> | |
| 45 | - <div class="grid-x cell text-center acym__listing__row grid-margin-x"> | |
| 46 | - <div class="medium-4 cell acym__users__email__history__subject"> | |
| 47 | - <a href="<?php echo esc_url(acym_frontendLink('archive&task=view&id='.$oneMailHistory->id.'&userid='.$data['user-information']->id.'-'.$data['user-information']->key.'&'.acym_noTemplate())); ?>" | |
| 48 | - target="_blank"><?php echo esc_html($oneMailHistory->subject); ?></a> | |
| 49 | - </div> | |
| 50 | - <div class="medium-2 cell"> | |
| 51 | - <?php | |
| 52 | - if (empty($oneMailHistory->send_date) || '0000-00-00 00:00:00' == $oneMailHistory->send_date) { | |
| 53 | - echo '-'; | |
| 54 | - } else { | |
| 55 | - acym_tooltip( | |
| 56 | - [ | |
| 57 | - 'hoveredText' => acym_date(acym_getTimeFromUTCDate($oneMailHistory->send_date), 'd F H:i'), | |
| 58 | - 'textShownInTooltip' => acym_date(acym_getTimeFromUTCDate($oneMailHistory->send_date), acym_getDateTimeFormat()), | |
| 59 | - ] | |
| 60 | - ); | |
| 61 | - } | |
| 62 | - ?> | |
| 63 | - </div> | |
| 64 | - <div class="medium-1 cell text-center"> | |
| 65 | - <?php echo esc_html($oneMailHistory->open ?? ''); ?> | |
| 66 | - </div> | |
| 67 | - <div class="medium-2 cell text-center"> | |
| 68 | - <?php | |
| 69 | - if (empty($oneMailHistory->open_date)) { | |
| 70 | - echo '-'; | |
| 71 | - } else { | |
| 72 | - acym_tooltip( | |
| 73 | - [ | |
| 74 | - 'hoveredText' => acym_date(acym_getTimeFromUTCDate($oneMailHistory->open_date), 'd F H:i'), | |
| 75 | - 'textShownInTooltip' => acym_date(acym_getTimeFromUTCDate($oneMailHistory->open_date), acym_getDateTimeFormat()), | |
| 76 | - ] | |
| 77 | - ); | |
| 78 | - } | |
| 79 | - ?> | |
| 80 | - </div> | |
| 81 | - <div class="medium-1 cell text-center"> | |
| 82 | - <?php echo esc_html($oneMailHistory->click ?? ''); ?> | |
| 83 | - </div> | |
| 84 | - <div class="medium-2 cell text-center acym__listing__header__user_history__bounce"> | |
| 85 | - <?php echo empty($oneMailHistory->bounce_rule) ? '-' : esc_html($oneMailHistory->ruleName ?? ''); ?> | |
| 86 | - </div> | |
| 87 | - </div> | |
| 88 | - <?php } ?> | |
| 89 | - </div> | |
| 90 | - <?php } ?> | |
| 91 | - </div> | |
| 92 | - <div class="cell grid-x align-middle" data-acym-type="user"> | |
| 93 | - <?php if (empty($data['userHistory'])) { | |
| 94 | - echo '<h2 class="cell acym__title__primary__color text-center">'.esc_html(acym_translation('ACYM_USER_HISTORY_EMPTY')).'</h2>'; | |
| 95 | - } else { ?> | |
| 96 | - <div class="grid-x cell text-center grid-margin-x acym__listing__header acym__listing__header__user_history"> | |
| 97 | - <div class="medium-2 hide-for-small-only cell acym__listing__header__title"> | |
| 98 | - <?php echo esc_html(acym_translation('ACYM_DATE')); ?> | |
| 99 | - </div> | |
| 100 | - <div class="medium-2 hide-for-small-only cell acym__listing__header__title"> | |
| 101 | - <?php echo esc_html(acym_translation('ACYM_IP')); ?> | |
| 102 | - </div> | |
| 103 | - <div class="medium-2 hide-for-small-only cell acym__listing__header__title"> | |
| 104 | - <?php echo esc_html(acym_translation('ACYM_ACTIONS')); ?> | |
| 105 | - </div> | |
| 106 | - <div class="medium-3 hide-for-small-only cell acym__listing__header__title"> | |
| 107 | - <?php echo esc_html(acym_translation('ACYM_DETAILS')); ?> | |
| 108 | - </div> | |
| 109 | - <div class="medium-3 hide-for-small-only cell acym__listing__header__title"> | |
| 110 | - <?php echo esc_html(acym_translation('ACYM_SOURCE')); ?> | |
| 111 | - </div> | |
| 112 | - </div> | |
| 113 | - <div class="acym__users__display__history__listing grid-x cell"> | |
| 114 | - <?php foreach ($data['userHistory'] as $key => $oneHistory) { ?> | |
| 115 | - <div class="grid-x cell text-center acym__listing__row grid-margin-x"> | |
| 116 | - <div class="cell small-12 medium-2"> | |
| 117 | - <?php echo esc_html(acym_date($oneHistory->date, acym_getDateTimeFormat())); ?> | |
| 118 | - </div> | |
| 119 | - <div class="cell small-6 medium-2 acym__users__display__history__listing__ip"> | |
| 120 | - <?php echo esc_html($oneHistory->ip); ?> | |
| 121 | - </div> | |
| 122 | - <div class="cell small-6 medium-2"> | |
| 123 | - <?php | |
| 124 | - $langKey = 'ACYM_ACTION_'.strtoupper($oneHistory->action); | |
| 125 | - $translation = acym_translation($langKey); | |
| 126 | - echo esc_html($translation === $langKey ? $oneHistory->action : $translation); | |
| 127 | - if ($oneHistory->action === 'unsubscribed' && !empty($oneHistory->unsubscribe_reason)) { | |
| 128 | - if (is_numeric($oneHistory->unsubscribe_reason)) { | |
| 129 | - $index = $oneHistory->unsubscribe_reason - 1; | |
| 130 | - $reason = $data['unsubReasons'][$index] ?? $oneHistory->unsubscribe_reason; | |
| 131 | - } else { | |
| 132 | - $reason = $oneHistory->unsubscribe_reason; | |
| 133 | - } | |
| 134 | - echo '<br />'.esc_html($reason); | |
| 135 | - } | |
| 136 | - ?> | |
| 137 | - </div> | |
| 138 | - <div class="cell small-6 medium-3"> | |
| 139 | - <?php | |
| 140 | - if (!empty($oneHistory->data)) { | |
| 141 | - $historyData = explode("\n", $oneHistory->data); | |
| 142 | - $details = '<div><h5>'.esc_html(acym_translation('ACYM_DETAILS')).'</h5><br />'; | |
| 143 | - if (!empty($oneHistory->mail_id)) { | |
| 144 | - $details .= '<b>'.esc_html(acym_translation('ACYM_CAMPAIGN')).' : </b>'; | |
| 145 | - $details .= esc_html($oneHistory->subject ?? '').' ( '.esc_html(acym_translation('ACYM_ID').' : '.$oneHistory->mail_id).' )<br />'; | |
| 146 | - } | |
| 147 | - | |
| 148 | - foreach ($historyData as $value) { | |
| 149 | - if (!strpos($value, '::')) { | |
| 150 | - $details .= $value.'<br />'; | |
| 151 | - continue; | |
| 152 | - } | |
| 153 | - [$part1, $part2] = explode('::', $value); | |
| 154 | - if (preg_match('#^[A-Z_]*$#', $part2)) { | |
| 155 | - $part2 = acym_translation($part2); | |
| 156 | - } | |
| 157 | - $details .= '<b>'.esc_html(acym_translation($part1)).' : </b>'.esc_html($part2).'<br />'; | |
| 158 | - } | |
| 159 | - | |
| 160 | - if ($oneHistory->action === 'unsubscribed') { | |
| 161 | - $details .= esc_html(acym_translation('ACYM_UNSUBSCRIBE_REASON')); | |
| 162 | - if (empty($oneHistory->unsubscribe_reason)) { | |
| 163 | - $details .= ' '.esc_html(acym_translation('ACYM_NO_REASON_SET_BY_USER')); | |
| 164 | - } else { | |
| 165 | - $reason = $data['historyClass']->getUnsubscribeReasonText($oneHistory->unsubscribe_reason); | |
| 166 | - $details .= ' '.esc_html($reason); | |
| 167 | - } | |
| 168 | - } | |
| 169 | - | |
| 170 | - $details .= '</div>'; | |
| 171 | - | |
| 172 | - acym_modal( | |
| 173 | - acym_translation('ACYM_VIEW_DETAILS'), | |
| 174 | - $details, | |
| 175 | - null, | |
| 176 | - ['style' => 'word-break: break-word;'], | |
| 177 | - ['class' => 'history_details'], | |
| 178 | - true, | |
| 179 | - false | |
| 180 | - ); | |
| 181 | - } | |
| 182 | - ?> | |
| 183 | - </div> | |
| 184 | - <div class="cell small-6 medium-3"> | |
| 185 | - <?php | |
| 186 | - if (!empty($oneHistory->source)) { | |
| 187 | - $source = explode("\n", $oneHistory->source); | |
| 188 | - $details = '<div><h5>'.esc_html(acym_translation('ACYM_SOURCE')).'</h5><br />'; | |
| 189 | - foreach ($source as $value) { | |
| 190 | - if (!strpos($value, '::')) continue; | |
| 191 | - [$part1, $part2] = explode('::', $value); | |
| 192 | - $details .= '<b>'.esc_html($part1).' : </b>'.esc_html($part2).'<br />'; | |
| 193 | - } | |
| 194 | - $details .= '</div>'; | |
| 195 | - | |
| 196 | - acym_modal( | |
| 197 | - acym_translation('ACYM_VIEW_SOURCE'), | |
| 198 | - $details, | |
| 199 | - null, | |
| 200 | - ['style' => 'word-break: break-word;'], | |
| 201 | - ['class' => 'history_details'] | |
| 202 | - ); | |
| 203 | - } | |
| 204 | - ?> | |
| 205 | - </div> | |
| 206 | - </div> | |
| 207 | - <?php } ?> | |
| 208 | - </div> | |
| 209 | - <?php } ?> | |
| 210 | - </div> | |
| 211 | - </div> | |
| 212 | -<?php } | |