implementing the ProcessProxy controller

This commit is contained in:
Erik Amaru Ortiz
2011-02-26 22:57:37 +00:00
parent 186c341d16
commit 228d49dd6b
5 changed files with 21 additions and 29 deletions

View File

@@ -42,13 +42,13 @@ class HttpProxyController {
return $this->__data__[$name]; return $this->__data__[$name];
} }
$trace = debug_backtrace(); /*$trace = debug_backtrace();
trigger_error( trigger_error(
'Undefined property via __get(): ' . $name . 'Undefined property via __get(): ' . $name .
' in ' . $trace[0]['file'] . ' in ' . $trace[0]['file'] .
' on line ' . $trace[0]['line'], ' on line ' . $trace[0]['line'],
E_USER_NOTICE); E_USER_NOTICE);
return null; return null;*/
} }
/** /**
@@ -79,10 +79,11 @@ class HttpProxyController {
*/ */
public function call($name) public function call($name)
{ {
//echo __CLASS__;
try { try {
$this->$name($this->__request__); $result = $this->$name($this->__request__);
if( ! $result )
$result = $this->__data__; $result = $this->__data__;
} catch (Exception $e) { } catch (Exception $e) {
$result->success = false; $result->success = false;
$result->msg = $e->getMessage(); $result->msg = $e->getMessage();

View File

@@ -48,6 +48,7 @@ class ProcessCategory extends BaseProcessCategory {
$c->add(ProcessCategoryPeer::CATEGORY_NAME, $sCategoryName); $c->add(ProcessCategoryPeer::CATEGORY_NAME, $sCategoryName);
$dataset = ProcessCategoryPeer::doSelectRS($c); $dataset = ProcessCategoryPeer::doSelectRS($c);
$dataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
$dataset->next(); $dataset->next();
$aRow = $dataset->getRow(); $aRow = $dataset->getRow();
return $aRow; return $aRow;

View File

@@ -519,10 +519,10 @@ Ext.onReady ( function() {
PMExt.notify(_('ID_RESPONSABILITIES_ASSIGNMENT'), result.msg); PMExt.notify(_('ID_RESPONSABILITIES_ASSIGNMENT'), result.msg);
if( typeof parent != 'undefined' ) { if( typeof parent != 'undefined' ) {
var tu_type = '';
parent.Ext.getCmp('eastPanel').show(); parent.Ext.getCmp('eastPanel').show();
parent.Ext.getCmp('usersPanelTabs').setActiveTab(1); parent.Ext.getCmp('usersPanelTabs').setActiveTab(1);
parent.Ext.getCmp('usersTaskGrid').store.reload({params:{tas_uid: _TAS_UID, tu_type: tu_type}});
parent.Ext.getCmp('usersTaskGrid').store.reload({params: {action:'getUsersTask', TAS_UID: _TAS_UID}});
} }
} else { } else {
PMExt.error(_('ID_ERROR'), result.msg) PMExt.error(_('ID_ERROR'), result.msg)

View File

@@ -1,17 +1,15 @@
var _TAS_UID; var _TAS_UID;
var processObj; var processObj;
//var ProcessMapObj;
Ext.onReady ( function() { Ext.onReady ( function() {
new Ext.KeyMap(document, { new Ext.KeyMap(document, {
key: Ext.EventObject.F5, key: Ext.EventObject.F5,
fn: function(keycode, e) { fn: function(keycode, e) {
//e.stopEvent(); e.stopEvent();
} }
}); });
processObj = new ProcessOptions(); processObj = new ProcessOptions();
//ProcessMapObj = new ProcessMapContext();
var west= { var west= {
id : 'palette', id : 'palette',
@@ -32,7 +30,7 @@ Ext.onReady ( function() {
var usersTaskStore = new Ext.data.GroupingStore( { var usersTaskStore = new Ext.data.GroupingStore( {
autoLoad: false, autoLoad: false,
url: '../processes/ajaxListener', url: '../processProxy/getActorsTask',
reader : new Ext.data.JsonReader({ reader : new Ext.data.JsonReader({
totalProperty: 'totalCount', totalProperty: 'totalCount',
root: 'data', root: 'data',
@@ -45,10 +43,7 @@ Ext.onReady ( function() {
{name : 'TU_RELATION'} {name : 'TU_RELATION'}
] ]
}), }),
baseParams: { baseParams: {tas_uid: '', tu_type: ''},
action: 'getUsersTask',
TAS_UID: '4619962094d5d499f746ca7075681567'
},
groupField: 'TU_RELATION' groupField: 'TU_RELATION'
}); });
@@ -187,9 +182,8 @@ Ext.onReady ( function() {
collapseMode:'mini', collapseMode:'mini',
loader : new Ext.tree.TreeLoader({ loader : new Ext.tree.TreeLoader({
preloadChildren : true, preloadChildren : true,
dataUrl : '../processes/ajaxListener', dataUrl : '../processProxy/getProcessDetail',
baseParams : { baseParams : {
action : 'getProcessDetail',
PRO_UID: pro_uid PRO_UID: pro_uid
} }
}), }),
@@ -205,8 +199,10 @@ Ext.onReady ( function() {
eastPanelTree.getSelectionModel().on('selectionchange', function(tree, node){ eastPanelTree.getSelectionModel().on('selectionchange', function(tree, node){
if( node.attributes.type == 'task') { if( node.attributes.type == 'task') {
_TAS_UID = node.attributes.id; _TAS_UID = node.attributes.id;
tu_type = '';
Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = ''; Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = '';
Ext.getCmp('usersTaskGrid').store.reload({params: {action:'getUsersTask', TAS_UID: _TAS_UID}}); Ext.getCmp('usersTaskGrid').store.reload({params: {tas_uid: _TAS_UID, tu_type: tu_type}});
} else { } else {
Ext.getCmp('usersPanelTabs').setActiveTab(0); Ext.getCmp('usersPanelTabs').setActiveTab(0);
Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = 'none'; Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = 'none';
@@ -236,14 +232,14 @@ Ext.onReady ( function() {
store : new Ext.data.Store( { store : new Ext.data.Store( {
//autoLoad: true, //autoload the data //autoLoad: true, //autoload the data
proxy : new Ext.data.HttpProxy( { proxy : new Ext.data.HttpProxy( {
url : '../processes/ajaxListener', url : '../processProxy/getCategoriesList',
method : 'POST' method : 'POST'
}), }),
baseParams : { baseParams : {
action : 'getCategoriesList' action : 'getCategoriesList'
}, },
reader : new Ext.data.JsonReader( { reader : new Ext.data.JsonReader( {
root : 'rows', //root : 'rows',
fields : [ fields : [
{name : 'CATEGORY_UID'}, {name : 'CATEGORY_UID'},
{name : 'CATEGORY_NAME'} {name : 'CATEGORY_NAME'}
@@ -341,9 +337,8 @@ Ext.onReady ( function() {
type = 'process'; type = 'process';
} }
Ext.Ajax.request({ Ext.Ajax.request({
url: '../processes/ajaxListener', url: '../processProxy/saveProperties',
params: { params: {
action : 'saveProperties',
UID: UID, UID: UID,
type: type, type: type,
property: r.record.data.name, property: r.record.data.name,
@@ -368,7 +363,7 @@ Ext.onReady ( function() {
var propertyStore = new Ext.data.JsonStore({ var propertyStore = new Ext.data.JsonStore({
id: 'propertyStore', id: 'propertyStore',
autoLoad: true, //autoload the data autoLoad: true, //autoload the data
url: '../processes/ajaxListener', url: '../processProxy/getProperties',
root: 'prop', root: 'prop',
fields: ['title', 'description'], fields: ['title', 'description'],
store: new Ext.grid.PropertyStore({ store: new Ext.grid.PropertyStore({
@@ -384,7 +379,6 @@ Ext.onReady ( function() {
} }
}, },
baseParams: { baseParams: {
action : 'getProperties',
UID : pro_uid, UID : pro_uid,
type : 'process' type : 'process'
} }

View File

@@ -67,14 +67,10 @@ Ext.onReady(function(){
hiddenName : 'category', hiddenName : 'category',
store : new Ext.data.Store( { store : new Ext.data.Store( {
proxy : new Ext.data.HttpProxy( { proxy : new Ext.data.HttpProxy( {
url : 'ajaxListener', url : '../processProxy/categoriesList',
method : 'POST' method : 'POST'
}), }),
baseParams : {
action : 'categoriesList'
},
reader : new Ext.data.JsonReader( { reader : new Ext.data.JsonReader( {
root : 'rows',
fields : [ { fields : [ {
name : 'CATEGORY_UID' name : 'CATEGORY_UID'
}, { }, {