diff --git a/approot.inc.php b/approot.inc.php index 6caae3533..86d523b0b 100644 --- a/approot.inc.php +++ b/approot.inc.php @@ -1,3 +1,11 @@ diff --git a/core/kpi.class.inc.php b/core/kpi.class.inc.php index 64aa10b28..a9c129941 100644 --- a/core/kpi.class.inc.php +++ b/core/kpi.class.inc.php @@ -193,4 +193,13 @@ class ExecutionKPI } } +class ApplicationStartupKPI extends ExecutionKPI +{ + public function __construct() + { + global $fItopStarted; + $this->m_fStarted = $fItopStarted; + } +} + ?> diff --git a/pages/UI.php b/pages/UI.php index 4088aba1c..ecb4f5d03 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -456,6 +456,9 @@ try require_once(APPROOT.'/application/startup.inc.php'); $operation = utils::ReadParam('operation', ''); + $oKPI = new ApplicationStartupKPI(); + $oKPI->ComputeAndReport('Load of data model and all includes'); + $oKPI = new ExecutionKPI(); require_once(APPROOT.'/application/loginwebpage.class.inc.php'); diff --git a/test/benchmark.php b/test/benchmark.php index 9214811a8..1d122763a 100644 --- a/test/benchmark.php +++ b/test/benchmark.php @@ -143,6 +143,13 @@ class BenchmarkDataCreation $oMyObject = MetaModel::NewObject($sClass); foreach($aData as $sProp => $value) { + if (is_array($value)) + { + // transform into a link set + $sCSVSpec = implode('|', $value); + $oAttDef = MetaModel::GetAttributeDef($sClass, $sProp); + $value = $oAttDef->MakeValueFromString($sCSVSpec, $sSepItem = '|', $sSepAttribute = ';', $sSepValue = ':', $sAttributeQualifier = '"'); + } $oMyObject->Set($sProp, $value); } @@ -295,18 +302,10 @@ class BenchmarkDataCreation 'login' => 'guru', 'password' => 'guru', 'language' => 'EN US', + 'profile_list' => array("profileid:$iGuruProfile;reason:he is the one"), ); $iLogin = $this->CreateObject('UserLocal', $aData); - // Assign the guru profile to the new login - // - $aData = array( - 'userid' => $iLogin, - 'profileid' => $iGuruProfile, - 'reason' => 'he is the one', - ); - $this->CreateObject('URP_UserProfile', $aData); - //////////////////////////////////////// // User login having all std profiles // @@ -318,26 +317,21 @@ class BenchmarkDataCreation 'email' => 'foo@combodo.com', ); $iPerson = $this->CreateObject('Person', $aData); + + $aProfileSet = array(); + foreach($aStdProfiles as $iProfileId) + { + $aProfileSet[] = "profileid:$iProfileId;reason:xxx"; + } $aData = array( 'contactid' => $iPerson, 'login' => 'foo', 'password' => 'foo', 'language' => 'EN US', + 'profile_list' => $aProfileSet, ); $iLogin = $this->CreateObject('UserLocal', $aData); - // Assign profiles to the new login - // - foreach($aStdProfiles as $iProfileId) - { - $aData = array( - 'userid' => $iLogin, - 'profileid' => $iProfileId, - 'reason' => '', - ); - $this->CreateObject('URP_UserProfile', $aData); - } - ///////////////////////// // // Organizations