From f4230d9787cf66a91a3f8cf350c5f5004314b96d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 22 Jan 2010 17:49:13 +0000 Subject: [PATCH] Works on enhancement of project tasks --- .../install/mysql/migration/2.7.0-2.8.0.sql | 16 ++++++++++++ .../mysql/tables/llx_projet_task.key.sql | 3 --- .../install/mysql/tables/llx_projet_task.sql | 25 +++++++++++++------ htdocs/projet/tasks/task.php | 5 ++-- htdocs/projet/tasks/time.php | 3 ++- 5 files changed, 38 insertions(+), 14 deletions(-) diff --git a/htdocs/install/mysql/migration/2.7.0-2.8.0.sql b/htdocs/install/mysql/migration/2.7.0-2.8.0.sql index 116ab5026a1..a0ebc78f32a 100755 --- a/htdocs/install/mysql/migration/2.7.0-2.8.0.sql +++ b/htdocs/install/mysql/migration/2.7.0-2.8.0.sql @@ -105,3 +105,19 @@ ALTER TABLE llx_bank_class DROP INDEX uk_bank_class_lineid; ALTER TABLE llx_bank_class ADD UNIQUE INDEX uk_bank_class_lineid (lineid, fk_categ); ALTER TABLE llx_rights_def MODIFY COLUMN module varchar(64); + +-- Enhancement of project tasks +ALTER TABLE llx_projet_task ADD COLUMN datec datetime AFTER fk_task_parent; +ALTER TABLE llx_projet_task ADD COLUMN tms timestamp AFTER datec; +ALTER TABLE llx_projet_task ADD COLUMN dateo datetime AFTER tms; +ALTER TABLE llx_projet_task ADD COLUMN datee datetime AFTER dateo; +ALTER TABLE llx_projet_task ADD COLUMN datev datetime AFTER datee; +ALTER TABLE llx_projet_task CHANGE title label varchar(255) NOT NULL; +ALTER TABLE llx_projet_task ADD COLUMN description varchar(255) AFTER label; +ALTER TABLE llx_projet_task ADD COLUMN fk_user_modif integer AFTER fk_user_creat; +ALTER TABLE llx_projet_task ADD COLUMN fk_user_valid integer AFTER fk_user_modif; +UPDATE llx_projet_task SET statut='1' WHERE statut='open'; +ALTER TABLE llx_projet_task CHANGE statut fk_statut smallint DEFAULT 0 NOT NULL; +ALTER TABLE llx_projet_task CHANGE note note_private text; +ALTER TABLE llx_projet_task ADD COLUMN note_public text AFTER note_private; + diff --git a/htdocs/install/mysql/tables/llx_projet_task.key.sql b/htdocs/install/mysql/tables/llx_projet_task.key.sql index 96d963493f9..d5cac3f1741 100644 --- a/htdocs/install/mysql/tables/llx_projet_task.key.sql +++ b/htdocs/install/mysql/tables/llx_projet_task.key.sql @@ -21,6 +21,3 @@ ALTER TABLE llx_projet_task ADD CONSTRAINT fk_projet_task_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid); - - - diff --git a/htdocs/install/mysql/tables/llx_projet_task.sql b/htdocs/install/mysql/tables/llx_projet_task.sql index d0e80abc39b..9d8bf348eb9 100644 --- a/htdocs/install/mysql/tables/llx_projet_task.sql +++ b/htdocs/install/mysql/tables/llx_projet_task.sql @@ -1,5 +1,6 @@ -- =========================================================================== -- Copyright (C) 2005 Rodolphe Quiedeville +-- Copyright (C) 2010 Regis Houssin -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -20,12 +21,20 @@ create table llx_projet_task ( - rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_projet integer NOT NULL, - fk_task_parent integer NOT NULL, - title varchar(255), - duration_effective real NOT NULL, - fk_user_creat integer, -- createur - statut varchar(6) DEFAULT 'open', - note text + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_projet integer NOT NULL, + fk_task_parent integer DEFAULT 0 NOT NULL, + datec datetime, -- date creation + tms timestamp, -- date creation/modification + dateo datetime, -- date start task + datee datetime, -- date end task + datev datetime, -- date validation + label varchar(255) NOT NULL, + description varchar(255), + duration_effective real NOT NULL, + fk_user_creat integer, -- user who created the task + fk_user_valid integer, -- user who validated the task + fk_statut smallint DEFAULT 0 NOT NULL, + note_private text, + note_public text )type=innodb; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 7ca1fd688b5..dc90ce17f91 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -1,6 +1,7 @@ * Copyright (C) 2006-2009 Laurent Destailleur + * Copyright (C) 2010 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +21,7 @@ /** * \file htdocs/projet/tasks/task.php * \ingroup projet - * \brief Fiche t�ches d'un projet + * \brief Fiche taches d'un projet * \version $Id$ */ @@ -159,7 +160,7 @@ if ($_GET["id"] > 0) */ print '
'; - if (!$user->rights->projet->creer) + if ($user->rights->projet->supprimer) { print ''.$langs->trans('Delete').''; } diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 79aae335b84..e5d138f818b 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1,6 +1,7 @@ * Copyright (C) 2006-2009 Laurent Destailleur + * Copyright (C) 2010 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +21,7 @@ /** * \file htdocs/projet/tasks/task.php * \ingroup projet - * \brief Fiche t�ches d'un projet + * \brief Fiche taches d'un projet * \version $Id$ */