X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FAdmin%2FForm%2FOptions.php;h=8282796976e620bf665b06fb1ce225ba558192c9;hb=2c7601f6753e9f5e06ae0324b4d8aeef677e4792;hp=ef2b883a9d1c3c541814787f38c415aa6a7794aa;hpb=6c2473d59d02d2f20f1c7b3b499eac191a8ad59a;p=civicrm-core.git diff --git a/CRM/Admin/Form/Options.php b/CRM/Admin/Form/Options.php index ef2b883a9d..8282796976 100644 --- a/CRM/Admin/Form/Options.php +++ b/CRM/Admin/Form/Options.php @@ -1,9 +1,9 @@ _gName) { - $this->_gName = CRM_Utils_Request::retrieve('group', 'String', $this, FALSE, 0); - $this->_gid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', - $this->_gName, - 'id', - 'name' - ); + if (!$this->_gName && !empty($this->urlPath[3])) { + $this->_gName = $this->urlPath[3]; + } + if (!$this->_gName && !empty($_GET['gid'])) { + $this->_gName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', (int) $_GET['gid'], 'name'); } if ($this->_gName) { $this->set('gName', $this->_gName); @@ -78,9 +76,14 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { else { $this->_gName = $this->get('gName'); } - $this->_gLabel = ucwords(str_replace('_', ' ', $this->_gName)); + $this->_gid = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', + $this->_gName, + 'id', + 'name' + ); + $this->_gLabel = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $this->_gid, 'title'); $url = "civicrm/admin/options/{$this->_gName}"; - $params = "group={$this->_gName}&reset=1"; + $params = "reset=1"; if (($this->_action & CRM_Core_Action::DELETE) && in_array($this->_gName, array('email_greeting', 'postal_greeting', 'addressee')) @@ -147,6 +150,8 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { */ public function buildQuickForm() { parent::buildQuickForm(); + $this->setPageTitle(ts('%1 Option', array(1 => $this->_gLabel))); + if ($this->_action & CRM_Core_Action::DELETE) { return; } @@ -194,7 +199,8 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { $financialAccount = CRM_Contribute_PseudoConstant::financialAccount(NULL, key($accountType)); $this->add('select', 'financial_account_id', ts('Financial Account'), - array('' => ts('- select -')) + $financialAccount + array('' => ts('- select -')) + $financialAccount, + TRUE ); } @@ -280,6 +286,8 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { 'case_type', 'payment_instrument', 'communication_style', + 'soft_credit_type', + 'website_type', ); if (in_array($this->_gName, $showIsDefaultGroups)) { @@ -431,4 +439,5 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form { CRM_Core_Session::setStatus(ts('The %1 \'%2\' has been saved.', array(1 => $this->_gLabel, 2 => $optionValue->label)), ts('Saved'), 'success'); } } + }