[Vtigercrm-developers] Vtiger 7 preview

Sutharsan Jeganathan ajstharsan at gmail.com
Mon Dec 12 06:38:02 GMT 2016


Hi

An easy way to run this script :)
*Run below script in browser with URL parameter module=<modulename>*
<?php
$moduleName = $_REQUEST['module'];
$Vtiger_Utils_Log = true;
include_once 'vtlib/Vtiger/Module.php';
include_once 'vtlib/Vtiger/Package.php';
include_once 'includes/main/WebUI.php';
require_once('vtlib/Vtiger/Block.php');
require_once('vtlib/Vtiger/Field.php');
include_once 'include/Webservices/Utils.php';
require_once 'modules/ModComments/ModComments.php';
include_once('modules/ModTracker/ModTracker.php');
            $path = $moduleName.".zip";
            $package = new Vtiger_Package();
            $module  = $package->getModuleNameFromZip($path);

            $moduleInstance = Vtiger_Module::getInstance($module);
            if ($moduleInstance) {
                echo "ERROR: Module $module already exists!\n";
            } else {
                echo "Importing ...";
                $package->import($path);
                echo "DONE.\n";
            }
$moduleInstance = Vtiger_Module::getInstance($moduleName);
ModTracker::enableTrackingForModule($moduleInstance->id);
$commentsModule = Vtiger_Module::getInstance('ModComments');
$fieldInstance = Vtiger_Field::getInstance('related_to', $commentsModule);
$fieldInstance->setRelatedModules(array($moduleName));


Thanks
Sutharsan Jeganathan

On Fri, Dec 9, 2016 at 8:31 PM, Matteo Baranzoni <info at greenbitweb.com>
wrote:

> i try to import module with this php script and it works:
>
> <?php
>> /*+*********************************************************
>> *************************
>>  * The contents of this file are subject to the vtiger CRM Public License
>> Version 1.0
>>  * ("License"); You may not use this file except in compliance with the
>> License
>>  * The Original Code is:  vtiger CRM Open Source
>>  * The Initial Developer of the Original Code is vtiger.
>>  * Portions created by vtiger are Copyright (C) vtiger.
>>  * All Rights Reserved.
>>  ***********************************************************
>> *************************/
>> $Vtiger_Utils_Log = true;
>> include_once 'vtlib/Vtiger/Module.php';
>> include_once 'vtlib/Vtiger/Package.php';
>> include_once 'includes/main/WebUI.php';
>> require_once('vtlib/Vtiger/Block.php');
>> require_once('vtlib/Vtiger/Field.php');
>> include_once 'include/Webservices/Utils.php';
>> require_once 'modules/ModComments/ModComments.php';
>> include_once('modules/ModTracker/ModTracker.php');
>> $path = "Accounting.zip";
>> $package = new Vtiger_Package();
>> $module  = $package->getModuleNameFromZip($path);
>>
>> $moduleInstance = Vtiger_Module::getInstance($module);
>> if ($moduleInstance) {
>> echo "ERROR: Module $module already exists!\n";
>> } else {
>> echo "Importing ...";
>> $package->import($path);
>> echo "DONE.\n";
>> }
>> $moduleInstance = Vtiger_Module::getInstance('Accounting');
>> ModTracker::enableTrackingForModule($moduleInstance->id);
>> $commentsModule = Vtiger_Module::getInstance('ModComments');
>> $fieldInstance = Vtiger_Field::getInstance('related_to',
>> $commentsModule);
>> $fieldInstance->setRelatedModules(array('Accounting'));
>
>
> my accounting module does not work well but it's inventory based module
> with some js extra features.
>
> 2016-12-09 14:49 GMT+01:00 Alan Lord <alanslists at gmail.com>:
>
>> On 09/12/16 13:46, Alan Lord wrote:
>>
>>> Copy the file from the old layout and rename it...
>>>
>>> sudo cp
>>>> ../../../../vlayout/modules/Settings/ModuleManager/ImportUse
>>>> rModuleStep1.tpl
>>>> Step1.tpl
>>>>
>>>
>>> But do remember to backup Step1.tpl first
>>>
>>
>> PS: The javascript is broken so it still won't work ;-)
>>
>> Didn't the vtiger Console "Import Module" feature work?
>>
>> http://community.vtiger.com/help/vtigercrm/developers/vtlib/
>> console-tool.html#import-module
>>
>>
>> _______________________________________________
>> http://www.vtiger.com/
>>
>
>
> _______________________________________________
> http://www.vtiger.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20161212/9f13962d/attachment.html>


More information about the vtigercrm-developers mailing list