Make modules available ( and unavailable ) in the Reports module

Sugar Dev Team —  June 15, 2012 — 10 Comments

I’ve seen several questions like this come up before…

I’m writing my own module which isn’t really a ‘Reports-friendly’ one. How can I make sure my users can’t report on it?

Or this one…

My module is set to not show in the navigation bar, but because of that I can’t report on it. What gives?

There’s a simple solution to both cases, and it lies in the white or black listing the module in the Reports. You can do this easily adding a file named reportmodulesdefs.php in the custom/modules/Reports/metadata/ directory, and specify the modules to whitelist or blacklist like this…

This works in Sugar 6.4 or 6.5.

10 responses to Make modules available ( and unavailable ) in the Reports module

  1. 

    Can we leverage the Ext framework for this?

    • 

       Not as of now, but it would be a great addition. Please add a bug request for it at http://bugs.sugarcrm.com, and if you feel up to it add the code at http://github.com/sugarcrm/sugarcrm_dev as a pull request.

      • 
        Aurelien Requiem July 7, 2012 at 11:27 pm

         Hi John,

        Just push a patch to allow that feature through the manifest.php.
        In the manifest, the patch would simply add a new option named ‘reportable’ for each created bean.

                ‘beans’ => array (
                        0 => array (
                                ‘module’ => ‘FooBars’,
                                ‘class’ => ‘FooBar’,
                                ‘path’ => ‘custom/modules/FooBars/FooBar.php’,
                                ‘tab’ => false,
                                ‘reportable’ => false,
                        ),

        The code is accessible to all via my github https://github.com/bobcatt/sugarcrm_dev/commit/bf34b644741088a6690e47ef3979142ea3e64300 and I submitted the change to SugarCRM via bug 54217

        The ‘reportable’ is strictly optional, because studio should support the feature, but in the meantime, I simply kept the default behavior (reportable = true)

  2. 

    I can’t get this to work. I’ve tried this on 2 instances (6.4.1 and 6.5.14) with no success (and no errors).

    I ran repair&rebuild, no effect.

    I restarted apache to ensure there was no weird apc caching. no effect.

    I also tried non-upgrade-safe change in the non-custom Reports module directory. no effect.

    what’s going on?

  3. 

    I can’t get this to work. Can you point out what I’m doing wrong?

    I tried this on 2 instances (6.4.1 and 6.5.14) with no success (and nothing in apache error log, nothing in sugarcrm.log).

    Ran repair & rebuild. no effect.

    Also edited non-upgrade-safe Report module file. no effect.

    Restarted apache to avoid any apc caching issue. no effect.

  4. 

    It works, but please take in consideration that you need to end the code with “?>”
    Quick Repair
    Done, works.
    It would be very useful to add “ProspectLists” module (Target Lists) in Reports, it’s hidden for Sugar PRO 6.5 and 6.7
    Thanks,
    David

  5. 

    in file modules/Reports/SavedReport.php methods getACLAllowedModules have check:

    if (isset($_SESSION[‘reports_getACLAllowedModules’])) {
    return $_SESSION[‘reports_getACLAllowedModules’];
    }

    so, for you not enough execute repair in admin tools. needs to clear cache in browser.

Trackbacks and Pingbacks:

  1. ็็How to hide some module on Report module (Pro 6.2.4) - August 24, 2012

    […] […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s