' . PHP_EOL
. '
' . PHP_EOL
@@ -227,7 +287,7 @@ protected function formInfoWithPrefixDiv(string $context, string $prefix) {
* @return string Form Name HTML
*/
- protected function formNameDiv(string $fieldName, string $labelText=null) {
+ protected function formNameDiv(string $fieldName, string $labelText=null): string {
$label = $labelText;
$desc = null;
@@ -310,7 +370,10 @@ protected function formNameDiv(string $fieldName, string $labelText=null) {
* @return string
*/
- public function statusControl(string $fieldName, string $status, array $link=[], string $labelText=null): string {
+ public function statusControl(string $fieldName,
+ string $status,
+ array $link=[],
+ string $labelText=null): string {
$linkHtml = $status;
if($link) {
@@ -354,7 +417,11 @@ public function statusControl(string $fieldName, string $status, array $link=[],
* @return string
*/
- public function startControlSet(string $modelName, string $action, bool $editable, array $reqFields, $entity=null) {
+ public function startControlSet(string $modelName,
+ string $action,
+ bool $editable,
+ array $reqFields,
+ $entity=null): string {
$this->editable = $editable;
$this->modelName = $modelName;
$this->reqFields = $reqFields;
@@ -371,7 +438,7 @@ public function startControlSet(string $modelName, string $action, bool $editabl
* @return string
*/
- protected function startLine(string $class=null) {
+ protected function startLine(string $class=null): string {
$ret = '
* ' . __d('field', 'required') . '
diff --git a/app/templates/ApiUsers/fields.inc b/app/templates/ApiUsers/fields.inc
index e4eb9bc02..80c0c0e00 100644
--- a/app/templates/ApiUsers/fields.inc
+++ b/app/templates/ApiUsers/fields.inc
@@ -56,9 +56,9 @@ if($vv_action == 'add' || $vv_action == 'edit') {
print $this->Field->control('status', ['empty' => false]);
- print $this->Field->control('valid_from');
+ print $this->Field->dateControl('valid_from');
- print $this->Field->control('valid_through');
+ print $this->Field->dateControl('valid_through');
print $this->Field->control('remote_ip');
diff --git a/app/templates/ExternalIdentities/fields.inc b/app/templates/ExternalIdentities/fields.inc
index 961774364..04fa8c917 100644
--- a/app/templates/ExternalIdentities/fields.inc
+++ b/app/templates/ExternalIdentities/fields.inc
@@ -30,7 +30,7 @@ if($vv_action == 'add' || $vv_action == 'edit') {
// XXX sync status?
print $this->Field->control('status', ['empty' => false]);
- print $this->Field->control('date_of_birth');
+ print $this->Field->dateControl('date_of_birth', \App\Lib\Enum\DateTypeEnum::DateOnly);
}
// XXX This is a placeholder for canvas... maybe it should become a separate page
diff --git a/app/templates/ExternalIdentityRoles/fields.inc b/app/templates/ExternalIdentityRoles/fields.inc
index 1bd58b465..15e98947a 100644
--- a/app/templates/ExternalIdentityRoles/fields.inc
+++ b/app/templates/ExternalIdentityRoles/fields.inc
@@ -44,13 +44,9 @@ if($vv_action == 'add' || $vv_action == 'edit') {
print $this->Field->control('manager_identifier', [], __d('field', 'manager'));
-// XXX these need to render date pickers
-// - we specifically have code in FieldHelper that checks for these two, but not date_of_birth
-// - can FieldHelper introspect the date type rather than require a hard coded list of fields?
-// though note valid_from/through uses special logic for 00:00:00 and 23:59:59
- print $this->Field->control('valid_from');
+ print $this->Field->dateControl('valid_from');
- print $this->Field->control('valid_through');
+ print $this->Field->dateControl('valid_through');
}
// XXX This is a placeholder for canvas... maybe it should become a separate page
diff --git a/app/templates/GroupMembers/fields.inc b/app/templates/GroupMembers/fields.inc
index 559a946a2..6a9f07665 100644
--- a/app/templates/GroupMembers/fields.inc
+++ b/app/templates/GroupMembers/fields.inc
@@ -32,9 +32,8 @@ if($vv_action == 'add') {
print $this->Form->hidden('person_id');
}
-// XXX valid from should default to 00:00:00 time, valid through to 23:59:59
-print $this->Field->control('valid_from');
+print $this->Field->dateControl('valid_from');
-print $this->Field->control('valid_through');
+print $this->Field->dateControl('valid_through');
// XXX RFE: Add links to EIS or Nesting info
\ No newline at end of file
diff --git a/app/templates/People/fields.inc b/app/templates/People/fields.inc
index ccb3e0a11..3b81e76f6 100644
--- a/app/templates/People/fields.inc
+++ b/app/templates/People/fields.inc
@@ -165,5 +165,5 @@ if($vv_action == 'add') {
if($vv_action == 'add' || $vv_action == 'edit') {
print $this->Field->control('status', ['empty' => false]);
- print $this->Field->control('date_of_birth');
+ print $this->Field->dateControl('date_of_birth', \App\Lib\Enum\DateTypeEnum::DateOnly);
}
\ No newline at end of file
diff --git a/app/templates/PersonRoles/fields.inc b/app/templates/PersonRoles/fields.inc
index b163efe3c..af8ad74bc 100644
--- a/app/templates/PersonRoles/fields.inc
+++ b/app/templates/PersonRoles/fields.inc
@@ -57,13 +57,9 @@ if($vv_action == 'add' || $vv_action == 'edit') {
print $this->Field->statusControl($f.'_person_id', $fname, $flink, __d('field', $f));
}
-// XXX these need to render date pickers
-// - we specifically have code in FieldHelper that checks for these two, but not date_of_birth
-// - can FieldHelper introspect the date type rather than require a hard coded list of fields?
-// though note valid_from/through uses special logic for 00:00:00 and 23:59:59
- print $this->Field->control('valid_from');
+ print $this->Field->dateControl('valid_from');
- print $this->Field->control('valid_through');
+ print $this->Field->dateControl('valid_through');
}
// XXX This is a placeholder for canvas... maybe it should become a separate page
diff --git a/app/templates/element/datePicker.php b/app/templates/element/datePicker.php
index 077242672..e04bc9b0e 100644
--- a/app/templates/element/datePicker.php
+++ b/app/templates/element/datePicker.php
@@ -1,7 +1,9 @@