Page 1 of 4 1234 LastLast
Results 1 to 10 of 38
Like Tree5Likes

Thread: How to add Import option to custom modules?

  1. #1
    crmsiva's Avatar
    crmsiva is offline A Sugar Hero
    Join Date
    Jan 2009
    Location
    Chennai, India
    Posts
    1,128

    Default How to add Import option to custom modules?

    Hi All

    Follow the below steps to add Import option to custom modules. This steps can also be used to enable import option in standard modules like projects.

    Add the below line in modules/<Module Name>/<Module Name>.php file.

    Code:
    var $importable = true;
    Create the file menu.ext.php in "custom\modules\<Module Name>\Ext\Menus" with below code.

    Code:
    <?php
    
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); 
    
    if(ACLController::checkAccess('<Module Name>', 'import', true)) $module_menu[]=Array("index.php?module=Import&action=Step1&import_module=<Module Name>&return_module=<Module Name>&return_action=index", "Import","Import", '<Module Name>');
    
    ?>
    This will add import menu item in the shortcut menu.
    Last edited by crmsiva; 2009-03-25 at 12:33 PM.
    santhosh.s, obed, mahe11 and 1 others like this.

  2. #2
    amrutha is offline Senior Member
    Join Date
    Mar 2009
    Posts
    65

    Default Re: How to add Import option to custom modules?

    Thanks for the replies... import is working now for my new module

  3. #3
    Qamrun is offline Senior Member
    Join Date
    Mar 2009
    Location
    New Delhi
    Posts
    46

    Smile Re: How to add Import option to custom modules?

    It's very helpful.... thanks a lot

  4. #4
    gsrikanth's Avatar
    gsrikanth is offline Sugar Community Member
    Join Date
    Dec 2008
    Location
    Hyderabad
    Posts
    49

    Default Re: How to add Import option to custom modules?

    I have done the same procedure and i got this error "There is no action by that name."
    The url is like this :index.php?module=Import&action=Step1&import_modul e=Project&return_module=Project&return_action=inde x
    please help...
    Last edited by gsrikanth; 2009-07-10 at 12:34 PM.

  5. #5
    crmsiva's Avatar
    crmsiva is offline A Sugar Hero
    Join Date
    Jan 2009
    Location
    Chennai, India
    Posts
    1,128

    Default Re: How to add Import option to custom modules?

    There is a space between "import_module" & "=Project" in the URL. Remove that space.

    Code:
    import_module =Project
    BTW, Which version of sugar you are using?

  6. #6
    gsrikanth's Avatar
    gsrikanth is offline Sugar Community Member
    Join Date
    Dec 2008
    Location
    Hyderabad
    Posts
    49

    Default Re: How to add Import option to custom modules?

    Hi crmsiva

    Thanks for your reply.It's very helpful....
    Last edited by gsrikanth; 2009-07-10 at 06:50 AM.

  7. #7
    galgo is offline Junior Member
    Join Date
    Apr 2008
    Posts
    3

    Default Re: How to add Import option to custom modules?

    crmsiva, thank you very much for these instructions.
    I drove myself nuts looking for the import option when I knew I'd made the fields importable Your instructions were clear and spot-on and now I have my import shortcut. Thank you again.

  8. #8
    smguenther is offline Member
    Join Date
    May 2009
    Posts
    9

    Default Re: How to add Import option to custom modules?

    Hi,

    I tried to use your explanation to add the import function to the ModuleBuilder, but I don't get the import option. Maybe you see what I did wrong:

    Quote Originally Posted by crmsiva View Post
    Hi All
    Add the below line in modules/<Module Name>/<Module Name>.php file.

    Code:
    var $importable = true;
    the file modules/ModuleBuilder/ModuleBuilder.php does not exist, instead there is a subdirectory called MB where this file is located.

    Here is how this file now looks like:

    Code:
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    require_once ('include/utils/file_utils.php') ;
    define ( 'MB_PACKAGE_PATH', 'custom/modulebuilder/packages' ) ;
    define ( 'MB_PACKAGE_BUILD', 'custom/modulebuilder/builds' ) ;
    require_once ('modules/ModuleBuilder/MB/MBPackage.php') ;
    
    class ModuleBuilder
    {
        var $packages = array ( ) ;
        var $importable = true;
        function getPackageList ()
    ....
    Quote Originally Posted by crmsiva View Post
    Create the file menu.ext.php in "custom\modules\<Module Name>\Ext\Menus" with below code.
    Here is my code:

    Code:
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    if(ACLController::checkAccess('ModuleBuilder', 'import', true)) $module_menu[]=Array("index.php?module=Import&action=Step1&import_module=ModuleBuilder&return_module=ModuleBuilder&return_action=index", "Import","Import", 'ModuleBuilder');
    ?>
    Any idea what I did wrong?

    Thanks for your help.

    Stefan

  9. #9
    crmsiva's Avatar
    crmsiva is offline A Sugar Hero
    Join Date
    Jan 2009
    Location
    Chennai, India
    Posts
    1,128

    Smile Re: How to add Import option to custom modules?

    Hi

    This solution will not work for Module Builder. This solution is for importing data and not modules. Use module loader to install a module.

  10. #10
    dekleinemedia is offline A Prolific Poster
    Join Date
    May 2009
    Location
    Netherlands
    Posts
    241

    Question Re: How to add Import option to custom modules?

    Quote Originally Posted by crmsiva View Post
    Hi All

    Follow the below steps to add Import option to custom modules. This steps can also be used to enable import option in standard modules like projects.

    Add the below line in modules/<Module Name>/<Module Name>.php file.

    Code:
    var $importable = true;
    Create the file menu.ext.php in "custom\modules\<Module Name>\Ext\Menus" with below code.

    Code:
    <?php
    
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); 
    
    if(ACLController::checkAccess('<Module Name>', 'import', true)) $module_menu[]=Array("index.php?module=Import&action=Step1&import_module=<Module Name>&return_module=<Module Name>&return_action=index", "Import","Import", '<Module Name>');
    
    ?>
    This will add import menu item in the shortcut menu.
    Hi,

    I am having in problem with creating an Import option in module "Project".

    I followed both steps, but when I am rebuildig this module "Project" my file menu.ext.php will be automatically delete out of my "custom\modules\Project\Ext\Menus" directory

    See scripts;

    Script: menu.ext.php (custom\modules\Project\Ext\Menus)
    PHP Code:
    <?php

    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); 

    if(
    ACLController::checkAccess('Project''import'true)) 
    $module_menu[]=Array("index.php?module=Import&action=Step1&import_module=Project&return_module=Project&return_action=index""Import","Import"'Project');

    ?>
    Script: Project.php (modules\Project)
    PHP Code:
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

    class 
    Project extends SugarBean {

        var 
    $object_name 'Project';
        var 
    $module_dir 'Project';
        var 
    $new_schema true;
        var 
    $table_name 'project';
        var 
    $importable true;
    }
    ?>
    Can someone please tell me what i did wrong, and why the created menu.ext.php is auto deleted when I rebuild the "Project" Module.

    Thanksssss
    Kind regards,

    De Kleine Media


    SugarCRM CE v.5.2.0h
    Windows platform
    MySQL v.5.1
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

Page 1 of 4 1234 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Set import option in custom modules
    By jmcalderond in forum General Discussion
    Replies: 7
    Last Post: 2009-03-25, 12:46 PM
  2. How to add Import option to new modules?
    By amrutha in forum Developer Help
    Replies: 2
    Last Post: 2009-03-25, 12:27 PM
  3. import for custom fields and custom modules
    By waverider in forum Developer Help
    Replies: 2
    Last Post: 2008-03-14, 09:44 AM
  4. link contacts with custom modules at import
    By juancarlos.delrio in forum Developer Help
    Replies: 0
    Last Post: 2007-11-13, 01:15 AM
  5. Import Function in Custom Modules
    By simpsond in forum Developer Help
    Replies: 7
    Last Post: 2007-07-06, 04:41 PM

Tags for this Thread

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
  •