some changes in projects opening methods in User Interface.

- An menu option "open with classic editor" was added to open new bpmn projects into classic editor
This commit is contained in:
Erik Amaru Ortiz
2014-03-06 17:41:39 -04:00
parent f46be88c81
commit 4eed9dfc48
3 changed files with 29 additions and 34 deletions

View File

@@ -23,7 +23,7 @@ class Designer extends Controller
*/
public function index($httpData)
{
$proUid = isset($httpData->pro_uid) ? $httpData->pro_uid : '';
$proUid = isset($httpData->prj_uid) ? $httpData->prj_uid : '';
$client = $this->getClientCredentials();
$authCode = $this->getAuthorizationCode($client);

View File

@@ -1,16 +0,0 @@
<?php
if (! array_key_exists('pro_uid', $_REQUEST)) {
die('Bad Request: The param "pro_uid" is required!');
}
$proUid = $_GET['pro_uid'];
$bpmnProject = BpmnProjectPeer::retrieveByPK($proUid);
if (is_object($bpmnProject)) {
$url = '../designer?pro_uid=' . $proUid;
} else {
$url = 'processes_Map?PRO_UID=' . $proUid;
}
G::header("location: $url");

View File

@@ -393,6 +393,13 @@ Ext.onReady(function(){
debug.setIconClass('icon-debug');
debug.setText(_('ID_ENABLE_DEBUG'));
}
if (rowSelected.data.PROJECT_TYPE == "bpmn"){
Ext.getCmp('edit_with_classic_editor').setDisabled(false);
} else {
Ext.getCmp('edit_with_classic_editor').setDisabled(true);
}
}, this);
processesGrid.on('contextmenu', function (evt) {
evt.preventDefault();
@@ -411,9 +418,12 @@ Ext.onReady(function(){
iconCls: 'button_menu_ext ss_sprite ss_pencil',
handler: editProcess
},{
text: 'Edit (New Editor)',
icon: '/images/pencil_beta.png',
handler: editNewProcess
id: 'edit_with_classic_editor',
text: 'Edit with classic editor',
iconCls: 'button_menu_ext ss_sprite ss_pencil',
handler: function() {
editProcess("classic");
}
}, {
id: 'activator2',
text: '',
@@ -572,22 +582,23 @@ function doSearch(){
store.load({params:{processName: filter, start: 0 , limit: 25}});
}
editProcess = function(){
editProcess = function(typeParam)
{
var rowSelected = processesGrid.getSelectionModel().getSelected();
if( rowSelected ) {
//location.href = 'processes_Map?PRO_UID='+rowSelected.data.PRO_UID+'&rand='+Math.random()
location.href = 'openDesigner?pro_uid='+rowSelected.data.PRO_UID+'&rand='+Math.random()
} else {
Ext.Msg.show({
title:'',
msg: _('ID_NO_SELECTION_WARNING'),
buttons: Ext.Msg.INFO,
fn: function(){},
animEl: 'elId',
icon: Ext.MessageBox.INFO,
buttons: Ext.MessageBox.OK
});
var url, pro_uid = rowSelected.data.PRO_UID;
var type = rowSelected.data.PROJECT_TYPE;
if (typeParam == "bpmn" || typeParam == "classic") {
type = typeParam;
}
if (type == "bpmn") {
url = '../designer?prj_uid=' + pro_uid;
} else {
url = 'processes_Map?PRO_UID=' + pro_uid;
}
location.href = url;
}
editNewProcess = function(){