Merge pull request #4240 from colemanw/enableDisable
[civicrm-core.git] / CRM / Case / Info.php
index 7067b2b7cb32820fbdcee96b266a0fcdcef1073f..ac3342aae48465fe913d2a9f40c7dba8e7f10d16 100644 (file)
@@ -65,14 +65,10 @@ class CRM_Case_Info extends CRM_Core_Component_Info {
       'js' => array('js/angular-crmCaseType.js'),
       'css' => array('css/angular-crmCaseType.css'),
     );
-    // Need full OptionValue records
-    $actStatuses = civicrm_api3('OptionValue', 'get', array('option_group_id' => 'activity_status'));
-    $actTypes = civicrm_api3('OptionValue', 'get', array('option_group_id' => 'activity_type'));
+
     CRM_Core_Resources::singleton()->addSetting(array(
       'crmCaseType' => array(
-        'actStatuses' => array_values($actStatuses['values']),
-        'actTypes' => array_values($actTypes['values']),
-        //CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'name'),
+        'REL_TYPE_CNAME' => CRM_Case_XMLProcessor::REL_TYPE_CNAME,
       ),
     ));
     return $result;
@@ -219,8 +215,9 @@ class CRM_Case_Info extends CRM_Core_Component_Info {
       &&
       (!$oldValue || !in_array('CiviCase', $oldValue))
     ) {
+      $pathToCaseSampleTpl =  __DIR__ . '/xml/configuration.sample/';
       $config = CRM_Core_Config::singleton();
-      CRM_Admin_Form_Setting_Component::loadCaseSampleData($config->dsn, $config->sqlDir . 'case_sample.mysql');
+      CRM_Admin_Form_Setting_Component::loadCaseSampleData($config->dsn, $pathToCaseSampleTpl . 'case_sample.mysql.tpl');
       if (!CRM_Case_BAO_Case::createCaseViews()) {
         $msg = ts("Could not create the MySQL views for CiviCase. Your mysql user needs to have the 'CREATE VIEW' permission");
         CRM_Core_Error::fatal($msg);