return CRM_Core_SelectValues::getRecurringFrequencyUnits($count);
}
+ /**
+ * Provides pseudoconstant list for `filter_contact_language`.
+ * @return array
+ */
+ public static function getFilterContactLanguageOptions(): array {
+ $languages = CRM_Core_I18n::languages(TRUE);
+ return $languages + [CRM_Core_I18n::NONE => ts('Contacts with no preferred language')];
+ }
+
+ /**
+ * Provides pseudoconstant list for `communication_language`.
+ * @return array
+ */
+ public static function getCommunicationLanguageOptions(): array {
+ $languages = CRM_Core_I18n::languages(TRUE);
+ return [CRM_Core_I18n::AUTO => ts('Follow recipient preferred language')] + $languages;
+ }
+
/**
* For each entity, get a list of entity-value labels.
*
'formatType',
'label',
'controlField',
+ 'min',
+ 'max',
/* Fixme: prior to CRM-13497 these were in a flat structure
// CRM-13497 moved them to be nested within 'html' but there's no point
// making that change in the DAOs right now since we are in the process of
];
$field['html'] = [];
foreach ($validOptions as $htmlOption) {
- if (!empty($fieldXML->html->$htmlOption)) {
+ if (isset($fieldXML->html->$htmlOption) && $fieldXML->html->$htmlOption !== '') {
$field['html'][$htmlOption] = $this->value($htmlOption, $fieldXML->html);
}
}
*
* Generated from xml/schema/CRM/Core/ActionSchedule.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:271b3b1e64984e8a221b98351ae68300)
+ * (GenCodeChecksum:cd1e6256f93e4fbc0bca48285b6b8258)
*/
/**
* Whether to return the plural version of the title.
*/
public static function getEntityTitle($plural = FALSE) {
- return $plural ? ts('Action Schedules') : ts('Action Schedule');
+ return $plural ? ts('Scheduled Reminders') : ts('Scheduled Reminder');
}
/**
'entity' => 'ActionSchedule',
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
+ 'html' => [
+ 'type' => 'Text',
+ ],
'add' => '3.4',
],
'title' => [
'entity' => 'ActionSchedule',
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
+ 'html' => [
+ 'type' => 'Text',
+ ],
'add' => '3.4',
],
'recipient' => [
'localizable' => 0,
'html' => [
'type' => 'Select',
- 'label' => ts("Recipient"),
+ 'label' => ts("Limit or Add Recipients"),
'controlField' => 'mapping_id',
],
'pseudoconstant' => [
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
'html' => [
+ 'type' => 'Number',
'label' => ts("Start Action Offset"),
+ 'min' => '0',
],
'add' => '3.4',
],
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
'html' => [
- 'label' => ts("Start Action condition"),
+ 'type' => 'Select',
+ 'label' => ts("Start Condition"),
+ ],
+ 'pseudoconstant' => [
+ 'callback' => 'CRM_Core_SelectValues::beforeAfter',
],
'add' => '3.4',
],
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
'html' => [
+ 'type' => 'Number',
'label' => ts("Repetition Frequency Interval"),
+ 'min' => '0',
],
'add' => '3.4',
],
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
'html' => [
+ 'type' => 'Number',
'label' => ts("End Frequency Interval"),
+ 'min' => '0',
],
'add' => '3.4',
],
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
'html' => [
- 'label' => ts("End Action"),
+ 'type' => 'Select',
+ 'label' => ts("End Condition"),
+ ],
+ 'pseudoconstant' => [
+ 'callback' => 'CRM_Core_SelectValues::beforeAfter',
],
'add' => '3.4',
],
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
'serialize' => self::SERIALIZE_COMMA,
+ 'html' => [
+ 'type' => 'EntityRef',
+ 'label' => ts("Manual Recipients"),
+ ],
'add' => '3.4',
],
'recipient_listing' => [
'entity' => 'ActionSchedule',
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
+ 'html' => [
+ 'type' => 'TextArea',
+ ],
'add' => '3.4',
],
'body_html' => [
'entity' => 'ActionSchedule',
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
+ 'html' => [
+ 'type' => 'RichTextEditor',
+ ],
'add' => '3.4',
],
'sms_body_text' => [
'entity' => 'ActionSchedule',
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
+ 'html' => [
+ 'type' => 'TextArea',
+ ],
'add' => '4.5',
],
'subject' => [
'entity' => 'ActionSchedule',
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
+ 'html' => [
+ 'type' => 'Text',
+ ],
'add' => '3.4',
],
'record_activity' => [
'name' => 'record_activity',
'type' => CRM_Utils_Type::T_BOOLEAN,
- 'title' => ts('Record Activity for Reminder?'),
+ 'title' => ts('Record Activity'),
'description' => ts('Record Activity for this reminder?'),
'required' => TRUE,
'usage' => [
'entity' => 'ActionSchedule',
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
+ 'html' => [
+ 'type' => 'CheckBox',
+ ],
'add' => '3.4',
],
'mapping_id' => [
'entity' => 'ActionSchedule',
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
+ 'html' => [
+ 'type' => 'Select Date',
+ 'formatType' => 'activityDate',
+ ],
'add' => '4.1',
],
'from_name' => [
'entity' => 'ActionSchedule',
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
+ 'html' => [
+ 'type' => 'Text',
+ 'label' => ts("From Name"),
+ ],
'add' => '4.5',
],
'from_email' => [
'entity' => 'ActionSchedule',
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
+ 'html' => [
+ 'type' => 'Email',
+ 'label' => ts("From Email"),
+ ],
'add' => '4.5',
],
'mode' => [
'type' => 'Select',
'label' => ts("SMS Provider"),
],
+ 'pseudoconstant' => [
+ 'callback' => 'CRM_Core_SelectValues::smsProvider',
+ ],
'add' => '4.5',
],
'used_for' => [
'entity' => 'ActionSchedule',
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
+ 'serialize' => self::SERIALIZE_SEPARATOR_TRIMMED,
'html' => [
- 'label' => ts("Filter Contact Language"),
+ 'type' => 'Select',
+ 'label' => ts("Recipients Language"),
+ ],
+ 'pseudoconstant' => [
+ 'callback' => 'CRM_Core_BAO_ActionSchedule::getFilterContactLanguageOptions',
],
'add' => '4.7',
],
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
'html' => [
+ 'type' => 'Select',
'label' => ts("Communication Language"),
],
+ 'pseudoconstant' => [
+ 'callback' => 'CRM_Core_BAO_ActionSchedule::getCommunicationLanguageOptions',
+ ],
'add' => '4.7',
],
'action_schedule_created_date' => [
'entity' => 'ActionSchedule',
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
+ 'html' => [
+ 'type' => 'Select Date',
+ 'formatType' => 'activityDate',
+ ],
'add' => '5.34',
],
'action_schedule_effective_end_date' => [
'entity' => 'ActionSchedule',
'bao' => 'CRM_Core_BAO_ActionSchedule',
'localizable' => 0,
+ 'html' => [
+ 'type' => 'Select Date',
+ 'formatType' => 'activityDate',
+ ],
'add' => '5.34',
],
];
return $addr;
}
+ public static function smsProvider(): array {
+ $providers = CRM_SMS_BAO_Provider::getProviders(NULL, NULL, TRUE, 'is_default desc, title');
+ $result = [];
+ foreach ($providers as $provider) {
+ $result[] = [
+ 'id' => $provider['id'],
+ 'name' => $provider['name'],
+ 'label' => $provider['title'],
+ ];
+ }
+ return $result;
+ }
+
/**
* Different type of Mailing Tokens.
*
];
}
+ public static function beforeAfter() {
+ return [
+ 'before' => ts('Before'),
+ 'after' => ts('After'),
+ ];
+ }
+
/**
* Columns from the option_value table which may or may not be used by each option_group.
*
<comment>Table to store the reminders.</comment>
<add>3.4</add>
<labelField>title</labelField>
+ <title>Scheduled Reminder</title>
<paths>
<browse>civicrm/admin/scheduleReminders</browse>
<add>civicrm/admin/scheduleReminders/edit?reset=1&action=add</add>
<name>name</name>
<title>Name</title>
<type>varchar</type>
+ <html>
+ <type>Text</type>
+ </html>
<length>64</length>
<comment>Name of the action(reminder)</comment>
<add>3.4</add>
<name>title</name>
<title>Title</title>
<type>varchar</type>
+ <html>
+ <type>Text</type>
+ </html>
<length>64</length>
<comment>Title of the action(reminder)</comment>
<add>3.4</add>
<length>64</length>
<comment>Recipient</comment>
<html>
- <label>Recipient</label>
+ <label>Limit or Add Recipients</label>
<type>Select</type>
<controlField>mapping_id</controlField>
</html>
<comment>Reminder Interval.</comment>
<default>0</default>
<html>
+ <type>Number</type>
+ <min>0</min>
<label>Start Action Offset</label>
</html>
<add>3.4</add>
<length>64</length>
<comment>Reminder Action</comment>
<html>
- <label>Start Action condition</label>
+ <type>Select</type>
+ <label>Start Condition</label>
</html>
+ <pseudoconstant>
+ <callback>CRM_Core_SelectValues::beforeAfter</callback>
+ </pseudoconstant>
<add>3.4</add>
</field>
<field>
<default>0</default>
<comment>Time interval for repeating the reminder.</comment>
<html>
+ <type>Number</type>
+ <min>0</min>
<label>Repetition Frequency Interval</label>
</html>
<add>3.4</add>
<type>int unsigned</type>
<comment>Time interval till repeating the reminder.</comment>
<html>
+ <type>Number</type>
+ <min>0</min>
<label>End Frequency Interval</label>
</html>
<add>3.4</add>
<length>32</length>
<comment>Reminder Action till repeating the reminder.</comment>
<html>
- <label>End Action</label>
+ <type>Select</type>
+ <label>End Condition</label>
</html>
+ <pseudoconstant>
+ <callback>CRM_Core_SelectValues::beforeAfter</callback>
+ </pseudoconstant>
<add>3.4</add>
</field>
<field>
<name>recipient_manual</name>
<title>Recipient Manual</title>
<type>varchar</type>
+ <html>
+ <type>EntityRef</type>
+ <label>Manual Recipients</label>
+ <multiple>1</multiple>
+ </html>
<length>128</length>
<comment>Contact IDs to which reminder should be sent.</comment>
<serialize>COMMA</serialize>
<name>body_text</name>
<title>Reminder Text</title>
<type>longtext</type>
+ <html>
+ <type>TextArea</type>
+ </html>
<comment>Body of the mailing in text format.</comment>
<add>3.4</add>
</field>
<name>body_html</name>
<title>Reminder HTML</title>
<type>longtext</type>
+ <html>
+ <type>RichTextEditor</type>
+ </html>
<comment>Body of the mailing in html format.</comment>
<add>3.4</add>
</field>
<name>sms_body_text</name>
<title>SMS Reminder Text</title>
<type>longtext</type>
+ <html>
+ <type>TextArea</type>
+ </html>
<comment>Content of the SMS text.</comment>
<add>4.5</add>
</field>
<name>subject</name>
<title>Reminder Subject</title>
<type>varchar</type>
+ <html>
+ <type>Text</type>
+ </html>
<length>128</length>
<comment>Subject of mailing</comment>
<add>3.4</add>
</field>
<field>
<name>record_activity</name>
- <title>Record Activity for Reminder?</title>
+ <title>Record Activity</title>
<type>boolean</type>
+ <html>
+ <type>CheckBox</type>
+ </html>
<default>0</default>
<required>true</required>
<comment>Record Activity for this reminder?</comment>
<name>absolute_date</name>
<title>Fixed Date for Reminder</title>
<type>date</type>
+ <html>
+ <type>Select Date</type>
+ <formatType>activityDate</formatType>
+ </html>
<comment>Date on which the reminder be sent.</comment>
<add>4.1</add>
</field>
<name>from_name</name>
<title>Reminder from Name</title>
<type>varchar</type>
+ <html>
+ <label>From Name</label>
+ <type>Text</type>
+ </html>
<length>255</length>
<comment>Name in "from" field</comment>
<add>4.5</add>
<name>from_email</name>
<title>Reminder From Email</title>
<type>varchar</type>
+ <html>
+ <label>From Email</label>
+ <type>Email</type>
+ </html>
<length>255</length>
<comment>Email address in "from" field</comment>
<add>4.5</add>
<type>Select</type>
<label>SMS Provider</label>
</html>
+ <pseudoconstant>
+ <callback>CRM_Core_SelectValues::smsProvider</callback>
+ </pseudoconstant>
</field>
<foreignKey>
<name>sms_provider_id</name>
<type>varchar</type>
<length>128</length>
<comment>Used for multilingual installation</comment>
+ <serialize>SEPARATOR_TRIMMED</serialize>
<html>
- <label>Filter Contact Language</label>
+ <type>Select</type>
+ <multiple>1</multiple>
+ <label>Recipients Language</label>
</html>
+ <pseudoconstant>
+ <callback>CRM_Core_BAO_ActionSchedule::getFilterContactLanguageOptions</callback>
+ </pseudoconstant>
<add>4.7</add>
</field>
<field>
<length>8</length>
<comment>Used for multilingual installation</comment>
<html>
+ <type>Select</type>
<label>Communication Language</label>
</html>
+ <pseudoconstant>
+ <callback>CRM_Core_BAO_ActionSchedule::getCommunicationLanguageOptions</callback>
+ </pseudoconstant>
<add>4.7</add>
</field>
<field>
<title>Effective start date</title>
<uniqueName>action_schedule_effective_start_date</uniqueName>
<type>timestamp</type>
+ <html>
+ <type>Select Date</type>
+ <formatType>activityDate</formatType>
+ </html>
<comment>Earliest date to consider start events from.</comment>
<required>false</required>
<export>true</export>
<title>Effective end date</title>
<uniqueName>action_schedule_effective_end_date</uniqueName>
<type>timestamp</type>
+ <html>
+ <type>Select Date</type>
+ <formatType>activityDate</formatType>
+ </html>
<comment>Latest date to consider end events from.</comment>
<required>false</required>
<export>true</export>