|
|
@@ -34,10 +34,10 @@ function render_jobs_table(string $audience, ?int $vendor_id = null): string {
|
|
|
FROM jobs j
|
|
|
JOIN vendors v ON v.id = j.vendor_id
|
|
|
WHERE $where
|
|
|
- ORDER BY (j.status = '') DESC,
|
|
|
+ ORDER BY (j.ack != '') DESC,
|
|
|
+ (j.status = '') DESC,
|
|
|
(j.status = 'Finished') DESC,
|
|
|
(j.status = 'Shipped') DESC,
|
|
|
- (j.ack = 'new') DESC,
|
|
|
j.due_date IS NULL,
|
|
|
j.due_date ASC,
|
|
|
j.job
|
|
|
@@ -71,7 +71,10 @@ function render_jobs_table(string $audience, ?int $vendor_id = null): string {
|
|
|
$editable = ($audience === 'ICG');
|
|
|
$jobClass = strlen($r['job']) > 9 ? 'smaller' : '';
|
|
|
$statusClass = $r['status'] !== '' ? 'status-' . strtolower($r['status']) : '';
|
|
|
- $ackClass = $r['ack'] === 'new' ? 'ack-new' : '';
|
|
|
+ $ackClass = '';
|
|
|
+ $ackLabel = '';
|
|
|
+ if ($r['ack'] === 'new') { $ackClass = 'ack-new'; $ackLabel = 'NEW'; }
|
|
|
+ elseif ($r['ack'] === 'changed') { $ackClass = 'ack-changed'; $ackLabel = 'CHANGED'; }
|
|
|
?>
|
|
|
<tr data-job-id="<?= (int) $r['id'] ?>" class="<?= h($statusClass) ?>">
|
|
|
<td class="<?= h($jobClass) ?>"><?= render_field($r, 'job', $editable) ?></td>
|
|
|
@@ -80,7 +83,7 @@ function render_jobs_table(string $audience, ?int $vendor_id = null): string {
|
|
|
<td class="right"><?= render_field($r, 'qty', $editable) ?></td>
|
|
|
<td class="center"><?= render_due($r, $editable) ?></td>
|
|
|
<?php if ($audience === 'ICG'): ?><td><?= h($r['vendor_name']) ?></td><?php endif; ?>
|
|
|
- <td class="center <?= h($ackClass) ?>"><?= $r['ack'] === 'new' ? 'NEW' : '' ?></td>
|
|
|
+ <td class="center <?= h($ackClass) ?>"><?= h($ackLabel) ?></td>
|
|
|
<td class="center"><?= render_status($r, $audience) ?></td>
|
|
|
<td class="center actions"><?= render_actions($r, $audience) ?></td>
|
|
|
</tr>
|
|
|
@@ -138,7 +141,7 @@ function format_short_date(?string $ts): string {
|
|
|
function render_actions(array $r, string $audience): string {
|
|
|
$btns = [];
|
|
|
if ($audience === 'vendor') {
|
|
|
- if ($r['ack'] === 'new') {
|
|
|
+ if ($r['ack'] === 'new' || $r['ack'] === 'changed') {
|
|
|
$btns[] = '<button class="btn btn-ack" data-action="acknowledge">Acknowledge</button>';
|
|
|
}
|
|
|
if ($r['status'] === '') {
|