Improvement constant PARTNER_FLAG

- Browser library
- HearBeat
- tab plugins
This commit is contained in:
Marco Antonio Nina
2013-03-18 15:13:14 -04:00
parent 517726c938
commit d6918697aa
6 changed files with 32 additions and 19 deletions

View File

@@ -158,18 +158,22 @@ G::LoadClass('serverConfiguration');
//Bootstrap::LoadClass('serverConfiguration');
//get the serverconf singleton, and check if we can send the heartbeat
$oServerConf = & serverConf::getSingleton();
$valueShow = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : true;
if ($valueShow) {
$sflag = $oServerConf->getHeartbeatProperty('HB_OPTION', 'HEART_BEAT_CONF');
$sflag = (trim($sflag) != '') ? $sflag : '1';
$sflag = $oServerConf->getHeartbeatProperty('HB_OPTION', 'HEART_BEAT_CONF');
$sflag = (trim($sflag) != '') ? $sflag : '1';
//get date of next beat
$nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF');
//get date of next beat
$nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF');
//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))) {
$oHeadPublisher =& headPublisher::getSingleton();
//To do: we need to change to ExtJs
$oHeadPublisher->addScriptCode('var flagHeartBeat = 1;');
//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))) {
$oHeadPublisher =& headPublisher::getSingleton();
//To do: we need to change to ExtJs
$oHeadPublisher->addScriptCode('var flagHeartBeat = 1;');
} else {
$oHeadPublisher->addScriptCode('var flagHeartBeat = 0;');
}
} else {
$oHeadPublisher->addScriptCode('var flagHeartBeat = 0;');
}

View File

@@ -30,7 +30,8 @@ $conf = new Configurations();
$oHeadPublisher->addExtJsScript( 'processes/main', true ); //adding a javascript file .js
$oHeadPublisher->addContent( 'processes/main' ); //adding a html file .html.
$valueShow = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : true;
$oHeadPublisher->assign( 'PARTNER_FLAG', $valueShow );
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
G::RenderPage( 'publish', 'extJs' );