diff --git a/CRM/UF/Form/Group.php b/CRM/UF/Form/Group.php index 933cfc537fa..77cca1586df 100644 --- a/CRM/UF/Form/Group.php +++ b/CRM/UF/Form/Group.php @@ -64,6 +64,7 @@ protected function setEntityFields() { 'title' => ['name' => 'title'], 'frontend_title' => ['name' => 'frontend_title'], 'description' => ['name' => 'description', 'help' => ['id' => 'id-description', 'file' => 'CRM/UF/Form/Group.hlp']], + 'uf_group_type' => ['name' => 'uf_group_type', 'not-auto-addable' => TRUE, 'help' => ['id' => 'id-used_for', 'file' => 'CRM/UF/Form/Group.hlp'], 'post_html_text' => ' ' . $this->getOtherModuleString()] ]; } @@ -266,17 +267,6 @@ public function setDefaultValues() { } $defaults['uf_group_type'] = isset($checked) ? $checked : ""; - //get the uf join records for current uf group other than default modules - $otherModules = array(); - $otherModules = CRM_Core_BAO_UFGroup::getUFJoinRecord($this->_id, TRUE, TRUE); - if (!empty($otherModules)) { - $otherModuleString = NULL; - foreach ($otherModules as $key) { - $otherModuleString .= " [ x ] "; - } - $this->assign('otherModuleString', $otherModuleString); - } - $showAdvanced = 0; $advFields = array( 'group', @@ -422,4 +412,20 @@ public function postProcess() { */ public function setDeleteMessage() {} + /** + * Get the string to display next to the used for field indicating unchangeable uses. + * + * @return string + */ + protected function getOtherModuleString() { + $otherModules = CRM_Core_BAO_UFGroup::getUFJoinRecord($this->_id, TRUE, TRUE); + if (!empty($otherModules)) { + $otherModuleString = NULL; + foreach ($otherModules as $key) { + $otherModuleString .= " [ x ] "; + } + } + return $otherModuleString; + } + } diff --git a/templates/CRM/Core/Form/Field.tpl b/templates/CRM/Core/Form/Field.tpl index fb6a01eee9a..5aa672db6c4 100644 --- a/templates/CRM/Core/Form/Field.tpl +++ b/templates/CRM/Core/Form/Field.tpl @@ -33,7 +33,7 @@ {/capture}{help id=$help.id file=$help.file}{/if} {if $action == 2 && $fieldSpec.is_add_translate_dialog}{include file='CRM/Core/I18n/Dialog.tpl' table=$entityTable field=$fieldName id=$entityID}{/if} -