Results 1 to 7 of 7

Thread: Programmatically UnHide Tab

  1. #1
    banning's Avatar
    banning is offline Sugar Community Member
    Join Date
    Jul 2010
    Location
    Kansas
    Posts
    73

    Default Programmatically UnHide Tab

    I have a problem... i can not use the admin "Configure Tabs" tool to do this (not cause they are broke i just need to be able to do it without them)...

    I need to be able to Programmatically "un-hide" a Tab... I've tried

    PHP Code:
    $modulekey array_keys($modInvisList'Prospects');
        foreach(
    $modulekey as $key => $value){
            unset(
    $modInvisList[$value]);
        };
        
    $moduleList[] = 'Prospects'
    However it doesn't work... i can see Prospects or "Targets" in the hidden tabs section and I can drag it over into the "Displayed Tabs" section, save and it works just fine... HOWEVER like i said i need to be able to do this by NOT using the "Configure Tabs" tool... any idea?
    --
    -Banning Stuckey
    http://www.iambanning.com
    Web 2.0 New Media Developer][Designer

  2. #2
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Programmatically UnHide Tab

    You are on right way, just make sure your code are been processed.
    AND also update the follow arrays:
    $beanList['module_name'] = 'module_name';
    $beanFiles['module_name'] = 'modules/module_name/module_name.php';
    unset($modules_exempt_from_availability_check['module_name']);
    unset($modInvisList['module_name']);
    $moduleList[] = 'module_name';
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  3. #3
    banning's Avatar
    banning is offline Sugar Community Member
    Join Date
    Jul 2010
    Location
    Kansas
    Posts
    73

    Default Re: Programmatically UnHide Tab

    i'm running this code

    PHP Code:
        $beanList['Prospects'] = 'Prospects';
        
    $beanFiles['Prospect']  = 'modules/Prospects/Prospect.php';
        
        
    $modulekey array_keys($modules_exempt_from_availability_check'Prospects');
        foreach(
    $modulekey as $key => $value){
            unset(
    $modules_exempt_from_availability_check[$value]);
        };
        
    $modulekey array_keys($modInvisList'Prospects');
        foreach(
    $modulekey as $key => $value){
            unset(
    $modInvisList[$value]);
        };
        
        
    $moduleList[] = 'Prospects'
    And i still can't see targets... i'm running CE 5.5.4 - im placing this code in custom/Extension/application/Ext/Include/include.ext.php - i also running Quick Repair & Rebuild and Repair Extensions
    --
    -Banning Stuckey
    http://www.iambanning.com
    Web 2.0 New Media Developer][Designer

  4. #4
    banning's Avatar
    banning is offline Sugar Community Member
    Join Date
    Jul 2010
    Location
    Kansas
    Posts
    73

    Default Re: Programmatically UnHide Tab

    Anyone got any other suggestions?... I could really use some help on this one thanks...
    --
    -Banning Stuckey
    http://www.iambanning.com
    Web 2.0 New Media Developer][Designer

  5. #5
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Programmatically UnHide Tab

    After run this code (in case it works) before your module be "visible", you have to set this tab as visible using the tabs management screen from administration. I think it makes some update on db which can't be automatically chnageing sugar conf. files.

    - Make sure your file are been processed, log it in some place (e.g: text-file).
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  6. #6
    banning's Avatar
    banning is offline Sugar Community Member
    Join Date
    Jul 2010
    Location
    Kansas
    Posts
    73

    Default Re: Programmatically UnHide Tab

    ah ok so you're thinking i'll have to use the admin tools then?... that is not an option for me i'll just have to go and tear through the code then and just call the function or whatever that sugar calls in that admin section and set it then.
    --
    -Banning Stuckey
    http://www.iambanning.com
    Web 2.0 New Media Developer][Designer

  7. #7
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Programmatically UnHide Tab

    I mean at least you could make sure this file are been executed. When do you remove a module from "$modInvisList" in case this module is propper configured it already had to be visible.

    I also think the name include.ext.php maybe is not th best choice because normally files with ".ext." are files autocomputed by sugar after compose its content via several separated files.

    In the worths case you could do the follow:
    - Set the module visible via admin tool.
    - search for modified files in your system (or records on db!)
    - Reporduce the changes programatically, so no need to use admin tool.
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Tabs: programmatically display?
    By SSAgov in forum Developer Help
    Replies: 0
    Last Post: 2011-02-18, 01:23 PM
  2. Create Meeting Programmatically
    By RobertCary in forum Developer Help
    Replies: 1
    Last Post: 2010-12-31, 10:43 PM
  3. Programmatically getting related records
    By fabiog in forum Developer Help
    Replies: 0
    Last Post: 2009-09-07, 08:12 AM
  4. programmatically set acl
    By waverider in forum Developer Help
    Replies: 2
    Last Post: 2008-03-10, 03:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •