Adding activity dialog now auto selects all available contracts use has option to remove them, adding documents on archived contracts is not limited anymore.

This commit is contained in:
2026-05-10 16:30:45 +02:00
parent fd81e8ce2d
commit b6bfa17980
3 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -632,9 +632,9 @@ public function storeDocument(ClientCase $clientCase, Request $request)
$contract = null; $contract = null;
if (! empty($validated['contract_uuid'])) { if (! empty($validated['contract_uuid'])) {
$contract = $clientCase->contracts()->where('uuid', $validated['contract_uuid'])->first(); $contract = $clientCase->contracts()->where('uuid', $validated['contract_uuid'])->first();
if ($contract && ! $contract->active) { /*if ($contract && ! $contract->active) {
return back()->with('warning', __('contracts.document_not_allowed_archived')); return back()->with('warning', __('contracts.document_not_allowed_archived'));
} }*/
} }
$directory = $contract $directory = $contract
? ('contracts/'.$contract->uuid.'/documents') ? ('contracts/'.$contract->uuid.'/documents')
@@ -54,7 +54,7 @@ const form = useInertiaForm({
props.actions[0].decisions.length > 0 props.actions[0].decisions.length > 0
? props.actions[0].decisions[0].id ? props.actions[0].decisions[0].id
: null, : null,
contract_uuids: props.contractUuid ? [props.contractUuid] : [], contract_uuids: props.contractUuid ? [props.contractUuid] : (props.contracts || []).map((c) => c.uuid),
send_auto_mail: true, send_auto_mail: true,
attach_documents: false, attach_documents: false,
attachment_document_ids: [], attachment_document_ids: [],
@@ -98,7 +98,7 @@ watch(
watch( watch(
() => props.contractUuid, () => props.contractUuid,
(cu) => { (cu) => {
form.contract_uuids = cu ? [cu] : []; form.contract_uuids = cu ? [cu] : (props.contracts || []).map((c) => c.uuid);
} }
); );
@@ -106,7 +106,7 @@ watch(
() => props.show, () => props.show,
(visible) => { (visible) => {
if (visible) { if (visible) {
form.contract_uuids = props.contractUuid ? [props.contractUuid] : []; form.contract_uuids = props.contractUuid ? [props.contractUuid] : (props.contracts || []).map((c) => c.uuid);
} }
} }
); );
+5 -5
View File
@@ -529,14 +529,14 @@ const clientSummary = computed(() => {
<!-- Action buttons: full-width row at bottom --> <!-- Action buttons: full-width row at bottom -->
<div class="grid grid-cols-2 gap-0 border-t mt-0"> <div class="grid grid-cols-2 gap-0 border-t mt-0">
<button <button
class="flex items-center justify-center gap-2 py-3 text-sm font-medium text-primary hover:bg-primary/5 active:bg-primary/10 transition-colors border-r" class="flex items-center justify-center gap-2 py-3 bg-secondary text-sm font-medium text-accent-foreground hover:bg-secondary/5 active:bg-secondary/10 transition-colors border-r"
@click="openDrawerAddActivity(c)" @click="openDrawerAddActivity(c)"
> >
<Plus class="w-4 h-4" /> <Plus class="w-4 h-4" />
Aktivnost Aktivnost
</button> </button>
<button <button
class="flex items-center justify-center gap-2 py-3 text-sm font-medium text-gray-600 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800 active:bg-gray-100 transition-colors" class="flex items-center justify-center gap-2 py-3 bg-secondary text-sm font-medium text-accent-foreground hover:bg-secondary/5 active:bg-secondary/10 transition-colors"
@click="openDocDialog(c)" @click="openDocDialog(c)"
> >
<Upload class="w-4 h-4" /> <Upload class="w-4 h-4" />
@@ -561,9 +561,9 @@ const clientSummary = computed(() => {
<Activity class="w-5 h-5" /> <Activity class="w-5 h-5" />
Aktivnosti Aktivnosti
</CardTitle> </CardTitle>
<Button size="sm" @click="openDrawerAddActivity()"> <Button size="lg" @click="openDrawerAddActivity()">
<Plus class="w-4 h-4" /> <Plus class="w-6 h-6" />
Nova <span class=" text-lg">Dodaj aktivnost</span>
</Button> </Button>
</div> </div>
</CardHeader> </CardHeader>