Add namespace Processmaker\Core

This commit is contained in:
Marco A. Nina Mena
2017-08-14 16:13:46 -04:00
parent 06641a39c2
commit ee5a124bba
87 changed files with 623 additions and 477 deletions

View File

@@ -1,5 +1,7 @@
<?php
use ProcessMaker\Core\System;
/**
* Admin controller
*
@@ -19,7 +21,7 @@ class Admin extends Controller
$RBAC->requirePermissions( 'PM_SETUP' );
require_once PATH_CONTROLLERS . 'main.php';
$skinsList = PmSystem::getSkingList();
$skinsList = System::getSkingList();
foreach ($skinsList['skins'] as $key => $value) {
if ($value['SKIN_WORKSPACE'] != 'Global') {
unset( $skinsList['skins'][$key] );
@@ -29,7 +31,7 @@ class Admin extends Controller
$mainController = new Main();
$languagesList = $mainController->getLanguagesList();
$languagesList[] = array ("", G::LoadTranslation("ID_USE_LANGUAGE_URL"));
$sysConf = PmSystem::getSystemConfiguration( PATH_CONFIG . 'env.ini' );
$sysConf = System::getSystemConfiguration( PATH_CONFIG . 'env.ini' );
foreach ($skinsList['skins'] as $skin) {
$skins[] = array ($skin['SKIN_FOLDER_ID'],$skin['SKIN_NAME']);
@@ -268,7 +270,7 @@ class Admin extends Controller
if (defined('SYSTEM_NAME')) {
$systemName = SYSTEM_NAME;
}
$properties[] = array ($systemName. ' Ver.', PmSystem::getVersion() . $ee, $pmSection);
$properties[] = array ($systemName. ' Ver.', System::getVersion() . $ee, $pmSection);
$properties[] = array("PMUI JS Lib. Ver.", $pmuiVer, $pmSection);
$properties[] = array("MAFE JS Lib. Ver.", $mafeVer, $pmSection);
$properties[] = array("PM Dynaform JS Lib. Ver.", $pmdynaformVer, $pmSection);

View File

@@ -1,5 +1,6 @@
<?php
use ProcessMaker\Core\System;
use ProcessMaker\Plugins\PluginRegistry;
/**
@@ -41,7 +42,7 @@ class adminProxy extends HttpProxyController
$updateRedirector = false;
$restart = false;
self::validateDataSystemConf($httpData, $envFile);
$sysConf = PmSystem::getSystemConfiguration($envFile);
$sysConf = System::getSystemConfiguration($envFile);
$updatedConf = array();
if ($sysConf['default_lang'] != $httpData->default_lang) {
@@ -99,7 +100,7 @@ class adminProxy extends HttpProxyController
}
}
PmSystem::updateIndexFile(array(
System::updateIndexFile(array(
'lang' => $sysConf['default_lang'],
'skin' => $sysConf['default_skin']
));
@@ -614,7 +615,7 @@ class adminProxy extends HttpProxyController
$sBodyPre->prepare();
$sBodyPre->assign('server', $_SERVER['SERVER_NAME']);
$sBodyPre->assign('date', date('H:i:s'));
$sBodyPre->assign('ver', PmSystem::getVersion());
$sBodyPre->assign('ver', System::getVersion());
$sBodyPre->assign('engine', $engine);
$sBodyPre->assign('msg', $msg);
$sBody = $sBodyPre->getOutputContent();
@@ -1418,7 +1419,7 @@ class adminProxy extends HttpProxyController
$params['lt'] = isset($licInfo[SYS_SYS]) ? isset($licInfo[SYS_SYS]['TYPE'])? $licInfo[SYS_SYS]['TYPE'] : '' : '';
//ProcessMaker Version
$params['v'] = PmSystem::getVersion();
$params['v'] = System::getVersion();
if (file_exists(PATH_DATA. 'log/upgrades.log')) {
$params['pmu'] = serialize(file_get_contents(PATH_DATA. 'log/upgrades.log', 'r'));
} else {
@@ -1508,7 +1509,7 @@ class adminProxy extends HttpProxyController
//Country/city (Timezone)
$params['t'] = (defined('TIME_ZONE') && TIME_ZONE != "Unknown") ? TIME_ZONE : date_default_timezone_get();
$params['w'] = count(PmSystem::listWorkspaces());
$params['w'] = count(System::listWorkspaces());
$support = PATH_DATA_SITE . G::sanitizeString($licenseManager->info['FIRST_NAME'] . '-' . $licenseManager->info['LAST_NAME'] . '-' . SYS_SYS . '-' . date('YmdHis'), false, false) . '.spm';
file_put_contents($support, serialize($params));

View File

@@ -1,5 +1,6 @@
<?php
use ProcessMaker\Core\System;
use ProcessMaker\Plugins\PluginRegistry;
/**
@@ -64,7 +65,7 @@ class Designer extends Controller
$this->setVar("SYS_SYS", SYS_SYS);
$this->setVar("SYS_LANG", SYS_LANG);
$this->setVar("SYS_SKIN", SYS_SKIN);
$this->setVar('HTTP_SERVER_HOSTNAME', PmSystem::getHttpServerHostnameRequestsFrontEnd());
$this->setVar('HTTP_SERVER_HOSTNAME', System::getHttpServerHostnameRequestsFrontEnd());
if ($debug) {
if (!file_exists(PATH_HTML . "lib-dev/pmUI/build.cache")) {

View File

@@ -1,5 +1,7 @@
<?php
use ProcessMaker\Core\System;
/**
* Home controller
*
@@ -102,7 +104,7 @@ class Home extends Controller
$userProperty = new UsersProperties();
$process = new Process();
$case = new Cases();
$sysConf = PmSystem::getSystemConfiguration( PATH_CONFIG . 'env.ini' );
$sysConf = System::getSystemConfiguration( PATH_CONFIG . 'env.ini' );
//Get ProcessStatistics Info
$start = 0;
@@ -184,7 +186,7 @@ class Home extends Controller
$solrEnabled = false;
if (($solrConf = PmSystem::solrEnv()) !== false) {
if (($solrConf = System::solrEnv()) !== false) {
$ApplicationSolrIndex = new AppSolr(
$solrConf["solr_enabled"],
@@ -408,7 +410,7 @@ class Home extends Controller
$type == "todo" || $type == "draft" || $type == "paused" || $type == "sent" ||
$type == "selfservice" || $type == "unassigned" || $type == "search"
) &&
(($solrConf = PmSystem::solrEnv()) !== false)
(($solrConf = System::solrEnv()) !== false)
) {
$ApplicationSolrIndex = new AppSolr(

View File

@@ -5,7 +5,11 @@
*
* @author Erik A. O. <erik@colosa.com>
*/
global $translation;
global
use ProcessMaker\Core\System;
$translation;
include PATH_LANGUAGECONT."translation.".SYS_LANG;
class Installer extends Controller
@@ -966,7 +970,7 @@ class Installer extends Controller
$envFile = PATH_CONFIG . 'env.ini';
// getting configuration from env.ini
$sysConf = PmSystem::getSystemConfiguration( $envFile );
$sysConf = System::getSystemConfiguration( $envFile );
$langUri = 'en';
if (isset($sysConf['default_lang'])) {
@@ -1022,7 +1026,7 @@ class Installer extends Controller
try {
// update the main index file
$indexFileUpdated = PmSystem::updateIndexFile(array('lang' => 'en','skin' => $updatedConf['default_skin']));
$indexFileUpdated = System::updateIndexFile(array('lang' => 'en','skin' => $updatedConf['default_skin']));
} catch (Exception $e) {
$info->result = false;
$info->message = G::LoadTranslation('ID_PROCESSMAKER_WRITE_CONFIG_INDEX', SYS_LANG, Array(PATH_HTML . "index.html."));

View File

@@ -1,5 +1,6 @@
<?php
use ProcessMaker\Core\System;
use ProcessMaker\Plugins\PluginRegistry;
/**
@@ -264,7 +265,7 @@ class Main extends Controller
}
$this->setVar( 'logo_company', $this->getCompanyLogo() );
$this->setVar( 'pmos_version', PmSystem::getVersion() );
$this->setVar( 'pmos_version', System::getVersion() );
$footerText = 'Copyright &copy; 2003-' . date( 'Y' ) . ' Colosa, Inc. All rights reserved.';
$adviseText = 'Supplied free of charge with no support, certification, warranty,
@@ -314,7 +315,7 @@ class Main extends Controller
$this->includeExtJS( 'main/sysLogin' );
$this->setVar( 'logo_company', $this->getCompanyLogo() );
$this->setVar( 'pmos_version', PmSystem::getVersion() );
$this->setVar( 'pmos_version', System::getVersion() );
$footerText = G::LoadTranslation('ID_COPYRIGHT_FROM') . date( 'Y' ) . G::LoadTranslation('ID_COPYRIGHT_COL');
$adviseText = G::LoadTranslation('ID_COLOSA_AND_CERTIFIED_PARTNERS');
@@ -384,7 +385,7 @@ class Main extends Controller
$template->assign( 'passwd', $newPass );
$template->assign( 'poweredBy', G::loadTranslation( 'ID_PROCESSMAKER_SLOGAN1' ) );
$template->assign( 'versionLabel', G::loadTranslation( 'ID_VERSION' ) );
$template->assign( 'version', PmSystem::getVersion() );
$template->assign( 'version', System::getVersion() );
$template->assign( 'visit', G::loadTranslation( 'ID_VISIT' ) );
$template->assign( 'footer', '' );
@@ -733,7 +734,7 @@ class Main extends Controller
if (defined('SYSTEM_NAME')) {
$systemName = SYSTEM_NAME;
}
$properties[] = array ($systemName. ' Ver.', PmSystem::getVersion() . $ee, $pmSection);
$properties[] = array ($systemName. ' Ver.', System::getVersion() . $ee, $pmSection);
$properties[] = array("PMUI JS Lib. Ver.", $pmuiVer, $pmSection);
$properties[] = array("MAFE JS Lib. Ver.", $mafeVer, $pmSection);
$properties[] = array("PM Dynaform JS Lib. Ver.", $pmdynaformVer, $pmSection);

View File

@@ -6,6 +6,9 @@
* @inherits HttpProxyController
* @access public
*/
use ProcessMaker\Core\System;
header("Content-type: text/html;charset=utf-8");
require_once 'classes/model/AdditionalTables.php';
@@ -920,7 +923,7 @@ class pmTablesProxy extends HttpProxyController
$result = new stdClass();
$net = new Net( G::getIpAddress() );
$META = " \n-----== ProcessMaker Open Source Private Tables ==-----\n" . " @Ver: 1.0 Oct-2009\n" . " @Processmaker version: " . PmSystem::getVersion() . "\n" . " -------------------------------------------------------\n" . " @Export Date: " . date( "l jS \of F Y h:i:s A" ) . "\n" . " @Server address: " . getenv( 'SERVER_NAME' ) . " (" . getenv( 'SERVER_ADDR' ) . ")\n" . " @Client address: " . $net->hostname . "\n" . " @Workspace: " . SYS_SYS . "\n" . " @Export trace back:\n\n";
$META = " \n-----== ProcessMaker Open Source Private Tables ==-----\n" . " @Ver: 1.0 Oct-2009\n" . " @Processmaker version: " . System::getVersion() . "\n" . " -------------------------------------------------------\n" . " @Export Date: " . date( "l jS \of F Y h:i:s A" ) . "\n" . " @Server address: " . getenv( 'SERVER_NAME' ) . " (" . getenv( 'SERVER_ADDR' ) . ")\n" . " @Client address: " . $net->hostname . "\n" . " @Workspace: " . SYS_SYS . "\n" . " @Export trace back:\n\n";
$EXPORT_TRACEBACK = Array ();
$c = 0;

View File

@@ -1,5 +1,7 @@
<?php
use ProcessMaker\Core\System;
/**
* StrategicDashboard controller
* @inherits Controller
@@ -31,7 +33,7 @@ class StrategicDashboard extends Controller
$user = new Users();
$user = $user->load($RBAC->aUserInfo['USER_INFO']['USR_UID']);
$this->usrUnitCost = $this->currencySymbolToShow($user);
$this->urlProxy = PmSystem::getHttpServerHostnameRequestsFrontEnd() . '/api/1.0/' . SYS_SYS . '/';
$this->urlProxy = System::getHttpServerHostnameRequestsFrontEnd() . '/api/1.0/' . SYS_SYS . '/';
//change
$clientId = 'x-pm-local-client';
$client = $this->getClientCredentials($clientId);

View File

@@ -1,5 +1,7 @@
<?php
use ProcessMaker\Core\System;
class webEntryProxy extends HttpProxyController
{
//Delete Web Entry
@@ -183,7 +185,7 @@ class webEntryProxy extends HttpProxyController
$template->assign( 'dynaform', $dynTitle );
$template->assign( 'timestamp', date( 'l jS \of F Y h:i:s A' ) );
$template->assign( 'ws', SYS_SYS );
$template->assign( 'version', PmSystem::getVersion() );
$template->assign( 'version', System::getVersion() );
$fileName = $pathProcess . $dynTitle . 'Post.php';
file_put_contents( $fileName, $template->getOutputContent() );