Neues Plugin IT-Service (OpenNIT); Abteilung bei „Geschrieben von“
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 4m42s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m27s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m41s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m32s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 6m7s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m29s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 5m33s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m30s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m35s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 4m42s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m27s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m41s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m32s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 6m7s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m29s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 5m33s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m30s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m35s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c713194a83
commit
c1117829c3
139 changed files with 2455 additions and 398 deletions
25
plugins-core/it-service/resources/js/status.js
Normal file
25
plugins-core/it-service/resources/js/status.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/** Farbe der Status-Plakette zu Tickets und Ausleihen */
|
||||
export function ticketTone(ticket) {
|
||||
const status = (ticket.status || '').toLowerCase();
|
||||
|
||||
if (!ticket.open) return 'done';
|
||||
if (['in_progress', 'in_bearbeitung', 'assigned'].includes(status)) return 'progress';
|
||||
if (['pending', 'waiting', 'wartend', 'on_hold'].includes(status)) return 'waiting';
|
||||
|
||||
return 'open';
|
||||
}
|
||||
|
||||
export function loanTone(loan) {
|
||||
return { pending: 'waiting', reserved: 'open', active: 'progress', returned: 'done' }[loan.status] ?? 'neutral';
|
||||
}
|
||||
|
||||
const dateFormat = new Intl.DateTimeFormat('de-DE', { day: '2-digit', month: '2-digit', year: 'numeric' });
|
||||
const dateTimeFormat = new Intl.DateTimeFormat('de-DE', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' });
|
||||
|
||||
/** Datumsangaben aus OpenNIT („2026-04-17 10:30“ oder ISO) lesbar machen */
|
||||
export function formatDate(value, withTime = false) {
|
||||
if (!value) return '';
|
||||
const date = new Date(String(value).replace(' ', 'T'));
|
||||
|
||||
return Number.isNaN(date.getTime()) ? String(value) : (withTime && /\d{2}:\d{2}/.test(value) ? dateTimeFormat : dateFormat).format(date);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue