mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-22 10:08:45 +02:00
Customer portal : Fixed regression introduced by r4159. Preferences form in user profile was crashing.
SVN:trunk[4166]
This commit is contained in:
@@ -61,6 +61,10 @@ class UserProfileBrickController extends BrickController
|
||||
|
||||
$aData = array();
|
||||
|
||||
// Setting form mode regarding the demo mode parameter
|
||||
$bDemoMode = MetaModel::GetConfig()->Get('demo_mode');
|
||||
$sFormMode = ($bDemoMode) ? ObjectController::ENUM_MODE_VIEW : ObjectController::ENUM_MODE_EDIT;
|
||||
|
||||
// If this is ajax call, we are just submiting preferences or password forms
|
||||
if ($oRequest->isXmlHttpRequest())
|
||||
{
|
||||
@@ -68,7 +72,7 @@ class UserProfileBrickController extends BrickController
|
||||
$sFormType = $aCurrentValues['form_type'];
|
||||
if ($sFormType === PreferencesFormManager::FORM_TYPE)
|
||||
{
|
||||
$aData['form'] = $this->HandlePreferencesForm($oRequest, $oApp);
|
||||
$aData['form'] = $this->HandlePreferencesForm($oRequest, $oApp, $sFormMode);
|
||||
}
|
||||
elseif ($sFormType === PasswordFormManager::FORM_TYPE)
|
||||
{
|
||||
@@ -88,10 +92,6 @@ class UserProfileBrickController extends BrickController
|
||||
$sCurContactClass = get_class($oCurContact);
|
||||
$sCurContactId = $oCurContact->GetKey();
|
||||
|
||||
// Setting form mode regarding the demo mode parameter
|
||||
$bDemoMode = MetaModel::GetConfig()->Get('demo_mode');
|
||||
$sFormMode = ($bDemoMode) ? ObjectController::ENUM_MODE_VIEW : ObjectController::ENUM_MODE_EDIT;
|
||||
|
||||
// Preparing forms
|
||||
$aData['forms']['contact'] = ObjectController::HandleForm($oRequest, $oApp, $sFormMode, $sCurContactClass, $sCurContactId, $oBrick->GetForm());
|
||||
$aData['forms']['preferences'] = $this->HandlePreferencesForm($oRequest, $oApp, $sFormMode);
|
||||
|
||||
Reference in New Issue
Block a user