Unterstützung: Ersteller trägt helfende Personen im Arbeitsblatt ein

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-09-30 14:57:46 +00:00
1 parent 3535f18a2b
commit d83bbfb48d
5 files changed
+139 -4

No files matched your search

+22 -2
View File
@@ -5,6 +5,8 @@ import { SERVICE_TYPES, todayIso, isoToGermanDate, timeToWoms, minutesBetween }
import { TICKET_STATUSES, statusLabel } from '../lib/ticketStatus'
import { DateTimeInput, DurationSelect } from './ui'
import { roundUpToStep, isValidStep } from '../lib/timeSteps'
import { validateSupporters } from '../lib/support'
import SupportersEditor from './SupportersEditor'
// Akquise-Tickets: Ergebnis des Kundenkontakts (statt technischer Status)
const ACQUISITION_STATUS = ['In Kontakt', 'Zugesagt', 'Abgesagt']
@@ -29,7 +31,8 @@ const initialForm = (workorder, newStatus) => ({
endTime: '',
details: '',
isComment: false,
countsToPlan: false
countsToPlan: false,
supporters: []
})
export default function CreateWorksheetModal({ isOpen, onClose, workorder, onCreate, aboHoursAllowed = true }) {
@@ -101,6 +104,13 @@ export default function CreateWorksheetModal({ isOpen, onClose, workorder, onCre
setLoading(false)
return
}
const supporters = formData.isComment ? [] : formData.supporters
const supportError = validateSupporters(supporters, user?.$id)
if (supportError) {
setError(supportError)
setLoading(false)
return
}
const worksheetData = {
woid: workorder.woid,
@@ -116,7 +126,8 @@ export default function CreateWorksheetModal({ isOpen, onClose, workorder, onCre
details: formData.details,
isComment: formData.isComment,
countsToPlan: aboHoursAllowed && !formData.isComment && formData.countsToPlan,
employeeShort: user?.prefs?.shortCode || '' // Aus User-Preferences
employeeShort: user?.prefs?.shortCode || '', // Aus User-Preferences
supporters
}
const result = await onCreate(worksheetData, user)
@@ -257,6 +268,15 @@ export default function CreateWorksheetModal({ isOpen, onClose, workorder, onCre
</div>
</div>
{!formData.isComment && (
<SupportersEditor
value={formData.supporters}
onChange={(list) => handleChange('supporters', list)}
excludeUserId={user?.$id}
minutes={formData.totalTime}
/>
)}
<div className="form-group">
<label className="form-label">Was wurde gemacht?</label>
<textarea