Merge branch '4.4' of https://github.com/civicrm/civicrm-core into 4.5
[civicrm-core.git] / CRM / Custom / Form / Group.php
index 82720dcc0a485b94cca7a34ffc0450f2bf5916aa..940268bad28526d7c19e075438cd7bd87791af48 100644 (file)
@@ -499,7 +499,9 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
       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&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');
@@ -536,6 +538,11 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
    * @static
    * return array array of relationship name.
    */
+  /**
+   * @param $list
+   *
+   * @return array
+   */
   static function getFormattedList(&$list) {
     $relName = array();