Web Entry compatibility fixes with Designer 1.1

This commit is contained in:
Enrique Ponce de Leon
2011-03-03 21:24:42 +00:00
parent 1ec5c0fde8
commit 4f17add70d
2 changed files with 70 additions and 62 deletions

View File

@@ -2,7 +2,7 @@
class webEntryProxy extends HttpProxyController class webEntryProxy extends HttpProxyController
{ {
//Delete Web Entry //Delete Web Entry
function deleteWebEntry($params){ function delete($params){
require_once 'classes/model/Event.php'; require_once 'classes/model/Event.php';
$pro_uid = $params->PRO_UID; $pro_uid = $params->PRO_UID;
$filename = $params->FILE_NAME; $filename = $params->FILE_NAME;
@@ -108,7 +108,7 @@ class webEntryProxy extends HttpProxyController
$this->msg = $message; $this->msg = $message;
} }
//Save New WebEntry //Save New WebEntry
function saveWebEntry($params){ function save($params){
require_once 'classes/model/Event.php'; require_once 'classes/model/Event.php';
global $G_FORM; global $G_FORM;
$sPRO_UID = $params->pro_uid; $sPRO_UID = $params->pro_uid;
@@ -235,4 +235,13 @@ class webEntryProxy extends HttpProxyController
$this->DYN_TITLE = $dynTitle; $this->DYN_TITLE = $dynTitle;
$this->USR_UID = $sWS_USER; $this->USR_UID = $sWS_USER;
} }
function load($params){
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
$PRO_UID = $params->PRO_UID;
$EVN_UID = $params->EVN_UID;
$sOutput = $oProcessMap->listNewWebEntry($PRO_UID,$EVN_UID);
return $sOutput;
}
} //End webEntryProxy } //End webEntryProxy

View File

@@ -50,7 +50,7 @@ pmosExt.prototype.popWebEntry= function(_5678)
{ {
var oTask = workflow.taskUid; var oTask = workflow.taskUid;
var oDyna = workflow.dynaList; var oDyna = workflow.dynaList;
var newButton = new Ext.Action({ var newButton = new Ext.Action({
text: _('ID_NEW_WEB_ENTRY'), text: _('ID_NEW_WEB_ENTRY'),
iconCls: 'button_menu_ext ss_sprite ss_add', iconCls: 'button_menu_ext ss_sprite ss_add',
@@ -58,6 +58,7 @@ pmosExt.prototype.popWebEntry= function(_5678)
handler: function(){ handler: function(){
webForm.hide(); webForm.hide();
editForm.getForm().reset(); editForm.getForm().reset();
Ext.getCmp('frameEdit').setTitle = _('ID_NEW_WEB_ENTRY');
editForm.getForm().findField('pro_uid').setValue(pro_uid); editForm.getForm().findField('pro_uid').setValue(pro_uid);
editForm.getForm().findField('evn_uid').setValue(evn_uid); editForm.getForm().findField('evn_uid').setValue(evn_uid);
editForm.getForm().findField('dynaform').setValue(''); editForm.getForm().findField('dynaform').setValue('');
@@ -66,25 +67,26 @@ pmosExt.prototype.popWebEntry= function(_5678)
newButton.disable(); newButton.disable();
} }
}); });
var editButton = new Ext.Action({ var editButton = new Ext.Action({
text: _('ID_EDIT'), text: _('ID_EDIT'),
iconCls: 'button_menu_ext ss_sprite ss_pencil', iconCls: 'button_menu_ext ss_sprite ss_pencil',
hidden: true, hidden: true,
handler: function(){ handler: function(){
webForm.hide(); webForm.hide();
editForm.title = _('ID_EDIT_WEB_ENTRY'); editForm.getForm().reset();
Ext.getCmp('frameEdit').setTitle = _('ID_EDIT_WEB_ENTRY');
editForm.getForm().findField('pro_uid').setValue(pro_uid); editForm.getForm().findField('pro_uid').setValue(pro_uid);
editForm.getForm().findField('evn_uid').setValue(evn_uid); editForm.getForm().findField('evn_uid').setValue(evn_uid);
editForm.getForm().findField('dynaform').setValue(webEntryList.data[0].DYN_TITLE); editForm.getForm().findField('dynaform').setValue(webEntryList.data.DYN_TITLE);
editForm.getForm().findField('username').setValue(webEntryList.data[0].USR_UID); editForm.getForm().findField('username').setValue(webEntryList.data.USR_UID);
editForm.getForm().findField('initDyna').setValue(webEntryList.data[0].DYN_UID); editForm.getForm().findField('initDyna').setValue(webEntryList.data.DYN_UID);
editForm.show(); editForm.show();
editButton.disable(); editButton.disable();
deleteButton.disable(); deleteButton.disable();
} }
}); });
var deleteButton = new Ext.Action({ var deleteButton = new Ext.Action({
text: _('ID_DELETE'), text: _('ID_DELETE'),
iconCls: 'button_menu_ext ss_sprite ss_delete', iconCls: 'button_menu_ext ss_sprite ss_delete',
@@ -94,7 +96,7 @@ pmosExt.prototype.popWebEntry= function(_5678)
if (btn=='yes'){ if (btn=='yes'){
var file_name = webForm.getForm().findField('dynaform').getValue(); var file_name = webForm.getForm().findField('dynaform').getValue();
Ext.Ajax.request({ Ext.Ajax.request({
url: '../webEntryProxy/deleteWebEntry', url: 'webEntryProxy/delete',
params: {PRO_UID: pro_uid, EVN_UID: evn_uid, FILE_NAME: file_name}, params: {PRO_UID: pro_uid, EVN_UID: evn_uid, FILE_NAME: file_name},
success: function (r,o){ success: function (r,o){
response = Ext.util.JSON.decode(r.responseText); response = Ext.util.JSON.decode(r.responseText);
@@ -122,7 +124,7 @@ pmosExt.prototype.popWebEntry= function(_5678)
}); });
} }
}); });
var goToWebEntry = new Ext.Action({ var goToWebEntry = new Ext.Action({
text: _('ID_TEST_WEB_ENTRY'), text: _('ID_TEST_WEB_ENTRY'),
disabled: true, disabled: true,
@@ -131,7 +133,7 @@ pmosExt.prototype.popWebEntry= function(_5678)
window.open(url,'',''); window.open(url,'','');
} }
}); });
var saveButton = new Ext.Action({ var saveButton = new Ext.Action({
text: _('ID_SAVE'), text: _('ID_SAVE'),
disabled: false, disabled: false,
@@ -140,32 +142,32 @@ pmosExt.prototype.popWebEntry= function(_5678)
var pass = editForm.getForm().findField('password').getValue(); var pass = editForm.getForm().findField('password').getValue();
Ext.Ajax.request({ Ext.Ajax.request({
url: '../webEntryProxy/checkCredentials', url: 'webEntryProxy/checkCredentials',
params: {PRO_UID: pro_uid, EVN_UID: evn_uid, WS_USER: user, WS_PASS: pass}, params: {PRO_UID: pro_uid, EVN_UID: evn_uid, WS_USER: user, WS_PASS: pass},
success: function(r,o){ success: function(r,o){
var resp = Ext.util.JSON.decode(r.responseText); var resp = Ext.util.JSON.decode(r.responseText);
if (resp.success){ if (resp.success){
editForm.getForm().submit({ editForm.getForm().submit({
success: function(f,a){ success: function(f,a){
var rs = Ext.util.JSON.decode(a.response.responseText); var rs = Ext.util.JSON.decode(a.response.responseText);
if (rs.success){ if (rs.success){
newButton.hide(); newButton.hide();
editButton.show(); editButton.show();
deleteButton.show(); deleteButton.show();
webForm.getForm().findField('link').setValue(rs.W_LINK); webForm.getForm().findField('link').setValue(rs.W_LINK);
webForm.getForm().findField('task').setValue(rs.TAS_TITLE); webForm.getForm().findField('task').setValue(rs.TAS_TITLE);
webForm.getForm().findField('dynaform').setValue(rs.DYN_TITLE); webForm.getForm().findField('dynaform').setValue(rs.DYN_TITLE);
webForm.getForm().findField('user').setValue(rs.USR_UID); webForm.getForm().findField('user').setValue(rs.USR_UID);
goToWebEntry.enable(); goToWebEntry.enable();
webForm.show(); webForm.show();
editForm.hide(); editForm.hide();
newButton.enable(); newButton.enable();
editButton.enable(); editButton.enable();
deleteButton.enable(); deleteButton.enable();
PMExt.notify(_('ID_WEB_ENTRY'),rs.msg); PMExt.notify(_('ID_WEB_ENTRY'),rs.msg);
}else{ }else{
PMExt.error(_('ID_WEB_ENTRY'),rs.msg); PMExt.error(_('ID_WEB_ENTRY'),rs.msg);
} }
}, },
failure: function(f,r){ failure: function(f,r){
PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') ); PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') );
@@ -181,7 +183,7 @@ pmosExt.prototype.popWebEntry= function(_5678)
}); });
} }
}); });
var cancelButton = new Ext.Action({ var cancelButton = new Ext.Action({
text: _('ID_CANCEL'), text: _('ID_CANCEL'),
disabled: false, disabled: false,
@@ -195,8 +197,8 @@ pmosExt.prototype.popWebEntry= function(_5678)
}); });
var webEntryList; var webEntryList;
var webForm = new Ext.FormPanel({ var webForm = new Ext.FormPanel({
labelWidth : 120, // label settings here cascade unless overridden labelWidth : 120, // label settings here cascade unless overridden
frame : true, frame : true,
@@ -223,7 +225,7 @@ pmosExt.prototype.popWebEntry= function(_5678)
buttons: [goToWebEntry] buttons: [goToWebEntry]
, hidden: true , hidden: true
}); });
var editForm = new Ext.FormPanel({ var editForm = new Ext.FormPanel({
labelWidth : 120, // label settings here cascade unless overridden labelWidth : 120, // label settings here cascade unless overridden
frame : true, frame : true,
@@ -231,7 +233,7 @@ pmosExt.prototype.popWebEntry= function(_5678)
autoHeight : true, autoHeight : true,
defaultType : 'textfield', defaultType : 'textfield',
buttonAlign : 'center', buttonAlign : 'center',
url : '../webEntryProxy/saveWebEntry', url : 'webEntryProxy/save',
items: [ items: [
{xtype: 'hidden', name: 'pro_uid', hidden: true}, {xtype: 'hidden', name: 'pro_uid', hidden: true},
{xtype: 'hidden', name: 'evn_uid', hidden: true}, {xtype: 'hidden', name: 'evn_uid', hidden: true},
@@ -241,6 +243,7 @@ pmosExt.prototype.popWebEntry= function(_5678)
title : _('ID_NEW_WEB_ENTRY'), title : _('ID_NEW_WEB_ENTRY'),
collapsible: false, collapsible: false,
autoHeight :true, autoHeight :true,
id : 'frameEdit',
buttonAlign: 'center', buttonAlign: 'center',
defaults : {width: 210}, defaults : {width: 210},
items: [ items: [
@@ -252,14 +255,14 @@ pmosExt.prototype.popWebEntry= function(_5678)
allowBlank : false, allowBlank : false,
triggerAction : 'all', triggerAction : 'all',
fieldLabel : _('ID_INITIAL_DYNAFORM'), fieldLabel : _('ID_INITIAL_DYNAFORM'),
name : 'initDyna', name : 'initDyna',
hiddenName : 'initDyna', hiddenName : 'initDyna',
displayField : 'name', displayField : 'name',
valueField : 'value', valueField : 'value',
store : new Ext.data.JsonStore({ store : new Ext.data.JsonStore({
fields : ['name', 'value'], fields : ['name', 'value'],
data :oDyna data :oDyna
}) })
}, },
{xtype: 'textfield', fieldLabel: _('ID_USER'), name: 'username', width: 200, allowBlank: false}, {xtype: 'textfield', fieldLabel: _('ID_USER'), name: 'username', width: 200, allowBlank: false},
{xtype: 'textfield', fieldLabel: _('ID_PASSWORD'), name: 'password', width: 200, inputType: 'password', allowBlank: false} {xtype: 'textfield', fieldLabel: _('ID_PASSWORD'), name: 'password', width: 200, inputType: 'password', allowBlank: false}
@@ -269,16 +272,12 @@ pmosExt.prototype.popWebEntry= function(_5678)
hidden: true, hidden: true,
buttons: [saveButton, cancelButton] buttons: [saveButton, cancelButton]
}); });
var webEntryWindow = new Ext.Window({ var webEntryWindow = new Ext.Window({
title:_('ID_START_MESSAGE_EVENT_WEB_ENTRY'), title:_('ID_START_MESSAGE_EVENT_WEB_ENTRY'),
//autoScroll: true,
collapsible: false, collapsible: false,
//maximizable: true,
width: 600, width: 600,
//bodyStyle : 'padding:8px 0 0 8px;',
//autoHeight: true,
autoHeight: true, autoHeight: true,
layout: 'fit', layout: 'fit',
plain: true, plain: true,
@@ -289,23 +288,23 @@ pmosExt.prototype.popWebEntry= function(_5678)
tbar: [newButton, editButton, deleteButton] tbar: [newButton, editButton, deleteButton]
}); });
workflow.webEntryWindow = webEntryWindow; workflow.webEntryWindow = webEntryWindow;
var evn_uid = workflow.currentSelection.id; var evn_uid = workflow.currentSelection.id;
Ext.Ajax.request({ Ext.Ajax.request({
url: 'bpmn/processes_Ajax.php', url: 'webEntryProxy/load',
params:{action:'webEntry', data: '{"uid":"'+ pro_uid +'","evn_uid":"'+evn_uid+'"}'}, params:{PRO_UID: pro_uid, EVN_UID: evn_uid},
success: function(r,o){ success: function(r,o){
webEntryList = Ext.util.JSON.decode(r.responseText); webEntryList = Ext.util.JSON.decode(r.responseText);
if (webEntryList.success){ if (webEntryList.success){
if (webEntryList.data[0].W_LINK !=''){ if (webEntryList.data.W_LINK !=''){
newButton.hide(); newButton.hide();
editButton.show(); editButton.show();
deleteButton.show(); deleteButton.show();
webForm.getForm().findField('link').setValue(webEntryList.data[0].W_LINK); webForm.getForm().findField('link').setValue(webEntryList.data.W_LINK);
webForm.getForm().findField('task').setValue(webEntryList.data[0].TAS_TITLE); webForm.getForm().findField('task').setValue(webEntryList.data.TAS_TITLE);
webForm.getForm().findField('dynaform').setValue(webEntryList.data[0].DYN_TITLE); webForm.getForm().findField('dynaform').setValue(webEntryList.data.DYN_TITLE);
webForm.getForm().findField('user').setValue(webEntryList.data[0].USR_UID); webForm.getForm().findField('user').setValue(webEntryList.data.USR_UID);
goToWebEntry.enable(); goToWebEntry.enable();
webForm.show(); webForm.show();
}else{ }else{
@@ -327,7 +326,7 @@ pmosExt.prototype.popWebEntry= function(_5678)
PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') ); PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') );
} }
}); });
webEntryWindow.show(); webEntryWindow.show();
} }
pmosExt.prototype.popCaseSchedular= function(_5678){ pmosExt.prototype.popCaseSchedular= function(_5678){
@@ -1483,7 +1482,7 @@ pmosExt.prototype.loadWebEntry=function()
var evn_uid = workflow.currentSelection.id; var evn_uid = workflow.currentSelection.id;
var urlparams = '?action=webEntry&data={"uid":"'+ pro_uid +'","evn_uid":"'+evn_uid+'"}'; var urlparams = '?action=webEntry&data={"uid":"'+ pro_uid +'","evn_uid":"'+evn_uid+'"}';
Ext.Ajax.request({ Ext.Ajax.request({
url: "bpmn/processes_Ajax.php"+ urlparams, url: "processes/processes_Ajax.php"+ urlparams,
success: function(response) { success: function(response) {
workflow.webEntryList = Ext.util.JSON.decode(response.responseText); workflow.webEntryList = Ext.util.JSON.decode(response.responseText);
}, },