From b305ab4bdb95d28b98d605e7d3784ffa64455950 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Feb 2010 01:21:47 +0000 Subject: [PATCH] Fix: Creation of a task --- htdocs/projet/index.php | 17 ++++++++--------- htdocs/projet/tasks/fiche.php | 12 +++++++++--- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 3950c1fd1c6..6c3a117ad0b 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -21,20 +21,19 @@ /** * \file htdocs/projet/index.php * \ingroup projet - * \brief Page d'accueil du module projet + * \brief Main project home page * \version $Id$ */ require("./pre.inc.php"); $langs->load("projects"); -if (!$user->rights->projet->lire) accessforbidden(); - // Security check if ($user->societe_id > 0) { $socid = $user->societe_id; } +if (!$user->rights->projet->lire) accessforbidden(); /* @@ -82,13 +81,13 @@ if ( $resql ) while ($i < $num) { $objp = $db->fetch_object($resql); - + $projectstatic->id = $objp->projectid; $projectstatic->user_author_id = $objp->fk_user_creat; $projectstatic->public = $objp->public; - + $userAccess = $projectstatic->restrictedProjectArea($user,1); - + if ($userAccess >= 0) { $var=!$var; @@ -118,7 +117,7 @@ print ''; print ''; print ''; -print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","","","",$sortfield,$sortorder); +print_liste_field_titre($langs->trans("ThirdParties"),"index.php","s.nom","","","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("NbOfProjects"),"","","","",'align="right"',$sortfield,$sortorder); print "\n"; @@ -152,7 +151,7 @@ if ( $resql ) } else { - print $langs->trans("Public"); + print $langs->trans("OthersNotLinkedToThirdParty"); } print ''; print ''; diff --git a/htdocs/projet/tasks/fiche.php b/htdocs/projet/tasks/fiche.php index 77f976bb69b..d0e29e1c20a 100644 --- a/htdocs/projet/tasks/fiche.php +++ b/htdocs/projet/tasks/fiche.php @@ -57,6 +57,12 @@ if ($_POST["action"] == 'createtask' && $user->rights->projet->creer) $_GET["action"]='create'; $error++; } + else if (empty($_POST['task_parent'])) + { + $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("ChildOfTask")); + $_GET["action"]='create'; + $error++; + } if (! $error) { @@ -139,12 +145,12 @@ if ($_GET["action"] == 'create' && $user->rights->projet->creer && (empty($proje print '
'.$obj->nb.'
'; - print ''; - print ''; print '
'.$langs->trans("Label").''; + print '
'.$langs->trans("Label").''; print ''; print '
'.$langs->trans("ChildOfTask").''; - print $formother->selectProjectTasks('',$projectid, 'task_parent', 0, 0, 1); + print '
'.$langs->trans("ChildOfTask").''; + print $formother->selectProjectTasks('',$projectid, 'task_parent', 0, 0, 1, 1); print '
'.$langs->trans("AffectedTo").'';