PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.1
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.1
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
← All changes | back/dynamics/birthday/plugin.php +0 -47 10.0.1 → 11.1.1 View file →
@@ -1,47 +1,0 @@
1 -<?php
2 -
3 -use AcyMailing\Core\AcymPlugin;
4 -use AcyMailing\Classes\FieldClass;
5 -
6 -require_once __DIR__.DIRECTORY_SEPARATOR.'BirthdayAutomationTriggers.php';
7 -require_once __DIR__.DIRECTORY_SEPARATOR.'BirthdayCampaignType.php';
8 -require_once __DIR__.DIRECTORY_SEPARATOR.'BirthdayFollowup.php';
9 -
10 -class plgAcymBirthday extends AcymPlugin
11 -{
12 - use BirthdayAutomationTriggers;
13 - use BirthdayCampaignType;
14 - use BirthdayFollowup;
15 -
16 - public function onAcymProcessFilter_birthday(&$query, $options, $num = null)
17 - {
18 - if ($options['plugin'] !== get_class($this)) return;
19 -
20 - $dateToCheck = $this->processDateToCheck($options);
21 -
22 - $fieldClass = new FieldClass();
23 - $birthdayField = $fieldClass->getOneById($options['field']);
24 - if (empty($birthdayField)) return;
25 -
26 - $query->join['birthday_field'.$num] = '#__acym_user_has_field AS uf'.$num.' ON uf'.$num.'.user_id = user.id';
27 - $query->where[] = 'uf'.$num.'.field_id = '.intval($birthdayField->id);
28 - $query->where[] = 'uf'.$num.'.value LIKE '.acym_escapeDB('%'.date_format($dateToCheck, '-m-d'));
29 - }
30 -
31 - public function getBirthdayField(&$availableFields)
32 - {
33 - $fieldClass = new FieldClass();
34 - $dateFields = $fieldClass->getFieldsByType(['date']);
35 - foreach ($dateFields as $oneField) {
36 - $availableFields[$oneField->id] = acym_translation($oneField->name);
37 - }
38 - }
39 -
40 - public function getJsonBirthdayField()
41 - {
42 - $availableFields = [];
43 - $this->getBirthdayField($availableFields);
44 - echo json_encode(['fields' => $availableFields]);
45 - exit;
46 - }
47 -}