PM Tables Ext JS Migration Complete
This commit is contained in:
@@ -861,6 +861,13 @@ public function loadByName($name) {
|
||||
return implode('', $aAux);
|
||||
}
|
||||
|
||||
function deleteMultiple($arrUID){
|
||||
$arrUIDs = explode(",",$arrUID);
|
||||
foreach ($arrUIDs as $UID){
|
||||
$this->deleteAll($UID);
|
||||
}
|
||||
}
|
||||
|
||||
function deleteAll($sUID) {
|
||||
try {
|
||||
$aData = $this->load($sUID);
|
||||
|
||||
@@ -91,6 +91,7 @@ if(isset($_POST['action'])) {
|
||||
|
||||
|
||||
$EXPORT_TRACEBACK = Array();
|
||||
$c = 0;
|
||||
foreach ($tables as $uid) {
|
||||
|
||||
$aTable = new additionalTables();
|
||||
@@ -112,6 +113,8 @@ if(isset($_POST['action'])) {
|
||||
'num_regs' => sizeof($rows),
|
||||
'schema' => in_array($uid, $schema)? 'yes': 'no',
|
||||
'data' => in_array($uid, $data)? 'yes': 'no'
|
||||
// 'schema' => ($schema[$c]=='Export')? 'yes': 'no',
|
||||
// 'data' => ($data[$c]=='Export')? 'yes': 'no'
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,6 @@ if ($_GET['sUID'] == '') {
|
||||
|
||||
require_once 'classes/model/AdditionalTables.php';
|
||||
$oAdditionalTables = new AdditionalTables();
|
||||
$oAdditionalTables->deleteAll($_GET['sUID']);
|
||||
$oAdditionalTables->deleteMultiple($_GET['sUID']);
|
||||
|
||||
G::Header('Location: additionalTablesList');
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* additionalTablesToExport.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
global $RBAC;
|
||||
$RBAC->requirePermissions('PM_SETUP_ADVANCE');
|
||||
$G_PUBLISH = new Publisher;
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
|
||||
//$oHeadPublisher->usingExtJs('ux/Ext.ux.fileUploadField');
|
||||
$oHeadPublisher->addExtJsScript('additionalTables/additionalTablesExport', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('additionalTables/additionalTablesExport'); //adding a html file .html.
|
||||
|
||||
$labels = G::getTranslations(Array('ID_EXPORT','ID_IMPORT','ID_EDIT','ID_DELETE', 'ID_DATA',
|
||||
'ID_NEW_ADD_TABLE','ID_DESCRIPTION','ID_NAME','ID_CONFIRM','ID_ADDITIONAL_TABLES','ID_SELECT_FIRST_PM_TABLE_ROW',
|
||||
'ID_CONFIRM_DELETE_PM_TABLE', 'ID_CANCEL','ID_CLOSE','ID_ACTION_EXPORT','ID_ACTION_IGNORE','ID_TITLE_EXPORT_RESULT','ID_TITLE_EXPORT_TOOL'));
|
||||
|
||||
$toSend = Array();
|
||||
$toSend['UID_LIST'] = $_GET["sUID"];
|
||||
|
||||
$oHeadPublisher->assign('TRANSLATIONS', $labels);
|
||||
$oHeadPublisher->assign('EXPORT_TABLES', $toSend);
|
||||
G::RenderPage('publish', 'extJs');
|
||||
?>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* data_additionalTablesList.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once 'classes/model/AdditionalTables.php';
|
||||
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_UID);
|
||||
$oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_NAME);
|
||||
$oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_DESCRIPTION);
|
||||
$oCriteria->addSelectColumn("'".G::LoadTranslation('ID_ACTION_EXPORT')."' as 'CH_SCHEMA'");
|
||||
$oCriteria->addSelectColumn("'".G::LoadTranslation('ID_ACTION_EXPORT')."' as 'CH_DATA'");
|
||||
|
||||
$uids = explode(',',$_GET['aUID']);
|
||||
|
||||
foreach ($uids as $UID){
|
||||
if (!isset($CC)){
|
||||
$CC = $oCriteria->getNewCriterion(AdditionalTablesPeer::ADD_TAB_UID, $UID ,Criteria::EQUAL);
|
||||
}else{
|
||||
$CC->addOr($oCriteria->getNewCriterion(AdditionalTablesPeer::ADD_TAB_UID, $UID ,Criteria::EQUAL));
|
||||
}
|
||||
}
|
||||
$oCriteria->add($CC);
|
||||
$oCriteria->addAnd($oCriteria->getNewCriterion(AdditionalTablesPeer::ADD_TAB_UID, '', Criteria::NOT_EQUAL));
|
||||
|
||||
$oDataset = AdditionalTablesPeer::doSelectRS ( $oCriteria );
|
||||
$oDataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$addTables = Array();
|
||||
while( $oDataset->next() ) {
|
||||
$addTables[] = $oDataset->getRow();
|
||||
}
|
||||
echo G::json_encode($addTables);
|
||||
@@ -32,6 +32,7 @@ var expander;
|
||||
var cmodel;
|
||||
var infoGrid;
|
||||
var viewport;
|
||||
var smodel;
|
||||
|
||||
var FIELD_CM;
|
||||
var FIELD_DS
|
||||
@@ -51,14 +52,16 @@ Ext.onReady(function(){
|
||||
text: TRANSLATIONS.ID_EDIT,
|
||||
iconCls: 'button_menu_ext ss_sprite ss_pencil',
|
||||
//icon: '/images/addc.png',
|
||||
handler: EditPMTableRow
|
||||
handler: EditPMTableRow,
|
||||
disabled: true
|
||||
});
|
||||
|
||||
deleteButton = new Ext.Action({
|
||||
text: TRANSLATIONS.ID_DELETE,
|
||||
iconCls: 'button_menu_ext ss_sprite ss_delete',
|
||||
//icon: '/images/addc.png',
|
||||
handler: DeletePMTableRow
|
||||
handler: DeletePMTableRow,
|
||||
disabled: true
|
||||
});
|
||||
|
||||
importButton = new Ext.Action({
|
||||
@@ -89,6 +92,30 @@ Ext.onReady(function(){
|
||||
|
||||
xColumns.unshift(idField);
|
||||
|
||||
smodel = new Ext.grid.CheckboxSelectionModel({
|
||||
listeners:{
|
||||
selectionchange: function(sm){
|
||||
var count_rows = sm.getCount();
|
||||
switch(count_rows){
|
||||
case 0:
|
||||
editButton.disable();
|
||||
deleteButton.disable();
|
||||
break;
|
||||
case 1:
|
||||
editButton.enable();
|
||||
deleteButton.enable();
|
||||
break;
|
||||
default:
|
||||
editButton.disable();
|
||||
deleteButton.disable();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
xColumns.unshift(smodel);
|
||||
|
||||
store = new Ext.data.GroupingStore( {
|
||||
proxy : new Ext.data.HttpProxy({
|
||||
url: 'data_additionalTablesData?sUID=' + TABLES.UID
|
||||
@@ -108,7 +135,6 @@ Ext.onReady(function(){
|
||||
});
|
||||
|
||||
|
||||
|
||||
infoGrid = new Ext.grid.GridPanel({
|
||||
region: 'center',
|
||||
layout: 'fit',
|
||||
@@ -123,23 +149,19 @@ Ext.onReady(function(){
|
||||
enableColumnResize: true,
|
||||
enableHdMenu: true,
|
||||
frame:false,
|
||||
plugins: expander,
|
||||
cls : 'grid_with_checkbox',
|
||||
//plugins: expander,
|
||||
//cls : 'grid_with_checkbox',
|
||||
iconCls:'icon-grid',
|
||||
columnLines: false,
|
||||
viewConfig: {
|
||||
forceFit:true
|
||||
},
|
||||
store: store,
|
||||
cm: cmodel,
|
||||
sm: smodel,
|
||||
tbar:[newButton,'-',editButton, deleteButton,'-',importButton,{xtype: 'tbfill' }, backButton],
|
||||
listeners: {
|
||||
rowdblclick: EditPMTableRow,
|
||||
rowclick: DoNothing,
|
||||
render: function(){
|
||||
infoGrid.getSelectionModel().on('rowselect', function(){
|
||||
var rowSelected = infoGrid.getSelectionModel().getSelected();
|
||||
});
|
||||
}
|
||||
rowdblclick: EditPMTableRow
|
||||
},
|
||||
view: new Ext.grid.GroupingView({
|
||||
forceFit:true,
|
||||
@@ -179,46 +201,20 @@ NewPMTableRow = function(){
|
||||
//Load PM Table Edition Row Form
|
||||
EditPMTableRow = function(){
|
||||
iGrid = Ext.getCmp('infoGrid');
|
||||
var rowSelected = iGrid.getSelectionModel().getSelected();
|
||||
if( rowSelected ) {
|
||||
location.href = 'additionalTablesDataEdit?sUID='+TABLES.UID+'&'+TABLES.PKF+'='+rowSelected.data[TABLES.PKF];
|
||||
} else {
|
||||
Ext.Msg.show({
|
||||
title:'',
|
||||
msg: TRANSLATIONS.ID_SELECT_FIRST_ROW,
|
||||
buttons: Ext.Msg.INFO,
|
||||
fn: DoNothing,
|
||||
animEl: 'elId',
|
||||
icon: Ext.MessageBox.INFO,
|
||||
buttons: Ext.MessageBox.OK
|
||||
});
|
||||
}
|
||||
rowsSelected = iGrid.getSelectionModel().getSelections();
|
||||
location.href = 'additionalTablesDataEdit?sUID='+TABLES.UID+'&'+TABLES.PKF+'='+RetrieveRowsID(rowsSelected);
|
||||
}
|
||||
|
||||
//Confirm PM Table Row Deletion Tasks
|
||||
DeletePMTableRow = function(){
|
||||
iGrid = Ext.getCmp('infoGrid');
|
||||
var rowSelected = iGrid.getSelectionModel().getSelected();
|
||||
if( rowSelected ) {
|
||||
confirmMsg = TRANSLATIONS.ID_MSG_CONFIRM_DELETE_ROW;
|
||||
//confirmMsg = confirmMsg.replace('{0}',rowSelected.data.ADD_TAB_NAME);
|
||||
Ext.Msg.confirm(TRANSLATIONS.ID_CONFIRM, confirmMsg,
|
||||
rowsSelected = iGrid.getSelectionModel().getSelections();
|
||||
Ext.Msg.confirm(TRANSLATIONS.ID_CONFIRM, TRANSLATIONS.ID_MSG_CONFIRM_DELETE_ROW,
|
||||
function(btn, text){
|
||||
if (btn=="yes"){
|
||||
location.href = 'additionalTablesDataDelete?sUID='+TABLES.UID+'&'+TABLES.PKF+'='+rowSelected.data[TABLES.PKF];
|
||||
location.href = 'additionalTablesDataDelete?sUID='+TABLES.UID+'&'+TABLES.PKF+'='+RetrieveRowsID(rowsSelected);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Ext.Msg.show({
|
||||
title:'',
|
||||
msg: TRANSLATIONS.ID_SELECT_FIRST_ROW,
|
||||
buttons: Ext.Msg.INFO,
|
||||
fn: DoNothing,
|
||||
animEl: 'elId',
|
||||
icon: Ext.MessageBox.INFO,
|
||||
buttons: Ext.MessageBox.OK
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//Load Import PM Table From CSV Source
|
||||
@@ -230,3 +226,12 @@ ImportPMTableCSV = function(){
|
||||
BackPMList = function(){
|
||||
location.href = 'additionalTablesList';
|
||||
}
|
||||
|
||||
//Gets UIDs from a array of rows
|
||||
RetrieveRowsID = function(rows){
|
||||
var arrAux = new Array();
|
||||
for(var c=0; c<rows.length; c++){
|
||||
arrAux[c] = rows[c].get(TABLES.PKF);
|
||||
}
|
||||
return arrAux.join(',');
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<div style="padding: 15px">
|
||||
<div id="list-panel"></div>
|
||||
</div>
|
||||
@@ -0,0 +1,195 @@
|
||||
|
||||
/*
|
||||
* @author: Qennix
|
||||
* Jan 13th, 2011
|
||||
*/
|
||||
|
||||
//Keyboard Events
|
||||
new Ext.KeyMap(document, {
|
||||
key: Ext.EventObject.F5,
|
||||
fn: function(keycode, e) {
|
||||
if (! e.ctrlKey) {
|
||||
if (Ext.isIE) {
|
||||
// IE6 doesn't allow cancellation of the F5 key, so trick it into
|
||||
// thinking some other key was pressed (backspace in this case)
|
||||
e.browserEvent.keyCode = 8;
|
||||
}
|
||||
e.stopEvent();
|
||||
document.location = document.location;
|
||||
}else{
|
||||
Ext.Msg.alert('Refresh', 'You clicked: CTRL-F5');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var store;
|
||||
var cmodel;
|
||||
var smodel;
|
||||
var infoGrid;
|
||||
var viewport
|
||||
|
||||
var cancelButton;
|
||||
var exportButton;
|
||||
|
||||
var w;
|
||||
|
||||
Ext.onReady(function(){
|
||||
Ext.QuickTips.init();
|
||||
|
||||
var reader = new Ext.data.ArrayReader({}, [{name: 'action'}]);
|
||||
|
||||
var comboStore = new Ext.data.Store({
|
||||
reader: reader,
|
||||
data: Ext.grid.dummyData
|
||||
});
|
||||
|
||||
exportButton = new Ext.Action({
|
||||
text: TRANSLATIONS.ID_EXPORT,
|
||||
iconCls: 'silk-add',
|
||||
icon: '/images/export.png',
|
||||
handler: ExportPMTables
|
||||
});
|
||||
|
||||
cancelButton = new Ext.Action({
|
||||
text: TRANSLATIONS.ID_CANCEL,
|
||||
iconCls: 'silk-add',
|
||||
icon: '/images/cases-selfservice.png',
|
||||
handler: CancelExport
|
||||
});
|
||||
|
||||
store = new Ext.data.GroupingStore( {
|
||||
proxy : new Ext.data.HttpProxy({
|
||||
url: 'data_additionalTablesExport?aUID='+EXPORT_TABLES.UID_LIST
|
||||
}),
|
||||
reader : new Ext.data.JsonReader( {
|
||||
root: '',
|
||||
fields : [
|
||||
{name : 'ADD_TAB_UID'},
|
||||
{name : 'ADD_TAB_NAME'},
|
||||
{name : 'ADD_TAB_DESCRIPTION'},
|
||||
{name : 'CH_SCHEMA'},
|
||||
{name : 'CH_DATA'}
|
||||
]
|
||||
})
|
||||
});
|
||||
|
||||
var action_edit = new Ext.form.ComboBox({
|
||||
typeAhead: true,
|
||||
triggerAction: 'all',
|
||||
mode: 'local',
|
||||
store: comboStore,
|
||||
displayField: 'action',
|
||||
valueField: 'action'
|
||||
});
|
||||
|
||||
cmodel = new Ext.grid.ColumnModel({
|
||||
defaults: {
|
||||
width: 10,
|
||||
sortable: true
|
||||
},
|
||||
columns: [
|
||||
new Ext.grid.RowNumberer(),
|
||||
//smodel,
|
||||
{id:'ADD_TAB_UID', dataIndex: 'ADD_TAB_UID', hidden:true, hideable:false},
|
||||
{header: TRANSLATIONS.ID_NAME, dataIndex: 'ADD_TAB_NAME', width: 20, align:'left'},
|
||||
{header: TRANSLATIONS.ID_DESCRIPTION, dataIndex: 'ADD_TAB_DESCRIPTION', width: 50, hidden:false, align:'left'},//,
|
||||
{header: 'SCHEMA', dataIndex: 'CH_SCHEMA', hidden: false, width: 20, editor: action_edit, align: 'center'},
|
||||
{header: 'DATA', dataIndex: 'CH_DATA', hidden: false, width: 20, editor: action_edit, align: 'center'}
|
||||
]
|
||||
});
|
||||
|
||||
infoGrid = new Ext.grid.EditorGridPanel({
|
||||
store: store,
|
||||
cm: cmodel,
|
||||
width: 600,
|
||||
height: 300,
|
||||
title: TRANSLATIONS.ID_ADDITIONAL_TABLES + ': ' +TRANSLATIONS.ID_TITLE_EXPORT_TOOL,
|
||||
frame: true,
|
||||
clicksToEdit: 1,
|
||||
iconCls:'icon-grid',
|
||||
id: 'infoGrid',
|
||||
|
||||
sm: new Ext.grid.RowSelectionModel({singleSelect: false}),
|
||||
tbar:[exportButton, {xtype: 'tbfill'} ,cancelButton],//'-', editButton, deleteButton,'-', dataButton,{xtype: 'tbfill'} , importButton, exportButton],
|
||||
view: new Ext.grid.GroupingView({
|
||||
forceFit:true,
|
||||
groupTextTpl: '{text}'
|
||||
})
|
||||
});
|
||||
|
||||
infoGrid.store.load({params: {"function":"additionalTablesExport"}});
|
||||
|
||||
viewport = new Ext.Viewport({
|
||||
layout: 'fit',
|
||||
autoScroll: false,
|
||||
items: [
|
||||
infoGrid
|
||||
]
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//Cancels Export View
|
||||
CancelExport = function(){
|
||||
location.href = 'additionalTablesList';
|
||||
}
|
||||
|
||||
//Export Schema/Data from PM Tables
|
||||
ExportPMTables = function(){
|
||||
iGrid = Ext.getCmp('infoGrid');
|
||||
var storeExport = iGrid.getStore();
|
||||
var UIDs = new Array();
|
||||
var SCHs = new Array();
|
||||
var DATs = new Array();
|
||||
for (var r=0; r<storeExport.getCount(); r++){
|
||||
row = storeExport.getAt(r);
|
||||
UIDs[r] = row.data['ADD_TAB_UID'];
|
||||
if (row.data['CH_SCHEMA']==TRANSLATIONS.ID_ACTION_EXPORT){
|
||||
SCHs[r] = row.data['ADD_TAB_UID'];
|
||||
}else{
|
||||
SCHs[r] = 0;
|
||||
}
|
||||
if (row.data['CH_DATA']==TRANSLATIONS.ID_ACTION_EXPORT){
|
||||
DATs[r] = row.data['ADD_TAB_UID'];
|
||||
}else{
|
||||
DATs[r] = 0;
|
||||
}
|
||||
}
|
||||
Ext.Ajax.request({
|
||||
url: 'additionalTablesAjax',
|
||||
success: SuccessExport,
|
||||
failure: DoNothing,
|
||||
params: { action: 'doExport', tables: UIDs.join(','), schema: SCHs.join(','), data: DATs.join(',') }
|
||||
});
|
||||
}
|
||||
|
||||
//Response Export Handler
|
||||
SuccessExport = function(response, opts){
|
||||
w = new Ext.Window({
|
||||
height: 350,
|
||||
width: 670,
|
||||
resizable: false,
|
||||
html: response.responseText,
|
||||
autoscroll: false,
|
||||
title: TRANSLATIONS.ID_TITLE_EXPORT_RESULT,
|
||||
closable: true,
|
||||
buttons: [{
|
||||
text: TRANSLATIONS.ID_CLOSE,
|
||||
// iconCls: 'silk-add',
|
||||
handler: CloseExport
|
||||
}]
|
||||
});
|
||||
w.show();
|
||||
}
|
||||
|
||||
//Close Export Dialog
|
||||
CloseExport = function(){
|
||||
w.close();
|
||||
}
|
||||
|
||||
|
||||
//Do Nothing Function
|
||||
DoNothing = function(){}
|
||||
|
||||
Ext.grid.dummyData = [['Export'],['Ignore']];
|
||||
|
||||
@@ -25,7 +25,7 @@ var newButton;
|
||||
var editButton;
|
||||
var deleteButton;
|
||||
var importButton;
|
||||
//var exportButton;
|
||||
var exportButton;
|
||||
var dataButton;
|
||||
|
||||
var store;
|
||||
@@ -33,6 +33,9 @@ var expander;
|
||||
var cmodel;
|
||||
var infoGrid;
|
||||
var viewport;
|
||||
var smodel;
|
||||
|
||||
var rowsSelected;
|
||||
|
||||
Ext.onReady(function(){
|
||||
Ext.QuickTips.init();
|
||||
@@ -48,14 +51,16 @@ Ext.onReady(function(){
|
||||
text: TRANSLATIONS.ID_EDIT,
|
||||
iconCls: 'button_menu_ext ss_sprite ss_pencil',
|
||||
//icon: '/images/addc.png',
|
||||
handler: EditPMTable
|
||||
handler: EditPMTable,
|
||||
disabled: true
|
||||
});
|
||||
|
||||
deleteButton = new Ext.Action({
|
||||
text: TRANSLATIONS.ID_DELETE,
|
||||
iconCls: 'button_menu_ext ss_sprite ss_delete',
|
||||
//icon: '/images/addc.png',
|
||||
handler: DeletePMTable
|
||||
handler: DeletePMTable,
|
||||
disabled: true
|
||||
});
|
||||
|
||||
importButton = new Ext.Action({
|
||||
@@ -69,14 +74,16 @@ Ext.onReady(function(){
|
||||
text: TRANSLATIONS.ID_EXPORT,
|
||||
iconCls: 'silk-add',
|
||||
icon: '/images/export.png',
|
||||
handler: ExportPMTable
|
||||
handler: ExportPMTable,
|
||||
disabled: true
|
||||
});
|
||||
|
||||
dataButton = new Ext.Action({
|
||||
text: TRANSLATIONS.ID_DATA,
|
||||
iconCls: 'silk-add',
|
||||
icon: '/images/cases-draft.png',
|
||||
handler: PMTableData
|
||||
handler: PMTableData,
|
||||
disabled: true
|
||||
});
|
||||
|
||||
|
||||
@@ -94,10 +101,32 @@ Ext.onReady(function(){
|
||||
})
|
||||
});
|
||||
|
||||
expander = new Ext.ux.grid.RowExpander({
|
||||
tpl : new Ext.Template(
|
||||
'<p><b>UID:</b> {ADD_TAB_UID}</p><br>'
|
||||
)
|
||||
smodel = new Ext.grid.CheckboxSelectionModel({
|
||||
listeners:{
|
||||
selectionchange: function(sm){
|
||||
var count_rows = sm.getCount();
|
||||
switch(count_rows){
|
||||
case 0:
|
||||
editButton.disable();
|
||||
deleteButton.disable();
|
||||
exportButton.disable();
|
||||
dataButton.disable();
|
||||
break;
|
||||
case 1:
|
||||
editButton.enable();
|
||||
deleteButton.enable();
|
||||
exportButton.enable();
|
||||
dataButton.enable();
|
||||
break;
|
||||
default:
|
||||
editButton.disable();
|
||||
deleteButton.enable();
|
||||
exportButton.enable();
|
||||
dataButton.disable();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
cmodel = new Ext.grid.ColumnModel({
|
||||
@@ -106,7 +135,7 @@ Ext.onReady(function(){
|
||||
sortable: true
|
||||
},
|
||||
columns: [
|
||||
expander,
|
||||
smodel,
|
||||
{id:'ADD_TAB_UID', dataIndex: 'ADD_TAB_UID', hidden:true, hideable:false},
|
||||
{header: TRANSLATIONS.ID_NAME, dataIndex: 'ADD_TAB_NAME', width: 20, align:'left'},
|
||||
{header: TRANSLATIONS.ID_DESCRIPTION, dataIndex: 'ADD_TAB_DESCRIPTION', width: 50, hidden:false, align:'left'}
|
||||
@@ -127,23 +156,19 @@ Ext.onReady(function(){
|
||||
enableColumnResize: true,
|
||||
enableHdMenu: true,
|
||||
frame:false,
|
||||
plugins: expander,
|
||||
cls : 'grid_with_checkbox',
|
||||
//plugins: expander,
|
||||
iconCls:'icon-grid',
|
||||
//cls : 'grid_with_checkbox',
|
||||
columnLines: false,
|
||||
viewConfig: {
|
||||
forceFit:true
|
||||
},
|
||||
store: store,
|
||||
cm: cmodel,
|
||||
sm: smodel,
|
||||
tbar:[newButton,'-', editButton, deleteButton,'-', dataButton,{xtype: 'tbfill'} , importButton, exportButton],
|
||||
listeners: {
|
||||
rowdblclick: PMTableData,
|
||||
rowclick: DoNothing,
|
||||
render: function(){
|
||||
infoGrid.getSelectionModel().on('rowselect', function(){
|
||||
var rowSelected = infoGrid.getSelectionModel().getSelected();
|
||||
});
|
||||
}
|
||||
},
|
||||
view: new Ext.grid.GroupingView({
|
||||
forceFit:true,
|
||||
@@ -181,46 +206,20 @@ NewPMTable = function(){
|
||||
//Load PM Table Edition Forms
|
||||
EditPMTable = function(){
|
||||
iGrid = Ext.getCmp('infoGrid');
|
||||
var rowSelected = iGrid.getSelectionModel().getSelected();
|
||||
if( rowSelected ) {
|
||||
location.href = 'additionalTablesEdit?sUID='+rowSelected.data.ADD_TAB_UID+'&rand='+Math.random();
|
||||
} else {
|
||||
Ext.Msg.show({
|
||||
title:'',
|
||||
msg: TRANSLATIONS.ID_SELECT_FIRST_PM_TABLE_ROW,
|
||||
buttons: Ext.Msg.INFO,
|
||||
fn: DoNothing,
|
||||
animEl: 'elId',
|
||||
icon: Ext.MessageBox.INFO,
|
||||
buttons: Ext.MessageBox.OK
|
||||
});
|
||||
}
|
||||
rowsSelected = iGrid.getSelectionModel().getSelections();
|
||||
location.href = 'additionalTablesEdit?sUID='+RetrieveRowsID(rowsSelected)+'&rand='+Math.random();
|
||||
}
|
||||
|
||||
//Confirm PM Table Deletion Tasks
|
||||
DeletePMTable = function(){
|
||||
iGrid = Ext.getCmp('infoGrid');
|
||||
var rowSelected = iGrid.getSelectionModel().getSelected();
|
||||
if( rowSelected ) {
|
||||
confirmMsg = TRANSLATIONS.ID_CONFIRM_DELETE_PM_TABLE;
|
||||
confirmMsg = confirmMsg.replace('{0}',rowSelected.data.ADD_TAB_NAME);
|
||||
Ext.Msg.confirm(TRANSLATIONS.ID_CONFIRM, confirmMsg,
|
||||
rowsSelected = iGrid.getSelectionModel().getSelections();
|
||||
Ext.Msg.confirm(TRANSLATIONS.ID_CONFIRM, TRANSLATIONS.ID_CONFIRM_DELETE_PM_TABLE,
|
||||
function(btn, text){
|
||||
if (btn=="yes"){
|
||||
location.href = 'additionalTablesDelete?sUID='+rowSelected.data.ADD_TAB_UID+'&rand='+Math.random();
|
||||
location.href = 'additionalTablesDelete?sUID='+RetrieveRowsID(rowsSelected)+'&rand='+Math.random();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Ext.Msg.show({
|
||||
title:'',
|
||||
msg: TRANSLATIONS.ID_SELECT_FIRST_PM_TABLE_ROW,
|
||||
buttons: Ext.Msg.INFO,
|
||||
fn: DoNothing,
|
||||
animEl: 'elId',
|
||||
icon: Ext.MessageBox.INFO,
|
||||
buttons: Ext.MessageBox.OK
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//Load Import PM Table Form
|
||||
@@ -230,24 +229,23 @@ ImportPMTable = function(){
|
||||
|
||||
//Load Export PM Tables Form
|
||||
ExportPMTable = function(){
|
||||
location.href = 'additionalTablesToExport';
|
||||
iGrid = Ext.getCmp('infoGrid');
|
||||
rowsSelected = iGrid.getSelectionModel().getSelections();
|
||||
location.href = 'additionalTablesToExport?sUID='+RetrieveRowsID(rowsSelected)+'&rand='+Math.random();
|
||||
}
|
||||
|
||||
//Load PM TAble Data
|
||||
PMTableData = function(){
|
||||
iGrid = Ext.getCmp('infoGrid');
|
||||
var rowSelected = iGrid.getSelectionModel().getSelected();
|
||||
if( rowSelected ) {
|
||||
location.href = 'additionalTablesData?sUID='+rowSelected.data.ADD_TAB_UID+'&rand='+Math.random();
|
||||
} else {
|
||||
Ext.Msg.show({
|
||||
title:'',
|
||||
msg: TRANSLATIONS.ID_SELECT_FIRST_PM_TABLE_ROW,
|
||||
buttons: Ext.Msg.INFO,
|
||||
fn: DoNothing,
|
||||
animEl: 'elId',
|
||||
icon: Ext.MessageBox.INFO,
|
||||
buttons: Ext.MessageBox.OK
|
||||
});
|
||||
rowsSelected = iGrid.getSelectionModel().getSelections();
|
||||
location.href = 'additionalTablesData?sUID='+RetrieveRowsID(rowsSelected)+'&rand='+Math.random();
|
||||
}
|
||||
|
||||
//Gets UIDs from a array of rows
|
||||
RetrieveRowsID = function(rows){
|
||||
var arrAux = new Array();
|
||||
for(var c=0; c<rows.length; c++){
|
||||
arrAux[c] = rows[c].get('ADD_TAB_UID');
|
||||
}
|
||||
return arrAux.join(',');
|
||||
}
|
||||
@@ -1,10 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dynaForm name="processes_Export" type="xmlform" width="100%" labelWidth="100px">
|
||||
|
||||
<TITLE type="title">
|
||||
<en>Processmaker Tables export</en>
|
||||
</TITLE>
|
||||
|
||||
<dynaForm name="processes_Export" type="xmlform" width="100%" labelWidth="130px">
|
||||
<FILENAME type="phpVariable"/>
|
||||
<FILENAME_LINK type="phpVariable"/>
|
||||
<FILENAME_LABEL type="link" value="@#FILENAME" link="@#FILENAME_LINK" target="_blank">
|
||||
@@ -13,7 +8,7 @@
|
||||
<SIZE type="caption">
|
||||
<en>File size</en>
|
||||
</SIZE>
|
||||
<META type="caption" enableHTML="1">
|
||||
<META type="textarea" required="0" readonly="0" rows="14" cols="82" mode="view">
|
||||
<en>Sumary</en>
|
||||
</META>
|
||||
</dynaForm>
|
||||
Reference in New Issue
Block a user