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";
CRM_Core_Action::UPDATE => array(
'name' => ts('Edit'),
'url' => 'civicrm/admin/options/' . self::$_gName,
- 'qs' => 'group=' . self::$_gName . '&action=update&id=%%id%%&reset=1',
+ 'qs' => 'action=update&id=%%id%%&reset=1',
'title' => ts('Edit %1', array(1 => self::$_gName)),
),
CRM_Core_Action::DISABLE => array(
CRM_Core_Action::DELETE => array(
'name' => ts('Delete'),
'url' => 'civicrm/admin/options/' . self::$_gName,
- 'qs' => 'group=' . self::$_gName . '&action=delete&id=%%id%%',
+ 'qs' => 'action=delete&id=%%id%%',
'title' => ts('Delete %1 Type', array(1 => self::$_gName)),
),
);
if ($options) {
$$stateName->setOptions($options);
}
+ if (property_exists($$stateName, 'urlPath')) {
+ $$stateName->urlPath = explode('/', $_GET[CRM_Core_Config::singleton()->userFrameworkURLVar]);
+ }
$this->addPage($$stateName);
$this->addAction($stateName, new HTML_QuickForm_Action_Direct());
*/
public $ajaxResponse = array();
+ /**
+ * Url path used to reach this page
+ *
+ * @var array
+ */
+ public $urlPath = array();
+
/**
* Stores info about reference fields for preprocessing
* Public so that hooks can access it
if (!array_key_exists('placeholder', $props)) {
$props['placeholder'] = $required ? ts('- select -') : ts('- none -');
}
- if (!empty($props['placeholder']) && empty($props['multiple'])) {
+ if ($props['placeholder'] !== NULL && empty($props['multiple'])) {
$options = array('' => '') + $options;
}
// Handle custom field
+--------------------------------------------------------------------+
*}
{capture assign=erURL}{crmURL p='civicrm/acl/entityrole' q='reset=1'}{/capture}
-{capture assign=rolesURL}{crmURL p='civicrm/admin/options' q='group=acl_role&reset=1'}{/capture}
+{capture assign=rolesURL}{crmURL p='civicrm/admin/options/acl_role' q='reset=1'}{/capture}
{capture assign=docLink}{docURL page='user/initial-set-up/access-control' text='Access Control Documentation'}{/capture}
<div id="help">
<td>{ts}Settings for outbound email - either SMTP server, port and authentication or Sendmail path and argument.{/ts}</td>
</tr>
<tr class="even">
- <td class="tasklist nowrap"><a href="{crmURL p="civicrm/admin/options/from_email_address" q="group=from_email_address`$fromAction`&reset=1&civicrmDestination=`$destination`"}" title="{$linkTitle}">{ts}From Email Addresses{/ts}</a></td>
+ <td class="tasklist nowrap"><a href="{crmURL p="civicrm/admin/options/from_email_address" q="reset=1`$fromAction`&civicrmDestination=`$destination`"}" title="{$linkTitle}">{ts}From Email Addresses{/ts}</a></td>
<td>{ts}Define general email address(es) that can be used as the FROM address when sending email to contacts from within CiviCRM (e.g. info@example.org){/ts}</td>
</tr>
{if $rows}
{if $action ne 1 and $action ne 2}
<div class="action-link">
- <a href="{crmURL q="group="|cat:$gName|cat:"&action=add&reset=1"}" class="button new-option"><span><div class="icon add-icon"></div>{ts 1=$gLabel}Add %1{/ts}</span></a>
+ <a href="{crmURL p="civicrm/admin/options/$gName" q='action=add&reset=1'}" class="button new-option"><span><div class="icon add-icon"></div>{ts 1=$gLabel}Add %1{/ts}</span></a>
</div>
{/if}
<div id={$gName}>
{if $action ne 1 and $action ne 2}
<div class="action-link">
- <a href="{crmURL q="group="|cat:$gName|cat:"&action=add&reset=1"}" class="button new-option"><span><div class="icon add-icon"></div>{ts 1=$gLabel}Add %1{/ts}</span></a>
+ <a href="{crmURL p="civicrm/admin/options/$gName" q='action=add&reset=1'}" class="button new-option"><span><div class="icon add-icon"></div>{ts 1=$gLabel}Add %1{/ts}</span></a>
</div>
{/if}
</div>
{else}
<div class="messages status no-popup">
<div class="icon inform-icon"></div>
- {capture assign=crmURL}{crmURL q="group="|cat:$gName|cat:"&action=add&reset=1"}{/capture}
+ {capture assign=crmURL}{crmURL p="civicrm/admin/options/$gName" q='action=add&reset=1'}{/capture}
{ts 1=$crmURL}There are no option values entered. You can <a href='%1'>add one</a>.{/ts}
</div>
{/if}
}
function addPaymentInstrument($label, $financialAccount) {
- $this->openCiviPage('admin/options/payment_instrument', 'group=payment_instrument&action=add&reset=1', "_qf_Options_next-bottom");
+ $this->openCiviPage('admin/options/payment_instrument', 'action=add&reset=1', "_qf_Options_next-bottom");
$this->type("label", $label);
$this->select("financial_account_id", "value=$financialAccount");
$this->click("_qf_Options_next-bottom");
$this->waitForText('crm-notification-container', "The Group '{$groupTitle}' has been saved.");
- $this->openCiviPage("admin/options/acl_role", "group=acl_role&action=add&reset=1", "_qf_Options_cancel-bottom");
+ $this->openCiviPage("admin/options/acl_role", "action=add&reset=1", "_qf_Options_cancel-bottom");
$label = "TestAclRole" . substr(sha1(rand()), 0, 4);
$this->type("label", $label);
$this->webtestAddContact($softCreditFname, $softCreditLname, FALSE);
//financial account for check
- $this->openCiviPage("admin/options/payment_instrument", "group=payment_instrument&reset=1");
+ $this->openCiviPage("admin/options/payment_instrument", "reset=1");
$financialAccount = $this->getText("xpath=//div[@id='payment_instrument']/div[2]/table/tbody//tr/td[1][text()='Check']/../td[3]");
// Add new Financial Account
$rand = substr(sha1(rand()), 0, 7);
// Add new Grant Type
- $this->openCiviPage('admin/options/grant_type', 'group=grant_type&reset=1');
+ $this->openCiviPage('admin/options/grant_type', 'reset=1');
$this->click("css=#grant_type > div.action-link > #new > span");
$this->waitForPageToLoad($this->getTimeoutMsec());
$grantType = 'GrantType' . $rand;