Skip to content
Snippets Groups Projects
Commit 4e41b721 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Nb of notes and doc not visible onto tasks.

parent a627dd9a
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ Fix: [ bug #1353 ] Email notifications, wrong URL.
Fix: [ bug #1362 ] Note is not saved.
Fix: tr/td balance.
Fix: [ bug #1360 ] note indicator for member tab.
Fix: Nb of notes and doc not visible onto tasks.
***** ChangeLog for 3.5.2 compared to 3.5.1 *****
Fix: Can't add user for a task.
......
......@@ -142,20 +142,26 @@ function task_prepare_head($object)
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'task');
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
$nbNote = 0;
if(!empty($object->note_private)) $nbNote++;
if(!empty($object->note_public)) $nbNote++;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
$head[$h][1] = $langs->trans('Notes');
if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
$head[$h][2] = 'task_notes';
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
/*$filesdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$listoffiles=dol_dir_list($filesdir,'files',1);
$head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents'));*/
$head[$h][1] = $langs->trans('Documents');
$filesdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->project->ref) . '/' .dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$listoffiles=dol_dir_list($filesdir,'files',1,'','thumbs');
$head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents'));
$head[$h][2] = 'task_document';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/note.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');;
$head[$h][1] = $langs->trans('Notes');
$head[$h][2] = 'task_notes';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'task','remove');
return $head;
......
......@@ -157,6 +157,8 @@ if ($id > 0 || ! empty($ref))
$result=$projectstatic->fetch($object->fk_project);
if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid);
$object->project = dol_clone($projectstatic);
$userWrite = $projectstatic->restrictedProjectArea($user,'write');
if ($withproject)
......
......@@ -52,6 +52,8 @@ if ($id > 0 || ! empty($ref))
{
$projectstatic->fetch($object->fk_project);
if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid);
$object->project = dol_clone($projectstatic);
}
else
{
......
......@@ -199,6 +199,8 @@ if ($id > 0 || ! empty($ref))
$result=$projectstatic->fetch($object->fk_project);
if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid);
$object->project = dol_clone($projectstatic);
$userWrite = $projectstatic->restrictedProjectArea($user,'write');
if (! empty($withproject))
......
......@@ -187,6 +187,8 @@ if ($id > 0 || ! empty($ref))
$result=$projectstatic->fetch($object->fk_project);
if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid);
$object->project = dol_clone($projectstatic);
$userWrite = $projectstatic->restrictedProjectArea($user,'write');
if ($withproject)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment