diff --git a/app/templates/GroupMembers/fields.inc b/app/templates/GroupMembers/fields.inc index 4775a33b5..5a2308c09 100644 --- a/app/templates/GroupMembers/fields.inc +++ b/app/templates/GroupMembers/fields.inc @@ -28,46 +28,54 @@ if($vv_action == 'add') { if(!empty($vv_selected_person)) { // The person has been preselected. Created a hidden field, and present information about the person. - print $this->Form->hidden('person_id', ['value' => $vv_selected_person['id']]); + $hidden = [ + 'person_id' => $vv_selected_person['id'] + ]; - // Present the person information in the view: -?> -
  • -
    -
    -
    - -
    -
    -
    - - - - - () - -
    -
    -
  • -element('form/listItem', [ + 'arguments' => [ + 'fieldName' => '', + 'labelText' => __d('field','name'), + 'groupmember' => $vv_selected_person + ] + ]); } else { // Produce the autocomplete people selector on 'add' - print $this->Field->peopleAutocompleteControl('person_id', [ - 'for' => 'GroupMembers', - 'action' => $vv_action, - 'groupId' => $this->getRequest()?->getQuery('group_id') - ]); + print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'person_id', + 'options' => [ + 'class' => 'form-control people-autocomplete', + 'placeholder' => __d('operation','autocomplete.people.placeholder'), + 'id' => 'person_id', + ], + 'autocomplete' => [ + 'configuration' => [ + 'for' => 'GroupMembers', + 'action' => $vv_action, + 'groupId' => $this->getRequest()?->getQuery('group_id') + ] + ] + ] + ]); } - - // XXX As a temporary hack for development, we accept a manually entered Person ID - // XXX leave here temporarily. - //print $this->Field->control('person_id', ['type' => 'text']); } else { - print $this->Form->hidden('person_id'); + $hidden = [ + 'person_id' => $vv_obj->person_id + ]; } -print $this->Field->dateControl('valid_from'); +print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'valid_from', + ] +]); -print $this->Field->dateControl('valid_through'); +print $this->element('form/listItem', [ + 'arguments' => [ + 'fieldName' => 'valid_through', + ] +]); // XXX RFE: Add links to EIS or Nesting info \ No newline at end of file diff --git a/app/templates/element/form/fieldDiv.php b/app/templates/element/form/fieldDiv.php index bc3b63bc5..ecec7e2e4 100644 --- a/app/templates/element/form/fieldDiv.php +++ b/app/templates/element/form/fieldDiv.php @@ -45,6 +45,10 @@ print $this->element('form/infoDiv/source'); } elseif(isset($vv_field_arguments['check']) && $vv_field_arguments['check']) { print $this->element('form/infoDiv/check'); + } elseif(isset($vv_field_arguments['groupmember'])) { + print $this->element('form/infoDiv/groupMember'); + } elseif(isset($vv_field_arguments['autocomplete'])) { + print $this->element('form/infoDiv/autocomplete'); } else { print $this->element('form/infoDiv/default'); } diff --git a/app/templates/element/form/infoDiv/autocomplete.php b/app/templates/element/form/infoDiv/autocomplete.php new file mode 100644 index 000000000..02477afab --- /dev/null +++ b/app/templates/element/form/infoDiv/autocomplete.php @@ -0,0 +1,59 @@ +Form->unlockField($fieldName); +$this->Form->unlockField($autoCompleteFieldName); + +$autocompleteArgs = [ + 'type' => 'field', + 'fieldName' => $fieldName, + 'personType' => 'person', + 'htmlId' => $autoCompleteFieldName, + 'viewConfigParameters' => $vv_field_arguments['autocomplete']['configuration'] +]; + +?> + + +Form->hidden($fieldName, $vv_field_arguments['options']) . $this->element('peopleAutocomplete', $autocompleteArgs); +?> +
    + info + +
    diff --git a/app/templates/element/form/infoDiv/groupMember.php b/app/templates/element/form/infoDiv/groupMember.php new file mode 100644 index 000000000..8d4b6069e --- /dev/null +++ b/app/templates/element/form/infoDiv/groupMember.php @@ -0,0 +1,41 @@ + + + + + + + + () + + diff --git a/app/templates/element/form/listItem.php b/app/templates/element/form/listItem.php index c14ba9e6e..0d95d0355 100644 --- a/app/templates/element/form/listItem.php +++ b/app/templates/element/form/listItem.php @@ -48,6 +48,10 @@ default => '' }; +if(isset($arguments['autocomplete'])) { + $classes = 'fields-people-autocomplete '; +} + ?>
  • diff --git a/app/templates/element/form/nameDiv.php b/app/templates/element/form/nameDiv.php index 028709d6e..8cc7a49f9 100644 --- a/app/templates/element/form/nameDiv.php +++ b/app/templates/element/form/nameDiv.php @@ -66,7 +66,6 @@ ?>
    -