Fix project into dol_banner

This commit is contained in:
Laurent Destailleur 2016-12-10 20:00:07 +01:00
parent 518049bed4
commit 653eb4d907
3 changed files with 14 additions and 8 deletions

View File

@ -75,13 +75,16 @@ function fichinter_prepare_head($object)
require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
$nbResource = 0; $nbResource = 0;
$objectres=new Dolresource($db); $objectres=new Dolresource($db);
foreach ($objectres->available_resources as $modresources => $resources) if (is_array($objectres->available_resources))
{ {
$resources=(array) $resources; // To be sure $resources is an array foreach ($objectres->available_resources as $modresources => $resources)
foreach($resources as $resource_obj)
{ {
$linked_resources = $object->getElementResources('fichinter',$object->id,$resource_obj); $resources=(array) $resources; // To be sure $resources is an array
foreach($resources as $resource_obj)
{
$linked_resources = $object->getElementResources('fichinter',$object->id,$resource_obj);
}
} }
} }

View File

@ -1203,7 +1203,7 @@ else if ($id > 0 || ! empty($ref))
{ {
$langs->load("projects"); $langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->commande->creer) if ($user->rights->ficheinter->creer)
{ {
if ($action != 'classify') if ($action != 'classify')
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; $morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';

View File

@ -28,6 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$langs->load("interventions"); $langs->load("interventions");
$langs->load("sendings"); $langs->load("sendings");
@ -105,6 +107,7 @@ $form = new Form($db);
$formcompany = new FormCompany($db); $formcompany = new FormCompany($db);
$contactstatic=new Contact($db); $contactstatic=new Contact($db);
$userstatic=new User($db); $userstatic=new User($db);
$formproject=new FormProjets($db);
llxHeader('',$langs->trans("Intervention")); llxHeader('',$langs->trans("Intervention"));
@ -133,7 +136,7 @@ if ($id > 0 || ! empty($ref))
{ {
$langs->load("projects"); $langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' '; $morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->commande->creer) if ($user->rights->ficheinter->creer)
{ {
if ($action != 'classify') if ($action != 'classify')
//$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; //$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';