BUG 9549 I added button to import dynaform SOLVED

I added button to import dynaform
This commit is contained in:
Brayan Osmar Pereyra Suxo
2012-11-23 15:47:10 -04:00
parent 27482e8624
commit 9b2c1343e4
3 changed files with 162 additions and 0 deletions

View File

@@ -38,6 +38,9 @@ var verifyLogin = function() {
case 'save_as':
dynaformEditor.save_as();
break;
case 'save_as':
dynaformEditor.save_as();
break;
case 'saveJavascript':
dynaformEditor.saveJavascript();
break;
@@ -264,6 +267,50 @@ var dynaformEditor={
url='dynaforms_Saveas';
popupWindow('Save as', url+'?DYN_UID='+this.dynUid+'&AA='+this.A , 500, 350);
},
importForm:function(){
panelImportDyna = new leimnud.module.panel();
panelImportDyna.options={
limit : true,
size : {w:410,h:160},
position : {x:0,y:0,center:true},
title : '',
theme : 'processmaker',
statusBar: false,
control : {drag:false,resize:true,close:false},
fx : {opacity:true,rolled:false,modal:true}
};
panelImportDyna.setStyle = {modal: {
backgroundColor: 'white'
}};
panelImportDyna.make();
panelImportDyna.addContent('<div id="importAjax" align="center"><img src="/images/ext/default/grid/loading.gif" /></div>');
var oRPC = new leimnud.module.rpc.xmlhttp({
url : '../dynaforms/fieldsHandlerAjax',
async : false,
method: 'POST',
args : 'request=showImportForm' + '&DYN_UID=' + this.dynUid
});
oRPC.make();
document.getElementById('importAjax').style.display = 'none';
panelImportDyna.addContent(oRPC.xmlhttp.responseText);
},
import:function(uidDynaSelect){
document.getElementById('importAjax').style.display = 'block';
document.getElementById('importForm').style.display = 'none';
var oRPC = new leimnud.module.rpc.xmlhttp({
url : '../dynaforms/fieldsHandlerAjax',
async : false,
method: 'POST',
args : 'request=import' + '&DYN_UID=' + this.dynUid + '&FILE=' + uidDynaSelect
});
oRPC.make();
resp = oRPC.xmlhttp.responseText;
if (resp == 'success') {
location.reload(true);
} else {
alert("Error: " + resp);
}
},
close:function()
{
if (!sessionPersits()) {