Works on enhancement of project tasks
Fix: security check
This commit is contained in:
parent
1e7b88bb2f
commit
80d808be36
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -111,7 +111,7 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorde
|
|||||||
if ($mesg) print $mesg;
|
if ($mesg) print $mesg;
|
||||||
|
|
||||||
$tasksarray=$task->getTasksArray(0,0,$project->id,0);
|
$tasksarray=$task->getTasksArray(0,0,$project->id,0);
|
||||||
$tasksrole=$task->getUserRolesForProjetsOrTasks($user,0,$project->id,0);
|
$tasksrole=$task->getUserRolesForProjectsOrTasks($user,0,$project->id,0);
|
||||||
//var_dump($tasksarray);
|
//var_dump($tasksarray);
|
||||||
|
|
||||||
print '<form name="addtime" method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$project->id.'">';
|
print '<form name="addtime" method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$project->id.'">';
|
||||||
|
|||||||
@ -263,7 +263,7 @@ else
|
|||||||
// can have a parent that is not affected to him).
|
// can have a parent that is not affected to him).
|
||||||
$tasksarray=$task->getTasksArray(0, 0, $project->id, $socid, 0);
|
$tasksarray=$task->getTasksArray(0, 0, $project->id, $socid, 0);
|
||||||
// We load also tasks limited to a particular user
|
// We load also tasks limited to a particular user
|
||||||
$tasksrole=($_REQUEST["mode"]=='mine' ? $task->getUserRolesForProjetsOrTasks(0,$user,$project->id,0) : '');
|
$tasksrole=($_REQUEST["mode"]=='mine' ? $task->getUserRolesForProjectsOrTasks(0,$user,$project->id,0) : '');
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|||||||
@ -73,7 +73,7 @@ $task = new Task($db);
|
|||||||
// can have a parent that is not affected to him).
|
// can have a parent that is not affected to him).
|
||||||
$tasksarray=$taskstatic->getTasksArray(0, 0, $projectstatic->id, $socid);
|
$tasksarray=$taskstatic->getTasksArray(0, 0, $projectstatic->id, $socid);
|
||||||
// We load also tasks limited to a particular user
|
// We load also tasks limited to a particular user
|
||||||
$tasksrole=($_REQUEST["mode"]=='mine' ? $taskstatic->getUserRolesForProjetsOrTasks(0,$user,$projectstatic->id,0) : '');
|
$tasksrole=($_REQUEST["mode"]=='mine' ? $taskstatic->getUserRolesForProjectsOrTasks(0,$user,$projectstatic->id,0) : '');
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|||||||
@ -504,7 +504,7 @@ class Task extends CommonObject
|
|||||||
|
|
||||||
if ((! $obj->public) && ($userp || $usert)) // If not public and we ask a filter on user
|
if ((! $obj->public) && ($userp || $usert)) // If not public and we ask a filter on user
|
||||||
{
|
{
|
||||||
if (! $this->getUserRolesForProjetsOrTasks($userp, $usert, $obj->projectid, $obj->rowid))
|
if (! $this->getUserRolesForProjectsOrTasks($userp, $usert, $obj->projectid, $obj->rowid))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
@ -542,7 +542,7 @@ class Task extends CommonObject
|
|||||||
* @param taskid
|
* @param taskid
|
||||||
* @return array Array of role of user for each projects or each tasks
|
* @return array Array of role of user for each projects or each tasks
|
||||||
*/
|
*/
|
||||||
function getUserRolesForProjetsOrTasks($userp,$usert,$projectid=0,$taskid=0)
|
function getUserRolesForProjectsOrTasks($userp,$usert,$projectid=0,$taskid=0)
|
||||||
{
|
{
|
||||||
$tasksrole = array();
|
$tasksrole = array();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user