This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
<?= $this->extend('layout/main_layout') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<?php $isSchoolYearReadonly = (bool) ($isSchoolYearReadonly ?? false); ?>
|
||||
|
||||
<div class="container-fluid py-5">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2>Print/Copy Requests</h2>
|
||||
<?php if ($isSchoolYearReadonly): ?>
|
||||
<div class="alert alert-warning">
|
||||
This school year is read-only. Existing requests are visible, but changes are disabled.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Print/Copy Request Tabs -->
|
||||
<div class="card my-4">
|
||||
@@ -109,7 +115,7 @@
|
||||
You are not assigned to any class. Please contact the administrator to be able to submit print requests.
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<button type="submit" class="btn btn-primary mt-3" <?= (!isset($class_id) || !$class_id) ? 'disabled' : '' ?>>Submit Request</button>
|
||||
<button type="submit" class="btn btn-primary mt-3" <?= (!isset($class_id) || !$class_id || $isSchoolYearReadonly) ? 'disabled' : '' ?>>Submit Request</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -164,7 +170,7 @@
|
||||
<div class="form-text mt-2">
|
||||
No file upload is required; please hand the original document to the copy staff after submitting.
|
||||
</div>
|
||||
<button type="submit" class="btn btn-outline-primary mt-3">Submit Copy Request</button>
|
||||
<button type="submit" class="btn btn-outline-primary mt-3" <?= $isSchoolYearReadonly ? 'disabled' : '' ?>>Submit Copy Request</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -241,10 +247,10 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="d-flex flex-wrap gap-1">
|
||||
<?php if (in_array($request['status'], ['not_assigned', 'assigned'])): ?>
|
||||
<?php if (!$isSchoolYearReadonly && in_array($request['status'], ['not_assigned', 'assigned'])): ?>
|
||||
<button type="button" class="btn btn-sm btn-warning mb-1" onclick='editRequest(<?= json_encode($request, JSON_HEX_APOS | JSON_HEX_QUOT) ?>)'>Edit</button>
|
||||
<?php endif; ?>
|
||||
<?php if ($request['status'] === 'not_assigned'): ?>
|
||||
<?php if (!$isSchoolYearReadonly && $request['status'] === 'not_assigned'): ?>
|
||||
<button type="button" class="btn btn-sm btn-danger mb-1" onclick="deleteRequest(<?= $request['id'] ?>)">Delete</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -328,7 +334,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
<button type="submit" class="btn btn-primary">Save changes</button>
|
||||
<button type="submit" class="btn btn-primary" <?= $isSchoolYearReadonly ? 'disabled' : '' ?>>Save changes</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user