diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index f0154fef7..ef99c2e75 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -1799,7 +1799,7 @@ EOF return $oObj->DisplayModifyForm( $oPage, $aExtraParams); } - protected static function ProcessZlist($aList, $aDetails, $sCurrentTab, $sCurrentCol, $sCurrentSet) + public static function ProcessZlist($aList, $aDetails, $sCurrentTab, $sCurrentCol, $sCurrentSet) { //echo "
ZList: ";
 		//print_r($aList);
diff --git a/modules/itop-request-mgmt-1.0.0/model.itop-request-mgmt.php b/modules/itop-request-mgmt-1.0.0/model.itop-request-mgmt.php
index 74aac9a4b..8fc323efc 100644
--- a/modules/itop-request-mgmt-1.0.0/model.itop-request-mgmt.php
+++ b/modules/itop-request-mgmt-1.0.0/model.itop-request-mgmt.php
@@ -50,7 +50,7 @@ class UserRequest extends ResponseTicket
 
 		MetaModel::Init_SetZListItems('details', array('document_list', 'ci_list', 'contact_list','incident_list',
 			'col:col1' => array(
-				'fieldset:Ticket:baseinfo' => array('ref','title','org_id','status','priority','service_id','servicesubcategory_id','product' ),
+				'fieldset:Ticket:baseinfo' => array('ref','title','org_id','status','priority','request_type','service_id','servicesubcategory_id','product' ),
 				'fieldset:Ticket:moreinfo' => array('impact','urgency','description','resolution_code', 'solution', 'user_satisfaction', 'user_commment','freeze_reason'),
 				),
 			'col:col2' => array(
diff --git a/portal/index.php b/portal/index.php
index 6e2f66e37..b795175d9 100644
--- a/portal/index.php
+++ b/portal/index.php
@@ -550,23 +550,99 @@ function ListResolvedRequests(WebPage $oP)
  */
 function DisplayRequestDetails($oP, UserRequest $oRequest)
 {
-	$aList = array('ref', 'status', 'title', 'description', 'request_type','ticket_log', 'start_date', 'tto_escalation_deadline', 'ttr_escalation_deadline', 'caller_id', 'service_id', 'servicesubcategory_id', 'product', 'impact', 'urgency', 'priority', 'workgroup_id', 'agent_id', 'related_problem_id', 'related_change_id', 'close_date', 'last_update', 'assignment_date', 'closure_deadline', 'resolution_code', 'solution', 'user_satisfaction', 'user_commment', 'freeze_reason');
+	// Identical to the standard 'details' ZList of UserRequest, except that the field 'org_id' has been removed
+	$aList = array(
+		'col:col1' => array(
+			'fieldset:Ticket:baseinfo' => array('ref','title','request_type','status','priority','service_id','servicesubcategory_id','product' ),
+			'fieldset:Ticket:moreinfo' => array('impact','urgency','description','resolution_code', 'solution', 'user_satisfaction', 'user_commment','freeze_reason'),
+			),
+		'col:col2' => array(
+			'fieldset:Ticket:date' => array('start_date','last_update','assignment_date','tto_escalation_deadline', 'ttr_escalation_deadline', 'close_date',  'closure_deadline',),
+			'fieldset:Ticket:contact' => array('caller_id','workgroup_id','agent_id',),
+			'fieldset:Ticket:relation' => array('related_problem_id', 'related_change_id'),
+			)
+
+	);
+
+	// Similar to CMDBAbstractObject::GetBareProperties except that: multiple tabs are not supported and GetFieldAsHtml is customized
+	// in order to NOT display any hyperlink
 	$aDetails = array();
-	foreach($aList as $sAttCode)
-	{
-		$iFlags = $oRequest->GetAttributeFlags($sAttCode);
-		$oAttDef = MetaModel::GetAttributeDef(get_class($oRequest), $sAttCode);
-		if ( (!$oAttDef->IsLinkSet()) && (($iFlags & OPT_ATT_HIDDEN) == 0) )
-		{
-			// Don't display linked set and non-visible attributes (in this state)
-			$sDisplayValue = GetFieldAsHtml($oRequest, $sAttCode);
-			$aDetails[] = array('label' => ''.MetaModel::GetLabel('UserRequest', $sAttCode).'', 'value' => $sDisplayValue);
-		}
-	}
 	$oP->add('
'); + + $aDetailsStruct = CMDBAbstractObject::ProcessZlist($aList, array('UI:PropertiesTab' => array()), 'UI:PropertiesTab', 'col1', ''); + // Compute the list of properties to display, first the attributes in the 'details' list, then + // all the remaining attributes that are not external fields + $aDetails = array(); + $iInputId = 0; + foreach($aDetailsStruct as $sTab => $aCols ) + { + $aDetails[$sTab] = array(); + ksort($aCols); + $oP->add(''); + foreach($aCols as $sColIndex => $aFieldsets) + { + $oP->add(''); + } + $oP->add('
'); + //$aDetails[$sTab][$sColIndex] = array(); + $sLabel = ''; + $sPreviousLabel = ''; + $aDetails[$sTab][$sColIndex] = array(); + foreach($aFieldsets as $sFieldsetName => $aFields) + { + if (!empty($sFieldsetName) && ($sFieldsetName[0] != '_')) + { + $sLabel = $sFieldsetName; + } + else + { + $sLabel = ''; + } + if ($sLabel != $sPreviousLabel) + { + if (!empty($sPreviousLabel)) + { + $oP->add('
'); + $oP->add(''.Dict::S($sPreviousLabel).''); + } + $oP->Details($aDetails[$sTab][$sColIndex]); + if (!empty($sPreviousLabel)) + { + $oP->add('
'); + } + $aDetails[$sTab][$sColIndex] = array(); + $sPreviousLabel = $sLabel; + } + foreach($aFields as $sAttCode) + { + $iFlags = $oRequest->GetAttributeFlags($sAttCode); + if ( ($iFlags & OPT_ATT_HIDDEN) == 0) + { + // The field is visible, add it to the current column + $val = GetFieldAsHtml($oRequest, $sAttCode); + $aDetails[$sTab][$sColIndex][] = array( 'label' => ''.MetaModel::GetLabel('UserRequest', $sAttCode).'', 'value' => $val); + $iInputId++; + } + } + } + if (!empty($sPreviousLabel)) + { + $oP->add('
'); + $oP->add(''.Dict::S($sFieldsetName).''); + } + $oP->Details($aDetails[$sTab][$sColIndex]); + if (!empty($sPreviousLabel)) + { + $oP->add('
'); + } + $oP->add('
'); + } + + // Attachments $sOQL = 'SELECT FileDoc AS Doc JOIN lnkTicketToDoc AS L ON L.document_id = Doc.id WHERE L.ticket_id = :request_id'; $oSearch = DBObjectSearch::FromOQL($sOQL); $oSet = new CMDBObjectSet($oSearch, array(), array('request_id' => $oRequest->GetKey())); + $aDetails = array(); if ($oSet->Count() > 0) { $sAttachements = ''; @@ -577,7 +653,12 @@ function DisplayRequestDetails($oP, UserRequest $oRequest) $sAttachements .= '
'; $aDetails[] = array('label' => Dict::S('Portal:Attachments'), 'value' => $sAttachements); } - $oP->details($aDetails); + $oP->Details($aDetails); + + // Case log + $oP->add('
'.MetaModel::GetLabel('UserRequest', 'ticket_log').''); + $oP->add(GetFieldAsHtml($oRequest, 'ticket_log')); + $oP->add('
'); $oP->add('
'); } diff --git a/portal/portal.css b/portal/portal.css index c93e54970..ff38a6c58 100644 --- a/portal/portal.css +++ b/portal/portal.css @@ -111,6 +111,8 @@ a.button span { } #request_details { display: inline-block; + width:800px; + text-align: left; } #request_details table { border: #f1f1f6 2px solid;