changing order of modules appearing at the top

Hi,

Tried changing the order of modules at the top using  "Select Module Tabs and Subpanels" but no matter what the old order prevails - 

As you can see I have moved a module called "Purchase Orders" up to #4 on the list but it is not the 4th module on top. Only way we can fix this is by resetting user preferences and then clear cache and reload. Is this a bug? We don't want to reset user preferences mainly because we have about 200 users and we don't want them to have to do this manually and administrators can't do a global reset from my understanding?

  • this is the admin configuration, it only affect new users. In order to make it working for existing users you need to do that in the layout options panel at Advanced tab of each User profile.

    Cheers

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Thanks @Andre! Issue is that we would have to do this manually across 200 users or rely on users to do it themselves both of which don't seem to be feasible options for us.

  • There is an alternative solution:

    • apply the changes in a specific user.
    • fetch from database (user_preferences table) the record containing the change (it is serialized and base64 encoded)
    • write a php script which load the user preference for each user and update it according to the previously configured in that user.

    We had done something similar for Home's dashlets, it works like a charm.

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • I will add that if any user decides to change their menu order within their profile preferences, the global changes by Admin will not apply to them. This is by design.

    .

    CRM Business Consultant

  • The way that Sugar is set up is that if a user has made any changes to their own display module list, that setting will win over the admin setting. Not all users will have done this, but for those that have, they would need to update their own module lists to reflect whatever changes you would want to apply as an admin on their own. If you wanted to force this update on your users then yes, you would need to reset their preferences so that their changes to the module list would get wiped out and the admin settings would prevail. Unfortunately this has the side affect of getting rid of all of their preferences they've set for themselves. Another challenge to this is that you would also have to reset preferences one by one per user as I do not believe there is a mass update process to handle user preference resetting. Something else to keep in mind is that even if you were to apply your module list settings to each user in the system, they could immediately go and change their own module list to whatever they wanted, thus undoing your applied changes.

    While it does not sound like a preferred method for you to ask each user to update their profile to adjust their own display modules, that is likely the best solution here. There is a chance that some users will want that change and some will not. 

    Robert Gonzalez

    Senior Director, Engineering

    Sugar Sell, Sugar Serve, Sugar Mobile

  • Thanks Robert and everyone for your replies.  I'm still stuck though.  Even the suggestion from Andre of making the change within individual users' advanced settings didn't really work. I moved the module up to wherever  it needs to be for a few users individually. But when they refresh their pages they can't see the module without scrolling through the list on the side - it is not in the position defined within their individual record. It might seem like a simple step to complete but we have a big user adoption problem so giving them any excuse for not using the system will only make it worse. I can sort of understand why it doesn't work but can't understand why an enterprise level solution has been designed this way. I do get your point @robert re people having the ability to change their settings again but if they want push the most regularly used module down the list, then that's their problem! My job is to make sure that we make things as easy as possible and I would like to start by making the most frequently used modules quickly accessible which surely isn't too much to ask!

    Anyway, I really appreciate everyone's help here!

  •  - Totally understand the problem that you're facing. 

    I'm not here to talk about the design, but trying to see if there is a way where we can help you. This is a problem that can be solved with a few extra steps. The individual user's advanced setting should work without any issues - not really sure what went wrong for you there. Can you try with logging out and log-in again - to ensure it works? If that works, eventually, the user's session will timeout and the tab order will be reset during their next login attempt or next day.

    As Andre mentioned, The user preferences are stored in the db, in a serialized+base64 encoded format. If a user customizes their tab structure, it will be as part of the "display_tabs" preference. Are you using using Sugar from SugarCloud or On-Premise? Here is a simple script to get you started - This will not wipe out user preferences, but you can just update the display order as needed:

    <?php
    
    // Initial Setup and Iterate through all users
    
    $user = BeanFactory::getBean('Users', '1');
    $tabPrefKey = 'display_tabs';
    
    $tabToMove = 'Purchase_Orders'; // Set the correct module name
    $newPosition = 3; // Index - starts with 0
    
    $tabs = $user->getPreference($tabPrefKey);
    $existingTabIndex = array_search($tabToMove, $tabs);
    if(!empty($existingTabIndex) && count($tabs) > $newPosition) {
        array_splice($tabs, $existingTabIndex, 1);
        array_splice($tabs, $newPosition, 0, $tabToMove);
        $user->setPreference($tabPrefKey, $tabs);
        $user->savePreferencesToDB();
    }

  •   Really appreciate your comments and thanks for sharing the script. We'll give it a go and see where we get to. 
    Thanks!