本文整理汇总了PHP中Vtiger_Language类的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Language类的具体用法?PHP Vtiger_Language怎么用?PHP Vtiger_Language使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Vtiger_Language类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create_tables
//.........这里部分代码省略.........
$this->db->query("insert into vtiger_parenttab values (3,'Sales',3,0)");
$this->db->query("insert into vtiger_parenttab values (4,'Support',4,0)");
$this->db->query("insert into vtiger_parenttab values (5,'Analytics',5,0)");
$this->db->query("insert into vtiger_parenttab values (6,'Inventory',6,0)");
$this->db->query("insert into vtiger_parenttab values (7,'Tools',7,0)");
$this->db->query("insert into vtiger_parenttab values (8,'Settings',8,0)");
$this->db->query("insert into vtiger_parenttabrel values (1,9,2)");
$this->db->query("insert into vtiger_parenttabrel values (1,28,4)");
$this->db->query("insert into vtiger_parenttabrel values (1,3,1)");
$this->db->query("insert into vtiger_parenttabrel values (3,7,1)");
$this->db->query("insert into vtiger_parenttabrel values (3,6,2)");
$this->db->query("insert into vtiger_parenttabrel values (3,4,3)");
$this->db->query("insert into vtiger_parenttabrel values (3,2,4)");
$this->db->query("insert into vtiger_parenttabrel values (3,20,5)");
$this->db->query("insert into vtiger_parenttabrel values (3,22,6)");
$this->db->query("insert into vtiger_parenttabrel values (3,23,7)");
$this->db->query("insert into vtiger_parenttabrel values (3,19,8)");
$this->db->query("insert into vtiger_parenttabrel values (3,8,9)");
$this->db->query("insert into vtiger_parenttabrel values (4,13,1)");
$this->db->query("insert into vtiger_parenttabrel values (4,15,2)");
$this->db->query("insert into vtiger_parenttabrel values (4,6,3)");
$this->db->query("insert into vtiger_parenttabrel values (4,4,4)");
$this->db->query("insert into vtiger_parenttabrel values (4,8,5)");
$this->db->query("insert into vtiger_parenttabrel values (5,1,2)");
$this->db->query("insert into vtiger_parenttabrel values (5,25,1)");
$this->db->query("insert into vtiger_parenttabrel values (6,14,1)");
$this->db->query("insert into vtiger_parenttabrel values (6,18,2)");
$this->db->query("insert into vtiger_parenttabrel values (6,19,3)");
$this->db->query("insert into vtiger_parenttabrel values (6,21,4)");
$this->db->query("insert into vtiger_parenttabrel values (6,22,5)");
$this->db->query("insert into vtiger_parenttabrel values (6,20,6)");
$this->db->query("insert into vtiger_parenttabrel values (6,23,7)");
$this->db->query("insert into vtiger_parenttabrel values (7,24,1)");
$this->db->query("insert into vtiger_parenttabrel values (7,27,2)");
$this->db->query("insert into vtiger_parenttabrel values (7,8,3)");
$this->db->query("insert into vtiger_parenttabrel values (2,26,1)");
$this->db->query("insert into vtiger_parenttabrel values (2,6,2)");
$this->db->query("insert into vtiger_parenttabrel values (2,4,3)");
$this->db->query("insert into vtiger_parenttabrel values (2,28,4)");
$this->db->query("insert into vtiger_parenttabrel values (4,28,7)");
$this->db->query("insert into vtiger_parenttabrel values (2,7,5)");
$this->db->query("insert into vtiger_parenttabrel values (2,9,6)");
$this->db->query("insert into vtiger_parenttabrel values (4,9,8)");
$this->db->query("insert into vtiger_parenttabrel values (2,8,8)");
$this->db->query("insert into vtiger_parenttabrel values (3,9,11)");
//add settings page to database starts
$this->addEntriesForSettings();
//add settings page to database end
//Added to populate the default inventory tax informations
$vatid = $this->db->getUniqueID("vtiger_inventorytaxinfo");
$salesid = $this->db->getUniqueID("vtiger_inventorytaxinfo");
$serviceid = $this->db->getUniqueID("vtiger_inventorytaxinfo");
$this->db->query("insert into vtiger_inventorytaxinfo values({$vatid},'tax" . $vatid . "','VAT','4.50','0')");
$this->db->query("insert into vtiger_inventorytaxinfo values({$salesid},'tax" . $salesid . "','Sales','10.00','0')");
$this->db->query("insert into vtiger_inventorytaxinfo values({$serviceid},'tax" . $serviceid . "','Service','12.50','0')");
//After added these taxes we should add these taxes as columns in vtiger_inventoryproductrel table
$this->db->query("alter table vtiger_inventoryproductrel add column tax{$vatid} decimal(7,3) default NULL");
$this->db->query("alter table vtiger_inventoryproductrel add column tax{$salesid} decimal(7,3) default NULL");
$this->db->query("alter table vtiger_inventoryproductrel add column tax{$serviceid} decimal(7,3) default NULL");
//Added to handle picklist uniqueid for the picklist values
//$this->db->query("insert into vtiger_picklistvalues_seq values(1)");
//Added to populate the default Shipping & Hanlding tax informations
$shvatid = $this->db->getUniqueID("vtiger_shippingtaxinfo");
$shsalesid = $this->db->getUniqueID("vtiger_shippingtaxinfo");
$shserviceid = $this->db->getUniqueID("vtiger_shippingtaxinfo");
$this->db->query("insert into vtiger_shippingtaxinfo values({$shvatid},'shtax" . $shvatid . "','VAT','4.50','0')");
$this->db->query("insert into vtiger_shippingtaxinfo values({$shsalesid},'shtax" . $shsalesid . "','Sales','10.00','0')");
$this->db->query("insert into vtiger_shippingtaxinfo values({$shserviceid},'shtax" . $shserviceid . "','Service','12.50','0')");
//After added these taxes we should add these taxes as columns in vtiger_inventoryshippingrel table
$this->db->query("alter table vtiger_inventoryshippingrel add column shtax{$shvatid} decimal(7,3) default NULL");
$this->db->query("alter table vtiger_inventoryshippingrel add column shtax{$shsalesid} decimal(7,3) default NULL");
$this->db->query("alter table vtiger_inventoryshippingrel add column shtax{$shserviceid} decimal(7,3) default NULL");
//version file is included here because without including this file version cannot be get
include 'vtigerversion.php';
$this->db->query("insert into vtiger_version values(" . $this->db->getUniqueID('vtiger_version') . ",'" . $vtiger_current_version . "','" . $vtiger_current_version . "')");
//Register default language English
require_once 'vtlib/Vtiger/Language.php';
$vtlanguage = new Vtiger_Language();
// JFV - set Japanese language info into vtiger_language table and set it as default, during default data populator operation. Default user language becomes ja
// $vtlanguage->register('en_us','US English','English',true,true,true);
$vtlanguage->register('en_us', 'US English', 'English', false, true, true);
$vtlanguage->register('ja', 'Japanese (日本語)', 'Japanese', true, true, true);
// JFV END
$this->initWebservices();
/**
* Setup module sequence numbering.
*/
$modseq = array('Leads' => 'LEA', 'Accounts' => 'ACC', 'Campaigns' => 'CAM', 'Contacts' => 'CON', 'Potentials' => 'POT', 'HelpDesk' => 'TT', 'Quotes' => 'QUO', 'SalesOrder' => 'SO', 'PurchaseOrder' => 'PO', 'Invoice' => 'INV', 'Products' => 'PRO', 'Vendors' => 'VEN', 'PriceBooks' => 'PB', 'Faq' => 'FAQ', 'Documents' => 'DOC');
foreach ($modseq as $modname => $prefix) {
$this->addInventoryRows(array(array('semodule' => $modname, 'active' => '1', 'prefix' => $prefix, 'startid' => '1', 'curid' => '1')));
}
// Adding Sharing Types for Reports
$this->db->query("insert into vtiger_reportfilters values(1,'Private')");
$this->db->query("insert into vtiger_reportfilters values(2,'Public')");
$this->db->query("insert into vtiger_reportfilters values(3,'Shared')");
require 'modules/Utilities/Currencies.php';
foreach ($currencies as $key => $value) {
$this->db->query("insert into vtiger_currencies values(" . $this->db->getUniqueID("vtiger_currencies") . ",'{$key}','" . $value[0] . "','" . $value[1] . "')");
}
}
示例2: installVtlibModule
function installVtlibModule($packagename, $packagepath, $customized = false)
{
global $log;
require_once 'vtlib/Vtiger/Package.php';
require_once 'vtlib/Vtiger/Module.php';
$Vtiger_Utils_Log = true;
$package = new Vtiger_Package();
if ($package->isLanguageType($packagepath)) {
$package = new Vtiger_Language();
$package->import($packagepath, true);
return;
}
$module = $package->getModuleNameFromZip($packagepath);
$module_exists = false;
$module_dir_exists = false;
if ($module == null) {
$log->fatal("{$packagename} Module zipfile is not valid!");
} else {
if (Vtiger_Module::getInstance($module)) {
$log->fatal("{$module} already exists!");
$module_exists = true;
}
}
if ($module_exists == false) {
$log->debug("{$module} - Installation starts here");
$package->import($packagepath, true);
$moduleInstance = Vtiger_Module::getInstance($module);
if (empty($moduleInstance)) {
$log->fatal("{$module} module installation failed!");
}
}
}
示例3: VTTaskManager
$invWorkFlow->test = '[{"fieldname":"subject","operation":"does not contain","value":"`!`"}]';
$invWorkFlow->description = "UpdateInventoryProducts On Every Save";
$vtWorkFlow->save($invWorkFlow);
$tm = new VTTaskManager($adb);
$task = $tm->createTask('VTEntityMethodTask', $invWorkFlow->id);
$task->active = true;
$task->methodName = "UpdateInventory";
$tm->saveTask($task);
/* Support to track if a module is of CrmEntity type or not */
ExecuteQuery("ALTER TABLE vtiger_tab ADD COLUMN isentitytype INT NOT NULL DEFAULT 1");
ExecuteQuery("UPDATE vtiger_tab SET isentitytype=0 WHERE name IN ('Home','Dashboard','Rss','Reports','Portal','Users','Recyclebin')");
/* Support for different languages to be stored in database instead of config file - Vtlib */
ExecuteQuery("CREATE TABLE IF NOT EXISTS vtiger_language(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(50), " . "prefix VARCHAR(10), label VARCHAR(30), lastupdated DATETIME, sequence INT, isdefault INT(1), active INT(1)) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
/* Register default language English. This will automatically register all the other langauges from config file */
require_once 'vtlib/Vtiger/Language.php';
$vtlanguage = new Vtiger_Language();
$vtlanguage->register('en_us', 'US English', 'English', true, true, true);
/* To store relationship between the modules in a common table */
ExecuteQuery("CREATE TABLE IF NOT EXISTS vtiger_crmentityrel (crmid int(11) NOT NULL, module varchar(100) NOT NULL, relcrmid int(11) NOT NULL, relmodule varchar(100) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
/* To store the field to module relationship for uitype 10 */
ExecuteQuery("CREATE TABLE IF NOT EXISTS vtiger_fieldmodulerel (fieldid int(11) NOT NULL, module varchar(100) NOT NULL, relmodule varchar(100) NOT NULL,\n \t\t\t\t\tstatus varchar(10) default NULL, sequence int(11) default NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
/* Making users and groups depends on vtiger_users_seq */
$max_grp_id = $adb->query("SELECT MAX(groupid) as maxid from vtiger_groups");
$maxid = $adb->query_result($max_grp_id, 0, "maxid");
$user_result = $adb->query("select max(id) as userid from vtiger_users");
$inc_num = $adb->query_result($user_result, 0, "userid");
$adb->getUniqueId("vtiger_users");
//Creates vtiger_users_seq table if not exists.
$seq_id = $inc_num + $maxid;
$adb->pquery("UPDATE vtiger_users_seq SET id=?", array($seq_id));
$tab_info = array("vtiger_group2grouprel" => array("fk_2_vtiger_group2grouprel", "(groupid)", "vtiger_groups(groupid)"), "vtiger_users2group" => array("fk_1_vtiger_users2group", "(groupid)", "vtiger_groups(groupid)"), "vtiger_group2role" => array("fk_1_vtiger_group2role", "(groupid)", "vtiger_groups(groupid)"), "vtiger_group2rs" => array("fk_1_vtiger_group2rs", "(groupid)", "vtiger_groups(groupid)"), "vtiger_datashare_grp2grp" => array("fk_2_vtiger_datashare_grp2grp", "(share_groupid)", "vtiger_groups(groupid)"), "vtiger_datashare_grp2grp" => array("fk_3_vtiger_datashare_grp2grp", "(to_groupid)", "vtiger_groups(groupid)"), "vtiger_datashare_grp2role" => array("fk_2_vtiger_datashare_grp2role", "(share_groupid)", "vtiger_groups(groupid)"), "vtiger_datashare_role2group" => array("fk_2_vtiger_datashare_role2group", "(to_groupid)", "vtiger_groups(groupid)"), "vtiger_datashare_grp2rs" => array("fk_2_vtiger_datashare_grp2rs", "(share_groupid)", "vtiger_groups(groupid)"), "vtiger_datashare_rs2grp" => array("fk_2_vtiger_datashare_rs2grp", "(to_groupid)", "vtiger_groups(groupid)"), "vtiger_tmp_read_group_sharing_per" => array("fk_1_vtiger_tmp_read_group_sharing_per", "(sharedgroupid)", "vtiger_groups(groupid)"), "vtiger_tmp_write_group_sharing_per" => array("fk_1_vtiger_tmp_write_group_sharing_per", "(sharedgroupid)", "vtiger_groups(groupid)"));
示例4: create_tables
//.........这里部分代码省略.........
$this->db->query("insert into vtiger_parenttab values (2,'Marketing',2,0)");
$this->db->query("insert into vtiger_parenttab values (3,'Sales',3,0)");
$this->db->query("insert into vtiger_parenttab values (4,'Support',4,0)");
$this->db->query("insert into vtiger_parenttab values (5,'Analytics',5,0)");
$this->db->query("insert into vtiger_parenttab values (6,'Inventory',6,0)");
$this->db->query("insert into vtiger_parenttab values (7,'Tools',7,0)");
$this->db->query("insert into vtiger_parenttab values (8,'Settings',8,0)");
$this->db->query("insert into vtiger_parenttabrel values (1,9,2)");
$this->db->query("insert into vtiger_parenttabrel values (1,28,4)");
$this->db->query("insert into vtiger_parenttabrel values (1,3,1)");
$this->db->query("insert into vtiger_parenttabrel values (3,7,1)");
$this->db->query("insert into vtiger_parenttabrel values (3,6,2)");
$this->db->query("insert into vtiger_parenttabrel values (3,4,3)");
$this->db->query("insert into vtiger_parenttabrel values (3,2,4)");
$this->db->query("insert into vtiger_parenttabrel values (3,20,5)");
$this->db->query("insert into vtiger_parenttabrel values (3,22,6)");
$this->db->query("insert into vtiger_parenttabrel values (3,23,7)");
$this->db->query("insert into vtiger_parenttabrel values (3,19,8)");
$this->db->query("insert into vtiger_parenttabrel values (3,8,9)");
$this->db->query("insert into vtiger_parenttabrel values (4,13,1)");
$this->db->query("insert into vtiger_parenttabrel values (4,15,2)");
$this->db->query("insert into vtiger_parenttabrel values (4,6,3)");
$this->db->query("insert into vtiger_parenttabrel values (4,4,4)");
$this->db->query("insert into vtiger_parenttabrel values (4,8,5)");
$this->db->query("insert into vtiger_parenttabrel values (5,1,2)");
$this->db->query("insert into vtiger_parenttabrel values (5,25,1)");
$this->db->query("insert into vtiger_parenttabrel values (6,14,1)");
$this->db->query("insert into vtiger_parenttabrel values (6,18,2)");
$this->db->query("insert into vtiger_parenttabrel values (6,19,3)");
$this->db->query("insert into vtiger_parenttabrel values (6,21,4)");
$this->db->query("insert into vtiger_parenttabrel values (6,22,5)");
$this->db->query("insert into vtiger_parenttabrel values (6,20,6)");
$this->db->query("insert into vtiger_parenttabrel values (6,23,7)");
$this->db->query("insert into vtiger_parenttabrel values (7,24,1)");
$this->db->query("insert into vtiger_parenttabrel values (7,27,2)");
$this->db->query("insert into vtiger_parenttabrel values (7,8,3)");
$this->db->query("insert into vtiger_parenttabrel values (2,26,1)");
$this->db->query("insert into vtiger_parenttabrel values (2,6,2)");
$this->db->query("insert into vtiger_parenttabrel values (2,4,3)");
$this->db->query("insert into vtiger_parenttabrel values (2,28,4)");
$this->db->query("insert into vtiger_parenttabrel values (4,28,7)");
$this->db->query("insert into vtiger_parenttabrel values (2,7,5)");
$this->db->query("insert into vtiger_parenttabrel values (2,9,6)");
$this->db->query("insert into vtiger_parenttabrel values (4,9,8)");
$this->db->query("insert into vtiger_parenttabrel values (2,8,8)");
$this->db->query("insert into vtiger_parenttabrel values (3,9,11)");
//add settings page to database starts
$this->addEntriesForSettings();
//add settings page to database end
//Added to populate the default inventory tax informations
$vatid = $this->db->getUniqueID("vtiger_inventorytaxinfo");
$salesid = $this->db->getUniqueID("vtiger_inventorytaxinfo");
$serviceid = $this->db->getUniqueID("vtiger_inventorytaxinfo");
$this->db->query("insert into vtiger_inventorytaxinfo values({$vatid},'tax" . $vatid . "','VAT','4.50','0')");
$this->db->query("insert into vtiger_inventorytaxinfo values({$salesid},'tax" . $salesid . "','Sales','10.00','0')");
$this->db->query("insert into vtiger_inventorytaxinfo values({$serviceid},'tax" . $serviceid . "','Service','12.50','0')");
//After added these taxes we should add these taxes as columns in vtiger_inventoryproductrel table
$this->db->query("alter table vtiger_inventoryproductrel add column tax{$vatid} decimal(7,3) default NULL");
$this->db->query("alter table vtiger_inventoryproductrel add column tax{$salesid} decimal(7,3) default NULL");
$this->db->query("alter table vtiger_inventoryproductrel add column tax{$serviceid} decimal(7,3) default NULL");
//Added to handle picklist uniqueid for the picklist values
//$this->db->query("insert into vtiger_picklistvalues_seq values(1)");
//Added to populate the default Shipping & Hanlding tax informations
$shvatid = $this->db->getUniqueID("vtiger_shippingtaxinfo");
$shsalesid = $this->db->getUniqueID("vtiger_shippingtaxinfo");
$shserviceid = $this->db->getUniqueID("vtiger_shippingtaxinfo");
$this->db->query("insert into vtiger_shippingtaxinfo values({$shvatid},'shtax" . $shvatid . "','VAT','4.50','0')");
$this->db->query("insert into vtiger_shippingtaxinfo values({$shsalesid},'shtax" . $shsalesid . "','Sales','10.00','0')");
$this->db->query("insert into vtiger_shippingtaxinfo values({$shserviceid},'shtax" . $shserviceid . "','Service','12.50','0')");
//After added these taxes we should add these taxes as columns in vtiger_inventoryshippingrel table
$this->db->query("alter table vtiger_inventoryshippingrel add column shtax{$shvatid} decimal(7,3) default NULL");
$this->db->query("alter table vtiger_inventoryshippingrel add column shtax{$shsalesid} decimal(7,3) default NULL");
$this->db->query("alter table vtiger_inventoryshippingrel add column shtax{$shserviceid} decimal(7,3) default NULL");
//version file is included here because without including this file version cannot be get
include 'vtigerversion.php';
$this->db->query("insert into vtiger_version values(" . $this->db->getUniqueID('vtiger_version') . ",'" . $vtiger_current_version . "','" . $vtiger_current_version . "')");
//Register default language English
require_once 'vtlib/Vtiger/Language.php';
$vtlanguage = new Vtiger_Language();
$vtlanguage->register('en_us', 'US English', 'English', true, true, true);
$this->insertUser2mergefields(0);
$this->insertUser2mergefields(1);
$this->db->query("update vtiger_user2mergefields set visible=1 where fieldid in(1,38,40,65,104,106,111,152,156,255)");
$this->initWebservices();
/**
* Setup module sequence numbering.
*/
$modseq = array('Leads' => 'LEA', 'Accounts' => 'ACC', 'Campaigns' => 'CAM', 'Contacts' => 'CON', 'Potentials' => 'POT', 'HelpDesk' => 'TT', 'Quotes' => 'QUO', 'SalesOrder' => 'SO', 'PurchaseOrder' => 'PO', 'Invoice' => 'INV', 'Products' => 'PRO', 'Vendors' => 'VEN', 'PriceBooks' => 'PB', 'Faq' => 'FAQ', 'Documents' => 'DOC');
foreach ($modseq as $modname => $prefix) {
$this->addInventoryRows(array(array('semodule' => $modname, 'active' => '1', 'prefix' => $prefix, 'startid' => '1', 'curid' => '1')));
}
// Adding Sharing Types for Reports
$this->db->query("insert into vtiger_reportfilters values(1,'Private')");
$this->db->query("insert into vtiger_reportfilters values(2,'Public')");
$this->db->query("insert into vtiger_reportfilters values(3,'Shared')");
require_once 'modules/Utilities/Currencies.php';
foreach ($currencies as $key => $value) {
$this->db->query("insert into vtiger_currencies values(" . $this->db->getUniqueID("vtiger_currencies") . ",'{$key}','" . $value[0] . "','" . $value[1] . "')");
}
}
示例5: updateVtlibModule
function updateVtlibModule($module, $packagepath)
{
global $log, $_installOrUpdateVtlibModule;
if (!file_exists($packagepath)) {
return;
}
if (isset($_installOrUpdateVtlibModule[$module . $packagepath])) {
return;
}
$_installOrUpdateVtlibModule[$module . $packagepath] = 'update';
require_once 'vtlib/Vtiger/Package.php';
require_once 'vtlib/Vtiger/Module.php';
$Vtiger_Utils_Log = defined('INSTALLATION_MODE_DEBUG') ? INSTALLATION_MODE_DEBUG : true;
$package = new Vtiger_Package();
if ($package->isLanguageType($packagepath)) {
require_once 'vtlib/Vtiger/Language.php';
$languagePack = new Vtiger_Language();
$languagePack->update(null, $packagepath, true);
return;
}
if ($module == null) {
$log->fatal("Module name is invalid");
} else {
$moduleInstance = Vtiger_Module::getInstance($module);
if ($moduleInstance || $package->isModuleBundle($packagepath)) {
$log->debug("{$module} - Module instance found - Update starts here");
$package->update($moduleInstance, $packagepath);
} else {
$log->fatal("{$module} doesn't exists!");
}
}
}
示例6: updateVtlibModule
function updateVtlibModule($module, $packagepath)
{
global $log;
require_once 'vtlib/Vtiger/Package.php';
require_once 'vtlib/Vtiger/Module.php';
$Vtiger_Utils_Log = true;
$package = new Vtiger_Package();
if ($package->isLanguageType($packagepath)) {
require_once 'vtlib/Vtiger/Language.php';
$languagePack = new Vtiger_Language();
$languagePack->update(null, $packagepath, true);
return;
}
if ($module == null) {
$log->fatal("Module name is invalid");
} else {
$moduleInstance = Vtiger_Module::getInstance($module);
if ($moduleInstance || $package->isModuleBundle($packagepath)) {
$log->debug("{$module} - Module instance found - Update starts here");
$package->update($moduleInstance, $packagepath);
} else {
$log->fatal("{$module} doesn't exists!");
}
}
}
示例7: importManifest
/**
* Import Module from manifest.xml file. Other files should already be in place
* @param String manifest.xml file path
*/
function importManifest($manifestfile)
{
global $adb, $log;
if (!$this->loadManifestFromFile($manifestfile)) {
return false;
}
$module = (string) $this->_modulexml->name;
if ($module != null) {
if ($this->isLanguageType()) {
require_once 'vtlib/Vtiger/Language.php';
$languagePack = new Vtiger_Language();
@$languagePack->register((string) $this->_modulexml->prefix, (string) $this->_modulexml->label, $module);
} else {
$sql = "select tabid from vtiger_tab where name=?";
$result = $adb->pquery($sql, array($module));
if ($result and $adb->num_rows($result) > 0) {
return false;
// module already installed
}
$this->import_Module();
}
} else {
return false;
}
return true;
}
示例8: insertIntoEntityTable
//.........这里部分代码省略.........
$res = $adb->pquery($sql, array($this->id));
$pick_val = $adb->query_result($res, 0, $columname);
$fldvalue = $pick_val;
} else {
$fldvalue = $this->column_fields[$fieldname];
}
} elseif ($uitype == 5 || $uitype == 6 || $uitype == 23) {
if (isset($current_user->date_format)) {
$fldvalue = getValidDBInsertDateValue($this->column_fields[$fieldname]);
} else {
$fldvalue = $this->column_fields[$fieldname];
}
} elseif ($uitype == 33) {
if (is_array($this->column_fields[$fieldname])) {
$field_list = implode(' |##| ', $this->column_fields[$fieldname]);
} else {
$field_list = $this->column_fields[$fieldname];
}
$fldvalue = $field_list;
} elseif ($uitype == 99) {
$plain_text = $this->column_fields[$fieldname];
$fldvalue = $this->encrypt_password($plain_text, $crypt_type);
// Update the plain-text value with encrypted value and dependent fields
$this->column_fields[$fieldname] = $fldvalue;
$this->column_fields['crypt_type'] = $crypt_type;
$this->column_fields['user_hash'] = $this->get_user_hash($plain_text);
} else {
$fldvalue = $this->column_fields[$fieldname];
$fldvalue = stripslashes($fldvalue);
}
$fldvalue = from_html($fldvalue, $insertion_mode == 'edit' ? true : false);
} else {
$fldvalue = '';
}
if ($uitype == 31) {
$themeList = array_keys(Vtiger_Util_Helper::getAllSkins());
if (!in_array($fldvalue, $themeList) || $fldvalue == '') {
global $default_theme;
if (!empty($default_theme) && in_array($default_theme, $themeList)) {
$fldvalue = $default_theme;
} else {
$fldvalue = $themeList[0];
}
}
if ($current_user->id == $this->id) {
$_SESSION['vtiger_authenticated_user_theme'] = $fldvalue;
}
} elseif ($uitype == 32) {
$languageList = Vtiger_Language::getAll();
$languageList = array_keys($languageList);
if (!in_array($fldvalue, $languageList) || $fldvalue == '') {
$default_language = vglobal('default_language');
if (!empty($default_language) && in_array($default_language, $languageList)) {
$fldvalue = vglobal('default_language');
} else {
$fldvalue = $languageList[0];
}
}
if ($current_user->id == $this->id) {
$_SESSION['authenticated_user_language'] = $fldvalue;
}
}
if ($fldvalue == '') {
$fldvalue = $this->get_column_value($columname, $fldvalue, $fieldname, $uitype, $datatype);
//$fldvalue =null;
}
if ($insertion_mode == 'edit') {
if ($i == 0) {
$update = $columname . "=?";
} else {
$update .= ', ' . $columname . "=?";
}
array_push($update_params, $fldvalue);
} else {
$column .= ", " . $columname;
array_push($qparams, $fldvalue);
}
}
if ($insertion_mode == 'edit') {
//Check done by Don. If update is empty the the query fails
if (trim($update) != '') {
$sql1 = "update {$table_name} set {$update} where " . $this->tab_name_index[$table_name] . "=?";
array_push($update_params, $this->id);
$this->db->pquery($sql1, $update_params);
}
} else {
// Set the crypt_type being used, to override the DB default constraint as it is not in vtiger_field
if ($table_name == 'vtiger_users' && strpos('crypt_type', $column) === false) {
$column .= ', crypt_type';
$qparams[] = $crypt_type;
}
// END
if ($table_name == 'vtiger_users' && strpos('user_hash', $column) === false) {
$column .= ', user_hash';
$qparams[] = $this->column_fields['user_hash'];
}
$sql1 = "insert into {$table_name} ({$column}) values(" . generateQuestionMarks($qparams) . ")";
$this->db->pquery($sql1, $qparams);
}
}
示例9: getAllLanguages
/**
* Function to returns all language information
* @return <Array>
*/
public static function getAllLanguages()
{
return Vtiger_Language::getAll();
}
示例10: getOptionalModuleDetails
/**
*
* @param String $packagepath - path to the package file.
* @return Array
*/
static function getOptionalModuleDetails($package, $optionalModulesInfo)
{
global $optionalModuleStrings;
$moduleUpdateVersion = $package->getVersion();
$moduleForVtigerVersion = $package->getDependentVtigerVersion();
$moduleMaxVtigerVersion = $package->getDependentMaxVtigerVersion();
if ($package->isLanguageType()) {
$type = 'language';
} else {
$type = 'module';
}
$moduleDetails = null;
$moduleName = $package->getModuleName();
if ($moduleName != null) {
$moduleDetails = array();
$moduleDetails['description'] = $optionalModuleStrings[$moduleName . '_description'];
if (Vtiger_Version::check($moduleForVtigerVersion, '>=') && Vtiger_Version::check($moduleMaxVtigerVersion, '<')) {
$moduleDetails['selected'] = true;
$moduleDetails['enabled'] = true;
} else {
$moduleDetails['selected'] = false;
$moduleDetails['enabled'] = false;
}
$migrationAction = 'install';
if (!$package->isLanguageType()) {
$moduleInstance = null;
if (Vtiger_Utils::checkTable('vtiger_tab')) {
$moduleInstance = Vtiger_Module::getInstance($moduleName);
}
if ($moduleInstance) {
$migrationAction = 'update';
if (version_compare($moduleUpdateVersion, $moduleInstance->version, '>=')) {
$moduleDetails['enabled'] = false;
}
}
} else {
if (Vtiger_Utils::CheckTable(Vtiger_Language::TABLENAME)) {
$languageList = array_keys(Vtiger_Language::getAll());
$prefix = $package->getPrefix();
if (in_array($prefix, $languageList)) {
$migrationAction = 'update';
}
}
}
$optionalModulesInfo[$migrationAction][$type][$moduleName] = $moduleDetails;
}
return $optionalModulesInfo;
}
示例11: uninstallExtension
protected function uninstallExtension(Vtiger_Request $request)
{
$extensionName = $request->get('extensionName');
$extensionInstance = Settings_ExtensionStore_Extension_Model::getModuleFromExtnName($extensionName);
$extnType = $extensionInstance->get('extnType');
$response = new Vtiger_Response();
if ($extnType == 'module') {
$extensionInstance->delete();
//Remove extension files
global $root_directory;
$deletePaths = array();
$pathToExtensionLayouts = $root_directory . "layouts/vlayout/modules/{$extensionName}";
$layoutDirAccessible = isFileAccessible($pathToExtensionLayouts);
if ($layoutDirAccessible) {
$deletePaths['layouts'] = $pathToExtensionLayouts;
}
$pathToExtensionModule = $root_directory . "modules/{$extensionName}";
$moduleDirAccessible = isFileAccessible($pathToExtensionModule);
if ($moduleDirAccessible) {
$deletePaths['modules'] = $pathToExtensionModule;
}
foreach ($deletePaths as $dirName) {
$this->deleteRecursively($dirName);
}
$response->setResult(array('success' => true, 'message' => 'extension deleted'));
} else {
if ($extnType == 'language') {
$languageInstance = Settings_ExtensionStore_Extension_Model::getLanguageInstance($extensionName);
if ($languageInstance) {
$langPrefix = $languageInstance->get('prefix');
Vtiger_Language::deregister($langPrefix);
//remove files
$langDir = "languages/{$langPrefix}";
if (isFileAccessible($langDir)) {
$this->deleteRecursively($langDir);
}
}
$response->setResult(array('success' => true, 'message' => 'extension deleted'));
} else {
$response->setError('Error in deleting extension');
}
}
$response->emit();
}
示例12: create_tables
//.........这里部分代码省略.........
$this->db->query("insert into vtiger_parenttab values (7,'Tools',7,0)");
$this->db->query("insert into vtiger_parenttab values (8,'Settings',8,0)");
$this->db->query("insert into vtiger_parenttabrel values (1,9,2)");
$this->db->query("insert into vtiger_parenttabrel values (1,28,4)");
$this->db->query("insert into vtiger_parenttabrel values (1,3,1)");
$this->db->query("insert into vtiger_parenttabrel values (3,7,1)");
$this->db->query("insert into vtiger_parenttabrel values (3,6,2)");
$this->db->query("insert into vtiger_parenttabrel values (3,4,3)");
$this->db->query("insert into vtiger_parenttabrel values (3,2,4)");
$this->db->query("insert into vtiger_parenttabrel values (3,20,5)");
$this->db->query("insert into vtiger_parenttabrel values (3,22,6)");
$this->db->query("insert into vtiger_parenttabrel values (3,23,7)");
$this->db->query("insert into vtiger_parenttabrel values (3,19,8)");
$this->db->query("insert into vtiger_parenttabrel values (3,8,9)");
$this->db->query("insert into vtiger_parenttabrel values (4,13,1)");
$this->db->query("insert into vtiger_parenttabrel values (4,15,2)");
$this->db->query("insert into vtiger_parenttabrel values (4,6,3)");
$this->db->query("insert into vtiger_parenttabrel values (4,4,4)");
$this->db->query("insert into vtiger_parenttabrel values (4,8,5)");
$this->db->query("insert into vtiger_parenttabrel values (5,1,2)");
$this->db->query("insert into vtiger_parenttabrel values (5,25,1)");
$this->db->query("insert into vtiger_parenttabrel values (6,14,1)");
$this->db->query("insert into vtiger_parenttabrel values (6,18,2)");
$this->db->query("insert into vtiger_parenttabrel values (6,19,3)");
$this->db->query("insert into vtiger_parenttabrel values (6,21,4)");
$this->db->query("insert into vtiger_parenttabrel values (6,22,5)");
$this->db->query("insert into vtiger_parenttabrel values (6,20,6)");
$this->db->query("insert into vtiger_parenttabrel values (6,23,7)");
$this->db->query("insert into vtiger_parenttabrel values (7,24,1)");
$this->db->query("insert into vtiger_parenttabrel values (7,27,2)");
$this->db->query("insert into vtiger_parenttabrel values (7,8,3)");
// SalesPlatform.ru begin
$this->db->query("insert into vtiger_parenttabrel values (7,30,4)");
// SalesPlatform.ru end
$this->db->query("insert into vtiger_parenttabrel values (2,26,1)");
$this->db->query("insert into vtiger_parenttabrel values (2,6,2)");
$this->db->query("insert into vtiger_parenttabrel values (2,4,3)");
$this->db->query("insert into vtiger_parenttabrel values (2,28,4)");
$this->db->query("insert into vtiger_parenttabrel values (4,28,7)");
$this->db->query("insert into vtiger_parenttabrel values (2,7,5)");
$this->db->query("insert into vtiger_parenttabrel values (2,9,6)");
$this->db->query("insert into vtiger_parenttabrel values (4,9,8)");
$this->db->query("insert into vtiger_parenttabrel values (2,8,8)");
$this->db->query("insert into vtiger_parenttabrel values (3,9,11)");
//add settings page to database starts
$this->addEntriesForSettings();
//add settings page to database end
//Added to populate the default inventory tax informations
$vatid = $this->db->getUniqueID("vtiger_inventorytaxinfo");
$salesid = $this->db->getUniqueID("vtiger_inventorytaxinfo");
$serviceid = $this->db->getUniqueID("vtiger_inventorytaxinfo");
//vtiger-ru-fork 27.10.2010 Eugene Babiy
$this->db->query("insert into vtiger_inventorytaxinfo values({$vatid},'tax" . $vatid . "','НДС','18','0')");
//$this->db->query("insert into vtiger_inventorytaxinfo values($salesid,'tax".$salesid."','Sales','10.00','0')");
//$this->db->query("insert into vtiger_inventorytaxinfo values($serviceid,'tax".$serviceid."','Service','12.50','0')");
//After added these taxes we should add these taxes as columns in vtiger_inventoryproductrel table
$this->db->query("alter table vtiger_inventoryproductrel add column tax{$vatid} decimal(7,3) default NULL");
$this->db->query("alter table vtiger_inventoryproductrel add column tax{$salesid} decimal(7,3) default NULL");
$this->db->query("alter table vtiger_inventoryproductrel add column tax{$serviceid} decimal(7,3) default NULL");
//Added to handle picklist uniqueid for the picklist values
//$this->db->query("insert into vtiger_picklistvalues_seq values(1)");
//Added to populate the default Shipping & Hanlding tax informations
$shvatid = $this->db->getUniqueID("vtiger_shippingtaxinfo");
$shsalesid = $this->db->getUniqueID("vtiger_shippingtaxinfo");
$shserviceid = $this->db->getUniqueID("vtiger_shippingtaxinfo");
//vtiger-ru-fork 27.10.2010 Eugene Babiy
$this->db->query("insert into vtiger_shippingtaxinfo values({$shvatid},'shtax" . $shvatid . "','НДС','18','0')");
//$this->db->query("insert into vtiger_shippingtaxinfo values($shsalesid,'shtax".$shsalesid."','Sales','10.00','0')");
//$this->db->query("insert into vtiger_shippingtaxinfo values($shserviceid,'shtax".$shserviceid."','Service','12.50','0')");
//After added these taxes we should add these taxes as columns in vtiger_inventoryshippingrel table
$this->db->query("alter table vtiger_inventoryshippingrel add column shtax{$shvatid} decimal(7,3) default NULL");
$this->db->query("alter table vtiger_inventoryshippingrel add column shtax{$shsalesid} decimal(7,3) default NULL");
$this->db->query("alter table vtiger_inventoryshippingrel add column shtax{$shserviceid} decimal(7,3) default NULL");
//version file is included here because without including this file version cannot be get
include 'vtigerversion.php';
$this->db->query("insert into vtiger_version values(" . $this->db->getUniqueID('vtiger_version') . ",'" . $vtiger_current_version . "','" . $vtiger_current_version . "')");
//Register default language English
require_once 'vtlib/Vtiger/Language.php';
$vtlanguage = new Vtiger_Language();
$vtlanguage->register('en_us', 'US English', 'English', true, true, true);
// vtiger-ru-fork 2010-10-27 22:29:43 Eugene Babiy
$vtlanguage->register('ru_ru', 'RU Русский', 'Русский', true, true, true);
$this->initWebservices();
/**
* Setup module sequence numbering.
*/
$modseq = array('Leads' => 'ОБР_', 'Accounts' => 'КОНТР_', 'Campaigns' => 'КАМП_', 'Contacts' => 'КОНТАКТ_', 'Potentials' => 'СДЕЛКА_', 'HelpDesk' => 'ЗАЯВКА_', 'Quotes' => 'ПР_', 'SalesOrder' => '', 'PurchaseOrder' => 'ЗАК_', 'Invoice' => '', 'Products' => 'ТОВ_', 'Vendors' => 'ПОСТ_', 'PriceBooks' => 'КАТ_', 'Faq' => 'ЧаВо_', 'Documents' => 'ДОК_');
foreach ($modseq as $modname => $prefix) {
$this->addInventoryRows(array(array('semodule' => $modname, 'active' => '1', 'prefix' => $prefix, 'startid' => '1', 'curid' => '1')));
}
// Adding Sharing Types for Reports
$this->db->query("insert into vtiger_reportfilters values(1,'Private')");
$this->db->query("insert into vtiger_reportfilters values(2,'Public')");
$this->db->query("insert into vtiger_reportfilters values(3,'Shared')");
require 'modules/Utilities/Currencies.php';
foreach ($currencies as $key => $value) {
$this->db->query("insert into vtiger_currencies values(" . $this->db->getUniqueID("vtiger_currencies") . ",'{$key}','" . $value[0] . "','" . $value[1] . "')");
}
$this->addDefaultLeadMapping();
}
示例13: putMsg
$taskManager->saveTask($task);
$task = $taskManager->createTask('VTEntityMethodTask', $helpDeskWorkflow->id);
$task->active = true;
$task->summary = 'Notify Related Customer on Ticket Change, which is not done from Portal';
$task->methodName = "NotifyParentOnTicketChange";
$taskManager->saveTask($task);
putMsg('Workflow "' . $helpDeskWorkflow->description . '" created!');
$delmods = array('EmailTemplates', 'Google');
foreach ($delmods as $module) {
$mod = Vtiger_Module::getInstance($module);
if ($mod) {
$mod->deleteRelatedLists();
$mod->deleteLinks();
$mod->deinitWebservice();
$mod->delete();
echo "<b>Module {$module} EXTERMINATED!</b><br>";
}
}
$delmods = array('ar_ae', 'sv_se', 'tr_tr', 'pl_pl', 'ro_ro', 'ru_ru');
require_once 'vtlib/Vtiger/Language.php';
foreach ($delmods as $prefix) {
$languagePack = new Vtiger_Language();
@$languagePack->deregister($prefix);
}
$insmods = array('CronTasks', 'ConfigEditor', 'PBXManager', 'cbupdater');
foreach ($insmods as $module) {
$package = new Vtiger_Package();
$rdo = $package->importManifest("modules/{$module}/manifest.xml");
}
$mod = Vtiger_Module::getInstance('ModTracker');
$mod->addLink('HEADERSCRIPT', 'ModTrackerCommon_JS', 'modules/ModTracker/ModTrackerCommon.js');
示例14: getOutputHtml
//.........这里部分代码省略.........
if (is_array($image_array)) {
for ($img_itr = 0; $img_itr < count($image_array); $img_itr++) {
$fieldvalue[] = array('name' => $image_array[$img_itr], 'path' => $image_path_array[$img_itr]);
}
} else {
$fieldvalue[] = '';
}
} elseif ($uitype == 101) {
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
$fieldvalue[] = getOwnerName($value);
$fieldvalue[] = $value;
} elseif ($uitype == 26) {
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
$folderid = $col_fields['folderid'];
$foldername_query = 'select foldername from vtiger_attachmentsfolder where folderid = ?';
$res = $adb->pquery($foldername_query, array($folderid));
$foldername = $adb->query_result($res, 0, 'foldername');
if ($foldername != '' && $folderid != '') {
$fldr_name[$folderid] = $foldername;
}
$sql = "select foldername,folderid from vtiger_attachmentsfolder order by foldername";
$res = $adb->pquery($sql, array());
for ($i = 0; $i < $adb->num_rows($res); $i++) {
$fid = $adb->query_result($res, $i, "folderid");
$fldr_name[$fid] = $adb->query_result($res, $i, "foldername");
}
$fieldvalue[] = $fldr_name;
} elseif ($uitype == 27) {
if ($value == 'E') {
$external_selected = "selected";
$filename = $col_fields['filename'];
} else {
$internal_selected = "selected";
$filename = $col_fields['filename'];
}
$editview_label[] = array(getTranslatedString('Internal'), getTranslatedString('External'));
$editview_label[] = array($internal_selected, $external_selected);
$editview_label[] = array("I", "E");
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
$fieldvalue[] = $value;
$fieldvalue[] = $filename;
} elseif ($uitype == '31') {
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
$options = array();
$themeList = get_themes();
foreach ($themeList as $theme) {
if ($value == $theme) {
$selected = 'selected';
} else {
$selected = '';
}
$options[] = array(getTranslatedString($theme), $theme, $selected);
}
$fieldvalue[] = $options;
} elseif ($uitype == '32') {
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
$options = array();
$languageList = Vtiger_Language::getAll();
foreach ($languageList as $prefix => $label) {
if ($value == $prefix) {
$selected = 'selected';
} else {
$selected = '';
}
$options[] = array(getTranslatedString($label), $prefix, $selected);
}
$fieldvalue[] = $options;
} else {
//Added condition to set the subject if click Reply All from web mail
if ($_REQUEST['module'] == 'Emails' && $_REQUEST['mg_subject'] != '') {
$value = $_REQUEST['mg_subject'];
}
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
if ($fieldname == 'fileversion') {
if (empty($value)) {
$value = '';
} else {
$fieldvalue[] = $value;
}
} else {
$fieldvalue[] = $value;
}
}
}
// Mike Crowe Mod --------------------------------------------------------force numerics right justified.
if (!preg_match("/id=/i", $custfld)) {
$custfld = preg_replace("/<input/iS", "<input id='{$fieldname}' ", $custfld);
}
if (in_array($uitype, array(71, 72, 7, 9, 90))) {
$custfld = preg_replace("/<input/iS", "<input align=right ", $custfld);
}
$final_arr[] = $ui_type;
$final_arr[] = $editview_label;
$final_arr[] = $editview_fldname;
$final_arr[] = $fieldvalue;
$type_of_data = explode('~', $typeofdata);
$final_arr[] = $type_of_data[1];
$log->debug('Exiting getOutputHtml method ...');
return $final_arr;
}
示例15: get_select_options_with_id
echo get_select_options_with_id(get_themes(), $display_theme);
?>
</select></td>
</tr>
<tr bgcolor="#f5f5f5">
<td class="small" align="right" width="30%"><?php
echo $current_module_strings['LBL_LANGUAGE'];
?>
</td>
<td class="small" align="left" width="70%"><select class="small" name='login_language' style="width:70%" tabindex="4">
<!-- vtlib Customization -->
<?php
/* php echo get_select_options_with_id(get_languages(), $display_language) */
?>
<?php
echo get_select_options_with_id(Vtiger_Language::getAll(), $display_language);
?>
</select></td>
</tr>
<?php
if (isset($_SESSION['validation'])) {
?>
<tr>
<td colspan="2"><font color="Red"> <?php
echo $current_module_strings['VLD_ERROR'];
?>
</font></td>
</tr>
<?php
} else {
if (isset($login_error) && $login_error != "") {