From 653eb4d907d43e81070cfe2f9a8601129a9617ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 10 Dec 2016 20:00:07 +0100 Subject: [PATCH] Fix project into dol_banner --- htdocs/core/lib/fichinter.lib.php | 15 +++++++++------ htdocs/fichinter/card.php | 2 +- htdocs/fichinter/contact.php | 5 ++++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index de7fc01d0ff..964bbe14b2c 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -75,16 +75,19 @@ function fichinter_prepare_head($object) require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; $nbResource = 0; $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($resources as $resource_obj) + foreach ($objectres->available_resources as $modresources => $resources) { - $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); + + } } } - + $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=fichinter&element_id='.$object->id; $head[$h][1] = $langs->trans("Resources"); if ($nbResource > 0) $head[$h][1].= ' '.$nbResource.''; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index d2eb83a720f..fb37a235b37 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1203,7 +1203,7 @@ else if ($id > 0 || ! empty($ref)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($user->rights->commande->creer) + if ($user->rights->ficheinter->creer) { if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php index ab9b15da666..22116857d7f 100644 --- a/htdocs/fichinter/contact.php +++ b/htdocs/fichinter/contact.php @@ -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.'/core/lib/fichinter.lib.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("sendings"); @@ -105,6 +107,7 @@ $form = new Form($db); $formcompany = new FormCompany($db); $contactstatic=new Contact($db); $userstatic=new User($db); +$formproject=new FormProjets($db); llxHeader('',$langs->trans("Intervention")); @@ -133,7 +136,7 @@ if ($id > 0 || ! empty($ref)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($user->rights->commande->creer) + if ($user->rights->ficheinter->creer) { if ($action != 'classify') //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';