#34417 [GroupByKanban] add: fix drag and drop for lead (#34493)

This commit is contained in:
Nicolas Domenech
2025-06-14 01:45:50 +02:00
committed by GitHub
parent c23d673780
commit 6b2050d34d
2 changed files with 13 additions and 7 deletions

View File

@@ -1627,10 +1627,10 @@ if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE')) {
// Code to manage drag and drop inside kanban group by view - handles sortable columns and item movement between status columns // Code to manage drag and drop inside kanban group by view - handles sortable columns and item movement between status columns
$(document).ready(function() { $(document).ready(function() {
if ($('.kanban .column:not(.kanbancollapsed)').length > 0) { if ($('.kanban .column').length > 0) {
$('.kanban .column:not(.kanbancollapsed)').sortable({ $('.kanban .column').sortable({
items: '.kanban-draggable', items: '.kanban-draggable',
connectWith: '.kanban .column:not(.kanbancollapsed)', connectWith: '.kanban .column',
cursor: 'move', cursor: 'move',
opacity: 0.8, opacity: 0.8,
tolerance: 'pointer', tolerance: 'pointer',
@@ -1664,9 +1664,15 @@ if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE')) {
element: item.data('element'), element: item.data('element'),
table_element: item.data('tableelement'), table_element: item.data('tableelement'),
fk_element: item.data('itemid'), fk_element: item.data('itemid'),
value: newColumn.data('groupbyid') value: newColumn.data('groupbyid'),
token: "<?php echo currentToken() ?>"
}, },
context: document.body context: document.body,
success: function() {
if (newColumn.hasClass('kanbancollapsed')) {
item.hide();
}
}
}); });
item.data('original-column', newColumn); item.data('original-column', newColumn);
} }

View File

@@ -1764,7 +1764,7 @@ while ($i < $imaxinloop) {
if (in_array($tmpcursor, $groupofcollpasedvalues)) { if (in_array($tmpcursor, $groupofcollpasedvalues)) {
print ' kanbancollapsed'; print ' kanbancollapsed';
} }
print '" data-groupbyid="'.preg_replace('/[^a-z0-9]/', '', $tmpcursor).'">'; print '" data-groupbyid="'.preg_replace('/[^a-z0-9]/', '', $tmpcursor).'" data-groupbyfield="'.$groupbyfield.'">';
print '<div class="kanbanlabel">'.$langs->trans($tmpgroupbyvalue).'</div>'; print '<div class="kanbanlabel">'.$langs->trans($tmpgroupbyvalue).'</div>';
print '</div>'; // Start and end the new column print '</div>'; // Start and end the new column
} }
@@ -1803,7 +1803,7 @@ while ($i < $imaxinloop) {
if (in_array($tmpcursor, $groupofcollpasedvalues)) { if (in_array($tmpcursor, $groupofcollpasedvalues)) {
print ' kanbancollapsed'; print ' kanbancollapsed';
} }
print '" data-groupbyid="'.preg_replace('/[^a-z0-9]/', '', $tmpcursor).'">'; print '" data-groupbyid="'.preg_replace('/[^a-z0-9]/', '', $tmpcursor).'" data-groupbyfield="'.$groupbyfield.'">';
print '<div class="kanbanlabel">'.$langs->trans(empty($tmpgroupbyvalue) ? 'Undefined' : $tmpgroupbyvalue).'</div>'; print '<div class="kanbanlabel">'.$langs->trans(empty($tmpgroupbyvalue) ? 'Undefined' : $tmpgroupbyvalue).'</div>';
print '</div>'; // Start and end the new column print '</div>'; // Start and end the new column
} }