This commit is contained in:
Roly Rudy Gutierrez Pinto
2017-03-30 15:45:01 -04:00
parent bf56da719b
commit 8305cee7cc

View File

@@ -26,19 +26,27 @@ class p11835 extends patch
*/ */
static public function isApplicable() static public function isApplicable()
{ {
if (! class_exists('System')) { if (!class_exists('System')) {
G::LoadClass("System"); G::LoadClass("System");
} }
patch::$isPathchable = false; patch::$isPathchable = false;
$con = Propel::getConnection("workflow"); $con = Propel::getConnection("workflow");
$stmt = $con->prepareStatement("describe TASK;"); $stmt = $con->prepareStatement("SHOW TABLES LIKE 'TASK'");
$rs = $stmt->executeQuery(); $rs = $stmt->executeQuery();
$rs->next(); $rs->next();
while($row = $rs->getRow()) { $row = $rs->getRow();
if (empty($row) === true) {
return patch::$isPathchable;
}
$stmt = $con->prepareStatement("DESCRIBE TASK");
$rs = $stmt->executeQuery();
$rs->next();
while ($row = $rs->getRow()) {
if ($row ['Field'] == "TAS_GROUP_VARIABLE") { if ($row ['Field'] == "TAS_GROUP_VARIABLE") {
$version = System::getVersion (); $version = System::getVersion();
$version = explode('-',$version); $version = explode('-', $version);
if ($version[0] == '2.5.1') { if ($version[0] == '2.5.1') {
echo "Version " . $version[0] . " Patch\n"; echo "Version " . $version[0] . " Patch\n";
patch::$isPathchable = true; patch::$isPathchable = true;
@@ -49,7 +57,7 @@ class p11835 extends patch
} }
return patch::$isPathchable; return patch::$isPathchable;
} }
public static function pmVersion($version) public static function pmVersion($version)
{ {
if (preg_match("/^\D*([\d\.]+)\D*$/", $version, $matches)) { if (preg_match("/^\D*([\d\.]+)\D*$/", $version, $matches)) {