Bladeren bron

Integrated the portal with the module to dispatch incidents or user requests

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3124 a333f486-631f-4898-b8df-5754b55c2be0
romainq 11 jaren geleden
bovenliggende
commit
405911d4ce
1 gewijzigde bestanden met toevoegingen van 17 en 1 verwijderingen
  1. 17 1
      portal/index.php

+ 17 - 1
portal/index.php

@@ -915,6 +915,8 @@ function ShowDetailsRequest(WebPage $oP, $oObj)
 			case 'assigned':
 			case 'frozen':
 			case 'pending':
+			case 'dispatched':
+			case 'redispatched':
 			$aEditAtt = array(
 				$sLogAttCode => '????'
 			);
@@ -1146,7 +1148,15 @@ function MakeStimulusForm(WebPage $oP, $oObj, $sStimulusCode, $aEditAtt)
 		$aArgs = array('this' => $oObj, 'formPrefix' => '');
 		$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
 		$sInputId = 'input_'.$sAttCode;
-		$sHTMLValue = "<span id=\"field_{$sStimulusCode}_{$sInputId}\">".cmdbAbstractObject::GetFormElementForField($oP, $sClass, $sAttCode, $oAttDef, $sValue, $sDisplayValue, $sInputId, '', 0 /*$iFlags*/, $aArgs).'</span>';
+		if (($sAttCode == 'user_satisfaction') || ($sAttCode == 'user_comment'))
+		{
+			$iFlags = OPT_ATT_MANDATORY;
+		}
+		else
+		{
+			$iFlags = 0;
+		}
+		$sHTMLValue = "<span id=\"field_{$sStimulusCode}_{$sInputId}\">".cmdbAbstractObject::GetFormElementForField($oP, $sClass, $sAttCode, $oAttDef, $sValue, $sDisplayValue, $sInputId, '', $iFlags, $aArgs).'</span>';
 
 		$oP->add('<h1>'.MetaModel::GetLabel($sClass, $sAttCode).'</h1>');
 		$oP->add($sHTMLValue);
@@ -1176,6 +1186,11 @@ function RunStimulusDialog(sStimulusCode, sTitle, sOkButtonLabel)
 		} },
 		],
 	});
+	// Start the validation
+	CheckFields(sStimulusCode+'_form', false);
+	$('#'+sStimulusCode+'_form').submit( function() {
+		return OnSubmit(sStimulusCode+'_form');
+	});
 }
 EOF
 		);
@@ -1239,6 +1254,7 @@ try
 	LoginWebPage::DoLogin(false /* bMustBeAdmin */, true /* IsAllowedToPortalUsers */); // Check user rights and prompt if needed
 
    ApplicationContext::SetUrlMakerClass('MyPortalURLMaker');
+	ApplicationContext::SetPluginProperty('QueryLocalizerPlugin', 'language_code', UserRights::GetUserLanguage());
 
 	$aClasses = explode(',', MetaModel::GetConfig()->Get('portal_tickets'));
 	$sMainClass = trim(reset($aClasses));