Create a simple module for Vtiger CRM

Here I want to explain how to create a simple installable module for vtiger CRM. 

For creating a new installable module named ‘testModule’ for vtiger, we should have an xml file named: ‘manifest.xml’. Contents of this file:
 
<?xml version=”1.0″?>
<module>
<type>extension</type>
<name>testModule</name>
<label>testModule</label>
<parent>Tools</parent>
<version>1.0</version>
<dependencies>
<vtiger_version>5.2.1</vtiger_version>
</dependencies>
</module>
 
The module folder structure:
 
testModule->
        modules->testModule->index.php
        modules->testModule->language->en_us.lang.php
        manifest.xml
 
Write the index file for our purpose. Here is an example to print the ‘Hello World’ when clicking the module:

 
<?php
include_once(‘language/en_us.lang.php’);
echo “<font color=red>”.HELLO_WORLD.”</font>”;
?>
 
Contents of language/en_us.lang.php:
 
<?php
define(‘HELLO_WORLD’,’Hello World’);
?>
 
Then we have to create a .zip archive file for installation via vtiger module manager. Create the ‘testModule.zip’ file inside the module folder ‘testModule’ and compress the contents ‘modules’ and ‘manifest.xml’ to the ‘testModule.zip’.
 
Then install the zip file via vtiger ‘Settings->Module Manger’ menu. Go to custom modules tab and click on the ‘Import New’ button to install it.
 
 
 
 

After installation you can see the module under ‘Tools’ menu. The content will be:
 
 
Enjoy creating more modules!
 
<?php
define(‘HELLO_WORLD’,’Hello World’);
?>
testModule->
        modules->testModule->index.php
        modules->testModule->language->en_us.lang.php
        manifest.xml
For creating a new installable module named ‘testModule’ for vtiger, we should have an xml file named: ‘manifest.xml’. Contents of this file:Here I want to explain how to create a simple installable module for vtiger CRM.
For creating a new installable module named ‘testModule’ for vtiger, we should have an xml file named: ‘manifest.xml’. Contents of this file:

Comments

shobin: Hi Ryan, Thanks for your comment and it is very happy to hear that this post is helpful to someone. Now lets come to your issue. Please edit the /etc/php.ini file in your machine and change the value as:  'error_reporting = E_ALL'  and  'display_errors = On'. Then try to click on the module, this will surely display the errors if exists in the module. If it is not helpful, you can send me the index.php file then I can look into it. Thanks and Regards. ".

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Ryan Sandnes says:

    Hey Shobin, thanks for the tutorial! I was pretty excited to finally find an easy module creation tutorial (Payslip wasn’t exactly easy, and I still have no clue how it works), but I am getting a white screen when I click on testModule. Any clue why this would be happening? I followed your instructions to the letter. vTiger created my testModule directory in modules. index.php is in there, and en_us.lang.php is in the language directory. Everything seems to be as it should, but that stupid white screen shows up. There is a serious lack of help in the module development, so I really hope to hear from you!
    Thanks again Shobin

    1. shobin says:

      Hi Ryan,

      Thanks for your comment and it is very happy to hear that this post is helpful to someone. Now lets come to your issue. Please edit the /etc/php.ini file in your machine and change the value as:  'error_reporting = E_ALL'  and  'display_errors = On'. Then try to click on the module, this will surely display the errors if exists in the module. If it is not helpful, you can send me the index.php file then I can look into it.

      Thanks and Regards.

      1. Anonymous says:

        Hello Shobin I have used your to produce a test module for V Tiger. I have used the same code as you told. The moudle is integrated with V Tiger successfully but when I try to run this module the following error is occured.
        Warning: require(modules/Events/language/en_us.lang.php) [function.require]: failed to open stream: No such file or directory in C:\Program Files\vtigercrm-5.2.1\apache\htdocs\vtigerCRM\include\utils\utils.php on line 492
        My Files are code are
        modules\hello\index.php Code
        “.HELLO_WORLD.”“;
        ?>
        modules\hello\language code

        manifest.xml Code


        extension
        hello
        Tools 1.0

        5.1.2


        all these files are place in hello.zip file and this file is used for integration

        1. Anonymous says:

          language file needs to be;
          ‘Hello World’);
          ?>

      2. Martijn says:

        Hi Shobin,
        I created modules using your guide and the comments in the post.
        Worked fine!
        Do also have an easy setup for entering the forms and the views, so I can use this as a new data entry entity?
        Thanks,
        Martijn

      3. Mario Ramirez says:

        Hi Ryan: I just do it all, but in the upload in Module Manager, in Vtiger 6.0.0 Beta gives a "failed" Message. I update the version in manifest.xml but nothing new happens, just the "failed" Message. Any Help will be appreciated Regards Mario Ramirez

    2. Kumutha says:

      Tutorial is good, but change the content of en_us.lang.php file in the form of array… its working for me thnk u so much…:) 🙂

  2. Anonymous says:

    Hi Ryan,
    How’s it going?
    Thanks for this wonderful post.
    I followed your instruction but when the time comes for me to import I got this errors:
    dUnzip2: File ‘manifest.xml’ is not compressed in the zip.
    Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity “test/vtlib/manifest-1311051151.xml” in C:\Program Files (x86)\vtigercrm-5.2.1\apache\htdocs\vtigerCRM\vtlib\Vtiger\PackageImport.php on line 54
    Warning: unlink(test/vtlib/manifest-1311051151.xml) [function.unlink]: No such file or directory in C:\Program Files (x86)\vtigercrm-5.2.1\apache\htdocs\vtigerCRM\vtlib\Vtiger\PackageImport.php on line 55
    This is how I made my folder structure:
    newModule – > modules -> newModules -> index.php
    newModule – > modules -> newModules -> language -> en_us.lang.php
    newModule -> manifesst.xml
    Your quick response will be appreciated.
    Hamm

    1. Anonymous says:

      Hi,
      I had the same problem so downloaded some other modules to see if I could find what was causing it. Turns out you need to don’t zip the initial directory. The base files in the zip should be the modules directory and the manifest.xml file. This solved the problem for me. Hope it helps you!

  3. zarah says:

    I liked it, and I thought there were a lot of subtleties and nuances that you don’t get right away. But that’s just my opinion, you’re completely entitled to yours.

  4. Anonymous says:

    For anybody in the future that may happen to get slightly lost in this, I finally managed to figure it out a bit.
    First, Shobin, thanks again for having a very simple tutorial on this… The others jump into something quite complex when all many of us want is a good starting point to work our way up with=)
    en_us.lang.php must look like this: $mod_strings = Array('HELLO_WORLD' => 'Hello World');
    If you are having trouble getting this module installed, do *not* create the source code or directory in the vTiger modules directory. Create them somewhere else entirely. vTiger will try to create the module itself when you import it! This was the source of many of my problems and I’m guessing the same thing causing everybody else problems.
    Make sure you use the module folder structure exactly:
    1) Create a directory called testModule
    2) Inside that directory, create manifest.xml and directory called modules
    3) Inside the modules directory, create another directory called testModule
    4) Inside the new testModule directory (Should now look like testModule->modules->testModule), create index.php and a new directory called language.
    5) Inside the language directory, create a file called en_us.lang.php
    That should be it. The big thing is to make sure this wasn’t created inside vTiger! Hope this helps people in the future!

    1. Anonymous says:

      please help!!!!
      how can i create a new module using vtlib. the procedure they have given in the vtlib pdf doesnt exactly tell us which file we should edit or use. am using vtigercrm 5.3.0
      kind regards

  5. walter says:

    Hi,
    thanks for your contribution on creating a new module, am in the process of creating one and am stuck in the middle of the process after doing all you had stated in importing the module in the module manager but i get an error “invalid file provided for module import! try again”…i will grateful appreciate your help.thank you.

    1. Ron says:

      Appreciate the recommendation. Let me try it out.

  6. Anonymous says:

    Invalid file provided for module import! Try Again. I have created as per above information but still it says invalid file..
    please help me.

  7. Anonymous says:

    i followed above instruction and created all files and folders but when i installed module its generate a
    “dUnzip2: File ‘manifest.xml’ is not compressed in the zip.” error and i also added below code in language file
    ‘Hello World’);
    ?>
    Can u please help me

  8. Rostam says:

    Hi Shobin, I just saw your tutorial. Though it’s a few years old I want to thank for this! It’s much more understandable than vtigers payslip tutorial.
    If you could answer me one question I am fighting with would be so great.
    How can I integrate the new module inside the Projects Module? It should look like all the other Modules in Projects->More Information. So that right above Project Tasks there is the modules title “testModule” and opens just like all the other ones…
    Couldn’t find a solution for this until now… and I must say I am very new to vtiger.
    Appreciate your help.
    Regards from Germany 🙂

  9. Anonymous says:

    I have done the job but when clicking on testModule it is giving following error
    Warning: require(modules/Events/language/en_us.lang.php) [function.require]: failed to open stream: No such file or directory in C:\Program Files\vtigercrm-5.4.0\apache\htdocs\vtigerCRM\include\utils\utils.php on line 498.
    I am using windows 7 and accesing the testModule folder outside of Vtiger installation folder.
    Please help. Awaiting an early reply.
    Regards
    Sanjib

    1. program pit says:

      Hello great blog! Does running a blog similar to this take
      a lot of work? I’ve absolutely no understanding of coding however I had been
      hoping to start my own blog soon. Anyway, if you have any suggestions or
      tips for new blog owners please share. I know this is off
      topic nevertheless I just needed to ask. Thank you!

  10. Anonymous says:

    Hello,
    I created a module for vtiger But when i upload this module in the module manager i got a error like:
    dUnzip2: File ‘manifest.xml’ is not compressed in the zip.
    Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity “test/vtlib/manifest-1369213987.xml” in G:\wamp\www\crmdev\vtlib\Vtiger\PackageImport.php on line 54
    Warning: unlink(test/vtlib/manifest-1369213987.xml) [function.unlink]: No such file or directory in G:\wamp\www\crmdev\vtlib\Vtiger\PackageImport.php on line 55
    What is the error? how can i fix this?

    1. Anonymous says:

      just put all content in .zip file
      ex:
      test.zip->manifest.xml
      test.zip->modules->index.php

  11. Anonymous says:

    Hi,
    I did all changes in new module still getting error while uploading module
    “Invalid file provided for module import! Try Again.”
    Error is coming might be because of vtiger version i am using.
    My vtiger version is 5.4.0

  12. Anonymous says:

    Is php version effects custom module installation in vtiger crm ? my php version is 5.2.

© 2020 Zesty Beanz Pvt Ltd All Rights Reserved.