Skip to content

Commit

Permalink
Attendance: removed non-Full teachers from Form Groups Not Registered…
Browse files Browse the repository at this point in the history
… reports
  • Loading branch information
Ross Parker committed Mar 6, 2025
1 parent 301734c commit 460701b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ v29.0.00
Activities: fixed activity missing from the timetable if it doesn't have a category
Activities: fixed missing registration button for parents on View Activities page
Attendance: fixed unable to add new partial future absence if a future future absence exists
Attendance: removed non-Full teachers from Form Groups Not Registered reports
Markbook: fixed attainment percentage values now updating from raw attainment values
Messenger: fixed required members field when editing a Messenger Group
Planner: fixed empty sections displaying below the advanced options in Add Unit Plan
Expand Down
17 changes: 8 additions & 9 deletions modules/Attendance/report_formGroupsNotRegistered_byDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,10 @@
$specialDayGateway = $container->get(SchoolYearSpecialDayGateway::class);

//Produce array of attendance data

$data = array('dateStart' => $lastNSchoolDays[count($lastNSchoolDays)-1], 'dateEnd' => $lastNSchoolDays[0] );
$sql = 'SELECT date, nameShort, gibbonAttendanceLogFormGroup.gibbonFormGroupID, UNIX_TIMESTAMP(timestampTaken) as timestamp, timestampTaken, gibbonPersonIDTaker FROM gibbonAttendanceLogFormGroup JOIN gibbonFormGroup ON (gibbonFormGroup.gibbonFormGroupID=gibbonAttendanceLogFormGroup.gibbonFormGroupID) WHERE date>=:dateStart AND date<=:dateEnd ORDER BY date';
$result = $connection2->prepare($sql);
$result->execute($data);
$data = array('dateStart' => $lastNSchoolDays[count($lastNSchoolDays)-1], 'dateEnd' => $lastNSchoolDays[0] );
$sql = 'SELECT date, nameShort, gibbonAttendanceLogFormGroup.gibbonFormGroupID, UNIX_TIMESTAMP(timestampTaken) as timestamp, timestampTaken, gibbonPersonIDTaker FROM gibbonAttendanceLogFormGroup JOIN gibbonFormGroup ON (gibbonFormGroup.gibbonFormGroupID=gibbonAttendanceLogFormGroup.gibbonFormGroupID) WHERE date>=:dateStart AND date<=:dateEnd ORDER BY date';
$result = $connection2->prepare($sql);
$result->execute($data);
$log = [];
$logAll = [];
while ($row = $result->fetch()) {
Expand Down Expand Up @@ -245,10 +244,10 @@
echo '<i>Not set</i>';
} else {

$dataTutor = array('gibbonPersonID1' => $row['gibbonPersonIDTutor'], 'gibbonPersonID2' => $row['gibbonPersonIDTutor2'], 'gibbonPersonID3' => $row['gibbonPersonIDTutor3']);
$sqlTutor = 'SELECT surname, preferredName FROM gibbonPerson WHERE gibbonPersonID=:gibbonPersonID1 OR gibbonPersonID=:gibbonPersonID2 OR gibbonPersonID=:gibbonPersonID3';
$resultTutor = $connection2->prepare($sqlTutor);
$resultTutor->execute($dataTutor);
$dataTutor = array('gibbonPersonID1' => $row['gibbonPersonIDTutor'], 'gibbonPersonID2' => $row['gibbonPersonIDTutor2'], 'gibbonPersonID3' => $row['gibbonPersonIDTutor3']);
$sqlTutor = "SELECT surname, preferredName FROM gibbonPerson WHERE (gibbonPersonID=:gibbonPersonID1 OR gibbonPersonID=:gibbonPersonID2 OR gibbonPersonID=:gibbonPersonID3) AND gibbonPerson.status='Full'";
$resultTutor = $connection2->prepare($sqlTutor);
$resultTutor->execute($dataTutor);

while ($rowTutor = $resultTutor->fetch()) {
echo Format::name('', $rowTutor['preferredName'], $rowTutor['surname'], 'Staff', true, true).'<br/>';
Expand Down
26 changes: 12 additions & 14 deletions modules/Attendance/report_formGroupsNotRegistered_byDate_print.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,19 @@
echo '</h2>';

//Produce array of attendance data

$data = array('dateStart' => $lastNSchoolDays[count($lastNSchoolDays)-1], 'dateEnd' => $lastNSchoolDays[0] );
$sql = 'SELECT date, gibbonFormGroupID, UNIX_TIMESTAMP(timestampTaken) FROM gibbonAttendanceLogFormGroup WHERE date>=:dateStart AND date<=:dateEnd ORDER BY date';
$result = $connection2->prepare($sql);
$result->execute($data);
$data = array('dateStart' => $lastNSchoolDays[count($lastNSchoolDays)-1], 'dateEnd' => $lastNSchoolDays[0] );
$sql = 'SELECT date, gibbonFormGroupID, UNIX_TIMESTAMP(timestampTaken) FROM gibbonAttendanceLogFormGroup WHERE date>=:dateStart AND date<=:dateEnd ORDER BY date';
$result = $connection2->prepare($sql);
$result->execute($data);
$log = array();
while ($row = $result->fetch()) {
$log[$row['gibbonFormGroupID']][$row['date']] = true;
}


$data = array('gibbonSchoolYearID' => $session->get('gibbonSchoolYearID'));
$sql = "SELECT gibbonFormGroupID, name, gibbonPersonIDTutor, gibbonPersonIDTutor2, gibbonPersonIDTutor3 FROM gibbonFormGroup WHERE gibbonSchoolYearID=:gibbonSchoolYearID AND attendance='Y' ORDER BY LENGTH(name), name";
$result = $connection2->prepare($sql);
$result->execute($data);
$data = array('gibbonSchoolYearID' => $session->get('gibbonSchoolYearID'));
$sql = "SELECT gibbonFormGroupID, name, gibbonPersonIDTutor, gibbonPersonIDTutor2, gibbonPersonIDTutor3 FROM gibbonFormGroup WHERE gibbonSchoolYearID=:gibbonSchoolYearID AND attendance='Y' ORDER BY LENGTH(name), name";
$result = $connection2->prepare($sql);
$result->execute($data);

if ( count($lastNSchoolDays) == 0 ) {
echo "<div class='error'>";
Expand Down Expand Up @@ -174,10 +172,10 @@
echo '<i>Not set</i>';
} else {

$dataTutor = array('gibbonPersonID1' => $row['gibbonPersonIDTutor'], 'gibbonPersonID2' => $row['gibbonPersonIDTutor2'], 'gibbonPersonID3' => $row['gibbonPersonIDTutor3']);
$sqlTutor = 'SELECT surname, preferredName FROM gibbonPerson WHERE gibbonPersonID=:gibbonPersonID1 OR gibbonPersonID=:gibbonPersonID2 OR gibbonPersonID=:gibbonPersonID3';
$resultTutor = $connection2->prepare($sqlTutor);
$resultTutor->execute($dataTutor);
$dataTutor = array('gibbonPersonID1' => $row['gibbonPersonIDTutor'], 'gibbonPersonID2' => $row['gibbonPersonIDTutor2'], 'gibbonPersonID3' => $row['gibbonPersonIDTutor3']);
$sqlTutor = "SELECT surname, preferredName FROM gibbonPerson WHERE (gibbonPersonID=:gibbonPersonID1 OR gibbonPersonID=:gibbonPersonID2 OR gibbonPersonID=:gibbonPersonID3) AND gibbonPerson.status='Full'";
$resultTutor = $connection2->prepare($sqlTutor);
$resultTutor->execute($dataTutor);

while ($rowTutor = $resultTutor->fetch()) {
echo Format::name('', $rowTutor['preferredName'], $rowTutor['surname'], 'Staff', true, true).'<br/>';
Expand Down

0 comments on commit 460701b

Please sign in to comment.