From 24264fb4cfe77ba43e9e49dd6916c3ace2a8df96 Mon Sep 17 00:00:00 2001 From: Erik Amaru Ortiz Date: Fri, 25 Feb 2011 21:49:32 +0000 Subject: [PATCH] task properties is saving from grid properties in bpmn designer --- gulliver/js/ext/pmos-common.js | 30 ++++++++- gulliver/system/class.g.php | 5 ++ .../engine/methods/processes/ajaxListener.php | 11 +++- workflow/engine/templates/bpmn/designer.js | 6 +- workflow/engine/templates/bpmn/processmap.js | 4 +- workflow/engine/templates/tools/main.js | 61 ++++++++++++++----- 6 files changed, 95 insertions(+), 22 deletions(-) diff --git a/gulliver/js/ext/pmos-common.js b/gulliver/js/ext/pmos-common.js index a01449fd9..60c2f41a3 100755 --- a/gulliver/js/ext/pmos-common.js +++ b/gulliver/js/ext/pmos-common.js @@ -108,12 +108,14 @@ Ext.msgBoxSlider = function(){ if( ! msgCt ) { msgCt = Ext.DomHelper.insertFirst(document.body, {id:'msg-div', style:'position:absolute'}, true); } - msgCt.alignTo(document, 't-t'); + //msgCt.alignTo(document, 'br-br'); + msgCt.alignTo(document, "br-br", [ -20, -20]); + var s = String.format.apply(String, Array.prototype.slice.call(arguments, 1)); var m = Ext.DomHelper.append(msgCt, {html:createBox(title, s)}, true); m.setWidth(400 ); m.position(null, 5000 ); - m.alignTo(document, 't-t'); + m.alignTo(document, 'br-br'); //Ext.get('x-box-mc-inner' ).setStyle('background-image', 'url("/images/_accept.png")'); Ext.get('x-box-mc-inner' ).setStyle('background-position', '5px 10px'); Ext.get('x-box-mc-inner' ).setStyle('background-repeat', 'no-repeat'); @@ -123,6 +125,30 @@ Ext.msgBoxSlider = function(){ }; }(); +/*Ext.msgBoxSlider = function() { + var msgCt; + + function createBox(t, s){ + return ['
', + '
', + '

', t, + '

', s, '
', + '
', + '
'].join(''); + } + return { + msg : function(title, format){ + if(!msgCt){ + msgCt = Ext.DomHelper.insertFirst(document.body, {id:'msg-div', style:'position:absolute'}, true); + } + msgCt.alignTo(document, 'bl-bl', [10, -90]); + var s = String.format.apply(String, Array.prototype.slice.call(arguments, 1)); + var m = Ext.DomHelper.append(msgCt, {html:createBox(title, s)}, true); + m.slideIn('b').pause(1).ghost("b", {remove:true}); + } + }; +}();*/ + /** * Translator function for internationalization */ diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 820601a5d..288652cb3 100644 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -3242,3 +3242,8 @@ function eprintln($s="", $c=null){ print "$s\n"; } } + +function __($msgID , $lang = SYS_LANG, $data = null) +{ + return G::LoadTranslation($msgID, $lang, $data); +} diff --git a/workflow/engine/methods/processes/ajaxListener.php b/workflow/engine/methods/processes/ajaxListener.php index 4161b8961..71ede9f9e 100755 --- a/workflow/engine/methods/processes/ajaxListener.php +++ b/workflow/engine/methods/processes/ajaxListener.php @@ -180,7 +180,8 @@ class Ajax function assignUsersTask($param) { try{ - require_once 'classes/model/TaskUser.php'; + require_once 'classes/model/TaskUser.php'; + require_once 'classes/model/Task.php'; $oTaskUser = new TaskUser(); $UIDS = explode(',', $param['UIDS']); $TU_TYPE = 1; @@ -191,9 +192,13 @@ class Ajax else $oTaskUser->create(array('TAS_UID' => $param['TAS_UID'], 'USR_UID' => $UID, 'TU_TYPE' => $TU_TYPE, 'TU_RELATION' => 2)); } + $task = TaskPeer::retrieveByPk($param['TAS_UID']); $result->success = true; - $result->msg = ''; + if( count($UIDS) > 1 ) + $result->msg = __('ID_ACTORS_ASSIGNED_SUCESSFULLY', SYS_LANG, Array(count($UIDS), $task->getTasTitle())); + else + $result->msg = __('ID_ACTOR_ASSIGNED_SUCESSFULLY', SYS_LANG, Array('tas_title'=>$task->getTasTitle())); } catch(Exception $e){ $result->success = false; $result->msg = $e->getMessage(); @@ -225,7 +230,7 @@ class Ajax $result->msg = ''; } catch(Exception $e){ $result->success = false; - $result->msg = "{$TU_RELATIONS[$i]} - {$param['TAS_UID']}, {$USR_UIDS[$i]}, $TU_TYPE, 1 --> " . $e->getMessage(); + $result->msg = $e->getMessage(); } print G::json_encode($result); diff --git a/workflow/engine/templates/bpmn/designer.js b/workflow/engine/templates/bpmn/designer.js index 3b037d25c..2c92c6f43 100755 --- a/workflow/engine/templates/bpmn/designer.js +++ b/workflow/engine/templates/bpmn/designer.js @@ -513,7 +513,11 @@ Ext.onReady ( function() { success: function(response){ var result = Ext.util.JSON.decode(response.responseText); if( result.success ) { - PMExt.notify('', 'Users & Groups assigned successfully!'); + if( typeof parent != 'undefined' ) + parent.PMExt.notify(_('ID_RESPONSABILITIES_ASSIGNMENT'), result.msg); + else + PMExt.notify(_('ID_RESPONSABILITIES_ASSIGNMENT'), result.msg); + if( typeof parent != 'undefined' ) { parent.Ext.getCmp('eastPanel').show(); parent.Ext.getCmp('usersPanelTabs').setActiveTab(1); diff --git a/workflow/engine/templates/bpmn/processmap.js b/workflow/engine/templates/bpmn/processmap.js index 329ddd6a2..a20874658 100755 --- a/workflow/engine/templates/bpmn/processmap.js +++ b/workflow/engine/templates/bpmn/processmap.js @@ -54,7 +54,7 @@ Ext.onReady ( function() { var usersTaskGrid = new Ext.grid.GridPanel({ id : 'usersTaskGrid', - title : 'Users & Groups', + title : _('ID_ACTORS'), height : 180, stateful : true, stateId : 'usersTaskGrid', @@ -594,7 +594,7 @@ Ext.onReady ( function() { }) }, { - text: 'Actors', + text: _('ID_ACTORS'), iconCls: 'ICON_USERS', handler: function(){ document.getElementById('designerFrame').contentWindow.usersPanel.show() diff --git a/workflow/engine/templates/tools/main.js b/workflow/engine/templates/tools/main.js index a10be9ec2..79c914b51 100755 --- a/workflow/engine/templates/tools/main.js +++ b/workflow/engine/templates/tools/main.js @@ -1,3 +1,5 @@ +var win; + Ext.onReady(function(){ Ext.QuickTips.init(); @@ -18,6 +20,26 @@ Ext.onReady(function(){ ] }) }); + + var comboCategory = new Ext.form.ComboBox({ + fieldLabel : 'Category', + name : 'category', + allowBlank : true, + store : new Ext.data.ArrayStore({ + fields: ['CATEGORY_UID', 'CATEGORY_NAME'], + data : [] + }), + + valueField : 'CATEGORY_NAME', + displayField : 'CATEGORY_NAME', + typeAhead : true, + //mode : 'local', + triggerAction : 'all', + editable: true, + forceSelection: true, + selectOnFocus : true + }); + var grid = new Ext.grid.GridPanel( { id: 'grid', @@ -36,6 +58,7 @@ Ext.onReady(function(){ viewConfig: { forceFit:true }, + clicksToEdit: 1, cm: new Ext.grid.ColumnModel({ defaults: { @@ -43,7 +66,9 @@ Ext.onReady(function(){ sortable: true }, columns: [ - {header: 'ID', id:'TRN_ID', dataIndex: 'TRN_ID', hidden:false, hideable:true, width: 350}, + {header: 'ID', id:'TRN_ID', dataIndex: 'TRN_ID', hidden:false, hideable:true, width: 350, + editor: new Ext.form.TextField({allowBlank: true, readOnly:true}) + } , {header: 'Value', dataIndex: 'TRN_VALUE', width: 300, renderer:function(v,p,r){ var label = v.length > 20 ? v.substring(0, 20) + '...' : v; return String.format("{0}", label); @@ -95,7 +120,7 @@ Ext.onReady(function(){ ] }), listeners: { - rowdblclick: edit, + rowdblclick: function(){}, render: function(){ this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING')}); this.ownerCt.doLayout(); @@ -106,6 +131,7 @@ Ext.onReady(function(){ grid.getSelectionModel().on('rowselect', function(){ var rowSelected = grid.getSelectionModel().getSelected(); Ext.getCmp('editValue').setValue(rowSelected.data.TRN_VALUE); + Ext.getCmp('label1').setValue(rowSelected.data.TRN_ID); }); @@ -133,7 +159,7 @@ Ext.onReady(function(){ region: 'south', layout: 'fit', //width: 200, - height: 100, + height: 120, minSize: 100, maxSize: 400, split: true, @@ -145,9 +171,15 @@ Ext.onReady(function(){ xtype:'textarea' } ], + tbar:[ new Ext.form.TextField ({ + id: 'label1', + allowBlank: true, + width: 600, + readOnly: true + })], bbar: [{ text: 'Save', - icon: '', + iconCls: 'ss_sprite ss_disk', handler: saveEdit }], }); @@ -189,13 +221,13 @@ function newLabel() id: 'id', fieldLabel: 'ID', xtype:'textfield', - width: 300 + width: 350 }, { id: 'label', fieldLabel: 'Label', xtype:'textarea', - width: 300, - height: 100 + width: 350, + height: 50 } ], buttons : [{ @@ -209,11 +241,11 @@ function newLabel() }] }); - var win = new Ext.Window({ - id: 'winNew', + win = new Ext.Window({ + //id: 'winNew', title: _('ID_NEW'), - width: 450, - height: 200, + width: 490, + height: 150, layout:'fit', autoScroll:true, modal: true, @@ -243,7 +275,7 @@ function saveNew() success : function(obj, resp) { Ext.getCmp('grid').store.reload(); PMExt.notify('SAVE', resp.result.msg); - Ext.getCmp('winNew').hide(); + win.hide(); }, failure: function(obj, resp) { Ext.Msg.alert( _('ID_ERROR'), resp.result.msg); @@ -325,13 +357,14 @@ function rebuild() Ext.MessageBox.hide(); result = Ext.util.JSON.decode(response.responseText); if(result.success){ - PMExt.notify('REBUILD SUCCESS', ''); + var text = 'Cache file: ' + result.cacheFile + '
'; //text += 'JS Cache file: ' + result.cacheFileJS + '
'; text += 'Rows: ' + result.rows + '
'; //text += 'JS ROws: ' + result.rowsJS + '
'; - PMExt.info('Result', text); + //PMExt.info('Result', text); + PMExt.notify('REBUILD SUCCESS', text); } else PMExt.error('Error', result.msg); }