From 7365a16d604e7d760ea6ad011b6a3dd2e4b03398 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 May 2010 10:20:28 +0000 Subject: [PATCH] Merge tab "tasks" and "mytasks". Now it is just a link to switch on page. --- htdocs/langs/en_US/projects.lang | 2 ++ htdocs/langs/fr_FR/projects.lang | 2 ++ htdocs/lib/project.lib.php | 14 ++++++++++++-- htdocs/projet/tasks/fiche.php | 21 +++++++++++++++++++-- 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 6cf295928cb..367536bb463 100755 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -74,6 +74,8 @@ ActionsOnProject=Actions on project YouAreNotContactOfProject=You are not a contact of this private project DeleteATimeSpent=Delete time spent ConfirmDeleteATimeSpent=Are you sure you want to delete this time spent ? +DoNotShowMyTasksOnly=See also tasks i am not affected to +ShowMyTasksOnly=View only tasks i am affected to ##### Types de contacts ##### TypeContact_project_internal_PROJECTLEADER=Project leader TypeContact_project_external_PROJECTLEADER=Project leader diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index 426601e070b..73281d581df 100755 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -74,6 +74,8 @@ ActionsOnProject=Actions sur le projet YouAreNotContactOfProject=Vous n'êtes pas contact de ce projet privé DeleteATimeSpent=Suppression du temps consommé ConfirmDeleteATimeSpent=Êtes-vous sûr de vouloir supprimer ce temps consommé ? +DoNotShowMyTasksOnly=Voir aussi les taches qui ne me sont pas affectées +ShowMyTasksOnly=Ne voir que les taches qui me sont affectées ##### Types de contacts ##### TypeContact_project_internal_PROJECTLEADER=Chef de projet TypeContact_project_external_PROJECTLEADER=Chef de projet diff --git a/htdocs/lib/project.lib.php b/htdocs/lib/project.lib.php index 1a818d7d5eb..d918b7e310e 100644 --- a/htdocs/lib/project.lib.php +++ b/htdocs/lib/project.lib.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2006-2010 Laurent Destailleur * Copyright (C) 2010 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -85,12 +85,22 @@ function project_prepare_head($object) $head[$h][2] = 'tasks'; $h++; + /* Now this is a filter in the Task tab. $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/fiche.php?id='.$object->id.'&mode=mine'; $head[$h][1] = $langs->trans("MyTasks"); $head[$h][2] = 'mytasks'; $h++; + */ - return $head; + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) + { + $head[$h][0] = DOL_URL_ROOT.'/projet/gant/gantview.php?id='.$object->id; + $head[$h][1] = $langs->trans("Gantt"); + $head[$h][2] = 'gantt'; + $h++; + } + + return $head; } diff --git a/htdocs/projet/tasks/fiche.php b/htdocs/projet/tasks/fiche.php index 6ff9491fa93..63436cf7511 100644 --- a/htdocs/projet/tasks/fiche.php +++ b/htdocs/projet/tasks/fiche.php @@ -42,6 +42,7 @@ $result = restrictedArea($user, 'projet', $projectid); $userAccess=0; $langs->load("users"); +$langs->load("projects"); /* @@ -199,12 +200,11 @@ else { /* * Fiche projet en mode visu - * */ $userstatic=new User($db); $tab='tasks'; - if ($_REQUEST["mode"]=='mine') $tab='mytasks'; + //if ($_REQUEST["mode"]=='mine') $tab='mytasks'; $head=project_prepare_head($project); dol_fiche_head($head, $tab, $langs->trans("Project"),0,($project->public?'projectpub':'project')); @@ -266,6 +266,23 @@ else print '
'; + + // Link to switch in "my task" / "all task" + print '
'; + if ($_REQUEST["mode"] == 'mine') + { + print ''.$langs->trans("DoNotShowMyTasksOnly").''; + //print ' - '; + //print $langs->trans("ShowMyTaskOnly"); + } + else + { + //print $langs->trans("DoNotShowMyTaskOnly"); + //print ' - '; + print ''.$langs->trans("ShowMyTasksOnly").''; + } + print '
'; + // Get list of tasks in tasksarray and taskarrayfiltered // We need all tasks (even not limited to a user because a task to user // can have a parent that is not affected to him).