Merge pull request #4922 from atm-alexis/NEW_multientity_for_project
FIX multicompany project access
This commit is contained in:
commit
75eb718c01
@ -588,7 +588,7 @@ class Task extends CommonObject
|
||||
$sql.= ", ".MAIN_DB_PREFIX."element_contact as ec2";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."c_type_contact as ctc2";
|
||||
}
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
$sql.= " WHERE p.entity IN (".getEntity('project',1).")";
|
||||
$sql.= " AND t.fk_projet = p.rowid";
|
||||
}
|
||||
elseif ($mode == 1)
|
||||
@ -609,7 +609,7 @@ class Task extends CommonObject
|
||||
{
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
|
||||
}
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
$sql.= " WHERE p.entity IN (".getEntity('project',1).")";
|
||||
}
|
||||
else return 'BadValueForParameterMode';
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
|
||||
// Security check
|
||||
$socid=0;
|
||||
if ($user->societe_id > 0) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'projet', $id);
|
||||
$result = restrictedArea($user, 'projet', $id,'projet&project');
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -43,7 +43,7 @@ $mine = (GETPOST('mode','alpha') == 'mine' ? 1 : 0);
|
||||
// Security check
|
||||
$socid=0;
|
||||
if ($user->societe_id > 0) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'projet',$id,'');
|
||||
$result=restrictedArea($user,'projet',$id,'projet&project');
|
||||
|
||||
$object = new Project($db);
|
||||
|
||||
|
||||
@ -92,7 +92,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
|
||||
// Security check
|
||||
$socid=0;
|
||||
if ($user->societe_id > 0) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'projet', $projectid);
|
||||
$result = restrictedArea($user, 'projet', $projectid, 'projet&project');
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -44,7 +44,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
|
||||
// Security check
|
||||
$socid=0;
|
||||
if ($user->societe_id > 0) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'projet', $id);
|
||||
$result = restrictedArea($user, 'projet', $id,'projet&project');
|
||||
|
||||
$langs->load("users");
|
||||
$langs->load("projects");
|
||||
|
||||
@ -42,7 +42,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
|
||||
// Security check
|
||||
$socid=0;
|
||||
if ($user->societe_id > 0) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'projet', $id);
|
||||
$result = restrictedArea($user, 'projet', $id,'projet&project');
|
||||
|
||||
$permissionnote=$user->rights->projet->creer; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ $extralabels_task=$extrafields_task->fetch_name_optionals_label($taskstatic->tab
|
||||
// Security check
|
||||
$socid=0;
|
||||
if ($user->societe_id > 0) $socid = $user->societe_id;
|
||||
$result = restrictedArea($user, 'projet', $id);
|
||||
$result = restrictedArea($user, 'projet', $id,'projet&project');
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('projecttaskcard','globalcard'));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user