This commit is contained in:
@@ -289,7 +289,7 @@ class ClassProgressController extends BaseController
|
||||
}
|
||||
|
||||
$row['status_label'] = self::STATUS_OPTIONS[$row['status']] ?? 'Unknown';
|
||||
$weeklyReports = $this->reportModel
|
||||
$weeklyReportsQuery = $this->reportModel
|
||||
->select('class_progress_reports.*, cs.class_section_name, CONCAT(IFNULL(u.firstname, ""), " ", IFNULL(u.lastname, "")) AS teacher_name')
|
||||
->join('classSection cs', 'cs.class_section_id = class_progress_reports.class_section_id', 'left')
|
||||
->join('users u', 'u.id = class_progress_reports.teacher_id', 'left')
|
||||
@@ -346,7 +346,7 @@ class ClassProgressController extends BaseController
|
||||
throw new PageNotFoundException('Progress report not found.');
|
||||
}
|
||||
|
||||
$weeklyReports = $this->reportModel
|
||||
$weeklyReportsQuery = $this->reportModel
|
||||
->select('class_progress_reports.*')
|
||||
->whereIn('teacher_id', $allowedTeacherIds)
|
||||
->where('class_section_id', $row['class_section_id'])
|
||||
@@ -513,7 +513,7 @@ class ClassProgressController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
$weeklyReports = $this->reportModel
|
||||
$weeklyReportsQuery = $this->reportModel
|
||||
->select('class_progress_reports.*')
|
||||
->whereIn('teacher_id', $allowedTeacherIds)
|
||||
->where('class_section_id', $classSectionId)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Controllers\View;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Exceptions\SchoolYear\SchoolYearWriteConflictException;
|
||||
use App\Models\ClassSectionModel;
|
||||
use App\Models\InventoryItemModel;
|
||||
use App\Models\InventoryCategoryModel;
|
||||
@@ -713,6 +714,8 @@ class InventoryController extends BaseController
|
||||
*/
|
||||
public function teacherDistributeForm()
|
||||
{
|
||||
$schoolYearContext = $this->resolveSchoolYearContext();
|
||||
|
||||
// 1) Build teacher/class context (auth/role/no-class handled inside)
|
||||
$ctx = $this->buildTeacherClassContext();
|
||||
if ($ctx instanceof \CodeIgniter\HTTP\RedirectResponse) {
|
||||
@@ -858,11 +861,19 @@ class InventoryController extends BaseController
|
||||
|
||||
'schoolYear' => $ctx['schoolYear'],
|
||||
'semester' => $ctx['semester'],
|
||||
'isEditable' => ! $schoolYearContext->isReadonly(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function teacherDistributeStore()
|
||||
{
|
||||
$schoolYearContext = $this->resolveSchoolYearContext();
|
||||
try {
|
||||
$this->assertSchoolYearWritable($schoolYearContext);
|
||||
} catch (SchoolYearWriteConflictException $e) {
|
||||
return redirect()->back()->withInput()->with('error', $e->getMessage());
|
||||
}
|
||||
|
||||
$ctx = $this->buildTeacherClassContext();
|
||||
if ($ctx instanceof \CodeIgniter\HTTP\RedirectResponse) {
|
||||
return $ctx;
|
||||
|
||||
Reference in New Issue
Block a user