From 83ab8c05e2d4265f37055796acd66377e6fb67b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Aug 2012 14:31:36 +0200 Subject: [PATCH] New: More surface control into project edition --- htdocs/projet/fiche.php | 31 +++++++++++++++++-------------- htdocs/projet/tasks.php | 10 +++++----- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index c4d32d3fb96..0890de8a9d7 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -61,6 +61,9 @@ if ($object->id > 0) $object->fetch_thirdparty(); } +$date_start=dol_mktime(0,0,0,GETPOST('projectmonth','int'),GETPOST('projectday','int'),GETPOST('projectyear','int')); +$date_end=dol_mktime(0,0,0,GETPOST('projectendmonth','int'),GETPOST('projectendday','int'),GETPOST('projectendyear','int'));; + /* * Actions @@ -129,8 +132,8 @@ if ($action == 'add' && $user->rights->projet->creer) $object->description = GETPOST('description','alpha'); $object->public = GETPOST('public','alpha'); $object->datec=dol_now(); - $object->date_start=dol_mktime(0,0,0,GETPOST('projectmonth','int'),GETPOST('projectday','int'),GETPOST('projectyear','int')); - $object->date_end=dol_mktime(0,0,0,GETPOST('projectendmonth','int'),GETPOST('projectendday','int'),GETPOST('projectendyear','int')); + $object->date_start=$date_start; + $object->date_end=$date_end; $result = $object->create($user); if ($result > 0) @@ -193,13 +196,13 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer) $old_start_date = $object->date_start; - $object->ref = GETPOST('ref','alpha'); - $object->title = GETPOST('title','alpha'); - $object->socid = GETPOST('socid','int'); - $object->description = GETPOST('description','alpha'); - $object->public = GETPOST('public','alpha'); - $object->date_start = empty($_POST["project"])?'':dol_mktime(0,0,0,GETPOST('projectmonth'),GETPOST('projectday'),GETPOST('projectyear')); - $object->date_end = empty($_POST["projectend"])?'':dol_mktime(0,0,0,GETPOST('projectendmonth'),GETPOST('projectendday'),GETPOST('projectendyear')); + $object->ref = GETPOST('ref','alpha'); + $object->title = GETPOST('title','alpha'); + $object->socid = GETPOST('socid','int'); + $object->description = GETPOST('description','alpha'); + $object->public = GETPOST('public','alpha'); + $object->date_start = empty($_POST["project"])?'':$date_start; + $object->date_end = empty($_POST["projectend"])?'':$date_end; $result=$object->update($user); @@ -387,12 +390,12 @@ if ($action == 'create' && $user->rights->projet->creer) // Date start print ''.$langs->trans("DateStart").''; - print $form->select_date('','project'); + print $form->select_date(($date_start?$date_start:''),'project'); print ''; // Date end print ''.$langs->trans("DateEnd").''; - print $form->select_date(-1,'projectend'); + print $form->select_date(($date_end?$date_end:-1),'projectend'); print ''; // Description @@ -519,10 +522,10 @@ else // Date start print ''.$langs->trans("DateStart").''; - print $form->select_date($object->date_start,'project'); - print 'select_date($object->date_start?$object->date_start:-1,'project'); + print '     '. $langs->trans("ProjectReportDate"); + print '/> '. $langs->trans("ProjectReportDate"); print ''; // Date end diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index eadd86b5b65..ac80a52a46c 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -212,7 +212,10 @@ if ($id > 0 || ! empty($ref)) else print $langs->trans('PrivateProject'); print ''; - // Date start + // Statut + print ''.$langs->trans("Status").''.$object->getLibStatut(4).''; + + // Date start print ''.$langs->trans("DateStart").''; print dol_print_date($object->date_start,'day'); print ''; @@ -222,9 +225,6 @@ if ($id > 0 || ! empty($ref)) print dol_print_date($object->date_end,'day'); print ''; - // Statut - print ''.$langs->trans("Status").''.$object->getLibStatut(4).''; - print ''; dol_fiche_end();