Kaynağa Gözat

Customer portal : Manage Brick : Edit action hyperlink is now setted on the first column if there is no friendlyname. Until now, if no friendlyname was available on the object class, there was no was of editing the object.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4171 a333f486-631f-4898-b8df-5754b55c2be0
glajarige 9 yıl önce
ebeveyn
işleme
eef4d199a7

+ 6 - 2
datamodels/2.x/itop-portal-base/portal/src/controllers/managebrickcontroller.class.inc.php

@@ -313,6 +313,9 @@ class ManageBrickController extends BrickController
 			{
 				$aColumnsAttrs = array_merge(array($sTitleAttrCode), $aColumnsAttrs);
 			}
+			// Defining which attribute will open the edition form)
+			$sMainActionAttrCode = $aColumnsAttrs[0];
+
 			// Loading columns definition
 			$aColumnsDefinition = array();
 			foreach ($aColumnsAttrs as $sColumnAttr)
@@ -334,8 +337,9 @@ class ManageBrickController extends BrickController
 				foreach ($aColumnsAttrs as $sItemAttr)
 				{
 					$aActions = array();
-					// Set the edit action to the main attribute only
-					if ($sItemAttr === $sTitleAttrCode)
+					// Set the edit action to the main (first) attribute only
+					//if ($sItemAttr === $sTitleAttrCode)
+					if ($sItemAttr === $sMainActionAttrCode)
 					{
 						$aActions[] = array(
 							'type' => ManageBrick::ENUM_ACTION_EDIT,