Add module

In this option the procedure of adding new module is described with respect to the both license user given bellow:

1) SaaS license user: - The new custom module can be added for that you need to send the request to the software support team with the details of the module you want to add. Support team will provide you access to your SaaS setup files. Once you have access to files you can follow the same procedure as that for download license described below.

2) Download license user: - For adding any new module for download license there is the procedure given below which will need little technical background.

Add custom module (using download license) procedure:-

Below are steps for adding a custom module - we will describe this using a test module "Test".

Section A} How to create the module:

Step 1) Create a module file under modules folder of your system installation files modules/module_test.php.

Step 2) Open file module_test.php and here you can add your module classes and functions.

class test {

function hello_world($operation)

{

echo 'Hello world';

}

function add_testing($operation)

{

$data=parse_form_array($operation['vis_action']);

$database=new class_database();

include_once(VIS_PATH_CLASS.VIS_CLASS_PREFIX.'test.php');

$object=new class_test($database);

$return=$object->add_testing($data);

$database->database_disconnect();

}

}

Step 3) Create a class files under classes folder of your installation files classes/class_test.php

Step 4) Open file class_test.php and here you can add your module classes and functions.

class class_test

{

var $database;

function class_test($connection)

{

$this->database = $connection;

}

function add_testing($data)

{

$result=$this->database->query_exec($query);

}

}

Step 5) Login to the manage portal and go to above path.

Path: Settings/Modules/Add Module.

Section B} How to test your module:

Step 1) Use query string with vis_module=test&vis_operation=function_in_module.

Step 2) Can submit using Ajax.

$(this).visExecution('submit_form', {'vis_module':'test', 'vis_operation':'add_testing', 'vis_form':'vis_form_id'})

Step 3) Submitted form can fetch the function with single line  :

$data=parse_form_array($operation['vis_action']);

where $operation is parameter to function add_testing

Step 4) Can load area in helpdesk like:

$('#display_div_id').visExecution('load_area',{'vis_module':'test', 'vis_operation':'hello_world'})

Here data will load whatever printed in function hello_world($operation) from module test