Skip to content
Snippets Groups Projects
Commit 3fde8ee5 authored by colemanw's avatar colemanw
Browse files

CRM-13783 - ProfileBuilder - Create new custom field in popup dialog

parent 83df6b4a
No related branches found
No related tags found
No related merge requests found
......@@ -293,7 +293,6 @@
events: {
'keyup .crm-designer-palette-search input': 'doSearch',
'click .crm-designer-palette-clear-search': 'clearSearch',
'click .crm-designer-palette-refresh': 'doRefresh',
'click .crm-designer-palette-toggle': 'toggleAll'
},
initialize: function() {
......@@ -401,30 +400,23 @@
},
doAddField: function(section) {
var paletteView = this;
var openAddNewWindow = function() {
var url = CRM.url('civicrm/admin/custom/group/field/add', {
reset: 1,
action: 'add',
gid: section.custom_group_id
});
window.open(url, '_blank');
};
if (paletteView.hideAddFieldAlert) {
openAddNewWindow();
} else {
CRM.confirm(function() {
paletteView.hideAddFieldAlert = true;
openAddNewWindow();
}, {
title: ts('Add Field'),
message: ts('A new window or tab will open. Use the new window to add your field, and then return to this window and click "Refresh."')
var url = CRM.url('civicrm/admin/custom/group/field/add', {
reset: 1,
action: 'add',
gid: section.custom_group_id
});
CRM.loadForm(url, {
resetButton: 'next_new',
onSuccess: function(data, settings) {
paletteView.doRefresh();
if (data.buttonName != 'next_new') {
$(settings.target).dialog('close');
}
);
}
}
});
return false;
},
doRefresh: function(event) {
doRefresh: function() {
var ufGroupModel = this.model;
CRM.Schema.reloadModels()
.done(function(data){
......
......@@ -29,8 +29,7 @@
<a class="crm-designer-palette-clear-search" href="#" title="{ts}Clear search{/ts}"><img src="{$config->resourceBase}i/close.png" class="action-icon" alt="X" /></a>
<div class="crm-designer-palette-controls">
<a href="#" class="crm-designer-palette-toggle" rel="open_all">{ts}Open All{/ts}</a>&nbsp; |&nbsp;
<a href="#" class="crm-designer-palette-toggle" rel="close_all">{ts}Close All{/ts}</a>&nbsp; |&nbsp;
<a href="#" class="crm-designer-palette-refresh">{ts}Refresh{/ts}</a>
<a href="#" class="crm-designer-palette-toggle" rel="close_all">{ts}Close All{/ts}</a>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment