BUG 8845 "Se aconseja adjuntar el boton de export en el submenu..." SOLVED
- Nuevo requerimiento, agregar la opcion "Export" en el listado de procesos - Se agrego la opcion "Export" (exportar un proceso) en la barra de herramientas y menu contextual
This commit is contained in:
@@ -382,7 +382,7 @@ var processmap=function(){
|
||||
panel.loader.show();
|
||||
var r = new leimnud.module.rpc.xmlhttp({
|
||||
url:this.options.dataServer,
|
||||
args:"action=process_Export&data="+{
|
||||
args:"action=process_Export&processMap=1&data="+{
|
||||
pro_uid :this.options.uid
|
||||
}.toJSONString()
|
||||
});
|
||||
|
||||
@@ -95,9 +95,27 @@ try {
|
||||
}
|
||||
|
||||
/* Render page */
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_Export', '', $Fields );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
if (isset($_REQUEST["processMap"]) && $_REQUEST["processMap"] == 1) {
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent("xmlform", "xmlform", "processes/processes_Export", "", $Fields);
|
||||
|
||||
G::RenderPage("publish", "raw");
|
||||
}
|
||||
else {
|
||||
$xmlFrm = new xmlform();
|
||||
$xmlFrm->parseFile(PATH_XMLFORM . "processes" . PATH_SEP . "processes_Export.xml" , SYS_LANG, true);
|
||||
|
||||
$Fields["xmlFrmFieldLabel"] = array(
|
||||
"title" => $xmlFrm->fields["TITLE"]->label,
|
||||
"proTitle" => $xmlFrm->fields["PRO_TITLE"]->label,
|
||||
"proDescription" => $xmlFrm->fields["PRO_DESCRIPTION"]->label,
|
||||
"size" => $xmlFrm->fields["SIZE"]->label,
|
||||
"fileName" => $xmlFrm->fields["FILENAME_LABEL"]->label,
|
||||
"fileNameXPDL" => $xmlFrm->fields["FILENAME_LABEL1"]->label,
|
||||
);
|
||||
|
||||
echo G::json_encode($Fields);
|
||||
}
|
||||
|
||||
}
|
||||
catch ( Exception $e ){
|
||||
|
||||
@@ -61,9 +61,16 @@ Ext.onReady(function(){
|
||||
{name : 'CASES_COUNT_COMPLETED', type:'float'},
|
||||
{name : 'CASES_COUNT_CANCELLED', type:'float'}
|
||||
]
|
||||
})//,
|
||||
}),
|
||||
|
||||
//sortInfo:{field: 'PRO_TITLE', direction: "ASC"}
|
||||
//groupField:'PRO_CATEGORY_LABEL'
|
||||
|
||||
listeners: {
|
||||
load: function (store) {
|
||||
Ext.ComponentMgr.get("export").setDisabled(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var expander = new Ext.ux.grid.RowExpander({
|
||||
@@ -237,6 +244,15 @@ Ext.onReady(function(){
|
||||
handler:deleteProcess
|
||||
},{
|
||||
xtype: 'tbseparator'
|
||||
},{
|
||||
id: "export",
|
||||
disabled: true,
|
||||
text: _("ID_EXPORT"),
|
||||
iconCls: "silk-add",
|
||||
icon: "/images/export.png",
|
||||
handler: function () {
|
||||
exportProcess();
|
||||
}
|
||||
},{
|
||||
text: _('ID_IMPORT'),
|
||||
iconCls: 'silk-add',
|
||||
@@ -318,7 +334,10 @@ Ext.onReady(function(){
|
||||
processesGrid.getSelectionModel().on('rowselect', function(){
|
||||
var rowSelected = processesGrid.getSelectionModel().getSelected();
|
||||
var activator = Ext.getCmp('activator');
|
||||
|
||||
activator.setDisabled(false);
|
||||
Ext.ComponentMgr.get("export").setDisabled(false);
|
||||
|
||||
if( rowSelected.data.PRO_STATUS == 'ACTIVE' ){
|
||||
activator.setIcon('/images/deactivate.png');
|
||||
activator.setText( _('ID_DEACTIVATE') );
|
||||
@@ -390,6 +409,12 @@ Ext.onReady(function(){
|
||||
text: _('ID_DELETE'),
|
||||
icon: '/images/delete.png',
|
||||
handler: deleteProcess
|
||||
}, {
|
||||
text: _("ID_EXPORT"),
|
||||
icon: "/images/export.png",
|
||||
handler: function () {
|
||||
exportProcess();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -633,6 +658,104 @@ deleteProcess = function(){
|
||||
}
|
||||
}
|
||||
|
||||
var winExportProcess = new Ext.Window({
|
||||
//layout: "fit",
|
||||
width: 625,
|
||||
height: 240,
|
||||
modal: true,
|
||||
closeAction: "hide",
|
||||
resizable: false,
|
||||
autoScroll: true,
|
||||
bodyStyle: "padding: 15px 15px 15px 15px;",
|
||||
|
||||
title: "",
|
||||
|
||||
items: [
|
||||
new Ext.FormPanel({
|
||||
id: "frmExportProcess",
|
||||
|
||||
width: 560,
|
||||
autoHeight: true,
|
||||
labelWidth: 1,
|
||||
|
||||
//title: "_",
|
||||
|
||||
items: [
|
||||
{
|
||||
xtype: "displayfield",
|
||||
fieldLabel: ""
|
||||
}
|
||||
]
|
||||
})
|
||||
]
|
||||
});
|
||||
|
||||
function exportProcess() {
|
||||
var record = processesGrid.getSelectionModel().getSelections();
|
||||
|
||||
if(record.length == 1) {
|
||||
var myMask = new Ext.LoadMask(Ext.getBody(), {msg: _("ID_LOADING")});
|
||||
myMask.show();
|
||||
|
||||
///////
|
||||
var proUid = record[0].get("PRO_UID");
|
||||
var proTitle = record[0].get("PRO_TITLE");
|
||||
var titleLength = 60;
|
||||
|
||||
title = (titleLength - proTitle.length >= 0)? proTitle : proTitle.substring(0, (titleLength - 1) + 1) + "...";
|
||||
|
||||
///////
|
||||
Ext.Ajax.request({
|
||||
url: "../processes/processes_Ajax",
|
||||
method: "POST",
|
||||
params: {
|
||||
"action": "process_Export",
|
||||
"data": "{\"pro_uid\": \"" + proUid + "\"}",
|
||||
"processMap": 0
|
||||
},
|
||||
|
||||
success: function (response, opts) {
|
||||
myMask.hide();
|
||||
|
||||
///////
|
||||
var dataResponse = eval("(" + response.responseText + ")"); //json
|
||||
|
||||
var frm = Ext.ComponentMgr.get("frmExportProcess");
|
||||
var frmItems = frm.form.items;
|
||||
var tdAttribute = " align=\"right\" valign=\"top\" nowrap=\"nowrap\" style=\"color: #515151; font-weight: bold;\"";
|
||||
var aStyle = "color: #2078A8; text-decoration: none;";
|
||||
|
||||
var str = "<table cellspacing=\"5px\" cellpadding=\"0px\" style=\"width: 45em; font-size: 0.95em;\">";
|
||||
str = str + "<tr><td" + tdAttribute + ">" + dataResponse.xmlFrmFieldLabel.proTitle + "</td><td>" + dataResponse.PRO_TITLE + "</td><tr>";
|
||||
str = str + "<tr><td" + tdAttribute + ">" + dataResponse.xmlFrmFieldLabel.proDescription + "</td><td>" + dataResponse.PRO_DESCRIPTION + "</td><tr>";
|
||||
str = str + "<tr><td" + tdAttribute + ">" + dataResponse.xmlFrmFieldLabel.size + "</td><td>" + dataResponse.SIZE + "</td><tr>";
|
||||
str = str + "<tr><td" + tdAttribute + ">" + dataResponse.xmlFrmFieldLabel.fileName + "</td><td><a href=\"" + dataResponse.FILENAME_LINK + "\" onclick=\"window.open(this.href, '_blank'); return (false);\" style=\"" + aStyle + "\" onmouseout=\"this.style.color='#2078A8';\" onmouseover=\"this.style.color='orange';\">" + dataResponse.FILENAME + "</a></td><tr>";
|
||||
str = str + "<tr><td" + tdAttribute + ">" + dataResponse.xmlFrmFieldLabel.fileNameXPDL + "</td><td><a href=\"" + dataResponse.FILENAME_LINKXPDL + "\" onclick=\"window.open(this.href, '_blank'); return (false);\" style=\"" + aStyle + "\" onmouseout=\"this.style.color='#2078A8';\" onmouseover=\"this.style.color='orange';\">" + dataResponse.FILENAMEXPDL + "</a></td><tr>";
|
||||
str = str + "</table>";
|
||||
|
||||
//frm.setTitle(dataResponse.xmlFrmFieldLabel.title);
|
||||
frmItems.items[0].setValue(str);
|
||||
|
||||
///////
|
||||
winExportProcess.setTitle(_("ID_EXPORT_PROCESS") + ": " + title);
|
||||
winExportProcess.show();
|
||||
},
|
||||
|
||||
failure: function (response, opts) {
|
||||
myMask.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
Ext.Msg.show({
|
||||
title: "",
|
||||
msg: _("ID_NO_SELECTION_WARNING"),
|
||||
icon: Ext.MessageBox.INFO,
|
||||
buttons: Ext.MessageBox.OK
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
importProcessExistGroup = function()
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user