Просмотр исходного кода

Fixed a (post 1.2-beta) regression: bulk modify and bluk apply stimulus were broken.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1483 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 14 лет назад
Родитель
Сommit
6c82e4034e

+ 7 - 4
application/cmdbabstract.class.inc.php

@@ -204,9 +204,9 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
 		$oBlock->Display($oPage, -1);
 	}
 
-	function DisplayBareProperties(WebPage $oPage, $bEditMode = false, $sPrefix = '')
+	function DisplayBareProperties(WebPage $oPage, $bEditMode = false, $sPrefix = '', $aExtraParams = array())
 	{
-		$aFieldsMap = $this->GetBareProperties($oPage, $bEditMode, $sPrefix);		
+		$aFieldsMap = $this->GetBareProperties($oPage, $bEditMode, $sPrefix, $aExtraParams);		
 
 		// Special case to display the case log, if any...
 		// WARNING: if you modify the loop below, also check the corresponding code in UpdateObject and DisplayModifyForm
@@ -384,7 +384,7 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
 		}
 	}
 
-	function GetBareProperties(WebPage $oPage, $bEditMode = false, $sPrefix)
+	function GetBareProperties(WebPage $oPage, $bEditMode = false, $sPrefix, $aExtraParams = array())
 	{
 		$sHtml = '';
 		$oAppContext = new ApplicationContext();	
@@ -399,6 +399,9 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
 		$aDetails = array();
 		$iInputId = 0;
 		$aFieldsMap = array();
+		$aFieldsComments = (isset($aExtraParams['fieldsComments'])) ? $aExtraParams['fieldsComments'] : array();
+		$bFieldComments = (count($aFieldsComments) > 0);
+		
 		foreach($aDetailsStruct as $sTab => $aCols )
 		{
 			$aDetails[$sTab] = array();
@@ -1772,7 +1775,7 @@ EOF
 		$oPage->SetCurrentTabContainer(OBJECT_PROPERTIES_TAB);
 		$oPage->SetCurrentTab(Dict::S('UI:PropertiesTab'));
 
-		$aFieldsMap = $this->DisplayBareProperties($oPage, true, $sPrefix);
+		$aFieldsMap = $this->DisplayBareProperties($oPage, true, $sPrefix, $aExtraParams);
 		// Now display the relations, one tab per relation
 		if (!isset($aExtraParams['noRelations']))
 		{

+ 1 - 1
modules/itop-config-mgmt-1.0.0/model.itop-config-mgmt.php

@@ -357,7 +357,7 @@ class FileDoc extends Document
 	 * Overload the display of the properties to add a tab (the first one)
 	 * with the preview of the document
 	 */
-	public function DisplayBareProperties(WebPage $oPage, $bEditMode = false, $sPrefix = '')
+	public function DisplayBareProperties(WebPage $oPage, $bEditMode = false, $sPrefix = '', $aExtraParams = array())
 	{
 		if (!$bEditMode)
 		{

+ 7 - 7
pages/UI.php

@@ -985,7 +985,7 @@ EOF
 
 		$sClass = utils::ReadParam('class', '', false, 'class');
 		$bPreview = utils::ReadParam('preview_mode', '');
-		$sSelectedObj = utils::ReadParam('selectObj', '');
+		$sSelectedObj = utils::ReadParam('selectObj', '', false, 'raw_data');
 		if ( empty($sClass) || empty($sSelectedObj)) // TO DO: check that the class name is valid !
 		{
 			throw new ApplicationException(Dict::Format('UI:Error:2ParametersMissing', 'class', 'selectObj'));
@@ -1582,9 +1582,9 @@ EOF
 				}
 			}
 			$sButtonsPosition = MetaModel::GetConfig()->Get('buttons_position');
-			if ($sButtonsPosition != 'bottom')
+			if ($sButtonsPosition == 'bottom')
 			{
-				// top or both: Displays the ticket details BEFORE the actions
+				// bottom: Displays the ticket details BEFORE the actions
 				$oP->add('<div class="ui-widget-content">');
 				$oObj->DisplayBareProperties($oP);
 				$oP->add('</div>');
@@ -1608,9 +1608,9 @@ EOF
 			$oP->add("<button type=\"submit\" class=\"action\"><span>$sActionLabel</span></button>\n");
 			$oP->add("</form>\n");
 			$oP->add("</div>\n");
-			if ($sButtonsPosition == 'bottom')
+			if ($sButtonsPosition != 'bottom')
 			{
-				// bottom or both: Displays the ticket details AFTER the actions
+				// top or both: Displays the ticket details AFTER the actions
 				$oP->add('<div class="ui-widget-content">');
 				$oObj->DisplayBareProperties($oP);
 				$oP->add('</div>');
@@ -1638,10 +1638,10 @@ EOF
 		
 		case 'bulk_apply_stimulus':
 		$bPreviewMode = utils::ReadPostedParam('preview_mode', false);
-		$sFilter = utils::ReadPostedParam('filter', '');
+		$sFilter = utils::ReadPostedParam('filter', '', false, 'raw_data');
 		$sStimulus = utils::ReadPostedParam('stimulus', '');
 		$sState = utils::ReadPostedParam('state', '');
-		$sSelectObject = utils::ReadPostedParam('selectObject', '');
+		$sSelectObject = utils::ReadPostedParam('selectObject', '', false, 'raw_data');
 		$aSelectObject = explode(',', $sSelectObject);
 
 		if (empty($sFilter) || empty($sStimulus) || empty($sState))

+ 1 - 1
synchro/synchrodatasource.class.inc.php

@@ -2053,7 +2053,7 @@ class SynchroReplica extends DBObject implements iDisplay
 		$this->DisplayBareProperties($oPage, $bEditMode);
 	}
 	
-	function DisplayBareProperties(WebPage $oPage, $bEditMode = false)
+	function DisplayBareProperties(WebPage $oPage, $bEditMode = false, $aExtraParams = array())
 	{
 		if ($bEditMode) return; // Not editable