BUG 9530 HeartBeat SOLVED

- HeartBeat not checked.
- HeartBeat works in skin classic and uxmodern.
This commit is contained in:
Marco Antonio Nina
2012-08-02 16:22:45 -04:00
parent bf72368055
commit e55b260b98
3 changed files with 42 additions and 28 deletions

View File

@@ -192,42 +192,41 @@ class Main extends Controller
$availableLangArray = $this->getLanguagesList(); $availableLangArray = $this->getLanguagesList();
//$G_PUBLISH = new Publisher ();
//$G_PUBLISH->AddContent ('xmlform', 'xmlform', 'login/login', '', $aFields, SYS_URI .
//'login/authentication.php');
G::LoadClass ('serverConfiguration'); G::LoadClass ('serverConfiguration');
if (($nextBeatDate = $this->memcache->get('nextBeatDate')) === false) { $oServerConf = & serverConf::getSingleton ();
//get the serverconf singleton, and check if we can send the heartbeat $flagHeartBeat = '';
$oServerConf = & serverConf::getSingleton (); $sflag = $oServerConf->getHeartbeatProperty('HB_OPTION', 'HEART_BEAT_CONF');
$sflag = (trim($sflag) != '') ? $sflag : '1';
$sflag = $oServerConf->getHeartbeatProperty('HB_OPTION','HEART_BEAT_CONF'); //get date of next beat
$sflag = (trim($sflag)!='')?$sflag:'1'; $nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF');
//get date of next beat //if flag to send heartbeat is enabled, and it is time to send heartbeat, sent it using asynchronous beat.
$nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE','HEART_BEAT_CONF'); if (($sflag == "1") && ((strtotime("now") > $nextBeatDate) || is_null($nextBeatDate))) {
$this->memcache->set('nextBeatDate', $nextBeatDate, 1*3600); //To do: we need to change to ExtJs
$this->setJSVar('flagHeartBeat', ($flagHeartBeat == 1));
} else {
$this->setJSVar('flagHeartBeat', ($flagHeartBeat == 0));
} }
$sflag = 1;
//check if we show the panel with the getting started info //check if we show the panel with the getting started info
if (($flagGettingStarted = $this->memcache->get('flagGettingStarted')) === false) { require_once 'classes/model/Configuration.php';
require_once 'classes/model/Configuration.php'; $oConfiguration = new Configuration ();
$oConfiguration = new Configuration (); $oCriteria = new Criteria ('workflow');
$oCriteria = new Criteria ('workflow'); $oCriteria->add (ConfigurationPeer::CFG_UID, 'getStarted');
$oCriteria->add (ConfigurationPeer::CFG_UID, 'getStarted'); $oCriteria->add (ConfigurationPeer::OBJ_UID, '');
$oCriteria->add (ConfigurationPeer::OBJ_UID, ''); $oCriteria->add (ConfigurationPeer::CFG_VALUE, '1');
$oCriteria->add (ConfigurationPeer::CFG_VALUE, '1'); $oCriteria->add (ConfigurationPeer::PRO_UID, '');
$oCriteria->add (ConfigurationPeer::PRO_UID, ''); $oCriteria->add (ConfigurationPeer::USR_UID, '');
$oCriteria->add (ConfigurationPeer::USR_UID, ''); $oCriteria->add (ConfigurationPeer::APP_UID, '');
$oCriteria->add (ConfigurationPeer::APP_UID, ''); $flagGettingStarted = ConfigurationPeer::doCount ($oCriteria);
$flagGettingStarted = ConfigurationPeer::doCount ($oCriteria); if ($flagGettingStarted == 0) {
$this->memcache->set('flagGettingStarted', $flagGettingStarted, 8*3600) ; $this->setJSVar('flagGettingStarted', ($flagGettingStarted == 1));
} else {
$this->setJSVar('flagGettingStarted', ($flagGettingStarted == 0));
} }
$this->setJSVar('flagGettingStarted', ($flagGettingStarted == 0));
G::loadClass('configuration'); G::loadClass('configuration');
$oConf = new Configurations; $oConf = new Configurations;
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS',''); $oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS','');

View File

@@ -160,7 +160,6 @@ $sflag = (trim($sflag) != '') ? $sflag : '1';
//get date of next beat //get date of next beat
$nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF'); $nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF');
$sflag = 1;
//if flag to send heartbeat is enabled, and it is time to send heartbeat, sent it using asynchronous beat. //if flag to send heartbeat is enabled, and it is time to send heartbeat, sent it using asynchronous beat.
if (($sflag == "1") && ((strtotime("now") > $nextBeatDate) || is_null($nextBeatDate))) { if (($sflag == "1") && ((strtotime("now") > $nextBeatDate) || is_null($nextBeatDate))) {

View File

@@ -72,6 +72,9 @@ var Login = function() {
if (flagGettingStarted) { if (flagGettingStarted) {
this.gettingStartedWindow.show(); this.gettingStartedWindow.show();
} }
if (flagHeartBeat) {
processHbInfo();
}
} }
} }
}(); }();
@@ -374,6 +377,19 @@ Login.initComponents = function()
//Ext.getCmp('login-form').hide(); //Ext.getCmp('login-form').hide();
} }
processHbInfo = function() {
Ext.Ajax.request({
url : '../services/processHeartBeat_Ajax' ,
params : {action:'processInformation'},
success: function ( result, request ) {
//console.info("");
},
failure: function ( result, request) {
//Ext.MessageBox.alert(_('ID_FAILED'), result.responseText);
}
});
}
Login.forgotPassword = function() Login.forgotPassword = function()
{ {
this.window.hide(); this.window.hide();