예제 #1
0
 /**
  * Browse all resources.
  *
  * @return void
  * @access public
  * @static
  */
 function browse($action = NULL)
 {
     // get all custom groups sorted by weight
     $configSet = array();
     $dao = new CRM_Booking_DAO_ResourceConfigSet();
     $dao->orderBy('weight');
     $dao->is_deleted = FALSE;
     $dao->find();
     while ($dao->fetch()) {
         $configSet[$dao->id] = array();
         CRM_Core_DAO::storeValues($dao, $configSet[$dao->id]);
         //TODO:: GET Actual type and location
         // form all action links
         $action = array_sum(array_keys($this->links()));
         // update enable/disable links.
         if ($dao->is_active) {
             $action -= CRM_Core_Action::ENABLE;
         } else {
             $action -= CRM_Core_Action::DISABLE;
         }
         $configSet[$dao->id]['action'] = CRM_Core_Action::formLink(self::links(), $action, array('id' => $dao->id));
     }
     $this->assign('rows', $configSet);
 }