Skip to content

Commit

Permalink
Groups
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Apr 26, 2024
1 parent d77c602 commit dd5d806
Showing 1 changed file with 39 additions and 36 deletions.
75 changes: 39 additions & 36 deletions app/templates/Groups/fields.inc
Original file line number Diff line number Diff line change
Expand Up @@ -32,50 +32,53 @@ if($vv_obj->isOwners()) {
$options['readonly'] = true;
}

print $this->Field->control(
fieldName: 'name',
options: $options
);

print $this->Field->control(
fieldName: 'description',
options: $options
);

print $this->Field->control(
fieldName: 'status',
options: $options
);

print $this->Field->control(
fieldName: 'open',
options: $options
);
foreach(['name',
'description',
'status',
'open',] as $field) {
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => $field,
'options' => $options
]
]);
}

print $this->Field->control('nesting_mode_all');
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'nesting_mode_all',
]
]);

if($vv_action != 'add') {
print $this->Field->control(
fieldName: 'group_type',
options: ['readonly' => true]
);

print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'group_type',
'options' => [
'readonly' => true
]
]
]);

if($vv_obj->isOwners()) {
// Link to the main group
if(!empty($vv_obj->owners_for_group)) {
print $this->Field->statusControl(
fieldName: 'owners_group_id',
status: $vv_obj->owners_for_group->name,
link: ['url' => ['controller' => 'groups', 'action' => 'edit', $vv_obj->owners_for_group->id]]
);
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'owners_group_id',
'status' => $vv_obj->owners_for_group->name,
'link' => ['url' => ['controller' => 'groups', 'action' => 'edit', $vv_obj->owners_for_group->id]],
]
]);
}
} else {
// Link to the owners group

print $this->Field->statusControl(
fieldName: 'owners_group_id',
status: $vv_obj->owners_group->name ?? '',
link: ['url' => ['controller' => 'groups', 'action' => 'edit', $vv_obj->owners_group_id]]
);
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'owners_group_id',
'status' => $vv_obj->owners_group->name ?? '',
'link' => ['url' => ['controller' => 'groups', 'action' => 'edit', $vv_obj->owners_group_id]]
]
]);
}
}

0 comments on commit dd5d806

Please sign in to comment.