From: Coleman Watts Date: Sun, 17 Nov 2013 23:11:14 +0000 (-0800) Subject: CRM-13783 - ProfileBuilder - Create new custom field in popup dialog X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3fde8ee54d6ed5d594442c64f1b23ce8d89a33c3;p=civicrm-core.git CRM-13783 - ProfileBuilder - Create new custom field in popup dialog --- diff --git a/js/view/crm.designer.js b/js/view/crm.designer.js index 9077eb39bf..2bea05605f 100644 --- a/js/view/crm.designer.js +++ b/js/view/crm.designer.js @@ -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){ diff --git a/templates/CRM/UF/Page/ProfileTemplates.tpl b/templates/CRM/UF/Page/ProfileTemplates.tpl index 312dc4dd92..32e9cc2bbc 100644 --- a/templates/CRM/UF/Page/ProfileTemplates.tpl +++ b/templates/CRM/UF/Page/ProfileTemplates.tpl @@ -29,8 +29,7 @@ X
{ts}Open All{/ts}  |  - {ts}Close All{/ts}  |  - {ts}Refresh{/ts} + {ts}Close All{/ts}