Team 2 (Purview Doctor Tagging)
Specific Folder FTP Upload / ftp-deploy (push) Successful in 51s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 51s
Details
This commit is contained in:
parent
914a319b3f
commit
48344bf0b1
|
|
@ -94,7 +94,7 @@
|
||||||
$isContact = str_starts_with($question->code, 'contact_id');
|
$isContact = str_starts_with($question->code, 'contact_id');
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
<select class="form-control" {!!($isContact)?'data-toggle="select2"':'' !!} id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
||||||
<option value=""> -- Select -- </option>
|
<option value=""> -- Select -- </option>
|
||||||
@foreach ($question->options as $option)
|
@foreach ($question->options as $option)
|
||||||
@if($isContact && isset($option->contact->type) && $option->contact->type == 'doctor' )
|
@if($isContact && isset($option->contact->type) && $option->contact->type == 'doctor' )
|
||||||
|
|
@ -350,7 +350,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* $("select[id^='field-contact_id']").each(function() {
|
$("select[id^='field-contact_id']").each(function() {
|
||||||
var select = $(this);
|
var select = $(this);
|
||||||
// Clear previous options
|
// Clear previous options
|
||||||
select.html('');
|
select.html('');
|
||||||
|
|
@ -411,74 +411,11 @@
|
||||||
// Enable search on doctor dropdowns
|
// Enable search on doctor dropdowns
|
||||||
applySelect2ToDoctorDropdowns();
|
applySelect2ToDoctorDropdowns();
|
||||||
$("#pageloader").fadeOut();
|
$("#pageloader").fadeOut();
|
||||||
}); */
|
});
|
||||||
|
|
||||||
// contacts लोड झाल्यानंतर:
|
|
||||||
contacts = contacts.filter(function(itm) { return itm.value !== 'sample'; });
|
|
||||||
|
|
||||||
$("select[id^='field-contact_id']").each(function() {
|
|
||||||
var select = $(this);
|
|
||||||
|
|
||||||
// जर आधी Select2 लागलेले असेल तर ते आधी नष्ट (destroy) करा
|
|
||||||
if (select.hasClass("select2-hidden-accessible")) {
|
|
||||||
select.select2('destroy');
|
|
||||||
}
|
|
||||||
|
|
||||||
// जुने ऑप्शन्स रिकामे करा
|
|
||||||
select.empty();
|
|
||||||
|
|
||||||
// डिफॉल्ट सिलेक्ट पर्याय जोडा
|
|
||||||
select.append($("<option></option>").attr("value", '').text('-- Select --'));
|
|
||||||
|
|
||||||
// डॉक्टरांची यादी जोडा
|
|
||||||
contacts.forEach(function(itm) {
|
|
||||||
var option = $("<option></option>")
|
|
||||||
.attr("value", itm.value)
|
|
||||||
.text(itm.display);
|
|
||||||
|
|
||||||
if (itm.contact && itm.contact.msl_code) {
|
|
||||||
option.attr("msl_code", itm.contact.msl_code);
|
|
||||||
}
|
|
||||||
if (itm.contact && itm.contact.speciality) {
|
|
||||||
option.attr("speciality", itm.contact.speciality);
|
|
||||||
}
|
|
||||||
select.append(option);
|
|
||||||
});
|
|
||||||
|
|
||||||
// आता Select2 लागू करा
|
|
||||||
select.select2({
|
|
||||||
width: "100%",
|
|
||||||
placeholder: "-- Select --",
|
|
||||||
allowClear: true
|
|
||||||
});
|
|
||||||
|
|
||||||
// Change event बांधा
|
|
||||||
select.off('change').on('change', function () {
|
|
||||||
var selected = $(this).find(':selected');
|
|
||||||
var selectId = $(this).attr('id');
|
|
||||||
var match = selectId.match(/^field-contact_id(_\d+)?$/);
|
|
||||||
var suffix = match && match[1] ? match[1] : '';
|
|
||||||
|
|
||||||
var mslCodeField = $('#field-msl_code' + suffix);
|
|
||||||
var specialityField = $('#field-speciality' + suffix);
|
|
||||||
|
|
||||||
if (mslCodeField.length) {
|
|
||||||
mslCodeField.val(selected.attr('msl_code') || '');
|
|
||||||
}
|
|
||||||
if (specialityField.length) {
|
|
||||||
specialityField.val(selected.attr('speciality') || '');
|
|
||||||
}
|
|
||||||
|
|
||||||
// डुप्लिकेट डॉक्टर निवडणे थांबवा
|
|
||||||
enforceUniqueDoctorSelections();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#pageloader").fadeOut();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue