Team 4 (Montair LC Kid ABM)
Specific Folder FTP Upload / ftp-deploy (push) Successful in 28s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 28s
Details
This commit is contained in:
parent
ab0ac794ac
commit
855a07e6cf
|
|
@ -41,22 +41,37 @@
|
|||
@endif
|
||||
|
||||
@php
|
||||
$currentRecordId = $id ?? null;
|
||||
$alreadySubmittedDoctors = [];
|
||||
if(isset($submissions) && is_array($submissions)) {
|
||||
foreach($submissions as $sub) {
|
||||
// Edit करताना सध्याचा रेकॉर्ड वगळा
|
||||
if($currentRecordId && isset($sub->id) && $sub->id == $currentRecordId) {
|
||||
continue;
|
||||
}
|
||||
if(isset($sub->formdata->contact_id) && !empty($sub->formdata->contact_id)) {
|
||||
$alreadySubmittedDoctors[] = (string)$sub->formdata->contact_id;
|
||||
}
|
||||
if(isset($sub->formdata->cont_id) && !empty($sub->formdata->cont_id)) {
|
||||
$alreadySubmittedDoctors[] = (string)$sub->formdata->cont_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
@php
|
||||
$submissions = Formhelper::getMultiformData($form->partition, $form_id, $form->user_id);
|
||||
// 1. null safe check
|
||||
$submissions = $submissions->data->submissions ?? [];
|
||||
|
||||
$currentRecordId = $id ?? null;
|
||||
$alreadySubmittedDoctors = [];
|
||||
|
||||
if (!empty($submissions)) {
|
||||
foreach ($submissions as $sub) {
|
||||
$subObj = (object)$sub; // safe object cast
|
||||
|
||||
|
||||
if ($currentRecordId && isset($subObj->id) && (string)$subObj->id === (string)$currentRecordId) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (isset($subObj->formdata)) {
|
||||
$fData = (object)$subObj->formdata;
|
||||
if (!empty($fData->contact_id)) {
|
||||
$alreadySubmittedDoctors[] = (string)$fData->contact_id;
|
||||
}
|
||||
if (!empty($fData->cont_id)) {
|
||||
$alreadySubmittedDoctors[] = (string)$fData->cont_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$alreadySubmittedDoctors = array_values(array_unique($alreadySubmittedDoctors));
|
||||
@endphp
|
||||
|
||||
@endphp
|
||||
|
||||
|
|
@ -203,7 +218,7 @@
|
|||
$('[data-toggle="select2"]').select2();
|
||||
var hierarcies = [];
|
||||
var contacts = [];
|
||||
var submittedDoctors = {!! json_encode(array_values(array_unique($alreadySubmittedDoctors))) !!};
|
||||
var submittedDoctors = @json($alreadySubmittedDoctors ?? []);
|
||||
@if(isset($form->manager_can_submit) && $form->manager_can_submit == true)
|
||||
@foreach($form->users as $option)
|
||||
hierarcies.push('{{$option->hierarchy_id}}');
|
||||
|
|
@ -279,7 +294,7 @@
|
|||
|
||||
$("[id^='field-contact_id']").each(function() {
|
||||
var select = $(this);
|
||||
// Clear previous options
|
||||
|
||||
|
||||
//var existingVal = select.val() || select.attr('data-preselected') || '';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue