Browse Source

Fix project into dol_banner

Laurent Destailleur 8 years ago
parent
commit
653eb4d907
3 changed files with 14 additions and 8 deletions
  1. 9 6
      htdocs/core/lib/fichinter.lib.php
  2. 1 1
      htdocs/fichinter/card.php
  3. 4 1
      htdocs/fichinter/contact.php

+ 9 - 6
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].= ' <span class="badge">'.$nbResource.'</span>';

+ 1 - 1
htdocs/fichinter/card.php

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

+ 4 - 1
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.='<br>'.$langs->trans('Project') . ' ';
-	    if ($user->rights->commande->creer)
+	    if ($user->rights->ficheinter->creer)
 	    {
 	        if ($action != 'classify')
 	            //$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&amp;id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';