| 1 |
<?php if (empty($data['allUsers'])) { ?> |
| 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 grid-x margin-top-1"> |
| 5 |
<div class="grid-x acym__listing__actions cell margin-bottom-1"> |
| 6 |
<?php |
| 7 |
$actions = [ |
| 8 |
'setActive' => acym_translation('ACYM_ACTIVATE'), |
| 9 |
'setInactive' => acym_translation('ACYM_DEACTIVATE'), |
| 10 |
'delete' => acym_translation('ACYM_DELETE'), |
| 11 |
]; |
| 12 |
echo acym_listingActions($actions); |
| 13 |
?> |
| 14 |
</div> |
| 15 |
<div class="cell grid-x align-justify"> |
| 16 |
<div class="cell grid-x large-shrink acym_vcenter"> |
| 17 |
<?php |
| 18 |
$options = [ |
| 19 |
'' => ['ACYM_ALL', $data['userNumberPerStatus']['all']], |
| 20 |
'active' => ['ACYM_ACTIVE', $data['userNumberPerStatus']['active']], |
| 21 |
'inactive' => ['ACYM_INACTIVE', $data['userNumberPerStatus']['inactive']], |
| 22 |
]; |
| 23 |
if ($this->config->get('require_confirmation', '0') == '1') { |
| 24 |
$options['confirmed'] = ['ACYM_CONFIRMED', $data['userNumberPerStatus']['confirmed']]; |
| 25 |
$options['unconfirmed'] = ['ACYM_NOT_CONFIRMED', $data['userNumberPerStatus']['unconfirmed']]; |
| 26 |
} |
| 27 |
echo acym_filterStatus($options, $data['status'], 'users_status'); |
| 28 |
?> |
| 29 |
</div> |
| 30 |
<div class="cell large-shrink acym_listing_sort-by"> |
| 31 |
<?php echo acym_sortBy( |
| 32 |
[ |
| 33 |
'id' => acym_strtolower(acym_translation('ACYM_ID')), |
| 34 |
'email' => acym_translation('ACYM_EMAIL'), |
| 35 |
'name' => acym_translation('ACYM_NAME'), |
| 36 |
'creation_date' => acym_translation('ACYM_DATE_CREATED'), |
| 37 |
'active' => acym_translation('ACYM_ACTIVE'), |
| 38 |
'confirmed' => acym_translation('ACYM_CONFIRMED'), |
| 39 |
'cms_id' => acym_translation('ACYM_USER_CMSID'), |
| 40 |
], |
| 41 |
'users', |
| 42 |
$data['ordering'] |
| 43 |
); ?> |
| 44 |
</div> |
| 45 |
</div> |
| 46 |
</div> |
| 47 |
<div class="grid-x acym__listing"> |
| 48 |
<div class="grid-x cell acym__listing__header"> |
| 49 |
<div class="medium-shrink small-1 cell"> |
| 50 |
<input id="checkbox_all" type="checkbox" name="checkbox_all"> |
| 51 |
</div> |
| 52 |
<div class="grid-x medium-auto small-11 cell acym__listing__header__title__container"> |
| 53 |
<div class="cell medium-4 small-7 xlarge-3 acym__listing__header__title"> |
| 54 |
<?php echo acym_translation('ACYM_EMAIL'); ?> |
| 55 |
</div> |
| 56 |
<div class="cell hide-for-small-only hide-for-medium-only large-2 acym__listing__header__title"> |
| 57 |
<?php echo acym_translation('ACYM_NAME'); ?> |
| 58 |
</div> |
| 59 |
<div class="cell hide-for-small-only hide-for-medium-only large-2 xlarge-1 acym__listing__header__title"> |
| 60 |
<?php echo acym_translation('ACYM_DATE_CREATED'); ?> |
| 61 |
</div> |
| 62 |
<?php |
| 63 |
if (!empty($data['fields'])) { |
| 64 |
foreach ($data['fields'] as $field) { |
| 65 |
?> |
| 66 |
<div class="cell medium-auto hide-for-small-only acym__listing__header__title"> |
| 67 |
<?php echo acym_escape(acym_translation($field)); ?> |
| 68 |
</div> |
| 69 |
<?php |
| 70 |
} |
| 71 |
} |
| 72 |
?> |
| 73 |
<div class="cell medium-auto hide-for-small-only acym__listing__header__title"> |
| 74 |
<?php echo acym_translation('ACYM_LISTS'); ?> |
| 75 |
</div> |
| 76 |
<?php if (acym_isAdmin()) { ?> |
| 77 |
<div class="cell medium-1 hide-for-small-only acym__listing__header__title"> |
| 78 |
<?php echo acym_translationSprintf('ACYM_CMS_USER', ACYM_CMS_TITLE); ?> |
| 79 |
</div> |
| 80 |
<?php } ?> |
| 81 |
<div class="cell medium-1 small-5 small-text-right medium-text-center acym__listing__header__title"> |
| 82 |
<?php echo acym_translation('ACYM_STATUS'); ?> |
| 83 |
</div> |
| 84 |
<div class="large-1 cell hide-for-small-only hide-for-medium-only text-center acym__listing__header__title"> |
| 85 |
<?php echo acym_translation('ACYM_ACTIONS') ?> |
| 86 |
</div> |
| 87 |
<div class="cell medium-shrink hide-for-small-only text-center acym__listing__header__title acym__listing__id"> |
| 88 |
<?php echo acym_translation('ACYM_ID'); ?> |
| 89 |
</div> |
| 90 |
</div> |
| 91 |
</div> |
| 92 |
<?php |
| 93 |
foreach ($data['allUsers'] as $user) { |
| 94 |
$linkUser = acym_completeLink(acym_getVar('cmd', 'ctrl').'&task=edit&userId='.$user->id); |
| 95 |
?> |
| 96 |
<div class="grid-x cell align-middle acym__listing__row"> |
| 97 |
<div class="medium-shrink small-1 cell"> |
| 98 |
<input id="checkbox_<?php echo acym_escape($user->id); ?>" type="checkbox" name="elements_checked[]" value="<?php echo acym_escape($user->id); ?>"> |
| 99 |
</div> |
| 100 |
<div class="grid-x medium-auto small-11 cell acym__listing__title__container"> |
| 101 |
<div class="grid-x cell small-9 medium-4 xlarge-3 acym__listing__title"> |
| 102 |
<a class="cell auto" href="<?php echo $linkUser; ?>"> |
| 103 |
<div><?php echo acym_escape($user->email); ?></div> |
| 104 |
</a> |
| 105 |
</div> |
| 106 |
<div class="cell hide-for-small-only hide-for-medium-only large-2"> |
| 107 |
<?php echo acym_escape($user->name); ?> |
| 108 |
</div> |
| 109 |
<div class="cell hide-for-small-only hide-for-medium-only large-2 xlarge-1"> |
| 110 |
<?php |
| 111 |
echo acym_tooltip( |
| 112 |
[ |
| 113 |
'hoveredText' => acym_date( |
| 114 |
$user->creation_date, |
| 115 |
acym_getDateTimeFormat('ACYM_DATE_FORMAT_LC5') |
| 116 |
), |
| 117 |
'textShownInTooltip' => acym_date( |
| 118 |
$user->creation_date, |
| 119 |
'Y-m-d H:i:s' |
| 120 |
), |
| 121 |
] |
| 122 |
); |
| 123 |
?> |
| 124 |
</div> |
| 125 |
<?php |
| 126 |
if (!empty($user->fields)) { |
| 127 |
foreach ($user->fields as $field) { |
| 128 |
?> |
| 129 |
<div class="medium-auto hide-for-small-only cell"> |
| 130 |
<?php echo acym_escape($field); ?> |
| 131 |
</div> |
| 132 |
<?php |
| 133 |
} |
| 134 |
} |
| 135 |
?> |
| 136 |
<div class="acym__users__subscription medium-auto small-11 cell"> |
| 137 |
<?php |
| 138 |
if (!empty($data['usersSubscriptions'][$user->id])) { |
| 139 |
$subscriptionsCount = count($data['usersSubscriptions'][$user->id]); |
| 140 |
$counter = 0; |
| 141 |
foreach ($data['usersSubscriptions'][$user->id] as $oneSub) { |
| 142 |
$classes = 'acym_subscription acym_toggleable '; |
| 143 |
$newvalue = intval($oneSub->status) === 1 ? 0 : 1; |
| 144 |
$classes .= $newvalue === 0 ? 'acymicon-circle' : 'acymicon-radio-button-unchecked'; |
| 145 |
if ($counter >= 5 && $subscriptionsCount !== 6) $classes .= ' acym_subscription_more'; |
| 146 |
$toggleAttributes = 'data-acy-user-id="'.$user->id.'" data-acy-list-name="'.$oneSub->name.'" data-acy-list-id="'.$oneSub->id.'"'; |
| 147 |
|
| 148 |
$dataTask = $newvalue === 0 ? 'unsubscribeOnClick' : 'subscribeOnClick'; |
| 149 |
$toggleAttributes .= ' data-acy-task="'.$dataTask.'"'; |
| 150 |
|
| 151 |
$toggleAttributes .= ' data-acy-newvalue="'.$newvalue.'"'; |
| 152 |
|
| 153 |
echo acym_tooltip( |
| 154 |
[ |
| 155 |
'hoveredText' => '<i class="'.$classes.'" style="color:'.acym_escape($oneSub->color).'" '.$toggleAttributes.'></i>', |
| 156 |
'textShownInTooltip' => acym_translationSprintf( |
| 157 |
$newvalue === 0 ? 'ACYM_SUBSCRIBED_TO_LIST' : 'ACYM_UNSUBSCRIBED_FROM_LIST', |
| 158 |
acym_escape($oneSub->name) |
| 159 |
), |
| 160 |
] |
| 161 |
); |
| 162 |
$counter++; |
| 163 |
} |
| 164 |
|
| 165 |
if ($counter > 5 && $subscriptionsCount !== 6) { |
| 166 |
$counter = $counter - 5; |
| 167 |
echo '<span class="acym__user__show-subscription acymicon-stack" data-iscollapsed="0" acym-data-value="'.$counter.'"> |
| 168 |
<i class="acym__user__button__showsubscription acymicon-circle acymicon-stack-2x"></i> |
| 169 |
<span class="acym__listing__text acym__user__show-subscription-bt acymicon-stack-1x">+'.$counter.'</span> |
| 170 |
</span>'; |
| 171 |
} |
| 172 |
} |
| 173 |
?> |
| 174 |
</div> |
| 175 |
<?php if (acym_isAdmin()) { ?> |
| 176 |
<div class="cell hide-for-small-only medium-1"> |
| 177 |
<?php |
| 178 |
if (empty($user->cms_id)) { |
| 179 |
echo '-'; |
| 180 |
} else { |
| 181 |
echo '<a href="'.acym_getCmsUserEdit($user->cms_id).'" target="_blank">'; |
| 182 |
echo $user->cms_username.'<br />'; |
| 183 |
echo acym_translation('ACYM_ID').': '.$user->cms_id; |
| 184 |
echo '</a>'; |
| 185 |
} |
| 186 |
?> |
| 187 |
</div> |
| 188 |
<?php } ?> |
| 189 |
<div class="acym__listing__controls acym__users__controls small-1 text-center cell acym__icon__table"> |
| 190 |
<?php |
| 191 |
if ($user->active == 1) { |
| 192 |
$class = 'acymicon-check-circle acym__color__green" data-acy-newvalue="0'; |
| 193 |
$tooltip = 'ACYM_ACTIVATED'; |
| 194 |
} else { |
| 195 |
$class = 'acymicon-times-circle acym__color__red" data-acy-newvalue="1'; |
| 196 |
$tooltip = 'ACYM_DEACTIVATED'; |
| 197 |
} |
| 198 |
echo acym_tooltip( |
| 199 |
[ |
| 200 |
'hoveredText' => '<i data-acy-table="user" data-acy-field="active" data-acy-elementid="'.acym_escape( |
| 201 |
$user->id |
| 202 |
).'" class="acym_toggleable '.$class.'"></i>', |
| 203 |
'textShownInTooltip' => acym_translation($tooltip), |
| 204 |
] |
| 205 |
); |
| 206 |
|
| 207 |
if ($this->config->get('require_confirmation', '0') == '1') { |
| 208 |
if ($user->confirmed == 1) { |
| 209 |
$class = 'acymicon-check-circle acym__color__green" data-acy-newvalue="0'; |
| 210 |
$tooltip = 'ACYM_CONFIRMED'; |
| 211 |
} else { |
| 212 |
$class = 'acymicon-times-circle acym__color__red" data-acy-newvalue="1'; |
| 213 |
$tooltip = 'ACYM_NOT_CONFIRMED'; |
| 214 |
} |
| 215 |
echo acym_tooltip( |
| 216 |
[ |
| 217 |
'hoveredText' => '<i data-acy-table="user" data-acy-field="confirmed" data-acy-elementid="'.acym_escape( |
| 218 |
$user->id |
| 219 |
).'" class="acym_toggleable '.$class.'"></i>', |
| 220 |
'textShownInTooltip' => acym_translation($tooltip), |
| 221 |
] |
| 222 |
); |
| 223 |
} |
| 224 |
?> |
| 225 |
</div> |
| 226 |
<div class="large-1 hide-for-small-only hide-for-medium-only cell text-center acym__icon__table"> |
| 227 |
<a href="<?php echo $linkUser; ?>"><i class="acymicon-pencil" title="<?php echo acym_translation('ACYM_EDIT'); ?>"></i></a> |
| 228 |
<?php if (acym_isAdmin()) { ?> |
| 229 |
<a><i class="acymicon-download fastActions" |
| 230 |
data-action="export" |
| 231 |
data-acy-elementid="<?php echo acym_escape($user->id); ?>" |
| 232 |
title="<?php echo acym_translation('ACYM_EXPORT'); ?>"></i></a> |
| 233 |
<?php } ?> |
| 234 |
<i class="cursor-pointer acymicon-delete fastActions deleteFastAction" |
| 235 |
data-action="delete" |
| 236 |
data-acy-elementid="<?php echo acym_escape($user->id); ?>" |
| 237 |
title="<?php echo acym_translation('ACYM_DELETE'); ?>"></i> |
| 238 |
</div> |
| 239 |
<div class="text-center medium-shrink hide-for-small-only acym__listing__text acym__listing__id"><?php echo acym_escape($user->id); ?></div> |
| 240 |
</div> |
| 241 |
</div> |
| 242 |
<?php |
| 243 |
} |
| 244 |
?> |
| 245 |
</div> |
| 246 |
<?php |
| 247 |
echo $data['pagination']->display('users'); |
| 248 |
} |
| 249 |
|