本文整理汇总了PHP中Vtiger_Package::importManifest方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Package::importManifest方法的具体用法?PHP Vtiger_Package::importManifest怎么用?PHP Vtiger_Package::importManifest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Package
的用法示例。
在下文中一共展示了Vtiger_Package::importManifest方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: applyChange
function applyChange()
{
if ($this->hasError()) {
$this->sendError();
}
if ($this->isApplied()) {
$this->sendMsg('Changeset cbupdate_example already applied!');
} else {
// do your magic here
$this->ExecuteQuery('select 1 from vtiger_cbupdater');
$this->ExecuteQuery('select 1 from vtiger_cbupder');
$package = new Vtiger_Package();
ob_start();
$rdo = $package->importManifest('build/French/manifest.xml');
$out = ob_get_contents();
ob_end_clean();
$this->sendMsg($out);
if ($rdo) {
$this->sendMsg('french installed!');
} else {
$this->sendMsg('NO french!');
}
$this->sendMsg('Changeset cbupdate_example applied!');
$this->markApplied();
}
$this->finishExecution();
}
示例2: installManifestModule
function installManifestModule($module)
{
$package = new Vtiger_Package();
ob_start();
$rdo = $package->importManifest("modules/{$module}/manifest.xml");
$out = ob_get_contents();
ob_end_clean();
$this->sendMsg($out);
if ($rdo) {
$this->sendMsg("{$module} installed!");
} else {
$this->sendMsgError("ERROR installing {$module}!");
}
}
示例3: Users
@error_reporting(0);
@ini_set('display_errors', 'off');
@set_time_limit(0);
@ini_set('memory_limit', '1024M');
if (count($argv) == 3) {
$module = $argv[1];
$type = $argv[2];
require_once 'vtlib/Vtiger/Module.php';
require_once 'vtlib/Vtiger/Package.php';
global $current_user, $adb;
$Vtiger_Utils_Log = false;
// Turn off debugging level
$current_user = new Users();
$current_user->retrieveCurrentUserInfoFromFile(1);
// admin
$package = new Vtiger_Package();
$tabrs = $adb->pquery('select count(*) from vtiger_tab where name=?', array($module));
if ($tabrs and $adb->query_result($tabrs, 0, 0) == 1) {
vtlib_toggleModuleAccess($module, true);
echo "Module activated: {$module} \n";
} else {
if (strtolower($type) == 'language') {
$rdo = $package->importManifest('include/language/' . $module . '.manifest.xml');
} else {
$rdo = $package->importManifest('modules/' . $module . '/manifest.xml');
}
echo "Module installed: {$module} \n";
}
} else {
echo "\n Incorrect amount of parameters \n";
}
示例4: putMsg
<td width="25%">' . $status . '</td>
<td width="5%"><font color="red"> F </font></td>
<td width="70%">' . $query . '</td>
</tr>';
$failure_query_array[$failure_query_count++] = $query;
$log->debug("Query Failed ==> {$query} \n Error is ==> [" . $adb->database->ErrorNo() . "]" . $adb->database->ErrorMsg());
}
}
function putMsg($msg)
{
echo '<tr width="100%"><td colspan=3>' . $msg . '</td></tr>';
}
echo "<table width=80% align=center border=1>";
$package = new Vtiger_Package();
ob_start();
$rdo = $package->importManifest("modules/cbupdater/manifest.xml");
$out = ob_get_contents();
ob_end_clean();
putMsg($out);
if ($rdo) {
putMsg("{$module} installed: <a href='index.php?module=cbupdater&action=getupdates'>proceed to the rest of the updates by clicking here</a>");
} else {
putMsg("ERROR installing {$module}!");
}
?>
</table>
<br /><br />
<b style="color:#FF0000">Failed Queries Log</b>
<div id="failedLog" style="border:1px solid #666666;width:90%;position:relative;height:200px;overflow:auto;left:5%;top:10px;">
<?php
foreach ($failure_query_array as $failed_query) {
示例5: array
$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');
示例6: CURDATE
ExecuteQuery('UPDATE `vtiger_troubletickets`
INNER JOIN `vtiger_ticketcf` ON `vtiger_ticketcf`.ticketid=`vtiger_troubletickets`.ticketid
SET `vtiger_troubletickets`.`from_portal`=`vtiger_ticketcf`.`from_portal`');
ExecuteQuery('ALTER TABLE `vtiger_ticketcf` DROP `from_portal`');
// Migrate FAQ Comments
ExecuteQuery("INSERT INTO `vtiger_faqcomments`(`commentid`, `faqid`, `comments`, `createdtime`) \n\t\tSELECT `modcommentsid`, `related_to`, `commentcontent`, CURDATE()\n\t\tFROM vtiger_modcomments\n\t\tINNER JOIN vtiger_crmentity ON crmid = related_to\n\t\tWHERE deleted = 0 and setype='FAQ'");
// Migrate Ticket Comments
ExecuteQuery("INSERT INTO `vtiger_ticketcomments`(`commentid`, `ticketid`, `comments`, `ownerid`, `ownertype`, `createdtime`)\n\t\tSELECT `modcommentsid`, `related_to`, `commentcontent`, \n\t\t\t\tCASE WHEN customer = '' THEN userid ELSE customer END, \n\t\t\t\tCASE WHEN customer = '' THEN 'user' ELSE 'customer' END, CURDATE()\n\t\tFROM vtiger_modcomments\n\t\tINNER JOIN vtiger_crmentity ON crmid = related_to\n\t\tWHERE deleted = 0 and setype='HelpDesk'");
// Recover chat functionality
ExecuteQuery("CREATE TABLE `vtiger_chat_users` (\n `id` int(20) NOT NULL AUTO_INCREMENT,\n `nick` varchar(50) NOT NULL,\n `session` varchar(50) NOT NULL,\n `ip` varchar(20) NOT NULL DEFAULT '000.000.000.000',\n `ping` datetime DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `chat_users_nick_idx` (`nick`),\n KEY `chat_users_session_idx` (`session`),\n KEY `chat_users_ping_idx` (`ping`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8");
ExecuteQuery("CREATE TABLE `vtiger_chat_msg` (\n`id` int(20) NOT NULL AUTO_INCREMENT,\n`chat_from` int(20) NOT NULL DEFAULT '0',\n`chat_to` int(20) NOT NULL DEFAULT '0',\n`born` datetime DEFAULT NULL,\n`msg` varchar(255) NOT NULL,\nPRIMARY KEY (`id`),\nKEY `chat_msg_chat_from_idx` (`chat_from`),\nKEY `chat_msg_chat_to_idx` (`chat_to`),\nKEY `chat_msg_born_idx` (`born`),\nCONSTRAINT `fk_1_vtiger_chat_msg` FOREIGN KEY (`chat_from`) REFERENCES `vtiger_chat_users` (`id`) ON DELETE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8");
ExecuteQuery("CREATE TABLE `vtiger_chat_pvchat` (\n `id` int(20) NOT NULL AUTO_INCREMENT,\n `msg` int(20) DEFAULT '0',\n PRIMARY KEY (`id`),\n UNIQUE KEY `chat_pvchat_msg_idx` (`msg`),\n CONSTRAINT `fk_1_vtiger_chat_pvchat` FOREIGN KEY (`msg`) REFERENCES `vtiger_chat_msg` (`id`) ON DELETE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8");
ExecuteQuery("CREATE TABLE `vtiger_chat_pchat` (\n `id` int(20) NOT NULL AUTO_INCREMENT,\n `msg` int(20) DEFAULT '0',\n PRIMARY KEY (`id`),\n UNIQUE KEY `chat_pchat_msg_idx` (`msg`),\n CONSTRAINT `fk_1_vtiger_chat_pchat` FOREIGN KEY (`msg`) REFERENCES `vtiger_chat_msg` (`id`) ON DELETE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8");
ExecuteQuery("CREATE TABLE `vtiger_ownernotify` (\n`crmid` int(19) DEFAULT NULL,\n`smownerid` int(19) DEFAULT NULL,\n`flag` int(3) DEFAULT NULL,\nKEY `ownernotify_crmid_flag_idx` (`crmid`,`flag`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8");
$package = new Vtiger_Package();
$rdo = $package->importManifest("modules/PBXManager/manifest.xml");
ExecuteQuery('ALTER TABLE vtiger_inventoryproductrel MODIFY comment text', array());
// Meta information cleanup
$inventoryModules = array('Invoice', 'SalesOrder', 'PurchaseOrder', 'Quotes');
$actions = array('Import', 'Export');
for ($i = 0; $i < count($inventoryModules); $i++) {
$moduleName = $inventoryModules[$i];
$moduleInstance = Vtiger_Module::getInstance($moduleName);
foreach ($actions as $actionName) {
Vtiger_Access::updateTool($moduleInstance, $actionName, false, '');
}
}
$delws = array('LineItem', 'ProductTaxes', 'Tax');
foreach ($delws as $ws) {
$wsrs = $adb->query("select id from vtiger_ws_entity where name='{$ws}'");
$wsid = $adb->query_result($wsrs, 0, 0);
示例7: Users
<?php
// Turn on debugging level
$Vtiger_Utils_Log = true;
require_once 'vtlib/Vtiger/Module.php';
require_once 'vtlib/Vtiger/Package.php';
global $current_user, $adb;
set_time_limit(0);
ini_set('memory_limit', '1024M');
$current_user = new Users();
$current_user->retrieveCurrentUserInfoFromFile(1);
// admin
$package = new Vtiger_Package();
//$rdo = $package->importManifest('modules/cbupdater/manifest.xml');
//$rdo = $package->importManifest('modules/Webforms/manifest.xml');
//$package->initImport('TSEmail_540.zip', true);
$rdo = $package->importManifest('include/language/it_it.manifest.xml');