Skip to content

Commit

Permalink
GroupNestings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Apr 27, 2024
1 parent 5ba2ef7 commit 1bc7299
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/src/Controller/ApiUsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function generate(string $id) {
'Groups', 'Servers', 'Types', 'Urls', 'Identifiers', 'HistoryRecords',
'TelephoneNumbers', 'Names', 'AdHocAttributes', 'PersonRoles', 'ExternalIdentities',
'ExternalIdentityRoles', 'ExternalIdentitySources', 'ExternalIdentitySourceRecords',
'IdentifierAssignments', 'Jobs', 'JobHistoryRecords', 'People'
'IdentifierAssignments', 'Jobs', 'JobHistoryRecords', 'People', 'GroupNestings'
])
) {
$this->render('/Standard/add-edit-view-new');
Expand Down
6 changes: 3 additions & 3 deletions app/src/Controller/StandardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function add() {
'Groups', 'Servers', 'Types', 'Urls', 'Identifiers', 'HistoryRecords',
'TelephoneNumbers', 'Names', 'AdHocAttributes', 'PersonRoles', 'ExternalIdentities',
'ExternalIdentityRoles', 'ExternalIdentitySources', 'ExternalIdentitySourceRecords',
'IdentifierAssignments', 'Jobs', 'JobHistoryRecords', 'People'
'IdentifierAssignments', 'Jobs', 'JobHistoryRecords', 'People', 'GroupNestings'
])
) {
$this->render('/Standard/add-edit-view-new');
Expand Down Expand Up @@ -437,7 +437,7 @@ public function edit(string $id) {
'Groups', 'Servers', 'Types', 'Urls', 'Identifiers', 'HistoryRecords',
'TelephoneNumbers', 'Names', 'AdHocAttributes', 'PersonRoles', 'ExternalIdentities',
'ExternalIdentityRoles', 'ExternalIdentitySources', 'ExternalIdentitySourceRecords',
'IdentifierAssignments', 'Jobs', 'JobHistoryRecords', 'People'
'IdentifierAssignments', 'Jobs', 'JobHistoryRecords', 'People', 'GroupNestings'
])
) {
$this->render('/Standard/add-edit-view-new');
Expand Down Expand Up @@ -896,7 +896,7 @@ public function view($id = null) {
'Groups', 'Servers', 'Types', 'Urls', 'Identifiers', 'HistoryRecords',
'TelephoneNumbers', 'Names', 'AdHocAttributes', 'PersonRoles', 'ExternalIdentities',
'ExternalIdentityRoles', 'ExternalIdentitySources', 'ExternalIdentitySourceRecords',
'IdentifierAssignments', 'Jobs', 'JobHistoryRecords', 'People'
'IdentifierAssignments', 'Jobs', 'JobHistoryRecords', 'People', 'GroupNestings'
])
) {
$this->render('/Standard/add-edit-view-new');
Expand Down
51 changes: 38 additions & 13 deletions app/templates/GroupNestings/fields.inc
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,47 @@
*/

if($vv_action == 'add') {
print $this->Field->control('target_group_id');
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'target_group_id',
]
]);
} elseif($vv_action == 'edit') {
$link = [
'url' => [
'controller' => 'groups',
'action' => 'edit',
$vv_obj->target_group_id]
];
// The target group can't be changed after adding
print $this->Field->statusControl('target_group_id',
$vv_obj->target_group->name,
['url' => ['controller' => 'groups',
'action' => 'edit',
$vv_obj->target_group_id]]);
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'target_group_id',
'status' => $vv_obj->target_group->name,
'link' => $link,
]
]);
}

if($vv_action == 'add' || $vv_action == 'edit') {
print $this->Field->statusControl('group_id',
$vv_bc_parent_obj->name,
['url' => ['controller' => 'groups',
'action' => 'edit',
$vv_bc_parent_obj->id]]);

print $this->Field->control('negate');
$link = [
'url' => [
'controller' => 'groups',
'action' => 'edit',
$vv_bc_parent_obj->id]
];
// The target group can't be changed after adding
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'group_id',
'status' => $vv_bc_parent_obj->name,
'link' => $link,
]
]);

print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'negate',
]
]);
}

0 comments on commit 1bc7299

Please sign in to comment.