Results 1 to 2 of 2

Thread: Probleme Subpanel lors duplication d'un module

  1. #1
    holyfire is offline Sugar Community Member
    Join Date
    May 2007
    Posts
    43

    Default Probleme Subpanel lors duplication d'un module

    Bonjour,

    Décidément j'accumule les problèmes sur sugar,


    Mon problème cette fois-ci est dut apparemment à ce que mon nouveau module dupliqué "écrase" ou non(ca dépends lol) le tableau contenant le subpanel Account de mon module d'origine.


    J'aimerais savoir ou chercher pour modifier, car je n'ai repérer aucun doublon de variables dans les 2 modules des fichiers vardefs.php, métadata ainsi que layout_defs, chacun créant sa propre table de jointure account_module



    Si vous avez la moindre idée n'hésitez pas, je suis à cours d'idée..

    Merci à l'avance
    Cordialement
    Alexandre A.

    Voici les définitions pour le subpanel account des deux modules:

    Module InvPostes
    accounts_invpostevardefs.php

    PHP Code:
    $dictionary['Account']['fields']['invpostes'] = array (
        
    'name' => 'invpostes',
        
    'type' => 'link',
        
    'relationship' => 'account_invposte',
        
    'module' => 'InvPostes',
        
    'source'=>'non-db',
        
    'vname'=>'LBL_INVPOSTE_SUBPANEL_TITLE',
    ); 
    accountlayout_invpostedefs.php

    PHP Code:
    $layout_defs['Accounts']['subpanel_setup']['invpostes'] =  array(
                
    'order' => 120,
                
    'module' => 'InvPostes',
                
    'subpanel_name' => 'ForAccount',
                
    'get_subpanel_data' => 'invpostes',
                
    //'add_subpanel_data' => 'account_id',
                
    'title_key' => 'LBL_INVPOSTE_SUBPANEL_TITLE',
                
    'refresh_page'=>1,
                
    'sort_order' => 'desc',
                
    'sort_by' => 'name',
                
    'top_buttons' => array(
                array(
    'widget_class' => 'SubPanelTopButtonQuickCreate'),
                array(
    'widget_class' => 'SubPanelTopSelectButton''popup_module' => 'InvPostes'),
                ),
    ); 
    accounts_invposteMetaData.php

    PHP Code:
    $dictionary['accounts_invpostes'] = array (
        
    'table' => 'accounts_invpostes'
        
    'fields' => array (
            array(
    'name' =>'id''type' =>'char''len'=>'36''required'=>true'default'=>'')
          , array(
    'name' =>'account_id''type' =>'char''len'=>'36')
          , array(
    'name' =>'invposte_id''type' =>'char''len'=>'36')
          , array (
    'name' => 'date_modified','type' => 'datetime')
          , array(
    'name' =>'deleted''type' =>'bool''len'=>'1''required'=>true'default'=>'0')
        ),
        
    'indices' => array (
            array(
    'name' =>'accounts_invpostespk''type' =>'primary''fields'=>array('id')),
            array(
    'name' =>'accounts_idx''type' =>'index''fields'=>array('account_id')),
            array(
    'name' =>'invposte_idx''type' =>'index''fields'=>array('invposte_id')), 
            array(
    'name' =>'acc_invp''type' =>'alternate_key''fields'=>array('account_id','invposte_id'))
        ),
        
    'relationships' => array (
                                    
    'accounts_invpostes' => 
                                    array(
                                    
    'lhs_module'=> 'Accounts',
                                    
    'lhs_table'=> 'accounts',
                                    
    'lhs_key' => 'id',
                                    
    'rhs_module'=> 'InvPostes',
                                    
    'rhs_table'=> 'invpostes_table',
                                    
    'rhs_key' => 'client_id',
                                    
    'relationship_type'=>'many-to-many',
                                    
    'join_table'=> 'accounts_invpostes',
                                    
    'join_key_lhs'=>'account_id',
                                    
    'join_key_rhs'=>'invposte_id'))
    ); 
    Module InvServeurs
    accounts_invserveurvardefs.php

    PHP Code:
    $dictionary['Account']['fields']['invserveurs'] = array (
        
    'name' => 'invserveurs',
        
    'type' => 'link',
        
    'relationship' => 'account_invserveur',
        
    'module' => 'InvServeurs',
        
    'source'=>'non-db',
        
    'vname'=>'LBL_INVSERVEUR_SUBPANEL_TITLE',
    ); 
    accountlayout_invserveurdefs.php

    PHP Code:
    $layout_defs['Accounts']['subpanel_setup']['invserveurs'] =  array(
                
    'order' => 120,
                
    'module' => 'InvServeurs',
                
    'subpanel_name' => 'ForAccount',
                
    'get_subpanel_data' => 'invserveurs',
                
    //'add_subpanel_data' => 'account_id',
                
    'title_key' => 'LBL_INVSERVEUR_SUBPANEL_TITLE',
                
    'refresh_page'=>1,
                
    'sort_order' => 'desc',
                
    'sort_by' => 'name',
                
    'top_buttons' => array(
                array(
    'widget_class' => 'SubPanelTopButtonQuickCreate'),
                array(
    'widget_class' => 'SubPanelTopSelectButton''popup_module' => 'InvServeurs'),
                ),
    ); 
    accounts_invserveurMetaData.php

    PHP Code:
    $dictionary['accounts_invserveurs'] = array (
        
    'table' => 'accounts_invserveurs'
        
    'fields' => array (
            array(
    'name' =>'id''type' =>'char''len'=>'36''required'=>true'default'=>'')
          , array(
    'name' =>'account_id''type' =>'char''len'=>'36')
          , array(
    'name' =>'invserveur_id''type' =>'char''len'=>'36')
          , array (
    'name' => 'date_modified','type' => 'datetime')
          , array(
    'name' =>'deleted''type' =>'bool''len'=>'1''required'=>true'default'=>'0')
        ),
        
    'indices' => array (
            array(
    'name' =>'accounts_invserveurspk''type' =>'primary''fields'=>array('id')),
            array(
    'name' =>'accounts_idx''type' =>'index''fields'=>array('account_id')),
            array(
    'name' =>'invserveur_idx''type' =>'index''fields'=>array('invserveur_id')), 
            array(
    'name' =>'acc_invp''type' =>'alternate_key''fields'=>array('account_id','invserveur_id'))
        ),
        
    'relationships' => array (
                                    
    'accounts_invserveurs' => 
                                    array(
                                    
    'lhs_module'=> 'Accounts',
                                    
    'lhs_table'=> 'accounts',
                                    
    'lhs_key' => 'id',
                                    
    'rhs_module'=> 'InvServeurs',
                                    
    'rhs_table'=> 'invserveurs_table',
                                    
    'rhs_key' => 'client_id',
                                    
    'relationship_type'=>'many-to-many',
                                    
    'join_table'=> 'accounts_invserveurs',
                                    
    'join_key_lhs'=>'account_id',
                                    
    'join_key_rhs'=>'invserveur_id'))
    ); 

  2. #2
    holyfire is offline Sugar Community Member
    Join Date
    May 2007
    Posts
    43

    Default Re: Probleme Subpanel lors duplication d'un module

    J'ai trouvé la solution il s'agissait de l'argument 'Order' dans la definition du Layout de account

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Module Builder
    By Olavo in forum Downloads
    Replies: 418
    Last Post: 2009-02-26, 06:36 AM
  2. Replies: 4
    Last Post: 2007-09-10, 02:14 PM
  3. Problems with Implementing Custom Pug Subpanel Module
    By soreilly in forum Developer Help
    Replies: 5
    Last Post: 2007-06-21, 08:44 AM
  4. Replies: 0
    Last Post: 2007-02-20, 11:00 AM
  5. Replies: 1
    Last Post: 2006-09-11, 03:38 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
  •