[ bug #865 ] Dolibarr navigation array in project/task do not work

Conflicts:
	htdocs/projet/fiche.php

Change-Id: I7607f97d21cc695c9b295d94f5abcb64fe25f3af
This commit is contained in:
fhenry 2013-04-30 18:23:44 +02:00 committed by Regis Houssin
parent 8a266058c1
commit 0b8d78c4f6
2 changed files with 17 additions and 13 deletions

View File

@ -36,6 +36,7 @@ class Project extends CommonObject
public $table_element = 'projet'; //!< Name of table without prefix where object is stored public $table_element = 'projet'; //!< Name of table without prefix where object is stored
public $table_element_line = 'projet_task'; public $table_element_line = 'projet_task';
public $fk_element = 'fk_projet'; 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 $id;
var $ref; var $ref;
@ -53,6 +54,7 @@ class Project extends CommonObject
var $statuts; var $statuts;
var $oldcopy; var $oldcopy;
/** /**
* Constructor * Constructor
* *

View File

@ -44,12 +44,6 @@ if ($id == '' && $ref == '' && ($action != "create" && $action != "add" && $acti
$mine = GETPOST('mode')=='mine' ? 1 : 0; $mine = GETPOST('mode')=='mine' ? 1 : 0;
//if (! $user->rights->projet->all->lire) $mine=1; // Special for projects //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 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('projectcard')); $hookmanager->initHooks(array('projectcard'));
@ -61,6 +55,11 @@ if ($object->id > 0)
$object->fetch_thirdparty(); $object->fetch_thirdparty();
} }
// Security check
$socid=0;
if ($user->societe_id > 0) $socid=$user->societe_id;
$result = restrictedArea($user, 'projet', $object->id);
// fetch optionals attributes and labels // fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
@ -741,10 +740,13 @@ else
print '</td><td valign="top" width="50%">'; print '</td><td valign="top" width="50%">';
// List of actions on element if (!empty($object->id))
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; {
$formactions=new FormActions($db); // List of actions on element
$somethingshown=$formactions->showactions($object,'project',$socid); include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'project',$socid);
}
print '</td></tr></table>'; print '</td></tr></table>';
} }