Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Widget is not showing

  1. #1
    youssefaoun is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    55

    Default Widget is not showing

    Hello,

    I built a new module based on Example_Module which is nice widget example.

    I copied the files of this module and the WIDGET IS NOT SHOWING AT ALL. here are my files:

    in Manifest:
    PHP Code:
    'layoutdefs'=> array(
            array(
                
    'from'=> '<basepath>/layoutdefs/cases_layout_defs.php'
                
    'to_module'=> 'Cases',
            ),
        ), 
    in cases_layout_defs.php :
    PHP Code:
    $layout_defs['Cases']['subpanel_setup']['myModule'] = array(
        
    'order' => 29,
        
    'module' => 'myModule',
        
    'subpanel_name' => 'default',    //this is the name of the file
        
    'get_subpanel_data' => 'myModule',
        
    'add_subpanel_data' => 'myModule_id',
        
    'title_key' => 'LBL_MYMODULE_SUBPANEL_TITLE',
        
    'top_buttons' => array(
            array(
    'widget_class' => 'SubPanelTopSelectButton'),
        ),
    ); 
    and 'subpanel_name' => 'default' is really the name of the file under modules/myModule/supanels/default.php

    COUld you please help?

    regards,
    Last edited by youssefaoun; 2007-05-11 at 01:16 AM.

  2. #2
    anna is offline Sugar Community Member
    Join Date
    Jan 2007
    Location
    USA
    Posts
    81

    Default Re: Widget is not showing

    Did you also create a cases_vardefs.php file?

    Whatever you reference in the layout_defs under get_subpanel_data and the subpanel_setup must exist in the vardefs as a field of type => link. If your relationship is many-to-many, you also need to create a metadata file.

    Eg to place a subpanel of module 'Creditcards' under the module of 'Contacts' you would need to have the following:

    contacts_vardefs.php
    PHP Code:
    // should be Contact, not Contacts
    $dictionary['Contact']['fields']['creditcards'] =   array (
        
    'name' => 'creditcards',
        
    'type' => 'link',
        
    'relationship' => 'contact_creditcards',
        
    'source' => 'non-db',
        
    'vname' => 'LBL_CREDITCARDS'
    );
    $dictionary['Contact']['relationships']['contact_creditcards'] =   array (
                
    'lhs_module'=> 'Contacts',
                
    'lhs_table'=> 'contacts',
                
    'lhs_key' => 'id',
                
    'rhs_module'=> 'Creditcards',
                
    'rhs_table'=> 'creditcards',
                
    'rhs_key' => 'contact_id',
                
    'relationship_type'=>'one-to-many'
    ); 
    contacts_layoudefs.php
    PHP Code:
    // should be Contacts, not Contact
    $layout_defs['Contacts']['subpanel_setup']['creditcards'] =  array(
                
    'order' => 140,
                
    'module' => 'Creditcards',
                
    'sort_order' => '',
                
    'sort_by' => '',
                
    'subpanel_name' => 'default',
            
    'get_subpanel_data' => 'creditcards',
            
    'add_subpanel_data' => 'creditcard_id',
            
    'title_key' => 'LBL_CREDITCARDS_SUBPANEL',
    ); 
    Make sure to rebuild the extensions and relationships under Admin if you simply copy the files and don't use ModuleInstaller.
    Hope this helps

  3. #3
    youssefaoun is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    55

    Default Re: Widget is not showing

    Thank you for answering

    Here is my cases_layout_def.php

    PHP Code:
    $layout_defs['Cases']['subpanel_setup']['aleksDebugModWidget'] = array(
        
    'order' => 150,
        
    'module' => 'aleksDebugModWidget',
        
    'subpanel_name' => 'default',    //this is the name of the file
        
    'get_subpanel_data' => 'aleksDebugModWidget',
        
    'add_subpanel_data' => 'aleksDebugModWidget_id',
        
    'title_key' => 'LBL_ALEKSDEBUGMODWIDGET_SUBPANEL_TITLE',
        
    'top_buttons' => array(array('widget_class' => 'SubPanelTopSelectButton'),),
    ); 
    Here is cases_vardefs.php

    PHP Code:
    $dictionary['Case']['fields']['aleksDebugModWidget'] = array (
        
    'name' => 'aleksDebugModWidget',
        
    'type' => 'link',
        
    'relationship' => 'cases_aleksDebugModWidget',
        
    'vname' => 'LBL_ALEKSDEBUGMODWIDGET',
        
    'source' =>'non-db',
    );

    $dictionary['Case']['relationships']['cases_aleksDebugModWidget'] =   array (
                
    'lhs_module'=> 'Cases',
                
    'lhs_table'=> 'cases',
                
    'lhs_key' => 'id',
                
    'rhs_module'=> 'aleksDebugModWidget',
                
    'rhs_table'=> 'aleksDebugModWidget',
                
    'rhs_key' => 'aleksDebugModWidget_id',
                
    'relationship_type'=>'many-to-many' 
    ); 
    And here are some lines of the manifest.php:

    PHP Code:
        'layoutdefs'=> array(
            array(
                
    'from'=> '<basepath>/layoutdefs/cases_layout_defs.php'
                
    'to_module'=> 'Cases',
            ),
        ),

        
    'relationships'=>array(
            array(
                
    'module' => 'Cases',
                
    'meta_data' => '<basepath>/relationship/cases_aleksDebugModWidgetMetaData.php',
                
    'module_vardefs' => '<basepath>/vardefs/cases_vardefs.php',
                
    //'module_layoutdefs'=>'<basepath>/layoutdefs/cases_layout_defs.php'
            
    ),
        ), 
    I am still having the same error:

    The widget is not appearing

    Besides, I am getting confised with the choice of Cases or Case in a place.
    The module is "Cases"!!

    Regards,
    Last edited by youssefaoun; 2007-05-10 at 09:19 PM.

  4. #4
    anna is offline Sugar Community Member
    Join Date
    Jan 2007
    Location
    USA
    Posts
    81

    Default Re: Widget is not showing

    Yeah, the use of plural and singular of the module name is pretty confusing, to say the least It looks like you got it right, though.

    These are the following suggestions:
    • 1. Did you customize your tabs before installing your module and is your custom module displaying in the tabs? If yes, it should also work as a subpanel.
    • 2. If you customized your tabs and your module is NOT displaying in the tabs, try going to Admin -> configure tabs and make sure your module is put into the 'displayed tabs'. I believe if you customize the tabs once, all newly installed module will automatically be put in the 'hidden tabs' and you need to manually bring them into the displayed ones.
    • 3. If your module is NOT intended to be displayed in the tabs, make sure you included something like this under $your_module/application/mod_app_strings.php
      PHP Code:
      $modules_exempt_from_availability_check['Creditcards']='Creditcards'
      The same file also should contain this line, otherwise your module won't work at all:
      PHP Code:
      $app_list_strings['moduleList']['Creditcards']='Creditcards'
      This file should be included in the manifest like this:

      PHP Code:
        'language'=> array(
         array(
      'from'     => '<basepath>/application/mod_app_strings.php'
               
      'to_module'=> 'application',
               
      'language' => 'en_us'
         
      ),( 
    • 5. Check the custom directory to make sure sure vardefs.ext.php and other ext files were properly generated
    • 6. Check the relationships table in the DB to make sure that your relationship was registered


    Sorry, gotta head out now. This is a starter ... try it, and see if it helps.

  5. #5
    youssefaoun is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    55

    Thumbs down Re: Widget is not showing

    Not working yet:

    I have checked:
    sugracrm/custom/Extension/modules/Cases/Vardefs

    and I saw a file named after my module aleksDebugModWidget.php

    it contains:
    PHP Code:
    $dictionary['Case']['fields']['aleksDebugModWidget'] = array (
        
    'name' => 'aleksDebugModWidget',
        
    'type' => 'link',
        
    'relationship' => 'cases_aleksDebugModWidget',
        
    'vname' => 'LBL_ALEKSDEBUGMODWIDGET',
        
    'source' =>'non-db',
    ); 
    The same under
    sugracrm/custom/Extension/modules/Cases/Layoutdefs

    and I saw a file named after my module aleksDebugModWidget.php

    it contains:
    PHP Code:
    $layout_defs['Cases']['subpanel_setup']['aleksDebugModWidget'] = array(
        
    'order' => 150,
        
    'module' => 'aleksDebugModWidget',
        
    'subpanel_name' => 'default',    //this is the name of the file
        
    'get_subpanel_data' => 'aleksDebugModWidget',
        
    'add_subpanel_data' => 'aleksDebugModWidget_id',
        
    'title_key' => 'LBL_ALEKSDEBUGMODWIDGET_SUBPANEL_TITLE',
        
    'top_buttons' => array(array('widget_class' => 'SubPanelTopSelectButton'),),
    ); 
    finally under Language I found: en_us.aleksDebugModWidget.php
    it contains:

    PHP Code:
    $mod_strings['LBL_ALEKSDEBUGMODWIDGET_SUBPANEL_TITLE'] = 'Module Link'
    I ran all the repair scripts... nothing runs.


    What to do?

  6. #6
    anna is offline Sugar Community Member
    Join Date
    Jan 2007
    Location
    USA
    Posts
    81

    Default Re: Widget is not showing

    Sorry to hear that you still can't get it to work. Your definitions look fine, so I am not sure what the problem is.
    Can you verify that you have these files: vardefs.ext.php, layoutdefs.ext.php under /custom/modules/Cases/Ext/Vardefs and Layoutdefs, respectively? These should be generated from the files that you said you found when you rebuild relationships.

    Another suggestion that might seem a bit 'strange' - I would change all the names that you use as keys (eg aleksDebugModWidget) to all lower case and stick with it. A lot of things in Sugar are just automatically put to lower or upper case before processing. I haven't come across any subpanel definitions that use mixed case, so that might be a sign that it HAS to be all lowercase. Check out the file include/SubPanels/SubPanelDefinitions.php and search for load_relationships, for example. The name of the subpanel is converted to lower case there, so that seems like it would cause a problem with your setup.

    Good luck.

  7. #7
    youssefaoun is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    55

    Default Re: Widget is not showing

    Thank you very much for your help.

    In fact "rebuilding" solved the problem..

  8. #8
    andydreisch's Avatar
    andydreisch is offline Sugar Team Member
    Join Date
    Apr 2005
    Location
    San Jose
    Posts
    2,080

    Default Re: Widget is not showing

    Hi youssefaoun, just checking. Was it the rebuild alone or did you also have to do some of anna's other suggestions?

    Thanks,

    Andy
    Andy Dreisch
    Vice President, Online Team


    Check out our Podcasts!
    Sugar University for training
    Sugar Wiki for developer and user help
    SugarForge for modules, themes, lang packs
    SugarExchange for production-ready extensions
    Enter/view bugs via the Sugar bug tracker

  9. #9
    youssefaoun is offline Sugar Community Member
    Join Date
    Apr 2007
    Posts
    55

    Default Re: Widget is not showing

    Actually I rebuilt it manually..

    By the way, since you are a team member, I would like to say something about SugarCRM:
    - I had to proceed by changing the name of Widget example in order to make a new Module. Building a module from scratch based on personal understanding is Mission Impossible
    - Code that doesn't work as expected leaves you wondering why!!?? for example, to make the widget example ran, I had to forget all my work from scratch and go the dummy way, Pasty my new module's name in Widgets example.

    Regards,

  10. #10
    andydreisch's Avatar
    andydreisch is offline Sugar Team Member
    Join Date
    Apr 2005
    Location
    San Jose
    Posts
    2,080

    Default Re: Widget is not showing

    youssefaoun, please be sure to participate in and review the Release 5.0 Developer Preview.

    We're taking great strides in Release 5.0 w/r/t easing the new module creation process.

    We'd like your feedback.

    Andy
    Andy Dreisch
    Vice President, Online Team


    Check out our Podcasts!
    Sugar University for training
    Sugar Wiki for developer and user help
    SugarForge for modules, themes, lang packs
    SugarExchange for production-ready extensions
    Enter/view bugs via the Sugar bug tracker

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Opportunities Dashlet not showing all Opportunities
    By Garowetz in forum General Discussion
    Replies: 1
    Last Post: 2008-04-17, 08:10 AM
  2. New Field not showing up in module
    By etabs in forum Help
    Replies: 7
    Last Post: 2007-05-01, 05:48 PM
  3. Replies: 1
    Last Post: 2007-03-02, 06:14 PM
  4. Subpanels not showing up?
    By Tinman4444 in forum Help
    Replies: 0
    Last Post: 2006-06-06, 02:36 AM

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
  •