BUG 0000 Refactoring for propel-generator/Database class to DatabasePropel class
- fixes in data editing - fixes in pmtables import
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
include_once 'propel/engine/EngineException.php';
|
||||
include_once 'propel/engine/database/model/Database.php';
|
||||
include_once 'propel/engine/database/model/DatabasePropel.php';
|
||||
|
||||
/**
|
||||
* A class for holding application data structures.
|
||||
@@ -158,7 +158,7 @@ class AppData {
|
||||
*/
|
||||
public function addDatabase($db)
|
||||
{
|
||||
if ($db instanceof Database) {
|
||||
if ($db instanceof DatabasePropel) {
|
||||
$db->setAppData($this);
|
||||
if ($db->getPlatform() === null) {
|
||||
$db->setPlatform($this->platform);
|
||||
@@ -167,7 +167,7 @@ class AppData {
|
||||
return $db;
|
||||
} else {
|
||||
// XML attributes array / hash
|
||||
$d = new Database();
|
||||
$d = new DatabasePropel();
|
||||
$d->loadFromXML($db);
|
||||
return $this->addDatabase($d); // calls self w/ different param type
|
||||
}
|
||||
|
||||
463
gulliver/thirdparty/propel-generator/classes/propel/engine/database/model/DatabasePropel.php
vendored
Normal file
463
gulliver/thirdparty/propel-generator/classes/propel/engine/database/model/DatabasePropel.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -95,7 +95,7 @@ class Domain extends XMLElement {
|
||||
/**
|
||||
* Sets the owning database object (if this domain is being setup via XML).
|
||||
*/
|
||||
public function setDatabase(Database $database) {
|
||||
public function setDatabase(DatabasePropel $database) {
|
||||
$this->database = $database;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class XmlToData extends AbstractHandler {
|
||||
*
|
||||
* @param Database $database
|
||||
*/
|
||||
public function __construct(Database $database, $encoding = 'iso-8859-1')
|
||||
public function __construct(DatabasePropel $database, $encoding = 'iso-8859-1')
|
||||
{
|
||||
$this->database = $database;
|
||||
$this->encoding = $encoding;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
//include_once 'phing/tasks/ext/CapsuleTask.php';
|
||||
require_once 'phing/TaskPhing.php';
|
||||
include_once 'propel/engine/database/model/AppData.php';
|
||||
include_once 'propel/engine/database/model/Database.php';
|
||||
include_once 'propel/engine/database/model/DatabasePropel.php';
|
||||
include_once 'propel/engine/database/transform/XmlToAppData.php';
|
||||
|
||||
/**
|
||||
|
||||
@@ -349,7 +349,7 @@ class PropelDataDumpTask extends AbstractPropelDataModelTask {
|
||||
* @param Database $database
|
||||
* @return DOMDocument
|
||||
*/
|
||||
private function createXMLDoc(Database $database) {
|
||||
private function createXMLDoc(DatabasePropel $database) {
|
||||
|
||||
$doc = new DOMDocument('1.0', 'utf-8');
|
||||
$doc->formatOutput = true; // pretty printing
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
require_once 'propel/phing/AbstractPropelDataModelTask.php';
|
||||
include_once 'propel/engine/database/model/AppData.php';
|
||||
include_once 'propel/engine/database/model/Database.php';
|
||||
include_once 'propel/engine/database/model/DatabasePropel.php';
|
||||
include_once 'propel/engine/database/transform/XmlToAppData.php';
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
include_once 'propel/engine/database/model/AppData.php';
|
||||
include_once 'propel/engine/database/model/Database.php';
|
||||
include_once 'propel/engine/database/model/DatabasePropel.php';
|
||||
include_once 'propel/engine/database/transform/XmlToAppData.php';
|
||||
include_once 'propel/engine/database/transform/XmlToData.php';
|
||||
|
||||
|
||||
@@ -280,7 +280,7 @@ class PropelOldSQLTask extends AbstractPropelDataModelTask {
|
||||
//'heavyIndexing' => $db->getHeavyIndexing(),
|
||||
);
|
||||
|
||||
$clone = new Database();
|
||||
$clone = new DatabasePropel();
|
||||
$clone->loadFromXML($attributes);
|
||||
return $clone;
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ class PropelSQLTask extends AbstractPropelDataModelTask {
|
||||
//'heavyIndexing' => $db->getHeavyIndexing(),
|
||||
);
|
||||
|
||||
$clone = new Database();
|
||||
$clone = new DatabasePropel();
|
||||
$clone->loadFromXML($attributes);
|
||||
return $clone;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -260,6 +260,7 @@ Ext.onReady(function(){
|
||||
forceFit:true
|
||||
},
|
||||
store: store,
|
||||
loadMask: true,
|
||||
cm: cmodel,
|
||||
sm: smodel,
|
||||
tbar:[ newButton,
|
||||
@@ -292,14 +293,14 @@ Ext.onReady(function(){
|
||||
infoGrid.on('contextmenu', function(evt){evt.preventDefault();}, this);
|
||||
infoGrid.addListener('rowcontextmenu',onMessageContextMenu, this);
|
||||
|
||||
infoGrid.store.load();
|
||||
|
||||
viewport = new Ext.Viewport({
|
||||
layout: 'fit',
|
||||
autoScroll: false,
|
||||
items: [infoGrid]
|
||||
});
|
||||
|
||||
infoGrid.store.load();
|
||||
|
||||
});
|
||||
|
||||
//Funtion Handles Context Menu Opening
|
||||
|
||||
@@ -114,7 +114,6 @@ Ext.onReady(function(){
|
||||
contextMenuItems.push(exportButton);
|
||||
|
||||
if (_PLUGIN_SIMPLEREPORTS !== false) {
|
||||
|
||||
externalOption = new Ext.Action({
|
||||
text:'',
|
||||
handler: function() {
|
||||
@@ -131,22 +130,22 @@ Ext.onReady(function(){
|
||||
});
|
||||
|
||||
searchText = new Ext.form.TextField ({
|
||||
id: 'searchTxt',
|
||||
ctCls:'pm_search_text_field',
|
||||
allowBlank: true,
|
||||
width: 150,
|
||||
emptyText: _('ID_ENTER_SEARCH_TERM'),
|
||||
listeners: {
|
||||
specialkey: function(f,e){
|
||||
if (e.getKey() == e.ENTER) {
|
||||
DoSearch();
|
||||
}
|
||||
},
|
||||
focus: function(f,e) {
|
||||
var row = infoGrid.getSelectionModel().getSelected();
|
||||
infoGrid.getSelectionModel().deselectRow(infoGrid.getStore().indexOf(row));
|
||||
id: 'searchTxt',
|
||||
ctCls:'pm_search_text_field',
|
||||
allowBlank: true,
|
||||
width: 150,
|
||||
emptyText: _('ID_ENTER_SEARCH_TERM'),
|
||||
listeners: {
|
||||
specialkey: function(f,e){
|
||||
if (e.getKey() == e.ENTER) {
|
||||
DoSearch();
|
||||
}
|
||||
},
|
||||
focus: function(f,e) {
|
||||
var row = infoGrid.getSelectionModel().getSelected();
|
||||
infoGrid.getSelectionModel().deselectRow(infoGrid.getStore().indexOf(row));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
clearTextButton = new Ext.Action({
|
||||
@@ -182,6 +181,7 @@ Ext.onReady(function(){
|
||||
comboPageSize.setValue(pageSize);
|
||||
|
||||
store = new Ext.data.GroupingStore( {
|
||||
autoLoad: false,
|
||||
proxy : new Ext.data.HttpProxy({
|
||||
url: 'pmTablesProxy/getList' + (PRO_UID? '?pro_uid='+PRO_UID: '')
|
||||
}),
|
||||
@@ -293,14 +293,25 @@ Ext.onReady(function(){
|
||||
forceFit:true
|
||||
},
|
||||
store: store,
|
||||
loadMask: true,
|
||||
cm: cmodel,
|
||||
sm: smodel,
|
||||
tbar:[newButton, editButton, deleteButton,'-', dataButton,'-' , importButton, exportButton,{xtype: 'tbfill'},searchText,clearTextButton,searchButton],
|
||||
tbar: [
|
||||
newButton,
|
||||
editButton,
|
||||
deleteButton,'-',
|
||||
dataButton,'-' ,
|
||||
importButton,
|
||||
exportButton,
|
||||
'->',
|
||||
searchText,
|
||||
clearTextButton,
|
||||
searchButton],
|
||||
bbar: bbarpaging,
|
||||
listeners: {
|
||||
rowdblclick: EditPMTable,
|
||||
render: function(){
|
||||
this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING_GRID')});
|
||||
this.loadMask = new Ext.LoadMask(this.body, {msg:'loading'});
|
||||
}
|
||||
},
|
||||
view: new Ext.grid.GroupingView({
|
||||
@@ -310,38 +321,35 @@ Ext.onReady(function(){
|
||||
});
|
||||
|
||||
infoGrid.on('rowcontextmenu',
|
||||
function (grid, rowIndex, evt) {
|
||||
var sm = grid.getSelectionModel();
|
||||
sm.selectRow(rowIndex, sm.isSelected(rowIndex));
|
||||
function (grid, rowIndex, evt) {
|
||||
var sm = grid.getSelectionModel();
|
||||
sm.selectRow(rowIndex, sm.isSelected(rowIndex));
|
||||
|
||||
var rowsSelected = Ext.getCmp('infoGrid').getSelectionModel().getSelections();
|
||||
tag = rowsSelected[0].get('ADD_TAB_TAG');
|
||||
text = tag? 'Convert to native Report Table': 'Convert to Simple Report';
|
||||
if (externalOption) {
|
||||
externalOption.setText(text);
|
||||
if (rowsSelected[0].get('PRO_UID')) {
|
||||
externalOption.setDisabled(false);
|
||||
} else {
|
||||
externalOption.setDisabled(true);
|
||||
}
|
||||
var rowsSelected = Ext.getCmp('infoGrid').getSelectionModel().getSelections();
|
||||
tag = rowsSelected[0].get('ADD_TAB_TAG');
|
||||
text = tag? 'Convert to native Report Table': 'Convert to Simple Report';
|
||||
if (externalOption) {
|
||||
externalOption.setText(text);
|
||||
if (rowsSelected[0].get('PRO_UID')) {
|
||||
externalOption.setDisabled(false);
|
||||
} else {
|
||||
externalOption.setDisabled(true);
|
||||
}
|
||||
},
|
||||
this
|
||||
}
|
||||
},
|
||||
this
|
||||
);
|
||||
|
||||
infoGrid.on('contextmenu', function(evt){evt.preventDefault();}, this);
|
||||
infoGrid.addListener('rowcontextmenu',onMessageContextMenu, this);
|
||||
|
||||
infoGrid.store.load();
|
||||
|
||||
viewport = new Ext.Viewport({
|
||||
layout: 'fit',
|
||||
autoScroll: false,
|
||||
items: [
|
||||
infoGrid
|
||||
]
|
||||
items: [infoGrid]
|
||||
});
|
||||
|
||||
|
||||
infoGrid.store.load();
|
||||
});
|
||||
|
||||
//Funtion Handles Context Menu Opening
|
||||
@@ -482,6 +490,9 @@ ImportPMTable = function(){
|
||||
url: 'pmTablesProxy/import',
|
||||
waitMsg: 'Uploading file...',
|
||||
success: function(o, resp){
|
||||
console.log(o);
|
||||
console.log(resp.response.responseText);
|
||||
|
||||
w.close();
|
||||
infoGrid.store.reload();
|
||||
|
||||
@@ -511,14 +522,7 @@ ImportPMTable = function(){
|
||||
}
|
||||
}]
|
||||
})
|
||||
]/*,
|
||||
listeners:{
|
||||
show:function() {
|
||||
this.loadMask = new Ext.LoadMask(this.body, {
|
||||
msg:'Loading. Please wait...'
|
||||
});
|
||||
}
|
||||
}*/
|
||||
]
|
||||
});
|
||||
w.show();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user