FIX: project time spent by day/week: quote mismatch is SQL query to assign to check task assigment

This commit is contained in:
Marc de Lima Lucio 2021-06-10 23:26:33 +02:00
parent 5d6735f364
commit 96656ff148
2 changed files with 2 additions and 2 deletions

View File

@ -210,7 +210,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
{
// Test if we are already contact of the project (should be rare but sometimes we can add as task contact without being contact of project, like when admin user has been removed from contact of project)
$sql = 'SELECT ec.rowid FROM '.MAIN_DB_PREFIX.'element_contact as ec, '.MAIN_DB_PREFIX.'c_type_contact as tc WHERE tc.rowid = ec.fk_c_type_contact';
$sql .= ' AND ec.fk_socpeople = '.$idfortaskuser." AND ec.element_id = '.$object->fk_project.' AND tc.element = 'project' AND source = 'internal'";
$sql .= ' AND ec.fk_socpeople = '.$idfortaskuser." AND ec.element_id = ".$object->fk_project." AND tc.element = 'project' AND source = 'internal'";
$resql = $db->query($sql);
if ($resql)
{

View File

@ -224,7 +224,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
{
// Test if we are already contact of the project (should be rare but sometimes we can add as task contact without being contact of project, like when admin user has been removed from contact of project)
$sql = 'SELECT ec.rowid FROM '.MAIN_DB_PREFIX.'element_contact as ec, '.MAIN_DB_PREFIX.'c_type_contact as tc WHERE tc.rowid = ec.fk_c_type_contact';
$sql .= ' AND ec.fk_socpeople = '.$idfortaskuser." AND ec.element_id = '.$object->fk_project.' AND tc.element = 'project' AND source = 'internal'";
$sql .= ' AND ec.fk_socpeople = '.$idfortaskuser." AND ec.element_id = ".$object->fk_project." AND tc.element = 'project' AND source = 'internal'";
$resql = $db->query($sql);
if ($resql)
{