task properties is saving from grid properties in bpmn designer

This commit is contained in:
Erik Amaru Ortiz
2011-02-25 21:49:32 +00:00
parent 207ddb0b62
commit 24264fb4cf
6 changed files with 95 additions and 22 deletions

View File

@@ -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("<?php echo _EXT_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 ['<div class="msg">',
'<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>',
'<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc"><h3>', t,
'</h3>', s, '</div></div></div>',
'<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>',
'</div>'].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
*/

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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()

View File

@@ -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("<font color='green'>{0}</font>", 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 + '<br/>';
//text += 'JS Cache file: ' + result.cacheFileJS + '<br/>';
text += 'Rows: ' + result.rows + '<br/>';
//text += 'JS ROws: ' + result.rowsJS + '<br/>';
PMExt.info('Result', text);
//PMExt.info('Result', text);
PMExt.notify('REBUILD SUCCESS', text);
} else
PMExt.error('Error', result.msg);
}