403Webshell
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/suitesupport.varianceinfotech.net/Add_Customer_Subscription_Module.php
<?php

$Vtiger_Utils_Log = true;

include_once 'vtlib/Vtiger/Module.php';
include_once 'vtlib/Vtiger/Menu.php';

$module = new Vtiger_Module();
$module->name = "CustomerSubscription";
$module->parent = 'Sales';
$module->save();

$module->initTables();
$module->initWebservice();

$block1 = new Vtiger_Block();
$block1->label = "LBL_CUSTOMER_SUBSCRIPTION";
$module->addBlock($block1);

$field0  = new Vtiger_Field();
$field0->name = 'customer_subscription_no';
$field0->label= 'Customer Subscription No';
$field0->uitype= 4;
$field0->displaytype= 1;
$field0->table= $module->basetable;
$field0->column = $field0->name;
$field0->columntype = 'VARCHAR(255)';
$field0->typeofdata = 'V~O';
$module->setEntityIdentifier($field0);
$block1->addField($field0);

$field1  = new Vtiger_Field();
$field1->name = 'invoice_id';
$field1->label= 'Invoice Id';
$field1->uitype= 2;
$field1->displaytype= 1;
$field1->table= $module->basetable;
$field1->column = $field1->name;
$field1->columntype = 'VARCHAR(255)';
$field1->typeofdata = 'V~O';
$block1->addField($field1);

$field2  = new Vtiger_Field();
$field2->name = 'invoice_amount';
$field2->label= 'Invoice Amount';
$field2->uitype= 71;
$field2->displaytype= 1;
$field2->table= $module->basetable;
$field2->column = $field2->name;
$field2->columntype = 'decimal(13,2)';
$field2->typeofdata = 'N~O';
$block1->addField($field2);

$field3  = new Vtiger_Field();
$field3->name = 'invoice_pdf_url';
$field3->label= 'Invoice PDF URL';
$field3->uitype= 17;
$field3->displaytype= 1;
$field3->table= $module->basetable;
$field3->column = $field3->name;
$field3->columntype = 'VARCHAR(255)';
$field3->typeofdata = 'V~O';
$block1->addField($field3);

$field4  = new Vtiger_Field();
$field4->name = 'invoice_status';
$field4->label= 'Invoice Status';
$field4->uitype= 15;
$field4->displaytype= 1;
$field4->table= $module->basetable;
$field4->column = $field4->name;
$field4->columntype = 'VARCHAR(255)';
$field4->typeofdata = 'V~O';
$field4->setPicklistValues(Array('Draft', 'Open', 'Paid', 'Uncollectible', 'Void'));
$block1->addField($field4);

$field5  = new Vtiger_Field();
$field5->name = 'contact_name';
$field5->label= 'Contact Name';
$field5->uitype= 10;
$field5->displaytype= 1;
$field5->table= $module->basetable;
$field5->column = $field5->name;
$field5->columntype = 'VARCHAR(255)';
$field5->typeofdata = 'V~O';
$block1->addField($field5);
$field5->setRelatedModules(Array('Contacts'));

$field6 = new Vtiger_Field();
$field6->name = 'customer_order';
$field6->label = 'Customer Order';
$field6->uitype= 10;
$field6->displaytype= 1;
$field6->table= $module->basetable;
$field6->column = $field6->name;
$field6->columntype = 'VARCHAR(255)';
$field6->typeofdata = 'V~O';
$block1->addField($field6);
$field6->setRelatedModules(Array('CustomerOrder'));


// Recommended common fields every Entity module should have (linked to core table)
$mfield1 = new Vtiger_Field();
$mfield1->name = 'assigned_user_id';
$mfield1->label = 'Assigned To';
$mfield1->table = 'vtiger_crmentity';
$mfield1->column = 'smownerid';
$mfield1->columntype = 'int(19)';
$mfield1->uitype = 53;
$mfield1->typeofdata = 'V~M';
$block1->addField($mfield1);

$mfield2 = new Vtiger_Field();
$mfield2->name = 'createdtime';
$mfield2->label= 'Created Time';
$mfield2->table = 'vtiger_crmentity';
$mfield2->column = 'createdtime';
$mfield2->uitype = 70;
$mfield2->typeofdata = 'DT~O';
$mfield2->displaytype= 2;
$block1->addField($mfield2);

$mfield3 = new Vtiger_Field();
$mfield3->name = 'modifiedtime';
$mfield3->label= 'Modified Time';
$mfield3->table = 'vtiger_crmentity';
$mfield3->column = 'modifiedtime';
$mfield3->uitype = 70;
$mfield3->typeofdata = 'DT~O';
$mfield3->displaytype= 2;
$block1->addField($mfield3);

$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);
$filter1->addField($field4, 4);
$filter1->addField($field5, 5);
$filter1->addField($mfield1, 6);
	
// Set sharing access of this module /
$module->setDefaultSharing('Private'); 

// Enable and Disable available tools 
$module->enableTools(Array('Import', 'Export'));
$module->disableTools('Merge');

Youez - 2016 - github.com/yon3zu
LinuXploit