0009768: Use ModelConfig for Timetracker models
[tine20] / tine20 / Timetracker / Setup / DemoData.php
index 1be1df0..bb6f215 100644 (file)
@@ -21,7 +21,7 @@ class Timetracker_Setup_DemoData extends Tinebase_Setup_DemoData_Abstract
      * 
      * @var array
      */
-    protected static $_requiredApplications = array('Admin', 'Sales');
+    protected static $_requiredApplications = array('Admin', 'Sales', 'HumanResources');
     
     /**
      * holds the instance of the singleton
@@ -254,7 +254,7 @@ class Timetracker_Setup_DemoData extends Tinebase_Setup_DemoData_Abstract
                             'own_model'              => 'Timetracker_Model_Timeaccount',
                             'own_backend'            => 'SQL',
                             'own_id'                 => NULL,
-                            'own_degree'             => Tinebase_Model_Relation::DEGREE_SIBLING,
+                            'related_degree'         => Tinebase_Model_Relation::DEGREE_SIBLING,
                             'related_model'          => 'Sales_Model_CostCenter',
                             'related_backend'        => Tasks_Backend_Factory::SQL,
                             'related_id'             => $costcenter->getId(),
@@ -264,7 +264,7 @@ class Timetracker_Setup_DemoData extends Tinebase_Setup_DemoData_Abstract
                             'own_model'              => 'Timetracker_Model_Timeaccount',
                             'own_backend'            => 'SQL',
                             'own_id'                 => NULL,
-                            'own_degree'             => Tinebase_Model_Relation::DEGREE_SIBLING,
+                            'related_degree'         => Tinebase_Model_Relation::DEGREE_SIBLING,
                             'related_model'          => 'Sales_Model_Contract',
                             'related_backend'        => Tasks_Backend_Factory::SQL,
                             'related_id'             => $contract->getId(),
@@ -278,7 +278,7 @@ class Timetracker_Setup_DemoData extends Tinebase_Setup_DemoData_Abstract
                             'own_model'              => 'Timetracker_Model_Timeaccount',
                             'own_backend'            => 'SQL',
                             'own_id'                 => NULL,
-                            'own_degree'             => Tinebase_Model_Relation::DEGREE_SIBLING,
+                            'related_degree'         => Tinebase_Model_Relation::DEGREE_SIBLING,
                             'related_model'          => 'Sales_Model_CostCenter',
                             'related_backend'        => Tasks_Backend_Factory::SQL,
                             'related_id'             => $costcenter->getId(),
@@ -308,11 +308,13 @@ class Timetracker_Setup_DemoData extends Tinebase_Setup_DemoData_Abstract
     
     /**
      * returns the cost center for the current account
+     *
+     * @return HumanResources_Model_CostCenter|Sales_Model_CostCenter
      */
     protected function _getCurrentUsersCostCenter()
     {
         $employee = $this->_getCurrentUsersEmployee();
-        $salesCC =  HumanResources_Controller_CostCenter::getInstance()->getValidCostCenter($employee->getId(), NULL, TRUE);
+        $salesCC = HumanResources_Controller_CostCenter::getInstance()->getValidCostCenter($employee->getId(), NULL, TRUE);
         return $salesCC;
     }