diff --git a/CRM/Admin/Page/AJAX.php b/CRM/Admin/Page/AJAX.php index 1fef6d99e87f..24f4c25f58a7 100644 --- a/CRM/Admin/Page/AJAX.php +++ b/CRM/Admin/Page/AJAX.php @@ -165,7 +165,7 @@ public static function getStatusMsg() { $ret['content'] = ts('Are you sure you want to disable this Participant Status?') . '

' . ts('Users will no longer be able to select this value when adding or editing Participant Status.'); break; - case 'CRM_Mailing_BAO_Component': + case 'CRM_Mailing_BAO_MailingComponent': $ret['content'] = ts('Are you sure you want to disable this component?'); break; diff --git a/CRM/Core/DAO/AllCoreTables.data.php b/CRM/Core/DAO/AllCoreTables.data.php index 4f25998aa3d2..e42e08bf4eb9 100644 --- a/CRM/Core/DAO/AllCoreTables.data.php +++ b/CRM/Core/DAO/AllCoreTables.data.php @@ -122,9 +122,9 @@ 'class' => 'CRM_Batch_DAO_EntityBatch', 'table' => 'civicrm_entity_batch', ], - 'CRM_Mailing_DAO_Component' => [ - 'name' => 'Component', - 'class' => 'CRM_Mailing_DAO_Component', + 'CRM_Mailing_DAO_MailingComponent' => [ + 'name' => 'MailingComponent', + 'class' => 'CRM_Mailing_DAO_MailingComponent', 'table' => 'civicrm_mailing_component', ], 'CRM_Mailing_DAO_MailingAB' => [ diff --git a/CRM/Core/DAO/Component.php b/CRM/Core/DAO/Component.php index a4823bf1180a..e1fafce1a334 100644 --- a/CRM/Core/DAO/Component.php +++ b/CRM/Core/DAO/Component.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Component.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:14ca0040d5a5656fd5dd91ad60a8ac89) + * (GenCodeChecksum:d0152fb407a743b3e15fd20c35f41c67) */ /** @@ -69,6 +69,7 @@ public static function &fields() { 'id' => [ 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, + 'title' => ts('Component ID'), 'description' => 'Component ID', 'required' => TRUE, 'table_name' => 'civicrm_component', diff --git a/CRM/Mailing/BAO/Component.php b/CRM/Mailing/BAO/Component.php index 6840e3edeee9..8137d4a64256 100644 --- a/CRM/Mailing/BAO/Component.php +++ b/CRM/Mailing/BAO/Component.php @@ -1,121 +1,10 @@ copyValues($params); - if ($component->find(TRUE)) { - CRM_Core_DAO::storeValues($component, $defaults); - return $component; - } - return NULL; - } - - /** - * Update the is_active flag in the db. - * - * @param int $id - * Id of the database record. - * @param bool $is_active - * Value we want to set the is_active field. - * - * @return bool - * true if we found and updated the object, else false - */ - public static function setIsActive($id, $is_active) { - return CRM_Core_DAO::setFieldValue('CRM_Mailing_DAO_Component', $id, 'is_active', $is_active); - } - - /** - * Create and Update mailing component. - * - * @param array $params - * (reference ) an assoc array of name/value pairs. - * @param array $ids - * (deprecated) the array that holds all the db ids. - * - * @return CRM_Mailing_BAO_Component - */ - public static function add(&$params, $ids = array()) { - $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('id', $ids)); - $component = new CRM_Mailing_DAO_Component(); - if ($id) { - $component->id = $id; - $component->find(TRUE); - } - - $component->copyValues($params); - if (empty($id) && empty($params['body_text'])) { - $component->body_text = CRM_Utils_String::htmlToText(CRM_Utils_Array::value('body_html', $params)); - } - - if ($component->is_default) { - if (!empty($id)) { - $sql = 'UPDATE civicrm_mailing_component SET is_default = 0 WHERE component_type = %1 AND id <> %2'; - $sqlParams = array( - 1 => array($component->component_type, 'String'), - 2 => array($id, 'Positive'), - ); - } - else { - $sql = 'UPDATE civicrm_mailing_component SET is_default = 0 WHERE component_type = %1'; - $sqlParams = array( - 1 => array($component->component_type, 'String'), - ); - } - CRM_Core_DAO::executeQuery($sql, $sqlParams); - } - - $component->save(); - return $component; - } +class CRM_Mailing_BAO_Component extends CRM_Mailing_BAO_MailingComponent { } diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index 212284f00ee8..f7087d35ca8f 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -823,14 +823,14 @@ public function getTestRecipients($testParams) { */ private function getHeaderFooter() { if (!$this->header and $this->header_id) { - $this->header = new CRM_Mailing_BAO_Component(); + $this->header = new CRM_Mailing_BAO_MailingComponent(); $this->header->id = $this->header_id; $this->header->find(TRUE); $this->header->free(); } if (!$this->footer and $this->footer_id) { - $this->footer = new CRM_Mailing_BAO_Component(); + $this->footer = new CRM_Mailing_BAO_MailingComponent(); $this->footer->id = $this->footer_id; $this->footer->find(TRUE); $this->footer->free(); @@ -1691,8 +1691,8 @@ public static function checkSendable($mailing) { } if (!Civi::settings()->get('disable_mandatory_tokens_check')) { - $header = $mailing->header_id && $mailing->header_id != 'null' ? CRM_Mailing_BAO_Component::findById($mailing->header_id) : NULL; - $footer = $mailing->footer_id && $mailing->footer_id != 'null' ? CRM_Mailing_BAO_Component::findById($mailing->footer_id) : NULL; + $header = $mailing->header_id && $mailing->header_id != 'null' ? CRM_Mailing_BAO_MailingComponent::findById($mailing->header_id) : NULL; + $footer = $mailing->footer_id && $mailing->footer_id != 'null' ? CRM_Mailing_BAO_MailingComponent::findById($mailing->footer_id) : NULL; foreach (array('body_html', 'body_text') as $field) { if (empty($mailing->{$field})) { continue; @@ -1784,7 +1784,7 @@ public static function &report($id, $skipDetails = FALSE, $isSMS = FALSE) { 'forward' => CRM_Mailing_Event_BAO_Forward::getTableName(), 'url' => CRM_Mailing_BAO_TrackableURL::getTableName(), 'urlopen' => CRM_Mailing_Event_BAO_TrackableURLOpen::getTableName(), - 'component' => CRM_Mailing_BAO_Component::getTableName(), + 'component' => CRM_Mailing_BAO_MailingComponent::getTableName(), 'spool' => CRM_Mailing_BAO_Spool::getTableName(), ); @@ -2718,7 +2718,7 @@ public static function getMailingContent(&$report, &$form, $isSMS = FALSE) { if (!$isSMS) { if ($report['mailing']['header_id']) { - $header = new CRM_Mailing_BAO_Component(); + $header = new CRM_Mailing_BAO_MailingComponent(); $header->id = $report['mailing']['header_id']; $header->find(TRUE); $htmlHeader = $header->body_html; @@ -2726,7 +2726,7 @@ public static function getMailingContent(&$report, &$form, $isSMS = FALSE) { } if ($report['mailing']['footer_id']) { - $footer = new CRM_Mailing_BAO_Component(); + $footer = new CRM_Mailing_BAO_MailingComponent(); $footer->id = $report['mailing']['footer_id']; $footer->find(TRUE); $htmlFooter = $footer->body_html; diff --git a/CRM/Mailing/BAO/MailingComponent.php b/CRM/Mailing/BAO/MailingComponent.php new file mode 100644 index 000000000000..9e1081cd0e94 --- /dev/null +++ b/CRM/Mailing/BAO/MailingComponent.php @@ -0,0 +1,114 @@ +copyValues($params); + if ($component->find(TRUE)) { + CRM_Core_DAO::storeValues($component, $defaults); + return $component; + } + return NULL; + } + + /** + * Update the is_active flag in the db. + * + * @param int $id + * Id of the database record. + * @param bool $is_active + * Value we want to set the is_active field. + * + * @return bool + * true if we found and updated the object, else false + */ + public static function setIsActive($id, $is_active) { + return CRM_Core_DAO::setFieldValue('CRM_Mailing_DAO_MailingComponent', $id, 'is_active', $is_active); + } + + /** + * Create and Update mailing component. + * + * @param array $params + * (reference ) an assoc array of name/value pairs. + * @param array $ids + * (deprecated) the array that holds all the db ids. + * + * @return CRM_Mailing_BAO_MailingComponent + */ + public static function add(&$params, $ids = array()) { + $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('id', $ids)); + $component = new CRM_Mailing_BAO_MailingComponent(); + if ($id) { + $component->id = $id; + $component->find(TRUE); + } + + $component->copyValues($params); + if (empty($id) && empty($params['body_text'])) { + $component->body_text = CRM_Utils_String::htmlToText(CRM_Utils_Array::value('body_html', $params)); + } + + if ($component->is_default) { + if (!empty($id)) { + $sql = 'UPDATE civicrm_mailing_component SET is_default = 0 WHERE component_type = %1 AND id <> %2'; + $sqlParams = array( + 1 => array($component->component_type, 'String'), + 2 => array($id, 'Positive'), + ); + } + else { + $sql = 'UPDATE civicrm_mailing_component SET is_default = 0 WHERE component_type = %1'; + $sqlParams = array( + 1 => array($component->component_type, 'String'), + ); + } + CRM_Core_DAO::executeQuery($sql, $sqlParams); + } + + $component->save(); + return $component; + } + +} diff --git a/CRM/Mailing/DAO/Mailing.php b/CRM/Mailing/DAO/Mailing.php index 286256a503b2..9df37c518b42 100644 --- a/CRM/Mailing/DAO/Mailing.php +++ b/CRM/Mailing/DAO/Mailing.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Mailing/Mailing.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:3e332257744be5cf9d7a2545f69f67eb) + * (GenCodeChecksum:3e943186d58d8e39d9765ce22d85ac79) */ /** @@ -401,7 +401,7 @@ public static function &fields() { 'entity' => 'Mailing', 'bao' => 'CRM_Mailing_BAO_Mailing', 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_DAO_Component', + 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent', ], 'footer_id' => [ 'name' => 'footer_id', @@ -412,7 +412,7 @@ public static function &fields() { 'entity' => 'Mailing', 'bao' => 'CRM_Mailing_BAO_Mailing', 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_DAO_Component', + 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent', ], 'reply_id' => [ 'name' => 'reply_id', @@ -423,7 +423,7 @@ public static function &fields() { 'entity' => 'Mailing', 'bao' => 'CRM_Mailing_BAO_Mailing', 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_DAO_Component', + 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent', ], 'unsubscribe_id' => [ 'name' => 'unsubscribe_id', @@ -434,7 +434,7 @@ public static function &fields() { 'entity' => 'Mailing', 'bao' => 'CRM_Mailing_BAO_Mailing', 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_DAO_Component', + 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent', ], 'resubscribe_id' => [ 'name' => 'resubscribe_id', @@ -454,7 +454,7 @@ public static function &fields() { 'entity' => 'Mailing', 'bao' => 'CRM_Mailing_BAO_Mailing', 'localizable' => 0, - 'FKClassName' => 'CRM_Mailing_DAO_Component', + 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent', ], 'name' => [ 'name' => 'name', diff --git a/CRM/Mailing/DAO/Component.php b/CRM/Mailing/DAO/MailingComponent.php similarity index 86% rename from CRM/Mailing/DAO/Component.php rename to CRM/Mailing/DAO/MailingComponent.php index 38aef9f12aea..b6ad32fe5638 100644 --- a/CRM/Mailing/DAO/Component.php +++ b/CRM/Mailing/DAO/MailingComponent.php @@ -4,15 +4,15 @@ * @package CRM * @copyright CiviCRM LLC (c) 2004-2018 * - * Generated from xml/schema/CRM/Mailing/Component.xml + * Generated from xml/schema/CRM/Mailing/MailingComponent.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:33742feaa53eaba2c4a543c4e5c673ab) + * (GenCodeChecksum:08753305769bb8ac8d2824081322af92) */ /** - * Database access object for the Component entity. + * Database access object for the MailingComponent entity. */ -class CRM_Mailing_DAO_Component extends CRM_Core_DAO { +class CRM_Mailing_DAO_MailingComponent extends CRM_Core_DAO { /** * Static instance to hold the table name. @@ -102,8 +102,8 @@ public static function &fields() { 'title' => ts('Mailing Component ID'), 'required' => TRUE, 'table_name' => 'civicrm_mailing_component', - 'entity' => 'Component', - 'bao' => 'CRM_Mailing_BAO_Component', + 'entity' => 'MailingComponent', + 'bao' => 'CRM_Mailing_DAO_MailingComponent', 'localizable' => 0, ], 'name' => [ @@ -114,8 +114,8 @@ public static function &fields() { 'maxlength' => 64, 'size' => CRM_Utils_Type::BIG, 'table_name' => 'civicrm_mailing_component', - 'entity' => 'Component', - 'bao' => 'CRM_Mailing_BAO_Component', + 'entity' => 'MailingComponent', + 'bao' => 'CRM_Mailing_DAO_MailingComponent', 'localizable' => 0, ], 'component_type' => [ @@ -126,8 +126,8 @@ public static function &fields() { 'maxlength' => 12, 'size' => CRM_Utils_Type::TWELVE, 'table_name' => 'civicrm_mailing_component', - 'entity' => 'Component', - 'bao' => 'CRM_Mailing_BAO_Component', + 'entity' => 'MailingComponent', + 'bao' => 'CRM_Mailing_DAO_MailingComponent', 'localizable' => 0, 'html' => [ 'type' => 'Select', @@ -143,8 +143,8 @@ public static function &fields() { 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'table_name' => 'civicrm_mailing_component', - 'entity' => 'Component', - 'bao' => 'CRM_Mailing_BAO_Component', + 'entity' => 'MailingComponent', + 'bao' => 'CRM_Mailing_DAO_MailingComponent', 'localizable' => 0, ], 'body_html' => [ @@ -155,8 +155,8 @@ public static function &fields() { 'rows' => 8, 'cols' => 80, 'table_name' => 'civicrm_mailing_component', - 'entity' => 'Component', - 'bao' => 'CRM_Mailing_BAO_Component', + 'entity' => 'MailingComponent', + 'bao' => 'CRM_Mailing_DAO_MailingComponent', 'localizable' => 0, 'html' => [ 'type' => 'TextArea', @@ -170,8 +170,8 @@ public static function &fields() { 'rows' => 8, 'cols' => 80, 'table_name' => 'civicrm_mailing_component', - 'entity' => 'Component', - 'bao' => 'CRM_Mailing_BAO_Component', + 'entity' => 'MailingComponent', + 'bao' => 'CRM_Mailing_DAO_MailingComponent', 'localizable' => 0, 'html' => [ 'type' => 'TextArea', @@ -184,8 +184,8 @@ public static function &fields() { 'description' => 'Is this the default component for this component_type?', 'default' => '0', 'table_name' => 'civicrm_mailing_component', - 'entity' => 'Component', - 'bao' => 'CRM_Mailing_BAO_Component', + 'entity' => 'MailingComponent', + 'bao' => 'CRM_Mailing_DAO_MailingComponent', 'localizable' => 0, ], 'is_active' => [ @@ -194,8 +194,8 @@ public static function &fields() { 'title' => ts('Mailing Component Is Active?'), 'description' => 'Is this property active?', 'table_name' => 'civicrm_mailing_component', - 'entity' => 'Component', - 'bao' => 'CRM_Mailing_BAO_Component', + 'entity' => 'MailingComponent', + 'bao' => 'CRM_Mailing_DAO_MailingComponent', 'localizable' => 0, ], ]; diff --git a/CRM/Mailing/Event/BAO/Confirm.php b/CRM/Mailing/Event/BAO/Confirm.php index 1d3c2d4d18d3..090a25d1f32f 100644 --- a/CRM/Mailing/Event/BAO/Confirm.php +++ b/CRM/Mailing/Event/BAO/Confirm.php @@ -111,7 +111,7 @@ public static function confirm($contact_id, $subscribe_id, $hash) { $group->id = $se->group_id; $group->find(TRUE); - $component = new CRM_Mailing_BAO_Component(); + $component = new CRM_Mailing_BAO_MailingComponent(); $component->is_default = 1; $component->is_active = 1; $component->component_type = 'Welcome'; diff --git a/CRM/Mailing/Event/BAO/Reply.php b/CRM/Mailing/Event/BAO/Reply.php index 679822ffe024..dffa7512f9f4 100644 --- a/CRM/Mailing/Event/BAO/Reply.php +++ b/CRM/Mailing/Event/BAO/Reply.php @@ -242,7 +242,7 @@ private static function autoRespond(&$mailing, $queue_id, $replyto) { $to = empty($replyto) ? $eq->email : $replyto; - $component = new CRM_Mailing_BAO_Component(); + $component = new CRM_Mailing_BAO_MailingComponent(); $component->id = $mailing->reply_id; $component->find(TRUE); diff --git a/CRM/Mailing/Event/BAO/Resubscribe.php b/CRM/Mailing/Event/BAO/Resubscribe.php index 360bd36bfec2..04b06ba5f546 100644 --- a/CRM/Mailing/Event/BAO/Resubscribe.php +++ b/CRM/Mailing/Event/BAO/Resubscribe.php @@ -215,7 +215,7 @@ public static function send_resub_response($queue_id, $groups, $is_domain = FALS WHERE $jobTable.id = $job"); $dao->fetch(); - $component = new CRM_Mailing_BAO_Component(); + $component = new CRM_Mailing_BAO_MailingComponent(); $component->id = $dao->resubscribe_id; $component->find(TRUE); diff --git a/CRM/Mailing/Event/BAO/Subscribe.php b/CRM/Mailing/Event/BAO/Subscribe.php index d82776413b4c..4fb544de3081 100644 --- a/CRM/Mailing/Event/BAO/Subscribe.php +++ b/CRM/Mailing/Event/BAO/Subscribe.php @@ -215,7 +215,7 @@ public function send_confirm_request($email) { $group->id = $this->group_id; $group->find(TRUE); - $component = new CRM_Mailing_BAO_Component(); + $component = new CRM_Mailing_BAO_MailingComponent(); $component->is_default = 1; $component->is_active = 1; $component->component_type = 'Subscribe'; diff --git a/CRM/Mailing/Event/BAO/Unsubscribe.php b/CRM/Mailing/Event/BAO/Unsubscribe.php index aa6950cb8c8d..7f1dd8798ca3 100644 --- a/CRM/Mailing/Event/BAO/Unsubscribe.php +++ b/CRM/Mailing/Event/BAO/Unsubscribe.php @@ -353,7 +353,7 @@ public static function send_unsub_response($queue_id, $groups, $is_domain = FALS WHERE $jobTable.id = $job"); $dao->fetch(); - $component = new CRM_Mailing_BAO_Component(); + $component = new CRM_Mailing_BAO_MailingComponent(); if ($is_domain) { $component->id = $dao->optout_id; diff --git a/CRM/Mailing/Form/Component.php b/CRM/Mailing/Form/Component.php index 35074d30fd4d..d7c72e34ef6a 100644 --- a/CRM/Mailing/Form/Component.php +++ b/CRM/Mailing/Form/Component.php @@ -62,24 +62,24 @@ public function buildQuickForm() { $this->applyFilter(array('name', 'subject', 'body_html'), 'trim'); $this->add('text', 'name', ts('Name'), - CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'name'), TRUE + CRM_Core_DAO::getAttribute('CRM_Mailing_BAO_MailingComponent', 'name'), TRUE ); $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array( - 'CRM_Mailing_DAO_Component', + 'CRM_Mailing_BAO_MailingComponent', $this->_id, )); $this->add('select', 'component_type', ts('Component Type'), CRM_Core_SelectValues::mailingComponents()); $this->add('text', 'subject', ts('Subject'), - CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'subject'), + CRM_Core_DAO::getAttribute('CRM_Mailing_BAO_MailingComponent', 'subject'), TRUE ); $this->add('textarea', 'body_text', ts('Body - TEXT Format'), - CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'body_text') + CRM_Core_DAO::getAttribute('CRM_Mailing_BAO_MailingComponent', 'body_text') ); $this->add('textarea', 'body_html', ts('Body - HTML Format'), - CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'body_html') + CRM_Core_DAO::getAttribute('CRM_Mailing_BAO_MailingComponent', 'body_html') ); $this->addYesNo('is_default', ts('Default?')); @@ -132,7 +132,7 @@ public function postProcess() { $params['id'] = $this->_id; } - $component = CRM_Mailing_BAO_Component::add($params); + $component = CRM_Mailing_BAO_MailingComponent::add($params); CRM_Core_Session::setStatus(ts('The mailing component \'%1\' has been saved.', array( 1 => $component->name, ) diff --git a/CRM/Mailing/Page/Component.php b/CRM/Mailing/Page/Component.php index d587d15beb3d..fbf5627e7b15 100644 --- a/CRM/Mailing/Page/Component.php +++ b/CRM/Mailing/Page/Component.php @@ -51,7 +51,7 @@ class CRM_Mailing_Page_Component extends CRM_Core_Page_Basic { * Classname of BAO. */ public function getBAOName() { - return 'CRM_Mailing_BAO_Component'; + return 'CRM_Mailing_BAO_MailingComponent'; } /** diff --git a/CRM/Mailing/PseudoConstant.php b/CRM/Mailing/PseudoConstant.php index 5cb6f7dabf80..460084d77f2f 100644 --- a/CRM/Mailing/PseudoConstant.php +++ b/CRM/Mailing/PseudoConstant.php @@ -158,13 +158,13 @@ public static function &component($type = NULL) { } if (!$type) { self::$component[$name] = NULL; - CRM_Core_PseudoConstant::populate(self::$component[$name], 'CRM_Mailing_DAO_Component'); + CRM_Core_PseudoConstant::populate(self::$component[$name], 'CRM_Mailing_BAO_MailingComponent'); } else { // we need to add an additional filter for $type self::$component[$name] = array(); - $object = new CRM_Mailing_DAO_Component(); + $object = new CRM_Mailing_BAO_MailingComponent(); $object->component_type = $type; $object->selectAdd(); $object->selectAdd("id, name"); diff --git a/api/v3/MailingComponent.php b/api/v3/MailingComponent.php index 997c28c0d631..693b7b9f9161 100644 --- a/api/v3/MailingComponent.php +++ b/api/v3/MailingComponent.php @@ -41,7 +41,7 @@ * API result array. */ function civicrm_api3_mailing_component_create($params) { - return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Component'); + return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'MailingComponent'); } diff --git a/api/v3/utils.php b/api/v3/utils.php index 094beb2375b8..bfa476adc4ec 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -332,10 +332,6 @@ function _civicrm_api3_get_DAO($name) { if ($name == 'MailingRecipients') { return 'CRM_Mailing_DAO_Recipients'; } - // FIXME: DAO should be renamed CRM_Mailing_DAO_MailingComponent - if ($name == 'MailingComponent') { - return 'CRM_Mailing_DAO_Component'; - } // FIXME: DAO should be renamed CRM_ACL_DAO_AclRole if ($name == 'AclRole') { return 'CRM_ACL_DAO_EntityRole'; diff --git a/tests/phpunit/CRM/Core/PseudoConstantTest.php b/tests/phpunit/CRM/Core/PseudoConstantTest.php index ec83676b1393..271d74d65fd4 100644 --- a/tests/phpunit/CRM/Core/PseudoConstantTest.php +++ b/tests/phpunit/CRM/Core/PseudoConstantTest.php @@ -912,7 +912,7 @@ public function testOptionValues() { 'sample' => $campaign_name, ), ), - 'CRM_Mailing_DAO_Component' => array( + 'CRM_Mailing_DAO_MailingComponent' => array( array( 'fieldName' => 'component_type', 'sample' => 'Header', diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index 62202dc02b24..fa0dbe649c78 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -842,7 +842,6 @@ public function testCustomDataGet($entityName) { $this->createLoggedInUser();// so subsidiary activities are created $entitiesWithNamingIssues = [ - 'MailingComponent' => 'Component', 'SmsProvider' => 'Provider', 'AclRole' => 'EntityRole', 'MailingEventQueue' => 'Queue', diff --git a/xml/schema/Core/Component.xml b/xml/schema/Core/Component.xml index 0a9f7e13f28a..c5ceff329d92 100644 --- a/xml/schema/Core/Component.xml +++ b/xml/schema/Core/Component.xml @@ -7,6 +7,7 @@ 2.0 id + Component ID int unsigned true Component ID diff --git a/xml/schema/Mailing/Component.xml b/xml/schema/Mailing/Component.xml index 76a27f027b9c..53f9c4a5c04a 100644 --- a/xml/schema/Mailing/Component.xml +++ b/xml/schema/Mailing/Component.xml @@ -2,7 +2,7 @@ CRM/Mailing - Component + MailingComponentcivicrm_mailing_componentStores information about the mailing components (header/footer).