Merged in jennydmz/processmaker/PM-605 (pull request #943)

Deleting the Creation of RT old Version. & Fixing the paginator in RT List
This commit is contained in:
Julio Cesar Laura Avendaño
2014-10-16 10:03:29 -04:00
2 changed files with 44 additions and 33 deletions

View File

@@ -42,7 +42,7 @@ class pmTablesProxy extends HttpProxyController
if ($pro_uid !== null) {
$process = $pro_uid == '' ? array ('not_equal' => $pro_uid
) : array ('equal' => $pro_uid);
$addTables = AdditionalTables::getAll( $start, $limit, $filter, $process );
$addTables = AdditionalTables::getAll( false, false, $filter, $process );
$c = $processMap->getReportTablesCriteria( $pro_uid );
$oDataset = RoutePeer::doSelectRS( $c );
@@ -51,21 +51,20 @@ class pmTablesProxy extends HttpProxyController
while ($oDataset->next()) {
$reportTablesOldList[] = $oDataset->getRow();
}
$addTables['count'] += count( $reportTablesOldList );
if(($start+$limit) > $addTables['count']){
foreach ($reportTablesOldList as $i => $oldRepTab) {
if($filter != ''){
$oldTableName = strtolower($oldRepTab['REP_TAB_NAME']);
$oldTableDesc = strtolower($oldRepTab['REP_TAB_TITLE']);
if((strpos($oldTableName, $filter) !== false) || (strpos($oldTableDesc, $filter) !== false)){
$addTables['rows'][] = array ('ADD_TAB_UID' => $oldRepTab['REP_TAB_UID'],'PRO_UID' => $oldRepTab['PRO_UID'],'DBS_UID' => ($oldRepTab['REP_TAB_CONNECTION'] == 'wf' ? 'workflow' : 'rp'),'ADD_TAB_DESCRIPTION' => $oldRepTab['REP_TAB_TITLE'],'ADD_TAB_NAME' => $oldRepTab['REP_TAB_NAME'],'ADD_TAB_TYPE' => $oldRepTab['REP_TAB_TYPE'],'TYPE' => 'CLASSIC' );
}
} else {
$addTables['rows'][] = array ('ADD_TAB_UID' => $oldRepTab['REP_TAB_UID'],'PRO_UID' => $oldRepTab['PRO_UID'],'DBS_UID' => ($oldRepTab['REP_TAB_CONNECTION'] == 'wf' ? 'workflow' : 'rp'),'ADD_TAB_DESCRIPTION' => $oldRepTab['REP_TAB_TITLE'],'ADD_TAB_NAME' => $oldRepTab['REP_TAB_NAME'],'ADD_TAB_TYPE' => $oldRepTab['REP_TAB_TYPE'],'TYPE' => 'CLASSIC' );
}
}
}
foreach ($reportTablesOldList as $i => $oldRepTab) {
if($filter != ''){
if((stripos($oldRepTab['REP_TAB_NAME'], $filter) !== false) || (stripos($oldRepTab['REP_TAB_TITLE'], $filter) !== false)){
$addTables['rows'][] = array ('ADD_TAB_UID' => $oldRepTab['REP_TAB_UID'],'PRO_UID' => $oldRepTab['PRO_UID'],'DBS_UID' => ($oldRepTab['REP_TAB_CONNECTION'] == 'wf' ? 'workflow' : 'rp'),'ADD_TAB_DESCRIPTION' => $oldRepTab['REP_TAB_TITLE'],'ADD_TAB_NAME' => $oldRepTab['REP_TAB_NAME'],'ADD_TAB_TYPE' => $oldRepTab['REP_TAB_TYPE'],'TYPE' => 'CLASSIC' );
}
} else {
$addTables['rows'][] = array ('ADD_TAB_UID' => $oldRepTab['REP_TAB_UID'],'PRO_UID' => $oldRepTab['PRO_UID'],'DBS_UID' => ($oldRepTab['REP_TAB_CONNECTION'] == 'wf' ? 'workflow' : 'rp'),'ADD_TAB_DESCRIPTION' => $oldRepTab['REP_TAB_TITLE'],'ADD_TAB_NAME' => $oldRepTab['REP_TAB_NAME'],'ADD_TAB_TYPE' => $oldRepTab['REP_TAB_TYPE'],'TYPE' => 'CLASSIC' );
}
}
$addTables['count'] = count($addTables['rows']);
if($start != 0){
$addTables['rows'] = array_splice($addTables['rows'], $start);
}
$addTables['rows'] = array_splice($addTables['rows'], 0, $limit);
} else {
$addTables = AdditionalTables::getAll( $start, $limit, $filter );
}

View File

@@ -40,33 +40,43 @@ Ext.onReady(function(){
pageSize = parseInt(CONFIG.pageSize);
var newMenuOptions = new Array();
if (PRO_UID == false) {
var newMenuOptions = new Array();
newMenuOptions.push({
text: _('ID_NEW_PMTABLE'),
handler: newPMTable
text: _('ID_NEW_PMTABLE'),
handler: newPMTable
});
newMenuOptions.push({
text: _('ID_NEW_REPORT_TABLE'),
handler: NewReportTable
});
newButton = new Ext.Action({
id: 'newButton',
text: _('ID_NEW'),
icon: '/images/add-table.png',
menu: newMenuOptions
});
}
var flagProcessmap = (typeof('flagProcessmap') != 'undefined') ? flagProcessmap : 0;
newMenuOptions.push({
text: _('ID_NEW_REPORT_TABLE'),
handler: NewReportTable
});
if (PRO_UID !== false) {
/*if (PRO_UID !== false) {
newMenuOptions.push({
text: _('ID_NEW_REPORT_TABLE_OLD'),
handler: NewReportTableOld
});
}
}*/
newButton = new Ext.Action({
id: 'newButton',
text: _('ID_NEW'),
icon: '/images/add-table.png',
menu: newMenuOptions
});
if (PRO_UID !== false) {
newButton = new Ext.Action({
id: 'newButton',
text: _('ID_NEW'),
icon: '/images/add-table.png',
handler: NewReportTable
});
}
editButton = new Ext.Action({
id: 'editButton',
@@ -705,12 +715,14 @@ UpdatePageConfig = function(pageSize){
//Do Search Function
DoSearch = function(){
infoGrid.store.load({params: {textFilter: searchText.getValue()}});
infoGrid.store.setBaseParam('textFilter', searchText.getValue());
infoGrid.store.load();
};
//Load Grid By Default
GridByDefault = function(){
searchText.reset();
infoGrid.store.setBaseParam('textFilter', searchText.getValue());
infoGrid.store.load();
};