diff --git a/app/templates/ApiUsers/fields.inc b/app/templates/ApiUsers/fields.inc index 007a2681b..f5390c24e 100644 --- a/app/templates/ApiUsers/fields.inc +++ b/app/templates/ApiUsers/fields.inc @@ -26,11 +26,11 @@ */ // This view does not support read-only -if($vv_action == 'add' || $vv_action == 'edit') { +if($vv_action == 'add' || $vv_action == 'edit') { if($vv_cur_co->id == 1) { print $this->element('banner', __d('information', 'api.cmp')); } - + // AR-ApiUser-3 For namespacing purposes, API Users are named with a prefix consisting of the string "co_#.". print $this->element('form/listItem', [ 'arguments' => [ @@ -38,7 +38,7 @@ if($vv_action == 'add' || $vv_action == 'edit') { 'prefix' => 'co_' . $vv_cur_co->id . '.' ] ]); - + // We link to the "Generate" button on edit only $generateLink = []; $labelIsTextOnly = false; @@ -67,14 +67,12 @@ if($vv_action == 'add' || $vv_action == 'edit') { ] ]); - print $this->element('form/listItem', [ 'arguments' => [ 'fieldName' => 'status', // select ] ]); - print $this->element('form/listItem', [ 'arguments' => [ 'fieldName' => 'valid_from', // timestamp diff --git a/app/templates/CoSettings/fields.inc b/app/templates/CoSettings/fields.inc index 983f808ea..0b0968ba9 100644 --- a/app/templates/CoSettings/fields.inc +++ b/app/templates/CoSettings/fields.inc @@ -28,50 +28,95 @@ Field->control('required_fields_address', ['suppressBlank' => true]); - - print $this->Field->control('default_address_type_id'); - - print $this->Field->control('default_email_address_type_id'); - - print $this->Field->control('default_identifier_type_id'); - - print $this->Field->control('default_name_type_id'); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'required_fields_address', + 'options' => ['empty' => false] + ]]); - print $this->Field->control('permitted_fields_name', ['suppressBlank' => true]); - - print $this->Field->control('required_fields_name', ['suppressBlank' => true]); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'default_address_type_id' + ]]); - print $this->Field->control('default_pronoun_type_id'); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'default_email_address_type_id' + ]]); - print $this->Field->control('default_telephone_number_type_id'); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'default_identifier_type_id' + ]]); - print $this->Field->control('permitted_fields_telephone_number', ['suppressBlank' => true]); - - print $this->Field->control('default_url_type_id'); - - print $this->Field->control('search_global_limit'); - - print $this->Field->control('search_global_limited_models'); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'default_name_type_id' + ]]); - print $this->Field->groupedControls( - [ - 'person_picker_email_address_type_id' => [ - 'options' => [ - 'suppressBlank' => true, - 'label' => __d('field', 'mail'), + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'permitted_fields_name', + 'options' => ['empty' => false] + ]]); + + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'required_fields_name', + 'options' => ['empty' => false] + ]]); + + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'default_pronoun_type_id' + ]]); + + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'default_telephone_number_type_id' + ]]); + + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'permitted_fields_telephone_number', + 'options' => ['empty' => false] + ]]); + + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'default_url_type_id' + ]]); + + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'search_global_limit' + ]]); + + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'search_global_limited_models' + ]]); + + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'person_picker_display_fields', + 'groupedControls' => [ + // each key is the fieldName of the control we are going to create + 'person_picker_email_address_type_id' => [ + 'options' => [ + 'empty' => true, + 'label' => __d('field', 'mail'), + ], ], - ], - 'person_picker_identifier_type_id' => [ - 'options' => [ - 'suppressBlank' => true, - 'label' => __d('field', 'identifier'), + 'person_picker_identifier_type_id' => [ + 'options' => [ + 'empty' => true, + 'label' => __d('field', 'identifier'), + ], ], + 'person_picker_display_types' => [ + 'singleRowItem' => true + ] ], - 'person_picker_display_types' => [ - 'singleRowItem' => true - ] - ], - 'person_picker_display_fields' - ); + ]]); } diff --git a/app/templates/element/form/fieldDiv.php b/app/templates/element/form/fieldDiv.php index 6248982b3..c494c2fdc 100644 --- a/app/templates/element/form/fieldDiv.php +++ b/app/templates/element/form/fieldDiv.php @@ -33,14 +33,16 @@ element('form/nameDiv'); - + // Info Div if(isset($vv_field_arguments['prefix'])) { - print $this->element('form/infoDivWithPrefix'); + print $this->element('form/infoDiv/withPrefix'); } elseif(isset($vv_field_arguments['status'])) { - print $this->element('form/infoDivStatus'); + print $this->element('form/infoDiv/status'); + } elseif(isset($vv_field_arguments['groupedControls'])) { + print $this->element('form/infoDiv/grouped'); } else { - print $this->element('form/infoDiv'); + print $this->element('form/infoDiv/default'); } ?> \ No newline at end of file diff --git a/app/templates/element/form/infoDiv.php b/app/templates/element/form/infoDiv/default.php similarity index 100% rename from app/templates/element/form/infoDiv.php rename to app/templates/element/form/infoDiv/default.php diff --git a/app/templates/element/form/infoDiv/grouped.php b/app/templates/element/form/infoDiv/grouped.php new file mode 100644 index 000000000..d5278f945 --- /dev/null +++ b/app/templates/element/form/infoDiv/grouped.php @@ -0,0 +1,51 @@ + + +