Fixed some problems

This commit is contained in:
Simon Pocrnjič 2026-02-05 21:17:16 +01:00
parent 8147fedd04
commit dda118a005
3 changed files with 10 additions and 13 deletions

View File

@ -872,7 +872,7 @@ public function show(ClientCase $clientCase)
->get(['id', 'name', 'color_tag', 'segment_id']), ->get(['id', 'name', 'color_tag', 'segment_id']),
'types' => $types, 'types' => $types,
'segments' => $case->segments()->wherePivot('active', true)->get(['segments.id', 'segments.name']), 'segments' => $case->segments()->wherePivot('active', true)->get(['segments.id', 'segments.name']),
'all_segments' => \App\Models\Segment::query()->where('active', true)->get(['id', 'name']), 'all_segments' => Segment::query()->where('active', true)->get(['id', 'name']),
'current_segment' => $currentSegment, 'current_segment' => $currentSegment,
'sms_profiles' => \App\Models\SmsProfile::query() 'sms_profiles' => \App\Models\SmsProfile::query()
->select(['id', 'name', 'default_sender_id']) ->select(['id', 'name', 'default_sender_id'])
@ -1345,10 +1345,10 @@ public function sendSmsToPhone(ClientCase $clientCase, Request $request, int $ph
if (! empty($validated['sender_id'])) { if (! empty($validated['sender_id'])) {
$sender = \App\Models\SmsSender::query()->find($validated['sender_id']); $sender = \App\Models\SmsSender::query()->find($validated['sender_id']);
if (! $sender) { if (! $sender) {
return back()->with('error', 'Izbran po┼íiljatelj ne obstaja.'); return back()->with('error', 'Izbran pošiljatelj ne obstaja.');
} }
if ($profile && (int) $sender->profile_id !== (int) $profile->id) { if ($profile && (int) $sender->profile_id !== (int) $profile->id) {
return back()->with('error', 'Izbran po┼íiljatelj ne pripada izbranemu profilu.'); return back()->with('error', 'Izbran pošiljatelj ne pripada izbranemu profilu.');
} }
} }
if (! $profile) { if (! $profile) {
@ -1391,7 +1391,7 @@ public function sendSmsToPhone(ClientCase $clientCase, Request $request, int $ph
} }
// Create an activity before sending // Create an activity before sending
$activityNote = sprintf('┼át: %s | Telo: %s', (string) $phone->nu, (string) $validated['message']); $activityNote = sprintf('Št: %s | Telo: %s', (string) $phone->nu, (string) $validated['message']);
$activityData = [ $activityData = [
'note' => $activityNote, 'note' => $activityNote,
'user_id' => optional($request->user())->id, 'user_id' => optional($request->user())->id,

View File

@ -2,11 +2,7 @@
import { computed, ref, useAttrs } from "vue"; import { computed, ref, useAttrs } from "vue";
import { Button } from "@/Components/ui/button"; import { Button } from "@/Components/ui/button";
import { Calendar } from "@/Components/ui/calendar"; import { Calendar } from "@/Components/ui/calendar";
import { import { Popover, PopoverContent, PopoverTrigger } from "@/Components/ui/popover";
Popover,
PopoverContent,
PopoverTrigger,
} from "@/Components/ui/popover";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { CalendarIcon } from "lucide-vue-next"; import { CalendarIcon } from "lucide-vue-next";
import { format } from "date-fns"; import { format } from "date-fns";
@ -86,7 +82,9 @@ const toCalendarDate = (value) => {
// Convert CalendarDate to ISO string (YYYY-MM-DD) // Convert CalendarDate to ISO string (YYYY-MM-DD)
const fromCalendarDate = (calendarDate) => { const fromCalendarDate = (calendarDate) => {
if (!calendarDate) return null; if (!calendarDate) return null;
return `${String(calendarDate.year).padStart(4, "0")}-${String(calendarDate.month).padStart(2, "0")}-${String(calendarDate.day).padStart(2, "0")}`; return `${String(calendarDate.year).padStart(4, "0")}-${String(
calendarDate.month
).padStart(2, "0")}-${String(calendarDate.day).padStart(2, "0")}`;
}; };
const calendarDate = computed({ const calendarDate = computed({
@ -142,11 +140,10 @@ const open = ref(false);
</Button> </Button>
</PopoverTrigger> </PopoverTrigger>
<PopoverContent class="w-auto p-0" align="start"> <PopoverContent class="w-auto p-0" align="start">
<Calendar v-model="calendarDate" :disabled="disabled" /> <Calendar locale="si-SI" v-model="calendarDate" :disabled="disabled" />
</PopoverContent> </PopoverContent>
</Popover> </Popover>
<p v-if="error" class="mt-1 text-sm text-red-600"> <p v-if="error" class="mt-1 text-sm text-red-600">
{{ Array.isArray(error) ? error[0] : error }} {{ Array.isArray(error) ? error[0] : error }}
</p> </p>
</template> </template>

View File

@ -480,7 +480,7 @@ watch(
/> />
<div class="wrap-anywhere"> <div class="wrap-anywhere">
<p> <p>
{{ doc.original_name || doc.name }} <span>{{ doc.name }}.{{ doc.extension }}</span>
</p> </p>
<span class="text-xs text-gray-400" <span class="text-xs text-gray-400"
>({{ doc.extension?.toUpperCase() || "" }}, >({{ doc.extension?.toUpperCase() || "" }},