Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active module won't display further than nth list options down #2307

Closed
jshwhitlow opened this issue Sep 23, 2016 · 8 comments

Comments

@jshwhitlow
Copy link

commented Sep 23, 2016

Issue (For my instance)

The Active module is displayed as the last module in each group (unless that module is already in the group or its the ALL group) However, if the group contains more than 6 modules it causes an issue because the active module will always display as the 7th module in the list, no matter how many modules are there.

In 7.7.4 of SuiteCRM, the module list was 10 modules down before the problem occurred.

Expected Behavior

The active module should always appear at the end of the list, no matter how many modules are present.

Actual Behavior

The active module will not appear further down than the nth option

Possible Fix

(every theme, not just SuiteR)
The fix has to do with modules/themes/SuiteR/tpls/_headermodulelist.tpl on lines 96-170 (could also be between 96-150 as well) Displayed here is lines 96-170
I added the <script> tags in this example so that you can refresh the page and see where its stopping (make sure you add more than 6 modules into one group). I'm not too knowledgeable with Smarty, but It appears that {$modules.modules} is stopping at the 7th spot and is obtaining that information from the $groupTabs {foreach} item.

{if $USE_GROUP_TABS}
    <ul class="nav navbar-nav">
        {assign var="groupSelected" value=false}
        {foreach from=$moduleTopMenu item=module key=name name=moduleList}
            {if $name == $MODULE_TAB}
                <li class="topnav">
                    {if $name != 'Home'}
                        <span class="currentTabLeft">&nbsp;</span>
                        <span class="currentTab" style="color:#ffffff !important;">{sugar_link id="moduleTab_$name" module=$name data=$module}</span><span>&nbsp;</span>
                    {/if}
                    <ul class="dropdown-menu" role="menu">
                        {if count($shortcutTopMenu.$name) > 0}
                            <h3 class="home_h3">{$APP.LBL_LINK_ACTIONS}</h3>
                            {foreach from=$shortcutTopMenu.$name item=item}
                                {if $item.URL == "-"}
                                    <li><a></a><span>&nbsp;</span></li>
                                {else}
                                    <li><a href="{$item.URL}">{$item.LABEL}</a></li>
                                {/if}
                            {/foreach}
                        {/if}
                        <h3 class="recent_h3">{$APP.LBL_LAST_VIEWED}</h3>
                        {foreach from=$recentRecords item=item name=lastViewed}
                            {if $item.module_name == $name}
                                <div class="recently_viewed_link_container">
                                    <li class="recentlinks_topedit">
                                        <a href="{sugar_link module=$item.module_name action='EditView' record=$item.item_id link_only=1}" style="margin-left:10px;"><span class=" glyphicon glyphicon-pencil" aria-hidden="true"></a>
                                    </li>
                                    <li class="recentlinks_top" role="presentation">
                                        <a title="{$item.module_name}" accessKey="{$smarty.foreach.lastViewed.iteration}" href="{sugar_link module=$item.module_name action='DetailView' record=$item.item_id link_only=1}">{$item.item_summary_short}</a>
                                    </li>
                                </div>
                            {/if}
                            {foreachelse}
                            {$APP.NTC_NO_ITEMS_DISPLAY}
                        {/foreach}
                        <h3 class="recent_h3">{$APP.LBL_FAVORITES}</h3>
                        {foreach from=$favoriteRecords item=item name=lastViewed}
                            {if $item.module_name == $name}
                                <div class="recently_viewed_link_container">
                                    <li class="recentlinks_topedit">
                                        <a href="{sugar_link module=$item.module_name action='EditView' record=$item.id link_only=1}" style="margin-left:10px;"><span class=" glyphicon glyphicon-pencil" aria-hidden="true"></a>
                                    </li>
                                    <li class="recentlinks_top" role="presentation">
                                        <a title="{$item.module_name}" accessKey="{$smarty.foreach.lastViewed.iteration}" href="{sugar_link module=$item.module_name action='DetailView' record=$item.id link_only=1}">{$item.item_summary_short}</a>
                                    </li>
                                </div>
                            {/if}
                            {foreachelse}
                            {$APP.NTC_NO_ITEMS_DISPLAY}
                        {/foreach}
                    </ul>
                </li>
            {/if}
        {/foreach}
        {foreach from=$groupTabs item=modules key=group name=groupList}
            {capture name=extraparams assign=extraparams}parentTab={$group}{/capture}
            <li class="topnav">
                <span class="notCurrentTabLeft">&nbsp;</span><span class="notCurrentTab">
                <a href="#" id="grouptab_{$smarty.foreach.groupList.index}" class="dropdown-toggle" data-toggle="dropdown">{$group}</a>
                <span class="notCurrentTabRight">&nbsp;</span>
                <ul class="dropdown-menu" role="menu" {if $smarty.foreach.groupList.last} class="All"{/if}>
                    {foreach from=$modules.modules item=module key=modulekey name=moduleLoop}
                        <li>
                            <script>console.log('{$group}: {$modules.moduleLoop.index}')</script>
                            {capture name=moduleTabId assign=moduleTabId}moduleTab_{$smarty.foreach.moduleList.index}_{$module}{/capture}
                            {sugar_link id=$moduleTabId module=$modulekey data=$module extraparams=$extraparams}
                        </li>
                    {/foreach}
                    {foreach from=$modules.extra item=submodulename key=submodule}
                        <li><a href="{sugar_link module=$submodule link_only=1 extraparams=$extraparams}">{$submodulename}</a></li>
                    {/foreach}
                </ul>
            </li>
        {/foreach}

Steps to Reproduce

  1. Open SuiteCRM, tested on 7.5.1 and most recent version of 7.7.4
  2. Navigate to Admin Console -> Configure Module Menu Filters
  3. Set up the settings like so:
    screen shot 2016-09-23 at 4 25 48 pm
  4. Screen shot of problem actually occurring (Meetings was the Active module):

screen shot 2016-09-23 at 4 27 59 pm

#### Context

I was trying to highlight the active module(by bolding it) in the smarty template so that it was more distinguishable that the module was not a part of the group, it was the active module.
Low Priority bug for you guys, medium priority for me personally

Your Environment

  • SuiteCRM Version used: 7.5.1, 7.7.4
  • Browser name and version: Chrome 53.0.2785.116 (64-bit)
  • Environment name and version: MySQL: PHP 5.5, MySQL
  • Operating System and version: Mac OS X El Capitan
@shogunpol

This comment has been minimized.

Copy link

commented Sep 26, 2016

The issue has been tested in recent version of SuiteCRM(7.7.4), and not appear.
@jshwhitlow , can you check this issue on recent version of SuiteCRM, and if its not appear, can you close an issue?

@jshwhitlow

This comment has been minimized.

Copy link
Author

commented Sep 26, 2016

If you read my post, you’ll see that I did in fact test this issue on 7.7.4 and it did occur for me.

@shogunpol

This comment has been minimized.

Copy link

commented Sep 26, 2016

@jshwhitlow , in "Your Environment" section is stands: SuiteCRM Version used: 7.5.1.
Another question in what browsers you test this issue, and of course if any more information you have to help us replicate the issue.

@jshwhitlow

This comment has been minimized.

Copy link
Author

commented Sep 26, 2016

@shogunpul, I tested this within the most recent version of Google Chrome.

@shogunpol

This comment has been minimized.

Copy link

commented Sep 26, 2016

@jshwhitlow , With your additional information I been able to replicate the issue,
We labelled this issue as a bug.

@Jason-Dang

This comment has been minimized.

Copy link

commented Jan 24, 2018

@jshwhitlow I have been looking into this rather old issue and have discovered the reason for the active module not being displayed at the very bottom of the tab group. Basically in include/MVC/View/Sugarview.php there is an assignment that sets the 'max_tabs' value based on the current user preference, this is in fact defined as a default in the config.php file 'default_max_tabs' => 10.

Due to this limit of 10 tabs any additional modules in the tab group get added to an extra module list which is populated in the smarty template after the primary module list. This is causing your 'Active Module' to be displayed after the 10th module in the group (excluding 'Home') and prior to any additional modules.

To get around this, all you would need to do is increase the value for 'default_max_tabs' in config.php.

@jshwhitlow

This comment has been minimized.

Copy link
Author

commented Jan 24, 2018

@Jason-Dang, I tested this and it in fact did work on my current Version of SuiteCRM 7.5.1. (Don't fret, the first quarter of this year we are upgrading to the latest version).

That said, I do think something needs to get changed here.

Either

A) The default_max_tabs setting should be removed, and if the limit exceeds a certain number or gets too long, the module list should become scrollable. There really isn't a need for a limit when I can just change which modules appear in that list myself.

OR

B) The default_max_tabs setting needs to do what it really implies which limit the total number of modules that will appear in a list, I'm not a fan of this list, but I think troubleshooting this problem would be easier if I was searching for 'Can't display more than 10 modules' instead of what I'm searching for how to fix.

If you feel it best, you can change this topic from a 'bug request' to a 'feature request'.

@Jason-Dang

This comment has been minimized.

Copy link

commented Jan 25, 2018

@jshwhitlow Just to note also, if a user does not already have a max_tabs preference set or their preference is less than or equal to 0 or greater than 10, then it will be set to the current default value set in config.php.

In regards to your suggestions/requests I would recommend creating a new 'suggestion' to highlight your points.

For the actual issue of the current module list not displaying at the bottom of the tab group, I am currently looking into a workaround for this so that it will always be displayed last regardless of the max tabs setting.

@Jason-Dang Jason-Dang referenced this issue Jan 26, 2018
3 of 6 tasks complete
Dillon-Brown added a commit that referenced this issue Feb 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.