Fix: management of time spent in task card
Fix: Update time spent in seconds
This commit is contained in:
parent
e51a002c10
commit
2642d924d3
@ -215,6 +215,8 @@ function PLinesb(&$inc, $parent, $lines, &$level, &$projectsrole)
|
||||
{
|
||||
global $user, $bc, $langs;
|
||||
global $form;
|
||||
|
||||
$lastprojectid=0;
|
||||
|
||||
$projectstatic = new Project($db);
|
||||
$taskstatic = new Task($db);
|
||||
@ -223,12 +225,17 @@ function PLinesb(&$inc, $parent, $lines, &$level, &$projectsrole)
|
||||
|
||||
for ($i = 0 ; $i < sizeof($lines) ; $i++)
|
||||
{
|
||||
if ($parent == 0)
|
||||
$level = 0;
|
||||
if ($parent == 0) $level = 0;
|
||||
|
||||
if ($lines[$i]->fk_parent == $parent)
|
||||
{
|
||||
$var = !$var;
|
||||
// Break on a new project
|
||||
if ($parent == 0 && $lines[$i]->projectid != $lastprojectid)
|
||||
{
|
||||
$var = !$var;
|
||||
$lastprojectid=$lines[$i]->projectid;
|
||||
}
|
||||
|
||||
print "<tr $bc[$var]>\n";
|
||||
|
||||
// Project
|
||||
|
||||
@ -158,7 +158,7 @@ llxHeader('', $langs->trans("Task"));
|
||||
$html = new Form($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
$contactstatic = new Contact($db);
|
||||
$project = new Project($db);
|
||||
$projectstatic = new Project($db);
|
||||
|
||||
|
||||
/* *************************************************************************** */
|
||||
@ -176,8 +176,11 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
if ( $task->fetch($id,$ref) > 0)
|
||||
{
|
||||
$result=$project->fetch($task->fk_project);
|
||||
if (! empty($project->socid)) $project->societe->fetch($project->socid);
|
||||
$result=$projectstatic->fetch($task->fk_project);
|
||||
if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid);
|
||||
|
||||
// To verify role of users
|
||||
$userAccess = $projectstatic->restrictedProjectArea($user);
|
||||
|
||||
$head = task_prepare_head($task);
|
||||
dol_fiche_head($head, 'contact', $langs->trans("Task"), 0, 'projecttask');
|
||||
@ -200,13 +203,13 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
// Project
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
||||
print $project->getNomUrl(1);
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Customer
|
||||
print "<tr><td>".$langs->trans("Company")."</td>";
|
||||
print '<td colspan="3">';
|
||||
if ($project->societe->id > 0) print $project->societe->getNomUrl(1);
|
||||
if ($projectstatic->societe->id > 0) print $projectstatic->societe->getNomUrl(1);
|
||||
else print ' ';
|
||||
print '</td></tr>';
|
||||
|
||||
@ -271,7 +274,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
|
||||
// Line to add an external contact. Only if project linked to a third party.
|
||||
if ($project->socid)
|
||||
if ($projectstatic->socid)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
@ -281,7 +284,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '</td>';
|
||||
|
||||
print '<td colspan="1">';
|
||||
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$project->societe->id;
|
||||
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$projectstatic->societe->id;
|
||||
$selectedCompany = $formcompany->selectCompaniesForNewContact($task, 'id', $selectedCompany, 'newcompany');
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -122,6 +122,9 @@ if ($taskid)
|
||||
{
|
||||
$result=$projectstatic->fetch($task->fk_project);
|
||||
if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid);
|
||||
|
||||
// To verify role of users
|
||||
$userAccess = $projectstatic->restrictedProjectArea($user);
|
||||
|
||||
if ($mesg) print $mesg;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user