diff --git a/datamodels/2.x/itop-portal-base/portal/src/entities/userprofilebrick.class.inc.php b/datamodels/2.x/itop-portal-base/portal/src/entities/userprofilebrick.class.inc.php index bb8bf02064..b988aa7ee5 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/entities/userprofilebrick.class.inc.php +++ b/datamodels/2.x/itop-portal-base/portal/src/entities/userprofilebrick.class.inc.php @@ -1,5 +1,5 @@ 'details', 'layout' => null ); + $this->bShowPictureForm = static::DEFAULT_SHOW_PICTURE_FORM; + $this->bShowPreferencesForm = static::DEFAULT_SHOW_PREFERENCES_FORM; + $this->bShowPasswordForm = static::DEFAULT_SHOW_PASSWORD_FORM; } /** @@ -72,6 +81,60 @@ class UserProfileBrick extends PortalBrick return $this; } + /** + * @return bool + */ + public function GetShowPictureForm() + { + return $this->bShowPictureForm; + } + + /** + * @param $bShowPictureForm + * @return \Combodo\iTop\Portal\Brick\UserProfileBrick + */ + public function SetShowPictureForm($bShowPictureForm) + { + $this->bShowPictureForm = $bShowPictureForm; + return $this; + } + + /** + * @return bool + */ + public function GetShowPreferencesForm() + { + return $this->bShowPreferencesForm; + } + + /** + * @param $bShowPreferencesForm + * @return \Combodo\iTop\Portal\Brick\UserProfileBrick + */ + public function SetShowPreferencesForm($bShowPreferencesForm) + { + $this->bShowPreferencesForm = $bShowPreferencesForm; + return $this; + } + + /** + * @return bool + */ + public function GetShowPasswordForm() + { + return $this->bShowPasswordForm; + } + + /** + * @param $bShowPasswordForm + * @return \Combodo\iTop\Portal\Brick\UserProfileBrick + */ + public function SetShowPasswordForm($bShowPasswordForm) + { + $this->bShowPasswordForm = $bShowPasswordForm; + return $this; + } + /** * Load the brick's data from the xml passed as a ModuleDesignElement. * This is used to set all the brick attributes at once. @@ -121,7 +184,7 @@ class UserProfileBrick extends PortalBrick } else { - throw new DOMFormatException('Field tag must have an id attribute', null, null, $oFormNode); + throw new DOMFormatException('Field tag must have an id attribute', null, null, $oFieldNode); } } } @@ -140,6 +203,16 @@ class UserProfileBrick extends PortalBrick ); } break; + + case 'show_picture_form': + case 'show_preferences_form': + case 'show_password_form': + $sConstName = 'DEFAULT_'.strtoupper($oBrickSubNode->nodeName); + $sSetterName = 'Set'.str_replace('_', '', ucwords($oBrickSubNode->nodeName, '_')); + + $bNodeValue = ($oBrickSubNode->GetText(constant('static::'.$sConstName)) === 'true') ? true : false; + $this->$sSetterName($bNodeValue); + break; } } @@ -147,5 +220,3 @@ class UserProfileBrick extends PortalBrick } } - -?> \ No newline at end of file diff --git a/datamodels/2.x/itop-portal-base/portal/src/views/bricks/user-profile/layout.html.twig b/datamodels/2.x/itop-portal-base/portal/src/views/bricks/user-profile/layout.html.twig index a456b82089..7d844c7d8c 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/views/bricks/user-profile/layout.html.twig +++ b/datamodels/2.x/itop-portal-base/portal/src/views/bricks/user-profile/layout.html.twig @@ -44,85 +44,91 @@