projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #14927 from seamuslee001/remove_template_field_mosaico
[civicrm-core.git]
/
CRM
/
Member
/
Tokens.php
diff --git
a/CRM/Member/Tokens.php
b/CRM/Member/Tokens.php
index ae603efb516a75f7d84dadebc809a3864fd2ac50..44100317acadb61f41b6e539fb972c17dd64b56b 100644
(file)
--- a/
CRM/Member/Tokens.php
+++ b/
CRM/Member/Tokens.php
@@
-4,7
+4,7
@@
+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-201
8
|
+ | Copyright CiviCRM LLC (c) 2004-201
9
|
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
@@
-45,7
+45,7
@@
class CRM_Member_Tokens extends \Civi\Token\AbstractTokenSubscriber {
*/
public function __construct() {
parent::__construct('membership', array_merge(
*/
public function __construct() {
parent::__construct('membership', array_merge(
- array(
+ [
'fee' => ts('Membership Fee'),
'id' => ts('Membership ID'),
'join_date' => ts('Membership Join Date'),
'fee' => ts('Membership Fee'),
'id' => ts('Membership ID'),
'join_date' => ts('Membership Join Date'),
@@
-53,7
+53,7
@@
class CRM_Member_Tokens extends \Civi\Token\AbstractTokenSubscriber {
'end_date' => ts('Membership End Date'),
'status' => ts('Membership Status'),
'type' => ts('Membership Type'),
'end_date' => ts('Membership End Date'),
'status' => ts('Membership Status'),
'type' => ts('Membership Type'),
-
)
,
+
]
,
CRM_Utils_Token::getCustomFieldTokens('Membership')
));
}
CRM_Utils_Token::getCustomFieldTokens('Membership')
));
}
@@
-63,8
+63,7
@@
class CRM_Member_Tokens extends \Civi\Token\AbstractTokenSubscriber {
*/
public function checkActive(\Civi\Token\TokenProcessor $processor) {
// Extracted from scheduled-reminders code. See the class description.
*/
public function checkActive(\Civi\Token\TokenProcessor $processor) {
// Extracted from scheduled-reminders code. See the class description.
- return
- !empty($processor->context['actionMapping'])
+ return !empty($processor->context['actionMapping'])
&& $processor->context['actionMapping']->getEntity() === 'civicrm_membership';
}
&& $processor->context['actionMapping']->getEntity() === 'civicrm_membership';
}
@@
-92,7
+91,7
@@
class CRM_Member_Tokens extends \Civi\Token\AbstractTokenSubscriber {
public function evaluateToken(\Civi\Token\TokenRow $row, $entity, $field, $prefetch = NULL) {
$actionSearchResult = $row->context['actionSearchResult'];
public function evaluateToken(\Civi\Token\TokenRow $row, $entity, $field, $prefetch = NULL) {
$actionSearchResult = $row->context['actionSearchResult'];
- if (in_array($field,
array('start_date', 'end_date', 'join_date')
)) {
+ if (in_array($field,
['start_date', 'end_date', 'join_date']
)) {
$row->tokens($entity, $field, \CRM_Utils_Date::customFormat($actionSearchResult->$field));
}
elseif (isset($actionSearchResult->$field)) {
$row->tokens($entity, $field, \CRM_Utils_Date::customFormat($actionSearchResult->$field));
}
elseif (isset($actionSearchResult->$field)) {