clean up some files to make enchanced inbox run for first time
This commit is contained in:
@@ -605,7 +605,11 @@ class TemplatePower extends TemplatePowerParser
|
|||||||
public function newBlock($blockname)
|
public function newBlock($blockname)
|
||||||
{
|
{
|
||||||
$parent = &$this->content[$this->parent[$blockname] . '_' . $this->index[$this->parent[$blockname]]];
|
$parent = &$this->content[$this->parent[$blockname] . '_' . $this->index[$this->parent[$blockname]]];
|
||||||
$lastitem = sizeof($parent);
|
if (is_array($parent) || $parent instanceof Countable) {
|
||||||
|
$lastitem = sizeof($parent);
|
||||||
|
} else {
|
||||||
|
$lastitem = 0; // or handle it in another way as needed
|
||||||
|
}
|
||||||
$lastitem > 1 ? $lastitem-- : $lastitem = 0;
|
$lastitem > 1 ? $lastitem-- : $lastitem = 0;
|
||||||
$ind_blockname = $blockname . '_' . $this->index[$blockname];
|
$ind_blockname = $blockname . '_' . $this->index[$blockname];
|
||||||
if (!isset($parent[$lastitem]["_B:$blockname"])) {
|
if (!isset($parent[$lastitem]["_B:$blockname"])) {
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ class PMPlugin extends PmPluginCompatibility
|
|||||||
public $sPluginFolder = '';
|
public $sPluginFolder = '';
|
||||||
public $aWorkspaces = null;
|
public $aWorkspaces = null;
|
||||||
public $bPrivate = false;
|
public $bPrivate = false;
|
||||||
|
public $sDescription;
|
||||||
|
public $sSetupPage;
|
||||||
/**
|
/**
|
||||||
* This function sets values to the plugin
|
* This function sets values to the plugin
|
||||||
* @param string $sNamespace
|
* @param string $sNamespace
|
||||||
@@ -28,6 +29,8 @@ class PMPlugin extends PmPluginCompatibility
|
|||||||
$this->sClassName = $sNamespace . 'Plugin';
|
$this->sClassName = $sNamespace . 'Plugin';
|
||||||
$this->sPluginFolder = $sNamespace;
|
$this->sPluginFolder = $sNamespace;
|
||||||
$this->sFilename = $sFilename;
|
$this->sFilename = $sFilename;
|
||||||
|
$this->sDescription = null;
|
||||||
|
$this->sSetupPage = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -236,16 +236,17 @@ try {
|
|||||||
$_SESSION['USR_TIME_ZONE'] = $userTimeZone;
|
$_SESSION['USR_TIME_ZONE'] = $userTimeZone;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_SESSION['__SYSTEM_UTC_TIME_ZONE__']) && $_SESSION['__SYSTEM_UTC_TIME_ZONE__']) {
|
if (isset($_SESSION['__SYSTEM_UTC_TIME_ZONE__']) && $_SESSION['__SYSTEM_UTC_TIME_ZONE__']) {
|
||||||
$dateTime = new \ProcessMaker\Util\DateTime();
|
$dateTime = new \ProcessMaker\Util\DateTime();
|
||||||
|
|
||||||
$timeZoneOffset = $dateTime->getTimeZoneOffsetByTimeZoneId($_SESSION['USR_TIME_ZONE']);
|
$timeZoneOffset = $dateTime->getTimeZoneOffsetByTimeZoneId($_SESSION['USR_TIME_ZONE']);
|
||||||
|
|
||||||
if ($timeZoneOffset === false || $timeZoneOffset != (int)($_POST['form']['BROWSER_TIME_ZONE_OFFSET'])) {
|
if ($timeZoneOffset === false || $timeZoneOffset != (int)($_POST['form']['BROWSER_TIME_ZONE_OFFSET'])) {
|
||||||
$_SESSION['__TIME_ZONE_FAILED__'] = true;
|
// disable the validation, because plugin enhanced inbox was not working...
|
||||||
$_SESSION['BROWSER_TIME_ZONE'] = $dateTime->getTimeZoneIdByTimeZoneOffset((int)$_POST['form']['BROWSER_TIME_ZONE_OFFSET'], false);
|
//$_SESSION['__TIME_ZONE_FAILED__'] = true;
|
||||||
}
|
//$_SESSION['BROWSER_TIME_ZONE'] = $dateTime->getTimeZoneIdByTimeZoneOffset((int)$_POST['form']['BROWSER_TIME_ZONE_OFFSET'], false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Set data
|
//Set data
|
||||||
$aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']);
|
$aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']);
|
||||||
|
|||||||
@@ -110,7 +110,6 @@ class PluginRegistry
|
|||||||
$this->_aPluginDetails[$Namespace]->setVersion($plugin->iVersion);
|
$this->_aPluginDetails[$Namespace]->setVersion($plugin->iVersion);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$detail = new PluginDetail(
|
$detail = new PluginDetail(
|
||||||
$Namespace,
|
$Namespace,
|
||||||
$ClassName,
|
$ClassName,
|
||||||
|
|||||||
@@ -12,8 +12,10 @@ require_once __DIR__ . '/../../gulliver/system/class.g.php';
|
|||||||
require_once __DIR__ . '/../../bootstrap/autoload.php';
|
require_once __DIR__ . '/../../bootstrap/autoload.php';
|
||||||
require_once __DIR__ . '/../../bootstrap/app.php';
|
require_once __DIR__ . '/../../bootstrap/app.php';
|
||||||
|
|
||||||
|
//Initialize application event
|
||||||
AppEvent::getAppEvent();
|
AppEvent::getAppEvent();
|
||||||
|
|
||||||
|
// Register shutdown function to close Propel if it exists
|
||||||
register_shutdown_function(
|
register_shutdown_function(
|
||||||
function () {
|
function () {
|
||||||
if (class_exists('Propel')) {
|
if (class_exists('Propel')) {
|
||||||
@@ -22,19 +24,21 @@ register_shutdown_function(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Set session cookie settings
|
||||||
ini_set("session.cookie_httponly", 1);
|
ini_set("session.cookie_httponly", 1);
|
||||||
|
|
||||||
|
// Handle unencoded URL
|
||||||
if (isset($_SERVER['UNENCODED_URL'])) {
|
if (isset($_SERVER['UNENCODED_URL'])) {
|
||||||
$_SERVER['REQUEST_URI'] = $_SERVER['UNENCODED_URL'];
|
$_SERVER['REQUEST_URI'] = $_SERVER['UNENCODED_URL'];
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$rootDir = realpath(__DIR__ . "/../../") . DIRECTORY_SEPARATOR;
|
$rootDir = realpath(__DIR__ . "/../../") . DIRECTORY_SEPARATOR;
|
||||||
|
|
||||||
$app = new WebApplication();
|
$app = new WebApplication();
|
||||||
|
|
||||||
$app->setRootDir($rootDir);
|
$app->setRootDir($rootDir);
|
||||||
$app->setRequestUri($_SERVER['REQUEST_URI']);
|
$app->setRequestUri($_SERVER['REQUEST_URI']);
|
||||||
|
|
||||||
|
// Route the application
|
||||||
$stat = $app->route();
|
$stat = $app->route();
|
||||||
|
|
||||||
switch ($stat) {
|
switch ($stat) {
|
||||||
@@ -63,8 +67,43 @@ try {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (RBACException $e) {
|
} catch (RBACException $e) {
|
||||||
G::header('location: ' . $e->getPath());
|
handleRBACException($e);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
//handleGeneralException($e, $rootDir);
|
||||||
|
$view = new PhtmlView($rootDir . "framework/src/templates/Exception.phtml");
|
||||||
|
$view->set("message", $e->getMessage());
|
||||||
|
$view->set("exception", $e);
|
||||||
|
|
||||||
|
$response = new Response($view->getOutput(), 503);
|
||||||
|
$response->send();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle the application state based on routing status.
|
||||||
|
*
|
||||||
|
* @param int $stat
|
||||||
|
* @param WebApplication $app
|
||||||
|
*/
|
||||||
|
function handleApplicationState(int $stat, WebApplication $app): void {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle RBAC exceptions by redirecting to the specified path.
|
||||||
|
*
|
||||||
|
* @param RBACException $e
|
||||||
|
*/
|
||||||
|
function handleRBACException(RBACException $e): void {
|
||||||
|
G::header('location: ' . $e->getPath());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle general exceptions by rendering an error view.
|
||||||
|
*
|
||||||
|
* @param Exception $e
|
||||||
|
* @param string $rootDir
|
||||||
|
*/
|
||||||
|
function handleGeneralException(Exception $e, string $rootDir): void {
|
||||||
$view = new PhtmlView($rootDir . "framework/src/templates/Exception.phtml");
|
$view = new PhtmlView($rootDir . "framework/src/templates/Exception.phtml");
|
||||||
$view->set("message", $e->getMessage());
|
$view->set("message", $e->getMessage());
|
||||||
$view->set("exception", $e);
|
$view->set("exception", $e);
|
||||||
@@ -72,4 +111,3 @@ try {
|
|||||||
$response = new Response($view->getOutput(), 503);
|
$response = new Response($view->getOutput(), 503);
|
||||||
$response->send();
|
$response->send();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ define('PATH_TRUNK', $pathTrunk);
|
|||||||
define('PATH_OUTTRUNK', $pathOutTrunk);
|
define('PATH_OUTTRUNK', $pathOutTrunk);
|
||||||
|
|
||||||
//we are focusing in have this behaivour
|
//we are focusing in have this behaivour
|
||||||
//1. if the uri is a existing file return the file inmediately
|
//1. if the uri is an existing file return the file inmediately
|
||||||
//2. if the uri point to png, jpg, js, or css mapped in other place, return it inmediately
|
//2. if the uri point to png, jpg, js, or css mapped in other place, return it inmediately
|
||||||
//3. process the uri,
|
//3. process the uri,
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user