CHANGE_ADD_user_in_masters_minor_fix - VADIVEL J 2025-10-29 11:55

This commit is contained in:
vadivelJ96 2025-10-29 11:56:23 +05:30
parent 53dffb08e9
commit f6e6056a76
2 changed files with 50 additions and 16 deletions

View File

@ -521,12 +521,13 @@ table.dataTable tbody td {
<?php foreach($roleData as $value) {
$headRoleValue = $value['id']??"";
// $headRoleValue = $value['id']??"";
// we are showing head role only to head's who logged in
if($headRoleValue == "5" && $currentLogInRole != "5" ){
continue;
}
// // we are showing head role only to head's who logged in
// if($headRoleValue == "5" && $currentLogInRole != "5" ){
// continue;
// }
?>
<option value="<?= $value['id'] ?>"><?= $value['role'] ?></option>
<?php } ?>

View File

@ -164,7 +164,7 @@ table.dataTable tbody td {
<thead class="bg-light">
<tr>
<th><div class="column-header">S.No&nbsp;</div></th>
<th><div class="column-header">S.No &nbsp;</div></th>
<th><div class="column-header">Lead Type &nbsp;</div></th>
<th><div class="column-header">Issuer &nbsp;</div></th>
<th><div class="column-header">Client Type &nbsp;</div></th>
@ -209,8 +209,10 @@ table.dataTable tbody td {
<td><?php echo $lead_status[$row['status']] ?? '-'; ?></td>
<td>
<div class="btn-group dropdown">
<a href="javascript:void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false">
<i class="mdi mdi-dots-horizontal"></i>
<a href="javascript:void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm"
data-toggle="dropdown"
aria-expanded="false"
data-boundary="window"> <i class="mdi mdi-dots-horizontal"></i>
</a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item btnEdit" data-id="<?= $row['id']; ?>" data-ft="<?= $row['lead_form_type']; ?>" onclick="getLeadsDataForEdit('<?= htmlspecialchars($row['id'], ENT_QUOTES) ?>', '<?= htmlspecialchars($row['lead_form_type'], ENT_QUOTES) ?>')">
@ -331,12 +333,19 @@ table.dataTable tbody td {
document.body.appendChild(customDropdown);
row.addEventListener("click", function(event) {
// Ignore clicks on the action column
if (event.target.closest('td:last-child')) {
return;
}
row.addEventListener("click", function(event) {
// 1. CRITICAL CHECK: Stop propagation if the click came from the dropdown toggle itself.
if (event.target.closest('.dropdown-toggle')) {
event.stopPropagation();
// **IMPORTANT:** Since you're using a custom script, you need to
// manually trigger the logic for your custom detached dropdown here.
// The code below should run when the dropdown toggle is clicked:
const originalDropdown = event.target.closest('.btn-group').querySelector('.dropdown-menu');
if (originalDropdown) {
// This is the code that opens your custom dropdown
if (activeDropdown) {
activeDropdown.style.display = 'none';
}
@ -349,8 +358,32 @@ table.dataTable tbody td {
customDropdown.style.top = `${rect.bottom + 5}px`;
activeDropdown = customDropdown;
event.stopPropagation();
});
}
return; // Exit the row listener early
}
// 2. Ignore clicks on the entire action column (your existing, good check)
if (event.target.closest('td:last-child')) {
return;
}
// ... rest of your row logic for general row clicks ...
if (activeDropdown) {
activeDropdown.style.display = 'none';
}
const rect = event.target.getBoundingClientRect();
customDropdown.style.display = 'block';
customDropdown.style.position = 'fixed';
customDropdown.style.left = `${rect.left}px`;
customDropdown.style.top = `${rect.bottom + 5}px`;
activeDropdown = customDropdown;
event.stopPropagation(); // Only needed if there is a parent handler
});
// Handle clicks on dropdown items
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {