Merge pull request #2464 from Jennydmz/master
BUG-15193 Error in PM Table Data Search option
This commit is contained in:
@@ -347,7 +347,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);
|
||||
@@ -400,17 +400,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);
|
||||
|
||||
@@ -408,6 +408,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)
|
||||
{
|
||||
@@ -419,13 +420,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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user