← All changes
|
back/dynamics/subscription/SubscriptionFollowup.php
+0
-48
10.2.2
→
11.1.1
View file →
| @@ -1,48 +1,0 @@ | ||
| 1 | -<?php | |
| 2 | - | |
| 3 | -trait SubscriptionFollowup | |
| 4 | -{ | |
| 5 | - public function matchFollowupsConditions(&$followups, $userId, $params) | |
| 6 | - { | |
| 7 | - foreach ($followups as $key => $followup) { | |
| 8 | - if (empty($followup->condition['lists_status']) || empty($followup->condition['lists'])) { | |
| 9 | - continue; | |
| 10 | - } | |
| 11 | - | |
| 12 | - $status = $followup->condition['lists_status'] === 'is'; | |
| 13 | - if ($followup->trigger === $this->subscribeTrigger) { | |
| 14 | - $user = false; | |
| 15 | - foreach ($followup->condition['lists'] as $list) { | |
| 16 | - if (in_array($list, $params['sub_lists'])) { | |
| 17 | - $user = true; | |
| 18 | - break; | |
| 19 | - } | |
| 20 | - } | |
| 21 | - } else { | |
| 22 | - $lists = implode(',', $followup->condition['lists']); | |
| 23 | - $user = acym_loadObject('SELECT * FROM #__acym_user_has_list WHERE user_id = '.intval($userId).' AND status = 1 AND list_id IN ('.$lists.')'); | |
| 24 | - } | |
| 25 | - | |
| 26 | - if (($status && empty($user)) || (!$status && !empty($user))) { | |
| 27 | - unset($followups[$key]); | |
| 28 | - } | |
| 29 | - } | |
| 30 | - } | |
| 31 | - | |
| 32 | - public function getFollowupTriggers(&$triggers) | |
| 33 | - { | |
| 34 | - $triggers[$this->subscribeTrigger] = acym_translation('ACYM_USER_SUBSCRIBES'); | |
| 35 | - } | |
| 36 | - | |
| 37 | - public function getFollowupTriggerBlock(&$blocks) | |
| 38 | - { | |
| 39 | - $blocks[] = [ | |
| 40 | - 'name' => acym_translation('ACYM_USER_SUBSCRIBES'), | |
| 41 | - 'description' => acym_translation('ACYM_USER_SUBSCRIBES_DESC'), | |
| 42 | - 'icon' => 'acymicon-user-check', | |
| 43 | - 'link' => acym_completeLink('campaigns&task=edit&step=followupCondition&trigger='.$this->subscribeTrigger), | |
| 44 | - 'level' => 2, | |
| 45 | - 'alias' => $this->subscribeTrigger, | |
| 46 | - ]; | |
| 47 | - } | |
| 48 | -} | |