FIX : Add calls to fetchComments function
This commit is contained in:
parent
d875553648
commit
a455f60c42
@ -64,6 +64,7 @@ if ($id > 0 || ! empty($ref))
|
||||
$ret = $object->fetch($id,$ref); // If we create project, ref may be defined into POST but record does not yet exists into database
|
||||
if ($ret > 0) {
|
||||
$object->fetch_thirdparty();
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
||||
$id=$object->id;
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,6 +67,7 @@ if ($id > 0 || ! empty($ref))
|
||||
$ret = $object->fetch($id,$ref); // If we create project, ref may be defined into POST but record does not yet exists into database
|
||||
if ($ret > 0) {
|
||||
$object->fetch_thirdparty();
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
||||
$id=$object->id;
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,6 +43,7 @@ $mine = GETPOST('mode')=='mine' ? 1 : 0;
|
||||
$object = new Project($db);
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
||||
|
||||
// Security check
|
||||
$socid=0;
|
||||
@ -140,6 +141,7 @@ $userstatic=new User($db);
|
||||
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
||||
// To verify role of users
|
||||
//$userAccess = $object->restrictedProjectArea($user,'read');
|
||||
$userWrite = $object->restrictedProjectArea($user,'write');
|
||||
|
||||
@ -48,6 +48,7 @@ $result=restrictedArea($user,'projet',$id,'projet&project');
|
||||
$object = new Project($db);
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
||||
|
||||
if ($id > 0 || ! empty($ref)) {
|
||||
$upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
|
||||
@ -97,6 +97,7 @@ $projectid=$id; // For backward compatibility
|
||||
$object = new Project($db);
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
||||
|
||||
// Security check
|
||||
$socid=$object->socid;
|
||||
|
||||
@ -42,6 +42,7 @@ $mine = ($mode == 'mine' ? 1 : 0);
|
||||
$object = new Project($db);
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
||||
|
||||
// Security check
|
||||
$socid=0;
|
||||
|
||||
@ -97,6 +97,7 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$object->fetch($id, $ref);
|
||||
$object->fetch_thirdparty();
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
||||
$object->info($object->id);
|
||||
}
|
||||
|
||||
|
||||
@ -38,6 +38,7 @@ $mine = $_REQUEST['mode']=='mine' ? 1 : 0;
|
||||
$object = new Project($db);
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
||||
|
||||
// Security check
|
||||
$socid=0;
|
||||
|
||||
@ -51,6 +51,7 @@ $extrafields_project = new ExtraFields($db);
|
||||
$extrafields_task = new ExtraFields($db);
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
||||
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
|
||||
@ -105,6 +105,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
$result=$projectstatic->fetch($object->fk_project);
|
||||
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) $projectstatic->fetchComments();
|
||||
|
||||
$object->project = clone $projectstatic;
|
||||
|
||||
|
||||
@ -173,9 +173,11 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if ($object->fetch($id, $ref) > 0)
|
||||
{
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
||||
$id = $object->id; // So when doing a search from ref, id is also set correctly.
|
||||
|
||||
$result=$projectstatic->fetch($object->fk_project);
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) $projectstatic->fetchComments();
|
||||
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
|
||||
|
||||
$object->project = clone $projectstatic;
|
||||
|
||||
@ -92,7 +92,9 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if ($object->fetch($id,$ref) > 0)
|
||||
{
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
||||
$projectstatic->fetch($object->fk_project);
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) $projectstatic->fetchComments();
|
||||
|
||||
if (! empty($projectstatic->socid)) {
|
||||
$projectstatic->fetch_thirdparty();
|
||||
|
||||
@ -50,7 +50,9 @@ if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if ($object->fetch($id,$ref) > 0)
|
||||
{
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
||||
$projectstatic->fetch($object->fk_project);
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) $projectstatic->fetchComments();
|
||||
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
|
||||
|
||||
$object->project = clone $projectstatic;
|
||||
|
||||
@ -211,8 +211,10 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($object->fetch($id,$ref) > 0)
|
||||
{
|
||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
||||
|
||||
$result=$projectstatic->fetch($object->fk_project);
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) $projectstatic->fetchComments();
|
||||
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
|
||||
|
||||
$object->project = clone $projectstatic;
|
||||
|
||||
@ -292,7 +292,9 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
||||
}
|
||||
elseif ($object->fetch($id, $ref) >= 0)
|
||||
{
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
||||
$result=$projectstatic->fetch($object->fk_project);
|
||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) $projectstatic->fetchComments();
|
||||
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
|
||||
$res=$projectstatic->fetch_optionals($object->id,$extralabels_projet);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user