Browse Source

- partial implementation of the 1:n links management
- factorization of the code handling itopblock templates

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@232 a333f486-631f-4898-b8df-5754b55c2be0

dflaven 15 years ago
parent
commit
7a986e7376

+ 6 - 1
application/cmdbabstract.class.inc.php

@@ -386,7 +386,7 @@ abstract class cmdbAbstractObject extends CMDBObject
 		if ($bDisplayMenu)
 		{
 			$sColspan = 'colspan="2"';
-			$aMenuExtraParams = array();
+			$aMenuExtraParams = $aExtraParams;
 			if (!empty($sLinkageAttribute))
 			{
 				//$aMenuExtraParams['linkage'] = $sLinkageAttribute;
@@ -725,6 +725,11 @@ abstract class cmdbAbstractObject extends CMDBObject
 							$sHTMLValue .= "<input type=\"hidden\" id=\"$iInputId\" name=\"attr_{$sAttCode}{$sNameSuffix}\" value=\"$value\" />\n";
 							$oPage->add_ready_script("\$('#label_$iInputId').autocomplete('./ajax.render.php', { minChars:3, onItemSelect:selectItem, onFindValue:findValue, formatItem:formatItem, autoFill:true, keyHolder:'#$iInputId', extraParams:{operation:'autocomplete', sclass:'$sClass',attCode:'".$sAttCode."'}});");
 							$oPage->add_ready_script("\$('#label_$iInputId').result( function(event, data, formatted) { if (data) { $('#{$iInputId}').val(data[1]); } } );");
+							// Prepopulate with a default value -- but no display value...
+							//if (!empty($value))
+							//{
+							//	$oPage->add_ready_script("\$('#label_$iInputId').search( 'domino.combodo.com' );");
+							//}
 						}
 						else
 						{

+ 44 - 10
application/displayblock.class.inc.php

@@ -55,11 +55,14 @@ class DisplayBlock
 	{
 		$iStartPos = stripos($sTemplate, '<'.self::TAG_BLOCK.' ',0);
 		$iEndPos = stripos($sTemplate, '</'.self::TAG_BLOCK.'>', $iStartPos); 
+		$iEndTag = stripos($sTemplate, '>', $iStartPos);
+		$aParams = array();
 		
 		if (($iStartPos === false) || ($iEndPos === false)) return null; // invalid template		
-		$sITopBlock = substr($sTemplate,$iStartPos, $iEndPos-$iStartPos);
-		$sITopData = substr($sITopBlock, 1+stripos($sITopBlock, ">"));
-		$sITopTag = substr($sITopBlock, 0, stripos($sITopBlock, ">"));
+		$sITopBlock = substr($sTemplate,$iStartPos, $iEndPos-$iStartPos+strlen('</'.self::TAG_BLOCK.'>'));
+		$sITopData = substr($sTemplate, 1+$iEndTag, $iEndPos - $iEndTag - 1);
+		$sITopTag = substr($sTemplate, $iStartPos + strlen('<'.self::TAG_BLOCK), $iEndTag - $iStartPos - strlen('<'.self::TAG_BLOCK));
+
 		$aMatches = array();
 		$sBlockClass = "DisplayBlock";
 		$bAsynchronous = false;
@@ -88,7 +91,12 @@ class DisplayBlock
 		if (preg_match('/ link_attr="(.*)"/U',$sITopTag, $aMatches))
 		{
 			// The list to display is a list of links to the specified object
-			$aParams['link_attr'] = $aMatches[1]; // Name of the Ext. Key that make this linkage
+			$aParams['link_attr'] = $aMatches[1]; // Name of the Ext. Key that makes this linkage
+		}
+		if (preg_match('/ target_attr="(.*)"/U',$sITopTag, $aMatches))
+		{
+			// The list to display is a list of links to the specified object
+			$aParams['target_attr'] = $aMatches[1]; // Name of the Ext. Key that make this linkage
 		}
 		if (preg_match('/ object_id="(.*)"/U',$sITopTag, $aMatches))
 		{
@@ -97,7 +105,6 @@ class DisplayBlock
 		}
 		// Parameters contains a list of extra parameters for the block
 		// the syntax is param_name1:value1;param_name2:value2;...
-		$aParams = array();
 		if (preg_match('/ parameters="(.*)"/U',$sITopTag, $aMatches))
 		{
 			$sParameters = $aMatches[1];
@@ -120,7 +127,7 @@ class DisplayBlock
 			}
 			if(empty($aParams['target_attr']))
 			{
-				// if 'links' mode is requested the d of the object to link to must be specified
+				// if 'links' mode is requested the id of the object to link to must be specified
 				throw new ApplicationException("Parameter target_attr is mandatory when link_attr is specified. Check the definition of the display template.");
 			}
 
@@ -291,7 +298,21 @@ class DisplayBlock
 					{
 						$oAppContext = new ApplicationContext();
 						$sParams = $oAppContext->GetForLink();
-						$sHtml .= $oPage->GetP("<a href=\"./UI.php?operation=new&class=$sClass&$sParams\">Click here to create a new ".Metamodel::GetName($sClass)."</a>\n");
+						// 1:n links, populate the target object as a default value when creating a new linked object
+						if (isset($aExtraParams['target_attr']))
+						{
+							$aExtraParams['default'][$aExtraParams['target_attr']] = $aExtraParams['object_id'];
+						}
+						$sDefault = '';
+						if (!empty($aExtraParams['default']))
+						{
+							foreach($aExtraParams['default'] as $sKey => $sValue)
+							{
+								$sDefault.= "&default[$sKey]=$sValue";
+							}
+						}
+						
+						$sHtml .= $oPage->GetP("<a href=\"./UI.php?operation=new&class=$sClass&$sParams{$sDefault}\">Click here to create a new ".Metamodel::GetName($sClass)."</a>\n");
 					}
 				}
 			}
@@ -678,12 +699,25 @@ class MenuBlock extends DisplayBlock
 		$sFilter = $this->m_oFilter->serialize();
 		$aActions = array();
 		$sUIPage = cmdbAbstractObject::ComputeUIPage($sClass);
+		// 1:n links, populate the target object as a default value when creating a new linked object
+		if (isset($aExtraParams['target_attr']))
+		{
+			$aExtraParams['default'][$aExtraParams['target_attr']] = $aExtraParams['object_id'];
+		}
+		$sDefault = '';
+		if (!empty($aExtraParams['default']))
+		{
+			foreach($aExtraParams['default'] as $sKey => $sValue)
+			{
+				$sDefault.= "&default[$sKey]=$sValue";
+			}
+		}
 		switch($oSet->Count())
 		{
 			case 0:
 			// No object in the set, the only possible action is "new"
 			$bIsModifyAllowed = UserRights::IsActionAllowed($sClass, UR_ACTION_MODIFY);
-			if ($bIsModifyAllowed) { $aActions[] = array ('label' => 'New', 'url' => "../page/$sUIPage?operation=new&class=$sClass&$sContext"); }
+			if ($bIsModifyAllowed) { $aActions[] = array ('label' => 'New', 'url' => "../page/$sUIPage?operation=new&class=$sClass&$sContext{$sDefault}"); }
 			break;
 			
 			case 1:
@@ -710,7 +744,7 @@ class MenuBlock extends DisplayBlock
 				$aActions[] = array ('label' => 'eMail', 'url' => "mailto:?subject=".$oSet->GetFilter()->__DescribeHTML()."&body=".urlencode("$sUrl?operation=search&filter=$sFilter&$sContext"));
 				$aActions[] = array ('label' => 'CSV Export', 'url' => "../pages/$sUIPage?operation=search&filter=$sFilter&format=csv&$sContext");
 				//$aActions[] = array ('label' => 'Bookmark...', 'url' => "../pages/ajax.render.php?operation=create&class=$sClass&filter=$sFilter", 'class' => 'jqmTrigger');
-				if ($bIsModifyAllowed) { $aActions[] = array ('label' => 'New...', 'url' => "../pages/$sUIPage?operation=new&class=$sClass&$sContext"); }
+				if ($bIsModifyAllowed) { $aActions[] = array ('label' => 'New...', 'url' => "../pages/$sUIPage?operation=new&class=$sClass&$sContext{$sDefault}"); }
 				//if ($bIsModifyAllowed) { $aActions[] = array ('label' => 'Clone...', 'url' => "../pages/$sUIPage?operation=clone&class=$sClass&id=$id&$sContext"); }
 				if ($bIsModifyAllowed) { $aActions[] = array ('label' => 'Modify...', 'url' => "../pages/$sUIPage?operation=modify&class=$sClass&id=$id&$sContext"); }
 				if ($bIsDeleteAllowed) { $aActions[] = array ('label' => 'Delete...', 'url' => "../pages/$sUIPage?operation=delete&class=$sClass&id=$id&$sContext"); }
@@ -762,7 +796,7 @@ class MenuBlock extends DisplayBlock
 				$aActions[] = array ('label' => 'eMail', 'url' => "mailto:?subject=".$oSet->GetFilter()->__DescribeHTML()."&body=".urlencode("$sUrl?operation=search&filter=$sFilter&$sContext"));
 				$aActions[] = array ('label' => 'CSV Export', 'url' => "../pages/$sUIPage?operation=search&filter=$sFilter&format=csv&$sContext");
 				//$aActions[] = array ('label' => 'Bookmark...', 'url' => "../pages/ajax.render.php?operation=create&class=$sClass&filter=$sFilter", 'class' => 'jqmTrigger');
-				if ($bIsModifyAllowed) { $aActions[] = array ('label' => 'New...', 'url' => "../pages/$sUIPage?operation=new&class=$sClass&$sContext"); }
+				if ($bIsModifyAllowed) { $aActions[] = array ('label' => 'New...', 'url' => "../pages/$sUIPage?operation=new&class=$sClass&$sContext{$sDefault}"); }
 				//if ($bIsBulkModifyAllowed) { $aActions[] = array ('label' => 'Modify All...', 'url' => "../pages/$sUIPage?operation=modify_all&filter=$sFilter&$sContext"); }
 				//if ($bIsBulkDeleteAllowed) { $aActions[] = array ('label' => 'Delete All...', 'url' => "../pages/$sUIPage?operation=delete_all&filter=$sFilter&$sContext"); }
 			}

+ 23 - 47
application/template.class.inc.php

@@ -7,6 +7,7 @@ class DisplayTemplate
 {
 	protected $m_sTemplate;
 	protected $m_aTags;
+	static protected $iBlockCount = 0;
 	
 	public function __construct($sTemplate)
 	{
@@ -25,17 +26,31 @@ class DisplayTemplate
 		while($sTag = $this->GetNextTag($iStart, $iEnd))
 		{
 			$sContent = $this->GetTagContent($sTag, $iStart, $iEnd);
-			$aAttributes = $this->GetTagAttributes($sTag, $iStart, $iEnd);
-			//$oPage->p("Tag: $sTag - ($iStart, $iEnd)");
+			$iAfterTagPos = $iEnd + strlen('</'.$sTag.'>');
+			$sOuterTag = substr($this->m_sTemplate, $iStart, $iAfterTagPos - $iStart);
 			$oPage->add(substr($this->m_sTemplate, $iBeforeTagPos, $iStart - $iBeforeTagPos));
-			$this->RenderTag($oPage, $sTag, $aAttributes, $sContent);
-
+			if ($sTag == DisplayBlock::TAG_BLOCK)
+			{
+				$oBlock = DisplayBlock::FromTemplate($sOuterTag);
+				if (is_object($oBlock))
+				{
+					$oBlock->Display($oPage, 'block_'.self::$iBlockCount);
+				}
+				self::$iBlockCount++;
+			}
+			else
+			{
+				$aAttributes = $this->GetTagAttributes($sTag, $iStart, $iEnd);
+				//$oPage->p("Tag: $sTag - ($iStart, $iEnd)");
+				$this->RenderTag($oPage, $sTag, $aAttributes, $sContent);
+	
+			}
 			$iAfterTagPos = $iEnd + strlen('</'.$sTag.'>');
 			$iBeforeTagPos = $iAfterTagPos;
 			$iStart = $iEnd;
 			$iEnd = strlen($this->m_sTemplate); 
 			$iCount++;
-			if ($iCount > 10) break;
+			if ($iCount > 10) break; //@@@ Why ?? Debug ??
 		}
 		$oPage->add(substr($this->m_sTemplate, $iAfterTagPos));
 	}
@@ -105,7 +120,6 @@ class DisplayTemplate
 	protected function RenderTag($oPage, $sTag, $aAttributes, $sContent)
 	{
 		static $iTabContainerCount = 0;
-		static $iBlockCount = 0;
 		switch($sTag)
 		{
 			case 'itoptabs':
@@ -134,46 +148,8 @@ class DisplayTemplate
 				$oPage->EndCollapsibleSection();
 			break;
 			
-			case 'itopblock': // TO DO: Use DisplayBlock::FromTemplate here
-				$sBlockClass = $aAttributes['blockclass'];
-				$sBlockType = $aAttributes['type'];
-				$aExtraParams = array();
-				if (isset($aAttributes['link_attr']))
-				{
-					$aExtraParams['link_attr'] = $aAttributes['link_attr'];
-					// Check that all mandatory parameters are present:
-					if(empty($aAttributes['object_id']))
-					{
-						// if 'links' mode is requested the d of the object to link to must be specified
-						throw new ApplicationException("Parameter object_id is mandatory when link_attr is specified. Check the definition of the display template.");
-					}
-					if(empty($aAttributes['target_attr']))
-					{
-						// if 'links' mode is requested the d of the object to link to must be specified
-						throw new ApplicationException("Parameter target_attr is mandatory when link_attr is specified. Check the definition of the display template.");
-					}
-					$aExtraParams['object_id'] = $aAttributes['object_id'];
-					$aExtraParams['target_attr'] = $aAttributes['target_attr'];
-				}
-
-				switch($aAttributes['encoding'])
-				{
-					case 'text/sibusql':
-					$oFilter = CMDBSearchFilter::FromSibusQL($sContent);
-					break;
-
-					case 'text/oql':
-					$oFilter = CMDBSearchFilter::FromOQL($sContent);
-					break;
-
-					case 'text/serialize':
-					default:
-					$oFilter = CMDBSearchFilter::unserialize($sContent);
-					break;
-				}
-				$oBlock = new $sBlockClass($oFilter, $sBlockType, false, $aExtraParams);
-				$oBlock->Display($oPage, 'block_'.$iBlockCount);
-				$iBlockCount++;
+			case 'itopblock': // No longer used, handled by DisplayBlock::FromTemplate see above
+				$oPage->add("<!-- Application Error: should be handled by DisplayBlock::FromTemplate -->");
 			break;
 			
 			default:
@@ -196,7 +172,7 @@ class DisplayTemplate
 		<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = \'$class$\'</itopblock>
 		</div>
 		<img src="../../images/connect_to_network.png" style="margin-top:-10px; margin-right:10px; float:right">
-		<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/sibusql">bizNetworkDevice: pkey = $pkey$</itopblock>
+		<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/sibusql">bizNetworkDevice: pkey = $pkey$</itopblock>
 		<itoptabs>
 			<itoptab name="Interfaces">
 				<itopblock blockclass="DisplayBlock" type="list" encoding="text/sibusql">bizInterface: device_id = $pkey$</itopblock>

+ 1 - 1
application/templates/audit_category.html

@@ -4,7 +4,7 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../../images/clean.png" style="margin-top:-20px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/sibusql">$class$: pkey = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/sibusql">$class$: pkey = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Rules">
 		<itopblock blockclass="DisplayBlock" type="list" encoding="text/sibusql">AuditRule: category_id = $pkey$</itopblock>

+ 1 - 1
business/templates/Circuits.html

@@ -4,6 +4,6 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/WanLinks.jpg" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/sibusql">$class$: pkey = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/sibusql">$class$: pkey = $pkey$</itopblock>
 <itoptabs>
 </itoptabs>

+ 1 - 1
business/templates/application.html

@@ -4,7 +4,7 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/software.jpg" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/oql">SELECT bizApplication WHERE id = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/oql">SELECT bizApplication WHERE id = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Impacted_Client_Applications">
 		<itopblock blockclass="DisplayBlock" type="links" link_attr="server_id" object_id="$pkey$" target_attr="client_id" encoding="text/oql">SELECT lnkClientServer WHERE server_id = $pkey$</itopblock>

+ 1 - 1
business/templates/change.html

@@ -4,7 +4,7 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/imageChange.gif" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/oql">SELECT $class$ WHERE id = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/oql">SELECT $class$ WHERE id = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Impacted_Infrastructures">
 		<itopblock blockclass="DisplayBlock" type="links" link_attr="ticket_id" object_id="$pkey$" target_attr="infra_id" encoding="text/oql">SELECT lnkInfraChangeTicket WHERE ticket_id = $pkey$</itopblock>

+ 1 - 1
business/templates/contract.html

@@ -4,7 +4,7 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/erwanContracts.jpg" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/oql">SELECT bizContract WHERE id = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/oql">SELECT bizContract WHERE id = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Covered_Infrastructures">
 		<itopblock blockclass="DisplayBlock" type="links" link_attr="contract_id" object_id="$pkey$" target_attr="infra_id" encoding="text/oql">SELECT lnkInfraContract WHERE contract_id = $pkey$</itopblock>

+ 1 - 1
business/templates/default.html

@@ -4,5 +4,5 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/tar.png" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/sibusql">$class$: pkey = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/sibusql">$class$: pkey = $pkey$</itopblock>
 

+ 1 - 1
business/templates/document.html

@@ -4,4 +4,4 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/folder_documents.png" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/oql">SELECT $class$ WHERE id = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/oql">SELECT $class$ WHERE id = $pkey$</itopblock>

+ 1 - 1
business/templates/group.html

@@ -4,7 +4,7 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/tar.png" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/oql">SELECT bizInfraGroup WHERE id = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/oql">SELECT bizInfraGroup WHERE id = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Infrastructures">
 		<itopblock blockclass="DisplayBlock" type="links" link_attr="infra_group_id" object_id="$pkey$" target_attr="infra_id"  encoding="text/oql">SELECT lnkInfraGrouping WHERE infra_group_id = $pkey$</itopblock>

+ 1 - 1
business/templates/interface.html

@@ -4,7 +4,7 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/tar.png" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/oql">SELECT bizInterface WHERE id = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/oql">SELECT bizInterface WHERE id = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Groups">
 		<itopblock blockclass="DisplayBlock" type="links" link_attr="infra_id" object_id="$pkey$" target_attr="infra_group_id" encoding="text/oql">SELECT lnkInfraGrouping WHERE infra_id = $pkey$</itopblock>

+ 1 - 1
business/templates/knownError.html

@@ -3,7 +3,7 @@
 	<h1>$class_name$: <span class="hilite">$name$</span></h1>
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/oql">SELECT bizKnownError WHERE id = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/oql">SELECT bizKnownError WHERE id = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Related_Intrastructures">
 		<itopblock blockclass="DisplayBlock" type="links" link_attr="error_id" object_id="$pkey$" target_attr="infra_id" encoding="text/oql">SELECT lnkInfraError WHERE error_id = $pkey$</itopblock>

+ 2 - 2
business/templates/location.html

@@ -4,10 +4,10 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/starthere.png" style="margin-top:-20px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/oql">SELECT bizLocation WHERE id = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/oql">SELECT bizLocation WHERE id = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Contacts">
-		<itopblock blockclass="DisplayBlock" type="list" encoding="text/oql">SELECT bizContact WHERE location_id = $pkey$</itopblock>
+		<itopblock blockclass="DisplayBlock" type="list" object_id="$pkey$" target_attr="location_id" encoding="text/oql">SELECT bizContact WHERE location_id = $pkey$</itopblock>
 	</itoptab>
 	<itoptab name="Servers">
 		<itopblock blockclass="DisplayBlock" type="list" encoding="text/oql">SELECT bizServer WHERE location_id = $pkey$</itopblock>

+ 1 - 1
business/templates/network.device.html

@@ -4,7 +4,7 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/connect_to_network.png" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/oql">SELECT bizNetworkDevice WHERE id = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/oql">SELECT bizNetworkDevice WHERE id = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Interfaces">
 		<itopblock blockclass="DisplayBlock" type="list" encoding="text/oql" linkage="device_id">SELECT bizInterface WHERE device_id = $pkey$</itopblock>

+ 1 - 1
business/templates/pc.html

@@ -4,7 +4,7 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/laptop_pcmcia.png" style="margin-top:-20px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/oql">SELECT bizPC WHERE id = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/oql">SELECT bizPC WHERE id = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Applications">
 		<itopblock blockclass="DisplayBlock" type="list" encoding="text/oql">SELECT bizApplication WHERE device_id = $pkey$</itopblock>

+ 1 - 1
business/templates/person.html

@@ -4,7 +4,7 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/users2-big.png" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/oql">SELECT bizPerson WHERE id = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/oql">SELECT bizPerson WHERE id = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Teams">
 		<itopblock blockclass="DisplayBlock" type="links" link_attr="contact_id" object_id="$pkey$" target_attr="team_id" encoding="text/oql">SELECT lnkContactTeam WHERE contact_id = $pkey$</itopblock>

+ 3 - 3
business/templates/server.html

@@ -4,7 +4,7 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/network-server.png" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/oql">SELECT bizServer WHERE id = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/oql">SELECT bizServer WHERE id = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Applications">
 		<itopblock blockclass="DisplayBlock" type="list" encoding="text/oql">SELECT bizApplication WHERE device_id = $pkey$</itopblock>
@@ -13,13 +13,13 @@
 		<itopblock blockclass="DisplayBlock" type="list" encoding="text/oql">SELECT bizPatch WHERE device_id = $pkey$</itopblock>
 	</itoptab>
 	<itoptab name="Interfaces">
-		<itopblock blockclass="DisplayBlock" type="list" encoding="text/oql" linkage="device_id">SELECT bizInterface WHERE device_id = $pkey$</itopblock>
+		<itopblock blockclass="DisplayBlock" type="list" encoding="text/oql" object_id="$pkey$" target_attr="device_id">SELECT bizInterface WHERE device_id = $pkey$</itopblock>
 	</itoptab>
 	<itoptab name="Contacts">
 		<itopblock blockclass="DisplayBlock" type="links" link_attr="object_id" object_id="$pkey$" target_attr="contact_id" encoding="text/oql">SELECT lnkContactRealObject WHERE object_id = $pkey$</itopblock>
 	</itoptab>
 		<itoptab name="Incidents">
-		<itopblock blockclass="DisplayBlock" type="links" link_attr="infra_id" object_id="$pkey$" target_attr="ticket_id" encoding="text/sibusql">lnkInfraTicket: infra_id = $pkey$</itopblock>
+		<itopblock blockclass="DisplayBlock" type="links" link_attr="infra_id" object_id="$pkey$" target_attr="ticket_id" encoding="text/oql">SELECT lnkInfraTicket WHERE infra_id = $pkey$</itopblock>
 	</itoptab>
 	<itoptab name="Changes">
 		<itopblock blockclass="DisplayBlock" type="list" encoding="text/sibusql">bizChangeTicket: PKEY IS ticket_id IN (lnkInfraChangeTicket: infra_id = $pkey$)</itopblock>

+ 1 - 1
business/templates/service.html

@@ -4,7 +4,7 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/kservices-big.png" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/sibusql">$class$: pkey = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/sibusql">$class$: pkey = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Contracts">
 		<itopblock blockclass="DisplayBlock" asynchronous="true" type="list" encoding="text/sibusql">bizContract: service_id = $pkey$</itopblock>

+ 1 - 1
business/templates/serviceCall.html

@@ -4,7 +4,7 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/messagebox_warning.png" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/oql">SELECT $class$ WHERE id = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/oql">SELECT $class$ WHERE id = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Impacted_Infrastructures">
 		<itopblock blockclass="DisplayBlock" type="links" link_attr="call_id" object_id="$pkey$" target_attr="infra_id" encoding="text/oql">SELECT lnkInfraCall WHERE call_id = $pkey$</itopblock>

+ 1 - 1
business/templates/serviceRequest.html

@@ -4,7 +4,7 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/erwanContracts.jpg" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/oql">SELECT $class$  WHERE id = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/oql">SELECT $class$  WHERE id = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Service_Items">
 		<itopblock blockclass="DisplayBlock" type="list" encoding="text/oql">SELECT bizServiceItem WHERE request_id = $pkey$</itopblock>

+ 1 - 1
business/templates/software.html

@@ -4,7 +4,7 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/software.jpg" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/sibusql">bizSoftware: pkey = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/sibusql">bizSoftware: pkey = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Installed_Instances">
 		<itopblock blockclass="DisplayBlock" type="list" encoding="text/sibusql">bizApplication: soft_id = $pkey$</itopblock>

+ 1 - 1
business/templates/team.html

@@ -4,7 +4,7 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/users2-big.png" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/oql">SELECT $class$ WHERE id = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/oql">SELECT $class$ WHERE id = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Members">
 		<itopblock blockclass="DisplayBlock" type="links" link_attr="team_id" object_id="$pkey$" target_attr="contact_id" encoding="text/oql">SELECT lnkContactTeam WHERE team_id=$pkey$</itopblock>

+ 1 - 1
business/templates/ticket.html

@@ -4,7 +4,7 @@
 	<itopblock blockclass="HistoryBlock" type="toggle" encoding="text/oql">SELECT CMDBChangeOp WHERE objkey = $pkey$ AND objclass = '$class$'</itopblock>
 </div>
 <img src="../images/messagebox_warning.png" style="margin-top:-10px; margin-right:10px; float:right">
-<itopblock blockclass="DisplayBlock" asynchronous="true" type="bare_details" encoding="text/sibusql">$class$: pkey = $pkey$</itopblock>
+<itopblock blockclass="DisplayBlock" asynchronous="false" type="bare_details" encoding="text/sibusql">$class$: pkey = $pkey$</itopblock>
 <itoptabs>
 	<itoptab name="Impacted_Infrastructures">
 		<itopblock blockclass="DisplayBlock" type="list" link_attr="ticket_id" object_id="$pkey$" target_attr="infra_id" encoding="text/oql">SELECT lnkInfraTicket WHERE ticket_id = $pkey$</itopblock>