else {
// 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'));
+ $url = CRM_Utils_System::url("civicrm/admin/custom/group/field$action", 'reset=1&new=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');
* @access public
*/
function browse() {
+ $resourceManager = CRM_Core_Resources::singleton();
+ if (!empty($_GET['new']) && $resourceManager->ajaxPopupsEnabled) {
+ $resourceManager->addScriptFile('civicrm', 'js/crm.addNew.js', 999);
+ }
+
$customField = array();
$customFieldBAO = new CRM_Core_BAO_CustomField();
else {
// 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));
+ $url = CRM_Utils_System::url('civicrm/admin/price/field', array('reset' => 1, 'action' => $action, 'sid' => $set->id, 'new' => 1));
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 browse() {
+ $resourceManager = CRM_Core_Resources::singleton();
+ if (!empty($_GET['new']) && $resourceManager->ajaxPopupsEnabled) {
+ $resourceManager->addScriptFile('civicrm', 'js/crm.addNew.js', 999);
+ }
+
$priceField = array();
$priceFieldBAO = new CRM_Price_BAO_PriceField();
else {
// 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'));
+ $url = CRM_Utils_System::url("civicrm/admin/uf/group/field$action", 'reset=1&new=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');
* @static
*/
function browse() {
+ $resourceManager = CRM_Core_Resources::singleton();
+ if (!empty($_GET['new']) && $resourceManager->ajaxPopupsEnabled) {
+ $resourceManager->addScriptFile('civicrm', 'js/crm.addNew.js', 999);
+ }
+
$ufField = array();
$ufFieldBAO = new CRM_Core_BAO_UFField();
--- /dev/null
+// http://civicrm.org/licensing
+// Opens the "new item" dialog after creating a container/set
+CRM.$(function($) {
+ var emptyMsg = $('.crm-empty-table');
+ if (emptyMsg.length) {
+ $('.action-link a.button', '#crm-container').click();
+ }
+});
{else}
{if $action eq 16}
- <div class="messages status no-popup">
+ <div class="messages status no-popup crm-empty-table">
<img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/>
- {ts 1=$groupTitle}There are no fields for custom group '%1'</a>.{/ts}
+ {ts}None found.{/ts}
</div>
{/if}
{/if}
{else}
{if $action eq 16}
- <div class="messages status no-popup">
+ <div class="messages status no-popup crm-empty-table">
<div class="icon inform-icon"></div>
- {ts 1=$groupTitle 2=$crmURL}There are no fields for price set '%1'.{/ts}
+ {ts}None found.{/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>
{else}
{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="messages status no-popup crm-empty-table">
<div class="icon inform-icon"></div>
- {ts 1=$groupTitle 2=$crmURL}There are no CiviCRM Profile Fields for '%1'</a>.{/ts}
+ {ts}None found.{/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>