Ejemplo n.º 1
0
 public static function checkColumn($table, $colum, $type, $default = false, $resetType = false)
 {
     $ehztyhugkvw = "colum";
     ${"GLOBALS"}["dgynoonp"] = "table";
     ${"GLOBALS"}["jclyabjwwyg"] = "resetType";
     global $adb;
     ${"GLOBALS"}["lmlixtkzk"] = "result";
     if (!\Workflow\DbCheck::existTable(${${"GLOBALS"}["dgynoonp"]})) {
         return false;
     }
     ${${"GLOBALS"}["lmlixtkzk"]} = $adb->query("SHOW COLUMNS FROM `" . ${${"GLOBALS"}["rkciyixds"]} . "` LIKE '" . ${$ehztyhugkvw} . "'");
     ${${"GLOBALS"}["fdpssjepgg"]} = $adb->num_rows(${${"GLOBALS"}["mvyuejx"]}) ? true : false;
     if (${${"GLOBALS"}["fdpssjepgg"]} == false) {
         $qywtoe = "colum";
         $fvgect = "default";
         ${"GLOBALS"}["qfykztjfwn"] = "colum";
         echo "Add column '" . ${${"GLOBALS"}["rkciyixds"]} . "'.'" . ${$qywtoe} . "'<br>";
         $adb->query("ALTER TABLE `" . ${${"GLOBALS"}["rkciyixds"]} . "` ADD `" . ${${"GLOBALS"}["qfykztjfwn"]} . "` " . ${${"GLOBALS"}["phkafcwyo"]} . " NOT NULL" . (${${"GLOBALS"}["dqmubcyqohqb"]} !== false ? " DEFAULT  '" . ${$fvgect} . "'" : ""), false);
     } elseif (${${"GLOBALS"}["jclyabjwwyg"]} == true) {
         ${${"GLOBALS"}["eaulupt"]} = strtolower(html_entity_decode($adb->query_result(${${"GLOBALS"}["mvyuejx"]}, 0, "type"), ENT_QUOTES));
         ${${"GLOBALS"}["eaulupt"]} = str_replace(" ", "", ${${"GLOBALS"}["eaulupt"]});
         if (${${"GLOBALS"}["eaulupt"]} != strtolower(str_replace(" ", "", ${${"GLOBALS"}["phkafcwyo"]}))) {
             $zwhgmqncy = "colum";
             $lceffvyvez = "type";
             $oomxuzd = "sql";
             ${${"GLOBALS"}["ztjqjrf"]} = "ALTER TABLE  `" . ${${"GLOBALS"}["rkciyixds"]} . "` CHANGE  `" . ${$zwhgmqncy} . "`  `" . ${${"GLOBALS"}["cqojoiyxp"]} . "` " . ${$lceffvyvez} . ";";
             $adb->query(${$oomxuzd});
         }
     }
     return ${${"GLOBALS"}["fdpssjepgg"]};
 }
Ejemplo n.º 2
0
}
if (!\Workflow\DbCheck::existTable("vtiger_wf_http_limits_value")) {
    echo "Create table vtiger_wf_http_limits_value ... ok<br>";
    $adb->query("CREATE TABLE IF NOT EXISTS `vtiger_wf_http_limits_value` (\n      `id` int(11) NOT NULL AUTO_INCREMENT,\n      `limit_id` int(10) unsigned NOT NULL,\n      `mode` enum('all','trigger','id') NOT NULL,\n      `value` varchar(64) NOT NULL,\n      PRIMARY KEY (`id`),\n      KEY `mode` (`mode`,`value`)\n    ) ENGINE = INNODB;");
}
if (!\Workflow\DbCheck::existTable("vtiger_wf_objects")) {
    echo "Create table vtiger_wf_objects ... ok<br>";
    $adb->query("CREATE TABLE IF NOT EXISTS `vtiger_wf_objects` (\n      `id` int(11) NOT NULL AUTO_INCREMENT,\n      `x` int(11) NOT NULL,\n      `y` int(11) NOT NULL,\n      `type` VARCHAR( 12 ) NOT NULL,\n      `content` text NOT NULL,\n      `workflow_id` int(11) NOT NULL,\n      PRIMARY KEY (`id`),\n      KEY `workflow_id` (`workflow_id`)\n    ) ENGINE=INNODB ;");
}
if (!\Workflow\DbCheck::existTable("vtiger_wf_repository")) {
    ${"GLOBALS"}["polhtlrmg"] = "initRepository";
    echo "Create table vtiger_wf_repository ... ok<br>";
    $adb->query("CREATE TABLE IF NOT EXISTS `vtiger_wf_repository` (\n      `id` int(11) NOT NULL AUTO_INCREMENT,\n      `title` varchar(128) NOT NULL,\n      `url` varchar(256) NOT NULL,\n      `licenseCode` varchar(40) NOT NULL,\n      `last_update` datetime NOT NULL,\n      `messages` text NOT NULL,\n      `available_status` varchar(64) NOT NULL,\n      `status` varchar(12) NOT NULL,\n      PRIMARY KEY (`id`)\n    ) ENGINE=InnoDB;");
    ${${"GLOBALS"}["polhtlrmg"]} = true;
}
if (!\Workflow\DbCheck::existTable("vtiger_wf_repository_types")) {
    echo "Create table vtiger_wf_repository_types ... ok<br>";
    $adb->query("CREATE TABLE IF NOT EXISTS `vtiger_wf_repository_types` (\n          `id` int(11) NOT NULL AUTO_INCREMENT,\n          `repos_id` int(11) NOT NULL,\n          `min_version` double NOT NULL,\n          `name` varchar(64) NOT NULL,\n          `version` int(10) unsigned NOT NULL,\n          `last_update` datetime NOT NULL,\n          `url` varchar(255) NOT NULL,\n          `checksum` text NOT NULL,\n          `mode` varchar(16) NOT NULL,\n          `autoinstall` tinyint(4) NOT NULL,\n          `status` varchar(12) NOT NULL,\n      PRIMARY KEY (`id`),\n      UNIQUE KEY `repos_id` (`repos_id`,`name`)\n    ) ENGINE=InnoDB");
}
${${"GLOBALS"}["trksdsce"]} = "SELECT * FROM vtiger_wf_config";
$xwumsixdl = "result";
${${"GLOBALS"}["kkktjzvrc"]} = $adb->query(${${"GLOBALS"}["trksdsce"]});
if ($adb->num_rows(${$wnwmzpt}) == 0) {
    $adb->query("INSERT INTO `vtiger_wf_config` (`id`, `version`, `license`, `last_hash`, `config`) VALUES (1, " . Workflow2::VERSION . ", 'free', 'free', '');");
}
${"GLOBALS"}["gegcyny"] = "sql";
if ($adb->num_rows(${$xwumsixdl}) > 1) {
    $adb->query("DELETE FROM `vtiger_wf_config` ORDER BY license LIMIT " . ($adb->num_rows(${${"GLOBALS"}["kkktjzvrc"]}) - 1));
}
\Workflow\DbCheck::checkColumn("vtiger_wf_messages", "target", "ENUM(  'record',  'user' )", "record");
\Workflow\DbCheck::checkColumn("vtiger_wf_repository", "messages", "text");