Improvement constant PARTNER_FLAG

- Browser library
- HearBeat
- tab plugins
This commit is contained in:
Marco Antonio Nina
2013-03-19 10:12:35 -04:00
parent d6918697aa
commit be174d0eed
6 changed files with 17 additions and 10 deletions

View File

@@ -195,7 +195,10 @@ class Installer
@mkdir($path_site . "reports/", 0777, true);
@mkdir($path_site . "xmlForms", 0777, true);
$db_text = "<?php\n" . "// Processmaker configuration\n" . "define ('DB_ADAPTER', 'mysql' );\n" . "define ('DB_HOST', '" . $this->options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_NAME', '" . $wf . "' );\n" . "define ('DB_USER', '" . (($this->cc_status == 1) ? $wf : $this->options['database']['username']) . "' );\n" . "define ('DB_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "define ('DB_RBAC_HOST', '" . $this->options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_RBAC_NAME', '" . $rb . "' );\n" . "define ('DB_RBAC_USER', '" . (($this->cc_status == 1) ? $rb : $this->options['database']['username']) . "' );\n" . "define ('DB_RBAC_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "define ('DB_REPORT_HOST', '" . $this->options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_REPORT_NAME', '" . $rp . "' );\n" . "define ('DB_REPORT_USER', '" . (($this->cc_status == 1) ? $rp : $this->options['database']['username']) . "' );\n" . "define ('DB_REPORT_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "define ('PARTNER_FLAG', true );\n"."?>";
$db_text = "<?php\n" . "// Processmaker configuration\n" . "define ('DB_ADAPTER', 'mysql' );\n" . "define ('DB_HOST', '" . $this->options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_NAME', '" . $wf . "' );\n" . "define ('DB_USER', '" . (($this->cc_status == 1) ? $wf : $this->options['database']['username']) . "' );\n" . "define ('DB_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "define ('DB_RBAC_HOST', '" . $this->options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_RBAC_NAME', '" . $rb . "' );\n" . "define ('DB_RBAC_USER', '" . (($this->cc_status == 1) ? $rb : $this->options['database']['username']) . "' );\n" . "define ('DB_RBAC_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "define ('DB_REPORT_HOST', '" . $this->options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_REPORT_NAME', '" . $rp . "' );\n" . "define ('DB_REPORT_USER', '" . (($this->cc_status == 1) ? $rp : $this->options['database']['username']) . "' );\n" . "define ('DB_REPORT_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "?>";
if (defined('PARTNER_FLAG')) {
$dbText .= "define ('PARTNER_FLAG', PARTNER_FLAG);\n";
}
$fp = @fopen($db_file, "w");
$this->log("Create: " . $db_file . " => " . ((!$fp) ? $fp : "OK") . "\n", $fp === false);
$ff = @fputs($fp, $db_text, strlen($db_text));

View File

@@ -680,7 +680,9 @@ class Installer extends Controller
$dbText .= sprintf( " define ('DB_REPORT_HOST', '%s' );\n", $db_host );
$dbText .= sprintf( " define ('DB_REPORT_NAME', '%s' );\n", $rp );
$dbText .= sprintf( " define ('DB_REPORT_USER', '%s' );\n", $rp );
$dbText .= sprintf( " define ('DB_REPORT_PASS', '%s' );\n", $rpPass );
$dbText .= sprintf( " define ('DB_REPORT_PASS', '%s' );\n", $rpPass );
if (defined('PARTNER_FLAG')) {
$dbText .= "define ('PARTNER_FLAG', PARTNER_FLAG);\n";
}
$this->installLog( G::LoadTranslation('ID_CREATING', SYS_LANG, Array($db_file) ));
@@ -945,7 +947,9 @@ class Installer extends Controller
$dbText .= sprintf( " define ('DB_REPORT_HOST', '%s' );\n", $db_host );
$dbText .= sprintf( " define ('DB_REPORT_NAME', '%s' );\n", $rp );
$dbText .= sprintf( " define ('DB_REPORT_USER', '%s' );\n", $rp );
$dbText .= sprintf( " define ('DB_REPORT_PASS', '%s' );\n", $rpPass );
$dbText .= sprintf( " define ('DB_REPORT_PASS', '%s' );\n", $rpPass );
if (defined('PARTNER_FLAG')) {
$dbText .= "define ('PARTNER_FLAG', PARTNER_FLAG);\n";
}
$this->installLog( G::LoadTranslation('ID_CREATING', SYS_LANG, Array($db_file) ));

View File

@@ -63,8 +63,8 @@ if ($RBAC->userCanAccess('PM_SETUP') == 1) {
}
//tools options
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1 ) {
$valueShow = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : true;
if ($valueShow) {
$valueShow = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : false;
if (!$valueShow) {
$G_TMP_MENU->AddIdRawOption('PLUGINS', 'pluginsMain', 'Plugins Manager', 'icon-plugins.png', '', 'plugins');
}
}

View File

@@ -158,8 +158,8 @@ 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) {
$partnerFlag = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : false;
if (!$partnerFlag) {
$sflag = $oServerConf->getHeartbeatProperty('HB_OPTION', 'HEART_BEAT_CONF');
$sflag = (trim($sflag) != '') ? $sflag : '1';

View File

@@ -30,8 +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 );
$partnerFlag = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : false;
$oHeadPublisher->assign( 'PARTNER_FLAG', $partnerFlag );
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
G::RenderPage( 'publish', 'extJs' );

View File

@@ -264,7 +264,7 @@ Ext.onReady(function(){
importProcess();
}
},
PARTNER_FLAG ?
!PARTNER_FLAG ?
[{
text: _('ID_BROWSE_LIBRARY'),
iconCls: 'button_menu_ext ss_sprite ss_world',