Merge code from github.com to bitbucket.org 2014-06-20 12:20
This commit is contained in:
@@ -198,8 +198,16 @@ class MySQLConnection extends ConnectionCommon implements Connection {
|
||||
}
|
||||
}//echo $sql . '<br /><br />';
|
||||
$result = @mysql_query($sql, $this->dblink);
|
||||
|
||||
if (!$result) {
|
||||
throw new SQLException('Could not execute query', mysql_error($this->dblink), $sql);
|
||||
if (!defined('DEBUG_SQL')) {
|
||||
define('DEBUG_SQL', 0);
|
||||
}
|
||||
if (DEBUG_SQL == 1) {
|
||||
throw new SQLException('Could not execute query', mysql_error($this->dblink), $sql);
|
||||
} else {
|
||||
throw new SQLException('It is not possible to execute the query. Please contact your system administrator');
|
||||
}
|
||||
}
|
||||
return new MySQLResultSet($this, $result, $fetchmode);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,14 @@ class Applications
|
||||
) {
|
||||
$callback = isset($callback)? $callback : "stcCallback1001";
|
||||
$dir = isset($dir)? $dir : "DESC";
|
||||
|
||||
if (isset($sort)) {
|
||||
G::LoadClass('phpSqlParser');
|
||||
$parser = new PHPSQLParser($sort);
|
||||
$sort = $parser->parsed;
|
||||
$sort = $sort[''][0];
|
||||
}
|
||||
|
||||
$sort = isset($sort)? $sort : "";
|
||||
$start = isset($start)? $start : "0";
|
||||
$limit = isset($limit)? $limit : "25";
|
||||
@@ -497,7 +505,7 @@ class Applications
|
||||
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
//g::pr($oDataset);
|
||||
//g::pr($oDataset);
|
||||
$result = array ();
|
||||
$result['totalCount'] = $totalCount;
|
||||
$rows = array ();
|
||||
|
||||
@@ -1107,8 +1107,10 @@ class System
|
||||
}
|
||||
|
||||
// Workspace environment configuration
|
||||
if (($wsConf = @parse_ini_file($wsIniFile)) !== false) {
|
||||
$config = array_merge($config, $wsConf);
|
||||
if (file_exists($wsIniFile) ) {
|
||||
if (($wsConf = @parse_ini_file($wsIniFile)) !== false) {
|
||||
$config = array_merge($config, $wsConf);
|
||||
}
|
||||
}
|
||||
|
||||
// validation debug config, only binary value is valid; debug = 1, to enable
|
||||
|
||||
@@ -368,7 +368,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
}
|
||||
}
|
||||
|
||||
public function getAllData($sUID, $start = null, $limit = null, $keyOrderUppercase = true, $filter = '')
|
||||
public function getAllData($sUID, $start = null, $limit = null, $keyOrderUppercase = true, $filter = '', $appUid = false)
|
||||
{
|
||||
$addTab = new AdditionalTables();
|
||||
$aData = $addTab->load($sUID, true);
|
||||
@@ -421,17 +421,17 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$closure = '';
|
||||
$types = array('INTEGER', 'BIGINT', 'SMALLINT', 'TINYINT', 'DECIMAL', 'DOUBLE', 'FLOAT', 'REAL');
|
||||
foreach ($aData['FIELDS'] as $aField) {
|
||||
if ($aField['FLD_NAME'] != 'APP_UID') {
|
||||
if (in_array($aField['FLD_TYPE'], $types)) {
|
||||
if (is_numeric($filter)) {
|
||||
$stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "' . $filter . '", Criteria::EQUAL)' . $closure . ';';
|
||||
$closure = '->addOr($a)';
|
||||
}
|
||||
} else {
|
||||
$stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "%' . $filter . '%", Criteria::LIKE)' . $closure . ';';
|
||||
$closure = '->addOr($a)';
|
||||
}
|
||||
}
|
||||
if (($appUid == false && $aField['FLD_NAME'] != 'APP_UID') || ($appUid == true)) {
|
||||
if (in_array($aField['FLD_TYPE'], $types)) {
|
||||
if (is_numeric($filter)) {
|
||||
$stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "' . $filter . '", Criteria::EQUAL)' . $closure . ';';
|
||||
$closure = '->addOr($a)';
|
||||
}
|
||||
} else {
|
||||
$stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "%' . $filter . '%", Criteria::LIKE)' . $closure . ';';
|
||||
$closure = '->addOr($a)';
|
||||
}
|
||||
}
|
||||
}
|
||||
$stringOr = $stringOr . '$oCriteria->add($a);';
|
||||
eval($stringOr);
|
||||
|
||||
@@ -410,6 +410,7 @@ class pmTablesProxy extends HttpProxyController
|
||||
* @param string $httpData->id
|
||||
* @param string $httpData->start
|
||||
* @param string $httpData->limit
|
||||
* @param string $httpData->appUid
|
||||
*/
|
||||
public function dataView ($httpData)
|
||||
{
|
||||
@@ -421,13 +422,14 @@ class pmTablesProxy extends HttpProxyController
|
||||
$limit_size = isset( $config['pageSize'] ) ? $config['pageSize'] : 20;
|
||||
$start = isset( $httpData->start ) ? $httpData->start : 0;
|
||||
$limit = isset( $httpData->limit ) ? $httpData->limit : $limit_size;
|
||||
$appUid = isset( $httpData->appUid ) ? $httpData->appUid : false;
|
||||
$appUid = ($appUid == "true") ? true : false;
|
||||
$filter = isset( $httpData->textFilter ) ? $httpData->textFilter : '';
|
||||
|
||||
$additionalTables = new AdditionalTables();
|
||||
$table = $additionalTables->load( $httpData->id, true );
|
||||
|
||||
if ($filter != '') {
|
||||
$result = $additionalTables->getAllData( $httpData->id, $start, $limit, true, $filter);
|
||||
$result = $additionalTables->getAllData( $httpData->id, $start, $limit, true, $filter, $appUid);
|
||||
} else {
|
||||
$result = $additionalTables->getAllData( $httpData->id, $start, $limit );
|
||||
}
|
||||
|
||||
@@ -76,6 +76,11 @@ Ext.onReady(function(){
|
||||
handler: DoSearch
|
||||
});
|
||||
|
||||
appUidSearch = new Ext.form.Checkbox ({
|
||||
id: 'appUidSearch',
|
||||
boxLabel : 'Search also in the APP_UID field'
|
||||
});
|
||||
|
||||
contextMenu = new Ext.menu.Menu({
|
||||
items : [ editButton, deleteButton ]
|
||||
});
|
||||
@@ -386,6 +391,7 @@ Ext.onReady(function(){
|
||||
importButton,
|
||||
exportButton,
|
||||
'->',
|
||||
appUidSearch,
|
||||
searchText,
|
||||
clearTextButton,
|
||||
searchButton
|
||||
@@ -394,6 +400,7 @@ Ext.onReady(function(){
|
||||
else
|
||||
tbar = [genDataReportButton,
|
||||
'->',
|
||||
appUidSearch,
|
||||
searchText,
|
||||
clearTextButton,
|
||||
searchButton];
|
||||
@@ -466,12 +473,13 @@ onMessageContextMenu = function (grid, rowIndex, e) {
|
||||
//Do Search Function
|
||||
DoSearch = function(){
|
||||
infoGrid.store.setBaseParam('textFilter', searchText.getValue());
|
||||
infoGrid.store.load({params: {start : 0 , limit : pageSize }});
|
||||
infoGrid.store.load({params: {start : 0 , limit : pageSize , appUid : appUidSearch.getValue() }});
|
||||
};
|
||||
|
||||
//Load Grid By Default
|
||||
GridByDefault = function(){
|
||||
searchText.reset();
|
||||
appUidSearch.reset();
|
||||
infoGrid.store.setBaseParam('textFilter', searchText.getValue());
|
||||
infoGrid.store.load();
|
||||
};
|
||||
|
||||
@@ -313,6 +313,7 @@ ini_set( 'soap.wsdl_cache_enabled', $config['wsdl_cache'] );
|
||||
ini_set( 'date.timezone', $config['time_zone'] );
|
||||
|
||||
define( 'DEBUG_SQL_LOG', $config['debug_sql'] );
|
||||
define( 'DEBUG_SQL', $config['debug'] );
|
||||
define( 'DEBUG_TIME_LOG', $config['debug_time'] );
|
||||
define( 'DEBUG_CALENDAR_LOG', $config['debug_calendar'] );
|
||||
define( 'MEMCACHED_ENABLED', $config['memcached'] );
|
||||
|
||||
Reference in New Issue
Block a user