<?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. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
public function preProcess() {
parent::preProcess();
$session = CRM_Core_Session::singleton();
- if (!$this->_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);
else {
$this->_gName = $this->get('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 = "reset=1";
*/
public function buildQuickForm() {
parent::buildQuickForm();
+ $this->setPageTitle(ts('%1 Option', array(1 => $this->_gLabel)));
+
if ($this->_action & CRM_Core_Action::DELETE) {
return;
}
$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
);
}
'case_type',
'payment_instrument',
'communication_style',
+ 'soft_credit_type',
+ 'website_type',
);
if (in_array($this->_gName, $showIsDefaultGroups)) {
CRM_Core_Session::setStatus(ts('The %1 \'%2\' has been saved.', array(1 => $this->_gLabel, 2 => $optionValue->label)), ts('Saved'), 'success');
}
}
+
}