CRM_Core_Session::setStatus(ts('Your custom field set \'%1 \' has been saved.', array(1 => $group->title)), ts('Saved'), 'success');
}
else {
- $url = CRM_Utils_System::url('civicrm/admin/custom/group/field/add', 'reset=1&action=add&gid=' . $group->id);
+ // Jump directly to adding a field if popups are disabled
+ $action = CRM_Core_Resources::singleton()->ajaxPopupsEnabled ? '' : '/add';
+ $url = CRM_Utils_System::url("civicrm/admin/custom/group/field$action", 'reset=1&gid=' . $group->id . '&action=' . ($action ? 'add' : 'browse'));
CRM_Core_Session::setStatus(ts("Your custom field set '%1' has been added. You can add custom fields now.",
array(1 => $group->title)
), ts('Saved'), 'success');
CRM_Core_Action::EXPORT => array(
'name' => ts('Move'),
'url' => 'civicrm/admin/custom/group/field/move',
+ 'class' => 'small-popup',
'qs' => 'reset=1&fid=%%id%%',
'title' => ts('Move Custom Field'),
),
$this->_sid = CRM_Utils_Request::retrieve('sid', 'Positive', $this, FALSE, NULL, 'REQUEST');
$this->_fid = CRM_Utils_Request::retrieve('fid', 'Positive', $this, FALSE, NULL, 'REQUEST');
$url = CRM_Utils_System::url('civicrm/admin/price/field', "reset=1&action=browse&sid={$this->_sid}");
- $breadCrumb = array(array('title' => ts('Price Set Fields'),
- 'url' => $url,
- ));
+ $breadCrumb = array(array('title' => ts('Price Set Fields'), 'url' => $url));
$this->_extendComponentId = array();
$extendComponentId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_sid, 'extends', 'id');
}
CRM_Utils_System::appendBreadCrumb($breadCrumb);
+
+ switch ($this->_action) {
+ case CRM_Core_Action::ADD:
+ CRM_Utils_System::setTitle(ts('Add Price Field'));
+ break;
+ case CRM_Core_Action::UPDATE:
+ CRM_Utils_System::setTitle(ts('Edit Price Field'));
+ break;
+ case CRM_Core_Action::DELETE:
+ CRM_Utils_System::setTitle(ts('Delete Price Field'));
+ break;
+ }
}
/**
CRM_Core_Session::setStatus(ts('The Set \'%1\' has been saved.', array(1 => $set->title)), ts('Saved'), 'success');
}
else {
- $url = CRM_Utils_System::url('civicrm/admin/price/field', 'reset=1&action=add&sid=' . $set->id);
+ // Jump directly to adding a field if popups are disabled
+ $action = CRM_Core_Resources::singleton()->ajaxPopupsEnabled ? 'browse' : 'add';
+ $url = CRM_Utils_System::url('civicrm/admin/price/field', array('reset' => 1, 'action' => $action, 'sid' => $set->id));
CRM_Core_Session::setStatus(ts("Your Set '%1' has been added. You can add fields to this set now.",
array(1 => $set->title)
), ts('Saved'), 'success');
* @access public
*/ function &actionLinks() {
if (!isset(self::$_actionLinks)) {
- // helper variable for nicer formatting
- $deleteExtra = ts('Are you sure you want to delete this price field?');
self::$_actionLinks = array(
CRM_Core_Action::UPDATE => array(
'name' => ts('Edit Price Field'),
'url' => 'civicrm/admin/price/field',
'qs' => 'action=delete&reset=1&sid=%%sid%%&fid=%%fid%%',
'title' => ts('Delete Price'),
- 'extra' => 'onclick = "return confirm(\'' . $deleteExtra . '\');"',
),
);
}
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
if ($this->_gid) {
$this->_title = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $this->_gid, 'title');
- CRM_Utils_System::setTitle($this->_title . ' - ' . ts('CiviCRM Profile Fields'));
+ switch ($this->_action) {
+ case CRM_Core_Action::ADD:
+ CRM_Utils_System::setTitle(ts('Add Profile Field'));
+ break;
+ case CRM_Core_Action::UPDATE:
+ CRM_Utils_System::setTitle(ts('Edit Profile Field'));
+ break;
+ case CRM_Core_Action::DELETE:
+ CRM_Utils_System::setTitle(ts('Delete Profile Field'));
+ break;
+ }
$url = CRM_Utils_System::url('civicrm/admin/uf/group/field',
"reset=1&action=browse&gid={$this->_gid}"
CRM_Core_Session::setStatus(ts("Your CiviCRM Profile '%1' has been saved.", array(1 => $ufGroup->title)), ts('Profile Saved'), 'success');
}
else {
- $url = CRM_Utils_System::url('civicrm/admin/uf/group/field/add', 'reset=1&action=add&gid=' . $ufGroup->id);
+ // Jump directly to adding a field if popups are disabled
+ $action = CRM_Core_Resources::singleton()->ajaxPopupsEnabled ? '' : '/add';
+ $url = CRM_Utils_System::url("civicrm/admin/uf/group/field$action", 'reset=1&gid=' . $ufGroup->id . '&action=' . ($action ? 'add' : 'browse'));
CRM_Core_Session::setStatus(ts('Your CiviCRM Profile \'%1\' has been added. You can add fields to this profile now.',
array(1 => $ufGroup->title)
), ts('Profile Added'), 'success');
</table>
{/strip}
- <div class="action-link">
- <a href="{crmURL p='civicrm/admin/custom/group/field/add' q="reset=1&action=add&gid=$gid"}" id="newCustomField" class="button action-item"><span><div class="icon add-icon"></div>{ts}Add Custom Field{/ts}</span></a>
- </div>
</div>
{else}
{if $action eq 16}
<div class="messages status no-popup">
- <img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/>
- {capture assign=crmURL}{crmURL p='civicrm/admin/custom/group/field/add' q="action=add&reset=1&gid=$gid"}{/capture}
- {ts 1=$groupTitle 2=$crmURL}There are no custom fields for custom group '%1', <a class="action-item" href='%2'>add one</a>.{/ts}
+ <img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/>
+ {ts 1=$groupTitle}There are no fields for custom group '%1'</a>.{/ts}
</div>
{/if}
{/if}
+ <div class="action-link">
+ <a href="{crmURL p='civicrm/admin/custom/group/field/add' q="reset=1&action=add&gid=$gid"}" id="newCustomField" class="button action-item"><span><div class="icon add-icon"></div>{ts}Add Custom Field{/ts}</span></a>
+ </div>
{/if}
{include file="CRM/common/crmeditable.tpl"}
}
</script>
{/literal}
-<h3>{if $action eq 1}{ts}Add Field{/ts}{elseif $action eq 2}{ts}Edit Field{/ts}{/if}</h3>
<div class="crm-block crm-form-block crm-price-field-form-block">
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
<table class="form-layout">
{if $action eq 16}
<div class="messages status no-popup">
<div class="icon inform-icon"></div>
- {capture assign=crmURL}{crmURL p='civicrm/admin/price/field q="action=add&reset=1&sid=$sid"}{/capture}
- {ts 1=$groupTitle 2=$crmURL}There are no fields for price set '%1', <a href='%2'>add one</a>.{/ts}
+ {ts 1=$groupTitle 2=$crmURL}There are no fields for price set '%1'.{/ts}
+ </div>
+ <div class="action-link">
+ <a href="{crmURL q="reset=1&action=add&sid=$sid"}" id="newPriceField" class="button"><span><div class="icon add-icon"></div>{ts}Add Price Field{/ts}</span></a>
</div>
{/if}
{/if}
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
-<h3>{if $action eq 8}{ts}Delete Field{/ts} - {$fieldTitle}{elseif $action eq 1}{ts}Add Field{/ts}{elseif $action eq 2}{ts}Edit Field{/ts} - {$fieldTitle}{/if}</h3>
<div class="crm-block crm-form-block crm-uf-field-form-block">
{if $action eq 8}
<div class="messages status no-popup">
{if $action eq 16}
{capture assign=crmURL}{crmURL p="civicrm/admin/uf/group/field/add" q="reset=1&action=add&gid=$gid"}{/capture}
<div class="messages status no-popup">
- <div class="icon inform-icon"></div>
- {ts 1=$groupTitle 2=$crmURL}There are no CiviCRM Profile Fields for '%1', you can <a href='%2'>add one now</a>.{/ts}
+ <div class="icon inform-icon"></div>
+ {ts 1=$groupTitle 2=$crmURL}There are no CiviCRM Profile Fields for '%1'</a>.{/ts}
+ </div>
+ <div class="action-link">
+ <a href="{crmURL p="civicrm/admin/uf/group/field/add" q="reset=1&action=add&gid=$gid"}" class="button"><span><div class="icon add-icon"></div>{ts}Add Field{/ts}</span></a>
</div>
{/if}
{/if}
//check the delete for price field
$this->openCiviPage("admin/price/field", "reset=1&action=browse&sid={$sid}");
$this->click("xpath=//table[@id='option11']/tbody/tr/td[9]/span[2]/ul/li[2]/a");
- // Check confirmation alert.
- $this->assertTrue((bool)preg_match("/^Are you sure you want to delete this price field?/",
- $this->getConfirmation()
- ));
- $this->chooseOkOnNextConfirmation();
- $this->waitForPageToLoad($this->getTimeoutMsec());
//assert the message
$this->waitForText('price_set_used_by',
"it is currently in use by one or more active events or contribution pages or contributions or event templates.");