This commit is contained in:
Paula Quispe
2018-06-06 16:33:46 -04:00
426 changed files with 30423 additions and 48814 deletions

View File

@@ -0,0 +1,107 @@
<?php
use ProcessMaker\Core\System;
/**
* File Logs controller
* @inherits Controller
*
* @access public
*/
class FileLogs extends Controller
{
// Class properties
private $urlProxy;
private $credentials;
const version = '1.0';
// Class constructor
public function __construct()
{
global $RBAC;
if ($RBAC->userCanAccess('PM_SETUP_LOG_FILES') !== 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
exit(0);
}
$designer = new Designer();
$this->setCredentials(base64_encode(G::json_encode($designer->getCredentials())));
$this->setUrlProxy(System::getHttpServerHostnameRequestsFrontEnd() . '/api/' . self::version . '/' . config('system.workspace') . '/');
}
/**
* Return server host
*
* @return string
*/
public function getUrlProxy()
{
return $this->urlProxy;
}
/**
* Set server host
*
* @param string $urlProxy
*/
public function setUrlProxy($urlProxy)
{
$this->urlProxy = $urlProxy;
}
/**
* Get credential oauth
*
* @return string
*/
public function getCredentials()
{
return $this->credentials;
}
/**
* Set Credentials
*
* @param string $credentials
*/
public function setCredentials($credentials)
{
$this->credentials = $credentials;
}
/**
* Render list file logs
*/
public function fileList()
{
try {
global $RBAC;
if (isset($_SESSION['__FILE_LOGS_ERROR__'])) {
$this->setJSVar('__FILE_LOGS_ERROR__', $_SESSION['__FILE_LOGS_ERROR__']);
unset($_SESSION['__FILE_LOGS_ERROR__']);
}
$this->setView('fileLogs/list');
$c = new Configurations();
$configPage = $c->getConfiguration('usersList', 'pageSize', null, $RBAC->aUserInfo['USER_INFO']['USR_UID']);
$config = [];
$config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
$this->setJSVar('urlProxy', $this->getUrlProxy());
$this->setJSVar('credentials', $this->getCredentials());
$this->setJSVar('CONFIG', $config);
$this->includeExtJS('fileLogs/list');
G::RenderPage('publish', 'extJs');
} catch (Exception $error) {
$_SESSION['__FILE_LOGS_ERROR__'] = $error->getMessage();
die();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -152,7 +152,7 @@ class adminProxy extends HttpProxyController
try {
$uRole = $oRoles->loadByCode($row['USR_ROLE']);
} catch (exception $oError) {
$uRole['ROL_NAME'] = G::loadTranslation( 'ID_DELETED' );
$uRole['ROL_NAME'] = G::loadTranslation('ID_DELETED');
}
$row['USR_ROLE_ID'] = $row['USR_ROLE'];
$row['USR_ROLE'] = isset($uRole['ROL_NAME']) ? ($uRole['ROL_NAME'] != '' ? $uRole['ROL_NAME'] : $uRole['USR_ROLE']) : $uRole['USR_ROLE'];
@@ -178,11 +178,11 @@ class adminProxy extends HttpProxyController
$oldName = isset($_POST['oldName'])? $_POST['oldName']:'';
$uid = isset($_POST['uid'])? $_POST['uid']:'';
switch ($_POST['action']){
switch ($_POST['action']) {
case 'calendarName':
require_once ('classes/model/CalendarDefinition.php');
require_once('classes/model/CalendarDefinition.php');
$oCalendar = new CalendarDefinition();
$aCalendars = $oCalendar->getCalendarList(false,true);
$aCalendars = $oCalendar->getCalendarList(false, true);
$aCalendarDefinitions = end($aCalendars);
foreach ($aCalendarDefinitions as $aDefinitions) {
@@ -193,7 +193,6 @@ class adminProxy extends HttpProxyController
}
if (isset($aDefinitions['CALENDAR_NAME'])) {
if ($aDefinitions['CALENDAR_UID'] != $uid) {
if ($aDefinitions['CALENDAR_NAME'] == $_POST['name']) {
$validated = false;
@@ -312,7 +311,6 @@ class adminProxy extends HttpProxyController
$data['success'] = true;
$data['optionAuthS'] = htmlspecialchars($params->optionAuthS);
return $data;
}
/**
@@ -415,7 +413,7 @@ class adminProxy extends HttpProxyController
$passwdHide = '';
}
$passwdDec = G::decrypt($passwd,'EMAILENCRYPT');
$passwdDec = G::decrypt($passwd, 'EMAILENCRYPT');
$auxPass = explode('hash:', $passwdDec);
if (count($auxPass) > 1) {
if (count($auxPass) == 2) {
@@ -498,7 +496,7 @@ class adminProxy extends HttpProxyController
if (strtoupper($UseSecureCon) == 'TLS') {
$smtp->Hello($hello);
}
if ($smtp->Authenticate($user, $passwd) ) {
if ($smtp->Authenticate($user, $passwd)) {
$this->success = true;
} else {
if (strtoupper($UseSecureCon) == 'TLS') {
@@ -671,7 +669,7 @@ class adminProxy extends HttpProxyController
$aFields['MESS_PASSWORD_HIDDEN'] = '';
$passwd = $aFields['MESS_PASSWORD'];
$passwdDec = G::decrypt($passwd,'EMAILENCRYPT');
$passwdDec = G::decrypt($passwd, 'EMAILENCRYPT');
$auxPass = explode('hash:', $passwdDec);
if (count($auxPass) > 1) {
if (count($auxPass) == 2) {
@@ -685,7 +683,7 @@ class adminProxy extends HttpProxyController
if ($aFields['MESS_PASSWORD'] != '') {
$aFields['MESS_PASSWORD'] = 'hash:'.$aFields['MESS_PASSWORD'];
$aFields['MESS_PASSWORD'] = G::encrypt($aFields['MESS_PASSWORD'],'EMAILENCRYPT');
$aFields['MESS_PASSWORD'] = G::encrypt($aFields['MESS_PASSWORD'], 'EMAILENCRYPT');
}
$aFields['MESS_ENABLED'] = isset($_POST['EnableEmailNotifications']) ? $_POST['EnableEmailNotifications'] : '';
@@ -718,7 +716,7 @@ class adminProxy extends HttpProxyController
if ($oConfiguration->exists($CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid)) {
$oConfiguration->update(
array (
array(
'CFG_UID' => 'Emails',
'OBJ_UID' => '',
'CFG_VALUE' => serialize($aFields),
@@ -758,12 +756,12 @@ class adminProxy extends HttpProxyController
public function loadFields()
{
$oConfiguration = new Configurations();
$oConfiguration->loadConfig($x, 'Emails','','','','');
$oConfiguration->loadConfig($x, 'Emails', '', '', '', '');
$fields = $oConfiguration->aConfig;
if (count($fields) > 0) {
$this->success = (count($fields) > 0);
$passwd = $fields['MESS_PASSWORD'];
$passwdDec = G::decrypt($passwd,'EMAILENCRYPT');
$passwdDec = G::decrypt($passwd, 'EMAILENCRYPT');
$auxPass = explode('hash:', $passwdDec);
if (count($auxPass) > 1) {
if (count($auxPass) == 2) {
@@ -790,9 +788,9 @@ class adminProxy extends HttpProxyController
$aPhotoSelect = $upload->getNameLogo($_SESSION['USER_LOGGED']);
$sPhotoSelect = trim($aPhotoSelect['DEFAULT_LOGO_NAME']);
$check = '';
$ainfoSite = explode("/",$_SERVER["REQUEST_URI"]);
$ainfoSite = explode("/", $_SERVER["REQUEST_URI"]);
$dir = PATH_DATA . "sites" . PATH_SEP . str_replace("sys", "", $ainfoSite[1]) . PATH_SEP . "files/logos";
G::mk_dir ( $dir );
G::mk_dir($dir);
$i = 0;
$images = array();
@@ -804,7 +802,7 @@ class adminProxy extends HttpProxyController
$extention = explode(".", $file);
$aImageProp = getimagesize($dir . '/' . $file, $info);
$sfileExtention = strtoupper($extention[count($extention)-1]);
if ( in_array($sfileExtention, array('JPG', 'JPEG', 'PNG', 'GIF') ) ) {
if (in_array($sfileExtention, array('JPG', 'JPEG', 'PNG', 'GIF'))) {
$check = (!strcmp($file, $sPhotoSelect)) ? '/images/toadd.png' : '/images/delete.png';
$onclick = (strcmp($file, $sPhotoSelect)) ? "onclick ='deleteLogo(\" $file \");return false;'" : '';
if ($i == 0) {
@@ -905,8 +903,18 @@ class adminProxy extends HttpProxyController
}
}
$img_new = imagecreatetruecolor($tmp_width, $tmp_height);
imagecopyresampled($img_new, $img_src, 0, 0, 0, 0,
$tmp_width, $tmp_height, $img_width, $img_height);
imagecopyresampled(
$img_new,
$img_src,
0,
0,
0,
0,
$tmp_width,
$tmp_height,
$img_width,
$img_height
);
// create temporary thumbnail and locate on the server
$thumb = $thumb_path."thumb_".$img_file;
@@ -953,19 +961,43 @@ class adminProxy extends HttpProxyController
$x_src = ($thumb_width - $square_size) / 2;
$y_src = 0;
$img_final = imagecreatetruecolor($square_size, $square_size);
imagecopy($img_final, $img_thumb_square, 0, 0,
$x_src, $y_src, $square_size, $square_size);
imagecopy(
$img_final,
$img_thumb_square,
0,
0,
$x_src,
$y_src,
$square_size,
$square_size
);
} elseif ($thumb_height > $thumb_width) {
// landscape
$x_src = 0;
$y_src = ($thumb_height - $square_size) / 2;
$img_final = imagecreatetruecolor($square_size, $square_size);
imagecopy($img_final, $img_thumb_square, 0, 0,
$x_src, $y_src, $square_size, $square_size);
imagecopy(
$img_final,
$img_thumb_square,
0,
0,
$x_src,
$y_src,
$square_size,
$square_size
);
} else {
$img_final = imagecreatetruecolor($square_size, $square_size);
imagecopy($img_final, $img_thumb_square, 0, 0,
0, 0, $square_size, $square_size);
imagecopy(
$img_final,
$img_thumb_square,
0,
0,
0,
0,
$square_size,
$square_size
);
}
switch ($img_type) {
@@ -1000,7 +1032,7 @@ class adminProxy extends HttpProxyController
$_FILES = $filter->xssFilterHard($_FILES);
$ainfoSite = explode("/", $_SERVER["REQUEST_URI"]);
$dir = PATH_DATA."sites".PATH_SEP.str_replace("sys","",$ainfoSite[1]).PATH_SEP."files/logos";
$dir = PATH_DATA."sites".PATH_SEP.str_replace("sys", "", $ainfoSite[1]).PATH_SEP."files/logos";
global $_FILES;
//| 0-> non fail
@@ -1029,7 +1061,7 @@ class adminProxy extends HttpProxyController
$files_img_type = $_FILES['img']['type'];
if (in_array($files_img_type, $allowedType)) {
// max upload file is 500 KB
// max upload file is 500 KB
if ($_FILES['img']['size'] <= 500000) {
$formf = $_FILES['img'];
$namefile = $formf['name'];
@@ -1061,7 +1093,7 @@ class adminProxy extends HttpProxyController
$failed = "3";
}
$u = self::hashunlink;
$u ($dir . '/tmp' . $fileName);
$u($dir . '/tmp' . $fileName);
} catch (Exception $e) {
$failed = "3";
}
@@ -1071,9 +1103,9 @@ class adminProxy extends HttpProxyController
} elseif ($files_img_type != '') {
$failed = "1";
}
$uploaded = $filter->validateInput($uploaded,'int');
$uploaded = $filter->validateInput($uploaded, 'int');
$files_img_type = $filter->xssFilterHard($files_img_type);
$failed = $filter->validateInput($failed,'int');
$failed = $filter->validateInput($failed, 'int');
$resp = array(
'success' => true,
'failed' => $failed,
@@ -1106,7 +1138,7 @@ class adminProxy extends HttpProxyController
$arrayImg = explode(";", $_POST['selectLogo']);
foreach ($arrayImg as $imgname) {
if ($imgname != "") {
if ( strcmp($imgname, self::getNameCurrentLogo()) == 0 ) {
if (strcmp($imgname, self::getNameCurrentLogo()) == 0) {
echo '{success: true}';
exit();
}
@@ -1136,12 +1168,12 @@ class adminProxy extends HttpProxyController
$arrayImg = explode(";", $_POST['images']);
foreach ($arrayImg as $imgname) {
if ($imgname != "") {
if ( strcmp($imgname, self::getNameCurrentLogo()) != 0 ) {
if (strcmp($imgname, self::getNameCurrentLogo()) != 0) {
if (file_exists($dir . '/' . $imgname)) {
unlink ($dir . '/' . $imgname);
unlink($dir . '/' . $imgname);
}
if (file_exists($dir . '/tmp' . $imgname)) {
unlink ($dir . '/tmp' . $imgname);
unlink($dir . '/tmp' . $imgname);
}
G::auditLog("DeleteLogo", "File Name: ".$imgname);
} else {
@@ -1201,7 +1233,7 @@ class adminProxy extends HttpProxyController
case 'restoreLogo':
$snameLogo = $_GET['NAMELOGO'];
$oConf = new Configurations;
$aConf = Array(
$aConf = array(
'WORKSPACE_LOGO_NAME' => '',
'DEFAULT_LOGO_NAME' => ''
);
@@ -1215,7 +1247,7 @@ class adminProxy extends HttpProxyController
} catch (Exception $oException) {
$token = strtotime("now");
PMException::registerErrorLog($oException, $token);
G::outRes( G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)) );
G::outRes(G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)));
die;
}
exit();
@@ -1257,7 +1289,7 @@ class adminProxy extends HttpProxyController
$extention = explode(".", $file);
$aImageProp = getimagesize($dir . '/' . $file, $info);
$sfileExtention = strtoupper($extention[count($extention)-1]);
if ( in_array($sfileExtention, array('JPG', 'JPEG', 'PNG', 'GIF') ) ) {
if (in_array($sfileExtention, array('JPG', 'JPEG', 'PNG', 'GIF'))) {
$dir1 = $dir . PATH_SEP . $file;
$dir2 = $newDir . PATH_SEP . $file;
copy($dir1, $dir2);
@@ -1297,7 +1329,7 @@ class adminProxy extends HttpProxyController
$filter = new InputFilter();
$dir = $filter->validateInput($dir, "path");
copy($dir,$newDir);
copy($dir, $newDir);
self::showLogo($newDir);
die;
}
@@ -1338,14 +1370,13 @@ class adminProxy extends HttpProxyController
$result = array();
try {
$pmRestClient = OauthClientsPeer::retrieveByPK('x-pm-local-client');
if (! empty($pmRestClient)) {
$pmRestClient->delete();
}
$http = G::is_https() ? 'https' : 'http';
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
$host = $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '');
$endpoint = sprintf(
@@ -1376,14 +1407,14 @@ class adminProxy extends HttpProxyController
return $result;
}
public function generateInfoSupport ()
public function generateInfoSupport()
{
require_once (PATH_CONTROLLERS . "InstallerModule.php");
$params = array ();
$oServerConf = &ServerConf::getSingleton();
$oServerConf = ServerConf::getSingleton();
$pluginRegistry = PluginRegistry::loadSingleton();
$licenseManager = &PmLicenseManager::getSingleton();
$licenseManager = PmLicenseManager::getSingleton();
//License Information:
$activeLicense = $licenseManager->getActiveLicense();
@@ -1399,11 +1430,11 @@ class adminProxy extends HttpProxyController
//Operative System version (Linux, Windows)
try {
$os = '';
if (file_exists( '/etc/redhat-release' )) {
$fnewsize = filesize( '/etc/redhat-release' );
$fp = fopen( '/etc/redhat-release', 'r' );
$os = trim( fread( $fp, $fnewsize ) );
fclose( $fp );
if (file_exists('/etc/redhat-release')) {
$fnewsize = filesize('/etc/redhat-release');
$fp = fopen('/etc/redhat-release', 'r');
$os = trim(fread($fp, $fnewsize));
fclose($fp);
}
$os .= " (" . PHP_OS . ")";
} catch (Exception $e) {
@@ -1426,7 +1457,12 @@ class adminProxy extends HttpProxyController
$installer = new InstallerModule();
$systemInfo = $installer->getSystemInfo();
try {
$params['mysql'] = mysql_get_server_info();
$con = Propel::getConnection('workflow');
$con = $con->getResource();
$output = mysqli_get_server_info($con);
preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);
$params['mysql'] = $version[0];
} catch (Exception $e) {
$params['mysql'] = '';
}
@@ -1439,19 +1475,19 @@ class adminProxy extends HttpProxyController
$params['serverSoftwareVersion'] = System::getServerVersion();
//Installed Plugins (license info?)
$arrayAddon = array ();
$arrayAddon = array();
if (file_exists( PATH_DATA_SITE . "ee" )) {
$arrayAddon = unserialize( trim( file_get_contents( PATH_DATA_SITE . "ee" ) ) );
if (file_exists(PATH_DATA_SITE . "ee")) {
$arrayAddon = unserialize(trim(file_get_contents(PATH_DATA_SITE . "ee")));
}
$plugins = array();
foreach ($arrayAddon as $addon) {
$sFileName = substr( $addon["sFilename"], 0, strpos( $addon["sFilename"], "-" ) );
$sFileName = substr($addon["sFilename"], 0, strpos($addon["sFilename"], "-"));
if (file_exists( PATH_PLUGINS . $sFileName . ".php" )) {
if (file_exists(PATH_PLUGINS . $sFileName . ".php")) {
$plugin = array();
$addonDetails = $pluginRegistry->getPluginDetails( $sFileName . ".php" );
$addonDetails = $pluginRegistry->getPluginDetails($sFileName . ".php");
$plugin['name'] = $addonDetails->getNamespace();
$plugin['description'] = $addonDetails->getDescription();
$plugin['version'] = $addonDetails->getVersion();
@@ -1462,14 +1498,14 @@ class adminProxy extends HttpProxyController
$params['pl'] = $plugins;
//Number of Users registered in PM. Including LDAP users and PM users.
require_once ("classes/model/RbacUsers.php");
$criteria = new Criteria( "rbac" );
$criteria->addSelectColumn( RbacUsersPeer::USR_AUTH_TYPE );
$criteria->addSelectColumn( "COUNT(".RbacUsersPeer::USR_UID . ") AS USERS_NUMBER" );
$criteria->add( RbacUsersPeer::USR_UID, null, Criteria::ISNOTNULL );
require_once("classes/model/RbacUsers.php");
$criteria = new Criteria("rbac");
$criteria->addSelectColumn(RbacUsersPeer::USR_AUTH_TYPE);
$criteria->addSelectColumn("COUNT(".RbacUsersPeer::USR_UID . ") AS USERS_NUMBER");
$criteria->add(RbacUsersPeer::USR_UID, null, Criteria::ISNOTNULL);
$criteria->addGroupByColumn(RbacUsersPeer::USR_AUTH_TYPE);
$rs = RbacUsersPeer::doSelectRS( $criteria );
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs = RbacUsersPeer::doSelectRS($criteria);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$users = array('local' => 0);
while ($rs->next()) {
$row = $rs->getRow();
@@ -1487,12 +1523,12 @@ class adminProxy extends HttpProxyController
$params['c'] = $maxNumber - 1;
//Number of active processes.
$criteria = new Criteria( "workflow" );
$criteria->addSelectColumn( ProcessPeer::PRO_STATUS );
$criteria->addSelectColumn( "COUNT(PROCESS.PRO_UID) AS NUMBER_PROCESS" );
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(ProcessPeer::PRO_STATUS);
$criteria->addSelectColumn("COUNT(PROCESS.PRO_UID) AS NUMBER_PROCESS");
$criteria->addGroupByColumn(ProcessPeer::PRO_STATUS);
$rs = UsersPeer::doSelectRS( $criteria );
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs = UsersPeer::doSelectRS($criteria);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$process = array();
while ($rs->next()) {
$row = $rs->getRow();
@@ -1551,4 +1587,4 @@ class adminProxy extends HttpProxyController
}
}
}
}
}

View File

@@ -21,7 +21,6 @@ class Designer extends Controller
public function __construct()
{
}
/**
@@ -43,7 +42,7 @@ class Designer extends Controller
$distribution = 0;
/*----------------------------------********---------------------------------*/
$licensedFeatures = &PMLicensedFeatures::getSingleton();
$licensedFeatures = PMLicensedFeatures::getSingleton();
if ($licensedFeatures->verifyfeature('7TTeDBQeWRoZTZKYjh4eFpYUlRDUUEyVERPU3FxellWank=')) {
$consolidated = 1;
}

View File

@@ -28,28 +28,28 @@ class Home extends Controller
/**
* Check the if the user has permissions over functions
*/
public function call ($name)
public function call($name)
{
global $RBAC;
$RBAC->allows(basename(__FILE__), $name);
parent::call($name);
}
public function __construct ()
public function __construct()
{
// setting client browser information
$this->clientBrowser = G::getBrowser();
// getting the ux type from user o group conf.
$this->userUxType = isset( $_SESSION['user_experience'] ) ? $_SESSION['user_experience'] : 'SIMPLIFIED';
$this->lastSkin = isset( $_SESSION['user_last_skin'] ) ? $_SESSION['user_last_skin'] : 'neoclassic';
$this->userUxBaseTemplate = (is_dir( PATH_CUSTOM_SKINS . 'uxs' )) ? PATH_CUSTOM_SKINS . 'simplified' . PATH_SEP . 'templates' : 'home';
$this->userUxType = isset($_SESSION['user_experience']) ? $_SESSION['user_experience'] : 'SIMPLIFIED';
$this->lastSkin = isset($_SESSION['user_last_skin']) ? $_SESSION['user_last_skin'] : 'neoclassic';
$this->userUxBaseTemplate = (is_dir(PATH_CUSTOM_SKINS . 'uxs')) ? PATH_CUSTOM_SKINS . 'simplified' . PATH_SEP . 'templates' : 'home';
if (isset( $_SESSION['USER_LOGGED'] ) && ! empty( $_SESSION['USER_LOGGED'] )) {
$this->userUid = isset( $_SESSION['USER_LOGGED'] ) ? $_SESSION['USER_LOGGED'] : null;
$this->userName = isset( $_SESSION['USR_USERNAME'] ) ? $_SESSION['USR_USERNAME'] : '';
$this->userFullName = isset( $_SESSION['USR_FULLNAME'] ) ? $_SESSION['USR_FULLNAME'] : '';
$this->userRolName = isset( $_SESSION['USR_ROLENAME'] ) ? $_SESSION['USR_ROLENAME'] : '';
if (isset($_SESSION['USER_LOGGED']) && ! empty($_SESSION['USER_LOGGED'])) {
$this->userUid = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : null;
$this->userName = isset($_SESSION['USR_USERNAME']) ? $_SESSION['USR_USERNAME'] : '';
$this->userFullName = isset($_SESSION['USR_FULLNAME']) ? $_SESSION['USR_FULLNAME'] : '';
$this->userRolName = isset($_SESSION['USR_ROLENAME']) ? $_SESSION['USR_ROLENAME'] : '';
$users = new Users();
$users = $users->load($this->userUid);
@@ -57,34 +57,34 @@ class Home extends Controller
}
}
public function login ($httpData)
public function login($httpData)
{
//start new session
@session_destroy();
session_start();
session_regenerate_id();
$data = isset( $httpData->d ) ? unserialize( base64_decode( $httpData->d ) ) : '';
$data = isset($httpData->d) ? unserialize(base64_decode($httpData->d)) : '';
$template = $this->clientBrowser['name'] == 'msie' ? 'login_ie' : 'login_standard';
$skin = $this->clientBrowser['name'] == 'msie' ? $this->lastSkin : 'simplified';
if (! is_array( $data )) {
$data = array (
if (! is_array($data)) {
$data = array(
'u' => '',
'p' => '',
'm' => ''
);
}
$this->setVar( 'msg', $data['m'] );
$this->setVar( 'usr', $data['u'] );
$this->setVar( 'pwd', $data['p'] );
$this->setVar('timeZoneFailed', (isset($data['timeZoneFailed']))? $data['timeZoneFailed'] : 0);
$this->setVar('userTimeZone', (isset($data['userTimeZone']))? $data['userTimeZone'] : '');
$this->setVar('msg', $data['m']);
$this->setVar('usr', $data['u']);
$this->setVar('pwd', $data['p']);
$this->setVar('timeZoneFailed', (isset($data['timeZoneFailed']))? $data['timeZoneFailed'] : 0);
$this->setVar('userTimeZone', (isset($data['userTimeZone']))? $data['userTimeZone'] : '');
$this->setVar('browserTimeZone', (isset($data['browserTimeZone']))? $data['browserTimeZone'] : '');
$this->setVar( 'skin', $skin );
$this->setVar('skin', $skin);
$this->setView( $this->userUxBaseTemplate . PATH_SEP . $template );
$this->setView($this->userUxBaseTemplate . PATH_SEP . $template);
$this->render();
}
@@ -94,26 +94,26 @@ class Home extends Controller
* @param string $httpData (opional)
*/
public function index ($httpData)
public function index($httpData)
{
if ($this->userUxType == 'SINGLE') {
$this->indexSingle( $httpData );
$this->indexSingle($httpData);
return;
}
$userProperty = new UsersProperties();
$process = new Process();
$case = new Cases();
$sysConf = System::getSystemConfiguration( PATH_CONFIG . 'env.ini' );
$sysConf = System::getSystemConfiguration(PATH_CONFIG . 'env.ini');
//Get ProcessStatistics Info
$start = 0;
$limit = '';
$proData = $process->getAllProcesses( $start, $limit, null, null, false, true );
$processList = $case->getStartCasesPerType( $_SESSION['USER_LOGGED'], 'category' );
$proData = $process->getAllProcesses($start, $limit, null, null, false, true);
$processList = $case->getStartCasesPerType($_SESSION['USER_LOGGED'], 'category');
$processesList = array ();
$processesList = array();
foreach ($processList as $key => $valueProcess) {
foreach ($proData as $keyPro => $valuePro) {
@@ -126,18 +126,18 @@ class Home extends Controller
}
}
$switchLink = $userProperty->getUserLocation( $_SESSION['USER_LOGGED'], SYS_LANG );
$switchLink = $userProperty->getUserLocation($_SESSION['USER_LOGGED'], SYS_LANG);
if (!isset($_COOKIE['workspaceSkin'])) {
if (substr( $sysConf['default_skin'], 0, 2 ) == 'ux') {
if (substr($sysConf['default_skin'], 0, 2) == 'ux') {
$_SESSION['_defaultUserLocation'] = $switchLink;
$switchLink = '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . $sysConf['default_skin'] . '/main';
}
}
$oServerConf = & ServerConf::getSingleton();
$oServerConf = ServerConf::getSingleton();
if ($oServerConf->isRtl( SYS_LANG )) {
if ($oServerConf->isRtl(SYS_LANG)) {
$swRtl = 1;
} else {
$swRtl = 0;
@@ -147,13 +147,13 @@ class Home extends Controller
global $G_TMP_MENU;
$mnu = new Menu();
$mnu->load( 'simplified' );
$arrayMnuOption = array ();
$mnuNewCase = array ();
$mnu->load('simplified');
$arrayMnuOption = array();
$mnuNewCase = array();
if (! empty( $mnu->Options )) {
if (! empty($mnu->Options)) {
foreach ($mnu->Options as $index => $value) {
$option = array ('id' => $mnu->Id[$index],'url' => $mnu->Options[$index],'label' => $mnu->Labels[$index],'icon' => $mnu->Icons[$index],'class' => $mnu->ElementClass[$index]
$option = array('id' => $mnu->Id[$index],'url' => $mnu->Options[$index],'label' => $mnu->Labels[$index],'icon' => $mnu->Icons[$index],'class' => $mnu->ElementClass[$index]
);
if ($mnu->Id[$index] != 'S_NEW_CASE') {
@@ -164,30 +164,29 @@ class Home extends Controller
}
}
$this->setView( $this->userUxBaseTemplate . PATH_SEP . 'index' );
$this->setView($this->userUxBaseTemplate . PATH_SEP . 'index');
$this->setVar( 'usrUid', $this->userUid );
$this->setVar( 'userName', $this->userName );
$this->setVar( 'processList', $processesList );
$this->setVar( 'canStartCase', $case->canStartCase( $_SESSION['USER_LOGGED'] ) );
$this->setVar( 'userUxType', $this->userUxType );
$this->setVar( 'clientBrowser', $this->clientBrowser['name'] );
$this->setVar( 'switchLink', $switchLink );
$this->setVar( 'arrayMnuOption', $arrayMnuOption );
$this->setVar( 'mnuNewCase', $mnuNewCase );
$this->setVar( 'rtl', $swRtl );
$this->setVar('usrUid', $this->userUid);
$this->setVar('userName', $this->userName);
$this->setVar('processList', $processesList);
$this->setVar('canStartCase', $case->canStartCase($_SESSION['USER_LOGGED']));
$this->setVar('userUxType', $this->userUxType);
$this->setVar('clientBrowser', $this->clientBrowser['name']);
$this->setVar('switchLink', $switchLink);
$this->setVar('arrayMnuOption', $arrayMnuOption);
$this->setVar('mnuNewCase', $mnuNewCase);
$this->setVar('rtl', $swRtl);
$this->render();
}
public function indexSingle ($httpData)
public function indexSingle($httpData)
{
$step = new Step();
$solrEnabled = false;
if (($solrConf = System::solrEnv()) !== false) {
$ApplicationSolrIndex = new AppSolr(
$solrConf["solr_enabled"],
$solrConf["solr_host"],
@@ -198,7 +197,7 @@ class Home extends Controller
//Check if there are missing records to reindex and reindex them
$ApplicationSolrIndex->synchronizePendingApplications();
$solrEnabled = true;
} else{
} else {
$solrEnabled = false;
}
}
@@ -206,16 +205,15 @@ class Home extends Controller
if ($solrEnabled) {
$cases = $ApplicationSolrIndex->getAppGridData($this->userUid, 0, 1, 'todo');
} else {
$apps = new Applications();
$cases = $apps->getAll( $this->userUid, 0, 1, 'todo' );
$cases = $apps->getAll($this->userUid, 0, 1, 'todo');
}
if (! isset( $cases['data'][0] )) {
if (! isset($cases['data'][0])) {
//the current user has not any aplication to do
$this->setView( $this->userUxBaseTemplate . PATH_SEP . 'indexSingle' );
$this->setVar( 'default_url', $this->userUxBaseTemplate . "/" . 'error?no=2' );
$this->setView($this->userUxBaseTemplate . PATH_SEP . 'indexSingle');
$this->setVar('default_url', $this->userUxBaseTemplate . "/" . 'error?no=2');
$this->render();
exit();
}
@@ -226,25 +224,25 @@ class Home extends Controller
$_SESSION['PROCESS'] = $lastApp['PRO_UID'];
$_SESSION['TASK'] = $lastApp['TAS_UID'];
$steps = $apps->getSteps( $lastApp['APP_UID'], $lastApp['DEL_INDEX'], $lastApp['TAS_UID'], $lastApp['PRO_UID'] );
$lastStep = array_pop( $steps );
$lastStep['title'] = G::LoadTranslation( 'ID_FINISH' );
$steps = $apps->getSteps($lastApp['APP_UID'], $lastApp['DEL_INDEX'], $lastApp['TAS_UID'], $lastApp['PRO_UID']);
$lastStep = array_pop($steps);
$lastStep['title'] = G::LoadTranslation('ID_FINISH');
$steps[] = $lastStep;
$this->setView( $this->userUxBaseTemplate . PATH_SEP . 'indexSingle' );
$this->setView($this->userUxBaseTemplate . PATH_SEP . 'indexSingle');
$this->setVar( 'usrUid', $this->userUid );
$this->setVar( 'userName', $this->userName );
$this->setVar( 'steps', $steps );
$this->setVar( 'default_url', "cases/cases_Open?APP_UID={$lastApp['APP_UID']}&DEL_INDEX={$lastApp['DEL_INDEX']}&action=todo" );
$this->setVar('usrUid', $this->userUid);
$this->setVar('userName', $this->userName);
$this->setVar('steps', $steps);
$this->setVar('default_url', "cases/cases_Open?APP_UID={$lastApp['APP_UID']}&DEL_INDEX={$lastApp['DEL_INDEX']}&action=todo");
$this->render();
}
public function appList ($httpData)
public function appList($httpData)
{
// setting default list applications types [default: todo]
$httpData->t = isset( $httpData->t ) ? $httpData->t : 'todo';
$httpData->t = isset($httpData->t) ? $httpData->t : 'todo';
// setting main list title
switch ($httpData->t) {
@@ -258,34 +256,34 @@ class Home extends Controller
$title = G::LoadTranslation("ID_UNASSIGNED_INBOX");
break;
default:
$title = ucwords( $httpData->t );
$title = ucwords($httpData->t);
break;
}
// getting apps data
$cases = $this->getAppsData( $httpData->t );
$cases = $this->getAppsData($httpData->t);
// settings html template
$this->setView( $this->userUxBaseTemplate . PATH_SEP . 'appList' );
$this->setView($this->userUxBaseTemplate . PATH_SEP . 'appList');
// settings vars and rendering
$this->setVar( 'cases', $cases['data'] );
$this->setVar( 'title', $title );
$this->setVar( 'noPerms', G::LoadTranslation( 'ID_CASES_NOTES_NO_PERMISSIONS' ));
$this->setVar( 'appListStart', $this->appListLimit );
$this->setVar( 'appListLimit', 10 );
$this->setVar( 'listType', $httpData->t );
$this->setVar('cases', $cases['data']);
$this->setVar('title', $title);
$this->setVar('noPerms', G::LoadTranslation('ID_CASES_NOTES_NO_PERMISSIONS'));
$this->setVar('appListStart', $this->appListLimit);
$this->setVar('appListLimit', 10);
$this->setVar('listType', $httpData->t);
$this->render();
}
public function appAdvancedSearch ($httpData)
public function appAdvancedSearch($httpData)
{
$title = G::LoadTranslation("ID_ADVANCEDSEARCH");
$httpData->t = 'search';
// settings html template
$this->setView( $this->userUxBaseTemplate . PATH_SEP . 'appListSearch' );
$this->setView($this->userUxBaseTemplate . PATH_SEP . 'appListSearch');
// get data
$process = (isset($httpData->process)) ? $httpData->process : null;
@@ -324,44 +322,44 @@ class Home extends Controller
$arraySearch = array($process, $status, $search, $category, $user, $dateFrom, $dateTo );
// settings vars and rendering
$this->setVar( 'statusValues', $this->getStatusArray( $httpData->t, $this->userUid) );
$this->setVar( 'categoryValues', $this->getCategoryArray() );
$this->setVar( 'allUsersValues', $this->getAllUsersArray( 'search' ) );
$this->setVar( 'categoryTitle', G::LoadTranslation("ID_CATEGORY") );
$this->setVar( 'processTitle', G::LoadTranslation("ID_PROCESS") );
$this->setVar( 'statusTitle', G::LoadTranslation("ID_STATUS") );
$this->setVar( 'searchTitle', G::LoadTranslation("ID_SEARCH") );
$this->setVar( 'userTitle', G::LoadTranslation("ID_USER") );
$this->setVar( 'fromTitle', G::LoadTranslation("ID_DELEGATE_DATE_FROM") );
$this->setVar( 'toTitle', G::LoadTranslation("ID_DELEGATE_DATE_TO") );
$this->setVar( 'filterTitle', G::LoadTranslation("ID_FILTER") );
$this->setVar( 'arraySearch', $arraySearch );
$this->setVar('statusValues', $this->getStatusArray($httpData->t, $this->userUid));
$this->setVar('categoryValues', $this->getCategoryArray());
$this->setVar('allUsersValues', $this->getAllUsersArray('search'));
$this->setVar('categoryTitle', G::LoadTranslation("ID_CATEGORY"));
$this->setVar('processTitle', G::LoadTranslation("ID_PROCESS"));
$this->setVar('statusTitle', G::LoadTranslation("ID_STATUS"));
$this->setVar('searchTitle', G::LoadTranslation("ID_SEARCH"));
$this->setVar('userTitle', G::LoadTranslation("ID_USER"));
$this->setVar('fromTitle', G::LoadTranslation("ID_DELEGATE_DATE_FROM"));
$this->setVar('toTitle', G::LoadTranslation("ID_DELEGATE_DATE_TO"));
$this->setVar('filterTitle', G::LoadTranslation("ID_FILTER"));
$this->setVar('arraySearch', $arraySearch);
$this->setVar( 'cases', $cases['data'] );
$this->setVar( 'title', $title );
$this->setVar( 'noPerms', G::LoadTranslation( 'ID_CASES_NOTES_NO_PERMISSIONS' ));
$this->setVar( 'appListStart', $this->appListLimit );
$this->setVar( 'appListLimit', 10 );
$this->setVar( 'listType', $httpData->t );
$this->setVar('cases', $cases['data']);
$this->setVar('title', $title);
$this->setVar('noPerms', G::LoadTranslation('ID_CASES_NOTES_NO_PERMISSIONS'));
$this->setVar('appListStart', $this->appListLimit);
$this->setVar('appListLimit', 10);
$this->setVar('listType', $httpData->t);
$this->setVar( 'processCurrentTitle', $processTitle );
$this->setVar( 'userCurrentName', $userName );
$this->setVar( 'currentUserLabel', G::LoadTranslation( "ID_ALL_USERS" ) );
$this->setVar( 'allProcessLabel', G::LoadTranslation("ID_ALL_PROCESS") );
$this->setVar('processCurrentTitle', $processTitle);
$this->setVar('userCurrentName', $userName);
$this->setVar('currentUserLabel', G::LoadTranslation("ID_ALL_USERS"));
$this->setVar('allProcessLabel', G::LoadTranslation("ID_ALL_PROCESS"));
$this->render();
}
public function getApps ($httpData)
public function getApps($httpData)
{
$cases = $this->getAppsData( $httpData->t, $httpData->start, $httpData->limit );
$cases = $this->getAppsData($httpData->t, $httpData->start, $httpData->limit);
$this->setView( $this->userUxBaseTemplate . PATH_SEP . 'applications' );
$this->setVar( 'cases', $cases['data'] );
$this->setView($this->userUxBaseTemplate . PATH_SEP . 'applications');
$this->setVar('cases', $cases['data']);
$this->render();
}
public function getAppsData (
public function getAppsData(
$type,
$start = null,
$limit = null,
@@ -375,13 +373,12 @@ class Home extends Controller
$callback = null,
$dir = 'DESC',
$sort = "APP_CACHE_VIEW.APP_NUMBER",
$category = null)
{
$category = null
) {
$appNotes = new AppNotes();
$start = empty( $start ) ? $this->appListStart : $start;
$limit = empty( $limit ) ? $this->appListLimit : $limit;
$start = empty($start) ? $this->appListStart : $start;
$limit = empty($limit) ? $this->appListLimit : $limit;
$notesStart = 0;
$notesLimit = 4;
@@ -412,7 +409,6 @@ class Home extends Controller
) &&
(($solrConf = System::solrEnv()) !== false)
) {
$ApplicationSolrIndex = new AppSolr(
$solrConf["solr_enabled"],
$solrConf["solr_host"],
@@ -423,7 +419,7 @@ class Home extends Controller
//Check if there are missing records to reindex and reindex them
$ApplicationSolrIndex->synchronizePendingApplications();
$solrEnabled = true;
} else{
} else {
$solrEnabled = false;
}
}
@@ -494,19 +490,18 @@ class Home extends Controller
$cases = $list->getList($listType, $dataList);
}
} else {
/*----------------------------------********---------------------------------*/
/*----------------------------------********---------------------------------*/
$case = new \ProcessMaker\BusinessModel\Cases();
$cases = $case->getList($dataList);
foreach ($cases['data'] as &$value) {
$value = array_change_key_case($value, CASE_UPPER);
}
/*----------------------------------********---------------------------------*/
/*----------------------------------********---------------------------------*/
}
/*----------------------------------********---------------------------------*/
}
if(empty($cases) && $type == 'search') {
if (empty($cases) && $type == 'search') {
$case = new \ProcessMaker\BusinessModel\Cases();
$cases = $case->getCasesSearch($dataList);
foreach ($cases['data'] as &$value) {
@@ -514,22 +509,22 @@ class Home extends Controller
}
}
if(!isset($cases['totalCount'])){
if (!isset($cases['totalCount'])) {
$cases['totalCount'] = $cases['total'];
}
// formating & complitting apps data with 'Notes'
foreach ($cases['data'] as $i => $row) {
// Formatting
$appTitle = str_replace( '#', '', $row['APP_TITLE'] );
$appTitle = str_replace('#', '', $row['APP_TITLE']);
if (is_numeric( $appTitle )) {
$cases['data'][$i]['APP_TITLE'] = G::LoadTranslation( 'ID_CASE' ) . ' ' . $appTitle;
if (is_numeric($appTitle)) {
$cases['data'][$i]['APP_TITLE'] = G::LoadTranslation('ID_CASE') . ' ' . $appTitle;
}
if (isset( $row['DEL_DELEGATE_DATE'] )) {
if (isset($row['DEL_DELEGATE_DATE'])) {
$conf = new Configurations();
$generalConfCasesList = $conf->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
$generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
$cases['data'][$i]['DEL_DELEGATE_DATE'] = '';
if (!empty(config("system.workspace"))) {
if (isset( $generalConfCasesList['casesListDateFormat'] ) && ! empty( $generalConfCasesList['casesListDateFormat'] )) {
@@ -540,8 +535,8 @@ class Home extends Controller
$cases['data'][$i]['DEL_DELEGATE_DATE'] = $conf->getSystemDate($row['DEL_DELEGATE_DATE']);
}
}
if (isset( $row['APP_DEL_PREVIOUS_USER'] )) {
$cases['data'][$i]['APP_DEL_PREVIOUS_USER'] = ucwords( $row['APP_DEL_PREVIOUS_USER'] );
if (isset($row['APP_DEL_PREVIOUS_USER'])) {
$cases['data'][$i]['APP_DEL_PREVIOUS_USER'] = ucwords($row['APP_DEL_PREVIOUS_USER']);
}
// Completting with Notes
$notes = $appNotes->getNotesList($row['APP_UID'], '', $notesStart, $notesLimit);
@@ -555,10 +550,10 @@ class Home extends Controller
return $cases;
}
public function startCase ($httpData)
public function startCase($httpData)
{
$case = new Cases();
$aData = $case->startCase( $httpData->id, $_SESSION['USER_LOGGED'] );
$aData = $case->startCase($httpData->id, $_SESSION['USER_LOGGED']);
$_SESSION['APPLICATION'] = $aData['APPLICATION'];
$_SESSION['INDEX'] = $aData['INDEX'];
@@ -568,16 +563,16 @@ class Home extends Controller
$_SESSION['CASES_REFRESH'] = true;
$oCase = new Cases();
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']);
$aNextStep['PAGE'] = '../cases/cases_Open?APP_UID=' . $aData['APPLICATION'] . '&DEL_INDEX=' . $aData['INDEX'] . '&action=draft';
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep;
$this->redirect( $aNextStep['PAGE'] );
$this->redirect($aNextStep['PAGE']);
}
public function error ($httpData)
public function error($httpData)
{
$httpData->no = isset( $httpData->no ) ? $httpData->no : 0;
$httpData->no = isset($httpData->no) ? $httpData->no : 0;
switch ($httpData->no) {
case 2:
@@ -587,11 +582,11 @@ class Home extends Controller
$tpl = $this->userUxBaseTemplate . PATH_SEP . 'error';
}
$this->setView( $tpl );
$this->setView($tpl);
$this->render();
}
function getUserArray($action, $userUid, $search = null)
public function getUserArray($action, $userUid, $search = null)
{
$conf = new Configurations();
$confEnvSetting = $conf->getFormats();
@@ -613,7 +608,8 @@ class Home extends Controller
if (!empty($search)) {
$cUsers->add(
$cUsers->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $search . '%', Criteria::LIKE)->addOr(
$cUsers->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $search . '%', Criteria::LIKE))
$cUsers->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $search . '%', Criteria::LIKE)
)
);
}
$oDataset = UsersPeer::doSelectRS($cUsers);
@@ -637,63 +633,63 @@ class Home extends Controller
return $users;
}
function getCategoryArray ()
public function getCategoryArray()
{
$category = array();
$category[] = array ("",G::LoadTranslation( "ID_ALL_CATEGORIES" ));
$category[] = array("",G::LoadTranslation("ID_ALL_CATEGORIES"));
$criteria = new Criteria( 'workflow' );
$criteria->addSelectColumn( ProcessCategoryPeer::CATEGORY_UID );
$criteria->addSelectColumn( ProcessCategoryPeer::CATEGORY_NAME );
$dataset = ProcessCategoryPeer::doSelectRS( $criteria );
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$criteria = new Criteria('workflow');
$criteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_UID);
$criteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
$dataset = ProcessCategoryPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
while ($row = $dataset->getRow()) {
$category[] = array ($row['CATEGORY_UID'],$row['CATEGORY_NAME']);
$category[] = array($row['CATEGORY_UID'],$row['CATEGORY_NAME']);
$dataset->next();
}
return $category;
}
function getAllUsersArray ($action)
public function getAllUsersArray($action)
{
global $oAppCache;
$users = array ();
$users[] = array ("CURRENT_USER",G::LoadTranslation( "ID_CURRENT_USER" ));
$users[] = array ("",G::LoadTranslation( "ID_ALL_USERS" ));
$users = array();
$users[] = array("CURRENT_USER",G::LoadTranslation("ID_CURRENT_USER"));
$users[] = array("",G::LoadTranslation("ID_ALL_USERS"));
if ($action == 'to_reassign') {
//now get users, just for the Search action
$cUsers = $oAppCache->getToReassignListCriteria(null);
$cUsers->addSelectColumn( AppCacheViewPeer::USR_UID );
$cUsers->addSelectColumn(AppCacheViewPeer::USR_UID);
if (g::MySQLSintaxis()) {
$cUsers->addGroupByColumn( AppCacheViewPeer::USR_UID );
$cUsers->addGroupByColumn(AppCacheViewPeer::USR_UID);
}
$cUsers->addAscendingOrderByColumn( AppCacheViewPeer::APP_CURRENT_USER );
$oDataset = AppCacheViewPeer::doSelectRS( $cUsers );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$cUsers->addAscendingOrderByColumn(AppCacheViewPeer::APP_CURRENT_USER);
$oDataset = AppCacheViewPeer::doSelectRS($cUsers);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$users[] = array ($aRow['USR_UID'],$aRow['APP_CURRENT_USER']);
$users[] = array($aRow['USR_UID'],$aRow['APP_CURRENT_USER']);
$oDataset->next();
}
}
return $users;
}
function getStatusArray ($action, $userUid)
public function getStatusArray($action, $userUid)
{
$status = array();
$aStatus = Application::$app_status_values;
$status[] = array('', G::LoadTranslation('ID_ALL_STATUS'));
foreach ($aStatus as $key => $value) {
if ($action == 'search') {
$status[] = array ($value, G::LoadTranslation( 'ID_CASES_STATUS_' . $key ));
$status[] = array($value, G::LoadTranslation('ID_CASES_STATUS_' . $key));
} else {
$status[] = array ($key, G::LoadTranslation( 'ID_CASES_STATUS_' . $key ));
$status[] = array($key, G::LoadTranslation('ID_CASES_STATUS_' . $key));
}
}
return $status;
@@ -724,8 +720,8 @@ class Home extends Controller
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$processes[] = array($aRow["PRO_ID"], $aRow["PRO_TITLE"]);
$oDataset->next();
$processes[] = array($aRow["PRO_ID"], $aRow["PRO_TITLE"]);
$oDataset->next();
}
return ($processes);
@@ -765,4 +761,3 @@ class Home extends Controller
print G::json_encode($users);
}
}

View File

@@ -15,23 +15,23 @@ class Main extends Controller
private $memcache;
private $conf;
public function __construct ()
public function __construct()
{
$this->memcache = & PMmemcached::getSingleton( !empty(config("system.workspace")) ? config("system.workspace") : '' );
$this->memcache = PMmemcached::getSingleton( !empty(config("system.workspace")) ? config("system.workspace") : '' );
define( 'ERROR_EXCEPTION', 1 );
define( 'INFO_EXCEPTION', 3 );
define( 'WARNING_EXCEPTION', 2 );
define('ERROR_EXCEPTION', 1);
define('INFO_EXCEPTION', 3);
define('WARNING_EXCEPTION', 2);
//$this->setDebug(true);
}
function index ($httpData)
public function index($httpData)
{
global $RBAC;
$RBAC->requirePermissions( 'PM_LOGIN' );
$RBAC->requirePermissions('PM_LOGIN');
$meta = new stdClass();
$showSystemInfo = $RBAC->userCanAccess( 'PM_SETUP' ) == 1;
$showSystemInfo = $RBAC->userCanAccess('PM_SETUP') == 1;
// setting variables for template
$this->setVar( 'logo_company', $this->getCompanyLogo() );
@@ -46,59 +46,60 @@ class Main extends Controller
// license notification
$expireInLabel = '';
require_once ("classes" . PATH_SEP . "class.pmLicenseManager.php");
$pmLicenseManager = &PmLicenseManager::getSingleton();
require_once("classes" . PATH_SEP . "class.pmLicenseManager.php");
$pmLicenseManager = PmLicenseManager::getSingleton();
$expireIn = $pmLicenseManager->getExpireIn();
$expireInLabel = $pmLicenseManager->getExpireInLabel();
$this->setVar( 'licenseNotification', $expireInLabel );
$this->setVar('licenseNotification', $expireInLabel);
// setting variables on javascript env.
$this->setJSVar( 'meta', array ('menu' => $this->getMenu()
) );
$this->setJSVar('meta', array('menu' => $this->getMenu()
));
$activeTab = 0;
if (isset( $_SESSION['_defaultUserLocation'] )) {
$activeTab = $this->resolveUrlToTabIndex( $_SESSION['_defaultUserLocation'] );
if (isset($_SESSION['_defaultUserLocation'])) {
$activeTab = $this->resolveUrlToTabIndex($_SESSION['_defaultUserLocation']);
}
if (isset( $_GET['st'] )) {
$activeTab = $this->getActiveTab( $_GET['st'] );
unset( $_GET['st'] );
if (isset($_GET['st'])) {
$activeTab = $this->getActiveTab($_GET['st']);
unset($_GET['st']);
}
$this->setJSVar( 'activeTab', $activeTab );
$this->setJSVar( 'urlAddGetParams', $this->getUrlGetParams() );
$this->setJSVar( 'showSystemInfo', $showSystemInfo );
$this->setJSVar('activeTab', $activeTab);
$this->setJSVar('urlAddGetParams', $this->getUrlGetParams());
$this->setJSVar('showSystemInfo', $showSystemInfo);
$switchInterface = isset( $_SESSION['user_experience'] ) && $_SESSION['user_experience'] == 'SWITCHABLE';
$switchInterface = isset($_SESSION['user_experience']) && $_SESSION['user_experience'] == 'SWITCHABLE';
if (($flyNotify = $this->getFlyNotify()) !== false) {
$this->setJSVar( 'flyNotify', $flyNotify );
$this->setJSVar('flyNotify', $flyNotify);
}
$this->setJSVar( 'switchInterface', $switchInterface );
$this->setJSVar('switchInterface', $switchInterface);
$this->includeExtJSLib( 'ux/ux.menu' );
$this->includeExtJS( 'main/index' );
$this->setLayout( 'pm-modern' );
$this->afterLoad( $httpData );
$this->includeExtJSLib('ux/ux.menu');
$this->includeExtJS('main/index');
$this->setLayout('pm-modern');
$this->afterLoad($httpData);
$this->render();
}
function screamFileUpgrades () {
G::streamFile( PATH_DATA . 'log/upgrades.log', true );
public function screamFileUpgrades()
{
G::streamFile(PATH_DATA . 'log/upgrades.log', true);
}
function getSystemInfo ()
public function getSystemInfo()
{
$this->setResponseType( 'json' );
$this->setResponseType('json');
$infoList = $this->_getSystemInfo();
$data = array ();
$data = array();
foreach ($infoList as $row) {
$data[] = array ('label' => $row[0],'value' => $row[1],'section' => $row[2]
$data[] = array('label' => $row[0],'value' => $row[1],'section' => $row[2]
);
}
return $data;
@@ -107,37 +108,37 @@ class Main extends Controller
/**
* Login
*/
public function login ()
public function login()
{
$this->conf = new Configurations();
// getting posibles errors passed by GET method
$this->getInUrlError();
if (! isset( $_SESSION['G_MESSAGE'] )) {
if (! isset($_SESSION['G_MESSAGE'])) {
$_SESSION['G_MESSAGE'] = '';
}
if (! isset( $_SESSION['G_MESSAGE_TYPE'] )) {
if (! isset($_SESSION['G_MESSAGE_TYPE'])) {
$_SESSION['G_MESSAGE_TYPE'] = '';
}
$msg = $_SESSION['G_MESSAGE'];
$msgType = $_SESSION['G_MESSAGE_TYPE'];
if (! isset( $_SESSION['FAILED_LOGINS'] )) {
if (! isset($_SESSION['FAILED_LOGINS'])) {
$_SESSION['FAILED_LOGINS'] = 0;
}
$sFailedLogins = $_SESSION['FAILED_LOGINS'];
if (isset( $_SESSION['USER_LOGGED'] )) {
if (isset($_SESSION['USER_LOGGED'])) {
//close the session, if the current session_id was used in PM.
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( LoginLogPeer::LOG_SID, session_id() );
$oCriteria->add( LoginLogPeer::USR_UID, isset( $_SESSION['USER_LOGGED'] ) ? $_SESSION['USER_LOGGED'] : '-' );
$oCriteria->add( LoginLogPeer::LOG_STATUS, 'ACTIVE' );
$oCriteria->add( LoginLogPeer::LOG_END_DATE, null, Criteria::ISNULL );
$oDataset = LoginLogPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oCriteria = new Criteria('workflow');
$oCriteria->add(LoginLogPeer::LOG_SID, session_id());
$oCriteria->add(LoginLogPeer::USR_UID, isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '-');
$oCriteria->add(LoginLogPeer::LOG_STATUS, 'ACTIVE');
$oCriteria->add(LoginLogPeer::LOG_END_DATE, null, Criteria::ISNULL);
$oDataset = LoginLogPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
if ($aRow) {
@@ -149,20 +150,20 @@ class Main extends Controller
$aLog['LOG_IP'] = $aRow['LOG_IP'];
$aLog['LOG_SID'] = session_id();
$aLog['LOG_INIT_DATE'] = $aRow['LOG_INIT_DATE'];
$aLog['LOG_END_DATE'] = date( 'Y-m-d H:i:s' );
$aLog['LOG_END_DATE'] = date('Y-m-d H:i:s');
$aLog['LOG_CLIENT_HOSTNAME'] = $aRow['LOG_CLIENT_HOSTNAME'];
$aLog['USR_UID'] = $aRow['USR_UID'];
$weblog->update( $aLog );
$weblog->update($aLog);
}
}
//remove memcached session
$this->memcache->delete( 'rbacSession' . session_id() );
$this->memcache->delete('rbacSession' . session_id());
} else {
// Execute SSO trigger
$pluginRegistry = PluginRegistry::loadSingleton();
if (defined( 'PM_SINGLE_SIGN_ON' )) {
if ($pluginRegistry->existsTrigger( PM_SINGLE_SIGN_ON )) {
if ($pluginRegistry->executeTriggers( PM_SINGLE_SIGN_ON, null )) {
if (defined('PM_SINGLE_SIGN_ON')) {
if ($pluginRegistry->existsTrigger(PM_SINGLE_SIGN_ON)) {
if ($pluginRegistry->executeTriggers(PM_SINGLE_SIGN_ON, null)) {
// Start new session
@session_destroy();
session_start();
@@ -171,7 +172,7 @@ class Main extends Controller
$result = $this->authentication();
if ($result->success) {
// Redirect to landing page for the user
G::header( 'Location: ' . $result->url );
G::header('Location: ' . $result->url);
die();
}
}
@@ -186,10 +187,10 @@ class Main extends Controller
session_start();
session_regenerate_id();
if (strlen( $msg ) > 0) {
if (strlen($msg) > 0) {
$_SESSION['G_MESSAGE'] = $msg;
}
if (strlen( $msgType ) > 0) {
if (strlen($msgType) > 0) {
$_SESSION['G_MESSAGE_TYPE'] = $msgType;
}
$_SESSION['FAILED_LOGINS'] = $sFailedLogins;
@@ -198,80 +199,80 @@ class Main extends Controller
$sflag = 0;
if (($nextBeatDate = $this->memcache->get( 'nextBeatDate' )) === false) {
if (($nextBeatDate = $this->memcache->get('nextBeatDate')) === false) {
//get the serverconf singleton, and check if we can send the heartbeat
$oServerConf = & ServerConf::getSingleton();
$sflag = $oServerConf->getHeartbeatProperty( 'HB_OPTION', 'HEART_BEAT_CONF' );
$sflag = (trim( $sflag ) != '') ? $sflag : '1';
$oServerConf = ServerConf::getSingleton();
$sflag = $oServerConf->getHeartbeatProperty('HB_OPTION', 'HEART_BEAT_CONF');
$sflag = (trim($sflag) != '') ? $sflag : '1';
//get date of next beat
$nextBeatDate = $oServerConf->getHeartbeatProperty( 'HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF' );
$this->memcache->set( 'nextBeatDate', $nextBeatDate, 1 * 3600 );
$nextBeatDate = $oServerConf->getHeartbeatProperty('HB_NEXT_BEAT_DATE', 'HEART_BEAT_CONF');
$this->memcache->set('nextBeatDate', $nextBeatDate, 1 * 3600);
} else {
$sflag = '1';
}
if (($sflag == '1') && ((strtotime( "now" ) > $nextBeatDate) || is_null( $nextBeatDate ))) {
if (($sflag == '1') && ((strtotime("now") > $nextBeatDate) || is_null($nextBeatDate))) {
//To do: we need to change to ExtJs
$this->setJSVar( 'flagHeartBeat', 1 );
$this->setJSVar('flagHeartBeat', 1);
} else {
$this->setJSVar( 'flagHeartBeat', 0 );
$this->setJSVar('flagHeartBeat', 0);
}
if (($flagGettingStarted = $this->memcache->get( 'flagGettingStarted' )) === false) {
if (($flagGettingStarted = $this->memcache->get('flagGettingStarted')) === false) {
require_once 'classes/model/Configuration.php';
$oConfiguration = new Configuration();
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( ConfigurationPeer::CFG_UID, 'getStarted' );
$oCriteria->add( ConfigurationPeer::OBJ_UID, '' );
$oCriteria->add( ConfigurationPeer::CFG_VALUE, '1' );
$oCriteria->add( ConfigurationPeer::PRO_UID, '' );
$oCriteria->add( ConfigurationPeer::USR_UID, '' );
$oCriteria->add( ConfigurationPeer::APP_UID, '' );
$flagGettingStarted = ConfigurationPeer::doCount( $oCriteria );
$this->memcache->set( 'flagGettingStarted', $flagGettingStarted, 8 * 3600 );
$oCriteria = new Criteria('workflow');
$oCriteria->add(ConfigurationPeer::CFG_UID, 'getStarted');
$oCriteria->add(ConfigurationPeer::OBJ_UID, '');
$oCriteria->add(ConfigurationPeer::CFG_VALUE, '1');
$oCriteria->add(ConfigurationPeer::PRO_UID, '');
$oCriteria->add(ConfigurationPeer::USR_UID, '');
$oCriteria->add(ConfigurationPeer::APP_UID, '');
$flagGettingStarted = ConfigurationPeer::doCount($oCriteria);
$this->memcache->set('flagGettingStarted', $flagGettingStarted, 8 * 3600);
}
$this->setJSVar( 'flagGettingStarted', ($flagGettingStarted == 0) );
$this->setJSVar('flagGettingStarted', ($flagGettingStarted == 0));
$oConf = new Configurations();
$oConf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
$flagForgotPassword = isset( $oConf->aConfig['login_enableForgotPassword'] ) ? $oConf->aConfig['login_enableForgotPassword'] : 'off';
$flagForgotPassword = isset($oConf->aConfig['login_enableForgotPassword']) ? $oConf->aConfig['login_enableForgotPassword'] : 'off';
$this->includeExtJSLib( 'ux/virtualkeyboard' );
$this->includeExtJS( 'main/login' );
$this->setView( 'main/login' );
$this->includeExtJSLib('ux/virtualkeyboard');
$this->includeExtJS('main/login');
$this->setView('main/login');
$oConf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
$forgotPasswd = isset( $oConf->aConfig['login_enableForgotPassword'] ) ? $oConf->aConfig['login_enableForgotPassword'] : false;
$virtualKeyboad = isset( $oConf->aConfig['login_enableVirtualKeyboard'] ) ? $oConf->aConfig['login_enableVirtualKeyboard'] : false;
$defaultLanguaje = isset( $oConf->aConfig['login_defaultLanguage'] ) ? $oConf->aConfig['login_defaultLanguage'] : 'en';
$forgotPasswd = isset($oConf->aConfig['login_enableForgotPassword']) ? $oConf->aConfig['login_enableForgotPassword'] : false;
$virtualKeyboad = isset($oConf->aConfig['login_enableVirtualKeyboard']) ? $oConf->aConfig['login_enableVirtualKeyboard'] : false;
$defaultLanguaje = isset($oConf->aConfig['login_defaultLanguage']) ? $oConf->aConfig['login_defaultLanguage'] : 'en';
$this->setJSVar( 'forgotPasswd', $forgotPasswd );
$this->setJSVar( 'virtualKeyboad', $virtualKeyboad );
$this->setJSVar('forgotPasswd', $forgotPasswd);
$this->setJSVar('virtualKeyboad', $virtualKeyboad);
$this->setJSVar( 'languages', $availableLangArray );
$this->setJSVar( 'defaultLang', $defaultLanguaje );
$this->setJSVar('languages', $availableLangArray);
$this->setJSVar('defaultLang', $defaultLanguaje);
//binding G::SendTemporalMessage() to Ext.msgBoxSlider.msgTopCenter()
if (($flyNotify = $this->getFlyNotify()) !== false) {
$this->setJSVar( 'flyNotify', $flyNotify );
$this->setJSVar('flyNotify', $flyNotify);
}
//binding G::SendTemporalMessage() to Ext.msgBoxSlider.msgTopCenter()
if (isset( $_GET['u'] )) {
$this->setJSVar( 'urlRequested', urldecode( $_GET['u'] ) );
if (isset($_GET['u'])) {
$this->setJSVar('urlRequested', urldecode($_GET['u']));
}
$this->setVar( 'logo_company', $this->getCompanyLogo() );
$this->setVar( 'pmos_version', System::getVersion() );
$this->setVar('logo_company', $this->getCompanyLogo());
$this->setVar('pmos_version', System::getVersion());
$footerText = 'Copyright &copy; 2003-' . date( 'Y' ) . ' Colosa, Inc. All rights reserved.';
$footerText = 'Copyright &copy; 2003-' . date('Y') . ' Colosa, Inc. All rights reserved.';
$adviseText = 'Supplied free of charge with no support, certification, warranty,
maintenance nor indemnity by Colosa and its Certified Partners. ';
$this->setVar( 'footer_text', $footerText );
$this->setVar( 'advise_text', $adviseText );
$this->setVar('footer_text', $footerText);
$this->setVar('advise_text', $adviseText);
$loginScript = $this->getHeadPublisher()->getExtJsLibraries();
$loginScript .= $this->getHeadPublisher()->getExtJsScripts();
$this->setVar("login_script", $loginScript);
@@ -286,53 +287,52 @@ class Main extends Controller
/**
* SysLogin
*/
public function sysLogin ()
public function sysLogin()
{
Propel::init( PATH_CORE . "config/databases.php" );
Creole::registerDriver( 'dbarray', 'creole.contrib.DBArrayConnection' );
Propel::init(PATH_CORE . "config/databases.php");
Creole::registerDriver('dbarray', 'creole.contrib.DBArrayConnection');
// getting posibles errors passed by GET method
$this->getInUrlError();
$availableWorkspace = $this->getWorkspacesAvailable();
$availableWorkspaceList = array ();
$availableWorkspaceList = array();
foreach ($availableWorkspace as $ws) {
$availableWorkspaceList[] = array ($ws,$ws
$availableWorkspaceList[] = array($ws,$ws
);
}
$aField['LOGIN_VERIFY_MSG'] = G::loadTranslation( 'LOGIN_VERIFY_MSG' );
$aField['LOGIN_VERIFY_MSG'] = G::loadTranslation('LOGIN_VERIFY_MSG');
//Get Server Configuration
$oServerConf = & ServerConf::getSingleton();
$oServerConf = ServerConf::getSingleton();
$availableLangArray = $this->getLanguagesList();
$this->includeExtJSLib( 'ux/virtualkeyboard' );
$this->setJSVar( 'sysLang', SYS_LANG );
$this->includeExtJS( 'main/sysLogin' );
$this->includeExtJSLib('ux/virtualkeyboard');
$this->setJSVar('sysLang', SYS_LANG);
$this->includeExtJS('main/sysLogin');
$this->setVar( 'logo_company', $this->getCompanyLogo() );
$this->setVar( 'pmos_version', System::getVersion() );
$this->setVar('logo_company', $this->getCompanyLogo());
$this->setVar('pmos_version', System::getVersion());
$footerText = G::LoadTranslation('ID_COPYRIGHT_FROM') . date( 'Y' ) . G::LoadTranslation('ID_COPYRIGHT_COL');
$footerText = G::LoadTranslation('ID_COPYRIGHT_FROM') . date('Y') . G::LoadTranslation('ID_COPYRIGHT_COL');
$adviseText = G::LoadTranslation('ID_COLOSA_AND_CERTIFIED_PARTNERS');
$this->setVar( 'footer_text', $footerText );
$this->setVar( 'advise_text', $adviseText );
$this->setVar('footer_text', $footerText);
$this->setVar('advise_text', $adviseText);
//binding G::SendTemporalMessage() to Ext.msgBoxSlider.msgTopCenter()
if (($flyNotify = $this->getFlyNotify()) !== false) {
$this->setJSVar( 'flyNotify', $flyNotify );
$this->setJSVar('flyNotify', $flyNotify);
}
$this->setJSVar( 'languages', $availableLangArray );
$this->setJSVar( 'workspaces', $availableWorkspaceList );
$this->setJSVar( 'wsPrivate', $oServerConf->getProperty( 'LOGIN_NO_WS' ) );
$this->setJSVar('languages', $availableLangArray);
$this->setJSVar('workspaces', $availableWorkspaceList);
$this->setJSVar('wsPrivate', $oServerConf->getProperty('LOGIN_NO_WS'));
$this->setJSVar( 'defaultLang', 'en' );
$this->setJSVar( 'defaultWS', '' );
$this->setJSVar('defaultLang', 'en');
$this->setJSVar('defaultWS', '');
$loginScript = $this->getHeadPublisher()->getExtJsLibraries();
$loginScript .= $this->getHeadPublisher()->getExtJsScripts();
@@ -345,56 +345,56 @@ class Main extends Controller
$this->render();
}
public function forgotPassword ($httpData)
public function forgotPassword($httpData)
{
$this->setResponseType( 'json' );
$this->setResponseType('json');
global $RBAC;
$rbacUser = new RbacUsers();
$user = new Users();
try {
$userData = $rbacUser->getByUsername( $httpData->username );
$userData = $rbacUser->getByUsername($httpData->username);
if (! $userData) {
$msg = G::LoadTranslation( 'ID_USER' ) . ' <b>' . $httpData->username . '</b> ' . G::LoadTranslation( 'ID_IS_NOT_REGISTERED' );
throw new Exception( $msg );
$msg = G::LoadTranslation('ID_USER') . ' <b>' . $httpData->username . '</b> ' . G::LoadTranslation('ID_IS_NOT_REGISTERED');
throw new Exception($msg);
}
if (trim( $userData['USR_EMAIL'] ) != trim( $httpData->email )) {
$msg = G::LoadTranslation( 'ID_EMAIL_DOES_NOT_MATCH_FOR_USER' ) . ' <b>' . $httpData->username . '</b>';
throw new Exception( $msg );
if (trim($userData['USR_EMAIL']) != trim($httpData->email)) {
$msg = G::LoadTranslation('ID_EMAIL_DOES_NOT_MATCH_FOR_USER') . ' <b>' . $httpData->username . '</b>';
throw new Exception($msg);
}
$newPass = G::generate_password();
$aData['USR_UID'] = $userData['USR_UID'];
$aData['USR_PASSWORD'] = Bootstrap::hashPassword( $newPass );
$aData['USR_PASSWORD'] = Bootstrap::hashPassword($newPass);
$rbacUser->update( $aData );
$user->update( $aData );
$rbacUser->update($aData);
$user->update($aData);
$subject = G::loadTranslation( 'ID_PROCESSMAKER_FORGOT_PASSWORD_SERVICE' );
$subject = G::loadTranslation('ID_PROCESSMAKER_FORGOT_PASSWORD_SERVICE');
$template = new TemplatePower( PATH_TPL . 'main/forgotPassword.tpl' );
$template = new TemplatePower(PATH_TPL . 'main/forgotPassword.tpl');
$template->prepare();
$template->assign( 'server', $_SERVER['SERVER_NAME'] );
$template->assign('server', $_SERVER['SERVER_NAME']);
$template->assign( 'serviceMsg', G::loadTranslation( 'ID_PROCESSMAKER_FORGOT_PASSWORD_SERVICE' ) );
$template->assign( 'content', G::loadTranslation( 'ID_PASSWORD_CHANGED_SUCCESSFULLY' ) );
$template->assign( 'passwd', $newPass );
$template->assign( 'poweredBy', G::loadTranslation( 'ID_PROCESSMAKER_SLOGAN1' ) );
$template->assign( 'versionLabel', G::loadTranslation( 'ID_VERSION' ) );
$template->assign( 'version', System::getVersion() );
$template->assign( 'visit', G::loadTranslation( 'ID_VISIT' ) );
$template->assign('serviceMsg', G::loadTranslation('ID_PROCESSMAKER_FORGOT_PASSWORD_SERVICE'));
$template->assign('content', G::loadTranslation('ID_PASSWORD_CHANGED_SUCCESSFULLY'));
$template->assign('passwd', $newPass);
$template->assign('poweredBy', G::loadTranslation('ID_PROCESSMAKER_SLOGAN1'));
$template->assign('versionLabel', G::loadTranslation('ID_VERSION'));
$template->assign('version', System::getVersion());
$template->assign('visit', G::loadTranslation('ID_VISIT'));
$template->assign( 'footer', '' );
$template->assign('footer', '');
$body = $template->getOutputContent();
G::sendMail( '', 'ProcessMaker Service', $httpData->email, $subject, $body );
G::sendMail('', 'ProcessMaker Service', $httpData->email, $subject, $body);
$result->success = true;
$result->message = G::LoadTranslation( 'ID_NEW_PASSWORD_SENT' );
$result->message = G::LoadTranslation('ID_NEW_PASSWORD_SENT');
} catch (Exception $e) {
$result->success = false;
$result->message = $e->getMessage();
@@ -407,7 +407,7 @@ class Main extends Controller
* Private Functions *
* *
*/
private function getMenu ()
private function getMenu()
{
global $G_MAIN_MENU;
global $G_SUB_MENU;
@@ -421,37 +421,37 @@ class Main extends Controller
$G_ID_MENU_SELECTED = 'BPMN';
$oMenu = new Menu();
$menus = $oMenu->generateArrayForTemplate( $G_MAIN_MENU, 'SelectedMenu', 'mainMenu', $G_MENU_SELECTED, $G_ID_MENU_SELECTED );
$menus = $oMenu->generateArrayForTemplate($G_MAIN_MENU, 'SelectedMenu', 'mainMenu', $G_MENU_SELECTED, $G_ID_MENU_SELECTED);
foreach ($menus as $i => $menu) {
if (strpos( $menu['target'], 'cases/main' ) !== false) {
$menus[$i]['target'] = str_replace( 'cases/main', 'cases/main_init', $menus[$i]['target'] );
if (strpos($menu['target'], 'cases/main') !== false) {
$menus[$i]['target'] = str_replace('cases/main', 'cases/main_init', $menus[$i]['target']);
}
if (strpos( $menu['target'], 'processes/main' ) !== false) {
$menus[$i]['target'] = str_replace( 'processes/main', 'processes/mainInit', $menus[$i]['target'] );
if (strpos($menu['target'], 'processes/main') !== false) {
$menus[$i]['target'] = str_replace('processes/main', 'processes/mainInit', $menus[$i]['target']);
}
if (strpos( $menu['target'], 'setup/main' ) !== false) {
$menus[$i]['target'] = str_replace( 'setup/main', 'setup/main_init', $menus[$i]['target'] );
if (strpos($menu['target'], 'setup/main') !== false) {
$menus[$i]['target'] = str_replace('setup/main', 'setup/main_init', $menus[$i]['target']);
}
if (strpos( $menu['target'], 'dashboard/main' ) !== false) {
$menus[$i]['target'] = str_replace( 'dashboard/main', 'dashboard', $menus[$i]['target'] );
if (strpos($menu['target'], 'dashboard/main') !== false) {
$menus[$i]['target'] = str_replace('dashboard/main', 'dashboard', $menus[$i]['target']);
}
$menus[$i]['elementclass'] = preg_replace( array ('/class=/','/"/'
), array ('',''
), $menus[$i]['elementclass'] );
$menus[$i]['elementclass'] = preg_replace(array('/class=/','/"/'
), array('',''
), $menus[$i]['elementclass']);
}
return $menus;
}
private function resolveUrlToTabIndex ($url)
private function resolveUrlToTabIndex($url)
{
if (strpos( $url, 'cases/main' ) !== false) {
if (strpos($url, 'cases/main') !== false) {
$activeTab = 0;
} elseif (strpos( $url, 'processes/main' ) !== false) {
} elseif (strpos($url, 'processes/main') !== false) {
$activeTab = 1;
} elseif (strpos( $url, 'dashboard/main' ) !== false) {
} elseif (strpos($url, 'dashboard/main') !== false) {
$activeTab = 2;
} elseif (strpos( $url, 'setup/main' ) !== false) {
} elseif (strpos($url, 'setup/main') !== false) {
$activeTab = 3;
} else {
$activeTab = 0;
@@ -460,24 +460,24 @@ class Main extends Controller
return $activeTab;
}
private function getCompanyLogo ()
private function getCompanyLogo()
{
$sCompanyLogo = '/images/processmaker2.logo2.png';
if (!empty(config("system.workspace"))) {
if (($aFotoSelect = $this->memcache->get( 'aFotoSelect' )) === false) {
$oLogoR = new ReplacementLogo();
$aFotoSelect = $oLogoR->getNameLogo( (isset( $_SESSION['USER_LOGGED'] )) ? $_SESSION['USER_LOGGED'] : '' );
$this->memcache->set( 'aFotoSelect', $aFotoSelect, 1 * 3600 );
$aFotoSelect = $oLogoR->getNameLogo((isset($_SESSION['USER_LOGGED'])) ? $_SESSION['USER_LOGGED'] : '');
$this->memcache->set('aFotoSelect', $aFotoSelect, 1 * 3600);
}
if (is_array( $aFotoSelect )) {
$sFotoSelect = trim( $aFotoSelect['DEFAULT_LOGO_NAME'] );
$sWspaceSelect = trim( $aFotoSelect['WORKSPACE_LOGO_NAME'] );
if (is_array($aFotoSelect)) {
$sFotoSelect = trim($aFotoSelect['DEFAULT_LOGO_NAME']);
$sWspaceSelect = trim($aFotoSelect['WORKSPACE_LOGO_NAME']);
}
}
if (class_exists( 'ProcessMaker\Plugins\PluginRegistry' )) {
if (class_exists('ProcessMaker\Plugins\PluginRegistry')) {
$oPluginRegistry = PluginRegistry::loadSingleton();
$logoPlugin = $oPluginRegistry->getCompanyLogo( $sCompanyLogo );
$logoPlugin = $oPluginRegistry->getCompanyLogo($sCompanyLogo);
if ($logoPlugin != '/images/processmaker2.logo2.png') {
$sCompanyLogo = $logoPlugin;
} elseif (isset( $sFotoSelect ) && $sFotoSelect != '' && ! (strcmp( $sWspaceSelect, config("system.workspace") ))) {
@@ -488,67 +488,67 @@ class Main extends Controller
return $sCompanyLogo;
}
public function getLanguagesList ()
public function getLanguagesList()
{
$Translations = new Translation;
$translationsTable = $Translations->getTranslationEnvironments();
if (($languagesList = $this->memcache->get( 'languagesList' )) === false) {
$languagesList = array ();
if (($languagesList = $this->memcache->get('languagesList')) === false) {
$languagesList = array();
foreach ($translationsTable as $locale) {
$LANG_ID = $locale['LOCALE'];
if ($locale['COUNTRY'] != '.') {
$LANG_NAME = $locale['LANGUAGE'] . ' (' . (ucwords( strtolower( $locale['COUNTRY'] ) )) . ')';
$LANG_NAME = $locale['LANGUAGE'] . ' (' . (ucwords(strtolower($locale['COUNTRY']))) . ')';
} else {
$LANG_NAME = $locale['LANGUAGE'];
}
$languagesList[] = array ($LANG_ID,$LANG_NAME
$languagesList[] = array($LANG_ID,$LANG_NAME
);
}
$this->memcache->set( 'languagesList', $languagesList, 1 * 3600 );
$this->memcache->set('languagesList', $languagesList, 1 * 3600);
}
return $languagesList;
}
private function getWorkspacesAvailable ()
private function getWorkspacesAvailable()
{
$oServerConf = & ServerConf::getSingleton();
$oServerConf = ServerConf::getSingleton();
$dir = PATH_DB;
$filesArray = array ();
if (file_exists( $dir )) {
if ($handle = opendir( $dir )) {
while (false !== ($file = readdir( $handle ))) {
$filesArray = array();
if (file_exists($dir)) {
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if (($file != ".") && ($file != "..")) {
if (file_exists( PATH_DB . $file . '/db.php' )) {
if (! $oServerConf->isWSDisabled( $file )) {
if (file_exists(PATH_DB . $file . '/db.php')) {
if (! $oServerConf->isWSDisabled($file)) {
$filesArray[] = $file;
}
}
}
}
closedir( $handle );
closedir($handle);
}
}
sort( $filesArray, SORT_STRING );
sort($filesArray, SORT_STRING);
return $filesArray;
}
private function getUserRole ()
private function getUserRole()
{
global $RBAC;
$rolCode = str_replace( '_', ' ', $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'] );
$rolCode = str_replace('_', ' ', $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE']);
$rolUid = $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_UID'];
$oCriteria1 = new Criteria( 'workflow' );
$oCriteria1->add( ContentPeer::CON_CATEGORY, 'ROL_NAME' );
$oCriteria1->add( ContentPeer::CON_ID, $rolUid );
$oCriteria1->add( ContentPeer::CON_LANG, SYS_LANG );
$oDataset1 = ContentPeer::doSelectRS( $oCriteria1 );
$oDataset1->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oCriteria1 = new Criteria('workflow');
$oCriteria1->add(ContentPeer::CON_CATEGORY, 'ROL_NAME');
$oCriteria1->add(ContentPeer::CON_ID, $rolUid);
$oCriteria1->add(ContentPeer::CON_LANG, SYS_LANG);
$oDataset1 = ContentPeer::doSelectRS($oCriteria1);
$oDataset1->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset1->next();
$aRow = $oDataset1->getRow();
$rolName = $aRow['CON_VALUE'];
@@ -559,19 +559,19 @@ class Main extends Controller
/**
* binding G::SendTemporalMessage() to Javascript routine Ext.msgBoxSlider.msgTopCenter()
*/
private function getFlyNotify ()
private function getFlyNotify()
{
if (! isset( $_SESSION['G_MESSAGE'] )) {
if (! isset($_SESSION['G_MESSAGE'])) {
return false;
}
$flyNotify['title'] = isset( $_SESSION['G_MESSAGE_TITLE'] ) ? $_SESSION['G_MESSAGE_TITLE'] : '';
$flyNotify['title'] = isset($_SESSION['G_MESSAGE_TITLE']) ? $_SESSION['G_MESSAGE_TITLE'] : '';
$flyNotify['text'] = $_SESSION['G_MESSAGE'];
unset( $_SESSION['G_MESSAGE'] );
if (isset( $_SESSION['G_MESSAGE_TYPE'] )) {
unset($_SESSION['G_MESSAGE']);
if (isset($_SESSION['G_MESSAGE_TYPE'])) {
$flyNotify['type'] = $_SESSION['G_MESSAGE_TYPE'];
unset( $_SESSION['G_MESSAGE_TYPE'] );
unset($_SESSION['G_MESSAGE_TYPE']);
} else {
$flyNotify['type'] = '';
}
@@ -581,22 +581,22 @@ class Main extends Controller
case 'alert':
case 'warning':
case 'tmp-warning':
$flyNotify['title'] = G::loadTranslation( 'ID_WARNING' );
$flyNotify['title'] = G::loadTranslation('ID_WARNING');
break;
case 'error':
case 'tmp-error':
$flyNotify['title'] = G::loadTranslation( 'ID_ERROR' );
$flyNotify['title'] = G::loadTranslation('ID_ERROR');
break;
case 'tmp-info':
case 'info':
$flyNotify['title'] = G::loadTranslation( 'ID_INFO' );
$flyNotify['title'] = G::loadTranslation('ID_INFO');
break;
case 'success':
case 'ok':
$flyNotify['title'] = G::loadTranslation( 'ID_SUCCESS' );
$flyNotify['title'] = G::loadTranslation('ID_SUCCESS');
break;
}
$flyNotify['title'] = strtoupper( $flyNotify['title'] );
$flyNotify['title'] = strtoupper($flyNotify['title']);
}
//TODO make dinamic
$flyNotify['time'] = 5;
@@ -605,18 +605,18 @@ class Main extends Controller
return $this->flyNotify;
}
private function setFlyNotify ($type, $title, $text, $time = 5)
private function setFlyNotify($type, $title, $text, $time = 5)
{
$this->flyNotify = array ('type' => $type,'title' => $title,'text' => $text,'time' => $time
$this->flyNotify = array('type' => $type,'title' => $title,'text' => $text,'time' => $time
);
$_SESSION['G_MESSAGE'] = $text;
$_SESSION['G_MESSAGE_TYPE'] = $type;
}
private function getInUrlError ()
private function getInUrlError()
{
if (isset( $_GET['errno'] )) {
if (isset($_GET['errno'])) {
switch ($_GET['errno']) {
case '1':
$trnLabel = 'ID_USER_HAVENT_RIGHTS_PAGE';
@@ -628,13 +628,13 @@ class Main extends Controller
$trnLabel = 'ID_USER_HAVENT_RIGHTS_PAGE';
break;
}
$this->setFlyNotify( 'error', 'ERROR', G::loadTranslation( $trnLabel ) );
$this->setFlyNotify('error', 'ERROR', G::loadTranslation($trnLabel));
}
}
private function getActiveTab ($activeTab)
private function getActiveTab($activeTab)
{
if (! is_numeric( $activeTab )) {
if (! is_numeric($activeTab)) {
switch ($activeTab) {
case 'home':
$activeTab = 0;
@@ -658,48 +658,47 @@ class Main extends Controller
return $activeTab;
}
private function getUrlGetParams ()
private function getUrlGetParams()
{
$urlGetParams = '';
foreach ($_GET as $key => $value) {
$urlGetParams .= $urlGetParams == '' ? $key : "&" . $key;
$urlGetParams .= trim( $value ) != '' ? '=' . $value : '';
$urlGetParams .= trim($value) != '' ? '=' . $value : '';
}
return $urlGetParams;
}
private function getUserFullName ()
private function getUserFullName()
{
return isset( $_SESSION['USR_FULLNAME'] ) ? $_SESSION['USR_FULLNAME'] : '';
return isset($_SESSION['USR_FULLNAME']) ? $_SESSION['USR_FULLNAME'] : '';
}
private function _getSystemInfo ()
private function _getSystemInfo()
{
if (getenv( 'HTTP_CLIENT_IP' )) {
$ip = getenv( 'HTTP_CLIENT_IP' );
if (getenv('HTTP_CLIENT_IP')) {
$ip = getenv('HTTP_CLIENT_IP');
} else {
if (getenv( 'HTTP_X_FORWARDED_FOR' )) {
$ip = getenv( 'HTTP_X_FORWARDED_FOR' );
if (getenv('HTTP_X_FORWARDED_FOR')) {
$ip = getenv('HTTP_X_FORWARDED_FOR');
} else {
$ip = getenv( 'REMOTE_ADDR' );
$ip = getenv('REMOTE_ADDR');
}
}
$redhat = '';
if (file_exists( '/etc/redhat-release' )) {
$fnewsize = filesize( '/etc/redhat-release' );
$fp = fopen( '/etc/redhat-release', 'r' );
$redhat = trim( fread( $fp, $fnewsize ) );
fclose( $fp );
if (file_exists('/etc/redhat-release')) {
$fnewsize = filesize('/etc/redhat-release');
$fp = fopen('/etc/redhat-release', 'r');
$redhat = trim(fread($fp, $fnewsize));
fclose($fp);
}
$redhat .= " (" . PHP_OS . ")";
if (defined( "DB_HOST" )) {
$dbNetView = new Net( DB_HOST );
$dbNetView->loginDbServer( DB_USER, DB_PASS );
if (defined("DB_HOST")) {
$dbNetView = new Net(DB_HOST);
$dbNetView->loginDbServer(DB_USER, DB_PASS);
$dbConns = new DbConnections( '' );
$dbConns = new DbConnections('');
$availdb = '';
foreach ($dbConns->getDbServicesAvailables() as $key => $val) {
if ($availdb != '') {
@@ -709,7 +708,7 @@ class Main extends Controller
}
try {
$sMySQLVersion = $dbNetView->getDbServerVersion( DB_ADAPTER );
$sMySQLVersion = $dbNetView->getDbServerVersion(DB_ADAPTER);
} catch (Exception $oException) {
$sMySQLVersion = '?????';
}
@@ -725,7 +724,7 @@ class Main extends Controller
$pmuiVer = $mafeVer = $pmdynaformVer = "(unknown)";
}
$sysSection = G::loadTranslation('ID_SYSTEM_INFO' );
$sysSection = G::loadTranslation('ID_SYSTEM_INFO');
$pmSection = G::LoadTranslation('ID_PROCESS_INFORMATION');
$properties = array ();
@@ -738,76 +737,76 @@ class Main extends Controller
if (defined('SYSTEM_NAME')) {
$systemName = SYSTEM_NAME;
}
$properties[] = array ($systemName. ' Ver.', System::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);
if (file_exists(PATH_DATA. 'log/upgrades.log')) {
$properties[] = array (G::LoadTranslation('ID_UPGRADES_PATCHES'), '<a href="#" onclick="showUpgradedLogs(); return false;">' . G::LoadTranslation( 'ID_UPGRADE_VIEW_LOG') . '</a>' ,$pmSection);
$properties[] = array(G::LoadTranslation('ID_UPGRADES_PATCHES'), '<a href="#" onclick="showUpgradedLogs(); return false;">' . G::LoadTranslation('ID_UPGRADE_VIEW_LOG') . '</a>' ,$pmSection);
} else {
$properties[] = array (G::LoadTranslation('ID_UPGRADES_PATCHES'), G::LoadTranslation( 'ID_UPGRADE_NEVER_UPGRADE') ,$pmSection);
$properties[] = array(G::LoadTranslation('ID_UPGRADES_PATCHES'), G::LoadTranslation('ID_UPGRADE_NEVER_UPGRADE') ,$pmSection);
}
$properties[] = array (G::LoadTranslation('ID_OPERATING_SYSTEM') ,$redhat,$sysSection
$properties[] = array(G::LoadTranslation('ID_OPERATING_SYSTEM') ,$redhat,$sysSection
);
$properties[] = array (G::LoadTranslation('ID_TIME_ZONE') ,(defined( 'TIME_ZONE' )) ? TIME_ZONE : "Unknown",$sysSection
$properties[] = array(G::LoadTranslation('ID_TIME_ZONE') ,(defined('TIME_ZONE')) ? TIME_ZONE : "Unknown",$sysSection
);
$properties[] = array (G::LoadTranslation('ID_WEB_SERVER') ,getenv( 'SERVER_SOFTWARE' ),$sysSection
$properties[] = array(G::LoadTranslation('ID_WEB_SERVER') ,getenv('SERVER_SOFTWARE'),$sysSection
);
$properties[] = array (G::LoadTranslation('ID_SERVER_NAME') ,getenv( 'SERVER_NAME' ),$pmSection
$properties[] = array(G::LoadTranslation('ID_SERVER_NAME') ,getenv('SERVER_NAME'),$pmSection
);
$properties[] = array (G::LoadTranslation('ID_SERVER_IP') ,$this->lookup( $ip ),$sysSection
$properties[] = array(G::LoadTranslation('ID_SERVER_IP') ,$this->lookup($ip),$sysSection
);
$properties[] = array (G::LoadTranslation('ID_PHP_VERSION') ,phpversion(),$sysSection
$properties[] = array(G::LoadTranslation('ID_PHP_VERSION') ,phpversion(),$sysSection
);
if (defined( "DB_HOST" )) {
$properties[] = array (G::LoadTranslation('ID_DATABASE') ,$dbNetView->dbName( DB_ADAPTER ) . ' (Version ' . $sMySQLVersion . ')',$pmSection
if (defined("DB_HOST")) {
$properties[] = array(G::LoadTranslation('ID_DATABASE') ,$dbNetView->dbName(DB_ADAPTER) . ' (Version ' . $sMySQLVersion . ')',$pmSection
);
$properties[] = array (G::LoadTranslation('ID_DATABASE_SERVER') ,DB_HOST,$pmSection
$properties[] = array(G::LoadTranslation('ID_DATABASE_SERVER') ,DB_HOST,$pmSection
);
$properties[] = array (G::LoadTranslation('ID_DATABASE_NAME') ,DB_NAME,$pmSection
$properties[] = array(G::LoadTranslation('ID_DATABASE_NAME') ,DB_NAME,$pmSection
);
$properties[] = array (G::LoadTranslation('ID_AVAILABLE_DB') ,$availdb,$sysSection
$properties[] = array(G::LoadTranslation('ID_AVAILABLE_DB') ,$availdb,$sysSection
);
} else {
$properties[] = array (G::LoadTranslation('ID_DATABASE') ,"Not defined",$pmSection
$properties[] = array(G::LoadTranslation('ID_DATABASE') ,"Not defined",$pmSection
);
$properties[] = array (G::LoadTranslation('ID_DATABASE_SERVER') ,"Not defined",$pmSection
$properties[] = array(G::LoadTranslation('ID_DATABASE_SERVER') ,"Not defined",$pmSection
);
$properties[] = array (G::LoadTranslation('ID_DATABASE_NAME') ,"Not defined",$pmSection
$properties[] = array(G::LoadTranslation('ID_DATABASE_NAME') ,"Not defined",$pmSection
);
$properties[] = array (G::LoadTranslation('ID_AVAILABLE_DB') ,"Not defined",$sysSection
$properties[] = array(G::LoadTranslation('ID_AVAILABLE_DB') ,"Not defined",$sysSection
);
}
$properties[] = array ( G::LoadTranslation('ID_WORKSPACE') ,!empty(config("system.workspace")) ? config("system.workspace") : "Not defined",$pmSection
);
$properties[] = array ( G::LoadTranslation('ID_SERVER_PROTOCOL') ,getenv( 'SERVER_PROTOCOL' ),$sysSection
$properties[] = array( G::LoadTranslation('ID_SERVER_PROTOCOL') ,getenv('SERVER_PROTOCOL'),$sysSection
);
$properties[] = array ( G::LoadTranslation('ID_SERVER_PORT') ,getenv( 'SERVER_PORT' ),$sysSection
$properties[] = array( G::LoadTranslation('ID_SERVER_PORT') ,getenv('SERVER_PORT'),$sysSection
);
//$sysSection[] = array('Remote Host', getenv ('REMOTE_HOST'), $sysSection);
$properties[] = array ( G::LoadTranslation('ID_SERVER_NAME') , getenv( 'SERVER_ADDR' ),$sysSection
$properties[] = array( G::LoadTranslation('ID_SERVER_NAME') , getenv('SERVER_ADDR'),$sysSection
);
$properties[] = array ( G::LoadTranslation('ID_USER_BROWSER') , getenv( 'HTTP_USER_AGENT' ),$sysSection
$properties[] = array( G::LoadTranslation('ID_USER_BROWSER') , getenv('HTTP_USER_AGENT'),$sysSection
);
return $properties;
}
private function lookup ($target)
private function lookup($target)
{
global $ntarget;
$msg = $target . ' => ';
//if (eregi ('[a-zA-Z]', $target))
if (preg_match( '[a-zA-Z]', $target )) {
if (preg_match('[a-zA-Z]', $target)) {
//Made compatible to PHP 5.3
$ntarget = gethostbyname( $target );
$ntarget = gethostbyname($target);
} else {
$ntarget = gethostbyaddr( $target );
$ntarget = gethostbyaddr($target);
}
$msg .= $ntarget;
return ($msg);
@@ -816,11 +815,10 @@ class Main extends Controller
/**
* Execute common reoutes after index() action load
*/
private function afterLoad ($httpData)
private function afterLoad($httpData)
{
if (isset( $httpData->i18 ) || isset( $httpData->i18n )) {
if (isset($httpData->i18) || isset($httpData->i18n)) {
$_SESSION['DEV_FLAG'] = true;
}
}
}

View File

@@ -18,8 +18,6 @@ class pmGmail extends Controller
$httpData->serviceDriveStatus = !empty($httpData->serviceDriveStatus) ? $httpData->serviceDriveStatus == 1 ? true : false : false;
if ($httpData->serviceGmailStatus || $httpData->serviceDriveStatus) {
$pmGoogle->setServiceGmailStatus($httpData->serviceGmailStatus);
$pmGoogle->setServiceDriveStatus($httpData->serviceDriveStatus);
@@ -58,7 +56,7 @@ class pmGmail extends Controller
{
try {
$this->includeExtJS('admin/pmGmail');
if (!empty ($_SESSION['__PMGMAIL_ERROR__'])) {
if (!empty($_SESSION['__PMGMAIL_ERROR__'])) {
$this->setJSVar('__PMGMAIL_ERROR__', $_SESSION['__PMGMAIL_ERROR__']);
unset($_SESSION['__PMGMAIL_ERROR__']);
}
@@ -70,7 +68,7 @@ class pmGmail extends Controller
$disableGmail = true;
$disableDrive = true;
$licensedFeatures = &PMLicensedFeatures::getSingleton();
$licensedFeatures = PMLicensedFeatures::getSingleton();
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
$disableGmail = false;
}

View File

@@ -19,14 +19,14 @@ class StrategicDashboard extends Controller
private $usrUnitCost;
// Class constructor
public function __construct ()
public function __construct()
{
global $RBAC;
$licensedFeatures = & PMLicensedFeatures::getSingleton();
$licensedFeatures = PMLicensedFeatures::getSingleton();
if (!$licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=')) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
}
$this->usrId = $RBAC->aUserInfo['USER_INFO']['USR_UID'];
@@ -70,8 +70,7 @@ class StrategicDashboard extends Controller
$result = '$';
if (isset($user['USR_UNIT_COST']) && !empty($user['USR_UNIT_COST'])) {
$result = $user['USR_UNIT_COST'];
}
else {
} else {
$processModel = new Process();
$processList = $processModel->getAllConfiguredCurrencies();
$defaultProcessCurrency = '';
@@ -124,74 +123,72 @@ class StrategicDashboard extends Controller
// Functions for the StrategicDashboards
public function dashboardList ()
public function dashboardList()
{
try {
$this->includeExtJS( 'strategicDashboard/dashboardList' );
if (isset( $_SESSION['__StrategicDashboard_ERROR__'] )) {
$this->setJSVar( '__StrategicDashboard_ERROR__', $_SESSION['__StrategicDashboard_ERROR__'] );
unset( $_SESSION['__StrategicDashboard_ERROR__'] );
$this->includeExtJS('strategicDashboard/dashboardList');
if (isset($_SESSION['__StrategicDashboard_ERROR__'])) {
$this->setJSVar('__StrategicDashboard_ERROR__', $_SESSION['__StrategicDashboard_ERROR__']);
unset($_SESSION['__StrategicDashboard_ERROR__']);
}
$this->setView( 'strategicDashboard/dashboardList' );
$this->setView('strategicDashboard/dashboardList');
$this->setJSVar('urlProxy',$this->urlProxy);
$this->setJSVar('credentials',$this->clientToken);
G::RenderPage( 'publish', 'extJs' );
$this->setJSVar('urlProxy', $this->urlProxy);
$this->setJSVar('credentials', $this->clientToken);
G::RenderPage('publish', 'extJs');
} catch (Exception $error) {
$_SESSION['__DASHBOARD_ERROR__'] = $error->getMessage();
die();
}
}
public function formDashboard ($data)
public function formDashboard($data)
{
try {
$this->includeExtJS( 'strategicDashboard/formDashboard', true, true );
$this->setView( 'strategicDashboard/formDashboard' );
$this->includeExtJS('strategicDashboard/formDashboard', true, true);
$this->setView('strategicDashboard/formDashboard');
$this->setJSVar('DAS_UID', '');
$this->setJSVar('urlProxy',$this->urlProxy);
$this->setJSVar('credentials',$this->clientToken);
$this->setJSVar('urlProxy', $this->urlProxy);
$this->setJSVar('credentials', $this->clientToken);
G::RenderPage( 'publish', 'extJs' );
G::RenderPage('publish', 'extJs');
return null;
} catch (Exception $error) {
$_SESSION['__DASHBOARD_ERROR__'] = $error->getMessage();
G::header( 'Location: dashboardList' );
G::header('Location: dashboardList');
die();
}
}
public function formEditDashboard ($data)
public function formEditDashboard($data)
{
try {
$this->includeExtJS( 'strategicDashboard/formDashboard', true, true );
$this->setView( 'strategicDashboard/formDashboard' );
$this->includeExtJS('strategicDashboard/formDashboard', true, true);
$this->setView('strategicDashboard/formDashboard');
$dasUid = isset($_REQUEST['DAS_UID']) ? $_REQUEST['DAS_UID'] : '';
$this->setJSVar('DAS_UID', $dasUid);
$this->setJSVar('urlProxy',$this->urlProxy);
$this->setJSVar('credentials',$this->clientToken);
$this->setJSVar('urlProxy', $this->urlProxy);
$this->setJSVar('credentials', $this->clientToken);
G::RenderPage( 'publish', 'extJs' );
G::RenderPage('publish', 'extJs');
return null;
} catch (Exception $error) {
$_SESSION['__DASHBOARD_ERROR__'] = $error->getMessage();
G::header( 'Location: dashboardList' );
G::header('Location: dashboardList');
die();
}
}
public function viewDashboard ()
public function viewDashboard()
{
try {
if (isset( $_SESSION['__StrategicDashboard_ERROR__'] )) {
$this->setJSVar( '__StrategicDashboard_ERROR__', $_SESSION['__StrategicDashboard_ERROR__'] );
unset( $_SESSION['__StrategicDashboard_ERROR__'] );
if (isset($_SESSION['__StrategicDashboard_ERROR__'])) {
$this->setJSVar('__StrategicDashboard_ERROR__', $_SESSION['__StrategicDashboard_ERROR__']);
unset($_SESSION['__StrategicDashboard_ERROR__']);
}
$this->setView( 'strategicDashboard/viewDashboard' );
$this->setView('strategicDashboard/viewDashboard');
$this->setVar('urlProxy', $this->urlProxy);
$this->setVar('SYS_SYS', config("system.workspace"));
@@ -199,7 +196,7 @@ class StrategicDashboard extends Controller
$this->setVar('credentials', $this->clientToken);
$this->setVar('unitCost', $this->usrUnitCost);
$translation = $this->getTranslations();
$translation = $this->getTranslations();
$this->setVar('translation', $translation);
$this->render();
} catch (Exception $error) {
@@ -208,16 +205,16 @@ class StrategicDashboard extends Controller
}
}
public function viewDashboardIE ()
public function viewDashboardIE()
{
try {
$this->setView( 'strategicDashboard/viewDashboardIE' );
$this->setView('strategicDashboard/viewDashboardIE');
$this->setVar('urlProxy', $this->urlProxy);
$this->setVar('usrId', $this->usrId);
$this->setVar('credentials', $this->clientToken);
$this->setVar('unitCost', $this->usrUnitCost);
$translation = $this->getTranslations();
$translation = $this->getTranslations();
$this->setVar('translation', $translation);
$this->render();
} catch (Exception $error) {
@@ -227,59 +224,60 @@ class StrategicDashboard extends Controller
}
}
private function getTranslations() {
$translation = array();
$translation['ID_MANAGERS_DASHBOARDS'] = G::LoadTranslation( 'ID_MANAGERS_DASHBOARDS');
$translation['ID_PRO_EFFICIENCY_INDEX'] = G::LoadTranslation( 'ID_PRO_EFFICIENCY_INDEX');
$translation['ID_EFFICIENCY_USER'] = G::LoadTranslation( 'ID_EFFICIENCY_USER');
$translation['ID_COMPLETED_CASES'] = G::LoadTranslation( 'ID_COMPLETED_CASES');
$translation['ID_WELL_DONE'] = G::LoadTranslation( 'ID_WELL_DONE');
$translation['ID_NUMBER_CASES'] = G::LoadTranslation( 'ID_NUMBER_CASES');
$translation['ID_EFFICIENCY_INDEX'] = G::LoadTranslation( 'ID_EFFICIENCY_INDEX');
$translation['ID_INEFFICIENCY_COST'] = G::LoadTranslation( 'ID_INEFFICIENCY_COST');
$translation['ID_EFFICIENCY_COST'] = G::LoadTranslation( 'ID_EFFICIENCY_COST');
$translation['ID_RELATED_PROCESS'] = G::LoadTranslation( 'ID_RELATED_PROCESS');
$translation['ID_RELATED_GROUPS'] = G::LoadTranslation( 'ID_RELATED_GROUPS');
$translation['ID_RELATED_TASKS'] = G::LoadTranslation( 'ID_RELATED_TASKS');
$translation['ID_RELATED_USERS'] = G::LoadTranslation( 'ID_RELATED_USERS');
$translation['ID_GRID_PAGE_NO_DASHBOARD_MESSAGE'] = G::LoadTranslation( 'ID_GRID_PAGE_NO_DASHBOARD_MESSAGE');
$translation['ID_PROCESS_TASKS'] = G::LoadTranslation( 'ID_PROCESS_TASKS');
$translation['ID_TIME_HOURS'] = G::LoadTranslation( 'ID_TIME_HOURS');
$translation['ID_GROUPS'] = G::LoadTranslation( 'ID_GROUPS');
$translation['ID_COSTS'] = G::LoadTranslation( 'ID_COSTS');
$translation['ID_TASK'] = G::LoadTranslation( 'ID_TASK');
$translation['ID_USER'] = G::LoadTranslation( 'ID_USER');
$translation['ID_YEAR'] = G::LoadTranslation( 'ID_YEAR');
$translation['ID_USERS'] = G::LoadTranslation( 'ID_USERS');
$translation['ID_USERS'] = G::LoadTranslation( 'ID_USERS');
$translation['ID_OVERDUE'] = G::LoadTranslation( 'ID_OVERDUE');
$translation['ID_AT_RISK'] = G::LoadTranslation( 'ID_AT_RISK');
$translation['ID_ON_TIME'] = G::LoadTranslation( 'ID_ON_TIME');
$translation['ID_NO_INEFFICIENT_PROCESSES'] = G::LoadTranslation('ID_NO_INEFFICIENT_PROCESSES');
$translation['ID_NO_INEFFICIENT_TASKS'] = G::LoadTranslation('ID_NO_INEFFICIENT_TASKS');
$translation['ID_NO_INEFFICIENT_USER_GROUPS'] = G::LoadTranslation('ID_NO_INEFFICIENT_USER_GROUPS');
$translation['ID_NO_INEFFICIENT_USERS'] = G::LoadTranslation('ID_NO_INEFFICIENT_USERS');
$translation['ID_DISPLAY_EMPTY'] = G::LoadTranslation('ID_DISPLAY_EMPTY');
$translation['ID_INBOX_EMPTY'] = G::LoadTranslation('ID_INBOX_EMPTY');
$translation['ID_INDICATOR'] = G::LoadTranslation('ID_INDICATOR');
$translation['ID_PERIODICITY'] = G::LoadTranslation('ID_PERIODICITY');
$translation['ID_MONTH'] = G::LoadTranslation('ID_MONTH');
$translation['ID_QUARTER'] = G::LoadTranslation('ID_QUARTER');
$translation['ID_SEMESTER'] = G::LoadTranslation('ID_SEMESTER');
$translation['ID_TO'] = G::LoadTranslation('ID_TO');
$translation['ID_FROM'] = G::LoadTranslation('ID_FROM');
$translation['ID_MONTH_ABB_1'] = G::LoadTranslation('ID_MONTH_ABB_1');
$translation['ID_MONTH_ABB_2'] = G::LoadTranslation('ID_MONTH_ABB_2');
$translation['ID_MONTH_ABB_3'] = G::LoadTranslation('ID_MONTH_ABB_3');
$translation['ID_MONTH_ABB_4'] = G::LoadTranslation('ID_MONTH_ABB_4');
$translation['ID_MONTH_ABB_5'] = G::LoadTranslation('ID_MONTH_ABB_5');
$translation['ID_MONTH_ABB_6'] = G::LoadTranslation('ID_MONTH_ABB_6');
$translation['ID_MONTH_ABB_7'] = G::LoadTranslation('ID_MONTH_ABB_7');
$translation['ID_MONTH_ABB_8'] = G::LoadTranslation('ID_MONTH_ABB_8');
$translation['ID_MONTH_ABB_9'] = G::LoadTranslation('ID_MONTH_ABB_9');
$translation['ID_MONTH_ABB_10'] = G::LoadTranslation('ID_MONTH_ABB_10');
$translation['ID_MONTH_ABB_11'] = G::LoadTranslation('ID_MONTH_ABB_11');
$translation['ID_MONTH_ABB_12'] = G::LoadTranslation('ID_MONTH_ABB_12');
return $translation;
}
private function getTranslations()
{
$translation = array();
$translation['ID_MANAGERS_DASHBOARDS'] = G::LoadTranslation('ID_MANAGERS_DASHBOARDS');
$translation['ID_PRO_EFFICIENCY_INDEX'] = G::LoadTranslation('ID_PRO_EFFICIENCY_INDEX');
$translation['ID_EFFICIENCY_USER'] = G::LoadTranslation('ID_EFFICIENCY_USER');
$translation['ID_COMPLETED_CASES'] = G::LoadTranslation('ID_COMPLETED_CASES');
$translation['ID_WELL_DONE'] = G::LoadTranslation('ID_WELL_DONE');
$translation['ID_NUMBER_CASES'] = G::LoadTranslation('ID_NUMBER_CASES');
$translation['ID_EFFICIENCY_INDEX'] = G::LoadTranslation('ID_EFFICIENCY_INDEX');
$translation['ID_INEFFICIENCY_COST'] = G::LoadTranslation('ID_INEFFICIENCY_COST');
$translation['ID_EFFICIENCY_COST'] = G::LoadTranslation('ID_EFFICIENCY_COST');
$translation['ID_RELATED_PROCESS'] = G::LoadTranslation('ID_RELATED_PROCESS');
$translation['ID_RELATED_GROUPS'] = G::LoadTranslation('ID_RELATED_GROUPS');
$translation['ID_RELATED_TASKS'] = G::LoadTranslation('ID_RELATED_TASKS');
$translation['ID_RELATED_USERS'] = G::LoadTranslation('ID_RELATED_USERS');
$translation['ID_GRID_PAGE_NO_DASHBOARD_MESSAGE'] = G::LoadTranslation('ID_GRID_PAGE_NO_DASHBOARD_MESSAGE');
$translation['ID_PROCESS_TASKS'] = G::LoadTranslation('ID_PROCESS_TASKS');
$translation['ID_TIME_HOURS'] = G::LoadTranslation('ID_TIME_HOURS');
$translation['ID_GROUPS'] = G::LoadTranslation('ID_GROUPS');
$translation['ID_COSTS'] = G::LoadTranslation('ID_COSTS');
$translation['ID_TASK'] = G::LoadTranslation('ID_TASK');
$translation['ID_USER'] = G::LoadTranslation('ID_USER');
$translation['ID_YEAR'] = G::LoadTranslation('ID_YEAR');
$translation['ID_USERS'] = G::LoadTranslation('ID_USERS');
$translation['ID_USERS'] = G::LoadTranslation('ID_USERS');
$translation['ID_OVERDUE'] = G::LoadTranslation('ID_OVERDUE');
$translation['ID_AT_RISK'] = G::LoadTranslation('ID_AT_RISK');
$translation['ID_ON_TIME'] = G::LoadTranslation('ID_ON_TIME');
$translation['ID_NO_INEFFICIENT_PROCESSES'] = G::LoadTranslation('ID_NO_INEFFICIENT_PROCESSES');
$translation['ID_NO_INEFFICIENT_TASKS'] = G::LoadTranslation('ID_NO_INEFFICIENT_TASKS');
$translation['ID_NO_INEFFICIENT_USER_GROUPS'] = G::LoadTranslation('ID_NO_INEFFICIENT_USER_GROUPS');
$translation['ID_NO_INEFFICIENT_USERS'] = G::LoadTranslation('ID_NO_INEFFICIENT_USERS');
$translation['ID_DISPLAY_EMPTY'] = G::LoadTranslation('ID_DISPLAY_EMPTY');
$translation['ID_INBOX_EMPTY'] = G::LoadTranslation('ID_INBOX_EMPTY');
$translation['ID_INDICATOR'] = G::LoadTranslation('ID_INDICATOR');
$translation['ID_PERIODICITY'] = G::LoadTranslation('ID_PERIODICITY');
$translation['ID_MONTH'] = G::LoadTranslation('ID_MONTH');
$translation['ID_QUARTER'] = G::LoadTranslation('ID_QUARTER');
$translation['ID_SEMESTER'] = G::LoadTranslation('ID_SEMESTER');
$translation['ID_TO'] = G::LoadTranslation('ID_TO');
$translation['ID_FROM'] = G::LoadTranslation('ID_FROM');
$translation['ID_MONTH_ABB_1'] = G::LoadTranslation('ID_MONTH_ABB_1');
$translation['ID_MONTH_ABB_2'] = G::LoadTranslation('ID_MONTH_ABB_2');
$translation['ID_MONTH_ABB_3'] = G::LoadTranslation('ID_MONTH_ABB_3');
$translation['ID_MONTH_ABB_4'] = G::LoadTranslation('ID_MONTH_ABB_4');
$translation['ID_MONTH_ABB_5'] = G::LoadTranslation('ID_MONTH_ABB_5');
$translation['ID_MONTH_ABB_6'] = G::LoadTranslation('ID_MONTH_ABB_6');
$translation['ID_MONTH_ABB_7'] = G::LoadTranslation('ID_MONTH_ABB_7');
$translation['ID_MONTH_ABB_8'] = G::LoadTranslation('ID_MONTH_ABB_8');
$translation['ID_MONTH_ABB_9'] = G::LoadTranslation('ID_MONTH_ABB_9');
$translation['ID_MONTH_ABB_10'] = G::LoadTranslation('ID_MONTH_ABB_10');
$translation['ID_MONTH_ABB_11'] = G::LoadTranslation('ID_MONTH_ABB_11');
$translation['ID_MONTH_ABB_12'] = G::LoadTranslation('ID_MONTH_ABB_12');
return $translation;
}
}