BUG 0000 PM TABLES - importing issue
- fixed the problem when multiples tables are selected to import
This commit is contained in:
@@ -1061,15 +1061,17 @@ class AdditionalTables extends BaseAdditionalTables {
|
||||
FieldsPeer::doDelete($oCriteria);
|
||||
|
||||
//deleting table
|
||||
if ( isset($aData['DBS_UID']) && $aData['DBS_UID'] != 'wf' && $aData['DBS_UID'] != '') {
|
||||
$con = Propel::getConnection($aData['DBS_UID']);
|
||||
$stmt = $con->createStatement();
|
||||
$stmt->executeQuery('DROP TABLE '.$aData['ADD_TAB_NAME']);
|
||||
} else {
|
||||
if ($aData['DBS_UID'] == 'wf' || $aData['DBS_UID'] == 'workflow' || $aData['DBS_UID'] == '' || $aData['DBS_UID'] == '0' || !$aData['DBS_UID']) {
|
||||
G::LoadSystem('database_' . strtolower(DB_ADAPTER));
|
||||
$oDataBase = new database(DB_ADAPTER, DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
||||
$oDataBase->iFetchType = MYSQL_NUM;
|
||||
$oDataBase->executeQuery($oDataBase->generateDropTableSQL($aData['ADD_TAB_NAME']));
|
||||
} else {
|
||||
$con = Propel::getConnection($aData['DBS_UID']);
|
||||
if (is_object($con)) {
|
||||
$stmt = $con->createStatement();
|
||||
$stmt->executeQuery('DROP TABLE '.$aData['ADD_TAB_NAME']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1216,9 +1218,12 @@ var additionalTablesDataDelete = function(sUID, sKeys) {
|
||||
$con = Propel::getConnection($aData['DBS_UID']);
|
||||
$oCriteria = new Criteria($aData['DBS_UID']);
|
||||
|
||||
eval('$oCriteria->addSelectColumn("\'1\' AS DUMMY");');
|
||||
//eval('$oCriteria->addSelectColumn("\'1\' AS DUMMY");');
|
||||
foreach ($aData['FIELDS'] as $aField) {
|
||||
eval('$oCriteria->addSelectColumn(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ');');
|
||||
if ($aField['FLD_KEY'] == '1') {
|
||||
eval('$oCriteria->addAscendingOrderByColumn(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ');');
|
||||
}
|
||||
}
|
||||
|
||||
$oCriteriaCount = clone $oCriteria;
|
||||
|
||||
@@ -28,6 +28,7 @@ class pmTables extends Controller
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$this->includeExtJS('pmTables/list', $this->debug);
|
||||
$this->includeExtJS('pmTables/export', $this->debug);
|
||||
$this->setView('pmTables/list');
|
||||
|
||||
//assigning js variables
|
||||
@@ -122,6 +123,16 @@ class pmTables extends Controller
|
||||
$this->setJSVar('EXPORT_TABLES', $toSend);
|
||||
G::RenderPage('publish', 'extJs');
|
||||
}
|
||||
|
||||
public function streamExported($httpData)
|
||||
{
|
||||
$PUBLIC_ROOT_PATH = PATH_DATA.'sites'.PATH_SEP.SYS_SYS.PATH_SEP.'public'.PATH_SEP;
|
||||
$sFileName = $httpData->f;
|
||||
|
||||
$realPath = $PUBLIC_ROOT_PATH . $sFileName;
|
||||
G::streamFile ( $realPath, true );
|
||||
unlink($realPath);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -114,7 +114,16 @@ Ext.onReady(function(){
|
||||
|
||||
//row editor for table columns grid
|
||||
editor = new Ext.ux.grid.RowEditor({
|
||||
saveText: _("ID_UPDATE")
|
||||
saveText: _("ID_UPDATE"),
|
||||
listeners: {
|
||||
afteredit: {
|
||||
fn:function(rowEditor, obj, data, rowIndex ){
|
||||
if (data.phantom === true) {
|
||||
store.reload(); // only if it is an insert
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var proxy = new Ext.data.HttpProxy({
|
||||
@@ -142,16 +151,16 @@ Ext.onReady(function(){
|
||||
totalProperty: 'count'
|
||||
})
|
||||
|
||||
store = new Ext.data.GroupingStore({
|
||||
store = new Ext.data.Store({
|
||||
proxy : proxy,
|
||||
reader : reader,
|
||||
writer : writer, // <-- plug a DataWriter into the store just as you would a Reader
|
||||
autoSave: true // <-- false would delay executing create, update, destroy requests until specifically told to do so with some [save] buton.
|
||||
});
|
||||
|
||||
Ext.data.DataProxy.addListener('write', function(proxy, action, result, res, rs) {
|
||||
/*Ext.data.DataProxy.addListener('write', function(proxy, action, result, res, rs) {
|
||||
PMExt.notify('UPDATE', 'the record was updated successfully.');
|
||||
});
|
||||
});*/
|
||||
|
||||
// load the store immeditately
|
||||
//store.load();
|
||||
@@ -225,16 +234,12 @@ Ext.onReady(function(){
|
||||
sm: smodel,
|
||||
tbar:[newButton,'-',editButton, deleteButton,'-',importButton,{xtype: 'tbfill' }, backButton],
|
||||
bbar: bbarpaging,
|
||||
listeners: {
|
||||
/*listeners: {
|
||||
//rowdblclick: EditPMTableRow,
|
||||
render: function(){
|
||||
this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING_GRID')});
|
||||
}
|
||||
},
|
||||
view: new Ext.grid.GroupingView({
|
||||
forceFit:true,
|
||||
groupTextTpl: '{text}'
|
||||
})
|
||||
},*/
|
||||
});
|
||||
|
||||
infoGrid.on('rowcontextmenu',
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -245,6 +245,7 @@ Ext.onReady(function(){
|
||||
});
|
||||
|
||||
cmodelColumns = new Array();
|
||||
cmodelColumns.push(new Ext.grid.CheckboxSelectionModel());
|
||||
cmodelColumns.push({id:'ADD_TAB_UID', dataIndex: 'ADD_TAB_UID', hidden:true, hideable:false});
|
||||
cmodelColumns.push({dataIndex: 'ADD_TAB_TAG', hidden:true, hideable:false});
|
||||
cmodelColumns.push({header: _('ID_NAME'), dataIndex: 'ADD_TAB_NAME', width: 300, align:'left', renderer: function(v,p,r){
|
||||
@@ -539,6 +540,23 @@ ImportPMTable = function(){
|
||||
|
||||
//Load Export PM Tables Form
|
||||
ExportPMTable = function(){
|
||||
var rows = Ext.getCmp('infoGrid').getSelectionModel().getSelections();
|
||||
var toExportRows = new Array();
|
||||
|
||||
for(var i=0; i<rows.length; i++){
|
||||
toExportRows.push([
|
||||
rows[i].get('ADD_TAB_UID'),
|
||||
rows[i].get('ADD_TAB_NAME'),
|
||||
(rows[i].get('PRO_UID') == ''? 'Table': 'Report'),
|
||||
true,
|
||||
false
|
||||
]);
|
||||
}
|
||||
|
||||
Export.targetGrid.store.loadData(toExportRows);
|
||||
|
||||
Export.window.show();
|
||||
return;
|
||||
iGrid = Ext.getCmp('infoGrid');
|
||||
rowsSelected = iGrid.getSelectionModel().getSelections();
|
||||
//location.href = 'additionalTablesToExport?sUID='+RetrieveRowsID(rowsSelected)+'&rand='+Math.random();
|
||||
|
||||
Reference in New Issue
Block a user