Selaa lähdekoodia

Bug fix: support the display of HTML fields in the lists in the new portal.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4324 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 8 vuotta sitten
vanhempi
commit
ca6fd49b80

+ 3 - 3
datamodels/2.x/itop-portal-base/portal/src/controllers/browsebrickcontroller.class.inc.php

@@ -545,7 +545,7 @@ class BrowseBrickController extends BrickController
 			$aRow[$key] = array(
 				'level_alias' => $key,
 				'id' => $value->GetKey(),
-				'name' => $value->Get($aLevelsProperties[$key]['name_att']),
+				'name' => $value->GetAsHTML($aLevelsProperties[$key]['name_att']),
 				'class' => get_class($value),
 				'action_rules_token' => static::PrepareActionRulesForItem($value, $key, $aLevelsProperties)
 			);
@@ -561,7 +561,7 @@ class BrowseBrickController extends BrickController
 				$aRow[$key]['fields'] = array();
 				foreach ($aLevelsProperties[$key]['fields'] as $aField)
 				{
-					$aRow[$key]['fields'][$aField['code']] = $value->Get($aField['code']);
+					$aRow[$key]['fields'][$aField['code']] = $value->GetAsHTML($aField['code']);
 				}
 			}
 		}
@@ -610,7 +610,7 @@ class BrowseBrickController extends BrickController
 			$aItems[$sCurrentIndex] = array(
 				'level_alias' => $aCurrentRowKeys[0],
 				'id' => $aCurrentRowValues[0]->GetKey(),
-				'name' => $aCurrentRowValues[0]->Get($aLevelsProperties[$aCurrentRowKeys[0]]['name_att']),
+				'name' => $aCurrentRowValues[0]->GetAsHTML($aLevelsProperties[$aCurrentRowKeys[0]]['name_att']),
 				'class' => get_class($aCurrentRowValues[0]),
 				'subitems' => array(),
 				'action_rules_token' => static::PrepareActionRulesForItem($aCurrentRowValues[0], $aCurrentRowKeys[0], $aLevelsProperties)

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

@@ -389,7 +389,7 @@ class ManageBrickController extends BrickController
 					}
 					else
 					{
-						$sValue = $oAttDef->GetValueLabel($oCurrentRow->Get($sItemAttr));
+						$sValue = $oCurrentRow->GetAsHTML($sItemAttr);
 					}
 					unset($oAttDef);
 

+ 2 - 2
datamodels/2.x/itop-portal-base/portal/src/views/bricks/browse/mode_list.html.twig

@@ -73,11 +73,11 @@
 						// For the same reason, tooltip widget is created in "drawCallback" instead of here.
 						if( (data.tooltip !== undefined) && (data.tooltip !== ''))
 						{
-							cellElem.html( $('<span></span>').attr('title', data.tooltip).attr('data-toggle', 'tooltip').text(data.name).prop('outerHTML') );
+							cellElem.html( $('<span></span>').attr('title', data.tooltip).attr('data-toggle', 'tooltip').html(data.name).prop('outerHTML') );
 						}
 						else
 						{
-							cellElem.text(data.name);
+							cellElem.html(data.name);
 						}
 						
 						// Building actions

+ 2 - 2
datamodels/2.x/itop-portal-base/portal/src/views/bricks/manage/layout.html.twig

@@ -103,7 +103,7 @@
 						
 						// Preparing the cell data
 						cellElem = (itemActions.length > 0) ? $('<a></a>') : $('<span></span>');
-						cellElem.text(row.attributes[att_code].value);
+						cellElem.html(row.attributes[att_code].value);
 						// Building actions
 						if(itemActions.length > 0)
 						{
@@ -227,7 +227,7 @@
 				// Note : The '.off()' call is to unbind event from DataTables that where triggered before we could intercept anything
 				$('#table-{{ sAreaId }}_filter input').off().on('keyup', function(){
 					var me = this;
-					
+
 					clearTimeout(oKeyTimeout);
 					oKeyTimeout = setTimeout(function() {
 						oTable{{ sAreaId }}.search(me.value.latinise()).draw();