Skip to main content

Install Signature Field

<?php
die();

require('../../config.inc.php');
chdir($root_directory);
require_once('include/utils/utils.php');
require_once('vtlib/Vtecrm/Module.php');
$Vtiger_Utils_Log = true;
global $adb, $table_prefix;
VteSession::start(); // crmv@128133

SDK::setClass('Touch', 'TouchCustom', 'modules/SDK/src/MyCustomizations/modules/Touch/TouchCustom.php'); // You can replace "Custom" with whatever you 

$moduleName = 'ModuleCustom'; // ModuleCustom is the module where you want to enable the signature

$signatureBlock = new Vtiger_Block();
$signatureBlock->label = 'LBL_SIGNATURE_BLOCK';
$moduleInstance = Vtiger_Module::getInstance($moduleName);
$moduleInstance->addBlock($signatureBlock);

$fields = array();
$fields[] = array(
	'module' => $moduleName, 
	'block' => 'LBL_SIGNATURE_BLOCK', 
	'name' => 'signature', 
	'label' => 'signature', 
	'uitype' => '1016', 
	'columntype' => 'VARCHAR(255)', 
	'typeofdata' => 'V~O'
);
include('modules/SDK/examples/fieldCreate.php');

SDK::setLanguageEntries($moduleName, 'LBL_SIGNATURE_BLOCK', array('it_it' => 'Signature Information', 'en_us' => 'Signature Information'));
SDK::setLanguageEntries($moduleName, 'signature', array('it_it' => 'Firma', 'en_us' => 'Signature'));
SDK::setLanguageEntries($moduleName, 'NO_SIGNATURE_IMAGE', array('it_it' => 'Nessuna Firma', 'en_us' => 'No Signature'));
  •  Create new file TouchCustom.php in modules/SDK
  • Create new file Custom.js (or whatever you want) in modules/Touch/overrides. The app will automatically download it andto extends/overwritesextend/overwrite the default behavior. Put the following piece of code in the file:
(function() {
	if (Vtecrm && Vtecrm.app) {
		Ext.define("Vtecrm.view.ShowRecordCustom", { // You can replace "Custom" with whatever you want
			override: "Vtecrm.view.ShowRecord",
			signatureModules: ["HelpDesk", "ModuleCustom"ModuleCustom1", "ModuleCustom2", "ModuleCustomN"], // ModuleCustomModuleCustom* isare yourthe modules where you want to enable the signature
		});
	}
})();

If you already have customizations in the file, you just need to add the class definition (Vtecrm.view.ShowRecordCustom).

If you have already extended/overwritten the class Vtecrm.view.ShowRecord you just need to overwrite the variable signatureModules adding the modules where you want to enable the signature