diff --git a/app/plugins/CoreEnroller/templates/AttributeCollectors/dispatch.inc b/app/plugins/CoreEnroller/templates/AttributeCollectors/dispatch.inc index c69891e06..d0a6475ec 100644 --- a/app/plugins/CoreEnroller/templates/AttributeCollectors/dispatch.inc +++ b/app/plugins/CoreEnroller/templates/AttributeCollectors/dispatch.inc @@ -25,8 +25,8 @@ * @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) */ -// This view does currently not support read-only -if($vv_action == 'add' || $vv_action == 'edit') { +// This view is intended to work with dispatch +if($vv_action == 'dispatch') { foreach($vv_enrollment_attributes as $attr) { $options = []; diff --git a/app/src/Model/Table/PetitionStepResultsTable.php b/app/src/Model/Table/PetitionStepResultsTable.php index 2c4f84781..a714d2612 100644 --- a/app/src/Model/Table/PetitionStepResultsTable.php +++ b/app/src/Model/Table/PetitionStepResultsTable.php @@ -38,6 +38,7 @@ class PetitionStepResultsTable extends Table { use \App\Lib\Traits\PermissionsTrait; use \App\Lib\Traits\PrimaryLinkTrait; use \App\Lib\Traits\TableMetaTrait; + use \App\Lib\Traits\ValidationTrait; /** * Perform Cake Model initialization. diff --git a/app/templates/Petitions/columns.inc b/app/templates/Petitions/columns.inc new file mode 100644 index 000000000..1cfed9ffc --- /dev/null +++ b/app/templates/Petitions/columns.inc @@ -0,0 +1,94 @@ + [ + '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' + ] +]; \ No newline at end of file diff --git a/app/templates/Petitions/fields.inc b/app/templates/Petitions/fields.inc new file mode 100644 index 000000000..b89841d3f --- /dev/null +++ b/app/templates/Petitions/fields.inc @@ -0,0 +1,87 @@ +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 "
= __d('field', 'ordr') ?> | += __d('controller', 'EnrollmentFlowSteps', [1]) ?> | += __d('result', 'result') ?> | += __d('field', 'EnrollmentFlows.authz_type') ?> | += __d('field', 'action') ?> | +
---|---|---|---|---|
= $step->ordr ?? "" ?> | += $step->description ?> | + += $step->petition_step_results[0]->comment ?? "" ?> | += __d('enumeration', 'EnrollmentActorEnum.'.$step->actor_type) ?> | +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; + } + } + ?> | +