Merged in dheeyi/processmaker/PM-1879 (pull request #1989)
PM-1879 0015808: Incorrect messages handling and/or actions when the user's session expires in the DESIGNER module 0016086: Information of templates lost.
This commit is contained in:
@@ -789,6 +789,13 @@ try {
|
||||
echo 'saved: ' . $sDirectory;
|
||||
}
|
||||
break;
|
||||
case 'getSessid':
|
||||
if(isset($_SESSION['USER_LOGGED'])){
|
||||
echo Bootstrap::json_encode(1);
|
||||
}else{
|
||||
echo Bootstrap::json_encode(0);
|
||||
}
|
||||
break;
|
||||
case 'events':
|
||||
$oProcessMap->eventsList($oData->pro_uid, $oData->type);
|
||||
break;
|
||||
|
||||
@@ -16,64 +16,197 @@ var CURRENT_MAIN_DIRECTORY;
|
||||
var CURRENT_CURRENT_DIRECTORY;
|
||||
var oUploadFilesPanel;
|
||||
var oUploadFilesPanel;
|
||||
var showPromptLogin = function(lastAction, pro_uid, fileName, fc64) {
|
||||
lastActionPerformed = lastAction;
|
||||
prouid = pro_uid;
|
||||
filename = fileName;
|
||||
fcont = fc64;
|
||||
promptPanel = new leimnud.module.panel();
|
||||
promptPanel.options={
|
||||
statusBarButtons:[{value: _('LOGIN')}],
|
||||
position:{center:true},
|
||||
size:{w:370,h:160},
|
||||
control:{
|
||||
close:false,
|
||||
resize:false
|
||||
},
|
||||
fx:{
|
||||
modal:true
|
||||
}
|
||||
};
|
||||
promptPanel.setStyle={
|
||||
content:{
|
||||
padding:10,
|
||||
paddingBottom:2,
|
||||
textAlign:'left',
|
||||
paddingLeft:24,
|
||||
backgroundRepeat:'no-repeat',
|
||||
backgroundPosition:'10 50%',
|
||||
backgroundColor:'transparent',
|
||||
borderWidth:0
|
||||
}
|
||||
};
|
||||
promptPanel.make();
|
||||
promptPanel.addContent(_('ID_FILES_MANAGER_EDITOR_LOGIN_AGAIN'));
|
||||
promptPanel.addContent('<br />');
|
||||
var label = document.createElement("label");
|
||||
var theUser = document.createElement("input");
|
||||
theUser.title = 'Username';
|
||||
theUser.id = 'theUser';
|
||||
leimnud.dom.setStyle(theUser,{
|
||||
font:'normal 10pt Tahoma,MiscFixed',
|
||||
color:'#000',
|
||||
width:'75%',
|
||||
marginTop:3,
|
||||
backgroundColor:'white',
|
||||
border:'1px solid #919B9C',
|
||||
});
|
||||
label.appendChild(theUser);
|
||||
label.innerHTML = (_('ID_USERNAME')) + ': ';
|
||||
promptPanel.addContent(label);
|
||||
promptPanel.addContent(theUser);
|
||||
theUser.focus();
|
||||
var labelpass = document.createElement("label");
|
||||
var thePassword = document.createElement("input");
|
||||
thePassword.type = 'password';
|
||||
thePassword.id = 'thePassword';
|
||||
leimnud.dom.setStyle(thePassword,{
|
||||
font:'normal 10pt Tahoma,MiscFixed',
|
||||
color:'#000',
|
||||
width:'76%',
|
||||
marginTop:3,
|
||||
backgroundColor:'white',
|
||||
border:'1px solid #919B9C'
|
||||
});
|
||||
labelpass.appendChild(thePassword);
|
||||
labelpass.innerHTML = (_('ID_FIELD_DYNAFORM_PASSWORD')) +': ';
|
||||
promptPanel.addContent(labelpass);
|
||||
promptPanel.addContent(thePassword);
|
||||
thePassword.onkeyup=function(evt)
|
||||
{
|
||||
var evt = (window.event)?window.event:evt;
|
||||
var key = (evt.which)?evt.which:evt.keyCode;
|
||||
if(key == 13) {
|
||||
verifyLogin();
|
||||
}
|
||||
}.extend(this);
|
||||
promptPanel.fixContent();
|
||||
promptPanel.elements.statusBarButtons[0].onmouseup = verifyLogin;
|
||||
};
|
||||
var verifyLogin = function() {
|
||||
if (document.getElementById('thePassword').value.trim() == '') {
|
||||
new leimnud.module.app.alert().make({
|
||||
label: (_('ID_WRONG_USER_PASS'))
|
||||
});
|
||||
return;
|
||||
}
|
||||
var rpc = new leimnud.module.rpc.xmlhttp({
|
||||
url : '../login/authentication',
|
||||
args: 'form[USR_USERNAME]=' + document.getElementById('theUser').value.trim() + '&form[USR_PASSWORD]=' + document.getElementById('thePassword').value.trim() + '&form[USR_LANG]=' + window.location.href.split("/")[4]
|
||||
});
|
||||
rpc.callback = function(rpc) {
|
||||
if (rpc.xmlhttp.responseText.indexOf('form[USR_USERNAME]') == -1) {
|
||||
promptPanel.remove();
|
||||
if(lastActionPerformed=='save'){
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : 'processes_Ajax',
|
||||
args: 'action=saveFile&filename='+filename+'&pro_uid='+prouid+'&MAIN_DIRECTORY='+CURRENT_MAIN_DIRECTORY+'&fcontent='+fcont
|
||||
});
|
||||
oRPC.callback = function(rpc) {
|
||||
};
|
||||
oRPC.make();
|
||||
}
|
||||
lastActionPerformed = '';
|
||||
} else {
|
||||
new leimnud.module.app.alert().make({
|
||||
label: (_('ID_WRONG_USER_PASS'))
|
||||
});
|
||||
}
|
||||
}.extend(this);
|
||||
rpc.make();
|
||||
};
|
||||
var uploadFilesScreen = function(PRO_UID, MAIN_DIRECTORY, CURRENT_DIRECTORY) {
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : 'processes_Ajax',
|
||||
args: 'action=getSessid&filename=filename'
|
||||
});
|
||||
|
||||
var swNavigator;
|
||||
if(navigator.appName=='Microsoft Internet Explorer'){
|
||||
var rv = '';
|
||||
if (new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})").exec(navigator.userAgent) != null) {
|
||||
rv = parseFloat(RegExp.$1);
|
||||
oRPC.callback = function(rpc) {
|
||||
if(rpc.xmlhttp.response==0){
|
||||
showPromptLogin('upload','','','');
|
||||
}else{
|
||||
var swNavigator;
|
||||
if(navigator.appName=='Microsoft Internet Explorer'){
|
||||
var rv = '';
|
||||
if (new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})").exec(navigator.userAgent) != null) {
|
||||
rv = parseFloat(RegExp.$1);
|
||||
}
|
||||
|
||||
if (rv >= 9) {
|
||||
swNavigator='ie9+';
|
||||
}
|
||||
else {
|
||||
swNavigator='ie';
|
||||
}
|
||||
|
||||
wd = 420;
|
||||
hg = 170;
|
||||
} else {
|
||||
swNavigator='wknormal';
|
||||
wd=420;
|
||||
hg=100;
|
||||
}
|
||||
|
||||
CURRENT_MAIN_DIRECTORY = MAIN_DIRECTORY;
|
||||
CURRENT_CURRENT_DIRECTORY = CURRENT_DIRECTORY;
|
||||
|
||||
Pm.tmp.processFilesManagerPanel.events = {
|
||||
remove: function() { oUploadFilesPanel.remove(); }.extend(this)
|
||||
};
|
||||
|
||||
oUploadFilesPanel = new leimnud.module.panel();
|
||||
oUploadFilesPanel.options={
|
||||
limit : true,
|
||||
size : {w:wd,h:hg},
|
||||
position : {x:Pm.tmp.processFilesManagerPanel.options.position.x,y:Pm.tmp.processFilesManagerPanel.options.position.y-90,center:false},
|
||||
title : '',
|
||||
control : {close:true,resize:false},fx:{modal:true},
|
||||
fx : {shadow:true,modal:true}
|
||||
};
|
||||
oUploadFilesPanel.make();
|
||||
oIFrame = window.document.createElement('iframe');
|
||||
oIFrame.style.border = '0';
|
||||
oIFrame.style.width = '100%';
|
||||
oIFrame.style.height = '100%';
|
||||
oIFrame.src = 'processes_UploadFilesForm?PRO_UID=' + PRO_UID + '&MAIN_DIRECTORY=' + MAIN_DIRECTORY + '&CURRENT_DIRECTORY=' + CURRENT_DIRECTORY+'&NAVIGATOR='+swNavigator;
|
||||
oUploadFilesPanel.addContent(oIFrame);
|
||||
}
|
||||
|
||||
if (rv >= 9) {
|
||||
swNavigator='ie9+';
|
||||
}
|
||||
else {
|
||||
swNavigator='ie';
|
||||
}
|
||||
|
||||
wd = 420;
|
||||
hg = 170;
|
||||
} else {
|
||||
swNavigator='wknormal';
|
||||
wd=420;
|
||||
hg=100;
|
||||
}
|
||||
|
||||
CURRENT_MAIN_DIRECTORY = MAIN_DIRECTORY;
|
||||
CURRENT_CURRENT_DIRECTORY = CURRENT_DIRECTORY;
|
||||
|
||||
Pm.tmp.processFilesManagerPanel.events = {
|
||||
remove: function() { oUploadFilesPanel.remove(); }.extend(this)
|
||||
};
|
||||
|
||||
oUploadFilesPanel = new leimnud.module.panel();
|
||||
oUploadFilesPanel.options={
|
||||
limit : true,
|
||||
size : {w:wd,h:hg},
|
||||
position : {x:Pm.tmp.processFilesManagerPanel.options.position.x,y:Pm.tmp.processFilesManagerPanel.options.position.y-90,center:false},
|
||||
title : '',
|
||||
control : {close:true,resize:false},fx:{modal:true},
|
||||
fx : {shadow:true,modal:true}
|
||||
};
|
||||
oUploadFilesPanel.make();
|
||||
oIFrame = window.document.createElement('iframe');
|
||||
oIFrame.style.border = '0';
|
||||
oIFrame.style.width = '100%';
|
||||
oIFrame.style.height = '100%';
|
||||
oIFrame.src = 'processes_UploadFilesForm?PRO_UID=' + PRO_UID + '&MAIN_DIRECTORY=' + MAIN_DIRECTORY + '&CURRENT_DIRECTORY=' + CURRENT_DIRECTORY+'&NAVIGATOR='+swNavigator;
|
||||
oUploadFilesPanel.addContent(oIFrame);
|
||||
}.extend(this);
|
||||
oRPC.make();
|
||||
};
|
||||
|
||||
var oPanel;
|
||||
function editFile(pro_uid, fileName){
|
||||
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : 'processes_Ajax',
|
||||
args: 'action=getSessid&filename='+fileName
|
||||
});
|
||||
|
||||
oRPC.callback = function(rpc) {
|
||||
if(rpc.xmlhttp.response==0){
|
||||
showPromptLogin('edit','','','');
|
||||
}
|
||||
}.extend(this);
|
||||
oRPC.make();
|
||||
|
||||
var typofile = fileName.split(".");
|
||||
if( typofile[typofile.length-1].toLowerCase() != 'txt' && typofile[typofile.length-1].toLowerCase() != 'html' ){
|
||||
msgBox(G_STRINGS.HTML_FILES,"alert");return;
|
||||
}
|
||||
|
||||
oPanel = new leimnud.module.panel();
|
||||
oPanel.options={
|
||||
oPanel = new leimnud.module.panel();
|
||||
oPanel.options={
|
||||
limit: true,
|
||||
size: {w: 820, h: 500},
|
||||
position: {x: 50, y: 50, center: true},
|
||||
@@ -81,22 +214,22 @@ function editFile(pro_uid, fileName){
|
||||
control: {close: true, resize: false},
|
||||
statusBar: true,
|
||||
fx: {shadow: true, modal: true}
|
||||
};
|
||||
oPanel.make();
|
||||
};
|
||||
oPanel.make();
|
||||
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : 'processes_Ajax',
|
||||
args: 'action=editFile&filename='+fileName+'&pro_uid='+pro_uid
|
||||
});
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : 'processes_Ajax',
|
||||
args: 'action=editFile&filename='+fileName+'&pro_uid='+pro_uid
|
||||
});
|
||||
|
||||
oPanel.loader.show();
|
||||
oRPC.callback = function(rpc) {
|
||||
oPanel.loader.hide();
|
||||
oPanel.addContent(rpc.xmlhttp.responseText);
|
||||
var scs=rpc.xmlhttp.responseText.extractScript();
|
||||
scs.evalScript();
|
||||
}.extend(this);
|
||||
oRPC.make();
|
||||
oPanel.loader.show();
|
||||
oRPC.callback = function(rpc) {
|
||||
oPanel.loader.hide();
|
||||
oPanel.addContent(rpc.xmlhttp.responseText);
|
||||
var scs=rpc.xmlhttp.responseText.extractScript();
|
||||
scs.evalScript();
|
||||
}.extend(this);
|
||||
oRPC.make();
|
||||
}
|
||||
|
||||
/*refresh content tiny*/
|
||||
@@ -107,42 +240,68 @@ function saveFile(pro_uid, fileName){
|
||||
tinyMCE.execCommand('mceRemoveControl',false,'form[fcontent]');
|
||||
fc64 = fc64.replace(/&/g, "@amp@");
|
||||
fc64 = fc64.replace(/\+/g, '%2B');
|
||||
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : 'processes_Ajax',
|
||||
args: 'action=getSessid&filename='+fileName
|
||||
});
|
||||
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : 'processes_Ajax',
|
||||
args: 'action=saveFile&filename='+fileName+'&pro_uid='+pro_uid+'&MAIN_DIRECTORY='+CURRENT_MAIN_DIRECTORY+'&fcontent='+fc64
|
||||
});
|
||||
|
||||
oPanel.loader.show();
|
||||
oPanel.loader.show();
|
||||
oRPC.callback = function(rpc) {
|
||||
oPanel.remove();
|
||||
if(rpc.xmlhttp.response==0){
|
||||
showPromptLogin('save',pro_uid, fileName, fc64);
|
||||
}
|
||||
}.extend(this);
|
||||
oRPC.make();
|
||||
oRPC.make();
|
||||
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : 'processes_Ajax',
|
||||
args: 'action=saveFile&filename='+fileName+'&pro_uid='+pro_uid+'&MAIN_DIRECTORY='+CURRENT_MAIN_DIRECTORY+'&fcontent='+fc64
|
||||
});
|
||||
|
||||
oPanel.loader.show();
|
||||
oRPC.callback = function(rpc) {
|
||||
oPanel.remove();
|
||||
}.extend(this);
|
||||
oRPC.make();
|
||||
}
|
||||
|
||||
var showCreateEmptyOptionsPanel;
|
||||
function showCreateEmptyOptions(e, MAIN_DIRECTORY){
|
||||
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : 'processes_Ajax',
|
||||
args: 'action=getSessid&filename=filename'
|
||||
});
|
||||
|
||||
oRPC.callback = function(rpc) {
|
||||
if(rpc.xmlhttp.response==0){
|
||||
showPromptLogin('createEmty','','','');
|
||||
}
|
||||
}.extend(this);
|
||||
oRPC.make();
|
||||
|
||||
CURRENT_MAIN_DIRECTORY = MAIN_DIRECTORY;
|
||||
oPanel = new leimnud.module.panel();
|
||||
oPanel.options={
|
||||
limit : true,
|
||||
size : {w:400,h:100},
|
||||
position : {x:e.clientX,y:e.clientY,center:false},
|
||||
title : '',
|
||||
control : {close:true,resize:false},fx:{modal:true},
|
||||
fx : {shadow:true,modal:true}
|
||||
};
|
||||
oPanel.make();
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({url : 'processes_Ajax', args: 'action=emptyFileOptions&MAIN_DIRECTORY='+CURRENT_MAIN_DIRECTORY });
|
||||
oPanel.loader.show();
|
||||
oRPC.callback = function(rpc) {
|
||||
oPanel.loader.hide();
|
||||
oPanel.addContent(rpc.xmlhttp.responseText);
|
||||
var scs=rpc.xmlhttp.responseText.extractScript();
|
||||
scs.evalScript();
|
||||
}.extend(this);
|
||||
oRPC.make();
|
||||
showCreateEmptyOptionsPanel = oPanel;
|
||||
oPanel = new leimnud.module.panel();
|
||||
oPanel.options={
|
||||
limit : true,
|
||||
size : {w:400,h:100},
|
||||
position : {x:e.clientX,y:e.clientY,center:false},
|
||||
title : '',
|
||||
control : {close:true,resize:false},fx:{modal:true},
|
||||
fx : {shadow:true,modal:true}
|
||||
};
|
||||
oPanel.make();
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({url : 'processes_Ajax', args: 'action=emptyFileOptions&MAIN_DIRECTORY='+CURRENT_MAIN_DIRECTORY });
|
||||
oPanel.loader.show();
|
||||
oRPC.callback = function(rpc) {
|
||||
oPanel.loader.hide();
|
||||
oPanel.addContent(rpc.xmlhttp.responseText);
|
||||
var scs=rpc.xmlhttp.responseText.extractScript();
|
||||
scs.evalScript();
|
||||
}.extend(this);
|
||||
oRPC.make();
|
||||
showCreateEmptyOptionsPanel = oPanel;
|
||||
}
|
||||
|
||||
function saveEmptyFile(){
|
||||
@@ -164,8 +323,8 @@ function saveEmptyFile(){
|
||||
var status = response.status;
|
||||
|
||||
if (status == "OK") {
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : 'processes_Ajax',
|
||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||
url : 'processes_Ajax',
|
||||
args: 'action=saveFile&filename='+fileName+'&pro_uid='+CURRENT_PRO_UID+'&MAIN_DIRECTORY='+CURRENT_MAIN_DIRECTORY+'&fcontent='
|
||||
});
|
||||
|
||||
@@ -179,7 +338,7 @@ function saveEmptyFile(){
|
||||
}
|
||||
editFile(CURRENT_PRO_UID, fileName)
|
||||
}.extend(this);
|
||||
oRPC.make();
|
||||
oRPC.make();
|
||||
} else {
|
||||
new leimnud.module.app.alert().make({label: _("ID_EXISTS_FILES")});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user