PMCORE-3846

This commit is contained in:
Julio Cesar Laura Avendaño
2022-06-02 20:27:42 +00:00
committed by Mauricio Veliz
parent 5835a96800
commit b3f57c2fd8
5 changed files with 52 additions and 100 deletions

View File

@@ -1,5 +1,5 @@
<?php
use Eusebiu\JavaScript\Facades\ScriptVariables;
use Illuminate\Support\Facades\View;
use ProcessMaker\Core\System;
use ProcessMaker\Model\User;
@@ -24,15 +24,17 @@ $oHeadPublisher->assignNumber("pageSize", 20); //sending the page size
$oHeadPublisher->assignNumber("availableFields", G::json_encode($availableFields));
$userCanAccess = 1;
$pmDynaform = new PmDynaform();
ScriptVariables::add('SYS_CREDENTIALS', base64_encode(G::json_encode($pmDynaform->getCredentials())));
ScriptVariables::add('SYS_SERVER_API', System::getHttpServerHostnameRequestsFrontEnd());
ScriptVariables::add('SYS_SERVER_AJAX', System::getServerProtocolHost());
ScriptVariables::add('SYS_WORKSPACE', config("system.workspace"));
ScriptVariables::add('SYS_URI', SYS_URI);
ScriptVariables::add('SYS_LANG', SYS_LANG);
ScriptVariables::add('TRANSLATIONS', $translation);
ScriptVariables::add('FORMATS', $conf->getFormats());
ScriptVariables::add('userId', User::getId($_SESSION['USER_LOGGED']));
echo View::make('Views::admin.settings.customCasesList', compact("userCanAccess"))->render();
$oHeadPublisher->assign('window.config', []);
$oHeadPublisher->assign('window.config.SYS_CREDENTIALS', base64_encode(G::json_encode($pmDynaform->getCredentials())));
$oHeadPublisher->assign('window.config.SYS_SERVER_API', System::getHttpServerHostnameRequestsFrontEnd());
$oHeadPublisher->assign('window.config.SYS_SERVER_AJAX', System::getServerProtocolHost());
$oHeadPublisher->assign('window.config.SYS_WORKSPACE', config('system.workspace'));
$oHeadPublisher->assign('window.config.SYS_URI', SYS_URI);
$oHeadPublisher->assign('window.config.SYS_LANG', SYS_LANG);
$oHeadPublisher->assign('window.config.TRANSLATIONS', $translation);
$oHeadPublisher->assign('window.config.FORMATS', $conf->getFormats());
$oHeadPublisher->assign('window.config.userId', User::getId($_SESSION['USER_LOGGED']));
echo View::make('Views::admin.settings.customCasesList', compact('userCanAccess', 'oHeadPublisher'))->render();

View File

@@ -1,7 +1,5 @@
<?php
use Eusebiu\JavaScript\Facades\ScriptVariables;
use Illuminate\Support\Facades\View;
use ProcessMaker\Core\System;
use ProcessMaker\Model\Application;
use ProcessMaker\Model\Delegation;
@@ -9,8 +7,6 @@ use ProcessMaker\Model\User;
$conf = new Configurations();
$oHeadPublisher = headPublisher::getSingleton();
$keyMem = "USER_PREFERENCES" . $_SESSION["USER_LOGGED"];
$memcache = PMmemcached::getSingleton(config("system.workspace"));
@@ -125,40 +121,25 @@ if (isset($_SESSION['__OPEN_APPLICATION_UID__'])) {
}
}
$oServerConf = ServerConf::getSingleton();
if ($oServerConf->isRtl(SYS_LANG)) {
$regionTreePanel = 'east';
$regionDebug = 'west';
} else {
$regionTreePanel = 'west';
$regionDebug = 'east';
}
$urlProxy = 'casesMenuLoader?action=getAllCounters&r=';
$oHeadPublisher->assign('regionTreePanel', $regionTreePanel);
$oHeadPublisher->assign('regionDebug', $regionDebug);
$oHeadPublisher->assign('openCaseIE', $openCaseIE);
$oHeadPublisher->assign("defaultOption", $defaultOption); //User menu permissions
$oHeadPublisher->assign('urlProxy', $urlProxy); //sending the urlProxy to make
$oHeadPublisher->assign("_nodeId", isset($confDefaultOption) ? $confDefaultOption : "PM_USERS"); //User menu permissions
$oHeadPublisher->assign("FORMATS", $conf->getFormats());
$userCanAccess = 1;
global $translation;
$pmDynaform = new PmDynaform();
ScriptVariables::add('defaultOption', $defaultOption);
ScriptVariables::add('_nodeId', isset($confDefaultOption) ? $confDefaultOption : "PM_USERS");
ScriptVariables::add('SYS_CREDENTIALS', base64_encode(G::json_encode($pmDynaform->getCredentials())));
ScriptVariables::add('SYS_SERVER_API', System::getHttpServerHostnameRequestsFrontEnd());
ScriptVariables::add('SYS_SERVER_AJAX', System::getServerProtocolHost());
ScriptVariables::add('SYS_WORKSPACE', config("system.workspace"));
ScriptVariables::add('SYS_URI', SYS_URI);
ScriptVariables::add('SYS_LANG', SYS_LANG);
ScriptVariables::add('TRANSLATIONS', $translation);
ScriptVariables::add('FORMATS', $conf->getFormats());
ScriptVariables::add('userId', User::getId($_SESSION['USER_LOGGED']));
ScriptVariables::add('userConfig', array(
"usr_uid" => $_SESSION['USER_LOGGED']
));
G::RenderPage("publish", "viena");
$oHeadPublisher = headPublisher::getSingleton();
$oHeadPublisher->assign('window.config', []);
$oHeadPublisher->assign('window.config.defaultOption', $defaultOption);
$oHeadPublisher->assign('window.config._nodeId', isset($confDefaultOption) ? $confDefaultOption : 'PM_USERS');
$oHeadPublisher->assign('window.config.SYS_CREDENTIALS', base64_encode(G::json_encode($pmDynaform->getCredentials())));
$oHeadPublisher->assign('window.config.SYS_SERVER_API', System::getHttpServerHostnameRequestsFrontEnd());
$oHeadPublisher->assign('window.config.SYS_SERVER_AJAX', System::getServerProtocolHost());
$oHeadPublisher->assign('window.config.SYS_WORKSPACE', config('system.workspace'));
$oHeadPublisher->assign('window.config.SYS_URI', SYS_URI);
$oHeadPublisher->assign('window.config.SYS_LANG', SYS_LANG);
$oHeadPublisher->assign('window.config.TRANSLATIONS', $translation);
$oHeadPublisher->assign('window.config.FORMATS', $conf->getFormats());
$oHeadPublisher->assign('window.config.userId', User::getId($_SESSION['USER_LOGGED']));
$oHeadPublisher->assign('window.config.userConfig', [
'usr_uid' => $_SESSION['USER_LOGGED']
]);
G::RenderPage('publish', 'viena');

View File

@@ -3,9 +3,6 @@
* Class SkinEngine
*
* This class load and dispatch the main systems layouts
*
* @author Erik Amaru Ortiz <erik@colosa.com>
* @author Hugo Loza
*/
use ProcessMaker\Core\System;
@@ -334,16 +331,18 @@ class SkinEngine
echo $template->getOutputContent();
}
private function _viena()
/**
* Render "viena" view
*/
private function _viena()
{
$oHeadPublisher = headPublisher::getSingleton();
$styles = "";
$header = $oHeadPublisher->getExtJsVariablesScript();
$header = $oHeadPublisher->getExtJsStylesheets($this->cssFileName . "-viena");
$templateFile = $this->layoutFile['dirname'] . PATH_SEP . $this->layoutFileViena['basename'];
if (file_exists($templateFile)) {
$body = ScriptVariables::render();
$oHeadPublisher = headPublisher::getSingleton();
$header = $oHeadPublisher->getExtJsStylesheets($this->cssFileName . '-viena');
$body = $oHeadPublisher->getExtJsVariablesScript('');
$template = new TemplatePower($templateFile);
$template->prepare();
$template->assign('header', $header);
@@ -351,7 +350,7 @@ class SkinEngine
echo $template->getOutputContent();
} else {
$userCanAccess = 1;
echo View::make('Views::home.home', compact("userCanAccess"))->render();
echo View::make('Views::home.home', compact('userCanAccess'))->render();
}
}
@@ -472,7 +471,6 @@ class SkinEngine
if (!defined('NO_DISPLAY_USERNAME')) {
define('NO_DISPLAY_USERNAME', 0);
}
if (NO_DISPLAY_USERNAME == 0) {
$smarty->assign('userfullname', isset($_SESSION['USR_FULLNAME']) ? $_SESSION['USR_FULLNAME'] : '');
$smarty->assign('user', isset($_SESSION['USR_USERNAME']) ? '(' . $_SESSION['USR_USERNAME'] . ')' : '');