/** * Get action Links. * * @return array * (reference) of action links */ public function &links() { if (!self::$_links) { self::$_links = array(CRM_Core_Action::UPDATE => array('name' => ts('Edit'), 'url' => 'civicrm/admin/locationType', 'qs' => 'action=update&id=%%id%%&reset=1', 'title' => ts('Edit Location Type')), CRM_Core_Action::DISABLE => array('name' => ts('Disable'), 'ref' => 'crm-enable-disable', 'title' => ts('Disable Location Type')), CRM_Core_Action::ENABLE => array('name' => ts('Enable'), 'ref' => 'crm-enable-disable', 'title' => ts('Enable Location Type')), CRM_Core_Action::DELETE => array('name' => ts('Delete'), 'url' => 'civicrm/admin/locationType', 'qs' => 'action=delete&id=%%id%%', 'title' => ts('Delete Location Type'))); } return self::$_links; }
/** * Get action Links * * @return array (reference) of action links */ function &links() { if (!self::$_links) { self::$_links = array(CRM_Core_Action::UPDATE => array('name' => ts('Edit'), 'url' => 'civicrm/admin/locationType', 'qs' => 'action=update&id=%%id%%&reset=1', 'title' => ts('Edit Location Type')), CRM_Core_Action::DISABLE => array('name' => ts('Disable'), 'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_LocationType' . '\',\'' . 'enable-disable' . '\' );"', 'ref' => 'disable-action', 'title' => ts('Disable Location Type')), CRM_Core_Action::ENABLE => array('name' => ts('Enable'), 'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Core_BAO_LocationType' . '\',\'' . 'disable-enable' . '\' );"', 'ref' => 'enable-action', 'title' => ts('Enable Location Type')), CRM_Core_Action::DELETE => array('name' => ts('Delete'), 'url' => 'civicrm/admin/locationType', 'qs' => 'action=delete&id=%%id%%', 'title' => ts('Delete Location Type'))); } return self::$_links; }
/** * Get action Links * * @return array (reference) of action links */ function &links() { CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js'); if (!self::$_links) { self::$_links = array(CRM_Core_Action::UPDATE => array('name' => ts('Edit'), 'url' => 'civicrm/admin/locationType', 'qs' => 'action=update&id=%%id%%&reset=1', 'title' => ts('Edit Location Type')), CRM_Core_Action::DISABLE => array('name' => ts('Disable'), 'ref' => 'crm-enable-disable', 'title' => ts('Disable Location Type')), CRM_Core_Action::ENABLE => array('name' => ts('Enable'), 'ref' => 'crm-enable-disable', 'title' => ts('Enable Location Type')), CRM_Core_Action::DELETE => array('name' => ts('Delete'), 'url' => 'civicrm/admin/locationType', 'qs' => 'action=delete&id=%%id%%', 'title' => ts('Delete Location Type'))); } return self::$_links; }
/** * Browse all custom data groups. * * @return void * @access public * @static */ function browse($action = null) { // get all custom groups sorted by weight $locationType = array(); $dao =& new CRM_Core_DAO_LocationType(); // set the domain_id parameter $config =& CRM_Core_Config::singleton(); $dao->domain_id = $config->domainID(); $dao->orderBy('name'); $dao->find(); while ($dao->fetch()) { $locationType[$dao->id] = array(); CRM_Core_DAO::storeValues($dao, $locationType[$dao->id]); // form all action links $action = array_sum(array_keys($this->links())); // update enable/disable links depending on custom_group properties. if ($dao->is_reserved) { $action -= CRM_CORE_ACTION_ENABLE; $action -= CRM_CORE_ACTION_DISABLE; $action -= CRM_CORE_ACTION_DELETE; } else { if ($dao->is_active) { $action -= CRM_CORE_ACTION_ENABLE; } else { $action -= CRM_CORE_ACTION_DISABLE; } } $locationType[$dao->id]['action'] = CRM_Core_Action::formLink(CRM_Admin_Page_LocationType::links(), $action, array('id' => $dao->id)); } $this->assign('rows', $locationType); }