www/app/components/user/controllers/userProfileController.js
/**
     * @desc Controllers of ProvisionalPlans
     * @namespace UserProfileController
     * @memberOf Controllers
     */
@desc Controllers of ProvisionalPlans
@namespace UserProfileController
@memberOf Controllers
@desc Controllers of ProvisionalPlans @namespace UserProfileController @memberOf Controllers
function UserProfileController($rootScope, $scope, $state, authenticateWebApi, toastr, $modal) {
        (function init() {
            defineScope();
            defineListeners();
        })();
        function defineScope() {
            $scope.userInput = {
                changePassword: {
                    holdPassword: '',
                    newPassword: '',
                    passwordConfirm: ''
                }
            };
        }
        function defineListeners() {
            $scope.changePassword = _changePassword;
        }
        function _changePassword() {
            var confirmActionModalOpts = {
                templateUrl: 'views/partials/user.profil.changePassword', 
                controller: 'userProfileChangePasswordController'
            };
            var modalInstance = $modal.open(confirmActionModalOpts);
            modalInstance.result.then(function () {
                _displaySuccessMessage('Changement de mot de passe effectué avec succès.');
            }, function (result) {
                if (result.canceled) {
                    toastr.warning('Changement de mot de passe annulé.');
                    neogenz.utilities.log.logDebug(
                        'userProfileController.js',
                        '_changePassword()',
                        'Changement de mot de passe échoué : ' + result.message);
                } else {
                    toastr.error('Changement de mot de passe échoué.');
                    neogenz.utilities.log.logError('userProfileController.js',
                        '_changePassword()',
                        'Changement de mot de passe échoué : ' + result.message);
                }
            });
        }
        function _displaySuccessMessage(successMessage) {
            if (neogenz.utilities.isUndefinedOrNull(successMessage)) {
                throw new Error('successMessage to display in null or undefined.');
            }
            toastr.success(successMessage);
        }
    }
function UserProfileController ( $rootScope , $scope , $state , authenticateWebApi , toastr , $modal ) { ( function init ( ) { defineScope ( ) ; defineListeners ( ) ; } ) ( ) ; function defineScope ( ) { $scope . userInput = { changePassword : { holdPassword : '' , newPassword : '' , passwordConfirm : '' } } ; } function defineListeners ( ) { $scope . changePassword = _changePassword ; } function _changePassword ( ) { var confirmActionModalOpts = { templateUrl : 'views/partials/user.profil.changePassword' , controller : 'userProfileChangePasswordController' } ; var modalInstance = $modal . open ( confirmActionModalOpts ) ; modalInstance . result . then ( function ( ) { _displaySuccessMessage ( 'Changement de mot de passe effectué avec succès.'); } , function ( result ) { if ( result . canceled ) { toastr . warning ( 'Changement de mot de passe annulé.') ; neogenz . utilities . log . logDebug ( 'userProfileController.js' , '_changePassword()' , 'Changement de mot de passe échoué : ' + r sult.m e ssage); } else { toastr . error ( 'Changement de mot de passe échoué.'); neogenz . utilities . log . logError ( 'userProfileController.js' , '_changePassword()' , 'Changement de mot de passe échoué : ' + r sult.m e ssage); } } ) ; } function _displaySuccessMessage ( successMessage ) { if ( neogenz . utilities . isUndefinedOrNull ( successMessage ) ) { throw new Error ( 'successMessage to display in null or undefined.' ) ; } toastr . success ( successMessage ) ; } }
@desc Controllers of ProvisionalPlans
 @namespace UserProfileController
 @memberOf Controllers
@desc Controllers of ProvisionalPlans @namespace UserProfileController @memberOf Controllers
/**
         * @desc Defines all $scope variables
         * @function defineScope
         * @memberOf Controllers.UserProfileController
         */ /**
         * @desc Attach view listeners to this controller
         * @function defineListeners
         * @memberOf Controllers.UserProfileController
         */ /**
         * @desc Open modal view with the form
         * @function _changePassword
         * @param {bool} formIsValid Passed from view, is a valid form angular boolean
         * @memberOf Controllers.UserProfileController
         */ // Url du template HTML /*resolve: {
                 confirmationMessage: function () {
                 return $scope.confirmationMessage;
                 }
                 }*/ /**
         * @desc Display an toastr.success message passed from parameter.
         *       This function is generally used to callback.
         * @function _displaySuccessMessage
         * @param {string} successMessage Success message to display
         * @memberOf Controllers.UserProfileController
         */