Merge branch '2014.11' into 2015.11
authorPhilipp Schüle <p.schuele@metaways.de>
Tue, 14 Jun 2016 09:11:59 +0000 (11:11 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 14 Jun 2016 09:11:59 +0000 (11:11 +0200)
1  2 
tine20/Tinebase/js/MainMenu.js

@@@ -97,7 -97,6 +97,7 @@@ Tine.Tinebase.MainMenu = Ext.extend(Ext
      },
      
      getUserActions: function() {
 +
          if (! this.userActions) {
              this.userActions = [
                  this.action_editProfile,
                      this.userActions = this.userActions.concat(this.action_changeUserAccount);
                  }
              }
 +            
 +            var regItems = Ext.ux.ItemRegistry.itemMap['Tine.Tinebase.MainMenu.userActions'] || [];
 +            
 +            Ext.each(regItems, function(reg) {
 +                var addItem = def = reg.item;
 +
 +                this.userActions.push(addItem);
 +            }, this);
          }
          return this.userActions;
      },
  
          this.action_editProfile = new Ext.Action({
              text: _('Edit Profile'),
-             disabled: false,
+             disabled: ! Tine.Tinebase.common.hasRight('manage_own_profile', 'Tinebase'),
              handler: this.onEditProfile,
              iconCls: 'tinebase-accounttype-user'
          });
              params : {
                  method : Ext.isObject(Tine.Setup) ? 'Setup.logout' : 'Tinebase.logout'
              },
 -            callback : function(options, Success, response) {
 +            callback : function(options, success, response) {
                  // clear the authenticated mod_ssl session
                  if (document.all == null) {
                      if (window.crypto && Ext.isFunction(window.crypto.logout)) {
                  } else {
                      document.execCommand('ClearAuthenticationCache');
                  }
 -                // remove the event handler
 -                // the reload() trigers the unload event
 +
 +                // the reload() triggers the unload event
                  var redirect = (Tine.Tinebase.registry.get('redirectUrl'));
                  if (redirect && redirect != '') {
 -                    window.location = Tine.Tinebase.registry.get('redirectUrl');
 +                    Tine.Tinebase.common.reload({
 +                        redirectUrl: Tine.Tinebase.registry.get('redirectUrl')
 +                    });
                  } else {
 -                    window.location.reload();
 +                    // registry is cleared before reload
 +                    Tine.Tinebase.common.reload({});
                  }
              }
          });