CRM-14479 - hook_angularModules - Allow specifying multiple *.js files for one module
[civicrm-core.git] / CRM / Case / Info.php
index 6d28cc622fa799d02bcd9c25558c987879c78b0e..8ed9054fd7198fe086c6cdb9178f6b1fc7b02599 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -31,7 +31,7 @@
  * abstract class.
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -64,10 +64,6 @@ class CRM_Case_Info extends CRM_Core_Component_Info {
     CRM_Utils_Hook::caseTypes($caseTypes);
 
     $proc = new CRM_Case_XMLProcessor();
-    $caseTypesGroupId = civicrm_api3('OptionGroup', 'getvalue', array('name' => 'case_type', 'return' => 'id'));
-    if (!is_numeric($caseTypesGroupId)) {
-      throw new CRM_Core_Exception("Found invalid ID for OptionGroup (case_type)");
-    }
     foreach ($caseTypes as $name => $caseType) {
       $xml = $proc->retrieve($name);
       if (!$xml) {
@@ -78,14 +74,15 @@ class CRM_Case_Info extends CRM_Core_Component_Info {
         $entities[] = array(
           'module' => $caseType['module'],
           'name' => $caseType['name'],
-          'entity' => 'OptionValue',
+          'entity' => 'CaseType',
           'params' => array(
             'version' => 3,
             'name' => $caseType['name'],
-            'label' => (string) $xml->name,
-            'description' => (string) $xml->description, // CRM_Utils_Array::value('description', $caseType, ''),
-            'option_group_id' => $caseTypesGroupId,
+            'title' => (string) $xml->name,
+            'description' => (string) $xml->description,
             'is_reserved' => 1,
+            'is_active' => 1,
+            'weight' => $xml->weight ? $xml->weight : 1,
           ),
         );
       }
@@ -171,8 +168,6 @@ class CRM_Case_Info extends CRM_Core_Component_Info {
     ) {
       $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, $config->sqlDir . 'case_sample1.mysql');
-      CRM_Core_Component::flushEnabledComponents();
       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);