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:
@@ -632,9 +632,9 @@ public function storeDocument(ClientCase $clientCase, Request $request)
|
||||
$contract = null;
|
||||
if (! empty($validated['contract_uuid'])) {
|
||||
$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'));
|
||||
}
|
||||
}*/
|
||||
}
|
||||
$directory = $contract
|
||||
? ('contracts/'.$contract->uuid.'/documents')
|
||||
|
||||
@@ -54,7 +54,7 @@ const form = useInertiaForm({
|
||||
props.actions[0].decisions.length > 0
|
||||
? props.actions[0].decisions[0].id
|
||||
: null,
|
||||
contract_uuids: props.contractUuid ? [props.contractUuid] : [],
|
||||
contract_uuids: props.contractUuid ? [props.contractUuid] : (props.contracts || []).map((c) => c.uuid),
|
||||
send_auto_mail: true,
|
||||
attach_documents: false,
|
||||
attachment_document_ids: [],
|
||||
@@ -98,7 +98,7 @@ watch(
|
||||
watch(
|
||||
() => props.contractUuid,
|
||||
(cu) => {
|
||||
form.contract_uuids = cu ? [cu] : [];
|
||||
form.contract_uuids = cu ? [cu] : (props.contracts || []).map((c) => c.uuid);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -106,7 +106,7 @@ watch(
|
||||
() => props.show,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
form.contract_uuids = props.contractUuid ? [props.contractUuid] : [];
|
||||
form.contract_uuids = props.contractUuid ? [props.contractUuid] : (props.contracts || []).map((c) => c.uuid);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -529,14 +529,14 @@ const clientSummary = computed(() => {
|
||||
<!-- Action buttons: full-width row at bottom -->
|
||||
<div class="grid grid-cols-2 gap-0 border-t mt-0">
|
||||
<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)"
|
||||
>
|
||||
<Plus class="w-4 h-4" />
|
||||
Aktivnost
|
||||
</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)"
|
||||
>
|
||||
<Upload class="w-4 h-4" />
|
||||
@@ -561,9 +561,9 @@ const clientSummary = computed(() => {
|
||||
<Activity class="w-5 h-5" />
|
||||
Aktivnosti
|
||||
</CardTitle>
|
||||
<Button size="sm" @click="openDrawerAddActivity()">
|
||||
<Plus class="w-4 h-4" />
|
||||
Nova
|
||||
<Button size="lg" @click="openDrawerAddActivity()">
|
||||
<Plus class="w-6 h-6" />
|
||||
<span class=" text-lg">Dodaj aktivnost</span>
|
||||
</Button>
|
||||
</div>
|
||||
</CardHeader>
|
||||
|
||||
Reference in New Issue
Block a user