Quote:
Originally Posted by crmsiva
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