From 5765c06d5fa23d01a974d66d64982b2d458631da Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Mon, 21 Jul 2025 15:17:46 +0200 Subject: [PATCH] Debug v22 --- htdocs/comm/action/card.php | 12 ++++++++++-- htdocs/langs/en_US/projects.lang | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 5faa1565f7a..daecb4d6930 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1744,7 +1744,7 @@ if ($action == 'create') { print '$(document).ready(function () { $("#projectid").change(function () { var url = "'.DOL_URL_ROOT.'/projet/ajax/projects.php?mode=gettasks&socid="+$("#search_socid").val()+"&projectid="+$("#projectid").val(); - console.log("Call url to get new list of tasks: "+url); + console.log("Call url to get the new list of tasks: "+url); $.get(url, function(data) { console.log(data); if (data) $("#taskid").html(data).select2(); @@ -1765,7 +1765,15 @@ if ($action == 'create') { $tid = GETPOSTISSET("projecttaskid") ? GETPOSTINT("projecttaskid") : (GETPOSTISSET("taskid") ? GETPOSTINT("taskid") : ''); - print $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', (string) $projectsListId, 'all', null, 1); + if (empty($projectsListId)) { + print ''; + print ajax_combobox('taskid'); + } else { + print $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 32, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', (string) $projectsListId, 'all', null, 1); + } print ''; } diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 8521a485ebc..f52571665bd 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -215,7 +215,8 @@ TimeSpentBy=Time spent by TasksAssignedTo=Tasks assigned to AssignTaskToMe=Assign task to myself AssignTaskToUser=Assign task to %s -SelectTaskToAssign=Select task to assign... +SelectTaskToAssign=Select a task to assign... +SelectAProjectFirst=Select a project first... AssignTask=Assign ProjectOverview=Overview ManageTasks=Use projects to follow tasks and/or report time spent (timesheets)