| Server IP : 138.197.176.125 / Your IP : 216.73.217.122 Web Server : Apache/2.4.41 (Ubuntu) System : Linux SuiteCRM-8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/suitesupport.varianceinfotech.net/ |
Upload File : |
<?php
$Vtiger_Utils_Log = true;
include_once('vtlib/Vtiger/Menu.php');
include_once('vtlib/Vtiger/Module.php');
//create objact and mention module place ex:Sales
$module = new Vtiger_Module();
$module->name = 'CTPushNotification';
$module->parent = 'Sales';
$module->save();
//start creating table
$module->initTables();
$module->initWebservice();
$block1 = new Vtiger_Block();
$block1->label = 'Push Notification Information';
$module->addBlock($block1);
$block2 = new Vtiger_Block();
$block2->label = 'Description';
$module->addBlock($block2);
$field1 = new Vtiger_Field();
$field1->name = 'pn_title'; //Input Field name
$field1->label = 'Push Notification Title'; //Input Label
$field1->table = $module->basetable; //Table Name
$field1->column = 'pn_title';
$field1->columntype = 'VARCHAR(50)';
$field1->uitype = 2;
$field1->typeofdata = 'V~M';
$block1->addField($field1); //to add field in block
$field2 = new Vtiger_Field();
$field2->name = 'pn_related'; //Input Field name
$field2->label = 'Related Module'; //Input Label
$field2->table = $module->basetable; //Table Name
$field2->column = 'pn_related';
$field2->columntype = 'VARCHAR(100)';
$field2->uitype = 10;
$field2->typeofdata = 'V~M';
$block1->addField($field2); //to add field in block
$field2->setRelatedModules(Array('Contacts','Leads','Accounts','HelpDesk','Potentials','Project','ProjectTask'));
$field3 = new Vtiger_Field();
$field3->name = 'pushnotificationstatus'; //Input Field name
$field3->label = 'Push Notification Status'; //Input Label
$field3->table = $module->basetable; //Table Name
$field3->column = 'pushnotificationstatus';
$field3->columntype = 'VARCHAR(255)';
$field3->uitype = 15;
$field3->setPickListValues(Array('Draft' , 'Send', 'Failed'));
$field3->typeofdata = 'V~O';
$block1->addField($field3); //to add field in block
$field4 = new Vtiger_Field();
$field4->name = 'devicekey'; //Input Field name
$field4->label = 'Device Key'; //Input Label
$field4->table = $module->basetable; //Table Name
$field4->column = 'devicekey';
$field4->columntype = 'TEXT';
$field4->uitype = 19;
$field4->typeofdata = 'V~O';
$block1->addField($field4); //to add field in block
$field5 = new Vtiger_Field();
$field5->name = 'description'; //Input Field name
$field5->label = 'Description'; //Input Label
$field5->table = $module->basetable; //Table Name
$field5->column = 'description';
$field5->columntype = 'TEXT';
$field5->uitype = 19;
$field5->typeofdata = 'V~O';
$block2->addField($field5); //to add field in block
$field6 = new Vtiger_Field();
$field6->name = 'pushnotification_response'; //Input Field name
$field6->label = 'Push Notification Response'; //Input Label
$field6->table = $module->basetable; //Table Name
$field6->column = 'pushnotification_response';
$field6->columntype = 'TEXT';
$field6->uitype = 19;
$field6->typeofdata = 'V~O';
$block1->addField($field6); //to add field in block
$field7 = new Vtiger_Field();
$field7->name = 'pushnotification_no'; //Input Field name
$field7->label = 'PushNotification No'; //Input Label
$field7->table = $module->basetable; //Table Name
$field7->column = 'pushnotification_no';
$field7->columntype = 'VARCHAR(255)';
$field7->uitype = 4;
$field7->typeofdata = 'V~O';
$module->setEntityIdentifier($field7);
$block1->addField($field7); //to add field in block
$field8 = new Vtiger_Field();
$field8->name = 'createdtime';
$field8->label = 'Created Time';
$field8->table = 'vtiger_crmentity';
$field8->column = 'createdtime';
$field8->columntype = 'datetime';
$field8->uitype = 70;
$field8->displaytype = 2;
$field8->typeofdata = 'DT~O';
$block1->addField($field8);
$field9 = new Vtiger_Field();
$field9->name = 'modifiedtime';
$field9->label = 'Modified Time';
$field9->table = 'vtiger_crmentity';
$field9->column = 'modifiedtime';
$field9->columntype = 'datetime';
$field9->uitype = 70;
$field9->displaytype = 2;
$field9->typeofdata = 'DT~O';
$block1->addField($field9);
$field10 = new Vtiger_Field();
$field10->name = 'assigned_user_id';
$field10->label = 'Assigned To';
$field10->table = 'vtiger_crmentity';
$field10->column = 'smownerid';
$field10->columntype = 'int(19)';
$field10->uitype = 53;
$field10->typeofdata = 'V~M';
$block1->addField($field10);
$field11 = new Vtiger_Field();
$field11->name = 'related_record_id'; //Input Field name
$field11->label = 'Related Record Id'; //Input Label
$field11->table = $module->basetable; //Table Name
$field11->column = 'related_record_id';
$field11->columntype = 'VARCHAR(50)';
$field11->uitype = 2;
$field11->typeofdata = 'V~O';
$block1->addField($field11); //to add field in block
$filter1 = new Vtiger_Filter();
$filter1->name = 'All';
$filter1->isdefault = true;
$module->addFilter($filter1);
// Add fields to the filter created
$filter1->addField($field1, 1);
$filter1->addField($field2, 2);
$filter1->addField($field3, 3);
/* Set sharing access of this module */
$module->setDefaultSharing('Private');
// Enable and Disable available tools
$module->enableTools(Array('Import', 'Export'));
$module->disableTools('Merge');
?>