2 ways on entering Contact's List view! Need Help!!

Hello all,

I have notived that if we enter in the Contacts list view from the top navigation bar, the display function is not used.

I have a jScript echoed in that fuction to popout the filter panel. so this feature is just at 50%.

Does anyone know how to get this script when we entre Contacts from top bar? Maybe a general footer for Account?

Thanks in advance.

Isn’t it the same link when you go from the Top bar, and when you go from the “View Contacts” link in the sidebar?

If it’s the same link, it should be asking exactly the same thing from the server… so I find this strange.

Hi pgr, no it isn’t. I also though it was but no.

From the top navigation bar:
http://localhost/suitecrm-7.9.0/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DContacts%26action%3Dindex%26parentTab%3DFicha+de+Cliente

from Menu.php:
http://localhost/suitecrm-7.9.0/index.php?module=Contacts&action=index&return_module=Contacts&return_action=DetailView

For me, on 7.9.11, both links are the same, the one with Ajax.
(I am assuming when you say menu.php that is the sidebar, I didn’t check that).

Are you really on 7.9.0 as your folder name implies, or have you upgraded?

Maybe you can check the online demo to see if it similar to your system.

suitecrm.com/demo

7.9.0 is the folder name on IIS 8. the SuiteCRM version we are running is the 7.9.8 (upgraded from 7.9.0).

I thinks that name should not be considered once this is IIS path. Meaning, this is http://localhost/suitecrm-7.9.0/ ins ue url.

The query string is the one that is changing. I am assuming that the entry point (if I can say it in that way) is the diference.

But have you customized anything in the sidebar? Why would your sidebar use a different link than mine, and than the one in the demo site?

the only customization from the top bar were the labels and we reagenge the groups on the top bay by using Administration -> Configure Modules and Menu filters.

we have not change any kind of links in the top navigation bar (we don’t even know how to do it)

This is the file

https://github.com/salesagility/SuiteCRM/blob/master/themes/SuiteP/tpls/_headerModuleList.tpl

it can be copied to the custom folder and customized.

I am a bit lost about the cause of your issue, though. It doesn’t make much sense to me, which leaves in a situation where I have trouble finding ways to help you… sorry

Hello all,

Sorry for the long time before answer.

I have seen the file headerModuleList.tpl whcih you have indicated but this just specifies the template to be used where the link is defined by {sugar_link id="moduleTab$name" module=$name data=$module}.

The link is seted in “function smarty_function_sugar_link($params, &$smarty)” of function.sugar_link.php file. The link it seft is generated by using the $params variable but I cannot find where that ajaxUILoc is beeing passed.

I’m sorry, I don’t know this part of the code, I am lost trying to help you.

Do you have XDEBUG so you can step through the code?

No problem.

I have tried to install XDEBUG once but without success (well more than once but all of them with the same results).

When developing PHP I usually go thrgough code and trying to find the parts of code which I need by using Notepad ++ and using exho to print what I need.

Yes I also had lots of troubles getting XDEBUG to work, but once it was working, it really makes a huge difference in productivity, and in your ability to “study” the code, seeing what it does, examining variables, etc…

I used Microsoft Visual Studio on Windows, with a remote Ubuntu server running SuiteCRM. This is quite an unusual environment around these parts :slight_smile:

What is the OS where you are developing? Is it on the same machine as the SuiteCRM web server server? And what is your IDE of choice?

I finally got XDEBUG installed

We are using a WIMP stack (Windows server 2008; IIS; MySQL; PHP).

I’m using notepad++ to read code, but I can have Netbeans installed.

And We got XDEBUG working.

I have finally found were the

part of the link is beeing generated. On include/utils/mvc_utils.php there is a function called ajaxLink($url) that adds that part of url.


function ajaxLink($url)
{
    global $sugar_config;
    $match = array();
    $javascriptMatch = array();

    preg_match('/module=([^&]*)/i', $url, $match);
    preg_match('/^javascript/i', $url, $javascriptMatch);

    if(!empty($sugar_config['disableAjaxUI'])){
        return $url;
    }
    else if(isset($match[1]) && in_array($match[1], ajaxBannedModules())){
        return $url;
    }
    //Don't modify javascript calls.
    else if (]isset($javascriptMatch[0])) {
    	return $url;
    }
    else
    {
       return "?action=ajaxui#ajaxUILoc=" . urlencode($url);
    }

On include/utils/mvc_utils.php the code runs and just return on the last return statement. Is ther any configuration that we are missing?

Did you change anything in the UI regarding disabling Ajax for some modules?

It’s in Admin / System Settings / Configure AJAX User Interface

Or also possible via config_override.php, something like this

$sugar_config['addAjaxBannedModules'][] = "Acounts";

No I do not change ajax settings.

With xdebug I found the the contact’s listview is entering the function on both ways. Unfortunatlty my custom script, echoed in dysplay function just not run when entering from the top nav bar.

I was able to accoumplish the requiremente.

We can assume this topic closed.