-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Miscellaneous Enrollment fixes (CFM-31)
- Loading branch information
Showing
5 changed files
with
246 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?php | ||
/** | ||
* COmanage Registry Petitions Index Columns | ||
* | ||
* Portions licensed to the University Corporation for Advanced Internet | ||
* Development, Inc. ("UCAID") under one or more contributor license agreements. | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. | ||
* | ||
* UCAID licenses this file to you under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at: | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @link https://www.internet2.edu/comanage COmanage Project | ||
* @package registry | ||
* @since COmanage Registry v5.0.0 | ||
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | ||
*/ | ||
|
||
$indexColumns = [ | ||
// We start with id to ensure there is a clickable field in the row | ||
'id' => [ | ||
'type' => 'link' | ||
], | ||
'enrollee_person_id' => [ | ||
'type' => 'relatedLink', | ||
'action' => 'edit', | ||
'label' => __d('field', 'Petitions.enrollee_person_id'), | ||
'model' => 'enrollee_person', | ||
'submodel' => 'primary_name', | ||
'field' => 'full_name', | ||
'default' => __d('field', 'Petitions.enrollee.new') | ||
], | ||
'status' => [ | ||
'type' => 'enum', | ||
'class' => 'PetitionStatusEnum', | ||
'sortable' => true | ||
], | ||
'enrollment_flow_id' => [ | ||
'type' => 'relatedLink', | ||
'model' => 'enrollment_flow', | ||
'field' => 'name' | ||
], | ||
'cou_id' => [ | ||
'type' => 'relatedLink', | ||
'model' => 'cou', | ||
'field' => 'name' | ||
], | ||
/* XXX this apparently isn't in the data model yet? | ||
'petitioner_person_id' => [ | ||
'type' => 'relatedLink', | ||
'action' => 'edit', | ||
// 'label' => __d('field', 'actor'), | ||
'model' => 'petitioner_person', | ||
'submodel' => 'primary_name', | ||
'field' => 'full_name' | ||
],*/ | ||
// sponsor | ||
// approver - there can be multiple approvers going forward, maybe omit this column | ||
'created' => [ | ||
'type' => 'datetime' | ||
], | ||
'modified' => [ | ||
'type' => 'datetime' | ||
] | ||
]; | ||
|
||
// $rowActions appear as row-level menu items in the index view gear icon | ||
$rowActions = [ | ||
[ | ||
'controller' => 'petitions', | ||
'action' => 'view', | ||
'class' => '', | ||
'icon' => 'visibility', | ||
'label' => __d('operation', 'view') | ||
], | ||
[ | ||
'controller' => 'petitions', | ||
'action' => 'resume', | ||
'class' => '', | ||
// XXX this icon is supposed to be "resume" but that doesn't appear to render | ||
'icon' => 'start', | ||
'label' => __d('operation', 'resume'), | ||
'if' => 'isResumable' | ||
] | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?php | ||
/** | ||
* COmanage Registry Petitions Fields | ||
* | ||
* Portions licensed to the University Corporation for Advanced Internet | ||
* Development, Inc. ("UCAID") under one or more contributor license agreements. | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. | ||
* | ||
* UCAID licenses this file to you under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at: | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @link https://www.internet2.edu/comanage COmanage Project | ||
* @package registry | ||
* @since COmanage Registry v5.0.0 | ||
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | ||
*/ | ||
|
||
// Petitions are read-only, though they can link to other actions | ||
if($vv_action == 'view') { | ||
// Start with the petition metadata | ||
print $this->Field->control('status'); | ||
|
||
print $this->Field->statusControl( | ||
fieldName: 'enrollee_person_id', | ||
status: !empty($vv_obj->enrollee_person->primary_name) | ||
? $vv_obj->enrollee_person->primary_name->full_name | ||
: __d('field', 'Petitions.enrollee.new'), | ||
link: (!empty($vv_obj->enrollee_person->id) | ||
? ['url' => [ | ||
'controller' => 'people', | ||
'action' => 'edit', | ||
$vv_obj->enrollee_person_id | ||
]] | ||
: []) | ||
); | ||
|
||
print $this->Field->statusControl( | ||
fieldName: 'petitioner_person_id', | ||
status: !empty($vv_obj->petitioner_person->primary_name) | ||
? $vv_obj->petitioner_person->primary_name->full_name | ||
: "", | ||
link: (!empty($vv_obj->petitioner_person->id) | ||
? ['url' => [ | ||
'controller' => 'people', | ||
'action' => 'edit', | ||
$vv_obj->enrollee_person_id | ||
]] | ||
: []) | ||
); | ||
|
||
// XXX petitioner_identifier if set? | ||
print "<ol>\n"; | ||
|
||
// XXX merge this with resume? | ||
foreach($vv_obj->enrollment_flow->enrollment_flow_steps as $step) { | ||
$stepId = $step->id; | ||
|
||
print "<li>" . $step->description; | ||
|
||
$result = \Cake\Utility\Hash::extract($vv_obj->petition_step_results, "{n}[enrollment_flow_step_id=$stepId]"); | ||
|
||
if(!empty($result)) { | ||
print ", Result: " . $result[0]->comment | ||
. $this->Html->link(' (View)', [ | ||
'controller' => 'petitions', | ||
'action' => 'result', | ||
$vv_obj->id, | ||
'?' => ['enrollment_flow_step_id' => $step->id] | ||
]); | ||
} | ||
|
||
print "</li>\n"; | ||
} | ||
|
||
print "</ol>\n"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
/** | ||
* COmanage Registry Petitions Resume View | ||
* | ||
* Portions licensed to the University Corporation for Advanced Internet | ||
* Development, Inc. ("UCAID") under one or more contributor license agreements. | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. | ||
* | ||
* UCAID licenses this file to you under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at: | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @link https://www.internet2.edu/comanage COmanage Project | ||
* @package registry | ||
* @since COmanage Registry v5.0.0 | ||
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | ||
*/ | ||
|
||
declare(strict_types = 1); | ||
|
||
// Track when we've rendered the current/next step so we know when to stop rendering links | ||
$seenNextStep = false; | ||
?> | ||
<table> | ||
<tr> | ||
<th><?= __d('field', 'ordr') ?></th> | ||
<th><?= __d('controller', 'EnrollmentFlowSteps', [1]) ?></th> | ||
<th><?= __d('result', 'result') ?></th> | ||
<th><?= __d('field', 'EnrollmentFlows.authz_type') ?></th> | ||
<th><?= __d('field', 'action') ?></th> | ||
</tr> | ||
<?php foreach($vv_steps as $step): ?> | ||
<tr> | ||
<td><?= $step->ordr ?? "" ?></td> | ||
<td><?= $step->description ?></td> | ||
<!-- this could be a link to the detailed step result --> | ||
<td><?= $step->petition_step_results[0]->comment ?? "" ?></td> | ||
<td><?= __d('enumeration', 'EnrollmentActorEnum.'.$step->actor_type) ?></td> | ||
<td><?php | ||
if(!$seenNextStep && !empty($vv_dispatch_urls[ $step->id ])) { | ||
print $this->Html->link( | ||
($step->id == $vv_next_step_id) ? __d('operation', 'continue') : __d('operation', 'Petitions.rerun'), | ||
$vv_dispatch_urls[ $step->id ] | ||
); | ||
|
||
if($step->id == $vv_next_step_id) { | ||
$seenNextStep = true; | ||
} | ||
} | ||
?></td> | ||
</tr> | ||
<?php endforeach; // $vv_steps ?> | ||
</table> |