From 2ffe5342dce11539c3cef46214c35b7c28712006 Mon Sep 17 00:00:00 2001 From: zeeshan Date: Thu, 8 Oct 2026 13:55:35 +0530 Subject: [PATCH] Team 2 (Purview Doctor Tagging ) Only Doctors in dropdown --- ...35a8-b66e-4889-b29d-db2666f4163a.blade.php | 67 +------------------ 1 file changed, 3 insertions(+), 64 deletions(-) diff --git a/resources/views/form/rapport-team2/1790853173-2ef535a8-b66e-4889-b29d-db2666f4163a.blade.php b/resources/views/form/rapport-team2/1790853173-2ef535a8-b66e-4889-b29d-db2666f4163a.blade.php index 88c53078..54b91673 100644 --- a/resources/views/form/rapport-team2/1790853173-2ef535a8-b66e-4889-b29d-db2666f4163a.blade.php +++ b/resources/views/form/rapport-team2/1790853173-2ef535a8-b66e-4889-b29d-db2666f4163a.blade.php @@ -47,7 +47,7 @@ @endphp - @if(count($submissions) ==0) + @if(count($submissions) ==0 || !empty($id) )
@@ -231,7 +231,7 @@ // All contacts loaded for each hierarchy // Example usage: console.log(contacts); // Filter out contacts where value == 'sample' - contacts = contacts.filter(function(itm) { return itm.value !== 'sample'; }); + contacts = contacts.filter(function(itm) { return itm.value !== 'sample'; && itm.contact && itm.contact.type === 'doctor' }); console.log(contacts); // Loop through contacts and append options to select elements whose id starts with 'field-contact_id' @@ -249,68 +249,7 @@ }); } - /* function enforceUniqueDoctorSelections() { - var selectedValues = []; - - // Collect selected values (ignore empty) - $("[id^='field-contact_id']").each(function () { - var v = $(this).val(); - if (v) selectedValues.push(String(v)); - }); - - // Reset all option disabled states, then disable duplicates across selects - $("[id^='field-contact_id']").each(function () { - var currentSelect = $(this); - var currentVal = currentSelect.val() ? String(currentSelect.val()) : ""; - - currentSelect.find("option").prop("disabled", false); - - // Disable values selected in OTHER selects (keep current selection enabled) - selectedValues.forEach(function (v) { - if (v && v !== currentVal) { - currentSelect - .find("option[value=\"" + v.replace(/"/g, '\\"') + "\"]") - .prop("disabled", true); - } - }); - - // Refresh select2 UI if present - if (currentSelect.data("select2")) { - currentSelect.trigger("change.select2"); - } - }); - } */ - - - /* function enforceUniqueDoctorSelections() { - var selectedValues = []; - - // Collect selected values from select dropdowns only - $("select[id^='field-contact_id']").each(function () { - var v = $(this).val(); - if (v) selectedValues.push(String(v)); - }); - - // Reset all option disabled states, then disable duplicates across selects - $("select[id^='field-contact_id']").each(function () { - var currentSelect = $(this); - var currentVal = currentSelect.val() ? String(currentSelect.val()) : ""; - - currentSelect.find("option").prop("disabled", false); - - selectedValues.forEach(function (v) { - if (v && v !== currentVal) { - currentSelect - .find("option[value=\"" + v.replace(/"/g, '\\"') + "\"]") - .prop("disabled", true); - } - }); - - if (currentSelect.data("select2")) { - currentSelect.trigger("change.select2"); - } - }); - } */ + function enforceUniqueDoctorSelections() {