PMCORE-3846
This commit is contained in:
committed by
Mauricio Veliz
parent
5835a96800
commit
b3f57c2fd8
@@ -1,29 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* class.headPublisher.php
|
|
||||||
*
|
|
||||||
* @package gulliver.system
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public LicensegetExtJsLibraries
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
use ProcessMaker\Plugins\PluginRegistry;
|
use ProcessMaker\Plugins\PluginRegistry;
|
||||||
use ProcessMaker\Core\System;
|
use ProcessMaker\Core\System;
|
||||||
@@ -31,8 +6,6 @@ use ProcessMaker\Core\System;
|
|||||||
/**
|
/**
|
||||||
* Class headPublisher
|
* Class headPublisher
|
||||||
*
|
*
|
||||||
* @author David S. Callizaya S. <davidsantos@colosa.com>
|
|
||||||
* @package gulliver.system
|
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
class headPublisher
|
class headPublisher
|
||||||
@@ -417,7 +390,13 @@ class headPublisher
|
|||||||
return $script;
|
return $script;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getExtJsVariablesScript()
|
/**
|
||||||
|
* Build javascript section with declaration of variables
|
||||||
|
*
|
||||||
|
* @param string $declarationKeyword
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getExtJsVariablesScript($declarationKeyword = 'var')
|
||||||
{
|
{
|
||||||
$script = '';
|
$script = '';
|
||||||
if (count($this->extVariable) > 0) {
|
if (count($this->extVariable) > 0) {
|
||||||
@@ -427,15 +406,7 @@ class headPublisher
|
|||||||
$value = $val['value'];
|
$value = $val['value'];
|
||||||
$variablesValues = G::json_encode($value);
|
$variablesValues = G::json_encode($value);
|
||||||
$variablesValues = $this->stripCodeQuotes($variablesValues);
|
$variablesValues = $this->stripCodeQuotes($variablesValues);
|
||||||
// var_dump($variablesValues);
|
$script .= " $declarationKeyword $name = " . $variablesValues . ";\n";
|
||||||
// echo "<br>";
|
|
||||||
$script .= " var $name = " . $variablesValues . ";\n";
|
|
||||||
/*
|
|
||||||
if ($val ['type'] == 'number')
|
|
||||||
$script .= " var $name = $value;\n";
|
|
||||||
else
|
|
||||||
$script .= " var $name = '$value';\n";
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
$script .= "</script>\n";
|
$script .= "</script>\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
{{ ScriptVariables::render() }}
|
{!! $oHeadPublisher->getExtJsVariablesScript('') !!}
|
||||||
<div id="customCaseList">
|
<div id="customCaseList">
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
use Eusebiu\JavaScript\Facades\ScriptVariables;
|
|
||||||
use Illuminate\Support\Facades\View;
|
use Illuminate\Support\Facades\View;
|
||||||
use ProcessMaker\Core\System;
|
use ProcessMaker\Core\System;
|
||||||
use ProcessMaker\Model\User;
|
use ProcessMaker\Model\User;
|
||||||
@@ -24,15 +24,17 @@ $oHeadPublisher->assignNumber("pageSize", 20); //sending the page size
|
|||||||
$oHeadPublisher->assignNumber("availableFields", G::json_encode($availableFields));
|
$oHeadPublisher->assignNumber("availableFields", G::json_encode($availableFields));
|
||||||
|
|
||||||
$userCanAccess = 1;
|
$userCanAccess = 1;
|
||||||
|
|
||||||
$pmDynaform = new PmDynaform();
|
$pmDynaform = new PmDynaform();
|
||||||
ScriptVariables::add('SYS_CREDENTIALS', base64_encode(G::json_encode($pmDynaform->getCredentials())));
|
|
||||||
ScriptVariables::add('SYS_SERVER_API', System::getHttpServerHostnameRequestsFrontEnd());
|
$oHeadPublisher->assign('window.config', []);
|
||||||
ScriptVariables::add('SYS_SERVER_AJAX', System::getServerProtocolHost());
|
$oHeadPublisher->assign('window.config.SYS_CREDENTIALS', base64_encode(G::json_encode($pmDynaform->getCredentials())));
|
||||||
ScriptVariables::add('SYS_WORKSPACE', config("system.workspace"));
|
$oHeadPublisher->assign('window.config.SYS_SERVER_API', System::getHttpServerHostnameRequestsFrontEnd());
|
||||||
ScriptVariables::add('SYS_URI', SYS_URI);
|
$oHeadPublisher->assign('window.config.SYS_SERVER_AJAX', System::getServerProtocolHost());
|
||||||
ScriptVariables::add('SYS_LANG', SYS_LANG);
|
$oHeadPublisher->assign('window.config.SYS_WORKSPACE', config('system.workspace'));
|
||||||
ScriptVariables::add('TRANSLATIONS', $translation);
|
$oHeadPublisher->assign('window.config.SYS_URI', SYS_URI);
|
||||||
ScriptVariables::add('FORMATS', $conf->getFormats());
|
$oHeadPublisher->assign('window.config.SYS_LANG', SYS_LANG);
|
||||||
ScriptVariables::add('userId', User::getId($_SESSION['USER_LOGGED']));
|
$oHeadPublisher->assign('window.config.TRANSLATIONS', $translation);
|
||||||
echo View::make('Views::admin.settings.customCasesList', compact("userCanAccess"))->render();
|
$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();
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Eusebiu\JavaScript\Facades\ScriptVariables;
|
|
||||||
use Illuminate\Support\Facades\View;
|
|
||||||
use ProcessMaker\Core\System;
|
use ProcessMaker\Core\System;
|
||||||
use ProcessMaker\Model\Application;
|
use ProcessMaker\Model\Application;
|
||||||
use ProcessMaker\Model\Delegation;
|
use ProcessMaker\Model\Delegation;
|
||||||
@@ -9,8 +7,6 @@ use ProcessMaker\Model\User;
|
|||||||
|
|
||||||
$conf = new Configurations();
|
$conf = new Configurations();
|
||||||
|
|
||||||
$oHeadPublisher = headPublisher::getSingleton();
|
|
||||||
|
|
||||||
$keyMem = "USER_PREFERENCES" . $_SESSION["USER_LOGGED"];
|
$keyMem = "USER_PREFERENCES" . $_SESSION["USER_LOGGED"];
|
||||||
$memcache = PMmemcached::getSingleton(config("system.workspace"));
|
$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;
|
global $translation;
|
||||||
|
|
||||||
$pmDynaform = new PmDynaform();
|
$pmDynaform = new PmDynaform();
|
||||||
ScriptVariables::add('defaultOption', $defaultOption);
|
|
||||||
ScriptVariables::add('_nodeId', isset($confDefaultOption) ? $confDefaultOption : "PM_USERS");
|
$oHeadPublisher = headPublisher::getSingleton();
|
||||||
ScriptVariables::add('SYS_CREDENTIALS', base64_encode(G::json_encode($pmDynaform->getCredentials())));
|
$oHeadPublisher->assign('window.config', []);
|
||||||
ScriptVariables::add('SYS_SERVER_API', System::getHttpServerHostnameRequestsFrontEnd());
|
$oHeadPublisher->assign('window.config.defaultOption', $defaultOption);
|
||||||
ScriptVariables::add('SYS_SERVER_AJAX', System::getServerProtocolHost());
|
$oHeadPublisher->assign('window.config._nodeId', isset($confDefaultOption) ? $confDefaultOption : 'PM_USERS');
|
||||||
ScriptVariables::add('SYS_WORKSPACE', config("system.workspace"));
|
$oHeadPublisher->assign('window.config.SYS_CREDENTIALS', base64_encode(G::json_encode($pmDynaform->getCredentials())));
|
||||||
ScriptVariables::add('SYS_URI', SYS_URI);
|
$oHeadPublisher->assign('window.config.SYS_SERVER_API', System::getHttpServerHostnameRequestsFrontEnd());
|
||||||
ScriptVariables::add('SYS_LANG', SYS_LANG);
|
$oHeadPublisher->assign('window.config.SYS_SERVER_AJAX', System::getServerProtocolHost());
|
||||||
ScriptVariables::add('TRANSLATIONS', $translation);
|
$oHeadPublisher->assign('window.config.SYS_WORKSPACE', config('system.workspace'));
|
||||||
ScriptVariables::add('FORMATS', $conf->getFormats());
|
$oHeadPublisher->assign('window.config.SYS_URI', SYS_URI);
|
||||||
ScriptVariables::add('userId', User::getId($_SESSION['USER_LOGGED']));
|
$oHeadPublisher->assign('window.config.SYS_LANG', SYS_LANG);
|
||||||
ScriptVariables::add('userConfig', array(
|
$oHeadPublisher->assign('window.config.TRANSLATIONS', $translation);
|
||||||
"usr_uid" => $_SESSION['USER_LOGGED']
|
$oHeadPublisher->assign('window.config.FORMATS', $conf->getFormats());
|
||||||
));
|
$oHeadPublisher->assign('window.config.userId', User::getId($_SESSION['USER_LOGGED']));
|
||||||
G::RenderPage("publish", "viena");
|
$oHeadPublisher->assign('window.config.userConfig', [
|
||||||
|
'usr_uid' => $_SESSION['USER_LOGGED']
|
||||||
|
]);
|
||||||
|
|
||||||
|
G::RenderPage('publish', 'viena');
|
||||||
@@ -3,9 +3,6 @@
|
|||||||
* Class SkinEngine
|
* Class SkinEngine
|
||||||
*
|
*
|
||||||
* This class load and dispatch the main systems layouts
|
* This class load and dispatch the main systems layouts
|
||||||
*
|
|
||||||
* @author Erik Amaru Ortiz <erik@colosa.com>
|
|
||||||
* @author Hugo Loza
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use ProcessMaker\Core\System;
|
use ProcessMaker\Core\System;
|
||||||
@@ -334,16 +331,18 @@ class SkinEngine
|
|||||||
|
|
||||||
echo $template->getOutputContent();
|
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'];
|
$templateFile = $this->layoutFile['dirname'] . PATH_SEP . $this->layoutFileViena['basename'];
|
||||||
if (file_exists($templateFile)) {
|
if (file_exists($templateFile)) {
|
||||||
$body = ScriptVariables::render();
|
$oHeadPublisher = headPublisher::getSingleton();
|
||||||
|
$header = $oHeadPublisher->getExtJsStylesheets($this->cssFileName . '-viena');
|
||||||
|
$body = $oHeadPublisher->getExtJsVariablesScript('');
|
||||||
|
|
||||||
$template = new TemplatePower($templateFile);
|
$template = new TemplatePower($templateFile);
|
||||||
$template->prepare();
|
$template->prepare();
|
||||||
$template->assign('header', $header);
|
$template->assign('header', $header);
|
||||||
@@ -351,7 +350,7 @@ class SkinEngine
|
|||||||
echo $template->getOutputContent();
|
echo $template->getOutputContent();
|
||||||
} else {
|
} else {
|
||||||
$userCanAccess = 1;
|
$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')) {
|
if (!defined('NO_DISPLAY_USERNAME')) {
|
||||||
define('NO_DISPLAY_USERNAME', 0);
|
define('NO_DISPLAY_USERNAME', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NO_DISPLAY_USERNAME == 0) {
|
if (NO_DISPLAY_USERNAME == 0) {
|
||||||
$smarty->assign('userfullname', isset($_SESSION['USR_FULLNAME']) ? $_SESSION['USR_FULLNAME'] : '');
|
$smarty->assign('userfullname', isset($_SESSION['USR_FULLNAME']) ? $_SESSION['USR_FULLNAME'] : '');
|
||||||
$smarty->assign('user', isset($_SESSION['USR_USERNAME']) ? '(' . $_SESSION['USR_USERNAME'] . ')' : '');
|
$smarty->assign('user', isset($_SESSION['USR_USERNAME']) ? '(' . $_SESSION['USR_USERNAME'] . ')' : '');
|
||||||
|
|||||||
Reference in New Issue
Block a user