BUG 8742 Migrate Processmaker Heartbeat to ExtJS SOLVED
- Migrate Processmaker Heartbeat to ExtJS (from master branch) - Heartbeat ExtJS migrated from the master branch.
This commit is contained in:
78
workflow/engine/templates/setup/processHeartBeatConfig.js
Normal file
78
workflow/engine/templates/setup/processHeartBeatConfig.js
Normal file
@@ -0,0 +1,78 @@
|
||||
Ext.onReady(function() {
|
||||
HeartFields = new Ext.form.FieldSet({
|
||||
|
||||
title : _('ID_HEARTBEAT_DISPLAY'),
|
||||
items : [
|
||||
{
|
||||
xtype : 'checkbox',
|
||||
checked : heartBeatChecked,
|
||||
name : 'acceptHB',
|
||||
fieldLabel : 'Terms of Use',
|
||||
hideLabel : true,
|
||||
id : 'ch_ii',
|
||||
style : 'margin-top:15px',
|
||||
boxLabel : '<b>' + _('ID_ENABLE_HEART_BEAT') + '</b>'
|
||||
|
||||
},
|
||||
{
|
||||
xtype : 'box',
|
||||
autoEl : { tag : 'div',
|
||||
html : '<br />' + _('ID_HEART_BEAT_DETAILS_1') + _('ID_HEART_BEAT_DETAILS_2')
|
||||
+ '<br>' + _('ID_SEE') + ' <a href="' + 'http://wiki.processmaker.com/index.php/Heartbeat'
|
||||
+ '" target="_blank" align="center">' + _('ID_MORE_INFORMATION') + '</a>.'
|
||||
},
|
||||
style : 'margin-left:20px'
|
||||
},
|
||||
],
|
||||
buttons : [{
|
||||
text : _('ID_SAVE'),
|
||||
handler : saveOption
|
||||
}]
|
||||
});
|
||||
|
||||
|
||||
var frm = new Ext.FormPanel( {
|
||||
title : ' ',
|
||||
id : 'frmHeart',
|
||||
labelWidth : 150,
|
||||
width : 600,
|
||||
labelAlign : 'right',
|
||||
autoScroll : true,
|
||||
bodyStyle : 'padding:2px',
|
||||
waitMsgTarget : true,
|
||||
frame : true,
|
||||
|
||||
defaults: {
|
||||
allowBlank : false,
|
||||
msgTarget : 'side',
|
||||
align : 'center'
|
||||
},
|
||||
items : [ HeartFields ]
|
||||
|
||||
});
|
||||
//render to process-panel
|
||||
frm.render(document.body);
|
||||
});
|
||||
|
||||
function saveOption() {
|
||||
Ext.getCmp('frmHeart').getForm().submit( {
|
||||
url : 'processHeartBeatAjax?action=saveOption',
|
||||
waitMsg : _('ID_SAVING_PROCESS'),
|
||||
timeout : 36000,
|
||||
success : function(obj, resp) {
|
||||
//nothing to do
|
||||
response = Ext.decode(resp.response.responseText);
|
||||
if (response.enable) {
|
||||
parent.PMExt.notify(_('ID_HEARTBEAT_DISPLAY'), _('ID_HEART_BEAT_ENABLED'));
|
||||
}
|
||||
else {
|
||||
parent.PMExt.notify(_('ID_HEARTBEAT_DISPLAY'), _('ID_HEART_BEAT_DISABLED'));
|
||||
}
|
||||
},
|
||||
failure : function(obj, resp) {
|
||||
Ext.Msg.alert( _('ID_ERROR'), resp.result.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user