X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FExtension%2FManager%2FReport.php;h=dedbc6b7d85f15bda82fdd9cbe728472920a2cc5;hb=82e7a8b8a4054c4814900ddf5e8fc56d6819c134;hp=908ae12539c761065e264f99738fded2f9f0e2ef;hpb=8906b92a00b4907e620e80624fb6ac6baa368bed;p=civicrm-core.git diff --git a/CRM/Extension/Manager/Report.php b/CRM/Extension/Manager/Report.php index 908ae12539..dedbc6b7d8 100644 --- a/CRM/Extension/Manager/Report.php +++ b/CRM/Extension/Manager/Report.php @@ -1,7 +1,7 @@ groupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', @@ -47,6 +48,11 @@ class CRM_Extension_Manager_Report extends CRM_Extension_Manager_Base { ); } + /** + * @param CRM_Extension_Info $info + * + * @throws Exception + */ public function onPreInstall(CRM_Extension_Info $info) { $customReports = $this->getCustomReportsByName(); if (array_key_exists($info->key, $customReports)) { @@ -81,6 +87,11 @@ class CRM_Extension_Manager_Report extends CRM_Extension_Manager_Base { $optionValue = CRM_Core_BAO_OptionValue::add($params, $ids); } + /** + * @param CRM_Extension_Info $info + * + * @return bool + */ public function onPreUninstall(CRM_Extension_Info $info) { // if( !array_key_exists( $info->key, $this->customReports ) ) { @@ -88,32 +99,45 @@ class CRM_Extension_Manager_Report extends CRM_Extension_Manager_Base { // } $customReports = $this->getCustomReportsByName(); - $cr = $this->getCustomReportsById(); - $id = $cr[$customReports[$info->key]]; + $cr = $this->getCustomReportsById(); + $id = $cr[$customReports[$info->key]]; $optionValue = CRM_Core_BAO_OptionValue::del($id); return $optionValue ? TRUE : FALSE; } + /** + * @param CRM_Extension_Info $info + */ public function onPreDisable(CRM_Extension_Info $info) { $customReports = $this->getCustomReportsByName(); - $cr = $this->getCustomReportsById(); - $id = $cr[$customReports[$info->key]]; + $cr = $this->getCustomReportsById(); + $id = $cr[$customReports[$info->key]]; $optionValue = CRM_Core_BAO_OptionValue::setIsActive($id, 0); } + /** + * @param CRM_Extension_Info $info + */ public function onPreEnable(CRM_Extension_Info $info) { $customReports = $this->getCustomReportsByName(); - $cr = $this->getCustomReportsById(); - $id = $cr[$customReports[$info->key]]; + $cr = $this->getCustomReportsById(); + $id = $cr[$customReports[$info->key]]; $optionValue = CRM_Core_BAO_OptionValue::setIsActive($id, 1); } + /** + * @return array + */ public function getCustomReportsByName() { return CRM_Core_OptionGroup::values(self::REPORT_GROUP_NAME, TRUE, FALSE, FALSE, NULL, 'name', FALSE, TRUE); } + /** + * @return array + */ public function getCustomReportsById() { return CRM_Core_OptionGroup::values(self::REPORT_GROUP_NAME, FALSE, FALSE, FALSE, NULL, 'id', FALSE, TRUE); } + }