Revert "Cases List Cache Builder display"
This reverts commit 81ff933f7e.
This commit is contained in:
@@ -872,13 +872,7 @@ class AppCacheView extends BaseAppCacheView {
|
||||
function getMySQLVersion() {
|
||||
$con = Propel::getConnection("workflow");
|
||||
$stmt = $con->createStatement();
|
||||
$connection = $con->getDSN();
|
||||
$sqlType = $connection['phptype'];
|
||||
if($sqlType == 'mssql')
|
||||
$sql = "SELECT SERVERPROPERTY('productversion')"; // Added by Ankit for mssql.}
|
||||
else
|
||||
$sql = "select version()";
|
||||
|
||||
$sql = "select version() ";
|
||||
$rs1 = $stmt->executeQuery($sql, ResultSet::FETCHMODE_NUM);
|
||||
$rs1->next();
|
||||
$row = $rs1->getRow();
|
||||
@@ -894,26 +888,20 @@ class AppCacheView extends BaseAppCacheView {
|
||||
$con = Propel::getConnection("workflow");
|
||||
|
||||
$stmt = $con->createStatement();
|
||||
$connection = $con->getDSN();
|
||||
$sqlType = $connection['phptype'];
|
||||
if($sqlType == 'mssql')
|
||||
$sql = "SELECT SYSTEM_USER, USER"; // Added by Ankit for mssql
|
||||
else
|
||||
$sql = "select CURRENT_USER(), USER() ";
|
||||
|
||||
$sql = "select CURRENT_USER(), USER() ";
|
||||
$rs1 = $stmt->executeQuery($sql, ResultSet::FETCHMODE_NUM);
|
||||
$rs1->next();
|
||||
$row = $rs1->getRow();
|
||||
$mysqlUser = str_replace('@', "'@'", $row[0] );
|
||||
|
||||
// $super = false;
|
||||
// $sql = "SELECT * FROM `information_schema`.`USER_PRIVILEGES` where GRANTEE = \"'$mysqlUser'\" and PRIVILEGE_TYPE = 'SUPER' ";
|
||||
// $rs1 = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||
// $rs1->next();
|
||||
// $row = $rs1->getRow();
|
||||
// if ( is_array($row = $rs1->getRow() ) ) {
|
||||
$super = false;
|
||||
$sql = "SELECT * FROM `information_schema`.`USER_PRIVILEGES` where GRANTEE = \"'$mysqlUser'\" and PRIVILEGE_TYPE = 'SUPER' ";
|
||||
$rs1 = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||
$rs1->next();
|
||||
$row = $rs1->getRow();
|
||||
if ( is_array($row = $rs1->getRow() ) ) {
|
||||
$super = true;
|
||||
//}
|
||||
}
|
||||
|
||||
return array( 'user' => $mysqlUser, 'super' => $super );
|
||||
}
|
||||
@@ -944,16 +932,9 @@ class AppCacheView extends BaseAppCacheView {
|
||||
function checkAppCacheView () {
|
||||
$con = Propel::getConnection("workflow");
|
||||
$stmt = $con->createStatement();
|
||||
$connection = $con->getDSN();
|
||||
$sqlType = $connection['phptype'];
|
||||
|
||||
//check if table APP_CACHE_VIEW exists
|
||||
if($sqlType == 'mssql'){
|
||||
//$sql = "SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE';"; //Added by Ankit for mssql
|
||||
$sql = "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES";
|
||||
}
|
||||
else
|
||||
$sql="SHOW TABLES";
|
||||
|
||||
$sql="SHOW TABLES";
|
||||
$rs1 = $stmt->executeQuery($sql, ResultSet::FETCHMODE_NUM);
|
||||
$rs1->next();
|
||||
$found = false;
|
||||
@@ -964,47 +945,6 @@ class AppCacheView extends BaseAppCacheView {
|
||||
$rs1->next();
|
||||
}
|
||||
|
||||
|
||||
$needCreateTable = $found == false;
|
||||
|
||||
//if exists the APP_CACHE_VIEW Table, we need to check if it has the correct number of fields, if not recreate the table
|
||||
$tableRecreated = false;
|
||||
if ( $found ) {
|
||||
if($sqlType == 'mssql')
|
||||
$sql = "SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = 'APP_CACHE_VIEW'"; //Added by Ankit for mssql
|
||||
else
|
||||
$sql="SHOW FIELDS FROM APP_CACHE_VIEW";
|
||||
|
||||
$rs1 = $stmt->executeQuery($sql, ResultSet::FETCHMODE_NUM);
|
||||
$rs1->next();
|
||||
$fields = array();
|
||||
while ( is_array($row = $rs1->getRow() ) ) {
|
||||
$fields[] = $row[0];
|
||||
$rs1->next();
|
||||
}
|
||||
if ( count($fields) != 31 ) {
|
||||
$needCreateTable = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $needCreateTable ) {
|
||||
if($sqlType == 'mssql'){
|
||||
$stmt->executeQuery( "IF EXISTS(SELECT 1 FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'APP_CACHE_VIEW') AND type = (N'U'))
|
||||
DROP TABLE APP_CACHE_VIEW");//Added by Ankit for msssql
|
||||
$filenameSql = $this->pathToAppCacheFiles . 'app_cache_view_mssql.sql';
|
||||
}
|
||||
else{
|
||||
$stmt->executeQuery( "DROP TABLE IF EXISTS `APP_CACHE_VIEW`; ");
|
||||
$filenameSql = $this->pathToAppCacheFiles . 'app_cache_view.sql';}
|
||||
|
||||
if ( !file_exists ( $filenameSql ) )
|
||||
throw ( new Exception ( "file app_cache_view_mssql.sql doesn't exists ") );
|
||||
$sql = file_get_contents ( $filenameSql );
|
||||
$stmt->executeQuery($sql);
|
||||
$tableRecreated = true;
|
||||
$found = true;
|
||||
}
|
||||
|
||||
//now count how many records there are ..
|
||||
$count = '-';
|
||||
if ( $found ) {
|
||||
@@ -1036,7 +976,7 @@ class AppCacheView extends BaseAppCacheView {
|
||||
$stmt->executeQuery($val);
|
||||
}
|
||||
|
||||
$sql = "select count(*) as CANT from APP_CACHE_VIEW";
|
||||
$sql = "select count(*) as CANT from APP_CACHE_VIEW ";
|
||||
$rs1 = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||
$rs1->next();
|
||||
$row1 = $rs1->getRow();
|
||||
@@ -1054,30 +994,14 @@ class AppCacheView extends BaseAppCacheView {
|
||||
$con = Propel::getConnection("workflow");
|
||||
$stmt = $con->createStatement();
|
||||
|
||||
$connection = $con->getDSN();
|
||||
$sqlType = $connection['phptype'];
|
||||
//check if table APP_CACHE_VIEW exists
|
||||
if($sqlType == 'mssql'){
|
||||
$rs = $stmt->executeQuery("select tablename = object_name(parent_obj),* from sysobjects
|
||||
where type = 'tr'", ResultSet::FETCHMODE_ASSOC);}
|
||||
else{
|
||||
$rs = $stmt->executeQuery('Show TRIGGERS', ResultSet::FETCHMODE_ASSOC);
|
||||
}
|
||||
$rs = $stmt->executeQuery('Show TRIGGERS', ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
$found = false;
|
||||
while ( is_array ( $row ) ) {
|
||||
if($sqlType=='mssql')
|
||||
{
|
||||
if ( strtolower($row['name'] == 'APP_DELEGATION_INSERT') && strtoupper($row['tablename']) == 'APP_DELEGATION' ) {
|
||||
$found = true;
|
||||
}
|
||||
if ( strtolower($row['Trigger'] == 'APP_DELEGATION_INSERT') && strtoupper($row['Table']) == 'APP_DELEGATION' ) {
|
||||
$found = true;
|
||||
}
|
||||
else{
|
||||
if ( strtolower($row['Trigger'] == 'APP_DELEGATION_INSERT') && strtoupper($row['Table']) == 'APP_DELEGATION' ) {
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
}
|
||||
@@ -1086,23 +1010,9 @@ class AppCacheView extends BaseAppCacheView {
|
||||
$found = false;
|
||||
}
|
||||
if ( ! $found ) {
|
||||
if($sqlType == 'mssql')
|
||||
{
|
||||
$filenameSql = $this->pathToAppCacheFiles . 'triggerAppDelegationInsert_mssql.sql';
|
||||
}
|
||||
else{
|
||||
$filenameSql = $this->pathToAppCacheFiles . 'triggerAppDelegationInsert.sql';
|
||||
}
|
||||
$filenameSql = $this->pathToAppCacheFiles . 'triggerAppDelegationInsert.sql';
|
||||
if ( !file_exists ( $filenameSql ) )
|
||||
{
|
||||
if($sqlType == 'mssql')
|
||||
{
|
||||
throw ( new Exception ( "file triggerAppDelegationInsert_mssql.sql doesn't exists ") );
|
||||
}
|
||||
else{
|
||||
throw ( new Exception ( "file triggerAppDelegationInsert.sql doesn't exists ") );
|
||||
}
|
||||
}
|
||||
throw ( new Exception ( "file triggerAppDelegationInsert.sql doesn't exists ") );
|
||||
$sql = file_get_contents ( $filenameSql );
|
||||
$sql = str_replace('{lang}', $lang, $sql);
|
||||
$stmt->executeQuery($sql);
|
||||
@@ -1120,30 +1030,14 @@ class AppCacheView extends BaseAppCacheView {
|
||||
$con = Propel::getConnection("workflow");
|
||||
$stmt = $con->createStatement();
|
||||
|
||||
$connection = $con->getDSN();
|
||||
$sqlType = $connection['phptype'];
|
||||
//check if table APP_CACHE_VIEW exists
|
||||
if($sqlType == 'mssql'){
|
||||
$rs = $stmt->executeQuery("select tablename = object_name(parent_obj),* from sysobjects
|
||||
where type = 'tr'", ResultSet::FETCHMODE_ASSOC);}
|
||||
else{
|
||||
$rs = $stmt->executeQuery('Show TRIGGERS', ResultSet::FETCHMODE_ASSOC);
|
||||
}
|
||||
$rs = $stmt->executeQuery("Show TRIGGERS", ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
$found = false;
|
||||
while ( is_array ( $row ) ) {
|
||||
if($sqlType=='mssql')
|
||||
{
|
||||
if ( strtolower($row['name'] == 'APP_DELEGATION_UPDATE') && strtoupper($row['tablename']) == 'APP_DELEGATION' ) {
|
||||
$found = true;
|
||||
}
|
||||
if ( strtolower($row['Trigger'] == 'APP_DELEGATION_UPDATE') && strtoupper($row['Table']) == 'APP_DELEGATION' ) {
|
||||
$found = true;
|
||||
}
|
||||
else{
|
||||
if ( strtolower($row['Trigger'] == 'APP_DELEGATION_UPDATE') && strtoupper($row['Table']) == 'APP_DELEGATION' ) {
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
}
|
||||
@@ -1154,21 +1048,9 @@ class AppCacheView extends BaseAppCacheView {
|
||||
}
|
||||
|
||||
if ( ! $found ) {
|
||||
if($sqlType == 'mssql')
|
||||
{
|
||||
$filenameSql = $this->pathToAppCacheFiles . '/triggerAppDelegationUpdate_mssql.sql';
|
||||
}
|
||||
else{
|
||||
$filenameSql = $this->pathToAppCacheFiles . '/triggerAppDelegationUpdate.sql';
|
||||
}
|
||||
$filenameSql = $this->pathToAppCacheFiles . '/triggerAppDelegationUpdate.sql';
|
||||
if ( !file_exists ( $filenameSql ) )
|
||||
if($sqlType == 'mssql')
|
||||
{
|
||||
throw ( new Exception ( "file triggerAppDelegationUpdate_mssql.sql doesn't exists ") );
|
||||
}
|
||||
else{
|
||||
throw ( new Exception ( "file triggerAppDelegationUpdate.sql doesn't exists ") );
|
||||
}
|
||||
throw ( new Exception ( "file triggerAppDelegationUpdate.sql doesn't exists ") );
|
||||
$sql = file_get_contents ( $filenameSql );
|
||||
$sql = str_replace('{lang}', $lang, $sql);
|
||||
$stmt->executeQuery($sql);
|
||||
@@ -1185,31 +1067,14 @@ class AppCacheView extends BaseAppCacheView {
|
||||
$con = Propel::getConnection("workflow");
|
||||
$stmt = $con->createStatement();
|
||||
|
||||
$connection = $con->getDSN();
|
||||
$sqlType = $connection['phptype'];
|
||||
//check if table APP_CACHE_VIEW exists
|
||||
if($sqlType == 'mssql'){
|
||||
$rs = $stmt->executeQuery("select tablename = object_name(parent_obj),* from sysobjects
|
||||
where type = 'tr'", ResultSet::FETCHMODE_ASSOC);}
|
||||
else{
|
||||
$rs = $stmt->executeQuery('Show TRIGGERS', ResultSet::FETCHMODE_ASSOC);
|
||||
}
|
||||
$rs = $stmt->executeQuery("Show TRIGGERS", ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
$found = false;
|
||||
while ( is_array ( $row ) ) {
|
||||
if($sqlType=='mssql')
|
||||
{
|
||||
if ( strtolower($row['name'] == 'APPLICATION_UPDATE') && strtoupper($row['tablename']) == 'APPLICATION' ) {
|
||||
$found = true;
|
||||
}
|
||||
if ( strtolower($row['Trigger'] == 'APPLICATION_UPDATE') && strtoupper($row['Table']) == 'APPLICATION' ) {
|
||||
$found = true;
|
||||
}
|
||||
else{
|
||||
if ( strtolower($row['Trigger'] == 'APPLICATION_UPDATE') && strtoupper($row['Table']) == 'APPLICATION' ) {
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
}
|
||||
@@ -1219,16 +1084,9 @@ class AppCacheView extends BaseAppCacheView {
|
||||
}
|
||||
|
||||
if ( ! $found ) {
|
||||
if($sqlType=='mssql'){
|
||||
$filenameSql = $this->pathToAppCacheFiles . '/triggerApplicationUpdate_mssql.sql';
|
||||
if ( !file_exists ( $filenameSql ) )
|
||||
throw ( new Exception ( "file triggerAppDelegationUpdate_mssql.sql doesn't exists ") );
|
||||
}
|
||||
else{
|
||||
$filenameSql = $this->pathToAppCacheFiles . '/triggerApplicationUpdate.sql';
|
||||
if ( !file_exists ( $filenameSql ) )
|
||||
throw ( new Exception ( "file triggerAppDelegationUpdate.sql doesn't exists ") );
|
||||
}
|
||||
$filenameSql = $this->pathToAppCacheFiles . '/triggerApplicationUpdate.sql';
|
||||
if ( !file_exists ( $filenameSql ) )
|
||||
throw ( new Exception ( "file triggerAppDelegationUpdate.sql doesn't exists ") );
|
||||
$sql = file_get_contents ( $filenameSql );
|
||||
$sql = str_replace('{lang}', $lang, $sql);
|
||||
$stmt->executeQuery($sql);
|
||||
@@ -1245,31 +1103,14 @@ class AppCacheView extends BaseAppCacheView {
|
||||
$con = Propel::getConnection("workflow");
|
||||
$stmt = $con->createStatement();
|
||||
|
||||
$connection = $con->getDSN();
|
||||
$sqlType = $connection['phptype'];
|
||||
//check if table APP_CACHE_VIEW exists
|
||||
if($sqlType == 'mssql'){
|
||||
$rs = $stmt->executeQuery("select tablename = object_name(parent_obj),* from sysobjects
|
||||
where type = 'tr'", ResultSet::FETCHMODE_ASSOC);}
|
||||
else{
|
||||
$rs = $stmt->executeQuery('Show TRIGGERS', ResultSet::FETCHMODE_ASSOC);
|
||||
}
|
||||
$rs = $stmt->executeQuery("Show TRIGGERS", ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
$found = false;
|
||||
while ( is_array ( $row ) ) {
|
||||
if($sqlType=='mssql')
|
||||
{
|
||||
if ( strtolower($row['name'] == 'APPLICATION_DELETE') && strtoupper($row['tablename']) == 'APPLICATION' ) {
|
||||
$found = true;
|
||||
}
|
||||
if ( strtolower($row['Trigger'] == 'APPLICATION_DELETE') && strtoupper($row['Table']) == 'APPLICATION' ) {
|
||||
$found = true;
|
||||
}
|
||||
else{
|
||||
if ( strtolower($row['Trigger'] == 'APPLICATION_DELETE') && strtoupper($row['Table']) == 'APPLICATION' ) {
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
}
|
||||
@@ -1280,16 +1121,9 @@ class AppCacheView extends BaseAppCacheView {
|
||||
}
|
||||
|
||||
if ( ! $found ) {
|
||||
if($sqlType=='mssql'){
|
||||
$filenameSql = $this->pathToAppCacheFiles . '/triggerApplicationDelete_mssql.sql';
|
||||
if ( !file_exists ( $filenameSql ) )
|
||||
throw ( new Exception ( "file triggerApplicationDelete_mssql.sql doesn't exists ") );
|
||||
}
|
||||
else{
|
||||
$filenameSql = $this->pathToAppCacheFiles . '/triggerApplicationDelete.sql';
|
||||
if ( !file_exists ( $filenameSql ) )
|
||||
throw ( new Exception ( "file triggerAppDelegationDelete.sql doesn't exists ") );
|
||||
}
|
||||
$sql = file_get_contents ( $filenameSql );
|
||||
$sql = str_replace('{lang}', $lang, $sql);
|
||||
$stmt->executeQuery($sql);
|
||||
@@ -1368,4 +1202,4 @@ class AppCacheView extends BaseAppCacheView {
|
||||
return $aRows;
|
||||
}
|
||||
|
||||
}// AppCacheView
|
||||
} // AppCacheView
|
||||
|
||||
Reference in New Issue
Block a user