diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 97eb27745a8..9465fb815e2 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -35,6 +35,7 @@ class Project extends CommonObject public $table_element = 'projet'; //!< Name of table without prefix where object is stored public $table_element_line = 'projet_task'; public $fk_element = 'fk_projet'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; var $ref; @@ -51,6 +52,7 @@ class Project extends CommonObject var $statuts_short; var $statuts; var $oldcopy; + /** * Constructor diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index f5870301860..2511a65ee10 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -43,12 +43,6 @@ if ($id == '' && $ref == '' && ($action != "create" && $action != "add" && $acti $mine = GETPOST('mode')=='mine' ? 1 : 0; //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects - -// Security check -$socid=0; -if ($user->societe_id > 0) $socid=$user->societe_id; -$result = restrictedArea($user, 'projet', $id); - // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; $hookmanager=new HookManager($db); @@ -61,6 +55,11 @@ if ($object->id > 0) $object->fetch_thirdparty(); } +// Security check +$socid=0; +if ($user->societe_id > 0) $socid=$user->societe_id; +$result = restrictedArea($user, 'projet', $object->id); + $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'));; @@ -720,10 +719,13 @@ else print ''; - // List of actions on element - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; - $formactions=new FormActions($db); - $somethingshown=$formactions->showactions($object,'project',$socid); + if (!empty($object->id)) + { + // List of actions on element + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; + $formactions=new FormActions($db); + $somethingshown=$formactions->showactions($object,'project',$socid); + } print ''; }