fix is_new issue with enrollment fixes
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 48s
Tests / PHPUnit (push) Failing after 1m22s

This commit is contained in:
root
2026-08-20 19:57:25 -04:00
parent 127098b87c
commit 889c037660
29 changed files with 77306 additions and 293 deletions
+5 -8
View File
@@ -58,7 +58,7 @@ public function buildRoster(string $selectedYear, string $semester): array
$students = $this->studentModel->getStudentsWithClassAndEnrollment($selectedYear);
$removedPriorStatuses = $this->removedPriorYearStudentStatuses($selectedYear);
$returningStudentIds = $this->priorYearStudentIds($selectedYear);
service('studentYearStatus')->attachToStudents($students, $selectedYear);
foreach ($students as &$s) {
// ===== Ensure IDs needed by the modal =====
@@ -93,11 +93,8 @@ public function buildRoster(string $selectedYear, string $semester): array
$s['parent_sort'] = 'ZZZ Unknown Parent';
}
// ===== New-student flags =====
$s['is_new'] = (int) ($s['is_new'] ?? 0);
if (isset($returningStudentIds[$s['student_id']])) {
$s['is_new'] = 0;
}
// ===== New-student flags (year-scoped) =====
$s['is_new'] = (int) ($s['is_new'] ?? 1) === 1 ? 1 : 0;
$s['new_student'] = $s['is_new'] === 1 ? 'Yes' : 'No';
// ===== Admission override =====
@@ -158,7 +155,7 @@ public function buildRoster(string $selectedYear, string $semester): array
*/
public function newStudents(string $schoolYear): array
{
$rows = $this->studentModel->getStudentsWithParentsAndEmergency($schoolYear);
$rows = $this->studentModel->getStudentsWithParentsAndEmergency($schoolYear, 1);
$newStudents = [];
foreach ($rows as $r) {
@@ -170,7 +167,7 @@ public function newStudents(string $schoolYear): array
? $classSection
: 'Class not Assigned';
$r['is_new'] = (int) $r['is_new'];
$r['is_new'] = (int) ($r['is_new'] ?? 1) === 1 ? 1 : 0;
$r['new_student'] = $r['is_new'] === 1 ? "Yes" : "No";
$r['modalIdContact'] = 'contact_' . (int)($r['id'] ?? 0);
$r['enrollment_status'] = $enrollmentstatus;