Академический Документы
Профессиональный Документы
Культура Документы
Search
Prerequisites
This change requires code-level customizations, and you will need direct access to
the server as well as administrator access in Sugar to perform the necessary
actions. If you need assistance making these changes and already have a
relationship with a Sugar partner, you can work with them to make this
customization. If not, please refer to the Partner Page (http://www.sugarcrm.com
/partners/channel-partners) to find a reselling partner to help with your
development needs.
Steps to Complete
To enable importing for your custom module, you must modify certain PHP files
depending on the version of Sugar that you have. Please note that the instructions
below apply to custom modules created via Admin > Module Builder and are not
applicable to any stock modules which come out-of-the-box with Sugar. All of the
directory paths are relative to the root directory of Sugar on the web server and
1 de 6 05/04/2017 21:20
Enabling Importing for Custom Modules - SugarCRM Support Site http://support.sugarcrm.com/Knowledge_Base/Developers/Customizatio...
Sugar 7
1. Edit the
./modules/<module_key>_<module_name>/<module_key>_<module_name>_sugar.php
file in your Sugar file system.
2. Around line 24 of the file, locate and
change public $importable = false; to public $importable = true; .
3. Save your changes to the file.
4. Next, edit the
./modules/<module_key>_<module_name>/clients/base/menus/header/header.php
file which should look similar to this:
1 $viewdefs[$moduleName]['base']['menu']['header'] = array(
2 array(
3 'route' => "#$moduleName/create",
4 'label' => 'LNK_NEW_RECORD',
5 'acl_action' => 'create',
6 'acl_module' => $moduleName,
7 'icon' => 'fa-plus',
8 ),
9 array(
10 'route' => "#$moduleName",
11 'label' => 'LNK_LIST',
12 'acl_action' => 'list',
13 'acl_module' => $moduleName,
14 'icon' => 'fa-bars',
15 ),
16 );
5. Add the following line to the end of the file after the last ), but before the
ending ); :
1 array(
2 'route' => "#bwc/index.php?module=Import&action=Step1&import_module=$moduleName&retu
3 'label' => 'LBL_IMPORT',
4 'acl_action' => 'import',
5 'acl_module' => $moduleName,
6 'icon' => 'icon-upload',
7 ),
6. Save your changes to the file. The updated file should then look similar to
this:
2 de 6 05/04/2017 21:20
Enabling Importing for Custom Modules - SugarCRM Support Site http://support.sugarcrm.com/Knowledge_Base/Developers/Customizatio...
1 $viewdefs[$moduleName]['base']['menu']['header'] = array(
2 array(
3 'route' => "#$moduleName/create",
4 'label' => 'LNK_NEW_RECORD',
5 'acl_action' => 'create',
6 'acl_module' => $moduleName,
7 'icon' => 'fa-plus',
8 ),
9 array(
10 'route' => "#$moduleName",
11 'label' => 'LNK_LIST',
12 'acl_action' => 'list',
13 'acl_module' => $moduleName,
14 'icon' => 'fa-bars',
15 ),
16 array(
17 'route' => "#bwc/index.php?module=Import&action=Step1&import_module=$moduleName&r
18 'label' => 'LBL_IMPORT',
19 'acl_action' => 'import',
20 'acl_module' => $moduleName,
21 'icon' => 'icon-upload',
22 ),
23 );
Once the necessary changes have been made, log into Sugar and navigate to
Admin > Repair and perform a "Quick Repair and Rebuild". This will rebuild the
cached files to fully implement the changes.
Sugar 6
1. Edit the
./modules/<module_key>_<module_name>/<module_key>_<module_name>_sugar.php
file in your Sugar file system.
2. Around line 41 of the file, locate and change var $importable = false;
to var $importable = true; .
3. Save your changes to the file.
4. Next, locate the ./modules/<module_key>_<module_name>/Menu.php file.
If this file exists, add the following code to the end of the file and save
your changes:
1 if(ACLController::checkAccess('<module_key>_<module_name>', 'import'
2 $module_menu[]=Array(
3 "index.php?module=Import&action=Step1&import_module=<module_key
4 $app_strings['LBL_IMPORT'],
5 "Import",
6 '<module_key>_<module_name>'
7 );
If this file does not exist, create the file with proper permissions for your
Linux (/Knowledge_Base/Platform_Management
/Required_File_System_Permissions_on_Linux/index.html) or Windows
(/Knowledge_Base/Platform_Management
/Required_File_System_Permissions_on_Windows_With_IIS
/index.html) server. The contents of the file should be as follows:
3 de 6 05/04/2017 21:20
Enabling Importing for Custom Modules - SugarCRM Support Site http://support.sugarcrm.com/Knowledge_Base/Developers/Customizatio...
1 <?php
2 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'
3
4 global $mod_strings, $app_strings, $sugar_config;
5
6 if(ACLController::checkAccess('<module_key>_<module_name>', 'edit'
7 $module_menu[]=Array(
8 "index.php?module=<module_key>_<module_name>&action=EditView&return_module
9 $mod_strings['LNK_NEW_RECORD'],
10 "Create<module_key>_<module_name>",
11 '<module_key>_<module_name>'
12 );
13 if(ACLController::checkAccess('<module_key>_<module_name>', 'list'
14 $module_menu[]=Array(
15 "index.php?module=<module_key>_<module_name>&action=index&return_module
16 $mod_strings['LNK_LIST'],
17 "<module_key>_<module_name>",
18 '<module_key>_<module_name>'
19 );
20 if(ACLController::checkAccess('<module_key>_<module_name>', 'import'
21 $module_menu[]=Array(
22 "index.php?module=Import&action=Step1&import_module=<module_key
23 $app_strings['LBL_IMPORT'],
24 "Import",
25 '<module_key>_<module_name>'
26 );
Once the necessary changes have been made, log into Sugar and navigate to
Admin > Repair and perform a "Quick Repair and Rebuild". This will rebuild the
cached files to fully implement the changes.
Application
After making these changes, the "Import {Module Name}" option will appear in the
Actions menu of the custom module's module tab. Simply click the triangle in the
module tab (for Sugar 7) or hover on the module tab (for Sugar 6) then select the
Import option to create or update records for your custom module. For instructions
on using Sugar's Import tool, please refer to the Import (/SmartLinks
/Application_Guide/Import/index.html) documentation.
From Sugar 7:
From Sugar 6:
4 de 6 05/04/2017 21:20
Enabling Importing for Custom Modules - SugarCRM Support Site http://support.sugarcrm.com/Knowledge_Base/Developers/Customizatio...
Store
5 de 6 05/04/2017 21:20
Enabling Importing for Custom Modules - SugarCRM Support Site http://support.sugarcrm.com/Knowledge_Base/Developers/Customizatio...
(http://www.sugarexchange.com/)
(http://www.sugarcrm.com (http://www.sugarcrm.com
/news/press-releases) /about/company-
News overview)
(http://www.sugarcrm.com Careers
/news/headlines) (http://www.sugarcrm.com
Events /about/careers)
/news/events) (http://www.sugarcrm.com
Awards /sugarcrm-inc-privacy-
(http://www.sugarcrm.com policy)
(http://blog.sugarcrm.com/) /sugarcrm-security-
/news/partner-news) (http://www.sugarcrm.com
/sugarcrm-terms-of-use)
Environmental Policy
(http://www.sugarcrm.com
/environmental-policy)
Impressum
(http://www.sugarcrm.com
/de/impressum)
SUGAR
WORLDWIDE:
Select Region
STAY CONNECTED:
6 de 6 05/04/2017 21:20