diff --git a/app/plugins/CoreEnroller/src/View/Cell/AttributeCollectorsCell.php b/app/plugins/CoreEnroller/src/View/Cell/AttributeCollectorsCell.php
new file mode 100644
index 000000000..bef6e3072
--- /dev/null
+++ b/app/plugins/CoreEnroller/src/View/Cell/AttributeCollectorsCell.php
@@ -0,0 +1,89 @@
+
+ */
+ protected $_validCellOptions = [
+ 'vv_obj',
+ 'vv_step',
+ 'viewVars',
+ ];
+
+ /**
+ * Initialization logic run at the end of object construction.
+ *
+ * @return void
+ */
+ public function initialize(): void
+ {
+ }
+
+ /**
+ * Default display method.
+ *
+ * @param int $petitionId
+ * @return void
+ * @since COmanage Registry v5.1.0
+ */
+ public function display(int $petitionId): void
+ {
+ $vv_enrollment_atttributes_ids = Hash::extract($this->vv_obj->petition_attributes, '{n}.enrollment_attribute_id');
+ $vv_enrollment_atttributes_ids = array_unique($vv_enrollment_atttributes_ids);
+
+ $vv_enrollment_attributes = $this->fetchTable('EnrollmentAttributes')
+ ->find()
+ ->where(fn(QueryExpression $exp, Query $q) => $exp->in('id', $vv_enrollment_atttributes_ids))
+ ->order(['ordr' => 'ASC'])
+ ->toArray();
+
+ $this->set('vv_enrollment_attributes', $vv_enrollment_attributes);
+ $this->set('vv_step', $this->vv_step);
+ $this->set('vv_obj', $this->vv_obj);
+ }
+}
diff --git a/app/plugins/CoreEnroller/src/View/Cell/BasicAttributeCollectorsCell.php b/app/plugins/CoreEnroller/src/View/Cell/BasicAttributeCollectorsCell.php
new file mode 100644
index 000000000..16e12361b
--- /dev/null
+++ b/app/plugins/CoreEnroller/src/View/Cell/BasicAttributeCollectorsCell.php
@@ -0,0 +1,81 @@
+
+ */
+ protected $_validCellOptions = [
+ 'vv_obj',
+ 'vv_step',
+ 'viewVars',
+ ];
+
+ /**
+ * Initialization logic run at the end of object construction.
+ *
+ * @return void
+ */
+ public function initialize(): void
+ {
+ }
+
+ /**
+ * Default display method.
+ *
+ * @param int $petitionId
+ * @return string
+ * @since COmanage Registry v5.1.0
+ */
+ public function display(int $petitionId): void
+ {
+ $vv_petition_basic_attribute_set = $this->fetchTable('PetitionBasicAttributeSets')
+ ->find()
+ ->where(['PetitionBasicAttributeSets.petition_id' => $this->vv_obj->id])
+ ->firstOrFail();
+
+ $this->set('vv_petition_basic_attribute_set', $vv_petition_basic_attribute_set);
+ $this->set('vv_obj', $this->vv_obj);
+ }
+}
diff --git a/app/plugins/CoreEnroller/src/View/Cell/EmailVerifiersCell.php b/app/plugins/CoreEnroller/src/View/Cell/EmailVerifiersCell.php
new file mode 100644
index 000000000..e855b6e2a
--- /dev/null
+++ b/app/plugins/CoreEnroller/src/View/Cell/EmailVerifiersCell.php
@@ -0,0 +1,85 @@
+
+ */
+ protected $_validCellOptions = [
+ 'vv_obj',
+ 'vv_step',
+ 'viewVars',
+ ];
+
+ /**
+ * Initialization logic run at the end of object construction.
+ *
+ * @return void
+ */
+ public function initialize(): void
+ {
+ }
+
+ /**
+ * Default display method.
+ *
+ * @param int $petitionId
+ * @return void
+ * @since COmanage Registry v5.1.0
+ */
+ public function display(int $petitionId): void
+ {
+ // Because Petition Verifications are not tracked on a per-step basis, we just pull all
+ // associated with the Petition
+
+ $vv_pv = $this->fetchTable('CoreEnroller.PetitionVerifications')
+ ->find()
+ ->where(['PetitionVerifications.petition_id' => $this->vv_obj->id])
+ ->contain(['Verifications'])
+ ->all();
+
+ $this->set('vv_pv', $vv_pv);
+ $this->set('viewVars', $this->viewVars);
+ }
+}
diff --git a/app/plugins/CoreEnroller/src/View/Cell/IdentifierCollectorsCell.php b/app/plugins/CoreEnroller/src/View/Cell/IdentifierCollectorsCell.php
new file mode 100644
index 000000000..af18eb85b
--- /dev/null
+++ b/app/plugins/CoreEnroller/src/View/Cell/IdentifierCollectorsCell.php
@@ -0,0 +1,80 @@
+
+ */
+ protected $_validCellOptions = [
+ 'vv_obj',
+ 'vv_step',
+ 'viewVars',
+ ];
+
+ /**
+ * Initialization logic run at the end of object construction.
+ *
+ * @return void
+ */
+ public function initialize(): void
+ {
+ }
+
+ /**
+ * Default display method.
+ *
+ * @param int $petitionId
+ * @return void
+ * @since COmanage Registry v5.1.0
+ */
+ public function display(int $petitionId): void
+ {
+ $vv_pi = $this->fetchTable('CoreEnroller.PetitionIdentifiers')
+ ->find()
+ ->where(['petition_id' => $this->vv_obj->id])
+ ->first();
+
+ $this->set('vv_pi', $vv_pi);
+ }
+}
diff --git a/app/plugins/CoreEnroller/src/View/Cell/InvitationAcceptersCell.php b/app/plugins/CoreEnroller/src/View/Cell/InvitationAcceptersCell.php
new file mode 100644
index 000000000..320b8dc87
--- /dev/null
+++ b/app/plugins/CoreEnroller/src/View/Cell/InvitationAcceptersCell.php
@@ -0,0 +1,80 @@
+
+ */
+ protected $_validCellOptions = [
+ 'vv_obj',
+ 'vv_step',
+ 'viewVars',
+ ];
+
+ /**
+ * Initialization logic run at the end of object construction.
+ *
+ * @return void
+ */
+ public function initialize(): void
+ {
+ }
+
+ /**
+ * Default display method.
+ *
+ * @param int $petitionId
+ * @return void
+ * @since COmanage Registry v5.1.0
+ */
+ public function display(int $petitionId): void
+ {
+ $vv_pa = $this->fetchTable('CoreEnroller.PetitionAcceptances')
+ ->find()
+ ->where(['petition_id' => $this->vv_obj->id])
+ ->first();
+
+ $this->set('vv_pa', $vv_pa);
+ }
+}
diff --git a/app/plugins/CoreEnroller/templates/element/petition/attributeCollectorsStep.php b/app/plugins/CoreEnroller/templates/cell/AttributeCollectors/display.php
similarity index 85%
rename from app/plugins/CoreEnroller/templates/element/petition/attributeCollectorsStep.php
rename to app/plugins/CoreEnroller/templates/cell/AttributeCollectors/display.php
index 0293a519f..e2d44c602 100644
--- a/app/plugins/CoreEnroller/templates/element/petition/attributeCollectorsStep.php
+++ b/app/plugins/CoreEnroller/templates/cell/AttributeCollectors/display.php
@@ -1,6 +1,6 @@
petition_attributes, '{n}.enrollment_attribute_id');
-$vv_enrollment_atttributes_ids = array_unique($vv_enrollment_atttributes_ids);
-
-$enrollmentAttributesTable = $this->Petition->getTable('EnrollmentAttributes');
-$vv_enrollment_attributes = $enrollmentAttributesTable->find()
- ->where(fn(QueryExpression $exp, Query $q) => $exp->in('id', $vv_enrollment_atttributes_ids))
- ->order(['ordr' => 'ASC'])
- ->toArray();
-
?>
diff --git a/app/plugins/CoreEnroller/templates/element/petition/basicAttributeCollectorsStep.php b/app/plugins/CoreEnroller/templates/cell/BasicAttributeCollectors/display.php
similarity index 86%
rename from app/plugins/CoreEnroller/templates/element/petition/basicAttributeCollectorsStep.php
rename to app/plugins/CoreEnroller/templates/cell/BasicAttributeCollectors/display.php
index e56d9dfd0..88b9562f0 100644
--- a/app/plugins/CoreEnroller/templates/element/petition/basicAttributeCollectorsStep.php
+++ b/app/plugins/CoreEnroller/templates/cell/BasicAttributeCollectors/display.php
@@ -1,6 +1,6 @@
id === null) {
- return __d('error', 'notfound', 'Petition Attributes');
- }
+if($vv_obj->id === null) {
+ return __d('error', 'notfound', 'Petition Attributes');
+}
- $tableObj = $this->Petition->getTable('PetitionBasicAttributeSets');
- $vv_petition_basic_attribute_set = $tableObj->find()
- ->where(['PetitionBasicAttributeSets.petition_id' => $vv_obj->id])
- ->firstOrFail();
?>
-
diff --git a/app/plugins/CoreEnroller/templates/cell/EmailVerifiers/display.php b/app/plugins/CoreEnroller/templates/cell/EmailVerifiers/display.php
new file mode 100644
index 000000000..a3bf4d13b
--- /dev/null
+++ b/app/plugins/CoreEnroller/templates/cell/EmailVerifiers/display.php
@@ -0,0 +1,53 @@
+
+
+
+
+
+ - = $pv->mail ?>:
+ verification) && $pv->verification->isVerified()): ?>
+ = __d('result', 'Verifications.status', [
+ VerificationMethodEnum::getLocalization($pv->verification->method),
+ $this->Time->nice($pv->verification->verification_time, $viewVars["vv_tz"])
+ ]) ?>
+
+ = __d('field','unverified') ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/app/plugins/CoreEnroller/templates/cell/IdentifierCollectors/display.php b/app/plugins/CoreEnroller/templates/cell/IdentifierCollectors/display.php
new file mode 100644
index 000000000..a5c6bae8a
--- /dev/null
+++ b/app/plugins/CoreEnroller/templates/cell/IdentifierCollectors/display.php
@@ -0,0 +1,39 @@
+
+identifier)): ?>
+
+ -
+ = __d('core_enroller', 'result.IdentifierCollector.collected', [$vv_pi->identifier]) ?>
+
+
+
\ No newline at end of file
diff --git a/app/plugins/CoreEnroller/templates/cell/InvitationAccepters/display.php b/app/plugins/CoreEnroller/templates/cell/InvitationAccepters/display.php
new file mode 100644
index 000000000..23b20b300
--- /dev/null
+++ b/app/plugins/CoreEnroller/templates/cell/InvitationAccepters/display.php
@@ -0,0 +1,50 @@
+
+
+
\ No newline at end of file
diff --git a/app/plugins/CoreEnroller/templates/element/petition/emailVerifiersStep.php b/app/plugins/CoreEnroller/templates/element/petition/emailVerifiersStep.php
deleted file mode 100644
index 33b48278b..000000000
--- a/app/plugins/CoreEnroller/templates/element/petition/emailVerifiersStep.php
+++ /dev/null
@@ -1,32 +0,0 @@
-Petition->getTable('CoreEnroller.PetitionVerifications');
-
-// Because Petition Verifications are not tracked on a per-step basis, we just pull all
-// associated with the Petition
-
-$vv_pv = $PetitionVerifications->find()
- ->where(['PetitionVerifications.petition_id' => $vv_obj->id])
- ->contain(['Verifications'])
- ->all();
-
-?>
-
-
-
-
- - = $pv->mail ?>:
- verification) && $pv->verification->isVerified()): ?>
- = __d('result', 'Verifications.status', [
- VerificationMethodEnum::getLocalization($pv->verification->method),
- $this->Time->nice($pv->verification->verification_time, $vv_tz)
- ]) ?>
-
- = __d('field','unverified') ?>
-
-
-
-
-
\ No newline at end of file
diff --git a/app/plugins/CoreEnroller/templates/element/petition/identifierCollectorsStep.php b/app/plugins/CoreEnroller/templates/element/petition/identifierCollectorsStep.php
deleted file mode 100644
index f486c6e19..000000000
--- a/app/plugins/CoreEnroller/templates/element/petition/identifierCollectorsStep.php
+++ /dev/null
@@ -1,8 +0,0 @@
-Petition->getTable('CoreEnroller.PetitionIdentifiers');
-
-$vv_pi = $PetitionIdentifiers->find()->where(['petition_id' => $vv_obj->id])->first();
-
-if(!empty($vv_pi->identifier)) {
- print __d('core_enroller', 'result.IdentifierCollector.collected', [$vv_pi->identifier]);
-}
\ No newline at end of file
diff --git a/app/plugins/CoreEnroller/templates/element/petition/invitationAcceptersStep.php b/app/plugins/CoreEnroller/templates/element/petition/invitationAcceptersStep.php
deleted file mode 100644
index b3ba8f668..000000000
--- a/app/plugins/CoreEnroller/templates/element/petition/invitationAcceptersStep.php
+++ /dev/null
@@ -1,23 +0,0 @@
-Petition->getTable('CoreEnroller.PetitionAcceptances');
-
-$vv_pa = $PetitionAcceptances->find()->where(['petition_id' => $vv_obj->id])->first();
-
-?>
-
-
-
diff --git a/app/plugins/CoreEnroller/tests/TestCase/View/Cell/AttributeCollectorsCellTest.php b/app/plugins/CoreEnroller/tests/TestCase/View/Cell/AttributeCollectorsCellTest.php
new file mode 100644
index 000000000..1bddbdcef
--- /dev/null
+++ b/app/plugins/CoreEnroller/tests/TestCase/View/Cell/AttributeCollectorsCellTest.php
@@ -0,0 +1,70 @@
+request = $this->getMockBuilder('Cake\Http\ServerRequest')->getMock();
+ $this->response = $this->getMockBuilder('Cake\Http\Response')->getMock();
+ $this->AttributeCollectors = new AttributeCollectorsCell($this->request, $this->response);
+ }
+
+ /**
+ * tearDown method
+ *
+ * @return void
+ */
+ protected function tearDown(): void
+ {
+ unset($this->AttributeCollectors);
+
+ parent::tearDown();
+ }
+
+ /**
+ * Test display method
+ *
+ * @return void
+ * @uses \CoreEnroller\View\Cell\AttributeCollectorsCell::display()
+ */
+ public function testDisplay(): void
+ {
+ $this->markTestIncomplete('Not implemented yet.');
+ }
+}
diff --git a/app/plugins/CoreEnroller/tests/TestCase/View/Cell/BasicAttributeCollectorsCellTest.php b/app/plugins/CoreEnroller/tests/TestCase/View/Cell/BasicAttributeCollectorsCellTest.php
new file mode 100644
index 000000000..2351dd505
--- /dev/null
+++ b/app/plugins/CoreEnroller/tests/TestCase/View/Cell/BasicAttributeCollectorsCellTest.php
@@ -0,0 +1,70 @@
+request = $this->getMockBuilder('Cake\Http\ServerRequest')->getMock();
+ $this->response = $this->getMockBuilder('Cake\Http\Response')->getMock();
+ $this->BasicAttributeCollectors = new BasicAttributeCollectorsCell($this->request, $this->response);
+ }
+
+ /**
+ * tearDown method
+ *
+ * @return void
+ */
+ protected function tearDown(): void
+ {
+ unset($this->BasicAttributeCollectors);
+
+ parent::tearDown();
+ }
+
+ /**
+ * Test display method
+ *
+ * @return void
+ * @uses \CoreEnroller\View\Cell\BasicAttributeCollectorsCell::display()
+ */
+ public function testDisplay(): void
+ {
+ $this->markTestIncomplete('Not implemented yet.');
+ }
+}
diff --git a/app/plugins/CoreEnroller/tests/TestCase/View/Cell/EmailVerifiersCellTest.php b/app/plugins/CoreEnroller/tests/TestCase/View/Cell/EmailVerifiersCellTest.php
new file mode 100644
index 000000000..660522a72
--- /dev/null
+++ b/app/plugins/CoreEnroller/tests/TestCase/View/Cell/EmailVerifiersCellTest.php
@@ -0,0 +1,70 @@
+request = $this->getMockBuilder('Cake\Http\ServerRequest')->getMock();
+ $this->response = $this->getMockBuilder('Cake\Http\Response')->getMock();
+ $this->EmailVerifiers = new EmailVerifiersCell($this->request, $this->response);
+ }
+
+ /**
+ * tearDown method
+ *
+ * @return void
+ */
+ protected function tearDown(): void
+ {
+ unset($this->EmailVerifiers);
+
+ parent::tearDown();
+ }
+
+ /**
+ * Test display method
+ *
+ * @return void
+ * @uses \CoreEnroller\View\Cell\EmailVerifiersCell::display()
+ */
+ public function testDisplay(): void
+ {
+ $this->markTestIncomplete('Not implemented yet.');
+ }
+}
diff --git a/app/plugins/CoreEnroller/tests/TestCase/View/Cell/IdentifierCollectorsCellTest.php b/app/plugins/CoreEnroller/tests/TestCase/View/Cell/IdentifierCollectorsCellTest.php
new file mode 100644
index 000000000..5066e1ec0
--- /dev/null
+++ b/app/plugins/CoreEnroller/tests/TestCase/View/Cell/IdentifierCollectorsCellTest.php
@@ -0,0 +1,70 @@
+request = $this->getMockBuilder('Cake\Http\ServerRequest')->getMock();
+ $this->response = $this->getMockBuilder('Cake\Http\Response')->getMock();
+ $this->IdentifierCollectors = new IdentifierCollectorsCell($this->request, $this->response);
+ }
+
+ /**
+ * tearDown method
+ *
+ * @return void
+ */
+ protected function tearDown(): void
+ {
+ unset($this->IdentifierCollectors);
+
+ parent::tearDown();
+ }
+
+ /**
+ * Test display method
+ *
+ * @return void
+ * @uses \CoreEnroller\View\Cell\IdentifierCollectorsCell::display()
+ */
+ public function testDisplay(): void
+ {
+ $this->markTestIncomplete('Not implemented yet.');
+ }
+}
diff --git a/app/plugins/CoreEnroller/tests/TestCase/View/Cell/InvitationAcceptersCellTest.php b/app/plugins/CoreEnroller/tests/TestCase/View/Cell/InvitationAcceptersCellTest.php
new file mode 100644
index 000000000..96f34bcd8
--- /dev/null
+++ b/app/plugins/CoreEnroller/tests/TestCase/View/Cell/InvitationAcceptersCellTest.php
@@ -0,0 +1,70 @@
+request = $this->getMockBuilder('Cake\Http\ServerRequest')->getMock();
+ $this->response = $this->getMockBuilder('Cake\Http\Response')->getMock();
+ $this->InvitationAccepters = new InvitationAcceptersCell($this->request, $this->response);
+ }
+
+ /**
+ * tearDown method
+ *
+ * @return void
+ */
+ protected function tearDown(): void
+ {
+ unset($this->InvitationAccepters);
+
+ parent::tearDown();
+ }
+
+ /**
+ * Test display method
+ *
+ * @return void
+ * @uses \CoreEnroller\View\Cell\InvitationAcceptersCell::display()
+ */
+ public function testDisplay(): void
+ {
+ $this->markTestIncomplete('Not implemented yet.');
+ }
+}
diff --git a/app/src/Model/Table/PersonRolesTable.php b/app/src/Model/Table/PersonRolesTable.php
index dc0ee791f..335ea96ba 100644
--- a/app/src/Model/Table/PersonRolesTable.php
+++ b/app/src/Model/Table/PersonRolesTable.php
@@ -296,12 +296,12 @@ public function beforeMarshal(EventInterface $event, \ArrayObject $data, \ArrayO
$re = '/^.*\(ID: (\d+)\)$/m';
// The data coming from the API is an int while the data coming from the UI is a string. The
// latter is produced by the people picker
- if(!empty($data['sponsor_person_id']) && !ctype_digit($data['sponsor_person_id'])) {
+ if(!empty($data['sponsor_person_id']) && !is_int($data['sponsor_person_id']) && !ctype_digit($data['sponsor_person_id'])) {
preg_match_all($re, $data['sponsor_person_id'], $matchesSponsor, PREG_SET_ORDER, 0);
$data['sponsor_person_id'] = $matchesSponsor[0][1];
}
- if(!empty($data['manager_person_id']) && !ctype_digit($data['manager_person_id'])) {
+ if(!empty($data['manager_person_id']) && !is_int($data['manager_person_id']) && !ctype_digit($data['manager_person_id'])) {
preg_match_all($re, $data['manager_person_id'], $matchesManager, PREG_SET_ORDER, 0);
$data['manager_person_id'] = $matchesManager[0][1];
}
diff --git a/app/templates/Petitions/fields.inc b/app/templates/Petitions/fields.inc
index 78d64075f..664cb444f 100644
--- a/app/templates/Petitions/fields.inc
+++ b/app/templates/Petitions/fields.inc
@@ -283,12 +283,7 @@ if (!empty($vv_obj?->petitioner_person?->id)) {
= $step->plugin ?>
- plugin);
- $elementName = lcfirst($pluginClass) . 'Step';
-
- print $this->element("$pluginName.petition/$elementName", ['vv_step' => $step]);
- ?>
+ = $this->cell($step->plugin, [$vv_obj->id], ['vv_obj' => $vv_obj, 'vv_step' => $step, 'viewVars' => $this->viewVars]) ?>