HOR-4676
This commit is contained in:
@@ -39,19 +39,19 @@ try {
|
||||
//Set variables
|
||||
$osIsLinux = strtoupper(substr(PHP_OS, 0, 3)) != 'WIN';
|
||||
|
||||
$pathHome = $argv[1];
|
||||
$pathTrunk = $argv[2];
|
||||
$pathHome = $argv[1];
|
||||
$pathTrunk = $argv[2];
|
||||
$pathOutTrunk = $argv[3];
|
||||
$cronName = $argv[4];
|
||||
$workspace = $argv[5];
|
||||
$dateSystem = $argv[6];
|
||||
$sNow = $argv[7]; //$date
|
||||
$cronName = $argv[4];
|
||||
$workspace = $argv[5];
|
||||
$dateSystem = $argv[6];
|
||||
$sNow = $argv[7]; //$date
|
||||
|
||||
//Defines constants
|
||||
define('PATH_SEP', ($osIsLinux)? '/' : '\\');
|
||||
define('PATH_SEP', ($osIsLinux) ? '/' : '\\');
|
||||
|
||||
define('PATH_HOME', $pathHome);
|
||||
define('PATH_TRUNK', $pathTrunk);
|
||||
define('PATH_HOME', $pathHome);
|
||||
define('PATH_TRUNK', $pathTrunk);
|
||||
define('PATH_OUTTRUNK', $pathOutTrunk);
|
||||
|
||||
define('PATH_CLASSES', PATH_HOME . 'engine' . PATH_SEP . 'classes' . PATH_SEP);
|
||||
@@ -70,33 +70,34 @@ try {
|
||||
//Add vendors to autoloader
|
||||
//$classLoader->add(PATH_TRUNK . 'vendor' . PATH_SEP . 'luracast' . PATH_SEP . 'restler' . PATH_SEP . 'vendor', 'Luracast');
|
||||
//$classLoader->add(PATH_TRUNK . 'vendor' . PATH_SEP . 'bshaffer' . PATH_SEP . 'oauth2-server-php' . PATH_SEP . 'src' . PATH_SEP, 'OAuth2');
|
||||
$classLoader->addClass('Bootstrap', PATH_TRUNK . 'gulliver' . PATH_SEP . 'system' . PATH_SEP . 'class.bootstrap.php');
|
||||
$classLoader->addClass('Bootstrap',
|
||||
PATH_TRUNK . 'gulliver' . PATH_SEP . 'system' . PATH_SEP . 'class.bootstrap.php');
|
||||
|
||||
$classLoader->addModelClassPath(PATH_TRUNK . 'workflow' . PATH_SEP . 'engine' . PATH_SEP . 'classes' . PATH_SEP . 'model' . PATH_SEP);
|
||||
|
||||
$arraySystemConfiguration = System::getSystemConfiguration('', '', $workspace);
|
||||
|
||||
$e_all = (defined('E_DEPRECATED'))? E_ALL & ~E_DEPRECATED : E_ALL;
|
||||
$e_all = (defined('E_STRICT'))? $e_all & ~E_STRICT : $e_all;
|
||||
$e_all = ($arraySystemConfiguration['debug'])? $e_all : $e_all & ~E_NOTICE;
|
||||
$e_all = (defined('E_DEPRECATED')) ? E_ALL & ~E_DEPRECATED : E_ALL;
|
||||
$e_all = (defined('E_STRICT')) ? $e_all & ~E_STRICT : $e_all;
|
||||
$e_all = ($arraySystemConfiguration['debug']) ? $e_all : $e_all & ~E_NOTICE;
|
||||
|
||||
app()->useStoragePath(realpath(PATH_DATA));
|
||||
app()->make(Kernel::class)->bootstrap();
|
||||
restore_error_handler();
|
||||
//Do not change any of these settings directly, use env.ini instead
|
||||
ini_set('display_errors', $arraySystemConfiguration['debug']);
|
||||
ini_set('display_errors', $arraySystemConfiguration['debug']);
|
||||
ini_set('error_reporting', $e_all);
|
||||
ini_set('short_open_tag', 'On');
|
||||
ini_set('short_open_tag', 'On');
|
||||
ini_set('default_charset', 'UTF-8');
|
||||
//ini_set('memory_limit', $arraySystemConfiguration['memory_limit']);
|
||||
ini_set('soap.wsdl_cache_enabled', $arraySystemConfiguration['wsdl_cache']);
|
||||
ini_set('date.timezone', $arraySystemConfiguration['time_zone']);
|
||||
|
||||
define('DEBUG_SQL_LOG', $arraySystemConfiguration['debug_sql']);
|
||||
define('DEBUG_SQL_LOG', $arraySystemConfiguration['debug_sql']);
|
||||
define('DEBUG_TIME_LOG', $arraySystemConfiguration['debug_time']);
|
||||
define('DEBUG_CALENDAR_LOG', $arraySystemConfiguration['debug_calendar']);
|
||||
define('MEMCACHED_ENABLED', $arraySystemConfiguration['memcached']);
|
||||
define('MEMCACHED_SERVER', $arraySystemConfiguration['memcached_server']);
|
||||
define('MEMCACHED_ENABLED', $arraySystemConfiguration['memcached']);
|
||||
define('MEMCACHED_SERVER', $arraySystemConfiguration['memcached_server']);
|
||||
|
||||
//require_once(PATH_GULLIVER . PATH_SEP . 'class.bootstrap.php');
|
||||
//define('PATH_GULLIVER_HOME', PATH_TRUNK . 'gulliver' . PATH_SEP);
|
||||
@@ -105,7 +106,7 @@ try {
|
||||
|
||||
//Set variables
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$dateInit = null;
|
||||
$dateInit = null;
|
||||
$dateFinish = null;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
@@ -115,12 +116,12 @@ try {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (strpos($argv[$i], '+init-date') !== false) {
|
||||
$dateInit = substr($argv[$i], 10);
|
||||
} else if (strpos($argv[$i], '+finish-date') !== false) {
|
||||
} elseif (strpos($argv[$i], '+finish-date') !== false) {
|
||||
$dateFinish = substr($argv[$i], 12);
|
||||
} else {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$argvx = $argvx . (($argvx != '')? ' ' : '') . $argv[$i];
|
||||
/*----------------------------------********---------------------------------*/
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$argvx = $argvx . (($argvx != '') ? ' ' : '') . $argv[$i];
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
@@ -138,12 +139,12 @@ try {
|
||||
include_once(PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php');
|
||||
|
||||
//PM Paths DATA
|
||||
define('PATH_DATA_SITE', PATH_DATA . 'sites/' . config("system.workspace") . '/');
|
||||
define('PATH_DOCUMENT', PATH_DATA_SITE . 'files/');
|
||||
define('PATH_DATA_MAILTEMPLATES', PATH_DATA_SITE . 'mailTemplates/');
|
||||
define('PATH_DATA_PUBLIC', PATH_DATA_SITE . 'public/');
|
||||
define('PATH_DATA_REPORTS', PATH_DATA_SITE . 'reports/');
|
||||
define('PATH_DYNAFORM', PATH_DATA_SITE . 'xmlForms/');
|
||||
define('PATH_DATA_SITE', PATH_DATA . 'sites/' . config("system.workspace") . '/');
|
||||
define('PATH_DOCUMENT', PATH_DATA_SITE . 'files/');
|
||||
define('PATH_DATA_MAILTEMPLATES', PATH_DATA_SITE . 'mailTemplates/');
|
||||
define('PATH_DATA_PUBLIC', PATH_DATA_SITE . 'public/');
|
||||
define('PATH_DATA_REPORTS', PATH_DATA_SITE . 'reports/');
|
||||
define('PATH_DYNAFORM', PATH_DATA_SITE . 'xmlForms/');
|
||||
define('PATH_IMAGES_ENVIRONMENT_FILES', PATH_DATA_SITE . 'usersFiles' . PATH_SEP);
|
||||
define('PATH_IMAGES_ENVIRONMENT_USERS', PATH_DATA_SITE . 'usersPhotographies' . PATH_SEP);
|
||||
|
||||
@@ -167,7 +168,8 @@ try {
|
||||
while (!feof($fileDb)) {
|
||||
$buffer = fgets($fileDb, 4096); //Read a line
|
||||
|
||||
$phpCode .= preg_replace('/define\s*\(\s*[\x22\x27](.*)[\x22\x27]\s*,\s*(\x22.*\x22|\x27.*\x27)\s*\)\s*;/i', '$$1 = $2;', $buffer);
|
||||
$phpCode .= preg_replace('/define\s*\(\s*[\x22\x27](.*)[\x22\x27]\s*,\s*(\x22.*\x22|\x27.*\x27)\s*\)\s*;/i',
|
||||
'$$1 = $2;', $buffer);
|
||||
}
|
||||
|
||||
fclose($fileDb);
|
||||
@@ -177,9 +179,9 @@ try {
|
||||
|
||||
eval($phpCode);
|
||||
|
||||
$dsn = $DB_ADAPTER . '://' . $DB_USER . ':' . $DB_PASS . '@' . $DB_HOST . '/' . $DB_NAME;
|
||||
$dsn = $DB_ADAPTER . '://' . $DB_USER . ':' . $DB_PASS . '@' . $DB_HOST . '/' . $DB_NAME;
|
||||
$dsnRbac = $DB_ADAPTER . '://' . $DB_RBAC_USER . ':' . $DB_RBAC_PASS . '@' . $DB_RBAC_HOST . '/' . $DB_RBAC_NAME;
|
||||
$dsnRp = $DB_ADAPTER . '://' . $DB_REPORT_USER . ':' . $DB_REPORT_PASS . '@' . $DB_REPORT_HOST . '/' . $DB_REPORT_NAME;
|
||||
$dsnRp = $DB_ADAPTER . '://' . $DB_REPORT_USER . ':' . $DB_REPORT_PASS . '@' . $DB_REPORT_HOST . '/' . $DB_REPORT_NAME;
|
||||
|
||||
switch ($DB_ADAPTER) {
|
||||
case 'mysql':
|
||||
@@ -212,7 +214,7 @@ try {
|
||||
//Creole::registerDriver('dbarray', 'creole.contrib.DBArrayConnection');
|
||||
|
||||
//Enable RBAC
|
||||
$rbac = &RBAC::getSingleton(PATH_DATA, session_id());
|
||||
$rbac = RBAC::getSingleton(PATH_DATA, session_id());
|
||||
$rbac->sSystem = 'PROCESSMAKER';
|
||||
|
||||
if (!defined('DB_ADAPTER')) {
|
||||
@@ -228,7 +230,7 @@ try {
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
ini_set('date.timezone', ($systemUtcTimeZone)? 'UTC' : $arraySystemConfiguration['time_zone']); //Set Time Zone
|
||||
ini_set('date.timezone', ($systemUtcTimeZone) ? 'UTC' : $arraySystemConfiguration['time_zone']); //Set Time Zone
|
||||
|
||||
define('TIME_ZONE', ini_get('date.timezone'));
|
||||
|
||||
@@ -268,7 +270,7 @@ try {
|
||||
} catch (Exception $e) {
|
||||
$token = strtotime("now");
|
||||
PMException::registerErrorLog($e, $token);
|
||||
G::outRes( G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)) . "\n" );
|
||||
G::outRes(G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)) . "\n");
|
||||
|
||||
eprintln('Problem in workspace: ' . $workspace . ' it was omitted.', 'red');
|
||||
}
|
||||
@@ -282,7 +284,7 @@ try {
|
||||
} catch (Exception $e) {
|
||||
$token = strtotime("now");
|
||||
PMException::registerErrorLog($e, $token);
|
||||
G::outRes( G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)) . "\n" );
|
||||
G::outRes(G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)) . "\n");
|
||||
}
|
||||
|
||||
//Functions
|
||||
@@ -353,7 +355,7 @@ function resendEmails()
|
||||
|
||||
if ($aSpoolWarnings !== false) {
|
||||
foreach ($aSpoolWarnings as $sWarning) {
|
||||
print("MAIL SPOOL WARNING: " . $sWarning."\n");
|
||||
print("MAIL SPOOL WARNING: " . $sWarning . "\n");
|
||||
saveLog("resendEmails", "warning", "MAIL SPOOL WARNING: " . $sWarning);
|
||||
}
|
||||
}
|
||||
@@ -366,7 +368,7 @@ function resendEmails()
|
||||
$c->add(ConfigurationPeer::CFG_UID, "Emails");
|
||||
$result = ConfigurationPeer::doSelectRS($c);
|
||||
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
if($result->next()) {
|
||||
if ($result->next()) {
|
||||
setExecutionResultMessage("WARNING", "warning");
|
||||
$message = "Emails won't be sent, but the cron will continue its execution";
|
||||
eprintln(" '-" . $message, "yellow");
|
||||
@@ -398,7 +400,7 @@ function unpauseApplications()
|
||||
saveLog('unpauseApplications', 'action', 'Unpausing Applications');
|
||||
} catch (Exception $oError) {
|
||||
setExecutionResultMessage('WITH ERRORS', 'error');
|
||||
eprintln(" '-".$oError->getMessage(), 'red');
|
||||
eprintln(" '-" . $oError->getMessage(), 'red');
|
||||
saveLog('unpauseApplications', 'error', 'Error Unpausing Applications: ' . $oError->getMessage());
|
||||
}
|
||||
}
|
||||
@@ -421,8 +423,8 @@ function executePlugins()
|
||||
if ($handle = opendir($pathCronPlugins)) {
|
||||
setExecutionMessage('Executing cron files in bin/plugins directory in Workspace: ' . config("system.workspace"));
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if (strpos($file, '.php',1) && is_file($pathCronPlugins . $file)) {
|
||||
$filename = str_replace('.php' , '', $file);
|
||||
if (strpos($file, '.php', 1) && is_file($pathCronPlugins . $file)) {
|
||||
$filename = str_replace('.php', '', $file);
|
||||
$className = $filename . 'ClassCron';
|
||||
|
||||
// Execute custom cron function
|
||||
@@ -452,8 +454,8 @@ function executePlugins()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function executeCustomCronFunction($pathFile, $className)
|
||||
{
|
||||
include_once $pathFile;
|
||||
@@ -463,7 +465,7 @@ function executeCustomCronFunction($pathFile, $className)
|
||||
if (method_exists($oPlugin, 'executeCron')) {
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$arrayCron["processcTimeProcess"] = 60; //Minutes
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
|
||||
//Try to execute Plugin Cron. If there is an error then continue with the next file
|
||||
@@ -473,7 +475,7 @@ function executeCustomCronFunction($pathFile, $className)
|
||||
setExecutionResultMessage('DONE');
|
||||
} catch (Exception $e) {
|
||||
setExecutionResultMessage('FAILED', 'error');
|
||||
eprintln(" '-".$e->getMessage(), 'red');
|
||||
eprintln(" '-" . $e->getMessage(), 'red');
|
||||
saveLog('executePlugins', 'error', 'Error executing cron file: ' . $pathFile . ' - ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
@@ -497,7 +499,7 @@ function calculateDuration()
|
||||
saveLog('calculateDuration', 'action', 'Calculating Duration');
|
||||
} catch (Exception $oError) {
|
||||
setExecutionResultMessage('WITH ERRORS', 'error');
|
||||
eprintln(" '-".$oError->getMessage(), 'red');
|
||||
eprintln(" '-" . $oError->getMessage(), 'red');
|
||||
saveLog('calculateDuration', 'error', 'Error Calculating Duration: ' . $oError->getMessage());
|
||||
}
|
||||
}
|
||||
@@ -505,29 +507,30 @@ function calculateDuration()
|
||||
/*----------------------------------********---------------------------------*/
|
||||
function calculateAppDuration()
|
||||
{
|
||||
global $argvx;
|
||||
global $argvx;
|
||||
|
||||
if ($argvx != "" && strpos($argvx, "calculateapp") === false) {
|
||||
return false;
|
||||
}
|
||||
if ($argvx != "" && strpos($argvx, "calculateapp") === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
setExecutionMessage("Calculating Duration by Application");
|
||||
setExecutionMessage("Calculating Duration by Application");
|
||||
|
||||
try {
|
||||
$oApplication = new Application();
|
||||
$oApplication->calculateAppDuration(1);
|
||||
try {
|
||||
$oApplication = new Application();
|
||||
$oApplication->calculateAppDuration(1);
|
||||
|
||||
setExecutionResultMessage('DONE');
|
||||
saveLog('calculateDurationByApp', 'action', 'Calculating Duration by Application');
|
||||
} catch (Exception $oError) {
|
||||
setExecutionResultMessage('WITH ERRORS', 'error');
|
||||
eprintln(" '-".$oError->getMessage(), 'red');
|
||||
saveLog('calculateDurationByApp', 'error', 'Error Calculating Duration: ' . $oError->getMessage());
|
||||
}
|
||||
setExecutionResultMessage('DONE');
|
||||
saveLog('calculateDurationByApp', 'action', 'Calculating Duration by Application');
|
||||
} catch (Exception $oError) {
|
||||
setExecutionResultMessage('WITH ERRORS', 'error');
|
||||
eprintln(" '-" . $oError->getMessage(), 'red');
|
||||
saveLog('calculateDurationByApp', 'error', 'Error Calculating Duration: ' . $oError->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
function executeEvents($sLastExecution, $sNow=null)
|
||||
function executeEvents($sLastExecution, $sNow = null)
|
||||
{
|
||||
global $argvx;
|
||||
global $sNow;
|
||||
@@ -559,12 +562,12 @@ function executeEvents($sLastExecution, $sNow=null)
|
||||
//saveLog('executeEvents', 'action', $res );
|
||||
} catch (Exception $oError) {
|
||||
setExecutionResultMessage('WITH ERRORS', 'error');
|
||||
eprintln(" '-".$oError->getMessage(), 'red');
|
||||
eprintln(" '-" . $oError->getMessage(), 'red');
|
||||
saveLog('calculateAlertsDueDate', 'Error', 'Error Executing Events: ' . $oError->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
function executeScheduledCases($sNow=null)
|
||||
function executeScheduledCases($sNow = null)
|
||||
{
|
||||
try {
|
||||
global $argvx;
|
||||
@@ -594,14 +597,15 @@ function executeScheduledCases($sNow=null)
|
||||
setExecutionResultMessage('DONE');
|
||||
} catch (Exception $oError) {
|
||||
setExecutionResultMessage('WITH ERRORS', 'error');
|
||||
eprintln(" '-".$oError->getMessage(), 'red');
|
||||
eprintln(" '-" . $oError->getMessage(), 'red');
|
||||
}
|
||||
}
|
||||
|
||||
function runDateForScheduledCases($sNow) {
|
||||
function runDateForScheduledCases($sNow)
|
||||
{
|
||||
global $arraySystemConfiguration;
|
||||
|
||||
$runDate = isset($sNow)? $sNow : date('Y-m-d H:i:s');
|
||||
$runDate = isset($sNow) ? $sNow : date('Y-m-d H:i:s');
|
||||
|
||||
$systemUtcTimeZone = false;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
@@ -617,11 +621,10 @@ function runDateForScheduledCases($sNow) {
|
||||
//function to convert it
|
||||
$currentTimeZone = date_default_timezone_get();
|
||||
date_default_timezone_set($arraySystemConfiguration['time_zone']);
|
||||
$runDate = gmdate('Y-m-d H:i:s', strtotime($sNow));
|
||||
$runDate = gmdate('Y-m-d H:i:s', strtotime($sNow));
|
||||
date_default_timezone_set($currentTimeZone);
|
||||
}
|
||||
else {
|
||||
$runDate = gmdate('Y-m-d H:i:s');
|
||||
} else {
|
||||
$runDate = gmdate('Y-m-d H:i:s');
|
||||
}
|
||||
}
|
||||
return $runDate;
|
||||
@@ -652,7 +655,7 @@ function executeUpdateAppTitle()
|
||||
$row = $rsCriteriaConf->getRow();
|
||||
|
||||
$taskUid = $row["OBJ_UID"];
|
||||
$lang = $row["CFG_VALUE"];
|
||||
$lang = $row["CFG_VALUE"];
|
||||
|
||||
//Update case labels
|
||||
$appcv = new AppCacheView();
|
||||
@@ -723,15 +726,14 @@ function executeCaseSelfService()
|
||||
$calendar = new Calendar();
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
|
||||
$row = $rsCriteria->getRow();
|
||||
$flag = false;
|
||||
$flag = false;
|
||||
|
||||
$appcacheAppUid = $row["APP_UID"];
|
||||
$appcacheAppUid = $row["APP_UID"];
|
||||
$appcacheDelIndex = $row["DEL_INDEX"];
|
||||
$appcacheDelDelegateDate = $row["DEL_DELEGATE_DATE"];
|
||||
$appcacheAppNumber = $row["APP_NUMBER"];
|
||||
$appcacheProUid = $row["PRO_UID"];
|
||||
$appcacheProUid = $row["PRO_UID"];
|
||||
$taskUid = $row["TAS_UID"];
|
||||
$taskSelfServiceTime = intval($row["TAS_SELFSERVICE_TIME"]);
|
||||
$taskSelfServiceTimeUnit = $row["TAS_SELFSERVICE_TIME_UNIT"];
|
||||
@@ -739,32 +741,32 @@ function executeCaseSelfService()
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$taskSelfServiceJustOneExecution = $row["TAS_SELFSERVICE_EXECUTION"];
|
||||
|
||||
if($taskSelfServiceJustOneExecution == 'ONCE'){
|
||||
$criteriaSelfService = new Criteria("workflow");
|
||||
if ($taskSelfServiceJustOneExecution == 'ONCE') {
|
||||
$criteriaSelfService = new Criteria("workflow");
|
||||
|
||||
$criteriaSelfService->add(AppTimeoutActionExecutedPeer::APP_UID, $appcacheAppUid);
|
||||
$criteriaSelfService->add(AppTimeoutActionExecutedPeer::DEL_INDEX, $appcacheDelIndex);
|
||||
$criteriaSelfService->add(AppTimeoutActionExecutedPeer::APP_UID, $appcacheAppUid);
|
||||
$criteriaSelfService->add(AppTimeoutActionExecutedPeer::DEL_INDEX, $appcacheDelIndex);
|
||||
|
||||
$querySelfService = AppTimeoutActionExecutedPeer::doSelectRS($criteriaSelfService);
|
||||
$querySelfService = AppTimeoutActionExecutedPeer::doSelectRS($criteriaSelfService);
|
||||
$querySelfService->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
if ($querySelfService->next()) {
|
||||
$row = $querySelfService->getRow();
|
||||
$flag = true; //already executed
|
||||
}
|
||||
if ($querySelfService->next()) {
|
||||
$row = $querySelfService->getRow();
|
||||
$flag = true; //already executed
|
||||
}
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
if ($calendar->pmCalendarUid == '') {
|
||||
$calendar->getCalendar(null, $appcacheProUid, $taskUid);
|
||||
$calendar->getCalendarData();
|
||||
$calendar->getCalendar(null, $appcacheProUid, $taskUid);
|
||||
$calendar->getCalendarData();
|
||||
}
|
||||
|
||||
$dueDate = $calendar->calculateDate(
|
||||
$appcacheDelDelegateDate,
|
||||
$taskSelfServiceTime,
|
||||
$taskSelfServiceTimeUnit //HOURS|DAYS|MINUTES
|
||||
//1
|
||||
//1
|
||||
);
|
||||
|
||||
if (time() > $dueDate["DUE_DATE_SECONDS"] && $flag == false) {
|
||||
@@ -795,10 +797,9 @@ function executeCaseSelfService()
|
||||
$row = $rsCriteriaTgr->getRow();
|
||||
|
||||
if (is_array($row) && $row["TRI_TYPE"] == "SCRIPT") {
|
||||
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$arrayCron["processcTimeProcess"] = 60; //Minutes
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
|
||||
//Trigger
|
||||
@@ -812,13 +813,13 @@ function executeCaseSelfService()
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
//saving the case`s data if the 'Execution' is set in ONCE.
|
||||
if($taskSelfServiceJustOneExecution == "ONCE"){
|
||||
$oAppTimeoutActionExecuted = new AppTimeoutActionExecuted();
|
||||
$dataSelf = array();
|
||||
$dataSelf["APP_UID"] = $appcacheAppUid;
|
||||
$dataSelf["DEL_INDEX"] = $appcacheDelIndex;
|
||||
$dataSelf["EXECUTION_DATE"] = time();
|
||||
$oAppTimeoutActionExecuted->create($dataSelf);
|
||||
if ($taskSelfServiceJustOneExecution == "ONCE") {
|
||||
$oAppTimeoutActionExecuted = new AppTimeoutActionExecuted();
|
||||
$dataSelf = array();
|
||||
$dataSelf["APP_UID"] = $appcacheAppUid;
|
||||
$dataSelf["DEL_INDEX"] = $appcacheDelIndex;
|
||||
$dataSelf["EXECUTION_DATE"] = time();
|
||||
$oAppTimeoutActionExecuted->create($dataSelf);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$appFields["APP_DATA"] = array_merge($appFields["APP_DATA"], $oPMScript->aFields);
|
||||
@@ -868,9 +869,9 @@ function saveLog($sSource, $sType, $sDescription)
|
||||
|
||||
function setExecutionMessage($m)
|
||||
{
|
||||
$len = strlen($m);
|
||||
$len = strlen($m);
|
||||
$linesize = 60;
|
||||
$rOffset = $linesize - $len;
|
||||
$rOffset = $linesize - $len;
|
||||
|
||||
eprint("* $m");
|
||||
|
||||
@@ -879,7 +880,7 @@ function setExecutionMessage($m)
|
||||
}
|
||||
}
|
||||
|
||||
function setExecutionResultMessage($m, $t='')
|
||||
function setExecutionResultMessage($m, $t = '')
|
||||
{
|
||||
$c = 'green';
|
||||
|
||||
@@ -899,68 +900,68 @@ function setExecutionResultMessage($m, $t='')
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
function fillReportByUser ()
|
||||
function fillReportByUser()
|
||||
{
|
||||
try {
|
||||
global $argvx;
|
||||
global $dateInit;
|
||||
global $dateFinish;
|
||||
try {
|
||||
global $argvx;
|
||||
global $dateInit;
|
||||
global $dateFinish;
|
||||
|
||||
if (strpos($argvx, "report_by_user") === false) {
|
||||
return false;
|
||||
}
|
||||
if ($dateInit == null) {
|
||||
eprintln("You must enter the starting date.", "red");
|
||||
eprintln('Example: +init-date"YYYY-MM-DD HH:MM:SS" +finish-date"YYYY-MM-DD HH:MM:SS"', "red");
|
||||
return false;
|
||||
}
|
||||
if (strpos($argvx, "report_by_user") === false) {
|
||||
return false;
|
||||
}
|
||||
if ($dateInit == null) {
|
||||
eprintln("You must enter the starting date.", "red");
|
||||
eprintln('Example: +init-date"YYYY-MM-DD HH:MM:SS" +finish-date"YYYY-MM-DD HH:MM:SS"', "red");
|
||||
return false;
|
||||
}
|
||||
|
||||
$dateFinish = ($dateFinish != null) ? $dateFinish : date("Y-m-d H:i:s");
|
||||
$dateFinish = ($dateFinish != null) ? $dateFinish : date("Y-m-d H:i:s");
|
||||
|
||||
$appcv = new AppCacheView();
|
||||
$appcv->setPathToAppCacheFiles( PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP );
|
||||
setExecutionMessage("Calculating data to fill the 'User Reporting'...");
|
||||
$appcv->fillReportByUser($dateInit, $dateFinish);
|
||||
setExecutionResultMessage("DONE");
|
||||
} catch (Exception $e) {
|
||||
setExecutionResultMessage("WITH ERRORS", "error");
|
||||
eprintln(" '-" . $e->getMessage(), "red");
|
||||
saveLog("fillReportByUser", "error", "Error in fill report by user: " . $e->getMessage());
|
||||
}
|
||||
$appcv = new AppCacheView();
|
||||
$appcv->setPathToAppCacheFiles(PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP);
|
||||
setExecutionMessage("Calculating data to fill the 'User Reporting'...");
|
||||
$appcv->fillReportByUser($dateInit, $dateFinish);
|
||||
setExecutionResultMessage("DONE");
|
||||
} catch (Exception $e) {
|
||||
setExecutionResultMessage("WITH ERRORS", "error");
|
||||
eprintln(" '-" . $e->getMessage(), "red");
|
||||
saveLog("fillReportByUser", "error", "Error in fill report by user: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
function fillReportByProcess ()
|
||||
function fillReportByProcess()
|
||||
{
|
||||
try {
|
||||
global $argvx;
|
||||
global $dateInit;
|
||||
global $dateFinish;
|
||||
try {
|
||||
global $argvx;
|
||||
global $dateInit;
|
||||
global $dateFinish;
|
||||
|
||||
if (strpos($argvx, "report_by_process") === false) {
|
||||
return false;
|
||||
}
|
||||
if (strpos($argvx, "report_by_process") === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($dateInit == null) {
|
||||
eprintln("You must enter the starting date.", "red");
|
||||
eprintln('Example: +init-date"YYYY-MM-DD HH:MM:SS" +finish-date"YYYY-MM-DD HH:MM:SS"', "red");
|
||||
return false;
|
||||
}
|
||||
if ($dateInit == null) {
|
||||
eprintln("You must enter the starting date.", "red");
|
||||
eprintln('Example: +init-date"YYYY-MM-DD HH:MM:SS" +finish-date"YYYY-MM-DD HH:MM:SS"', "red");
|
||||
return false;
|
||||
}
|
||||
|
||||
$dateFinish = ($dateFinish != null) ? $dateFinish : date("Y-m-d H:i:s");
|
||||
$appcv = new AppCacheView();
|
||||
$appcv->setPathToAppCacheFiles( PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP );
|
||||
$dateFinish = ($dateFinish != null) ? $dateFinish : date("Y-m-d H:i:s");
|
||||
$appcv = new AppCacheView();
|
||||
$appcv->setPathToAppCacheFiles(PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP);
|
||||
|
||||
setExecutionMessage("Calculating data to fill the 'Process Reporting'...");
|
||||
$appcv->fillReportByProcess($dateInit, $dateFinish);
|
||||
setExecutionResultMessage("DONE");
|
||||
} catch (Exception $e) {
|
||||
setExecutionResultMessage("WITH ERRORS", "error");
|
||||
eprintln(" '-" . $e->getMessage(), "red");
|
||||
saveLog("fillReportByProcess", "error", "Error in fill report by process: " . $e->getMessage());
|
||||
}
|
||||
setExecutionMessage("Calculating data to fill the 'Process Reporting'...");
|
||||
$appcv->fillReportByProcess($dateInit, $dateFinish);
|
||||
setExecutionResultMessage("DONE");
|
||||
} catch (Exception $e) {
|
||||
setExecutionResultMessage("WITH ERRORS", "error");
|
||||
eprintln(" '-" . $e->getMessage(), "red");
|
||||
saveLog("fillReportByProcess", "error", "Error in fill report by process: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
function synchronizeDrive ()
|
||||
function synchronizeDrive()
|
||||
{
|
||||
try {
|
||||
global $argvx;
|
||||
@@ -968,7 +969,7 @@ function synchronizeDrive ()
|
||||
if (strpos($argvx, "synchronize-documents-drive") === false) {
|
||||
return false;
|
||||
}
|
||||
$licensedFeatures = &PMLicensedFeatures::getSingleton();
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('AhKNjBEVXZlWUFpWE8wVTREQ0FObmo0aTdhVzhvalFic1M=')) {
|
||||
$drive = new AppDocumentDrive();
|
||||
if ($drive->getStatusDrive()) {
|
||||
@@ -981,7 +982,6 @@ function synchronizeDrive ()
|
||||
setExecutionMessage("The Drive license is not enabled");
|
||||
}
|
||||
setExecutionResultMessage("DONE");
|
||||
|
||||
} catch (Exception $e) {
|
||||
setExecutionResultMessage("WITH ERRORS", "error");
|
||||
eprintln(" '-" . $e->getMessage(), "red");
|
||||
@@ -997,7 +997,7 @@ function synchronizeGmailLabels()
|
||||
if (strpos($argvx, "synchronize-gmail-labels") === false) {
|
||||
return false;
|
||||
}
|
||||
$licensedFeatures = &PMLicensedFeatures::getSingleton();
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
|
||||
$pmGoogle = new PmGoogleApi();
|
||||
if ($pmGoogle->getServiceGmailStatus()) {
|
||||
@@ -1011,13 +1011,13 @@ function synchronizeGmailLabels()
|
||||
setExecutionMessage("The Gmail license is not enabled");
|
||||
}
|
||||
setExecutionResultMessage("DONE");
|
||||
|
||||
} catch (Exception $e) {
|
||||
setExecutionResultMessage("WITH ERRORS", "error");
|
||||
eprintln(" '-" . $e->getMessage(), "red");
|
||||
saveLog("synchronizeGmailLabels", "error", "Error when synchronizing Gmail labels: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
function sendNotifications()
|
||||
@@ -1047,7 +1047,7 @@ function sendNotifications()
|
||||
setExecutionResultMessage("Processed $n");
|
||||
}
|
||||
$notificationsApple = $notQueue->loadStatusDeviceType('pending', 'apple');
|
||||
if($notificationsApple) {
|
||||
if ($notificationsApple) {
|
||||
setExecutionMessage("|-- Send Apple Notifications");
|
||||
$n = 0;
|
||||
foreach ($notificationsApple as $key => $item) {
|
||||
|
||||
@@ -1,30 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* cliUpgrade.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2011 Colosa Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
* @author Alexandre Rosenfeld <alexandre@colosa.com>
|
||||
* @package workflow-engine-bin-tasks
|
||||
*/
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use ProcessMaker\Core\System;
|
||||
|
||||
CLI::taskName('upgrade');
|
||||
@@ -35,7 +11,8 @@ CLI::taskOpt('noxml', 'If this option is enabled, the XML files translation is n
|
||||
CLI::taskRun("run_upgrade");
|
||||
/*----------------------------------********---------------------------------*/
|
||||
CLI::taskName('unify-database');
|
||||
CLI::taskDescription(<<<EOT
|
||||
CLI::taskDescription(
|
||||
<<<EOT
|
||||
Unify RBAC, Reports and Workflow database schemas to match the latest version
|
||||
|
||||
Specify the workspaces whose databases schemas should be unified.
|
||||
@@ -141,7 +118,7 @@ function run_upgrade($command, $args)
|
||||
define("PATH_DATA_SITE", PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP);
|
||||
}
|
||||
|
||||
if(!defined('DB_ADAPTER')) {
|
||||
if (!defined('DB_ADAPTER')) {
|
||||
define('DB_ADAPTER', 'mysql');
|
||||
}
|
||||
|
||||
@@ -205,13 +182,16 @@ function run_upgrade($command, $args)
|
||||
$flag = G::isPMUnderUpdating(0);
|
||||
}
|
||||
|
||||
function listFiles($dir) {
|
||||
function listFiles($dir)
|
||||
{
|
||||
$files = array();
|
||||
$lista = glob($dir.'/*');
|
||||
foreach($lista as $valor) {
|
||||
foreach ($lista as $valor) {
|
||||
if (is_dir($valor)) {
|
||||
$inner_files = listFiles($valor);
|
||||
if (is_array($inner_files)) $files = array_merge($files, $inner_files);
|
||||
if (is_array($inner_files)) {
|
||||
$files = array_merge($files, $inner_files);
|
||||
}
|
||||
}
|
||||
if (is_file($valor)) {
|
||||
array_push($files, $valor);
|
||||
@@ -224,12 +204,12 @@ function run_unify_database($args)
|
||||
{
|
||||
$workspaces = array();
|
||||
|
||||
if (sizeof($args) > 2) {
|
||||
if (count($args) > 2) {
|
||||
$filename = array_pop($args);
|
||||
foreach ($args as $arg) {
|
||||
$workspaces[] = new WorkspaceTools($arg);
|
||||
}
|
||||
} else if (sizeof($args) > 0) {
|
||||
} elseif (count($args) > 0) {
|
||||
$workspace = new WorkspaceTools($args[0]);
|
||||
$workspaces[] = $workspace;
|
||||
}
|
||||
@@ -243,7 +223,7 @@ function run_unify_database($args)
|
||||
$count = count($workspaces);
|
||||
|
||||
if ($count > 1) {
|
||||
if(!Bootstrap::isLinuxOs()){
|
||||
if (!Bootstrap::isLinuxOs()) {
|
||||
CLI::error("This is not a Linux enviroment, please specify workspace.\n");
|
||||
return;
|
||||
}
|
||||
@@ -264,7 +244,7 @@ function run_unify_database($args)
|
||||
}
|
||||
|
||||
$ws = $workspace->name;
|
||||
$sContent = file_get_contents (PATH_DB . $ws . PATH_SEP . 'db.php');
|
||||
$sContent = file_get_contents(PATH_DB . $ws . PATH_SEP . 'db.php');
|
||||
|
||||
if (strpos($sContent, 'rb_')) {
|
||||
$workspace->onedb = false;
|
||||
@@ -277,47 +257,46 @@ function run_unify_database($args)
|
||||
} else {
|
||||
//create destination path
|
||||
$parentDirectory = PATH_DATA . "upgrade";
|
||||
if (! file_exists( $parentDirectory )) {
|
||||
mkdir( $parentDirectory );
|
||||
if (! file_exists($parentDirectory)) {
|
||||
mkdir($parentDirectory);
|
||||
}
|
||||
$tempDirectory = $parentDirectory . basename(tempnam(__FILE__, ''));
|
||||
if (is_writable( $parentDirectory )) {
|
||||
mkdir( $tempDirectory );
|
||||
if (is_writable($parentDirectory)) {
|
||||
mkdir($tempDirectory);
|
||||
} else {
|
||||
throw new Exception( "Could not create directory:" . $parentDirectory );
|
||||
throw new Exception("Could not create directory:" . $parentDirectory);
|
||||
}
|
||||
$metadata = $workspace->getMetadata();
|
||||
CLI::logging( "Exporting rb and rp databases to a temporal location...\n" );
|
||||
$metadata["databases"] = $workspace->exportDatabase( $tempDirectory,true );
|
||||
CLI::logging("Exporting rb and rp databases to a temporal location...\n");
|
||||
$metadata["databases"] = $workspace->exportDatabase($tempDirectory, true);
|
||||
$metadata["version"] = 1;
|
||||
|
||||
list ($dbHost, $dbUser, $dbPass) = @explode( SYSTEM_HASH, G::decrypt( HASH_INSTALLATION, SYSTEM_HASH ) );
|
||||
$link = mysql_connect( $dbHost, $dbUser, $dbPass );
|
||||
list($dbHost, $dbUser, $dbPass) = @explode(SYSTEM_HASH, G::decrypt(HASH_INSTALLATION, SYSTEM_HASH));
|
||||
$connectionName = 'UPGRADE';
|
||||
InstallerModule::setNewConnection($connectionName, $dbHost, $dbUser, $dbPass,'', '');
|
||||
|
||||
foreach ($metadata['databases'] as $db) {
|
||||
$dbName = $metadata['DB_NAME'];
|
||||
CLI::logging( "+> Restoring {$db['name']} to $dbName database\n" );
|
||||
CLI::logging("+> Restoring {$db['name']} to $dbName database\n");
|
||||
|
||||
$aParameters = array('dbHost'=>$dbHost,'dbUser'=>$dbUser,'dbPass'=>$dbPass);
|
||||
$aParameters = ['dbHost'=>$dbHost,'dbUser'=>$dbUser,'dbPass'=>$dbPass];
|
||||
|
||||
$restore = $workspace->executeScript( $dbName, "$tempDirectory/{$db['name']}.sql", $aParameters);
|
||||
$restore = $workspace->executeScript($dbName, "$tempDirectory/{$db['name']}.sql", $aParameters, $connectionName);
|
||||
|
||||
if ($restore) {
|
||||
CLI::logging( "+> Remove {$db['name']} database\n" );
|
||||
CLI::logging("+> Remove {$db['name']} database\n");
|
||||
|
||||
$sql = "DROP DATABASE IF EXISTS {$db['name']};";
|
||||
if (! @mysql_query( $sql )) {
|
||||
throw new Exception( mysql_error() );
|
||||
}
|
||||
DB::connection($connectionName)->statement("DROP DATABASE IF EXISTS {$db['name']}");
|
||||
}
|
||||
}
|
||||
DB::disconnect($connectionName);
|
||||
|
||||
CLI::logging( "Removing temporary files\n" );
|
||||
G::rm_dir( $tempDirectory );
|
||||
CLI::logging("Removing temporary files\n");
|
||||
G::rm_dir($tempDirectory);
|
||||
|
||||
$newDBNames = $workspace->resetDBInfo( $dbHost, true, true, true );
|
||||
$newDBNames = $workspace->resetDBInfo($dbHost, true, true, true);
|
||||
|
||||
CLI::logging( CLI::info( "Done restoring databases" ) . "\n" );
|
||||
CLI::logging(CLI::info("Done restoring databases") . "\n");
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
CLI::logging("Errors upgrading workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n");
|
||||
@@ -326,4 +305,4 @@ function run_unify_database($args)
|
||||
}
|
||||
$flag = G::isPMUnderUpdating(0);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
@@ -209,7 +209,7 @@ EOT
|
||||
CLI::taskArg('workspace', true, true);
|
||||
CLI::taskRun("run_migrate_itee_to_dummytask");
|
||||
|
||||
/* ----------------------------------********--------------------------------- */
|
||||
/*----------------------------------********---------------------------------*/
|
||||
CLI::taskName("check-workspace-disabled-code");
|
||||
CLI::taskDescription(<<<EOT
|
||||
Check disabled code for the specified workspace(s).
|
||||
@@ -248,7 +248,7 @@ EOT
|
||||
);
|
||||
CLI::taskArg('workspace', true, true);
|
||||
CLI::taskRun("run_migrate_list_unassigned");
|
||||
/* ----------------------------------********--------------------------------- */
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
CLI::taskName('migrate-indexing-acv');
|
||||
CLI::taskDescription(<<<EOT
|
||||
@@ -344,15 +344,23 @@ CLI::taskRun("regenerate_pmtable_classes");
|
||||
|
||||
/**
|
||||
* Function run_info
|
||||
* access public
|
||||
*
|
||||
* @param array $args
|
||||
* @param array $opts
|
||||
*/
|
||||
function run_info($args, $opts)
|
||||
{
|
||||
$workspaces = get_workspaces_from_args($args);
|
||||
WorkspaceTools::printSysInfo();
|
||||
foreach ($workspaces as $workspace) {
|
||||
echo "\n";
|
||||
$workspace->printMetadata(false);
|
||||
|
||||
//Check if the command is executed by a specific workspace
|
||||
$workspaces = get_workspaces_from_args($args);
|
||||
if (count($args) === 1) {
|
||||
$workspaces[0]->printMetadata(false);
|
||||
} else {
|
||||
foreach ($workspaces as $workspace) {
|
||||
echo "\n";
|
||||
passthru(PHP_BINARY . " processmaker info " . $workspace->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -865,21 +873,31 @@ function run_workspace_restore($args, $opts)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrating cases folders of the workspaces
|
||||
*
|
||||
* @param array $command
|
||||
* @param array $args
|
||||
*/
|
||||
function runStructureDirectories($command, $args)
|
||||
{
|
||||
$workspaces = get_workspaces_from_args($command);
|
||||
$count = count($workspaces);
|
||||
$errors = false;
|
||||
$countWorkspace = 0;
|
||||
foreach ($workspaces as $index => $workspace) {
|
||||
if (count($command) === 1) {
|
||||
try {
|
||||
$countWorkspace++;
|
||||
CLI::logging("Updating workspaces ($countWorkspace/$count): " . CLI::info($workspace->name) . "\n");
|
||||
$workspace = $workspaces[0];
|
||||
CLI::logging(": " . CLI::info($workspace->name) . "\n");
|
||||
$workspace->updateStructureDirectories($workspace->name);
|
||||
$workspace->close();
|
||||
} catch (Exception $e) {
|
||||
CLI::logging("Errors upgrading workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n");
|
||||
$errors = true;
|
||||
}
|
||||
} else {
|
||||
$count = count($workspaces);
|
||||
$countWorkspace = 0;
|
||||
foreach ($workspaces as $index => $workspace) {
|
||||
$countWorkspace++;
|
||||
CLI::logging("Updating workspaces ($countWorkspace/$count)");
|
||||
passthru(PHP_BINARY . " processmaker migrate-cases-folders " . $workspace->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -981,7 +999,7 @@ function run_migrate_itee_to_dummytask($args, $opts)
|
||||
}
|
||||
}
|
||||
}
|
||||
/* ----------------------------------********--------------------------------- */
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
/**
|
||||
* Check if we need to execute an external program for each workspace
|
||||
@@ -1118,7 +1136,7 @@ function migrate_list_unassigned($command, $args, $opts)
|
||||
}
|
||||
}
|
||||
}
|
||||
/* ----------------------------------********--------------------------------- */
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
/**
|
||||
* Check if we need to execute an external program for each workspace
|
||||
|
||||
@@ -1704,7 +1704,9 @@ class AppSolr
|
||||
$UnSerializedCaseData = unserialize($documentData ['APP_DATA']);
|
||||
|
||||
if ($UnSerializedCaseData === false) {
|
||||
$UnSerializedCaseData = preg_replace('!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':\"$2\";'", $documentData ['APP_DATA']); // utf8_encode
|
||||
$UnSerializedCaseData = preg_replace_callback('!s:(\d+):"(.*?)";!', function ($m) {
|
||||
return 's:' . strlen($m[2]) . ':"' . $m[2] . '";';
|
||||
}, $documentData ['APP_DATA']); // utf8_encode
|
||||
$UnSerializedCaseData = unserialize($UnSerializedCaseData);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
|
||||
class Applications
|
||||
{
|
||||
/**
|
||||
@@ -88,7 +87,7 @@ class Applications
|
||||
$sqlData .= " LEFT JOIN USERS ON (APP_DELEGATION.USR_ID = USERS.USR_ID)";
|
||||
$sqlData .= " LEFT JOIN PROCESS ON (APP_DELEGATION.PRO_ID = PROCESS.PRO_ID)";
|
||||
|
||||
$sqlData .= " WHERE TASK.TAS_TYPE NOT IN ('" . implode("','",$arrayTaskTypeToExclude) . "')";
|
||||
$sqlData .= " WHERE TASK.TAS_TYPE NOT IN ('" . implode("','", $arrayTaskTypeToExclude) . "')";
|
||||
switch ($status) {
|
||||
case 1: //DRAFT
|
||||
$sqlData .= " AND APP_DELEGATION.DEL_THREAD_STATUS='OPEN'";
|
||||
@@ -126,7 +125,7 @@ class Applications
|
||||
}
|
||||
|
||||
if (!empty($category)) {
|
||||
$category = mysql_real_escape_string($category);
|
||||
$category = mysqli_real_escape_string($con->getResource(), $category);
|
||||
$sqlData .= " AND PROCESS.PRO_CATEGORY = '{$category}'";
|
||||
}
|
||||
|
||||
@@ -166,7 +165,6 @@ class Applications
|
||||
if ($columnSearch === 'TAS_TITLE') {
|
||||
$sqlData .= " AND TASK.TAS_TITLE LIKE '%{$search}%' ";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!empty($dateFrom)) {
|
||||
@@ -197,7 +195,7 @@ class Applications
|
||||
}
|
||||
|
||||
//Define the number of records by return
|
||||
if(empty($limit)) {
|
||||
if (empty($limit)) {
|
||||
$limit = 25;
|
||||
}
|
||||
if (!empty($start) && empty($search)) {
|
||||
@@ -205,7 +203,7 @@ class Applications
|
||||
} else {
|
||||
$sqlData .= " LIMIT " . $limit;
|
||||
}
|
||||
|
||||
|
||||
$dataset = $stmt->executeQuery($sqlData);
|
||||
$result = [];
|
||||
//By performance enable always the pagination
|
||||
@@ -346,8 +344,8 @@ class Applications
|
||||
$Criteria = $oAppCache->getCompletedListCriteria($userUid);
|
||||
$CriteriaCount = $oAppCache->getCompletedCountCriteria($userUid);
|
||||
|
||||
$Criteria->add (AppCacheViewPeer::DEL_LAST_INDEX,"1");
|
||||
$CriteriaCount->add (AppCacheViewPeer::DEL_LAST_INDEX,"1");
|
||||
$Criteria->add(AppCacheViewPeer::DEL_LAST_INDEX, "1");
|
||||
$CriteriaCount->add(AppCacheViewPeer::DEL_LAST_INDEX, "1");
|
||||
break;
|
||||
default:
|
||||
//All status
|
||||
@@ -365,8 +363,8 @@ class Applications
|
||||
$CriteriaCount = $oAppCache->getToReviseCountCriteria($userUid);
|
||||
break;
|
||||
case "to_reassign":
|
||||
GLOBAL $RBAC;
|
||||
if($RBAC->userCanAccess('PM_REASSIGNCASE') == 1){
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) {
|
||||
$Criteria = $oAppCache->getToReassignListCriteria($userUid);
|
||||
$CriteriaCount = $oAppCache->getToReassignCountCriteria($userUid);
|
||||
} else {
|
||||
@@ -405,19 +403,19 @@ class Applications
|
||||
$CriteriaCount->addJoin(AppCacheViewPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN);
|
||||
$CriteriaCount->add(TaskPeer::TAS_TYPE, $arrayTaskTypeToExclude, Criteria::NOT_IN);
|
||||
|
||||
$Criteria->addAlias( 'CU', 'USERS' );
|
||||
$Criteria->addJoin( AppCacheViewPeer::USR_UID, 'CU.USR_UID', Criteria::LEFT_JOIN );
|
||||
$Criteria->addAsColumn( 'USR_UID', 'CU.USR_UID' );
|
||||
$Criteria->addAsColumn( 'USR_FIRSTNAME', 'CU.USR_FIRSTNAME' );
|
||||
$Criteria->addAsColumn( 'USR_LASTNAME', 'CU.USR_LASTNAME' );
|
||||
$Criteria->addAsColumn( 'USR_USERNAME', 'CU.USR_USERNAME' );
|
||||
$Criteria->addAlias('CU', 'USERS');
|
||||
$Criteria->addJoin(AppCacheViewPeer::USR_UID, 'CU.USR_UID', Criteria::LEFT_JOIN);
|
||||
$Criteria->addAsColumn('USR_UID', 'CU.USR_UID');
|
||||
$Criteria->addAsColumn('USR_FIRSTNAME', 'CU.USR_FIRSTNAME');
|
||||
$Criteria->addAsColumn('USR_LASTNAME', 'CU.USR_LASTNAME');
|
||||
$Criteria->addAsColumn('USR_USERNAME', 'CU.USR_USERNAME');
|
||||
|
||||
$CriteriaCount->addAlias( 'CU', 'USERS' );
|
||||
$CriteriaCount->addJoin( AppCacheViewPeer::USR_UID, 'CU.USR_UID', Criteria::LEFT_JOIN );
|
||||
$CriteriaCount->addAsColumn( 'USR_UID', 'CU.USR_UID' );
|
||||
$CriteriaCount->addAsColumn( 'USR_FIRSTNAME', 'CU.USR_FIRSTNAME' );
|
||||
$CriteriaCount->addAsColumn( 'USR_LASTNAME', 'CU.USR_LASTNAME' );
|
||||
$CriteriaCount->addAsColumn( 'USR_USERNAME', 'CU.USR_USERNAME' );
|
||||
$CriteriaCount->addAlias('CU', 'USERS');
|
||||
$CriteriaCount->addJoin(AppCacheViewPeer::USR_UID, 'CU.USR_UID', Criteria::LEFT_JOIN);
|
||||
$CriteriaCount->addAsColumn('USR_UID', 'CU.USR_UID');
|
||||
$CriteriaCount->addAsColumn('USR_FIRSTNAME', 'CU.USR_FIRSTNAME');
|
||||
$CriteriaCount->addAsColumn('USR_LASTNAME', 'CU.USR_LASTNAME');
|
||||
$CriteriaCount->addAsColumn('USR_USERNAME', 'CU.USR_USERNAME');
|
||||
|
||||
//Current delegation
|
||||
$appdelcrTableName = AppCacheViewPeer::TABLE_NAME;
|
||||
@@ -455,13 +453,13 @@ class Applications
|
||||
$CriteriaCount->addAlias("APPDELCR", $appdelcrTableName);
|
||||
$CriteriaCount->addAlias("USRCR", UsersPeer::TABLE_NAME);
|
||||
|
||||
$arrayCondition = array();
|
||||
$arrayCondition = [];
|
||||
$arrayCondition[] = array(AppCacheViewPeer::APP_UID, "APPDELCR.APP_UID");
|
||||
$arrayCondition[] = array("APPDELCR.DEL_LAST_INDEX", 1);
|
||||
$Criteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN);
|
||||
$CriteriaCount->addJoinMC($arrayCondition, Criteria::LEFT_JOIN);
|
||||
|
||||
$arrayCondition = array();
|
||||
$arrayCondition = [];
|
||||
$arrayCondition[] = array("APPDELCR.USR_UID", "USRCR.USR_UID");
|
||||
$Criteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN);
|
||||
$CriteriaCount->addJoinMC($arrayCondition, Criteria::LEFT_JOIN);
|
||||
@@ -469,17 +467,17 @@ class Applications
|
||||
//Previous user
|
||||
|
||||
if (($action == "todo" || $action == "selfservice" || $action == "unassigned" || $action == "paused" || $action == "to_revise" || $action == "sent") || ($status == "TO_DO" || $status == "DRAFT" || $status == "PAUSED" || $status == "CANCELLED" || $status == "COMPLETED")) {
|
||||
$Criteria->addAlias( 'PU', 'USERS' );
|
||||
$Criteria->addJoin( AppCacheViewPeer::PREVIOUS_USR_UID, 'PU.USR_UID', Criteria::LEFT_JOIN );
|
||||
$Criteria->addAsColumn( 'PREVIOUS_USR_FIRSTNAME', 'PU.USR_FIRSTNAME' );
|
||||
$Criteria->addAsColumn( 'PREVIOUS_USR_LASTNAME', 'PU.USR_LASTNAME' );
|
||||
$Criteria->addAsColumn( 'PREVIOUS_USR_USERNAME', 'PU.USR_USERNAME' );
|
||||
$Criteria->addAlias('PU', 'USERS');
|
||||
$Criteria->addJoin(AppCacheViewPeer::PREVIOUS_USR_UID, 'PU.USR_UID', Criteria::LEFT_JOIN);
|
||||
$Criteria->addAsColumn('PREVIOUS_USR_FIRSTNAME', 'PU.USR_FIRSTNAME');
|
||||
$Criteria->addAsColumn('PREVIOUS_USR_LASTNAME', 'PU.USR_LASTNAME');
|
||||
$Criteria->addAsColumn('PREVIOUS_USR_USERNAME', 'PU.USR_USERNAME');
|
||||
|
||||
$CriteriaCount->addAlias( 'PU', 'USERS' );
|
||||
$CriteriaCount->addJoin( AppCacheViewPeer::PREVIOUS_USR_UID, 'PU.USR_UID', Criteria::LEFT_JOIN );
|
||||
$CriteriaCount->addAsColumn( 'PREVIOUS_USR_FIRSTNAME', 'PU.USR_FIRSTNAME' );
|
||||
$CriteriaCount->addAsColumn( 'PREVIOUS_USR_LASTNAME', 'PU.USR_LASTNAME' );
|
||||
$CriteriaCount->addAsColumn( 'PREVIOUS_USR_USERNAME', 'PU.USR_USERNAME' );
|
||||
$CriteriaCount->addAlias('PU', 'USERS');
|
||||
$CriteriaCount->addJoin(AppCacheViewPeer::PREVIOUS_USR_UID, 'PU.USR_UID', Criteria::LEFT_JOIN);
|
||||
$CriteriaCount->addAsColumn('PREVIOUS_USR_FIRSTNAME', 'PU.USR_FIRSTNAME');
|
||||
$CriteriaCount->addAsColumn('PREVIOUS_USR_LASTNAME', 'PU.USR_LASTNAME');
|
||||
$CriteriaCount->addAsColumn('PREVIOUS_USR_USERNAME', 'PU.USR_USERNAME');
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -533,34 +531,36 @@ class Applications
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
}
|
||||
|
||||
$Criteria->add( $Criteria->getNewCriterion( AppCacheViewPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL )->addAnd( $Criteria->getNewCriterion( AppCacheViewPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL ) ) );
|
||||
$CriteriaCount->add( $CriteriaCount->getNewCriterion( AppCacheViewPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL )->addAnd( $CriteriaCount->getNewCriterion( AppCacheViewPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL ) ) );
|
||||
$Criteria->add($Criteria->getNewCriterion(AppCacheViewPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL)->addAnd($Criteria->getNewCriterion(AppCacheViewPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL)));
|
||||
$CriteriaCount->add($CriteriaCount->getNewCriterion(AppCacheViewPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL)->addAnd($CriteriaCount->getNewCriterion(AppCacheViewPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL)));
|
||||
} else {
|
||||
$dateFrom = $dateFrom . " 00:00:00";
|
||||
|
||||
$Criteria->add( AppCacheViewPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL );
|
||||
$CriteriaCount->add( AppCacheViewPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL );
|
||||
$Criteria->add(AppCacheViewPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL);
|
||||
$CriteriaCount->add(AppCacheViewPeer::DEL_DELEGATE_DATE, $dateFrom, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
} elseif ($dateTo != "") {
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
|
||||
$Criteria->add( AppCacheViewPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL );
|
||||
$CriteriaCount->add( AppCacheViewPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL );
|
||||
$Criteria->add(AppCacheViewPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL);
|
||||
$CriteriaCount->add(AppCacheViewPeer::DEL_DELEGATE_DATE, $dateTo, Criteria::LESS_EQUAL);
|
||||
}
|
||||
|
||||
if ($newerThan != '') {
|
||||
if ($oldestThan != '') {
|
||||
$Criteria->add(
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::DEL_DELEGATE_DATE, $newerThan, Criteria::GREATER_THAN)->addAnd(
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::DEL_DELEGATE_DATE, $oldestThan, Criteria::LESS_THAN))
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::DEL_DELEGATE_DATE, $oldestThan, Criteria::LESS_THAN)
|
||||
)
|
||||
);
|
||||
$CriteriaCount->add(
|
||||
$CriteriaCount->getNewCriterion(AppCacheViewPeer::DEL_DELEGATE_DATE, $newerThan, Criteria::GREATER_THAN)->addAnd(
|
||||
$CriteriaCount->getNewCriterion(AppCacheViewPeer::DEL_DELEGATE_DATE, $oldestThan, Criteria::LESS_THAN))
|
||||
$CriteriaCount->getNewCriterion(AppCacheViewPeer::DEL_DELEGATE_DATE, $oldestThan, Criteria::LESS_THAN)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$Criteria->add(AppCacheViewPeer::DEL_DELEGATE_DATE, $newerThan, Criteria::GREATER_THAN);
|
||||
$CriteriaCount->add( AppCacheViewPeer::DEL_DELEGATE_DATE, $newerThan, Criteria::GREATER_THAN);
|
||||
$CriteriaCount->add(AppCacheViewPeer::DEL_DELEGATE_DATE, $newerThan, Criteria::GREATER_THAN);
|
||||
}
|
||||
} else {
|
||||
if ($oldestThan != '') {
|
||||
@@ -573,20 +573,20 @@ class Applications
|
||||
if ($filter != '') {
|
||||
switch ($filter) {
|
||||
case 'read':
|
||||
$Criteria->add( AppCacheViewPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL );
|
||||
$CriteriaCount->add( AppCacheViewPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL );
|
||||
$Criteria->add(AppCacheViewPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL);
|
||||
$CriteriaCount->add(AppCacheViewPeer::DEL_INIT_DATE, null, Criteria::ISNOTNULL);
|
||||
break;
|
||||
case 'unread':
|
||||
$Criteria->add( AppCacheViewPeer::DEL_INIT_DATE, null, Criteria::ISNULL );
|
||||
$CriteriaCount->add( AppCacheViewPeer::DEL_INIT_DATE, null, Criteria::ISNULL );
|
||||
$Criteria->add(AppCacheViewPeer::DEL_INIT_DATE, null, Criteria::ISNULL);
|
||||
$CriteriaCount->add(AppCacheViewPeer::DEL_INIT_DATE, null, Criteria::ISNULL);
|
||||
break;
|
||||
case 'started':
|
||||
$Criteria->add( AppCacheViewPeer::DEL_INDEX, 1, Criteria::EQUAL );
|
||||
$CriteriaCount->add( AppCacheViewPeer::DEL_INDEX, 1, Criteria::EQUAL );
|
||||
$Criteria->add(AppCacheViewPeer::DEL_INDEX, 1, Criteria::EQUAL);
|
||||
$CriteriaCount->add(AppCacheViewPeer::DEL_INDEX, 1, Criteria::EQUAL);
|
||||
break;
|
||||
case 'completed':
|
||||
$Criteria->add( AppCacheViewPeer::APP_STATUS, 'COMPLETED', Criteria::EQUAL );
|
||||
$CriteriaCount->add( AppCacheViewPeer::APP_STATUS, 'COMPLETED', Criteria::EQUAL );
|
||||
$Criteria->add(AppCacheViewPeer::APP_STATUS, 'COMPLETED', Criteria::EQUAL);
|
||||
$CriteriaCount->add(AppCacheViewPeer::APP_STATUS, 'COMPLETED', Criteria::EQUAL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -609,7 +609,7 @@ class Applications
|
||||
$additionalTable = new AdditionalTables();
|
||||
$tableData = $additionalTable->load($additionalTableUid, true);
|
||||
|
||||
$tableField = array();
|
||||
$tableField = [];
|
||||
|
||||
foreach ($tableData["FIELDS"] as $arrayField) {
|
||||
$tableField[] = $arrayField["FLD_NAME"];
|
||||
@@ -645,14 +645,21 @@ class Applications
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::APP_NUMBER, $search, Criteria::EQUAL)->addOr(
|
||||
$oTmpCriteria
|
||||
)))));
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$Criteria->add(
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
))));
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// the count query needs to be the normal criteria query if there are defined PM Table Fields in the cases list
|
||||
@@ -664,7 +671,10 @@ class Applications
|
||||
$CriteriaCount->getNewCriterion(AppCacheViewPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$CriteriaCount->getNewCriterion(AppCacheViewPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$CriteriaCount->getNewCriterion(AppCacheViewPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
))));
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -691,17 +701,17 @@ class Applications
|
||||
|
||||
// first check if there is a PMTable defined within the list,
|
||||
// the issue that brokes the normal criteria query seems to be fixed
|
||||
if (isset( $oAppCache->confCasesList['PMTable'] ) && ! empty( $oAppCache->confCasesList['PMTable'] )) {
|
||||
if (isset($oAppCache->confCasesList['PMTable']) && ! empty($oAppCache->confCasesList['PMTable'])) {
|
||||
// then
|
||||
$oAdditionalTables = AdditionalTablesPeer::retrieveByPK( $oAppCache->confCasesList['PMTable'] );
|
||||
$oAdditionalTables = AdditionalTablesPeer::retrieveByPK($oAppCache->confCasesList['PMTable']);
|
||||
$tableName = $oAdditionalTables->getAddTabName();
|
||||
$tableNameAux = $tableName;
|
||||
$tableName = strtolower( $tableName );
|
||||
$tableNameArray = explode( '_', $tableName );
|
||||
$tableName = strtolower($tableName);
|
||||
$tableNameArray = explode('_', $tableName);
|
||||
foreach ($tableNameArray as $item) {
|
||||
$newTableName[] = ucfirst( $item );
|
||||
$newTableName[] = ucfirst($item);
|
||||
}
|
||||
$tableName = implode( '', $newTableName );
|
||||
$tableName = implode('', $newTableName);
|
||||
// so the pm table class can be invoqued from the pm table model clases
|
||||
if (! class_exists( $tableName )) {
|
||||
require_once (PATH_DB . config("system.workspace") . PATH_SEP . "classes" . PATH_SEP . $tableName . ".php");
|
||||
@@ -728,7 +738,7 @@ class Applications
|
||||
}
|
||||
}
|
||||
|
||||
if (isset( $oAppCache->confCasesList['PMTable'] ) && ! empty( $oAppCache->confCasesList['PMTable'] ) && $tableNameAux != '') {
|
||||
if (isset($oAppCache->confCasesList['PMTable']) && ! empty($oAppCache->confCasesList['PMTable']) && $tableNameAux != '') {
|
||||
$sortTable = explode(".", $sortBk);
|
||||
|
||||
$additionalTableUid = $oAppCache->confCasesList["PMTable"];
|
||||
@@ -779,18 +789,18 @@ class Applications
|
||||
}
|
||||
|
||||
//limit the results according the interface
|
||||
$Criteria->setLimit( $limit );
|
||||
$Criteria->setOffset( $start );
|
||||
$Criteria->setLimit($limit);
|
||||
$Criteria->setOffset($start);
|
||||
|
||||
//execute the query
|
||||
$oDataset = AppCacheViewPeer::doSelectRS( $Criteria, Propel::getDbConnection('workflow_ro') );
|
||||
$oDataset = AppCacheViewPeer::doSelectRS($Criteria, Propel::getDbConnection('workflow_ro'));
|
||||
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$result = array ();
|
||||
$result = [];
|
||||
$result['totalCount'] = $totalCount;
|
||||
$rows = array ();
|
||||
$aPriorities = array ('1' => 'VL','2' => 'L','3' => 'N','4' => 'H','5' => 'VH');
|
||||
$rows = [];
|
||||
$aPriorities = array('1' => 'VL','2' => 'L','3' => 'N','4' => 'H','5' => 'VH');
|
||||
$index = $start;
|
||||
|
||||
while ($oDataset->next()) {
|
||||
@@ -812,18 +822,18 @@ class Applications
|
||||
}
|
||||
|
||||
//Unassigned user
|
||||
if (! isset( $aRow['APP_CURRENT_USER'] )) {
|
||||
if (! isset($aRow['APP_CURRENT_USER'])) {
|
||||
$aRow['APP_CURRENT_USER'] = "[" . strtoupper(G::LoadTranslation("ID_UNASSIGNED")) . "]";
|
||||
}
|
||||
|
||||
// replacing the status data with their respective translation
|
||||
if (isset( $aRow['APP_STATUS'] )) {
|
||||
$aRow['APP_STATUS_LABEL'] = G::LoadTranslation( "ID_{$aRow['APP_STATUS']}" );
|
||||
if (isset($aRow['APP_STATUS'])) {
|
||||
$aRow['APP_STATUS_LABEL'] = G::LoadTranslation("ID_{$aRow['APP_STATUS']}");
|
||||
}
|
||||
|
||||
// replacing the priority data with their respective translation
|
||||
if (isset( $aRow['DEL_PRIORITY'] )) {
|
||||
$aRow['DEL_PRIORITY'] = G::LoadTranslation( "ID_PRIORITY_{$aPriorities[$aRow['DEL_PRIORITY']]}" );
|
||||
if (isset($aRow['DEL_PRIORITY'])) {
|
||||
$aRow['DEL_PRIORITY'] = G::LoadTranslation("ID_PRIORITY_{$aPriorities[$aRow['DEL_PRIORITY']]}");
|
||||
}
|
||||
|
||||
$rows[] = $aRow;
|
||||
@@ -840,67 +850,66 @@ class Applications
|
||||
*
|
||||
* @return Array $fields
|
||||
*/
|
||||
public function setDefaultFields ()
|
||||
public function setDefaultFields()
|
||||
{
|
||||
$fields = array ();
|
||||
$fields['APP_NUMBER'] = array ('name' => 'APP_NUMBER','fieldType' => 'case field','label' => G::loadTranslation( 'ID_CASESLIST_APP_NUMBER' ),'width' => 40,'align' => 'left'
|
||||
$fields = [];
|
||||
$fields['APP_NUMBER'] = array('name' => 'APP_NUMBER','fieldType' => 'case field','label' => G::loadTranslation('ID_CASESLIST_APP_NUMBER'),'width' => 40,'align' => 'left'
|
||||
);
|
||||
$fields['APP_UID'] = array ('name' => 'APP_UID','fieldType' => 'key','label' => G::loadTranslation( 'ID_CASESLIST_APP_UID' ),'width' => 80,'align' => 'left'
|
||||
$fields['APP_UID'] = array('name' => 'APP_UID','fieldType' => 'key','label' => G::loadTranslation('ID_CASESLIST_APP_UID'),'width' => 80,'align' => 'left'
|
||||
);
|
||||
$fields['DEL_INDEX'] = array ('name' => 'DEL_INDEX','fieldType' => 'key','label' => G::loadTranslation( 'ID_CASESLIST_DEL_INDEX' ),'width' => 50,'align' => 'left'
|
||||
$fields['DEL_INDEX'] = array('name' => 'DEL_INDEX','fieldType' => 'key','label' => G::loadTranslation('ID_CASESLIST_DEL_INDEX'),'width' => 50,'align' => 'left'
|
||||
);
|
||||
$fields['TAS_UID'] = array ('name' => 'TAS_UID','fieldType' => 'case field','label' => G::loadTranslation( 'ID_CASESLIST_TAS_UID' ),'width' => 80,'align' => 'left'
|
||||
$fields['TAS_UID'] = array('name' => 'TAS_UID','fieldType' => 'case field','label' => G::loadTranslation('ID_CASESLIST_TAS_UID'),'width' => 80,'align' => 'left'
|
||||
);
|
||||
$fields['USR_UID'] = array ('name' => 'USR_UID','fieldType' => 'case field','label' => G::loadTranslation( 'ID_CASESLIST_USR_UID' ),'width' => 80,'align' => 'left','hidden' => true
|
||||
$fields['USR_UID'] = array('name' => 'USR_UID','fieldType' => 'case field','label' => G::loadTranslation('ID_CASESLIST_USR_UID'),'width' => 80,'align' => 'left','hidden' => true
|
||||
);
|
||||
$fields['PREVIOUS_USR_UID'] = array ('name' => 'PREVIOUS_USR_UID','fieldType' => 'case field','label' => G::loadTranslation( 'ID_CASESLIST_PREVIOUS_USR_UID' ),'width' => 80,'align' => 'left','hidden' => true
|
||||
$fields['PREVIOUS_USR_UID'] = array('name' => 'PREVIOUS_USR_UID','fieldType' => 'case field','label' => G::loadTranslation('ID_CASESLIST_PREVIOUS_USR_UID'),'width' => 80,'align' => 'left','hidden' => true
|
||||
);
|
||||
$fields['APP_TITLE'] = array ('name' => 'APP_TITLE','fieldType' => 'case field','label' => G::loadTranslation( 'ID_CASESLIST_APP_TITLE' ),'width' => 140,'align' => 'left'
|
||||
$fields['APP_TITLE'] = array('name' => 'APP_TITLE','fieldType' => 'case field','label' => G::loadTranslation('ID_CASESLIST_APP_TITLE'),'width' => 140,'align' => 'left'
|
||||
);
|
||||
$fields['APP_PRO_TITLE'] = array ('name' => 'APP_PRO_TITLE','fieldType' => 'case field','label' => G::loadTranslation( 'ID_CASESLIST_APP_PRO_TITLE' ),'width' => 140,'align' => 'left'
|
||||
$fields['APP_PRO_TITLE'] = array('name' => 'APP_PRO_TITLE','fieldType' => 'case field','label' => G::loadTranslation('ID_CASESLIST_APP_PRO_TITLE'),'width' => 140,'align' => 'left'
|
||||
);
|
||||
$fields['APP_TAS_TITLE'] = array ('name' => 'APP_TAS_TITLE','fieldType' => 'case field','label' => G::loadTranslation( 'ID_CASESLIST_APP_TAS_TITLE' ),'width' => 140,'align' => 'left'
|
||||
$fields['APP_TAS_TITLE'] = array('name' => 'APP_TAS_TITLE','fieldType' => 'case field','label' => G::loadTranslation('ID_CASESLIST_APP_TAS_TITLE'),'width' => 140,'align' => 'left'
|
||||
);
|
||||
$fields['APP_DEL_PREVIOUS_USER'] = array ('name' => 'APP_DEL_PREVIOUS_USER','fieldType' => 'case field','label' => G::loadTranslation( 'ID_CASESLIST_APP_DEL_PREVIOUS_USER' ),'width' => 120,'align' => 'left'
|
||||
$fields['APP_DEL_PREVIOUS_USER'] = array('name' => 'APP_DEL_PREVIOUS_USER','fieldType' => 'case field','label' => G::loadTranslation('ID_CASESLIST_APP_DEL_PREVIOUS_USER'),'width' => 120,'align' => 'left'
|
||||
);
|
||||
$fields['APP_CURRENT_USER'] = array ('name' => 'APP_CURRENT_USER','fieldType' => 'case field','label' => G::loadTranslation( 'ID_CASESLIST_APP_CURRENT_USER' ),'width' => 120,'align' => 'left'
|
||||
$fields['APP_CURRENT_USER'] = array('name' => 'APP_CURRENT_USER','fieldType' => 'case field','label' => G::loadTranslation('ID_CASESLIST_APP_CURRENT_USER'),'width' => 120,'align' => 'left'
|
||||
);
|
||||
$fields['USR_FIRSTNAME'] = array ('name' => 'USR_FIRSTNAME','fieldType' => 'case field','label' => G::loadTranslation( 'ID_CASESLIST_APP_CURRENT_USER' ),'width' => 120,'align' => 'left'
|
||||
$fields['USR_FIRSTNAME'] = array('name' => 'USR_FIRSTNAME','fieldType' => 'case field','label' => G::loadTranslation('ID_CASESLIST_APP_CURRENT_USER'),'width' => 120,'align' => 'left'
|
||||
);
|
||||
$fields['USR_LASTNAME'] = array ('name' => 'USR_LASTNAME','fieldType' => 'case field','label' => G::loadTranslation( 'ID_CASESLIST_APP_CURRENT_USER' ),'width' => 120,'align' => 'left'
|
||||
$fields['USR_LASTNAME'] = array('name' => 'USR_LASTNAME','fieldType' => 'case field','label' => G::loadTranslation('ID_CASESLIST_APP_CURRENT_USER'),'width' => 120,'align' => 'left'
|
||||
);
|
||||
$fields['DEL_TASK_DUE_DATE'] = array ('name' => 'DEL_TASK_DUE_DATE','fieldType' => 'case field','label' => G::loadTranslation( 'ID_CASESLIST_DEL_TASK_DUE_DATE' ),'width' => 100,'align' => 'left'
|
||||
$fields['DEL_TASK_DUE_DATE'] = array('name' => 'DEL_TASK_DUE_DATE','fieldType' => 'case field','label' => G::loadTranslation('ID_CASESLIST_DEL_TASK_DUE_DATE'),'width' => 100,'align' => 'left'
|
||||
);
|
||||
$fields['APP_UPDATE_DATE'] = array ('name' => 'APP_UPDATE_DATE','fieldType' => 'case field','label' => G::loadTranslation( 'ID_CASESLIST_APP_UPDATE_DATE' ),'width' => 100,'align' => 'left'
|
||||
$fields['APP_UPDATE_DATE'] = array('name' => 'APP_UPDATE_DATE','fieldType' => 'case field','label' => G::loadTranslation('ID_CASESLIST_APP_UPDATE_DATE'),'width' => 100,'align' => 'left'
|
||||
);
|
||||
$fields['DEL_PRIORITY'] = array ('name' => 'DEL_PRIORITY','fieldType' => 'case field','label' => G::loadTranslation( 'ID_CASESLIST_DEL_PRIORITY' ),'width' => 80,'align' => 'left'
|
||||
$fields['DEL_PRIORITY'] = array('name' => 'DEL_PRIORITY','fieldType' => 'case field','label' => G::loadTranslation('ID_CASESLIST_DEL_PRIORITY'),'width' => 80,'align' => 'left'
|
||||
);
|
||||
$fields['APP_STATUS'] = array ('name' => 'APP_STATUS','fieldType' => 'case field','label' => G::loadTranslation( 'ID_CASESLIST_APP_STATUS' ),'width' => 80,'align' => 'left'
|
||||
$fields['APP_STATUS'] = array('name' => 'APP_STATUS','fieldType' => 'case field','label' => G::loadTranslation('ID_CASESLIST_APP_STATUS'),'width' => 80,'align' => 'left'
|
||||
);
|
||||
$fields['APP_FINISH_DATE'] = array ('name' => 'APP_FINISH_DATE','fieldType' => 'case field','label' => G::loadTranslation( 'ID_CASESLIST_APP_FINISH_DATE' ),'width' => 100,'align' => 'left'
|
||||
$fields['APP_FINISH_DATE'] = array('name' => 'APP_FINISH_DATE','fieldType' => 'case field','label' => G::loadTranslation('ID_CASESLIST_APP_FINISH_DATE'),'width' => 100,'align' => 'left'
|
||||
);
|
||||
$fields['APP_DELAY_UID'] = array ('name' => 'APP_DELAY_UID','fieldType' => 'delay field','label' => G::loadTranslation( 'ID_CASESLIST_APP_DELAY_UID' ),'width' => 100,'align' => 'left'
|
||||
$fields['APP_DELAY_UID'] = array('name' => 'APP_DELAY_UID','fieldType' => 'delay field','label' => G::loadTranslation('ID_CASESLIST_APP_DELAY_UID'),'width' => 100,'align' => 'left'
|
||||
);
|
||||
$fields['APP_THREAD_INDEX'] = array ('name' => 'APP_THREAD_INDEX','fieldType' => 'delay field','label' => G::loadTranslation( 'ID_CASESLIST_APP_THREAD_INDEX' ),'width' => 100,'align' => 'left'
|
||||
$fields['APP_THREAD_INDEX'] = array('name' => 'APP_THREAD_INDEX','fieldType' => 'delay field','label' => G::loadTranslation('ID_CASESLIST_APP_THREAD_INDEX'),'width' => 100,'align' => 'left'
|
||||
);
|
||||
$fields['APP_DEL_INDEX'] = array ('name' => 'APP_DEL_INDEX','fieldType' => 'delay field','label' => G::loadTranslation( 'ID_CASESLIST_APP_DEL_INDEX' ),'width' => 100,'align' => 'left'
|
||||
$fields['APP_DEL_INDEX'] = array('name' => 'APP_DEL_INDEX','fieldType' => 'delay field','label' => G::loadTranslation('ID_CASESLIST_APP_DEL_INDEX'),'width' => 100,'align' => 'left'
|
||||
);
|
||||
$fields['APP_TYPE'] = array ('name' => 'APP_TYPE','fieldType' => 'delay field','label' => G::loadTranslation( 'ID_CASESLIST_APP_TYPE' ),'width' => 100,'align' => 'left'
|
||||
$fields['APP_TYPE'] = array('name' => 'APP_TYPE','fieldType' => 'delay field','label' => G::loadTranslation('ID_CASESLIST_APP_TYPE'),'width' => 100,'align' => 'left'
|
||||
);
|
||||
$fields['APP_DELEGATION_USER'] = array ('name' => 'APP_DELEGATION_USER','fieldType' => 'delay field','label' => G::loadTranslation( 'ID_CASESLIST_APP_DELEGATION_USER' ),'width' => 100,'align' => 'left'
|
||||
$fields['APP_DELEGATION_USER'] = array('name' => 'APP_DELEGATION_USER','fieldType' => 'delay field','label' => G::loadTranslation('ID_CASESLIST_APP_DELEGATION_USER'),'width' => 100,'align' => 'left'
|
||||
);
|
||||
$fields['APP_ENABLE_ACTION_USER'] = array ('name' => 'APP_ENABLE_ACTION_USER','fieldType' => 'delay field','label' => G::loadTranslation( 'ID_CASESLIST_APP_ENABLE_ACTION_USER' ),'width' => 100,'align' => 'left'
|
||||
$fields['APP_ENABLE_ACTION_USER'] = array('name' => 'APP_ENABLE_ACTION_USER','fieldType' => 'delay field','label' => G::loadTranslation('ID_CASESLIST_APP_ENABLE_ACTION_USER'),'width' => 100,'align' => 'left'
|
||||
);
|
||||
$fields['APP_ENABLE_ACTION_DATE'] = array ('name' => 'APP_ENABLE_ACTION_DATE','fieldType' => 'delay field','label' => G::loadTranslation( 'ID_CASESLIST_AAPP_ENABLE_ACTION_DATE' ),'width' => 100,'align' => 'left'
|
||||
$fields['APP_ENABLE_ACTION_DATE'] = array('name' => 'APP_ENABLE_ACTION_DATE','fieldType' => 'delay field','label' => G::loadTranslation('ID_CASESLIST_AAPP_ENABLE_ACTION_DATE'),'width' => 100,'align' => 'left'
|
||||
);
|
||||
$fields['APP_DISABLE_ACTION_USER'] = array ('name' => 'APP_DISABLE_ACTION_USER','fieldType' => 'delay field','label' => G::loadTranslation( 'ID_CASESLIST_APP_DISABLE_ACTION_USER' ),'width' => 100,'align' => 'left'
|
||||
$fields['APP_DISABLE_ACTION_USER'] = array('name' => 'APP_DISABLE_ACTION_USER','fieldType' => 'delay field','label' => G::loadTranslation('ID_CASESLIST_APP_DISABLE_ACTION_USER'),'width' => 100,'align' => 'left'
|
||||
);
|
||||
$fields['APP_DISABLE_ACTION_DATE'] = array ('name' => 'APP_DISABLE_ACTION_DATE','fieldType' => 'delay field','label' => G::loadTranslation( 'ID_CASESLIST_APP_DISABLE_ACTION_DATE' ),'width' => 100,'align' => 'left'
|
||||
$fields['APP_DISABLE_ACTION_DATE'] = array('name' => 'APP_DISABLE_ACTION_DATE','fieldType' => 'delay field','label' => G::loadTranslation('ID_CASESLIST_APP_DISABLE_ACTION_DATE'),'width' => 100,'align' => 'left'
|
||||
);
|
||||
$fields['APP_AUTOMATIC_DISABLED_DATE'] = array ('name' => 'APP_AUTOMATIC_DISABLED_DATE','fieldType' => 'delay field','label' => G::loadTranslation( 'ID_CASESLIST_APP_AUTOMATIC_DISABLED_DATE' ),'width' => 100,'align' => 'left'
|
||||
$fields['APP_AUTOMATIC_DISABLED_DATE'] = array('name' => 'APP_AUTOMATIC_DISABLED_DATE','fieldType' => 'delay field','label' => G::loadTranslation('ID_CASESLIST_APP_AUTOMATIC_DISABLED_DATE'),'width' => 100,'align' => 'left'
|
||||
);
|
||||
return $fields;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -909,9 +918,9 @@ class Applications
|
||||
* @param $action
|
||||
* @return an array with the default fields for an specific case list (action)
|
||||
*/
|
||||
public function getDefaultFields ($action)
|
||||
public function getDefaultFields($action)
|
||||
{
|
||||
$rows = array ();
|
||||
$rows = [];
|
||||
switch ($action) {
|
||||
case 'todo': // #, Case, task, process, sent by, due date, Last Modify, Priority
|
||||
$fields = $this->setDefaultFields();
|
||||
@@ -1089,34 +1098,34 @@ class Applications
|
||||
* @param array $second
|
||||
* @return $response a json string
|
||||
*/
|
||||
public function genericJsonResponse ($pmtable, $first, $second, $rowsperpage, $dateFormat)
|
||||
public function genericJsonResponse($pmtable, $first, $second, $rowsperpage, $dateFormat)
|
||||
{
|
||||
$firstGrid['totalCount'] = count( $first );
|
||||
$firstGrid['totalCount'] = count($first);
|
||||
$firstGrid['data'] = $first;
|
||||
$secondGrid['totalCount'] = count( $second );
|
||||
$secondGrid['totalCount'] = count($second);
|
||||
$secondGrid['data'] = $second;
|
||||
$result = array ();
|
||||
$result = [];
|
||||
$result['first'] = $firstGrid;
|
||||
$result['second'] = $secondGrid;
|
||||
$result['PMTable'] = isset( $pmtable ) ? $pmtable : '';
|
||||
$result['rowsperpage'] = isset( $rowsperpage ) ? $rowsperpage : 20;
|
||||
$result['dateformat'] = isset( $dateFormat ) && $dateFormat != '' ? $dateFormat : 'M d, Y';
|
||||
$result['PMTable'] = isset($pmtable) ? $pmtable : '';
|
||||
$result['rowsperpage'] = isset($rowsperpage) ? $rowsperpage : 20;
|
||||
$result['dateformat'] = isset($dateFormat) && $dateFormat != '' ? $dateFormat : 'M d, Y';
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getSteps ($appUid, $index, $tasUid, $proUid)
|
||||
public function getSteps($appUid, $index, $tasUid, $proUid)
|
||||
{
|
||||
$steps = Array ();
|
||||
$steps = [];
|
||||
$case = new Cases();
|
||||
$step = new Step();
|
||||
$appDocument = new AppDocument();
|
||||
|
||||
$caseSteps = $step->getAllCaseSteps( $proUid, $tasUid, $appUid );
|
||||
$caseSteps = $step->getAllCaseSteps($proUid, $tasUid, $appUid);
|
||||
|
||||
//getting externals steps
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$eSteps = $oPluginRegistry->getSteps();
|
||||
$externalSteps = array ();
|
||||
$externalSteps = [];
|
||||
/** @var \ProcessMaker\Plugins\Interfaces\StepDetail $externalStep */
|
||||
foreach ($eSteps as $externalStep) {
|
||||
$externalSteps[$externalStep->getStepId()] = $externalStep;
|
||||
@@ -1124,17 +1133,17 @@ class Applications
|
||||
|
||||
//getting the case record
|
||||
if ($appUid) {
|
||||
$caseData = $case->loadCase( $appUid );
|
||||
$caseData = $case->loadCase($appUid);
|
||||
$pmScript = new PMScript();
|
||||
$pmScript->setFields( $caseData['APP_DATA'] );
|
||||
$pmScript->setFields($caseData['APP_DATA']);
|
||||
}
|
||||
|
||||
$externalStepCount = 0;
|
||||
|
||||
foreach ($caseSteps as $caseStep) {
|
||||
// if it has a condition
|
||||
if (trim( $caseStep->getStepCondition() ) != '') {
|
||||
$pmScript->setScript( $caseStep->getStepCondition() );
|
||||
if (trim($caseStep->getStepCondition()) != '') {
|
||||
$pmScript->setScript($caseStep->getStepCondition());
|
||||
|
||||
if (! $pmScript->evaluate()) {
|
||||
//evaluated false, jump & continue with the others steps
|
||||
@@ -1146,21 +1155,21 @@ class Applications
|
||||
$stepType = $caseStep->getStepTypeObj();
|
||||
$stepPosition = $caseStep->getStepPosition();
|
||||
|
||||
$stepItem = array ();
|
||||
$stepItem = [];
|
||||
$stepItem['id'] = $stepUid;
|
||||
$stepItem['type'] = $stepType;
|
||||
|
||||
switch ($stepType) {
|
||||
case 'DYNAFORM':
|
||||
$oDocument = DynaformPeer::retrieveByPK( $stepUid );
|
||||
$oDocument = DynaformPeer::retrieveByPK($stepUid);
|
||||
|
||||
$stepItem['title'] = $oDocument->getDynTitle();
|
||||
$stepItem['url'] = "cases/cases_Step?UID=$stepUid&TYPE=$stepType&POSITION=$stepPosition&ACTION=EDIT";
|
||||
$stepItem['version'] = $oDocument->getDynVersion();
|
||||
break;
|
||||
case 'OUTPUT_DOCUMENT':
|
||||
$oDocument = OutputDocumentPeer::retrieveByPK( $caseStep->getStepUidObj() );
|
||||
$outputDoc = $appDocument->getObject( $appUid, $index, $caseStep->getStepUidObj(), 'OUTPUT' );
|
||||
$oDocument = OutputDocumentPeer::retrieveByPK($caseStep->getStepUidObj());
|
||||
$outputDoc = $appDocument->getObject($appUid, $index, $caseStep->getStepUidObj(), 'OUTPUT');
|
||||
$stepItem['title'] = $oDocument->getOutDocTitle();
|
||||
|
||||
if ($outputDoc['APP_DOC_UID']) {
|
||||
@@ -1170,7 +1179,7 @@ class Applications
|
||||
}
|
||||
break;
|
||||
case 'INPUT_DOCUMENT':
|
||||
$oDocument = InputDocumentPeer::retrieveByPK( $stepUid );
|
||||
$oDocument = InputDocumentPeer::retrieveByPK($stepUid);
|
||||
$stepItem['title'] = $oDocument->getInpDocTitle();
|
||||
$stepItem['url'] = "cases/cases_Step?UID=$stepUid&TYPE=$stepType&POSITION=$stepPosition&ACTION=ATTACH";
|
||||
break;
|
||||
@@ -1188,10 +1197,10 @@ class Applications
|
||||
}
|
||||
|
||||
//last, assign task
|
||||
$stepItem = array ();
|
||||
$stepItem = [];
|
||||
$stepItem['id'] = '-1';
|
||||
$stepItem['type'] = '';
|
||||
$stepItem['title'] = G::LoadTranslation( 'ID_ASSIGN_TASK' );
|
||||
$stepItem['title'] = G::LoadTranslation('ID_ASSIGN_TASK');
|
||||
$stepItem['url'] = "cases/cases_Step?TYPE=ASSIGN_TASK&UID=-1&POSITION=10000&ACTION=ASSIGN";
|
||||
|
||||
$steps[] = $stepItem;
|
||||
|
||||
@@ -471,26 +471,21 @@ abstract class ArrayBasePeer
|
||||
public static function doSelect(Criteria $criteria, $tableName, $con = null)
|
||||
{
|
||||
$dbMap = Propel::getDatabaseMap($criteria->getDbName());
|
||||
|
||||
$stmt = null;
|
||||
|
||||
try {
|
||||
$params = array();
|
||||
$sql = self::createSelectSql($criteria, $tableName, $params);
|
||||
$sql['params'] = $params;
|
||||
$stmt = $con->prepareStatement($sql);
|
||||
//$stmt->setLimit($criteria->getLimit());
|
||||
$sql['limit'] = $criteria->getLimit();
|
||||
//$stmt->setOffset($criteria->getOffset());
|
||||
$sql['offset'] = $criteria->getOffset();
|
||||
//$rs = $stmt->executeQuery(ResultSet::FETCHMODE_NUM);
|
||||
$sql['limit'] = (int) $criteria->getLimit();
|
||||
$sql['offset'] = (int) $criteria->getOffset();
|
||||
$rs = $con->executeQuery($sql, ResultSet::FETCHMODE_NUM);
|
||||
} catch (Exception $e) {
|
||||
if ($stmt)
|
||||
if ($stmt) {
|
||||
$stmt->close();
|
||||
}
|
||||
throw new PropelException($e);
|
||||
}
|
||||
|
||||
return $rs;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
<?php
|
||||
|
||||
use \ProcessMaker\BusinessModel\WebEntryEvent;
|
||||
use ProcessMaker\BusinessModel\User as BusinessModelUser;
|
||||
use ProcessMaker\BusinessModel\WebEntryEvent;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
|
||||
/**
|
||||
* A Cases object where you can do start, load, update, refresh about cases
|
||||
* This object is applied to Task
|
||||
@@ -1856,14 +1858,16 @@ class Cases
|
||||
* This function updates a row in APP_DELEGATION
|
||||
*
|
||||
* @name closeAllDelegations
|
||||
* @param string $sAppUid
|
||||
* @param string $appUid
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function closeAllThreads($sAppUid)
|
||||
public function closeAllThreads($appUid)
|
||||
{
|
||||
try {
|
||||
$c = new Criteria();
|
||||
$c->add(AppThreadPeer::APP_UID, $sAppUid);
|
||||
$c->add(AppThreadPeer::APP_UID, $appUid);
|
||||
$c->add(AppThreadPeer::APP_THREAD_STATUS, 'OPEN');
|
||||
$rowObj = AppThreadPeer::doSelect($c);
|
||||
foreach ($rowObj as $appThread) {
|
||||
@@ -1878,11 +1882,12 @@ class Cases
|
||||
throw (new PropelException('The row cannot be created!', new PropelException($msg)));
|
||||
}
|
||||
}
|
||||
//update searchindex
|
||||
|
||||
/** Update search index */
|
||||
if ($this->appSolr != null) {
|
||||
$this->appSolr->updateApplicationSearchIndex($sAppUid);
|
||||
$this->appSolr->updateApplicationSearchIndex($appUid);
|
||||
}
|
||||
} catch (exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
@@ -1915,19 +1920,22 @@ class Cases
|
||||
/**
|
||||
* With this function we can change status to CLOSED in APP_DELEGATION
|
||||
*
|
||||
* @name closeAllDelegations
|
||||
* @param string $sAppUid
|
||||
* @return
|
||||
* @param string $appUid
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function closeAllDelegations($sAppUid)
|
||||
public function closeAllDelegations($appUid)
|
||||
{
|
||||
try {
|
||||
$c = new Criteria();
|
||||
$c->add(AppDelegationPeer::APP_UID, $sAppUid);
|
||||
$c->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN');
|
||||
$rowObj = AppDelegationPeer::doSelect($c);
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(AppDelegationPeer::APP_UID, $appUid);
|
||||
$criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN');
|
||||
$rowObj = AppDelegationPeer::doSelect($criteria);
|
||||
$data = [];
|
||||
foreach ($rowObj as $appDel) {
|
||||
$appDel->setDelThreadStatus('CLOSED');
|
||||
$appDel->setDelFinishDate('now');
|
||||
if ($appDel->Validate()) {
|
||||
$appDel->Save();
|
||||
} else {
|
||||
@@ -1937,12 +1945,31 @@ class Cases
|
||||
}
|
||||
throw (new PropelException('The row cannot be created!', new PropelException($msg)));
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$delIndex = $appDel->getDelIndex();
|
||||
$inbox = new ListInbox();
|
||||
$inbox->remove($appUid, $delIndex);
|
||||
$data['DEL_THREAD_STATUS'] = 'CLOSED';
|
||||
$data['APP_UID'] = $appUid;
|
||||
$data['DEL_INDEX'] = $delIndex;
|
||||
$data['USR_UID'] = $appDel->getUsrUid();
|
||||
$listParticipatedLast = new ListParticipatedLast();
|
||||
$listParticipatedLast->refresh($data);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
/** This case is subProcess? */
|
||||
if (SubApplication::isCaseSubProcess($appUid)) {
|
||||
$route = new Derivation();
|
||||
$route->verifyIsCaseChild($appUid, $delIndex);
|
||||
}
|
||||
}
|
||||
//update searchindex
|
||||
|
||||
/** Update search index */
|
||||
if ($this->appSolr != null) {
|
||||
$this->appSolr->updateApplicationSearchIndex($sAppUid);
|
||||
$this->appSolr->updateApplicationSearchIndex($appUid);
|
||||
}
|
||||
} catch (exception $e) {
|
||||
} catch (Exception $e) {
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
@@ -1950,18 +1977,19 @@ class Cases
|
||||
/**
|
||||
* With this we can change the status to CLOSED in APP_DELEGATION
|
||||
*
|
||||
* @name CloseCurrentDelegation
|
||||
* @param string $sAppUid
|
||||
* @param string $iDelIndex
|
||||
* @return Fields
|
||||
* @param string $appUid
|
||||
* @param string $delIndex
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function CloseCurrentDelegation($sAppUid, $iDelIndex)
|
||||
public function CloseCurrentDelegation($appUid, $delIndex)
|
||||
{
|
||||
try {
|
||||
$c = new Criteria();
|
||||
$c->add(AppDelegationPeer::APP_UID, $sAppUid);
|
||||
$c->add(AppDelegationPeer::DEL_INDEX, $iDelIndex);
|
||||
$rowObj = AppDelegationPeer::doSelect($c);
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(AppDelegationPeer::APP_UID, $appUid);
|
||||
$criteria->add(AppDelegationPeer::DEL_INDEX, $delIndex);
|
||||
$rowObj = AppDelegationPeer::doSelect($criteria);
|
||||
$user = '';
|
||||
foreach ($rowObj as $appDel) {
|
||||
$appDel->setDelThreadStatus('CLOSED');
|
||||
@@ -1977,17 +2005,30 @@ class Cases
|
||||
throw (new PropelException('The row cannot be created!', new PropelException($msg)));
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$inbox = new ListInbox();
|
||||
$inbox->remove($sAppUid, $iDelIndex);
|
||||
$data = [];
|
||||
$inbox->remove($appUid, $delIndex);
|
||||
$data['DEL_THREAD_STATUS'] = 'CLOSED';
|
||||
$data['APP_UID'] = $sAppUid;
|
||||
$data['DEL_INDEX'] = $iDelIndex;
|
||||
$data['APP_UID'] = $appUid;
|
||||
$data['DEL_INDEX'] = $delIndex;
|
||||
$data['USR_UID'] = $user;
|
||||
$listParticipatedLast = new ListParticipatedLast();
|
||||
$listParticipatedLast->refresh($data);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
} catch (exception $e) {
|
||||
|
||||
/** This case is subProcess? */
|
||||
if (SubApplication::isCaseSubProcess($appUid)) {
|
||||
$route = new Derivation();
|
||||
$route->verifyIsCaseChild($appUid, $delIndex);
|
||||
}
|
||||
|
||||
/** Update searchindex */
|
||||
if ($this->appSolr != null) {
|
||||
$this->appSolr->updateApplicationSearchIndex($appUid);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
@@ -2533,10 +2574,11 @@ class Cases
|
||||
* Get the transfer History
|
||||
*
|
||||
* @name getTransferHistoryCriteria
|
||||
* @param string $sAppUid
|
||||
* @return array
|
||||
* @param integer $appNumber
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function getTransferHistoryCriteria($sAppUid)
|
||||
public function getTransferHistoryCriteria($appNumber)
|
||||
{
|
||||
$c = new Criteria('workflow');
|
||||
$c->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
@@ -2546,41 +2588,52 @@ class Cases
|
||||
$c->addSelectColumn(AppDelegationPeer::TAS_UID);
|
||||
$c->addSelectColumn(AppDelegationPeer::APP_UID);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||
///-- $c->addAsColumn('USR_NAME', "CONCAT(USR_LASTNAME, ' ', USR_FIRSTNAME)");
|
||||
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
|
||||
if (G::LoadSystemExist($sDataBase)) {
|
||||
$oDataBase = new database();
|
||||
$c->addAsColumn('USR_NAME', $oDataBase->concatString("USR_LASTNAME", "' '", "USR_FIRSTNAME"));
|
||||
$c->addAsColumn(
|
||||
'DEL_FINISH_DATE', $oDataBase->getCaseWhen("DEL_FINISH_DATE IS NULL", "'-'", AppDelegationPeer::DEL_FINISH_DATE)
|
||||
);
|
||||
$c->addAsColumn(
|
||||
'APP_TYPE', $oDataBase->getCaseWhen("DEL_FINISH_DATE IS NULL", "'IN_PROGRESS'", AppDelayPeer::APP_TYPE)
|
||||
);
|
||||
}
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
|
||||
$c->addSelectColumn(AppDelayPeer::APP_ENABLE_ACTION_DATE);
|
||||
$c->addSelectColumn(AppDelayPeer::APP_DISABLE_ACTION_DATE);
|
||||
$c->addSelectColumn(TaskPeer::TAS_TITLE);
|
||||
//APP_DELEGATION LEFT JOIN USERS
|
||||
$c->addJoin(AppDelegationPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
|
||||
|
||||
//APP_DELAY FOR MORE DESCRIPTION
|
||||
//$c->addJoin(AppDelegationPeer::DEL_INDEX, AppDelayPeer::APP_DEL_INDEX, Criteria::LEFT_JOIN);
|
||||
//$c->addJoin(AppDelegationPeer::APP_UID, AppDelayPeer::APP_UID, Criteria::LEFT_JOIN);
|
||||
//We added this custom query for the case tracker
|
||||
$c->addAsColumn(
|
||||
'TAS_TITLE',
|
||||
'CASE WHEN TASK.TAS_TITLE = "INTERMEDIATE-THROW-EMAIL-EVENT" THEN "' . G::LoadTranslation('ID_INTERMEDIATE_THROW_EMAIL_EVENT') . '"
|
||||
WHEN TASK.TAS_TITLE = "INTERMEDIATE-THROW-MESSAGE-EVENT" THEN "' . G::LoadTranslation('ID_INTERMEDIATE_THROW_MESSAGE_EVENT') . '"
|
||||
WHEN TASK.TAS_TITLE = "INTERMEDIATE-CATCH-MESSAGE-EVENT" THEN "' . G::LoadTranslation('ID_INTERMEDIATE_CATCH_MESSAGE_EVENT') . '"
|
||||
WHEN TASK.TAS_TITLE = "INTERMEDIATE-CATCH-TIMER-EVENT" THEN "' . G::LoadTranslation('ID_INTERMEDIATE_CATCH_TIMER_EVENT') . '"
|
||||
ELSE TASK.TAS_TITLE
|
||||
END'
|
||||
);
|
||||
|
||||
$dbAdapter = 'database_' . strtolower(DB_ADAPTER);
|
||||
if (G::LoadSystemExist($dbAdapter)) {
|
||||
$dataBase = new database();
|
||||
$c->addAsColumn(
|
||||
'USR_NAME',
|
||||
$dataBase->concatString("USR_LASTNAME", "' '", "USR_FIRSTNAME")
|
||||
);
|
||||
$c->addAsColumn(
|
||||
'DEL_FINISH_DATE',
|
||||
$dataBase->getCaseWhen("DEL_FINISH_DATE IS NULL", "'-'", AppDelegationPeer::DEL_FINISH_DATE)
|
||||
);
|
||||
$c->addAsColumn(
|
||||
'APP_TYPE',
|
||||
$dataBase->getCaseWhen("DEL_FINISH_DATE IS NULL", "'IN_PROGRESS'", AppDelayPeer::APP_TYPE)
|
||||
);
|
||||
}
|
||||
|
||||
//Define the joins
|
||||
$c->addJoin(AppDelegationPeer::USR_ID, UsersPeer::USR_ID, Criteria::LEFT_JOIN);
|
||||
$c->addJoin(AppDelegationPeer::TAS_ID, TaskPeer::TAS_ID, Criteria::LEFT_JOIN);
|
||||
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
$app = array();
|
||||
$app[] = array(AppDelegationPeer::DEL_INDEX, AppDelayPeer::APP_DEL_INDEX);
|
||||
$app[] = array(AppDelegationPeer::APP_UID, AppDelayPeer::APP_UID);
|
||||
$app = [];
|
||||
$app[] = [AppDelegationPeer::DEL_INDEX, AppDelayPeer::APP_DEL_INDEX];
|
||||
$app[] = [AppDelegationPeer::APP_NUMBER, AppDelayPeer::APP_NUMBER];
|
||||
$c->addJoinMC($app, Criteria::LEFT_JOIN);
|
||||
|
||||
//LEFT JOIN TASK TAS_TITLE
|
||||
$c->addJoin(AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN);
|
||||
//Define the where
|
||||
$c->add(AppDelegationPeer::APP_NUMBER, $appNumber);
|
||||
|
||||
//WHERE
|
||||
$c->add(AppDelegationPeer::APP_UID, $sAppUid);
|
||||
|
||||
//ORDER BY
|
||||
//Order by
|
||||
$c->clearOrderByColumns();
|
||||
$c->addAscendingOrderByColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
|
||||
|
||||
@@ -4125,216 +4178,207 @@ class Cases
|
||||
}
|
||||
|
||||
/**
|
||||
* cancel a case
|
||||
* Cancel case without matter the threads
|
||||
* if the force is true, we will cancel it does not matter the threads
|
||||
* if the force is false, we will to cancel one thread
|
||||
*
|
||||
* @name cancelCase
|
||||
* @param string $sApplicationUID
|
||||
* @param string $iIndex
|
||||
* @param string $user_logged
|
||||
* @return void
|
||||
*/
|
||||
public function cancelCase($sApplicationUID, $iIndex, $user_logged)
|
||||
* @param string $appUid
|
||||
* @param integer $delIndex
|
||||
* @param string $usrUid
|
||||
*
|
||||
* @return boolean|string
|
||||
*/
|
||||
public function cancelCase($appUid, $delIndex = null, $usrUid = null)
|
||||
{
|
||||
$this->getExecuteTriggerProcess($sApplicationUID, 'CANCELED');
|
||||
/** Execute a trigger when a case is cancelled */
|
||||
$this->getExecuteTriggerProcess($appUid, 'CANCELED');
|
||||
|
||||
$oApplication = new Application();
|
||||
$aFields = $oApplication->load($sApplicationUID);
|
||||
$caseFields = $this->loadCase($appUid);
|
||||
$appStatusCurrent = $caseFields['APP_STATUS'];
|
||||
|
||||
$appData = self::unserializeData($aFields['APP_DATA']);
|
||||
$appData = G::array_merges(G::getSystemConstants(), $appData);
|
||||
/** Update the status CANCELLED in the tables related */
|
||||
$caseFields['APP_STATUS'] = Application::APP_STATUS_CANCELLED;
|
||||
$this->updateCase($appUid, $caseFields);
|
||||
|
||||
$appStatusCurrent = $aFields['APP_STATUS'];
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(AppDelegationPeer::APP_UID, $sApplicationUID);
|
||||
$oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
|
||||
$resAppDel = AppDelegationPeer::doCount($oCriteria);
|
||||
|
||||
$this->CloseCurrentDelegation($sApplicationUID, $iIndex);
|
||||
if ($resAppDel == 1) {
|
||||
$aFields['APP_STATUS'] = 'CANCELLED';
|
||||
$oApplication->update($aFields);
|
||||
|
||||
require_once 'classes/model/AdditionalTables.php';
|
||||
$oReportTables = new ReportTables();
|
||||
$addtionalTables = new additionalTables();
|
||||
$oReportTables->updateTables($aFields['PRO_UID'], $aFields['APP_UID'], $aFields['APP_NUMBER'], $appData);
|
||||
$addtionalTables->updateReportTables($aFields['PRO_UID'], $aFields['APP_UID'], $aFields['APP_NUMBER'], $appData, $aFields['APP_STATUS']);
|
||||
}
|
||||
$oAppDel = new AppDelegation();
|
||||
$oAppDel->Load($sApplicationUID, $iIndex);
|
||||
$aAppDel = $oAppDel->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$this->closeAppThread($sApplicationUID, $aAppDel['DEL_THREAD']);
|
||||
/** Close the thread(s) in APP_DELEGATION and APP_THREAD */
|
||||
$indexesClosed = self::closeCaseThreads($appUid, $delIndex);
|
||||
|
||||
/** Create a register in APP_DELAY */
|
||||
$delay = new AppDelay();
|
||||
$array['PRO_UID'] = $aFields['PRO_UID'];
|
||||
$array['APP_UID'] = $sApplicationUID;
|
||||
|
||||
$c = new Criteria('workflow');
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn(AppThreadPeer::APP_THREAD_INDEX);
|
||||
$c->add(AppThreadPeer::APP_UID, $sApplicationUID);
|
||||
$c->add(AppThreadPeer::DEL_INDEX, $iIndex);
|
||||
$oDataset = AppThreadPeer::doSelectRS($c);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
$array['APP_THREAD_INDEX'] = $aRow['APP_THREAD_INDEX'];
|
||||
$array['APP_DEL_INDEX'] = $iIndex;
|
||||
$array['APP_TYPE'] = 'CANCEL';
|
||||
foreach ($indexesClosed as $value){
|
||||
$dataList = [];
|
||||
$rowDelay = AppDelay::buildAppDelayRow(
|
||||
$caseFields['PRO_UID'],
|
||||
isset($caseFields['PRO_ID']) ? $caseFields['PRO_ID'] : 0,
|
||||
$appUid,
|
||||
$caseFields['APP_NUMBER'],
|
||||
$value['DEL_THREAD'],
|
||||
$value['DEL_INDEX'],
|
||||
AppDelay::APP_TYPE_CANCEL,
|
||||
Application::APP_STATUS_CANCELLED,
|
||||
is_null($usrUid) ? '' : $usrUid
|
||||
);
|
||||
$delay->create($rowDelay);
|
||||
|
||||
$c = new Criteria('workflow');
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn(ApplicationPeer::APP_STATUS);
|
||||
$c->add(ApplicationPeer::APP_UID, $sApplicationUID);
|
||||
$oDataset = ApplicationPeer::doSelectRS($c);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aRow1 = $oDataset->getRow();
|
||||
$array['APP_STATUS'] = $aRow1['APP_STATUS'];
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$dataList = [
|
||||
'APP_UID' => $appUid,
|
||||
'DEL_INDEX' => $value['DEL_INDEX'],
|
||||
'USR_UID' => $rowDelay['APP_DELEGATION_USER'],
|
||||
'APP_STATUS_CURRENT' => $appStatusCurrent
|
||||
];
|
||||
|
||||
$array['APP_DELEGATION_USER'] = $user_logged;
|
||||
$array['APP_ENABLE_ACTION_USER'] = $user_logged;
|
||||
$array['APP_ENABLE_ACTION_DATE'] = date('Y-m-d H:i:s');
|
||||
$array['APP_NUMBER'] = $oApplication->getAppNumber();
|
||||
$delay->create($array);
|
||||
$dataList = array_merge($caseFields, $dataList);
|
||||
$listCanceled = new ListCanceled();
|
||||
$listCanceled->create($dataList);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
}
|
||||
|
||||
//Before cancel a case verify if is a child case
|
||||
$oCriteria2 = new Criteria('workflow');
|
||||
$oCriteria2->add(SubApplicationPeer::APP_UID, $sApplicationUID);
|
||||
$oCriteria2->add(SubApplicationPeer::SA_STATUS, 'ACTIVE');
|
||||
if (SubApplicationPeer::doCount($oCriteria2) > 0) {
|
||||
$oDerivation = new Derivation();
|
||||
$oDerivation->verifyIsCaseChild($sApplicationUID, $iIndex);
|
||||
/**
|
||||
* This function will be close the one or all threads
|
||||
*
|
||||
* @param string $appUid
|
||||
* @param integer $delIndex, if is null we will to close all threads
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function closeCaseThreads($appUid, $delIndex = null)
|
||||
{
|
||||
$delegation = new AppDelegation();
|
||||
$result = [];
|
||||
|
||||
/** Close all the threads in APP_DELEGATION and APP_THREAD */
|
||||
if (is_null($delIndex)) {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$result = $delegation->LoadParallel($appUid);
|
||||
$this->closeAllDelegations($appUid);
|
||||
$this->closeAllThreads($appUid);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
} else {
|
||||
/** Close the specific delIndex in APP_DELEGATION and APP_THREAD */
|
||||
$this->CloseCurrentDelegation($appUid, $delIndex);
|
||||
$resultDelegation = $delegation->Load($appUid, $delIndex);
|
||||
$this->closeAppThread($appUid, $resultDelegation['DEL_THREAD']);
|
||||
$result[] = $resultDelegation;
|
||||
}
|
||||
|
||||
//update searchindex
|
||||
if ($this->appSolr != null) {
|
||||
$this->appSolr->updateApplicationSearchIndex($sApplicationUID);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$data = array(
|
||||
'APP_UID' => $sApplicationUID,
|
||||
'DEL_INDEX' => $iIndex,
|
||||
'USR_UID' => $user_logged,
|
||||
'APP_STATUS_CURRENT' => $appStatusCurrent
|
||||
);
|
||||
$data = array_merge($aFields, $data);
|
||||
$oListCanceled = new ListCanceled();
|
||||
$oListCanceled->create($data);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Un cancel case
|
||||
*
|
||||
* @param string $caseUID
|
||||
* @param string $userUID
|
||||
* @return int
|
||||
* @param string $appUid
|
||||
* @param string $usrUid
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function unCancelCase($appUID, $userUID)
|
||||
public function unCancelCase($appUid, $usrUid)
|
||||
{
|
||||
try {
|
||||
$oUser = new \ProcessMaker\BusinessModel\User();
|
||||
if (!$oUser->checkPermission($userUID, 'PM_UNCANCELCASE')) {
|
||||
$user = new BusinessModelUser();
|
||||
/** Review if the user has the permission PM_UNCANCELCASE */
|
||||
if (!$user->checkPermission($usrUid, 'PM_UNCANCELCASE')) {
|
||||
throw new Exception(G::LoadTranslation('ID_YOU_DO_NOT_HAVE_PERMISSION'));
|
||||
}
|
||||
|
||||
$application = new Application();
|
||||
$rowApplication = $application->load($appUID);
|
||||
if ($rowApplication["APP_STATUS"] !== "CANCELLED") {
|
||||
throw new Exception(G::LoadTranslation('ID_THE_APPLICATION_IS_NOT_CANCELED', [$appUID]));
|
||||
$caseFields = $this->loadCase($appUid);
|
||||
/** Review if the case has the status CANCELLED */
|
||||
if ($caseFields["APP_STATUS"] !== Application::APP_STATUS_CANCELLED) {
|
||||
throw new Exception(G::LoadTranslation('ID_THE_APPLICATION_IS_NOT_CANCELED', [$appUid]));
|
||||
}
|
||||
|
||||
$criteriaAppDelay = new Criteria('workflow');
|
||||
$criteriaAppDelay->add(AppDelayPeer::APP_UID, $appUID);
|
||||
$criteriaAppDelay->add(AppDelayPeer::APP_STATUS, 'CANCELLED');
|
||||
$criteriaAppDelay->add(AppDelayPeer::PRO_UID, $rowApplication['PRO_UID']);
|
||||
$criteriaAppDelay->addDescendingOrderByColumn(AppDelayPeer::APP_ENABLE_ACTION_DATE);
|
||||
$resultSetAppDelay = AppDelayPeer::doSelectRS($criteriaAppDelay);
|
||||
$resultSetAppDelay->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$resultSetAppDelay->next();
|
||||
$rowAppDelay = $resultSetAppDelay->getRow();
|
||||
if (!isset($rowAppDelay['APP_STATUS'])) {
|
||||
throw new Exception(G::LoadTranslation('ID_THREAD_STATUS_DOES_NOT_EXIST_FOR_THE_APPLICATION.', [$appUID]));
|
||||
}
|
||||
//Load the USR_ID
|
||||
$u = new Users();
|
||||
$userId = $u->load($usrUid)['USR_ID'];
|
||||
|
||||
//Application
|
||||
$rowApplication['APP_STATUS'] = 'TO_DO';
|
||||
$rowApplication['APP_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$application->update($rowApplication);
|
||||
|
||||
//AppDelegation
|
||||
$appDelegation = new AppDelegation();
|
||||
$rowAppDelegation = $appDelegation->Load($appUID, $rowAppDelay['APP_DEL_INDEX']);
|
||||
|
||||
$appDelegation = new AppDelegation();
|
||||
$delIndex = $appDelegation->createAppDelegation($rowAppDelegation['PRO_UID'], $rowAppDelegation['APP_UID'], $rowAppDelegation['TAS_UID'], $userUID, $rowAppDelay['APP_THREAD_INDEX']);
|
||||
|
||||
//AppThread
|
||||
$dataAppThread = [
|
||||
'APP_UID' => $rowApplication['APP_UID'],
|
||||
'APP_THREAD_INDEX' => $rowAppDelay['APP_THREAD_INDEX'],
|
||||
'APP_THREAD_STATUS' => 'OPEN',
|
||||
'DEL_INDEX' => $delIndex
|
||||
];
|
||||
$appThread = new AppThread();
|
||||
$appThread->update($dataAppThread);
|
||||
|
||||
//AppDelay
|
||||
$dataAppDelay = [
|
||||
'PRO_UID' => $rowApplication['PRO_UID'],
|
||||
'APP_UID' => $rowApplication['APP_UID'],
|
||||
'APP_THREAD_INDEX' => $rowAppDelay['APP_THREAD_INDEX'],
|
||||
'APP_DELINDEX' => $delIndex,
|
||||
'APP_TYPE' => 'UNCANCEL',
|
||||
'APP_STATUS' => $rowApplication['APP_STATUS'],
|
||||
'APP_NEXT_TASK' => 0,
|
||||
'APP_DELEGATION_USER' => $userUID,
|
||||
'APP_ENABLE_ACTION_USER' => $userUID,
|
||||
'APP_ENABLE_ACTION_DATE' => date('Y-m-d H:i:s'),
|
||||
'APP_DISABLE_ACTION_USER' => 0
|
||||
];
|
||||
//Get the list of thread that close with the CancelCase
|
||||
$appDelay = new AppDelay();
|
||||
$appDelay->create($dataAppDelay);
|
||||
$threadsCanceled = $appDelay->getThreadByStatus($appUid, Application::APP_STATUS_CANCELLED);
|
||||
|
||||
//ListCanceled
|
||||
$criteriaListCanceled = new Criteria("workflow");
|
||||
$criteriaListCanceled->add(ListCanceledPeer::APP_UID, $appUID);
|
||||
$resultSetListCanceled = ListCanceledPeer::doSelectRS($criteriaListCanceled);
|
||||
$resultSetListCanceled->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$resultSetListCanceled->next();
|
||||
$rowListCanceled = $resultSetListCanceled->getRow();
|
||||
ListCanceledPeer::doDelete($criteriaListCanceled);
|
||||
//Get all the threads in the AppDelay
|
||||
foreach ($threadsCanceled as $row){
|
||||
//Load the thread CLOSED
|
||||
$appDelegation = new AppDelegation();
|
||||
$delegationClosed = $appDelegation->Load($appUid, $row['APP_DEL_INDEX']);
|
||||
//Create an appDelegation for each thread
|
||||
$appDelegation = new AppDelegation();
|
||||
$delIndex = $appDelegation->createAppDelegation(
|
||||
$delegationClosed['PRO_UID'],
|
||||
$delegationClosed['APP_UID'],
|
||||
$delegationClosed['TAS_UID'],
|
||||
$usrUid,
|
||||
$delegationClosed['DEL_THREAD'],
|
||||
3,
|
||||
false,
|
||||
$delegationClosed['DEL_PREVIOUS'],
|
||||
null,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
$delegationClosed['APP_NUMBER'],
|
||||
$delegationClosed['TAS_ID'],
|
||||
$userId,
|
||||
$delegationClosed['PRO_ID']
|
||||
);
|
||||
|
||||
//ListInbox
|
||||
$rowListCanceled['DEL_PREVIOUS_USR_USERNAME'] = $rowListCanceled['DEL_CURRENT_USR_USERNAME'];
|
||||
$rowListCanceled['DEL_PREVIOUS_USR_FIRSTNAME'] = $rowListCanceled['DEL_CURRENT_USR_FIRSTNAME'];
|
||||
$rowListCanceled['DEL_PREVIOUS_USR_LASTNAME'] = $rowListCanceled['DEL_CURRENT_USR_LASTNAME'];
|
||||
$rowListCanceled['APP_STATUS'] = 'TO_DO';
|
||||
$rowListCanceled['APP_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$rowListCanceled['DEL_RISK_DATE'] = date('Y-m-d H:i:s');
|
||||
$rowListCanceled['DEL_INDEX'] = $delIndex;
|
||||
unset($rowListCanceled['DEL_CURRENT_USR_USERNAME']);
|
||||
unset($rowListCanceled['DEL_CURRENT_USR_FIRSTNAME']);
|
||||
unset($rowListCanceled['DEL_CURRENT_USR_LASTNAME']);
|
||||
unset($rowListCanceled['APP_CANCELED_DATE']);
|
||||
//Update the appThread
|
||||
$dataAppThread = [
|
||||
'APP_UID' => $row['APP_UID'],
|
||||
'APP_THREAD_INDEX' => $delegationClosed['DEL_THREAD'],
|
||||
'APP_THREAD_STATUS' => 'OPEN',
|
||||
'DEL_INDEX' => $delIndex
|
||||
];
|
||||
$appThread = new AppThread();
|
||||
$res = $appThread->update($dataAppThread);
|
||||
|
||||
$this->putCaseInInboxList($rowListCanceled, $userUID);
|
||||
//New register in AppDelay
|
||||
$newAppDelay = AppDelay::buildAppDelayRow(
|
||||
$row['PRO_UID'],
|
||||
$delegationClosed['PRO_ID'],
|
||||
$row['APP_UID'],
|
||||
$delegationClosed['APP_NUMBER'],
|
||||
$row['APP_THREAD_INDEX'],
|
||||
$delIndex,
|
||||
AppDelay::APP_TYPE_UNCANCEL,
|
||||
Application::APP_STATUS_TODO,
|
||||
$usrUid,
|
||||
$userId
|
||||
);
|
||||
$appDelay->create($newAppDelay);
|
||||
|
||||
//ListParticipatedLast
|
||||
$criteriaListParticipatedLast = new Criteria("workflow");
|
||||
$criteriaListParticipatedLast->add(ListParticipatedLastPeer::APP_UID, $appUID);
|
||||
$resultSetListParticipatedLast = ListParticipatedLastPeer::doSelectRS($criteriaListParticipatedLast);
|
||||
$resultSetListParticipatedLast->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$resultSetListParticipatedLast->next();
|
||||
$rowListParticipatedLast = $resultSetListParticipatedLast->getRow();
|
||||
$rowListParticipatedLast['APP_STATUS'] = 'TO_DO';
|
||||
$rowListParticipatedLast['DEL_THREAD_STATUS'] = 'OPEN';
|
||||
$rowListParticipatedLast['DEL_INIT_DATE'] = null;
|
||||
$listParticipatedLast = new ListParticipatedLast();
|
||||
$listParticipatedLast->update($rowListParticipatedLast);
|
||||
} catch (Exception $oException) {
|
||||
throw $oException;
|
||||
//New register in the listInbox
|
||||
$newDelegation = array_merge($newAppDelay, $delegationClosed);
|
||||
$newDelegation['USR_UID'] = $usrUid;
|
||||
$newDelegation['DEL_INDEX'] = $delIndex;
|
||||
$newDelegation['APP_STATUS'] = Application::APP_STATUS_TODO;
|
||||
$inbox = new ListInbox();
|
||||
//Get the previous user
|
||||
//When the status of the case is DRAFT we does not have a previous thread
|
||||
$previousUser = '';
|
||||
if ($delegationClosed['DEL_PREVIOUS'] != 0){
|
||||
$appDelegation = new AppDelegation();
|
||||
$delegationPrevious = $appDelegation->Load($appUid, $delegationClosed['DEL_PREVIOUS']);
|
||||
$previousUser = $delegationPrevious['USR_UID'];
|
||||
}
|
||||
|
||||
$inbox->newRow($newDelegation, $previousUser);
|
||||
}
|
||||
|
||||
//Update the status of the case
|
||||
$caseFields['APP_STATUS'] = Application::APP_STATUS_TODO;
|
||||
$this->updateCase($appUid, $caseFields);
|
||||
|
||||
//Remove the case from the list Canceled
|
||||
$listCanceled = new ListCanceled();
|
||||
$listCanceled->removeAll($appUid);
|
||||
|
||||
} catch (Exception $exception) {
|
||||
throw $exception;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5783,6 +5827,7 @@ class Cases
|
||||
$resultCaseNotes = 0;
|
||||
$resultSummary = 0;
|
||||
$resultMessages = [];
|
||||
$resultReassignCases = [];
|
||||
|
||||
foreach ($permissions as $row) {
|
||||
$userUid = $row['USR_UID'];
|
||||
@@ -5927,7 +5972,7 @@ class Cases
|
||||
break;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
case 'MSGS_HISTORY':
|
||||
$listMessage= $objectPermission->objectPermissionMessage(
|
||||
$listMessage = $objectPermission->objectPermissionMessage(
|
||||
$appUid,
|
||||
$proUid,
|
||||
$userUid,
|
||||
@@ -5939,11 +5984,17 @@ class Cases
|
||||
);
|
||||
$resultMessages = array_merge($resultMessages, $listMessage);
|
||||
break;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
case 'REASSIGN_MY_CASES':
|
||||
$listReassign = $objectPermission->objectPermissionByReassignCases($appUid, $proUid, $tasUid);
|
||||
$resultReassignCases = array_merge($resultReassignCases, $listReassign);
|
||||
break;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
return [
|
||||
"DYNAFORMS" => $resultDynaforms,
|
||||
"INPUT_DOCUMENTS" => $resultInputs,
|
||||
"ATTACHMENTS" => $resultAttachments,
|
||||
@@ -5951,9 +6002,10 @@ class Cases
|
||||
"CASES_NOTES" => $resultCaseNotes,
|
||||
"MSGS_HISTORY" => $resultMessages
|
||||
/*----------------------------------********---------------------------------*/
|
||||
, "REASSIGN_MY_CASES" => $resultReassignCases
|
||||
, "SUMMARY_FORM" => $resultSummary
|
||||
/*----------------------------------********---------------------------------*/
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -7116,7 +7168,9 @@ class Cases
|
||||
|
||||
// BUG 8134, FIX!// for single/double quote troubles // Unserialize with utf8 content get trouble
|
||||
if ($unserializedData === false) {
|
||||
$unserializedData = preg_replace('!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':\"$2\";'", $data);
|
||||
$unserializedData = preg_replace_callback('!s:(\d+):"(.*?)";!', function ($m) {
|
||||
return 's:' . strlen($m[2]) . ':"' . $m[2] . '";';
|
||||
}, $data);
|
||||
$unserializedData = @unserialize($unserializedData);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class Configurations // extends Configuration
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function Configurations()
|
||||
public function __construct()
|
||||
{
|
||||
$this->Configuration = new Configuration();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class DbConnections
|
||||
{
|
||||
@@ -18,7 +19,7 @@ class DbConnections
|
||||
* @param string $pPRO_UID
|
||||
* @return void
|
||||
*/
|
||||
public function __construct ($pPRO_UID = null)
|
||||
public function __construct($pPRO_UID = null)
|
||||
{
|
||||
$this->errno = 0;
|
||||
$this->errstr = "";
|
||||
@@ -32,36 +33,36 @@ class DbConnections
|
||||
*
|
||||
* @return Array $connections
|
||||
*/
|
||||
public function getAllConnections ()
|
||||
public function getAllConnections()
|
||||
{
|
||||
if (isset( $this->PRO_UID )) {
|
||||
if (isset($this->PRO_UID)) {
|
||||
$oDBSource = new DbSource();
|
||||
$oContent = new Content();
|
||||
$connections = Array ();
|
||||
$types = Array ();
|
||||
$connections = array ();
|
||||
$types = array ();
|
||||
$this->have_any_connectios = false;
|
||||
|
||||
$c = new Criteria();
|
||||
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_UID );
|
||||
$c->addSelectColumn( DbSourcePeer::PRO_UID );
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_TYPE );
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_SERVER );
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_DATABASE_NAME );
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_USERNAME );
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_PASSWORD );
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_PORT );
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_ENCODE );
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_UID);
|
||||
$c->addSelectColumn(DbSourcePeer::PRO_UID);
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_TYPE);
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_SERVER);
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_DATABASE_NAME);
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_USERNAME);
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_PASSWORD);
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_PORT);
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_ENCODE);
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_CONNECTION_TYPE);
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_TNS);
|
||||
$c->addSelectColumn( ContentPeer::CON_VALUE );
|
||||
$c->addSelectColumn(ContentPeer::CON_VALUE);
|
||||
|
||||
$c->add( DbSourcePeer::PRO_UID, $this->PRO_UID );
|
||||
$c->add( ContentPeer::CON_CATEGORY, 'DBS_DESCRIPTION' );
|
||||
$c->addJoin( DbSourcePeer::DBS_UID, ContentPeer::CON_ID );
|
||||
$c->add(DbSourcePeer::PRO_UID, $this->PRO_UID);
|
||||
$c->add(ContentPeer::CON_CATEGORY, 'DBS_DESCRIPTION');
|
||||
$c->addJoin(DbSourcePeer::DBS_UID, ContentPeer::CON_ID);
|
||||
|
||||
$result = DbSourcePeer::doSelectRS( $c );
|
||||
$result = DbSourcePeer::doSelectRS($c);
|
||||
$result->next();
|
||||
$row = $result->getRow();
|
||||
|
||||
@@ -82,7 +83,7 @@ class DbConnections
|
||||
|
||||
$result->next();
|
||||
}
|
||||
if (! in_array( $row[2], $types )) {
|
||||
if (! in_array($row[2], $types)) {
|
||||
$types[] = $row[2];
|
||||
}
|
||||
$this->connections = $connections;
|
||||
@@ -96,20 +97,19 @@ class DbConnections
|
||||
* @param string $pType
|
||||
* @return Array $connections
|
||||
*/
|
||||
public function getConnections ($pType)
|
||||
public function getConnections($pType)
|
||||
{
|
||||
$connections = Array ();
|
||||
$connections = array ();
|
||||
foreach ($this->connections as $c) {
|
||||
if (trim( $pType ) == trim( $c['DBS_TYPE'] )) {
|
||||
if (trim($pType) == trim($c['DBS_TYPE'])) {
|
||||
$connections[] = $c;
|
||||
}
|
||||
}
|
||||
if (count( $connections ) > 0) {
|
||||
if (count($connections) > 0) {
|
||||
return $connections;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -121,27 +121,27 @@ class DbConnections
|
||||
* @param string $only
|
||||
* @return Array $connections
|
||||
*/
|
||||
public function getConnectionsProUid ($pProUid, $only = array())
|
||||
public function getConnectionsProUid($pProUid, $only = array())
|
||||
{
|
||||
$connections = Array ();
|
||||
$connections = array ();
|
||||
$c = new Criteria();
|
||||
$c->clearSelectColumns();
|
||||
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_UID );
|
||||
$c->addSelectColumn( DbSourcePeer::PRO_UID );
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_TYPE );
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_SERVER );
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_DATABASE_NAME );
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_CONNECTION_TYPE );
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_TNS );
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_UID);
|
||||
$c->addSelectColumn(DbSourcePeer::PRO_UID);
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_TYPE);
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_SERVER);
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_DATABASE_NAME);
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_CONNECTION_TYPE);
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_TNS);
|
||||
|
||||
$result = DbSourcePeer::doSelectRS( $c );
|
||||
$result = DbSourcePeer::doSelectRS($c);
|
||||
$result->next();
|
||||
$row = $result->getRow();
|
||||
|
||||
$sw = count($only) > 0;
|
||||
while ($row = $result->getRow()) {
|
||||
if ((trim( $pProUid ) == trim( $row[1] )) && ( $sw ? in_array($row[2], $only) : true )) {
|
||||
if ((trim($pProUid) == trim($row[1])) && ( $sw ? in_array($row[2], $only) : true )) {
|
||||
$dbUid = $row[0];
|
||||
|
||||
$dbDescription = '';
|
||||
@@ -171,22 +171,80 @@ class DbConnections
|
||||
$result->next();
|
||||
}
|
||||
|
||||
if (count( $connections ) > 0) {
|
||||
if (count($connections) > 0) {
|
||||
return $connections;
|
||||
} else {
|
||||
return Array ();
|
||||
return array ();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* loadAdditionalConnections
|
||||
*
|
||||
* @param $force boolean Determines if we should force load additional connections, even if lastProcessId is the same as active process
|
||||
* @return void
|
||||
*/
|
||||
public function loadAdditionalConnections ()
|
||||
public static function loadAdditionalConnections($force = false)
|
||||
{
|
||||
PROPEL::Init( PATH_METHODS . 'dbConnections/genericDbConnections.php' );
|
||||
// $lastProcessId determines what was the last process ID we processed. If it was the same, we'll continue to
|
||||
static $lastProcessId = null;
|
||||
// We need to rebuild the Propel configuration, but this time, bring in any additional configuration for the active process
|
||||
if ($force || (isset($_SESSION['PROCESS']) && $_SESSION['PROCESS'] != $lastProcessId)) {
|
||||
// Get our current configuration
|
||||
$conf = Propel::getConfiguration();
|
||||
// Iterate through the datasources of configuration, and only care about workflow, rbac or rp. Remove anything else.
|
||||
foreach ($conf['datasources'] as $key => $val) {
|
||||
if (!in_array($key, ['workflow', 'rbac', 'rp'])) {
|
||||
unset($conf['datasources'][$key]);
|
||||
}
|
||||
}
|
||||
// Now, let's fetch all external database connections for this process from cache
|
||||
$externalDbs = Cache::get('proc-' . $_SESSION['PROCESS'] . '-extdbs', function () {
|
||||
// Use explicit DbSource in the model namespace to ignore the global DbSource which is propel built
|
||||
// @todo Eventually remove the global DbSource and remove explicit namespace path
|
||||
return \ProcessMaker\Model\DbSource::where('PRO_UID', $_SESSION['PROCESS'])->get();
|
||||
});
|
||||
foreach ($externalDbs as $externalDb) {
|
||||
$conf['datasources'][$externalDb->DBS_UID] = [];
|
||||
$flagTns = ($externalDb->DBS_TYPE == "oracle" && $externalDb->DBS_CONNECTION_TYPE == "TNS")? 1 : 0;
|
||||
// Build the appropriate items to add to our Propel configuration
|
||||
// Let's grab the decrypted password
|
||||
$passw = '';
|
||||
if ($externalDb->DBS_PASSWORD != '') {
|
||||
$aPassw = explode('_', $externalDb->DBS_PASSWORD);
|
||||
$passw = $aPassw[0];
|
||||
|
||||
if (sizeof($aPassw) > 1 && $flagTns === 0) {
|
||||
$passw = ($passw == "none")? "" : G::decrypt($passw, $externalDb->DBS_DATABASE_NAME);
|
||||
} else {
|
||||
$passw = ($passw == "none")? "" : G::decrypt($passw, $externalDb->DBS_TNS);
|
||||
}
|
||||
}
|
||||
// Check for TNS for Oracle
|
||||
if ($flagTns == 0) {
|
||||
// Not TNS, build a standard configuration
|
||||
$dbsPort = ($externalDb->DBS_PORT == '') ? ('') : (':' . $externalDb->DBS_PORT);
|
||||
$encoding = (trim($externalDb->DBS_ENCODE) == '') ? '' : '?encoding=' . $externalDb->DBS_ENCODE;
|
||||
if (strpos($externalDb->DBS_SERVER, "\\") && $externalDb->DBS_TYPE == 'mssql') {
|
||||
// This is a microsoft SQL server which is using a netbios connection string
|
||||
$conf['datasources'][$externalDb->DBS_UID]['connection'] = $externalDb->DBS_TYPE . '://'
|
||||
. $externalDb->DBS_USERNAME . ':' . $passw . '@' . $externalDb->DBS_SERVER . '/'
|
||||
. $externalDb->DBS_DATABASE_NAME . $encoding;
|
||||
} else {
|
||||
$conf['datasources'][$externalDb->DBS_UID]['connection'] = $externalDb->DBS_TYPE . '://'
|
||||
. $externalDb->DBS_USERNAME . ':' . $passw . '@' . $externalDb->DBS_SERVER . $dbsPort . '/'
|
||||
. $externalDb->DBS_DATABASE_NAME . $encoding;
|
||||
}
|
||||
} else {
|
||||
// Is oracle and TNS, let's provide a TNS based DSN
|
||||
$conf["datasources"][$externalDb->DBS_UID]["connection"] = $externalDb->DBS_TYPE . "://"
|
||||
. $externalDb->DBS_USERNAME . ":" . $passw . "@" . $externalDb->DBS_TNS;
|
||||
}
|
||||
$conf['datasources'][$externalDb->DBS_UID]['adapter'] = $externalDb->DBS_TYPE;
|
||||
}
|
||||
Propel::initConfiguration($conf);
|
||||
$lastProcessId = $_SESSION['PROCESS'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -194,31 +252,19 @@ class DbConnections
|
||||
*
|
||||
* @return array $servicesAvailables
|
||||
*/
|
||||
public function getDbServicesAvailables ()
|
||||
public function getDbServicesAvailables()
|
||||
{
|
||||
$servicesAvailables = Array ();
|
||||
$servicesAvailables = array ();
|
||||
|
||||
$dbServices = Array ('mysql' => Array ('id' => 'mysql','command' => 'mysql_connect','name' => 'MySql'
|
||||
),'pgsql' => Array ('id' => 'pgsql','command' => 'pg_connect','name' => 'PostgreSql'
|
||||
),'mssql' => Array ('id' => 'mssql','command' => 'mssql_connect','name' => 'Microsoft SQL Server'
|
||||
),'oracle' => Array ('id' => 'oracle','command' => 'oci_connect','name' => 'Oracle'
|
||||
)
|
||||
);
|
||||
/*,
|
||||
'informix'=> Array(
|
||||
'id' => 'informix',
|
||||
'command' => 'ifx_connect',
|
||||
'name' => 'Informix'
|
||||
),
|
||||
'sqlite' => Array(
|
||||
'id' => 'sqlite',
|
||||
'command' => 'sqlite_open',
|
||||
'name' => 'SQLite'
|
||||
)
|
||||
*/
|
||||
$dbServices = array ('mysql' => array ('id' => 'mysql','command' => 'mysqli_connect','name' => 'MySql'
|
||||
),'pgsql' => array ('id' => 'pgsql','command' => 'pg_connect','name' => 'PostgreSql'
|
||||
),'mssql' => array ('id' => 'mssql','command' => 'mssql_connect','name' => 'Microsoft SQL Server (mssql extension)'
|
||||
),'sqlsrv' => array ('id' => 'mssql','command' => 'sqlsrv_connect','name' => 'Microsoft SQL Server (sqlsrv extension)'
|
||||
),'oracle' => array ('id' => 'oracle','command' => 'oci_connect','name' => 'Oracle'
|
||||
));
|
||||
|
||||
foreach ($dbServices as $service) {
|
||||
if (@function_exists( $service['command'] )) {
|
||||
if (@function_exists($service['command'])) {
|
||||
$servicesAvailables[] = $service;
|
||||
}
|
||||
}
|
||||
@@ -230,7 +276,7 @@ class DbConnections
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function showMsg ()
|
||||
public function showMsg()
|
||||
{
|
||||
if ($this->errno != 0) {
|
||||
$msg = "
|
||||
@@ -254,91 +300,91 @@ class DbConnections
|
||||
* @param string $engine
|
||||
* @return $this->ordx($this->encodesList);
|
||||
*/
|
||||
public function getEncondeList ($engine = '')
|
||||
public function getEncondeList($engine = '')
|
||||
{
|
||||
switch ($engine) {
|
||||
default:
|
||||
case 'mysql':
|
||||
$encodes = Array (Array ('big5','big5 - Big5 Traditional Chinese'
|
||||
),Array ('dec8','dec8 - DEC West European'
|
||||
),Array ('cp850','cp850 - DOS West European'
|
||||
),Array ('hp8','hp8 - HP West European'
|
||||
),Array ('koi8r','koi8r - KOI8-R Relcom Russian'
|
||||
),Array ('latin1','latin1 - cp1252 West European'
|
||||
),Array ('latin2','latin2 - ISO 8859-2 Central European'
|
||||
),Array ('swe7','swe7 - 7bit Swedish'
|
||||
),Array ('ascii','ascii - US ASCII'
|
||||
),Array ('ujis','ujis - EUC-JP Japanese'
|
||||
),Array ('sjis','sjis - Shift-JIS Japanese'
|
||||
),Array ('hebrew','hebrew - ISO 8859-8 Hebrew'
|
||||
),Array ('tis620','tis620 - TIS620 Thai'
|
||||
),Array ('euckr','euckr - EUC-KR Korean'
|
||||
),Array ('koi8u','koi8u - KOI8-U Ukrainian'
|
||||
),Array ('gb2312','gb2312 - GB2312 Simplified Chinese'
|
||||
),Array ('greek','greek - ISO 8859-7 Greek'
|
||||
),Array ('cp1250','cp1250 - Windows Central European'
|
||||
),Array ('gbk','gbk - GBK Simplified Chinese'
|
||||
),Array ('latin5','latin5 - ISO 8859-9 Turkish'
|
||||
),Array ('armscii8','armscii8 - ARMSCII-8 Armenian'
|
||||
),Array ('utf8','utf8 - UTF-8 Unicode'
|
||||
),Array ('ucs2','ucs2 - UCS-2 Unicode'
|
||||
),Array ('cp866','cp866 - DOS Russian'
|
||||
),Array ('keybcs2','keybcs2 - DOS Kamenicky Czech-Slovak'
|
||||
),Array ('macce','macce - Mac Central European'
|
||||
),Array ('macroman','macroman - Mac West European'
|
||||
),Array ('cp852','cp852 - DOS Central European'
|
||||
),Array ('latin7','atin7 - ISO 8859-13 Baltic'
|
||||
),Array ('cp1251','cp1251 - Windows Cyrillic'
|
||||
),Array ('cp1256','cp1256 - Windows Arabic'
|
||||
),Array ('cp1257','cp1257 - Windows Baltic'
|
||||
),Array ('binary','binary - Binary pseudo charset'
|
||||
),Array ('geostd8','geostd8 - GEOSTD8 Georgian'
|
||||
),Array ('cp932','cp932] - SJIS for Windows Japanese'
|
||||
),Array ('eucjpms','eucjpms - UJIS for Windows Japanese'
|
||||
$encodes = array (array ('big5','big5 - Big5 Traditional Chinese'
|
||||
),array ('dec8','dec8 - DEC West European'
|
||||
),array ('cp850','cp850 - DOS West European'
|
||||
),array ('hp8','hp8 - HP West European'
|
||||
),array ('koi8r','koi8r - KOI8-R Relcom Russian'
|
||||
),array ('latin1','latin1 - cp1252 West European'
|
||||
),array ('latin2','latin2 - ISO 8859-2 Central European'
|
||||
),array ('swe7','swe7 - 7bit Swedish'
|
||||
),array ('ascii','ascii - US ASCII'
|
||||
),array ('ujis','ujis - EUC-JP Japanese'
|
||||
),array ('sjis','sjis - Shift-JIS Japanese'
|
||||
),array ('hebrew','hebrew - ISO 8859-8 Hebrew'
|
||||
),array ('tis620','tis620 - TIS620 Thai'
|
||||
),array ('euckr','euckr - EUC-KR Korean'
|
||||
),array ('koi8u','koi8u - KOI8-U Ukrainian'
|
||||
),array ('gb2312','gb2312 - GB2312 Simplified Chinese'
|
||||
),array ('greek','greek - ISO 8859-7 Greek'
|
||||
),array ('cp1250','cp1250 - Windows Central European'
|
||||
),array ('gbk','gbk - GBK Simplified Chinese'
|
||||
),array ('latin5','latin5 - ISO 8859-9 Turkish'
|
||||
),array ('armscii8','armscii8 - ARMSCII-8 Armenian'
|
||||
),array ('utf8','utf8 - UTF-8 Unicode'
|
||||
),array ('ucs2','ucs2 - UCS-2 Unicode'
|
||||
),array ('cp866','cp866 - DOS Russian'
|
||||
),array ('keybcs2','keybcs2 - DOS Kamenicky Czech-Slovak'
|
||||
),array ('macce','macce - Mac Central European'
|
||||
),array ('macroman','macroman - Mac West European'
|
||||
),array ('cp852','cp852 - DOS Central European'
|
||||
),array ('latin7','atin7 - ISO 8859-13 Baltic'
|
||||
),array ('cp1251','cp1251 - Windows Cyrillic'
|
||||
),array ('cp1256','cp1256 - Windows Arabic'
|
||||
),array ('cp1257','cp1257 - Windows Baltic'
|
||||
),array ('binary','binary - Binary pseudo charset'
|
||||
),array ('geostd8','geostd8 - GEOSTD8 Georgian'
|
||||
),array ('cp932','cp932] - SJIS for Windows Japanese'
|
||||
),array ('eucjpms','eucjpms - UJIS for Windows Japanese'
|
||||
)
|
||||
);
|
||||
|
||||
break;
|
||||
case 'pgsql':
|
||||
$encodes = Array (Array ("BIG5","BIG5"
|
||||
),Array ("EUC_CN","EUC_CN"
|
||||
),Array ("EUC_JP","EUC_JP"
|
||||
),Array ("EUC_KR","EUC_KR"
|
||||
),Array ("EUC_TW","EUC_TW"
|
||||
),Array ("GB18030","GB18030"
|
||||
),Array ("GBK","GBK"
|
||||
),Array ("ISO_8859_5","ISO_8859_5"
|
||||
),Array ("ISO_8859_6","ISO_8859_6"
|
||||
),Array ("ISO_8859_7","ISO_8859_7"
|
||||
),Array ("ISO_8859_8","ISO_8859_8"
|
||||
),Array ("JOHAB","JOHAB"
|
||||
),Array ("KOI8","KOI8"
|
||||
),Array ("selected","LATIN1"
|
||||
),Array ("LATIN2","LATIN2"
|
||||
),Array ("LATIN3","LATIN3"
|
||||
),Array ("LATIN4","LATIN4"
|
||||
),Array ("LATIN5","LATIN5"
|
||||
),Array ("LATIN6","LATIN6"
|
||||
),Array ("LATIN7","LATIN7"
|
||||
),Array ("LATIN8","LATIN8"
|
||||
),Array ("LATIN9","LATIN9"
|
||||
),Array ("LATIN10","LATIN10"
|
||||
),Array ("SJIS","SJIS"
|
||||
),Array ("SQL_ASCII","SQL_ASCII"
|
||||
),Array ("UHC","UHC"
|
||||
),Array ("UTF8","UTF8"
|
||||
),Array ("WIN866","WIN866"
|
||||
),Array ("WIN874","WIN874"
|
||||
),Array ("WIN1250","WIN1250"
|
||||
),Array ("WIN1251","WIN1251"
|
||||
),Array ("WIN1252","WIN1252"
|
||||
),Array ("WIN1256","WIN1256"
|
||||
),Array ("WIN1258","WIN1258"
|
||||
$encodes = array (array ("BIG5","BIG5"
|
||||
),array ("EUC_CN","EUC_CN"
|
||||
),array ("EUC_JP","EUC_JP"
|
||||
),array ("EUC_KR","EUC_KR"
|
||||
),array ("EUC_TW","EUC_TW"
|
||||
),array ("GB18030","GB18030"
|
||||
),array ("GBK","GBK"
|
||||
),array ("ISO_8859_5","ISO_8859_5"
|
||||
),array ("ISO_8859_6","ISO_8859_6"
|
||||
),array ("ISO_8859_7","ISO_8859_7"
|
||||
),array ("ISO_8859_8","ISO_8859_8"
|
||||
),array ("JOHAB","JOHAB"
|
||||
),array ("KOI8","KOI8"
|
||||
),array ("selected","LATIN1"
|
||||
),array ("LATIN2","LATIN2"
|
||||
),array ("LATIN3","LATIN3"
|
||||
),array ("LATIN4","LATIN4"
|
||||
),array ("LATIN5","LATIN5"
|
||||
),array ("LATIN6","LATIN6"
|
||||
),array ("LATIN7","LATIN7"
|
||||
),array ("LATIN8","LATIN8"
|
||||
),array ("LATIN9","LATIN9"
|
||||
),array ("LATIN10","LATIN10"
|
||||
),array ("SJIS","SJIS"
|
||||
),array ("SQL_ASCII","SQL_ASCII"
|
||||
),array ("UHC","UHC"
|
||||
),array ("UTF8","UTF8"
|
||||
),array ("WIN866","WIN866"
|
||||
),array ("WIN874","WIN874"
|
||||
),array ("WIN1250","WIN1250"
|
||||
),array ("WIN1251","WIN1251"
|
||||
),array ("WIN1252","WIN1252"
|
||||
),array ("WIN1256","WIN1256"
|
||||
),array ("WIN1258","WIN1258"
|
||||
)
|
||||
);
|
||||
break;
|
||||
case 'mssql':
|
||||
$encodes = Array (Array ('utf8','utf8 - UTF-8 Unicode'
|
||||
$encodes = array (array ('utf8','utf8 - UTF-8 Unicode'
|
||||
)
|
||||
);
|
||||
break;
|
||||
@@ -353,7 +399,7 @@ class DbConnections
|
||||
}
|
||||
|
||||
$this->encodesList = $encodes;
|
||||
return $this->ordx( $this->encodesList );
|
||||
return $this->ordx($this->encodesList);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -361,7 +407,7 @@ class DbConnections
|
||||
*
|
||||
* @return integer $errno
|
||||
*/
|
||||
public function getErrno ()
|
||||
public function getErrno()
|
||||
{
|
||||
return $this->errno;
|
||||
}
|
||||
@@ -371,7 +417,7 @@ class DbConnections
|
||||
*
|
||||
* @return string errstr
|
||||
*/
|
||||
public function getErrmsg ()
|
||||
public function getErrmsg()
|
||||
{
|
||||
return $this->errstr;
|
||||
}
|
||||
@@ -382,19 +428,19 @@ class DbConnections
|
||||
* @param array $m
|
||||
* @return array $aRet
|
||||
*/
|
||||
public function ordx ($m)
|
||||
public function ordx($m)
|
||||
{
|
||||
$aTmp = Array ();
|
||||
$aRet = Array ();
|
||||
for ($i = 0; $i < count( $m ); $i ++) {
|
||||
array_push( $aTmp, $m[$i][0] . '|' . $m[$i][1] );
|
||||
$aTmp = array ();
|
||||
$aRet = array ();
|
||||
for ($i = 0; $i < count($m); $i ++) {
|
||||
array_push($aTmp, $m[$i][0] . '|' . $m[$i][1]);
|
||||
}
|
||||
usort( $aTmp, "strnatcasecmp" );
|
||||
usort($aTmp, "strnatcasecmp");
|
||||
|
||||
for ($i = 0; $i < count( $aTmp ); $i ++) {
|
||||
$x = explode( '|', $aTmp[$i] );
|
||||
array_push( $aRet, Array ($x[0],$x[1]
|
||||
) );
|
||||
for ($i = 0; $i < count($aTmp); $i ++) {
|
||||
$x = explode('|', $aTmp[$i]);
|
||||
array_push($aRet, array ($x[0],$x[1]
|
||||
));
|
||||
}
|
||||
return $aRet;
|
||||
}
|
||||
@@ -407,30 +453,30 @@ class DbConnections
|
||||
* @param string proUid
|
||||
* @return void
|
||||
*/
|
||||
public function encryptThepassw ($proUid)
|
||||
public function encryptThepassw($proUid)
|
||||
{
|
||||
$oDBSource = new DbSource();
|
||||
|
||||
$c = new Criteria();
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_UID );
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_DATABASE_NAME );
|
||||
$c->addSelectColumn( DbSourcePeer::DBS_PASSWORD );
|
||||
$c->add( DbSourcePeer::PRO_UID, $proUid );
|
||||
$result = DbSourcePeer::doSelectRS( $c );
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_UID);
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_DATABASE_NAME);
|
||||
$c->addSelectColumn(DbSourcePeer::DBS_PASSWORD);
|
||||
$c->add(DbSourcePeer::PRO_UID, $proUid);
|
||||
$result = DbSourcePeer::doSelectRS($c);
|
||||
$result->next();
|
||||
$row = $result->getRow();
|
||||
while ($row = $result->getRow()) {
|
||||
if ($row[2] != '') {
|
||||
$aPass = explode( '_', $row[2] );
|
||||
if (count( $aPass ) == 1) {
|
||||
$passEncrypt = G::encrypt( $row[2], $row[1] );
|
||||
$aPass = explode('_', $row[2]);
|
||||
if (count($aPass) == 1) {
|
||||
$passEncrypt = G::encrypt($row[2], $row[1]);
|
||||
$passEncrypt .= "_2NnV3ujj3w";
|
||||
$c2 = new Criteria( 'workflow' );
|
||||
$c2->add( DbSourcePeer::DBS_PASSWORD, $passEncrypt );
|
||||
$c3 = new Criteria( 'workflow' );
|
||||
$c3->add( DbSourcePeer::DBS_UID, $row[0] );
|
||||
BasePeer::doUpdate( $c3, $c2, Propel::getConnection( 'workflow' ) );
|
||||
$c2 = new Criteria('workflow');
|
||||
$c2->add(DbSourcePeer::DBS_PASSWORD, $passEncrypt);
|
||||
$c3 = new Criteria('workflow');
|
||||
$c3->add(DbSourcePeer::DBS_UID, $row[0]);
|
||||
BasePeer::doUpdate($c3, $c2, Propel::getConnection('workflow'));
|
||||
}
|
||||
}
|
||||
$result->next();
|
||||
@@ -446,11 +492,11 @@ class DbConnections
|
||||
* @param string passw
|
||||
* @return string
|
||||
*/
|
||||
public function getPassWithoutEncrypt ($aInfoCon)
|
||||
public function getPassWithoutEncrypt($aInfoCon)
|
||||
{
|
||||
$passw = '';
|
||||
if ($aInfoCon['DBS_PASSWORD'] != '') {
|
||||
$aPassw = explode( '_', $aInfoCon['DBS_PASSWORD'] );
|
||||
$aPassw = explode('_', $aInfoCon['DBS_PASSWORD']);
|
||||
$passw = $aPassw[0];
|
||||
|
||||
$flagTns = ($aInfoCon["DBS_TYPE"] == "oracle" && $aInfoCon["DBS_CONNECTION_TYPE"] == "TNS")? 1 : 0;
|
||||
|
||||
@@ -1740,22 +1740,33 @@ class Derivation
|
||||
return $aGrp;
|
||||
}
|
||||
|
||||
function checkReplacedByUser ($user)
|
||||
/**
|
||||
* Review the replaced by configuration
|
||||
*
|
||||
* @param string $user
|
||||
*
|
||||
* @return string
|
||||
* @throws Exception
|
||||
*/
|
||||
function checkReplacedByUser($user)
|
||||
{
|
||||
if (is_string( $user )) {
|
||||
$userInstance = UsersPeer::retrieveByPK( $user );
|
||||
if (is_string($user)) {
|
||||
$userInstance = UsersPeer::retrieveByPK($user);
|
||||
} else {
|
||||
$userInstance = $user;
|
||||
}
|
||||
if (! is_object( $userInstance )) {
|
||||
throw new Exception( "The user with the UID '$user' doesn't exist." );
|
||||
if (!is_object($userInstance)) {
|
||||
if (!is_string($user)) {
|
||||
$user = gettype($user);
|
||||
}
|
||||
throw new Exception("The user with the UID '" . $user . "' doesn't exist.");
|
||||
}
|
||||
if ($userInstance->getUsrStatus() == 'ACTIVE') {
|
||||
return $userInstance->getUsrUid();
|
||||
} else {
|
||||
$userReplace = trim( $userInstance->getUsrReplacedBy() );
|
||||
$userReplace = trim($userInstance->getUsrReplacedBy());
|
||||
if ($userReplace != '') {
|
||||
return $this->checkReplacedByUser( UsersPeer::retrieveByPK( $userReplace ) );
|
||||
return $this->checkReplacedByUser(UsersPeer::retrieveByPK($userReplace));
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -18,10 +18,13 @@ class DynaFormField extends DBTable
|
||||
/**
|
||||
* Function SetTo
|
||||
*
|
||||
* @param string $objConnection
|
||||
* @param object $objConnection connection string
|
||||
* @param string $strTable Table name defaultValue=''
|
||||
* @param array $arrKeys table keys defaultValue=UID
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function SetTo($objConnection)
|
||||
public function SetTo($objConnection, $strTable = "", $arrKeys = array('UID'))
|
||||
{
|
||||
DBTable::SetTo($objConnection, 'dynaForm', array('XMLNODE_NAME'
|
||||
));
|
||||
@@ -33,7 +36,7 @@ class DynaFormField extends DBTable
|
||||
* @param string $sUID
|
||||
* @return void
|
||||
*/
|
||||
public function Load($sUID)
|
||||
public function Load($sUID = null)
|
||||
{
|
||||
parent::Load($sUID);
|
||||
if (is_array($this->Fields)) {
|
||||
@@ -51,7 +54,7 @@ class DynaFormField extends DBTable
|
||||
* @param string $uid
|
||||
* @return void
|
||||
*/
|
||||
public function Delete($uid)
|
||||
public function Delete($uid=null)
|
||||
{
|
||||
$this->Fields['XMLNODE_NAME'] = $uid;
|
||||
parent::Delete();
|
||||
@@ -65,7 +68,7 @@ class DynaFormField extends DBTable
|
||||
* @param array $options
|
||||
* @return void
|
||||
*/
|
||||
public function Save($Fields, $labels = array(), $options = array())
|
||||
public function Save($Fields=null, $labels = array(), $options = array())
|
||||
{
|
||||
|
||||
if ($Fields['TYPE'] === 'javascript') {
|
||||
|
||||
@@ -1,294 +1,275 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created on 21/12/2007
|
||||
* Dynaform - Dynaform
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class DynaformEditor extends WebResource
|
||||
{
|
||||
|
||||
private $isOldCopy = false;
|
||||
public $file = '';
|
||||
public $title = 'New Dynaform';
|
||||
public $dyn_uid = '';
|
||||
public $dyn_type = '';
|
||||
public $home = '';
|
||||
|
||||
/**
|
||||
* Other Options for Editor:
|
||||
* left: 'getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))',
|
||||
* top: 'getAbsoluteTop(document.getElementById("dynaformEditor[0]"))',
|
||||
* height: '3/4*(document.body.clientWidth-getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))*2)',
|
||||
* left: 'getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))'
|
||||
* left: 'getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))'
|
||||
*
|
||||
* Other Options for Toolbar:
|
||||
* left: 'getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))',
|
||||
* top: 'getAbsoluteTop(document.getElementById("dynaformEditor[0]"))',
|
||||
*/
|
||||
public $defaultConfig = array('Editor' => array('left' => '0', 'top' => '0', 'width' => 'document.body.clientWidth-4', 'height' => 'document.body.clientHeight-4'),
|
||||
'Toolbar' => array('left' => 'document.body.clientWidth-2-toolbar.clientWidth-24-3+7', 'top' => '52'),
|
||||
'FieldsList' => array('left' => '4+toolbar.clientWidth+24', 'top' => 'getAbsoluteTop(document.getElementById("dynaformEditor[0]"))', 'width' => 244, 'height' => 400)
|
||||
);
|
||||
public $panelConf = array('style' => array('title' => array('textAlign' => 'center')),
|
||||
'width' => 700, 'height' => 600, 'tabWidth' => 120, 'modal' => true, 'drag' => false, 'resize' => false, 'blinkToFront' => false
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructor of the class dynaformEditor
|
||||
*
|
||||
* @param string $get
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($get)
|
||||
{
|
||||
$this->panelConf = array_merge($this->panelConf, $this->defaultConfig['Editor']);
|
||||
//'title' => G::LoadTranslation('ID_DYNAFORM_EDITOR').' - ['.$this->title.']',
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the xml form default
|
||||
*
|
||||
* @param string $filename
|
||||
* @return void
|
||||
*/
|
||||
public function _createDefaultXmlForm($fileName)
|
||||
{
|
||||
//Create the default Dynaform
|
||||
$sampleForm = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
|
||||
$sampleForm .= '<dynaForm type="' . $this->dyn_type . '" name="" width="500" enabletemplate="0" mode="edit">' . "\n";
|
||||
switch ($this->dyn_type) {
|
||||
case "xmlform":
|
||||
/* $sampleForm.='<title type="title" enablehtml="0">' . "\n" .
|
||||
' <en>Sample form</en>' . "\n" .
|
||||
'</title>'."\n";
|
||||
$sampleForm.='<submit type="submit" enablehtml="0" onclick="">' . "\n" .
|
||||
' <en>Submit</en>' . "\n" .
|
||||
'</submit>'."\n"; */
|
||||
break;
|
||||
case "grid":
|
||||
/* $sampleForm.='<fieldA type="text" >' . "\n" .
|
||||
'<en>A</en>' . "\n" .
|
||||
'</fieldA>'."\n";
|
||||
$sampleForm.='<fieldB type="text" >' . "\n" .
|
||||
'<en>B</en>' . "\n" .
|
||||
'</fieldB>'."\n"; */
|
||||
break;
|
||||
}
|
||||
$sampleForm .= '</dynaForm>';
|
||||
G::verifyPath(dirname($fileName), true);
|
||||
$fp = fopen($fileName, 'w');
|
||||
$sampleForm = str_replace('name=""', 'name="' . $this->_getFilename($this->file) . '"', $sampleForm);
|
||||
fwrite($fp, $sampleForm);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the DynaformEditor
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function _render()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
$script = '';
|
||||
|
||||
/* Start Block: Load (Create if doesn't exist) the xmlform */
|
||||
$Parameters = array('SYS_LANG' => SYS_LANG, 'URL' => G::encrypt($this->file, URL_KEY), 'DYN_UID' => $this->dyn_uid, 'PRO_UID' => $this->pro_uid, 'DYNAFORM_NAME' => $this->dyn_title, 'FILE' => $this->file, 'DYN_EDITOR' => $this->dyn_editor
|
||||
);
|
||||
$_SESSION['Current_Dynafom']['Parameters'] = $Parameters;
|
||||
|
||||
$XmlEditor = array('URL' => G::encrypt($this->file, URL_KEY), 'XML' => '' //$openDoc->getXml()
|
||||
);
|
||||
$JSEditor = array('URL' => G::encrypt($this->file, URL_KEY)
|
||||
);
|
||||
|
||||
$A = G::encrypt($this->file, URL_KEY);
|
||||
|
||||
try {
|
||||
$openDoc = new Xml_Document();
|
||||
$fileName = $this->home . $this->file . '.xml';
|
||||
if (file_exists($fileName)) {
|
||||
$openDoc->parseXmlFile($fileName);
|
||||
} else {
|
||||
$this->_createDefaultXmlForm($fileName);
|
||||
$openDoc->parseXmlFile($fileName);
|
||||
}
|
||||
//$form = new Form( $this->file , $this->home, SYS_LANG, true );
|
||||
$Properties = DynaformEditorAjax::get_properties($A, $this->dyn_uid);
|
||||
/* Start Block: Prepare the XMLDB connection */
|
||||
define('DB_XMLDB_HOST', PATH_DYNAFORM . $this->file . '.xml');
|
||||
define('DB_XMLDB_USER', '');
|
||||
define('DB_XMLDB_PASS', '');
|
||||
define('DB_XMLDB_NAME', '');
|
||||
define('DB_XMLDB_TYPE', 'myxml');
|
||||
/* Start Block: Prepare the dynaformEditor */
|
||||
$G_PUBLISH = new Publisher();
|
||||
$sName = 'dynaformEditor';
|
||||
$G_PUBLISH->publisherId = $sName;
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->setTitle(G::LoadTranslation('ID_DYNAFORM_EDITOR') . ' - ' . $Properties['DYN_TITLE']);
|
||||
$G_PUBLISH->AddContent('blank');
|
||||
$this->panelConf['title'] = '';
|
||||
$G_PUBLISH->AddContent('panel-init', 'mainPanel', $this->panelConf);
|
||||
if ($Properties['DYN_TYPE'] == 'xmlform') {
|
||||
$G_PUBLISH->AddContent('xmlform', 'toolbar', 'dynaforms/fields_Toolbar', 'display:none', $Parameters, '', '');
|
||||
} else {
|
||||
$G_PUBLISH->AddContent('xmlform', 'toolbar', 'dynaforms/fields_ToolbarGrid', 'display:none', $Parameters, '', '');
|
||||
}
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_Editor', 'display:none', $Parameters, '', '');
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_XmlEditor', 'display:none', $XmlEditor, '', '');
|
||||
$G_PUBLISH->AddContent('blank');
|
||||
$i = 0;
|
||||
$aFields = array();
|
||||
$aFields[] = array('XMLNODE_NAME' => 'char', 'TYPE' => 'char', 'UP' => 'char', 'DOWN' => 'char'
|
||||
);
|
||||
$oSession = new DBSession(new DBConnection(PATH_DYNAFORM . $this->file . '.xml', '', '', '', 'myxml'));
|
||||
$oDataset = $oSession->Execute('SELECT * FROM dynaForm WHERE NOT( XMLNODE_NAME = "" ) AND TYPE <> "pmconnection"');
|
||||
$iMaximun = $oDataset->count();
|
||||
while ($aRow = $oDataset->Read()) {
|
||||
$aFields[] = array('XMLNODE_NAME' => $aRow['XMLNODE_NAME'], 'TYPE' => $aRow['TYPE'], 'UP' => ($i > 0 ? G::LoadTranslation('ID_UP') : ''), 'DOWN' => ($i < $iMaximun - 1 ? G::LoadTranslation('ID_DOWN') : ''), 'row__' => ($i + 1)
|
||||
);
|
||||
$i++;
|
||||
break;
|
||||
}
|
||||
global $_DBArray;
|
||||
$_DBArray['fields'] = $aFields;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('fields');
|
||||
/**
|
||||
* *@Erik-> this is deprecated,.
|
||||
* (unuseful) $G_PUBLISH->AddContent('propeltable', 'paged-table', 'dynaforms/fields_List', $oCriteria, $Parameters, '', SYS_URI.'dynaforms/dynaforms_PagedTableAjax');**
|
||||
*/
|
||||
$G_PUBLISH->AddContent('blank');
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_JSEditor', 'display:none', $JSEditor, '', '');
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_Properties', 'display:none', $Properties, '', '');
|
||||
//for showHide tab option @Neyek
|
||||
$G_PUBLISH->AddContent('blank');
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_PREVIEW"), $sName . '[3]', 'dynaformEditor.changeToPreview', 'dynaformEditor.saveCurrentView');
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_XML"), $sName . '[4]', 'dynaformEditor.changeToXmlCode', 'dynaformEditor.saveCurrentView');
|
||||
if ($Properties['DYN_TYPE'] != 'grid') {
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_HTML"), $sName . '[5]', 'dynaformEditor.changeToHtmlCode', 'dynaformEditor.saveCurrentView');
|
||||
}
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_FIELDS_LIST"), $sName . '[6]', 'dynaformEditor.changeToFieldsList', 'dynaformEditor.saveCurrentView');
|
||||
if ($Properties["DYN_TYPE"] != "grid") {
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_JAVASCRIPTS"), $sName . '[7]', 'dynaformEditor.changeToJavascripts', 'dynaformEditor.saveCurrentView');
|
||||
}
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_PROPERTIES"), $sName . '[8]', 'dynaformEditor.changeToProperties', 'dynaformEditor.saveCurrentView');
|
||||
|
||||
//for showHide tab option @Neyek
|
||||
if ($Properties["DYN_TYPE"] != "grid") {
|
||||
$G_PUBLISH->AddContent("panel-tab", G::LoadTranslation("ID_CONDITIONS_EDITOR"), $sName . "[9]", "dynaformEditor.changeToShowHide", "dynaformEditor.saveShowHide");
|
||||
}
|
||||
|
||||
$G_PUBLISH->AddContent('panel-close');
|
||||
$oHeadPublisher->addScriptFile("/js/maborak/core/maborak.loader.js",2);
|
||||
$oHeadPublisher->addScriptFile('/jscore/dynaformEditor/core/dynaformEditor.js');
|
||||
|
||||
$oHeadPublisher->addScriptFile('/js/codemirrorOld/js/codemirror.js',1);
|
||||
|
||||
$oHeadPublisher->addScriptFile('/js/grid/core/grid.js');
|
||||
$oHeadPublisher->addScriptCode('
|
||||
var DYNAFORM_URL="' . $Parameters['URL'] . '";
|
||||
leimnud.event.add(window,"load",function(){ loadEditor(); });
|
||||
');
|
||||
$oHeadPublisher->addScriptCode(' var jsMeta;var __usernameLoggedDE__ = "' . (isset($_SESSION['USR_USERNAME']) ? $_SESSION['USR_USERNAME'] : '') . '";var SYS_LANG = "' . SYS_LANG . '";var __DYN_UID__ = "' . $this->dyn_uid . '";');
|
||||
|
||||
$arrayParameterAux = $Parameters;
|
||||
$arrayParameterAux["DYNAFORM_NAME"] = base64_encode($arrayParameterAux["DYNAFORM_NAME"]);
|
||||
$oHeadPublisher->addScriptCode('var dynaformEditorParams = \'' . serialize($arrayParameterAux) . '\';');
|
||||
|
||||
G::RenderPage("publish", 'blank');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename
|
||||
*
|
||||
* @param string $file
|
||||
* @return string
|
||||
*/
|
||||
public function _getFilename($file)
|
||||
{
|
||||
return (strcasecmp(substr($file, - 5), '_tmp0') == 0) ? substr($file, 0, strlen($file) - 5) : $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the temporal copy
|
||||
*
|
||||
* @param string $onOff
|
||||
* @return void
|
||||
*/
|
||||
public function _setUseTemporalCopy($onOff)
|
||||
{
|
||||
$file = self::_getFilename($this->file);
|
||||
if ($onOff) {
|
||||
$this->file = $file . '_tmp0';
|
||||
self::_setTmpData(array('useTmpCopy' => true ));
|
||||
if (!file_exists(PATH_DYNAFORM . $file . '.xml')) {
|
||||
$this->_createDefaultXmlForm(PATH_DYNAFORM . $file . '.xml');
|
||||
}
|
||||
//Creates a copy if it doesn't exist, else, use the old copy
|
||||
if (!file_exists(PATH_DYNAFORM . $this->file . '.xml')) {
|
||||
self::_copyFile(PATH_DYNAFORM . $file . '.xml', PATH_DYNAFORM . $this->file . '.xml');
|
||||
}
|
||||
if (!file_exists(PATH_DYNAFORM . $this->file . '.html') && file_exists(PATH_DYNAFORM . $file . '.html')) {
|
||||
self::_copyFile(PATH_DYNAFORM . $file . '.html', PATH_DYNAFORM . $this->file . '.html');
|
||||
}
|
||||
} else {
|
||||
$this->file = $file;
|
||||
self::_setTmpData(array());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set temporal data
|
||||
*
|
||||
* @param $data
|
||||
* @return void
|
||||
*/
|
||||
public function _setTmpData($data)
|
||||
{
|
||||
G::verifyPath(PATH_C . 'dynEditor/', true);
|
||||
$fp = fopen(PATH_C . 'dynEditor/' . session_id() . '.php', 'w');
|
||||
fwrite($fp, '$tmpData=unserialize(\'' . addcslashes(serialize($data), '\\\'') . '\');');
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get temporal data
|
||||
*
|
||||
* @param string $filename
|
||||
* @return array
|
||||
*/
|
||||
public function _getTmpData()
|
||||
{
|
||||
$tmpData = array();
|
||||
$file = PATH_C . 'dynEditor/' . session_id() . '.php';
|
||||
if (file_exists($file)) {
|
||||
eval(implode('', file($file)));
|
||||
}
|
||||
return $tmpData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy files
|
||||
*
|
||||
* @param file $from
|
||||
* @param file $to
|
||||
* @return void
|
||||
*/
|
||||
public function _copyFile($from, $to)
|
||||
{
|
||||
$copy = implode('', file($from));
|
||||
$fcopy = fopen($to, "w");
|
||||
fwrite($fcopy, $copy);
|
||||
fclose($fcopy);
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created on 21/12/2007
|
||||
* Dynaform - Dynaform
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
class DynaformEditor extends WebResource
|
||||
{
|
||||
private $isOldCopy = false;
|
||||
public $file = '';
|
||||
public $title = 'New Dynaform';
|
||||
public $dyn_uid = '';
|
||||
public $dyn_type = '';
|
||||
public $home = '';
|
||||
|
||||
/**
|
||||
* Other Options for Editor:
|
||||
* left: 'getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))',
|
||||
* top: 'getAbsoluteTop(document.getElementById("dynaformEditor[0]"))',
|
||||
* height: '3/4*(document.body.clientWidth-getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))*2)',
|
||||
* left: 'getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))'
|
||||
* left: 'getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))'
|
||||
*
|
||||
* Other Options for Toolbar:
|
||||
* left: 'getAbsoluteLeft(document.getElementById("dynaformEditor[0]"))',
|
||||
* top: 'getAbsoluteTop(document.getElementById("dynaformEditor[0]"))',
|
||||
*/
|
||||
public $defaultConfig = array('Editor' => array('left' => '0', 'top' => '0', 'width' => 'document.body.clientWidth-4', 'height' => 'document.body.clientHeight-4'),
|
||||
'Toolbar' => array('left' => 'document.body.clientWidth-2-toolbar.clientWidth-24-3+7', 'top' => '52'),
|
||||
'FieldsList' => array('left' => '4+toolbar.clientWidth+24', 'top' => 'getAbsoluteTop(document.getElementById("dynaformEditor[0]"))', 'width' => 244, 'height' => 400)
|
||||
);
|
||||
public $panelConf = array('style' => array('title' => array('textAlign' => 'center')),
|
||||
'width' => 700, 'height' => 600, 'tabWidth' => 120, 'modal' => true, 'drag' => false, 'resize' => false, 'blinkToFront' => false
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructor of the class dynaformEditor
|
||||
*
|
||||
* @param string $get
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($get)
|
||||
{
|
||||
$this->panelConf = array_merge($this->panelConf, $this->defaultConfig['Editor']);
|
||||
//'title' => G::LoadTranslation('ID_DYNAFORM_EDITOR').' - ['.$this->title.']',
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the xml form default
|
||||
*
|
||||
* @param string $filename
|
||||
* @return void
|
||||
*/
|
||||
public function _createDefaultXmlForm($fileName)
|
||||
{
|
||||
//Create the default Dynaform
|
||||
$sampleForm = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
|
||||
$sampleForm .= '<dynaForm type="' . $this->dyn_type . '" name="" width="500" enabletemplate="0" mode="edit">' . "\n";
|
||||
|
||||
$sampleForm .= '</dynaForm>';
|
||||
G::verifyPath(dirname($fileName), true);
|
||||
$fp = fopen($fileName, 'w');
|
||||
$sampleForm = str_replace('name=""', 'name="' . $this->_getFilename($this->file) . '"', $sampleForm);
|
||||
fwrite($fp, $sampleForm);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the DynaformEditor
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function _render()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
$script = '';
|
||||
|
||||
/* Start Block: Load (Create if doesn't exist) the xmlform */
|
||||
$Parameters = array('SYS_LANG' => SYS_LANG, 'URL' => G::encrypt($this->file, URL_KEY), 'DYN_UID' => $this->dyn_uid, 'PRO_UID' => $this->pro_uid, 'DYNAFORM_NAME' => $this->dyn_title, 'FILE' => $this->file, 'DYN_EDITOR' => $this->dyn_editor
|
||||
);
|
||||
$_SESSION['Current_Dynafom']['Parameters'] = $Parameters;
|
||||
|
||||
$XmlEditor = array('URL' => G::encrypt($this->file, URL_KEY), 'XML' => '' //$openDoc->getXml()
|
||||
);
|
||||
$JSEditor = array('URL' => G::encrypt($this->file, URL_KEY)
|
||||
);
|
||||
|
||||
$A = G::encrypt($this->file, URL_KEY);
|
||||
|
||||
try {
|
||||
$openDoc = new Xml_Document();
|
||||
$fileName = $this->home . $this->file . '.xml';
|
||||
if (file_exists($fileName)) {
|
||||
$openDoc->parseXmlFile($fileName);
|
||||
} else {
|
||||
$this->_createDefaultXmlForm($fileName);
|
||||
$openDoc->parseXmlFile($fileName);
|
||||
}
|
||||
//$form = new Form( $this->file , $this->home, SYS_LANG, true );
|
||||
$Properties = DynaformEditorAjax::get_properties($A, $this->dyn_uid);
|
||||
/* Start Block: Prepare the XMLDB connection */
|
||||
define('DB_XMLDB_HOST', PATH_DYNAFORM . $this->file . '.xml');
|
||||
define('DB_XMLDB_USER', '');
|
||||
define('DB_XMLDB_PASS', '');
|
||||
define('DB_XMLDB_NAME', '');
|
||||
define('DB_XMLDB_TYPE', 'myxml');
|
||||
/* Start Block: Prepare the dynaformEditor */
|
||||
$G_PUBLISH = new Publisher();
|
||||
$sName = 'dynaformEditor';
|
||||
$G_PUBLISH->publisherId = $sName;
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->setTitle(G::LoadTranslation('ID_DYNAFORM_EDITOR') . ' - ' . $Properties['DYN_TITLE']);
|
||||
$G_PUBLISH->AddContent('blank');
|
||||
$this->panelConf['title'] = '';
|
||||
$G_PUBLISH->AddContent('panel-init', 'mainPanel', $this->panelConf);
|
||||
if ($Properties['DYN_TYPE'] == 'xmlform') {
|
||||
$G_PUBLISH->AddContent('xmlform', 'toolbar', 'dynaforms/fields_Toolbar', 'display:none', $Parameters, '', '');
|
||||
} else {
|
||||
$G_PUBLISH->AddContent('xmlform', 'toolbar', 'dynaforms/fields_ToolbarGrid', 'display:none', $Parameters, '', '');
|
||||
}
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_Editor', 'display:none', $Parameters, '', '');
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_XmlEditor', 'display:none', $XmlEditor, '', '');
|
||||
$G_PUBLISH->AddContent('blank');
|
||||
$i = 0;
|
||||
$aFields = array();
|
||||
$aFields[] = array('XMLNODE_NAME' => 'char', 'TYPE' => 'char', 'UP' => 'char', 'DOWN' => 'char'
|
||||
);
|
||||
$oSession = new DBSession(new DBConnection(PATH_DYNAFORM . $this->file . '.xml', '', '', '', 'myxml'));
|
||||
$oDataset = $oSession->Execute('SELECT * FROM dynaForm WHERE NOT( XMLNODE_NAME = "" ) AND TYPE <> "pmconnection"');
|
||||
$iMaximun = $oDataset->count();
|
||||
while ($aRow = $oDataset->Read()) {
|
||||
$aFields[] = array('XMLNODE_NAME' => $aRow['XMLNODE_NAME'], 'TYPE' => $aRow['TYPE'], 'UP' => ($i > 0 ? G::LoadTranslation('ID_UP') : ''), 'DOWN' => ($i < $iMaximun - 1 ? G::LoadTranslation('ID_DOWN') : ''), 'row__' => ($i + 1)
|
||||
);
|
||||
$i++;
|
||||
break;
|
||||
}
|
||||
global $_DBArray;
|
||||
$_DBArray['fields'] = $aFields;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('fields');
|
||||
/**
|
||||
* *@Erik-> this is deprecated,.
|
||||
* (unuseful) $G_PUBLISH->AddContent('propeltable', 'paged-table', 'dynaforms/fields_List', $oCriteria, $Parameters, '', SYS_URI.'dynaforms/dynaforms_PagedTableAjax');**
|
||||
*/
|
||||
$G_PUBLISH->AddContent('blank');
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_JSEditor', 'display:none', $JSEditor, '', '');
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_Properties', 'display:none', $Properties, '', '');
|
||||
//for showHide tab option @Neyek
|
||||
$G_PUBLISH->AddContent('blank');
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_PREVIEW"), $sName . '[3]', 'dynaformEditor.changeToPreview', 'dynaformEditor.saveCurrentView');
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_XML"), $sName . '[4]', 'dynaformEditor.changeToXmlCode', 'dynaformEditor.saveCurrentView');
|
||||
if ($Properties['DYN_TYPE'] != 'grid') {
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_HTML"), $sName . '[5]', 'dynaformEditor.changeToHtmlCode', 'dynaformEditor.saveCurrentView');
|
||||
}
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_FIELDS_LIST"), $sName . '[6]', 'dynaformEditor.changeToFieldsList', 'dynaformEditor.saveCurrentView');
|
||||
if ($Properties["DYN_TYPE"] != "grid") {
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_JAVASCRIPTS"), $sName . '[7]', 'dynaformEditor.changeToJavascripts', 'dynaformEditor.saveCurrentView');
|
||||
}
|
||||
$G_PUBLISH->AddContent('panel-tab', G::LoadTranslation("ID_PROPERTIES"), $sName . '[8]', 'dynaformEditor.changeToProperties', 'dynaformEditor.saveCurrentView');
|
||||
|
||||
//for showHide tab option @Neyek
|
||||
if ($Properties["DYN_TYPE"] != "grid") {
|
||||
$G_PUBLISH->AddContent("panel-tab", G::LoadTranslation("ID_CONDITIONS_EDITOR"), $sName . "[9]", "dynaformEditor.changeToShowHide", "dynaformEditor.saveShowHide");
|
||||
}
|
||||
|
||||
$G_PUBLISH->AddContent('panel-close');
|
||||
$oHeadPublisher->addScriptFile("/js/maborak/core/maborak.loader.js", 2);
|
||||
$oHeadPublisher->addScriptFile('/jscore/dynaformEditor/core/dynaformEditor.js');
|
||||
|
||||
$oHeadPublisher->addScriptFile('/js/codemirrorOld/js/codemirror.js', 1);
|
||||
|
||||
$oHeadPublisher->addScriptFile('/js/grid/core/grid.js');
|
||||
$oHeadPublisher->addScriptCode('
|
||||
var DYNAFORM_URL="' . $Parameters['URL'] . '";
|
||||
leimnud.event.add(window,"load",function(){ loadEditor(); });
|
||||
');
|
||||
$oHeadPublisher->addScriptCode(' var jsMeta;var __usernameLoggedDE__ = "' . (isset($_SESSION['USR_USERNAME']) ? $_SESSION['USR_USERNAME'] : '') . '";var SYS_LANG = "' . SYS_LANG . '";var __DYN_UID__ = "' . $this->dyn_uid . '";');
|
||||
|
||||
$arrayParameterAux = $Parameters;
|
||||
$arrayParameterAux["DYNAFORM_NAME"] = base64_encode($arrayParameterAux["DYNAFORM_NAME"]);
|
||||
$oHeadPublisher->addScriptCode('var dynaformEditorParams = \'' . serialize($arrayParameterAux) . '\';');
|
||||
|
||||
G::RenderPage("publish", 'blank');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the filename
|
||||
*
|
||||
* @param string $file
|
||||
* @return string
|
||||
*/
|
||||
public function _getFilename($file)
|
||||
{
|
||||
return (strcasecmp(substr($file, - 5), '_tmp0') == 0) ? substr($file, 0, strlen($file) - 5) : $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the temporal copy
|
||||
*
|
||||
* @param string $onOff
|
||||
* @return void
|
||||
*/
|
||||
public function _setUseTemporalCopy($onOff)
|
||||
{
|
||||
$file = self::_getFilename($this->file);
|
||||
if ($onOff) {
|
||||
$this->file = $file . '_tmp0';
|
||||
self::_setTmpData(array('useTmpCopy' => true ));
|
||||
if (!file_exists(PATH_DYNAFORM . $file . '.xml')) {
|
||||
$this->_createDefaultXmlForm(PATH_DYNAFORM . $file . '.xml');
|
||||
}
|
||||
//Creates a copy if it doesn't exist, else, use the old copy
|
||||
if (!file_exists(PATH_DYNAFORM . $this->file . '.xml')) {
|
||||
self::_copyFile(PATH_DYNAFORM . $file . '.xml', PATH_DYNAFORM . $this->file . '.xml');
|
||||
}
|
||||
if (!file_exists(PATH_DYNAFORM . $this->file . '.html') && file_exists(PATH_DYNAFORM . $file . '.html')) {
|
||||
self::_copyFile(PATH_DYNAFORM . $file . '.html', PATH_DYNAFORM . $this->file . '.html');
|
||||
}
|
||||
} else {
|
||||
$this->file = $file;
|
||||
self::_setTmpData(array());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set temporal data
|
||||
*
|
||||
* @param $data
|
||||
* @return void
|
||||
*/
|
||||
public function _setTmpData($data)
|
||||
{
|
||||
G::verifyPath(PATH_C . 'dynEditor/', true);
|
||||
$fp = fopen(PATH_C . 'dynEditor/' . session_id() . '.php', 'w');
|
||||
fwrite($fp, '$tmpData=unserialize(\'' . addcslashes(serialize($data), '\\\'') . '\');');
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get temporal data
|
||||
*
|
||||
* @param string $filename
|
||||
* @return array
|
||||
*/
|
||||
public function _getTmpData()
|
||||
{
|
||||
$tmpData = array();
|
||||
$file = PATH_C . 'dynEditor/' . session_id() . '.php';
|
||||
if (file_exists($file)) {
|
||||
eval(implode('', file($file)));
|
||||
}
|
||||
return $tmpData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy files
|
||||
*
|
||||
* @param file $from
|
||||
* @param file $to
|
||||
* @return void
|
||||
*/
|
||||
public function _copyFile($from, $to)
|
||||
{
|
||||
$copy = implode('', file($from));
|
||||
$fcopy = fopen($to, "w");
|
||||
fwrite($fcopy, $copy);
|
||||
fclose($fcopy);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class EnterpriseClass extends PMPlugin
|
||||
if (count(glob(PATH_DATA_SITE . 'license/*.dat')) == 0) {
|
||||
return;
|
||||
}
|
||||
require_once ("classes/model/Users.php");
|
||||
require_once("classes/model/Users.php");
|
||||
$user = $data;
|
||||
$criteria = new Criteria("workflow");
|
||||
|
||||
@@ -45,26 +45,9 @@ class EnterpriseClass extends PMPlugin
|
||||
$sw = 0;
|
||||
|
||||
if (UsersPeer::doCount($criteria) > 0) {
|
||||
//if ($rsSQLUSR->getRecordCount() > 0) {
|
||||
$sw = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
$cnn = Propel::getConnection("workflow");
|
||||
$stmt = $cnn->createStatement();
|
||||
|
||||
$sql = "SELECT USR.USR_UID
|
||||
FROM USERS AS USR
|
||||
WHERE USR.USR_USERNAME = '" . $user->lName . "' AND USR.USR_ROLE = 'PROCESSMAKER_ADMIN'";
|
||||
$rsSQLUSR = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$sw = 0;
|
||||
|
||||
if ($rsSQLUSR->getRecordCount() > 0) {
|
||||
$sw = 1;
|
||||
}
|
||||
*/
|
||||
|
||||
if ($sw == 1) {
|
||||
//Upgrade available
|
||||
$swUpgrade = 0;
|
||||
@@ -78,7 +61,8 @@ class EnterpriseClass extends PMPlugin
|
||||
|
||||
foreach ($addon as $index => $value) {
|
||||
if ($addon[$index]["id"] == "processmaker") {
|
||||
if (version_compare($pmVersion . "", (EnterpriseUtils::pmVersion($addon[$index]["version"])) . "", "<")) {
|
||||
if (version_compare($pmVersion . "",
|
||||
(EnterpriseUtils::pmVersion($addon[$index]["version"])) . "", "<")) {
|
||||
$swUpgrade = 1;
|
||||
break;
|
||||
}
|
||||
@@ -99,23 +83,23 @@ class EnterpriseClass extends PMPlugin
|
||||
|
||||
public function enterpriseLimitCreateUser()
|
||||
{
|
||||
$oServerConf = &ServerConf::getSingleton();
|
||||
$infoLicense =$oServerConf->getProperty('LICENSE_INFO');
|
||||
$oServerConf = ServerConf::getSingleton();
|
||||
$infoLicense = $oServerConf->getProperty('LICENSE_INFO');
|
||||
if (isset($infoLicense[config("system.workspace")]['LIMIT_USERS'])) {
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
|
||||
$count = UsersPeer::doCount($criteria);
|
||||
if ($count >= $infoLicense[config("system.workspace")]['LIMIT_USERS'] ) {
|
||||
if ($count >= $infoLicense[config("system.workspace")]['LIMIT_USERS']) {
|
||||
throw new Exception("You can\'t add more users to the System, this reach the limit of allowed users by license that it has installed now");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function setHashPassword ($object)
|
||||
public function setHashPassword($object)
|
||||
{
|
||||
$type = array('md5', 'sha256');
|
||||
if (!in_array($object->hash, $type)) {
|
||||
throw new Exception( 'Type: ' . $object->hash. ' No valid.');
|
||||
throw new Exception('Type: ' . $object->hash . ' No valid.');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -138,7 +122,7 @@ class EnterpriseClass extends PMPlugin
|
||||
$criteria->add(RbacUsersPeer::USR_STATUS, 0, Criteria::NOT_EQUAL);
|
||||
$dataset = RbacUsersPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
|
||||
while ($dataset->next()) {
|
||||
$row = $dataset->getRow();
|
||||
$property = $userProperty->loadOrCreateIfNotExists($row['USR_UID'], array());
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -144,8 +144,8 @@ class LdapAdvanced
|
||||
/**
|
||||
* Set User to this Authentication Source
|
||||
*
|
||||
* @param string $userUid UID of User
|
||||
* @param array $arrayUserLdap User LDAP data
|
||||
* @param string $userUid UID of User
|
||||
* @param array $arrayUserLdap User LDAP data
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
@@ -296,8 +296,8 @@ class LdapAdvanced
|
||||
public function progressBar($total, $count)
|
||||
{
|
||||
try {
|
||||
$p = (int) (($count * 100) / $total);
|
||||
$n = (int) ($p / 2);
|
||||
$p = (int)(($count * 100) / $total);
|
||||
$n = (int)($p / 2);
|
||||
|
||||
return "[" . str_repeat("|", $n) . str_repeat(" ", 50 - $n) . "] $p%";
|
||||
} catch (Exception $e) {
|
||||
@@ -309,7 +309,7 @@ class LdapAdvanced
|
||||
* Show front end
|
||||
*
|
||||
* @param string $option Option
|
||||
* @param string $data Data string
|
||||
* @param string $data Data string
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
@@ -587,14 +587,14 @@ class LdapAdvanced
|
||||
/**
|
||||
* Get Users from Department (Search result identifier)
|
||||
*
|
||||
* @param resource $ldapcnn LDAP link identifier
|
||||
* @param resource $searchResult Search result identifier
|
||||
* @param string $option Option (GET, SYNCHRONIZE)
|
||||
* @param string $dn DN
|
||||
* @param string $uidUserIdentifier User identifier
|
||||
* @param int $totalUser Total users
|
||||
* @param int $countUser User counter
|
||||
* @param array $arrayData Data
|
||||
* @param resource $ldapcnn LDAP link identifier
|
||||
* @param resource $searchResult Search result identifier
|
||||
* @param string $option Option (GET, SYNCHRONIZE)
|
||||
* @param string $dn DN
|
||||
* @param string $uidUserIdentifier User identifier
|
||||
* @param int $totalUser Total users
|
||||
* @param int $countUser User counter
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return an array data
|
||||
*/
|
||||
@@ -663,9 +663,9 @@ class LdapAdvanced
|
||||
/**
|
||||
* Get Users from Department
|
||||
*
|
||||
* @param string $option Option (GET, SYNCHRONIZE)
|
||||
* @param string $dn DN of Department
|
||||
* @param array $arrayData Data
|
||||
* @param string $option Option (GET, SYNCHRONIZE)
|
||||
* @param string $dn DN of Department
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return an array with data Users or array data
|
||||
*/
|
||||
@@ -681,7 +681,7 @@ class LdapAdvanced
|
||||
|
||||
//Set variables
|
||||
$dn = trim($dn);
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac = RBAC::getSingleton();
|
||||
|
||||
if (is_null($rbac->authSourcesObj)) {
|
||||
$rbac->authSourcesObj = new AuthenticationSource();
|
||||
@@ -792,12 +792,12 @@ class LdapAdvanced
|
||||
/**
|
||||
* Synchronize Group's members
|
||||
*
|
||||
* @param resource $ldapcnn LDAP link identifier
|
||||
* @param array $arrayAuthSourceData Authentication Source Data
|
||||
* @param string $groupUid Unique id of Group
|
||||
* @param array $arrayGroupLdap LDAP Group
|
||||
* @param string $memberAttribute Member attribute
|
||||
* @param array $arrayData Data
|
||||
* @param resource $ldapcnn LDAP link identifier
|
||||
* @param array $arrayAuthSourceData Authentication Source Data
|
||||
* @param string $groupUid Unique id of Group
|
||||
* @param array $arrayGroupLdap LDAP Group
|
||||
* @param string $memberAttribute Member attribute
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* @return array Return array data
|
||||
*/
|
||||
@@ -812,7 +812,7 @@ class LdapAdvanced
|
||||
}
|
||||
|
||||
$uidUserIdentifier = (isset($arrayAuthSourceData['AUTH_SOURCE_DATA']['AUTH_SOURCE_IDENTIFIER_FOR_USER'])) ?
|
||||
$arrayAuthSourceData['AUTH_SOURCE_DATA']['AUTH_SOURCE_IDENTIFIER_FOR_USER'] : 'uid';
|
||||
$arrayAuthSourceData['AUTH_SOURCE_DATA']['AUTH_SOURCE_IDENTIFIER_FOR_USER'] : 'uid';
|
||||
|
||||
$filterUsers = trim($arrayAuthSourceData['AUTH_SOURCE_DATA']['AUTH_SOURCE_USERS_FILTER']);
|
||||
|
||||
@@ -843,18 +843,21 @@ class LdapAdvanced
|
||||
|
||||
$username = (isset($arrayUserLdap[$uidUserIdentifier])) ? $arrayUserLdap[$uidUserIdentifier] : '';
|
||||
|
||||
$arrayData['countUser'] ++;
|
||||
$arrayData['countUser']++;
|
||||
|
||||
if ((is_array($username) && !empty($username)) || trim($username) != '') {
|
||||
$arrayData = $this->groupSynchronizeUser(
|
||||
$groupUid, $this->getUserDataFromAttribute($username, $arrayUserLdap), $arrayData
|
||||
$groupUid,
|
||||
$this->getUserDataFromAttribute($username, $arrayUserLdap),
|
||||
$arrayData
|
||||
);
|
||||
}
|
||||
|
||||
//Progress bar
|
||||
$this->frontEndShow(
|
||||
'BAR', 'Groups: ' . $arrayData['i'] . '/' . $arrayData['n'] . ' ' .
|
||||
$this->progressBar($arrayData['totalUser'], $arrayData['countUser'])
|
||||
'BAR',
|
||||
'Groups: ' . $arrayData['i'] . '/' . $arrayData['n'] . ' ' .
|
||||
$this->progressBar($arrayData['totalUser'], $arrayData['countUser'])
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -872,9 +875,9 @@ class LdapAdvanced
|
||||
/**
|
||||
* Get Users from Group
|
||||
*
|
||||
* @param string $option Option (SYNCHRONIZE)
|
||||
* @param array $arrayGroupData Group data
|
||||
* @param array $arrayData Data
|
||||
* @param string $option Option (SYNCHRONIZE)
|
||||
* @param array $arrayGroupData Group data
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return array data
|
||||
*/
|
||||
@@ -889,7 +892,7 @@ class LdapAdvanced
|
||||
|
||||
//Set variables
|
||||
$dn = trim($arrayGroupData["GRP_LDAP_DN"]);
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac = RBAC::getSingleton();
|
||||
|
||||
if (is_null($rbac->authSourcesObj)) {
|
||||
$rbac->authSourcesObj = new AuthenticationSource();
|
||||
@@ -944,7 +947,12 @@ class LdapAdvanced
|
||||
}
|
||||
|
||||
$arrayData = $this->__ldapGroupSynchronizeMembers(
|
||||
$ldapcnn, $arrayAuthenticationSourceData, $arrayGroupData['GRP_UID'], $arrayGroupLdap, $memberAttribute2, array_merge($arrayData, ['totalUser' => $totalUser, 'countUser' => $countUser])
|
||||
$ldapcnn,
|
||||
$arrayAuthenticationSourceData,
|
||||
$arrayGroupData['GRP_UID'],
|
||||
$arrayGroupLdap,
|
||||
$memberAttribute2,
|
||||
array_merge($arrayData, ['totalUser' => $totalUser, 'countUser' => $countUser])
|
||||
);
|
||||
|
||||
$totalUser = $arrayData['totalUser'];
|
||||
@@ -977,7 +985,12 @@ class LdapAdvanced
|
||||
}
|
||||
|
||||
$arrayData = $this->__ldapGroupSynchronizeMembers(
|
||||
$ldapcnn, $arrayAuthenticationSourceData, $arrayGroupData['GRP_UID'], $arrayGroupLdap, $memberAttribute2, array_merge($arrayData, ['totalUser' => $totalUser, 'countUser' => $countUser])
|
||||
$ldapcnn,
|
||||
$arrayAuthenticationSourceData,
|
||||
$arrayGroupData['GRP_UID'],
|
||||
$arrayGroupLdap,
|
||||
$memberAttribute2,
|
||||
array_merge($arrayData, ['totalUser' => $totalUser, 'countUser' => $countUser])
|
||||
);
|
||||
|
||||
$totalUser = $arrayData['totalUser'];
|
||||
@@ -1008,9 +1021,8 @@ class LdapAdvanced
|
||||
*
|
||||
*
|
||||
* @access public
|
||||
|
||||
* @param string $strUser UserId (user login)
|
||||
* @param string $strPass Password
|
||||
* @param string $strUser UserId (user login)
|
||||
* @param string $strPass Password
|
||||
* @return
|
||||
* -1: user doesn"t exists / no existe usuario
|
||||
* -2: wrong password / password errado
|
||||
@@ -1040,7 +1052,7 @@ class LdapAdvanced
|
||||
$validUserPass = 1;
|
||||
|
||||
try {
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac = RBAC::getSingleton();
|
||||
|
||||
if (is_null($rbac->authSourcesObj)) {
|
||||
$rbac->authSourcesObj = new AuthenticationSource();
|
||||
@@ -1055,7 +1067,7 @@ class LdapAdvanced
|
||||
$setAttributes = 0;
|
||||
|
||||
if (isset($arrayAuthSource['AUTH_SOURCE_DATA']['AUTH_SOURCE_SHOWGRID']) &&
|
||||
$arrayAuthSource['AUTH_SOURCE_DATA']['AUTH_SOURCE_SHOWGRID'] == 'on'
|
||||
$arrayAuthSource['AUTH_SOURCE_DATA']['AUTH_SOURCE_SHOWGRID'] == 'on'
|
||||
) {
|
||||
$setAttributes = 1;
|
||||
}
|
||||
@@ -1096,7 +1108,10 @@ class LdapAdvanced
|
||||
$arrayUserData = $user->getUserRecordByPk($usrUid, [], false);
|
||||
|
||||
$result = $this->__ldapUserUpdateByDnAndData(
|
||||
$this->ldapcnn, $arrayAuthSource, $userDn, [$arrayUserData['USR_USERNAME'] => $arrayUserData]
|
||||
$this->ldapcnn,
|
||||
$arrayAuthSource,
|
||||
$userDn,
|
||||
[$arrayUserData['USR_USERNAME'] => $arrayUserData]
|
||||
);
|
||||
|
||||
//Update DN
|
||||
@@ -1125,15 +1140,17 @@ class LdapAdvanced
|
||||
|
||||
$ldapcnn = $this->ldapConnection($arrayAuthSource);
|
||||
$flagUpdate = false;
|
||||
switch (ldap_errno($ldapcnn)) {
|
||||
case '0x00':
|
||||
switch (hexdec(ldap_errno($ldapcnn))) {
|
||||
case 0:
|
||||
//0x00
|
||||
$flagUpdate = true;
|
||||
$statusRbac = 1;
|
||||
$statusUser = 'ACTIVE';
|
||||
break;
|
||||
case '0x34':
|
||||
case '0x58':
|
||||
case '0x5e':
|
||||
case 52:
|
||||
case 88:
|
||||
case 94:
|
||||
//0x34, 0x58, 0x5e
|
||||
//LDAP_UNAVAILABLE
|
||||
//LDAP_USER_CANCELLED
|
||||
//LDAP_NO_RESULTS_RETURNED
|
||||
@@ -1192,7 +1209,7 @@ class LdapAdvanced
|
||||
/**
|
||||
* Get data of a User from attribute
|
||||
*
|
||||
* @param mixed $username Username
|
||||
* @param mixed $username Username
|
||||
* @param array $arrayAttributes Attributes
|
||||
*
|
||||
* return array Return an array with data User
|
||||
@@ -1231,7 +1248,7 @@ class LdapAdvanced
|
||||
|
||||
$paged = !is_null($start) && !is_null($limit);
|
||||
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac = RBAC::getSingleton();
|
||||
|
||||
if (is_null($rbac->authSourcesObj)) {
|
||||
$rbac->authSourcesObj = new AuthenticationSource();
|
||||
@@ -1392,7 +1409,7 @@ class LdapAdvanced
|
||||
$arrayUserData = array();
|
||||
|
||||
//Set variables
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac = RBAC::getSingleton();
|
||||
|
||||
if (is_null($rbac->authSourcesObj)) {
|
||||
$rbac->authSourcesObj = new AuthenticationSource();
|
||||
@@ -1499,7 +1516,7 @@ class LdapAdvanced
|
||||
|
||||
public function automaticRegister($aAuthSource, $strUser, $strPass)
|
||||
{
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac = RBAC::getSingleton();
|
||||
|
||||
if ($rbac->userObj == null) {
|
||||
$rbac->userObj = new RbacUsers();
|
||||
@@ -1593,7 +1610,7 @@ class LdapAdvanced
|
||||
$arrayDepartment = [];
|
||||
|
||||
//Set variables
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac = RBAC::getSingleton();
|
||||
|
||||
if (is_null($rbac->authSourcesObj)) {
|
||||
$rbac->authSourcesObj = new AuthenticationSource();
|
||||
@@ -1698,7 +1715,7 @@ class LdapAdvanced
|
||||
$dFilter = "(&(" . $this->arrayObjectClassFilter["department"] . ")(ou=" . $departmentName . "))";
|
||||
|
||||
$aUsers = array();
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac = RBAC::getSingleton();
|
||||
|
||||
$rbac->authSourcesObj = new AuthenticationSource();
|
||||
$aAuthSource = $rbac->authSourcesObj->load($this->sAuthSource);
|
||||
@@ -1805,6 +1822,7 @@ class LdapAdvanced
|
||||
|
||||
return $terminated;
|
||||
}
|
||||
|
||||
/* activate an user previously deactivated
|
||||
if user is now in another department, we need the second parameter, the depUid
|
||||
|
||||
@@ -1888,7 +1906,7 @@ class LdapAdvanced
|
||||
public function getTerminatedOu()
|
||||
{
|
||||
if (trim($this->sAuthSource) != '') {
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac = RBAC::getSingleton();
|
||||
$aAuthSource = $rbac->authSourcesObj->load($this->sAuthSource);
|
||||
$attributes = $aAuthSource['AUTH_SOURCE_DATA'];
|
||||
$this->sTerminatedOu = isset($attributes['AUTH_SOURCE_RETIRED_OU']) ? $attributes['AUTH_SOURCE_RETIRED_OU'] : '';
|
||||
@@ -1898,11 +1916,11 @@ class LdapAdvanced
|
||||
}
|
||||
|
||||
/**
|
||||
get all authsource for this plugin ( ldapAdvanced plugin, because other authsources are not needed )
|
||||
this function is used only by cron
|
||||
returns only AUTH_SOURCE_PROVIDER = ldapAdvanced
|
||||
|
||||
@return array with authsources with type = ldap
|
||||
* get all authsource for this plugin ( ldapAdvanced plugin, because other authsources are not needed )
|
||||
* this function is used only by cron
|
||||
* returns only AUTH_SOURCE_PROVIDER = ldapAdvanced
|
||||
*
|
||||
* @return array with authsources with type = ldap
|
||||
*/
|
||||
public function getAuthSources()
|
||||
{
|
||||
@@ -1930,15 +1948,15 @@ class LdapAdvanced
|
||||
}
|
||||
|
||||
/**
|
||||
function to get departments from the array previously obtained from LDAP
|
||||
we are calling registered departments
|
||||
it is a recursive function, in the first call with an array with first top level departments from PM
|
||||
then go thru all departments and obtain a list of departments already created in PM and pass that array
|
||||
to next function to synchronize All users for each department
|
||||
this function is used in cron only
|
||||
|
||||
@param array departments obtained from LDAP/Active Directory
|
||||
@param array of departments, first call have only top level departments
|
||||
* function to get departments from the array previously obtained from LDAP
|
||||
* we are calling registered departments
|
||||
* it is a recursive function, in the first call with an array with first top level departments from PM
|
||||
* then go thru all departments and obtain a list of departments already created in PM and pass that array
|
||||
* to next function to synchronize All users for each department
|
||||
* this function is used in cron only
|
||||
*
|
||||
* @param array departments obtained from LDAP/Active Directory
|
||||
* @param array of departments, first call have only top level departments
|
||||
*/
|
||||
public function getRegisteredDepartments(array $arrayLdapDepartment, array $arrayDbDepartment)
|
||||
{
|
||||
@@ -1961,8 +1979,8 @@ class LdapAdvanced
|
||||
}
|
||||
|
||||
/**
|
||||
select departments but it is not recursive, only returns departments in this level
|
||||
@param string $DepParent the DEP_UID for parent department
|
||||
* select departments but it is not recursive, only returns departments in this level
|
||||
* @param string $DepParent the DEP_UID for parent department
|
||||
*/
|
||||
public function getDepartments($DepParent)
|
||||
{
|
||||
@@ -2009,11 +2027,11 @@ class LdapAdvanced
|
||||
}
|
||||
|
||||
/**
|
||||
function to get users from USERS table in wf_workflow and filter by department
|
||||
this function is used in cron only
|
||||
|
||||
@param string department UID ( DEP_UID value )
|
||||
@return array of users
|
||||
* function to get users from USERS table in wf_workflow and filter by department
|
||||
* this function is used in cron only
|
||||
*
|
||||
* @param string department UID ( DEP_UID value )
|
||||
* @return array of users
|
||||
*/
|
||||
public function getUserFromPM($username)
|
||||
{
|
||||
@@ -2040,11 +2058,11 @@ class LdapAdvanced
|
||||
}
|
||||
|
||||
/**
|
||||
get all user (UID, USERNAME) moved to Removed OU
|
||||
this function is used in cron only
|
||||
|
||||
@param array authSource row, in this fuction we are validating if Removed OU is defined or not
|
||||
@return array of users
|
||||
* get all user (UID, USERNAME) moved to Removed OU
|
||||
* this function is used in cron only
|
||||
*
|
||||
* @param array authSource row, in this fuction we are validating if Removed OU is defined or not
|
||||
* @return array of users
|
||||
*/
|
||||
public function getUsersFromRemovedOu($aAuthSource)
|
||||
{
|
||||
@@ -2060,12 +2078,12 @@ class LdapAdvanced
|
||||
}
|
||||
|
||||
/**
|
||||
set STATUS=0 for all users in the array $aUsers
|
||||
this functin is used to deactivate an array of users ( usually used for Removed OU )
|
||||
this function is used in cron only
|
||||
|
||||
@param array authSource row, in this fuction we are validating if Removed OU is defined or not
|
||||
@return array of users
|
||||
* set STATUS=0 for all users in the array $aUsers
|
||||
* this functin is used to deactivate an array of users ( usually used for Removed OU )
|
||||
* this function is used in cron only
|
||||
*
|
||||
* @param array authSource row, in this fuction we are validating if Removed OU is defined or not
|
||||
* @return array of users
|
||||
*/
|
||||
public function deactiveArrayOfUsers($aUsers)
|
||||
{
|
||||
@@ -2108,17 +2126,17 @@ class LdapAdvanced
|
||||
}
|
||||
|
||||
/**
|
||||
creates an users using the data send in the array $aUsers
|
||||
and then add the user to specific department
|
||||
this function is used in cron only
|
||||
|
||||
@param array $aUser info taken from ldap
|
||||
@param string $depUid the department UID
|
||||
@return boolean
|
||||
* creates an users using the data send in the array $aUsers
|
||||
* and then add the user to specific department
|
||||
* this function is used in cron only
|
||||
*
|
||||
* @param array $aUser info taken from ldap
|
||||
* @param string $depUid the department UID
|
||||
* @return boolean
|
||||
*/
|
||||
public function createUserAndActivate($aUser, $depUid)
|
||||
{
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac = RBAC::getSingleton();
|
||||
|
||||
if ($rbac->userObj == null) {
|
||||
$rbac->userObj = new RbacUsers();
|
||||
@@ -2218,7 +2236,7 @@ class LdapAdvanced
|
||||
$arrayGroup = [];
|
||||
|
||||
//Set variables
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac = RBAC::getSingleton();
|
||||
|
||||
if (is_null($rbac->authSourcesObj)) {
|
||||
$rbac->authSourcesObj = new AuthenticationSource();
|
||||
@@ -2354,7 +2372,7 @@ class LdapAdvanced
|
||||
}
|
||||
|
||||
/**
|
||||
select groups but it is not recursive, only returns groups in this level
|
||||
* select groups but it is not recursive, only returns groups in this level
|
||||
*/
|
||||
public function getGroups()
|
||||
{
|
||||
@@ -2380,15 +2398,15 @@ class LdapAdvanced
|
||||
}
|
||||
|
||||
/**
|
||||
function to get groups from the array previously obtained from LDAP
|
||||
we are calling registered groups
|
||||
it is a recursive function, in the first call with an array with first top level groups from PM
|
||||
then go thru all groups and obtain a list of groups already created in PM and pass that array
|
||||
to next function to synchronize All users for each group
|
||||
this function is used in cron only
|
||||
|
||||
@param array groups obtained from LDAP/Active Directory
|
||||
@param array of groups, first call have only top level groups
|
||||
* function to get groups from the array previously obtained from LDAP
|
||||
* we are calling registered groups
|
||||
* it is a recursive function, in the first call with an array with first top level groups from PM
|
||||
* then go thru all groups and obtain a list of groups already created in PM and pass that array
|
||||
* to next function to synchronize All users for each group
|
||||
* this function is used in cron only
|
||||
*
|
||||
* @param array groups obtained from LDAP/Active Directory
|
||||
* @param array of groups, first call have only top level groups
|
||||
*/
|
||||
public function getRegisteredGroups(array $arrayLdapGroup, array $arrayDbGroup)
|
||||
{
|
||||
@@ -2436,7 +2454,9 @@ class LdapAdvanced
|
||||
unset($result['count']);
|
||||
|
||||
foreach ($result as $key => $value) {
|
||||
$result[$key] = addcslashes(preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''", $value), '<>,"');
|
||||
$result[$key] = addcslashes(preg_replace_callback("/\\\([0-9A-Fa-f]{2})/", function ($m) {
|
||||
return chr(hexdec($m[1]));
|
||||
}, $value), '<>,"');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2447,8 +2467,8 @@ class LdapAdvanced
|
||||
* Synchronize User for this Department
|
||||
*
|
||||
* @param string $departmentUid UID of Department
|
||||
* @param array $arrayUserLdap User LDAP data
|
||||
* @param array $arrayData Data
|
||||
* @param array $arrayUserLdap User LDAP data
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return data
|
||||
*/
|
||||
@@ -2469,7 +2489,7 @@ class LdapAdvanced
|
||||
$userUid = $arrayUserData["USR_UID"];
|
||||
$found = true;
|
||||
|
||||
$arrayData["already"] ++;
|
||||
$arrayData["already"]++;
|
||||
$arrayData["alreadyUsers"] .= $arrayUserData["USR_USERNAME"] . " ";
|
||||
}
|
||||
|
||||
@@ -2497,7 +2517,7 @@ class LdapAdvanced
|
||||
|
||||
$this->activateUser($arrayUserData["USR_UID"], $arrayNewUserData["sDN"], $departmentUid);
|
||||
|
||||
$arrayData["moved"] ++;
|
||||
$arrayData["moved"]++;
|
||||
$arrayData["movedUsers"] .= $arrayUserData["USR_USERNAME"] . " ";
|
||||
|
||||
$this->setArrayAuthenticationSourceUser($userUid, $arrayNewUserData); //INITIALIZE DATA //Update User
|
||||
@@ -2509,14 +2529,14 @@ class LdapAdvanced
|
||||
//Impossible
|
||||
$userUid = $arrayUserData["USR_UID"];
|
||||
|
||||
$arrayData["impossible"] ++;
|
||||
$arrayData["impossible"]++;
|
||||
$arrayData["impossibleUsers"] .= $arrayUserData["USR_USERNAME"] . " ";
|
||||
} else {
|
||||
//User not exists
|
||||
//Create User
|
||||
$userUid = $this->createUserAndActivate($arrayNewUserData, $departmentUid);
|
||||
|
||||
$arrayData["created"] ++;
|
||||
$arrayData["created"]++;
|
||||
$arrayData["createdUsers"] .= $arrayNewUserData["sUsername"] . " ";
|
||||
|
||||
$this->setArrayAuthenticationSourceUser($userUid, $arrayNewUserData); //INITIALIZE DATA //Add User
|
||||
@@ -2549,9 +2569,9 @@ class LdapAdvanced
|
||||
/**
|
||||
* Synchronize User for this Group
|
||||
*
|
||||
* @param string $groupUid UID of Group
|
||||
* @param array $arrayUserLdap User LDAP data
|
||||
* @param array $arrayData Data
|
||||
* @param string $groupUid UID of Group
|
||||
* @param array $arrayUserLdap User LDAP data
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return data
|
||||
*/
|
||||
@@ -2574,7 +2594,7 @@ class LdapAdvanced
|
||||
$userUid = $arrayUserData["USR_UID"];
|
||||
$found = true;
|
||||
|
||||
$arrayData["already"] ++;
|
||||
$arrayData["already"]++;
|
||||
$arrayData["alreadyUsers"] .= $arrayUserData["USR_USERNAME"] . " ";
|
||||
}
|
||||
|
||||
@@ -2596,7 +2616,7 @@ class LdapAdvanced
|
||||
|
||||
$group->addUserToGroup($groupUid, $userUid);
|
||||
|
||||
$arrayData["moved"] ++;
|
||||
$arrayData["moved"]++;
|
||||
$arrayData["movedUsers"] .= $arrayUserData["USR_USERNAME"] . " ";
|
||||
|
||||
$this->setArrayAuthenticationSourceUser($userUid, $arrayNewUserData); //INITIALIZE DATA //Update User
|
||||
@@ -2608,7 +2628,7 @@ class LdapAdvanced
|
||||
//Impossible
|
||||
$userUid = $arrayUserData["USR_UID"];
|
||||
|
||||
$arrayData["impossible"] ++;
|
||||
$arrayData["impossible"]++;
|
||||
$arrayData["impossibleUsers"] .= $arrayUserData["USR_USERNAME"] . " ";
|
||||
} else {
|
||||
//User not exists
|
||||
@@ -2617,7 +2637,7 @@ class LdapAdvanced
|
||||
|
||||
$group->addUserToGroup($groupUid, $userUid);
|
||||
|
||||
$arrayData["created"] ++;
|
||||
$arrayData["created"]++;
|
||||
$arrayData["createdUsers"] .= $arrayNewUserData["sUsername"] . " ";
|
||||
|
||||
$this->setArrayAuthenticationSourceUser($userUid, $arrayNewUserData); //INITIALIZE DATA //Add User
|
||||
@@ -2650,10 +2670,10 @@ class LdapAdvanced
|
||||
/**
|
||||
* Update User data based on the LDAP Server
|
||||
*
|
||||
* @param resource $ldapcnn LDAP link identifier
|
||||
* @param array $arrayAuthSourceData Authentication Source Data
|
||||
* @param string $userDn User DN
|
||||
* @param array $arrayUser Users
|
||||
* @param resource $ldapcnn LDAP link identifier
|
||||
* @param array $arrayAuthSourceData Authentication Source Data
|
||||
* @param string $userDn User DN
|
||||
* @param array $arrayUser Users
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
@@ -2661,7 +2681,7 @@ class LdapAdvanced
|
||||
{
|
||||
try {
|
||||
//Set variables
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac = RBAC::getSingleton();
|
||||
|
||||
if (is_null($rbac->userObj)) {
|
||||
$rbac->userObj = new RbacUsers();
|
||||
@@ -2679,7 +2699,7 @@ class LdapAdvanced
|
||||
];
|
||||
|
||||
if (isset($arrayAuthSourceData['AUTH_SOURCE_DATA']['AUTH_SOURCE_GRID_ATTRIBUTE']) &&
|
||||
!empty($arrayAuthSourceData['AUTH_SOURCE_DATA']['AUTH_SOURCE_GRID_ATTRIBUTE'])
|
||||
!empty($arrayAuthSourceData['AUTH_SOURCE_DATA']['AUTH_SOURCE_GRID_ATTRIBUTE'])
|
||||
) {
|
||||
foreach ($arrayAuthSourceData['AUTH_SOURCE_DATA']['AUTH_SOURCE_GRID_ATTRIBUTE'] as $value) {
|
||||
$arrayAttributesToSync[$value['attributeUser']] = $value['attributeLdap'];
|
||||
@@ -2688,7 +2708,7 @@ class LdapAdvanced
|
||||
|
||||
//Search User from LDAP Server
|
||||
$uidUserIdentifier = (isset($arrayAuthSourceData['AUTH_SOURCE_DATA']['AUTH_SOURCE_IDENTIFIER_FOR_USER'])) ?
|
||||
$arrayAuthSourceData['AUTH_SOURCE_DATA']['AUTH_SOURCE_IDENTIFIER_FOR_USER'] : 'uid';
|
||||
$arrayAuthSourceData['AUTH_SOURCE_DATA']['AUTH_SOURCE_IDENTIFIER_FOR_USER'] : 'uid';
|
||||
|
||||
$arrayAttribute = array_merge($this->arrayAttributesForUser, array_values($arrayAttributesToSync));
|
||||
|
||||
@@ -2750,7 +2770,8 @@ class LdapAdvanced
|
||||
}
|
||||
} else {
|
||||
$this->log(
|
||||
$ldapcnn, 'User is repeated: Username "' . $username . '", DN "' . $arrayUserLdap['dn'] . '"'
|
||||
$ldapcnn,
|
||||
'User is repeated: Username "' . $username . '", DN "' . $arrayUserLdap['dn'] . '"'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2770,11 +2791,11 @@ class LdapAdvanced
|
||||
/**
|
||||
* Update Users data based on the LDAP Server
|
||||
*
|
||||
* @param resource $ldapcnn LDAP link identifier
|
||||
* @param array $arrayAuthSourceData Authentication Source Data
|
||||
* @param string $filterUsers Filter
|
||||
* @param array $arrayUserUid UID of Users
|
||||
* @param array $arrayData Data
|
||||
* @param resource $ldapcnn LDAP link identifier
|
||||
* @param array $arrayAuthSourceData Authentication Source Data
|
||||
* @param string $filterUsers Filter
|
||||
* @param array $arrayUserUid UID of Users
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@@ -2815,14 +2836,18 @@ class LdapAdvanced
|
||||
|
||||
do {
|
||||
if ($this->__ldapUserUpdateByDnAndData(
|
||||
$ldapcnn, $arrayAuthSourceData, ldap_get_dn($ldapcnn, $entry), $arrayUser
|
||||
)
|
||||
$ldapcnn,
|
||||
$arrayAuthSourceData,
|
||||
ldap_get_dn($ldapcnn, $entry),
|
||||
$arrayUser
|
||||
)
|
||||
) {
|
||||
$countUser++;
|
||||
|
||||
//Progress bar
|
||||
$this->frontEndShow(
|
||||
'BAR', 'Update Users data: ' . $countUser . '/' . $totalUser . ' ' . $this->progressBar($totalUser, $countUser)
|
||||
'BAR',
|
||||
'Update Users data: ' . $countUser . '/' . $totalUser . ' ' . $this->progressBar($totalUser, $countUser)
|
||||
);
|
||||
}
|
||||
} while ($entry = ldap_next_entry($ldapcnn, $entry));
|
||||
@@ -2849,7 +2874,7 @@ class LdapAdvanced
|
||||
$countUser = 0;
|
||||
|
||||
//Set variables
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac = RBAC::getSingleton();
|
||||
|
||||
if (is_null($rbac->authSourcesObj)) {
|
||||
$rbac->authSourcesObj = new AuthenticationSource();
|
||||
@@ -2880,7 +2905,11 @@ class LdapAdvanced
|
||||
|
||||
if ($count == $limit) {
|
||||
list($totalUser, $countUser) = $this->__ldapUsersUpdateData(
|
||||
$ldapcnn, $arrayAuthenticationSourceData, $filterUsers, $arrayUserUid, ['totalUser' => $totalUser, 'countUser' => $countUser]
|
||||
$ldapcnn,
|
||||
$arrayAuthenticationSourceData,
|
||||
$filterUsers,
|
||||
$arrayUserUid,
|
||||
['totalUser' => $totalUser, 'countUser' => $countUser]
|
||||
);
|
||||
|
||||
$count = 0;
|
||||
@@ -2892,7 +2921,11 @@ class LdapAdvanced
|
||||
|
||||
if ($count > 0) {
|
||||
list($totalUser, $countUser) = $this->__ldapUsersUpdateData(
|
||||
$ldapcnn, $arrayAuthenticationSourceData, $filterUsers, $arrayUserUid, ['totalUser' => $totalUser, 'countUser' => $countUser]
|
||||
$ldapcnn,
|
||||
$arrayAuthenticationSourceData,
|
||||
$filterUsers,
|
||||
$arrayUserUid,
|
||||
['totalUser' => $totalUser, 'countUser' => $countUser]
|
||||
);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
@@ -2920,7 +2953,7 @@ class LdapAdvanced
|
||||
* Get page size limit for a search result
|
||||
*
|
||||
* @param resource $ldapcnn LDAP link identifier
|
||||
* @param string $baseDn The base DN for the directory
|
||||
* @param string $baseDn The base DN for the directory
|
||||
*
|
||||
* @return int Returns the page size limit for a search result
|
||||
*/
|
||||
|
||||
@@ -409,7 +409,7 @@ class license_application extends Padl
|
||||
$DATA['RESULT'] = 'TMINUS';
|
||||
}
|
||||
# the license has expired
|
||||
if ($DATA['DATE']['END'] - time() < 0 && $DATA['DATE']['SPAN'] != 'NEVER' && $DATA['DATE']['SPAN'] != '~') {
|
||||
if (intval($DATA['DATE']['END']) - time() < 0 && $DATA['DATE']['SPAN'] !== 'NEVER' && $DATA['DATE']['SPAN'] !== '~') {
|
||||
$DATA['RESULT'] = 'EXPIRED';
|
||||
}
|
||||
$DATA['DATE']['HUMAN']['START'] = date($this->DATE_STRING, $DATA['DATE']['START']);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
/**
|
||||
* Class MultipleFilesBackup
|
||||
* create a backup of this workspace
|
||||
@@ -20,12 +22,12 @@ class MultipleFilesBackup
|
||||
* @filename contains the path and filename of the comppress file(s).
|
||||
* @size got the Max size of the compressed files, by default if the $size less to zero will mantains 1000 Mb as Max size.
|
||||
*/
|
||||
public function MultipleFilesBackup($filename, $size)
|
||||
public function __construct($filename, $size)
|
||||
{
|
||||
if (!empty($filename)) {
|
||||
$this->filename = $filename;
|
||||
}
|
||||
if (!empty($size) && (int) $size > 0) {
|
||||
if (!empty($size) && (int)$size > 0) {
|
||||
$this->fileSize = $size;
|
||||
}
|
||||
}
|
||||
@@ -91,6 +93,7 @@ class MultipleFilesBackup
|
||||
G::rm_dir($tempDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
/* Restore from file(s) commpressed by letsBackup function, into a temporary directory
|
||||
* @ filename got the name and path of the compressed file(s), if there are many files with file extention as a numerical series, the extention should be discriminated.
|
||||
* @ srcWorkspace contains the workspace to be restored.
|
||||
@@ -162,14 +165,14 @@ class MultipleFilesBackup
|
||||
CLI::logging(CLI::warning("> Workspace $backupWorkspace found, but not restoring.") . "\n");
|
||||
continue;
|
||||
} else {
|
||||
CLI::logging("> Restoring " . CLI::info($backupWorkspace) . " to " . CLI::info($workspaceName) . "\n");
|
||||
CLI::logging('> Restoring ' . CLI::info($backupWorkspace) . ' to ' . CLI::info($workspaceName) . "\n");
|
||||
}
|
||||
$workspace = new WorkspaceTools($workspaceName);
|
||||
if ($workspace->workspaceExists()) {
|
||||
if ($overwrite) {
|
||||
CLI::logging(CLI::warning("> Workspace $workspaceName already exist, overwriting!") . "\n");
|
||||
} else {
|
||||
throw new Exception("Destination workspace already exist (use -o to overwrite)");
|
||||
throw new Exception('Destination workspace already exist (use -o to overwrite)');
|
||||
}
|
||||
}
|
||||
if (file_exists($workspace->path)) {
|
||||
@@ -196,31 +199,35 @@ class MultipleFilesBackup
|
||||
list($dbHost, $dbUser, $dbPass) = @explode(SYSTEM_HASH, G::decrypt(HASH_INSTALLATION, SYSTEM_HASH));
|
||||
|
||||
CLI::logging("> Connecting to system database in '$dbHost'\n");
|
||||
$link = mysql_connect($dbHost, $dbUser, $dbPass);
|
||||
@mysql_query("SET NAMES 'utf8';");
|
||||
@mysql_query("SET FOREIGN_KEY_CHECKS=0;");
|
||||
if (!$link) {
|
||||
throw new Exception('Could not connect to system database: ' . mysql_error());
|
||||
|
||||
try {
|
||||
$connectionLestRestore = 'RESTORE';
|
||||
InstallerModule::setNewConnection($connectionLestRestore, $dbHost, $dbUser, $dbPass, '', '');
|
||||
DB::connection($connectionLestRestore)
|
||||
->statement("SET NAMES 'utf8'");
|
||||
DB::connection($connectionLestRestore)
|
||||
->statement('SET FOREIGN_KEY_CHECKS=0');
|
||||
} catch (Exception $exception) {
|
||||
throw new Exception('Could not connect to system database: ' . $exception->getMessage());
|
||||
}
|
||||
|
||||
|
||||
$onedb = false;
|
||||
if (strpos($metadata->DB_RBAC_NAME, 'rb_') === false) {
|
||||
$onedb = true;
|
||||
} else {
|
||||
$onedb = false;
|
||||
}
|
||||
|
||||
$newDBNames = $workspace->resetDBInfo($dbHost, $createWorkspace, $onedb);
|
||||
$aParameters = array('dbHost' => $dbHost, 'dbUser' => $dbUser, 'dbPass' => $dbPass);
|
||||
$aParameters = ['dbHost' => $dbHost, 'dbUser' => $dbUser, 'dbPass' => $dbPass];
|
||||
|
||||
foreach ($metadata->databases as $db) {
|
||||
$dbName = $newDBNames[$db->name];
|
||||
CLI::logging("+> Restoring database {$db->name} to $dbName\n");
|
||||
$workspace->executeSQLScript($dbName, "$tempDirectory/{$db->name}.sql", $aParameters);
|
||||
$workspace->createDBUser($dbName, $db->pass, "localhost", $dbName);
|
||||
$workspace->createDBUser($dbName, $db->pass, "%", $dbName);
|
||||
$workspace->executeSQLScript($dbName, "$tempDirectory/{$db->name}.sql", $aParameters, 1, $connectionLestRestore);
|
||||
$workspace->createDBUser($dbName, $db->pass, "localhost", $dbName, $connectionLestRestore);
|
||||
$workspace->createDBUser($dbName, $db->pass, "%", $dbName, $connectionLestRestore);
|
||||
}
|
||||
$workspace->upgradeCacheView(false);
|
||||
mysql_close($link);
|
||||
}
|
||||
CLI::logging("Removing temporary files\n");
|
||||
G::rm_dir($tempDirectory);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class Net
|
||||
{
|
||||
public $hostname;
|
||||
@@ -79,7 +81,7 @@ class Net
|
||||
}
|
||||
if ($this->is_ipaddress($ipHost)) {
|
||||
$this->ip = $ipHost;
|
||||
if (! $this->hostname = @gethostbyaddr($ipHost)) {
|
||||
if (!$this->hostname = @gethostbyaddr($ipHost)) {
|
||||
$this->errno = 2000;
|
||||
$this->errstr = "NET::Host down";
|
||||
$this->error = G::loadTranslation('ID_HOST_UNREACHABLE');
|
||||
@@ -87,7 +89,7 @@ class Net
|
||||
} else {
|
||||
$ip = @gethostbyname($ipHost);
|
||||
$long = ip2long($ip);
|
||||
if ($long == - 1 || $long === false) {
|
||||
if ($long == -1 || $long === false) {
|
||||
$this->errno = 2000;
|
||||
$this->errstr = "NET::Host down";
|
||||
$this->error = G::loadTranslation('ID_HOST_UNREACHABLE');
|
||||
@@ -134,8 +136,8 @@ class Net
|
||||
#if have a ip address format
|
||||
if (count($tmp) == 4) {
|
||||
#if a correct ip address
|
||||
for ($i = 0; $i < count($tmp); $i ++) {
|
||||
if (! is_int($tmp[$i])) {
|
||||
for ($i = 0; $i < count($tmp); $i++) {
|
||||
if (!is_int($tmp[$i])) {
|
||||
$key = false;
|
||||
break;
|
||||
}
|
||||
@@ -157,7 +159,7 @@ class Net
|
||||
$cmd = "ping -w $pTTL $this->ip";
|
||||
$output = exec($cmd, $a, $a1);
|
||||
$this->errstr = "";
|
||||
for ($i = 0; $i < count($a); $i ++) {
|
||||
for ($i = 0; $i < count($a); $i++) {
|
||||
$this->errstr += $a[$i];
|
||||
}
|
||||
$this->errno = $a1;
|
||||
@@ -193,7 +195,7 @@ class Net
|
||||
* This function tries to connect to server
|
||||
*
|
||||
* @param string $pDbDriver
|
||||
* @param array $arrayServerData
|
||||
* @param array $arrayServerData
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@@ -212,39 +214,31 @@ class Net
|
||||
|
||||
if (array_key_exists("connectionType", $arrayServerData) || array_key_exists("DBS_TYPEORACLE", $arrayServerData)) {
|
||||
if ($arrayServerData["connectionType"] == "TNS" || $arrayServerData["DBS_TYPEORACLE"] == "TNS") {
|
||||
$flagTns=1;
|
||||
$flagTns = 1;
|
||||
} else {
|
||||
$flagTns=0;
|
||||
$flagTns = 0;
|
||||
}
|
||||
} else {
|
||||
$flagTns=0;
|
||||
$flagTns = 0;
|
||||
}
|
||||
|
||||
if (isset($this->db_user) && (isset($this->db_passwd) || $this->db_passwd == "") && (isset($this->db_sourcename) || $flagTns == 1)) {
|
||||
switch ($pDbDriver) {
|
||||
case 'mysql':
|
||||
if ($this->db_passwd == '') {
|
||||
$link = @mysql_connect($this->ip . (($this->db_port != '') && ($this->db_port != 0) ? ':' . $this->db_port : ''), $this->db_user);
|
||||
} else {
|
||||
$link = @mysql_connect($this->ip . (($this->db_port != '') && ($this->db_port != 0) ? ':' . $this->db_port : ''), $this->db_user, $this->db_passwd);
|
||||
}
|
||||
if ($link) {
|
||||
if (@mysql_ping($link)) {
|
||||
$stat->status = 'SUCCESS';
|
||||
$this->errstr = "";
|
||||
$this->errno = 0;
|
||||
} else {
|
||||
$this->error = "Lost MySql Connection";
|
||||
$this->errstr = "NET::MYSQL->Lost Connection";
|
||||
$this->errno = 10010;
|
||||
}
|
||||
} else {
|
||||
$this->error = "MySql connection refused!";
|
||||
$this->errstr = "NET::MYSQL->The connection was refused";
|
||||
|
||||
try {
|
||||
InstallerModule::setNewConnection('NET', $this->ip, $this->db_user, $this->db_passwd, $this->db_sourcename, $this->db_port);
|
||||
$stat->status = 'SUCCESS';
|
||||
$this->errstr = '';
|
||||
$this->errno = 0;
|
||||
} catch (Exception $exception) {
|
||||
$this->error = 'MySql connection refused!';
|
||||
$this->errstr = 'NET::MYSQL->The connection was refused';
|
||||
$this->errno = 10001;
|
||||
}
|
||||
break;
|
||||
case 'pgsql':
|
||||
//todo
|
||||
$this->db_port = ($this->db_port == "") ? "5432" : $this->db_port;
|
||||
$link = @pg_connect("host='$this->ip' port='$this->db_port' user='$this->db_user' password='$this->db_passwd' dbname='$this->db_sourcename'");
|
||||
if ($link) {
|
||||
@@ -258,12 +252,28 @@ class Net
|
||||
}
|
||||
break;
|
||||
case 'mssql':
|
||||
if ($this->db_instance != "") {
|
||||
$str_port = "";
|
||||
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
|
||||
//todo
|
||||
if (!extension_loaded('sqlsrv')) {
|
||||
if ($this->db_instance != "") {
|
||||
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
|
||||
} else {
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
|
||||
$link = @mssql_connect($this->ip . $port, $this->db_user, $this->db_passwd);
|
||||
}
|
||||
} else {
|
||||
$str_port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
|
||||
$link = @mssql_connect($this->ip . $str_port, $this->db_user, $this->db_passwd);
|
||||
if ($this->db_instance != "") {
|
||||
$server = $this->ip . "\\" . $this->db_instance;
|
||||
} else {
|
||||
$server = $this->ip;
|
||||
}
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ", " . $this->db_port;
|
||||
$server .= $port;
|
||||
$opt = [
|
||||
'UID' => $this->db_user,
|
||||
'PWD' => $this->db_passwd,
|
||||
'Database' => $this->db_sourcename
|
||||
];
|
||||
$link = @sqlsrv_connect($server, $opt);
|
||||
}
|
||||
|
||||
if ($link) {
|
||||
@@ -277,9 +287,10 @@ class Net
|
||||
}
|
||||
break;
|
||||
case 'oracle':
|
||||
//todo
|
||||
try {
|
||||
if ($flagTns == 0) {
|
||||
$this->db_port = ($this->db_port == "" || $this->db_port == 0)? "1521" : $this->db_port;
|
||||
$this->db_port = ($this->db_port == "" || $this->db_port == 0) ? "1521" : $this->db_port;
|
||||
|
||||
$cnn = @oci_connect($this->db_user, $this->db_passwd, "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=$this->ip) (PORT=$this->db_port) )) (CONNECT_DATA=(SERVICE_NAME=$this->db_sourcename)))", $dbsEncode);
|
||||
} else {
|
||||
@@ -315,7 +326,7 @@ class Net
|
||||
* This function tries to open to the DB
|
||||
*
|
||||
* @param string $pDbDriver
|
||||
* @param array $arrayServerData
|
||||
* @param array $arrayServerData
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@@ -336,41 +347,34 @@ class Net
|
||||
|
||||
if (array_key_exists("connectionType", $arrayServerData) || array_key_exists("DBS_TYPEORACLE", $arrayServerData)) {
|
||||
if ($arrayServerData["connectionType"] == "TNS" || $arrayServerData["DBS_TYPEORACLE"] == "TNS") {
|
||||
$flagTns=1;
|
||||
$flagTns = 1;
|
||||
} else {
|
||||
$flagTns=0;
|
||||
$flagTns = 0;
|
||||
}
|
||||
} else {
|
||||
$flagTns=0;
|
||||
$flagTns = 0;
|
||||
}
|
||||
|
||||
if (isset($this->db_user) && (isset($this->db_passwd) || $this->db_passwd == "") && (isset($this->db_sourcename) || $flagTns == 1)) {
|
||||
switch ($pDbDriver) {
|
||||
case 'mysql':
|
||||
$link = @mysql_connect($this->ip . (($this->db_port != '') && ($this->db_port != 0) ? ':' . $this->db_port : ''), $this->db_user, $this->db_passwd);
|
||||
$db = @mysql_select_db($this->db_sourcename);
|
||||
if ($link) {
|
||||
if ($db) {
|
||||
$result = @mysql_query("show tables;");
|
||||
if ($result) {
|
||||
$stat->status = 'SUCCESS';
|
||||
$this->errstr = "";
|
||||
$this->errno = 0;
|
||||
@mysql_free_result($result);
|
||||
} else {
|
||||
$this->error = "the user $this->db_user doesn't have privileges to run queries!";
|
||||
$this->errstr = "NET::MYSQL->Test query failed";
|
||||
$this->errno = 10100;
|
||||
}
|
||||
} else {
|
||||
$this->error = "The $this->db_sourcename data base does'n exist!";
|
||||
$this->errstr = "NET::MYSQL->Select data base failed";
|
||||
$this->errno = 10011;
|
||||
}
|
||||
} else {
|
||||
$this->error = "MySql connection refused!";
|
||||
$this->errstr = "NET::MYSQL->The connection was refused";
|
||||
try {
|
||||
$this->errstr = 'NET::MYSQL->The connection was refused';
|
||||
$this->errno = 10001;
|
||||
$connection = 'NET_' . $this->db_sourcename;
|
||||
InstallerModule::setNewConnection($connection, $this->ip, $this->db_user, $this->db_passwd, $this->db_sourcename, $this->db_port);
|
||||
|
||||
$this->errstr = 'NET::MYSQL->Test query failed';
|
||||
$this->errno = 10100;
|
||||
|
||||
$result = DB::connection($connection)->statement('show tables');
|
||||
if ($result) {
|
||||
$stat->status = 'SUCCESS';
|
||||
$this->errstr = '';
|
||||
$this->errno = 0;
|
||||
}
|
||||
} catch (Exception $exception) {
|
||||
$this->error = $exception->getMessage();
|
||||
}
|
||||
break;
|
||||
case 'pgsql':
|
||||
@@ -393,17 +397,32 @@ class Net
|
||||
}
|
||||
break;
|
||||
case 'mssql':
|
||||
// $str_port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":".$this->db_port;
|
||||
// $link = @mssql_connect($this->ip . $str_port, $this->db_user, $this->db_passwd);
|
||||
if ($this->db_instance != "") {
|
||||
$str_port = "";
|
||||
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
|
||||
if (!extension_loaded('sqlsrv')) {
|
||||
if ($this->db_instance != "") {
|
||||
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
|
||||
} else {
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
|
||||
$link = @mssql_connect($this->ip . $port, $this->db_user, $this->db_passwd);
|
||||
}
|
||||
} else {
|
||||
$str_port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
|
||||
$link = @mssql_connect($this->ip . $str_port, $this->db_user, $this->db_passwd);
|
||||
if ($this->db_instance != "") {
|
||||
$server = $this->ip . "\\" . $this->db_instance;
|
||||
} else {
|
||||
$server = $this->ip;
|
||||
}
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ", " . $this->db_port;
|
||||
$server .= $port;
|
||||
$opt = [
|
||||
'UID' => $this->db_user,
|
||||
'PWD' => $this->db_passwd,
|
||||
'Database' => $this->db_sourcename
|
||||
];
|
||||
$link = $db = @sqlsrv_connect($server, $opt);
|
||||
}
|
||||
if ($link) {
|
||||
$db = @mssql_select_db($this->db_sourcename, $link);
|
||||
if (!extension_loaded('sqlsrv')) {
|
||||
$db = @mssql_select_db($this->db_sourcename, $link);
|
||||
}
|
||||
if ($db) {
|
||||
$stat->status = 'SUCCESS';
|
||||
$this->errstr = "";
|
||||
@@ -421,7 +440,7 @@ class Net
|
||||
break;
|
||||
case 'oracle':
|
||||
if ($flagTns == 0) {
|
||||
$this->db_port = ($this->db_port == "" || $this->db_port == 0)? "1521" : $this->db_port;
|
||||
$this->db_port = ($this->db_port == "" || $this->db_port == 0) ? "1521" : $this->db_port;
|
||||
|
||||
$cnn = @oci_connect($this->db_user, $this->db_passwd, "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=$this->ip) (PORT=$this->db_port) )) (CONNECT_DATA=(SERVICE_NAME=$this->db_sourcename)))", $dbsEncode);
|
||||
} else {
|
||||
@@ -466,13 +485,13 @@ class Net
|
||||
*/
|
||||
public function getDbServerVersion($driver)
|
||||
{
|
||||
if (! isset($this->ip)) {
|
||||
if (!isset($this->ip)) {
|
||||
$this->ip = getenv('HTTP_CLIENT_IP');
|
||||
}
|
||||
|
||||
if (isset($this->ip) && isset($this->db_user) && isset($this->db_passwd)) {
|
||||
try {
|
||||
if (! isset($this->db_sourcename)) {
|
||||
if (!isset($this->db_sourcename)) {
|
||||
$this->db_sourcename = DB_NAME;
|
||||
}
|
||||
$value = 'none';
|
||||
@@ -540,7 +559,7 @@ class Net
|
||||
</div>
|
||||
</fieldset>
|
||||
<center>";
|
||||
print($msg) ;
|
||||
print($msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -200,7 +200,6 @@ class PMPluginRegistry
|
||||
if (array_key_exists($detail->sNamespace, $this->_restServiceEnabled)
|
||||
&& $this->_restServiceEnabled[$detail->sNamespace] == true
|
||||
) {
|
||||
|
||||
$oPlugin->registerRestService();
|
||||
}
|
||||
|
||||
@@ -372,7 +371,6 @@ class PMPluginRegistry
|
||||
*/
|
||||
public function installPluginArchive($filename, $pluginName)
|
||||
{
|
||||
|
||||
$tar = new Archive_Tar($filename);
|
||||
$files = $tar->listContent();
|
||||
$plugins = array();
|
||||
@@ -399,40 +397,6 @@ class PMPluginRegistry
|
||||
//$pluginName = $plugins[0];
|
||||
$pluginFile = "$pluginName.php";
|
||||
|
||||
/*
|
||||
$oldPluginStatus = $this->getStatusPlugin($pluginFile);
|
||||
|
||||
if ($pluginStatus != 0) {
|
||||
$oldDetails = $this->getPluginDetails($pluginFile);
|
||||
$oldVersion = $oldDetails->iVersion;
|
||||
} else {
|
||||
$oldDetails = NULL;
|
||||
$oldVersion = NULL;
|
||||
}
|
||||
*/
|
||||
|
||||
//$pluginIni = $tar->extractInString("$pluginName.ini");
|
||||
//$pluginConfig = parse_ini_string($pluginIni);
|
||||
/*
|
||||
if (!empty($oClass->aDependences)) {
|
||||
foreach ($oClass->aDependences as $aDependence) {
|
||||
if (file_exists(PATH_PLUGINS . $aDependence['sClassName'] . '.php')) {
|
||||
require_once PATH_PLUGINS . $aDependence['sClassName'] . '.php';
|
||||
if (!$oPluginRegistry->getPluginDetails($aDependence['sClassName'] . '.php')) {
|
||||
throw new Exception('This plugin needs "' . $aDependence['sClassName'] . '" plugin');
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new Exception('This plugin needs "' . $aDependence['sClassName'] . '" plugin');
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($oClass);
|
||||
if ($fVersionOld > $fVersionNew) {
|
||||
throw new Exception('A recent version of this plugin was already installed.');
|
||||
}
|
||||
*/
|
||||
|
||||
$res = $tar->extract(PATH_PLUGINS);
|
||||
if (!file_exists(PATH_PLUGINS . $pluginFile)) {
|
||||
throw (new Exception("File \"$pluginFile\" doesn't exist"));
|
||||
@@ -509,8 +473,7 @@ class PMPluginRegistry
|
||||
$wsPathDataSite = PATH_DATA . "sites" . PATH_SEP . $ws->name . PATH_SEP;
|
||||
|
||||
if (file_exists($wsPathDataSite . "plugin.singleton")) {
|
||||
|
||||
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$pluginRegistry = PMPluginRegistry::getSingleton();
|
||||
$pluginRegistry->unSerializeInstance(file_get_contents($wsPathDataSite . "plugin.singleton"));
|
||||
|
||||
///////
|
||||
@@ -551,7 +514,6 @@ class PMPluginRegistry
|
||||
G::RenderPage('publish');
|
||||
die();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -633,7 +595,6 @@ class PMPluginRegistry
|
||||
*/
|
||||
public function registerJavascript($sNamespace, $sCoreJsFile, $pluginJsFile)
|
||||
{
|
||||
|
||||
foreach ($this->_aJavascripts as $i => $js) {
|
||||
if ($sCoreJsFile == $js->sCoreJsFile && $sNamespace == $js->sNamespace) {
|
||||
if (is_string($pluginJsFile)) {
|
||||
@@ -652,7 +613,7 @@ class PMPluginRegistry
|
||||
$js = new StdClass();
|
||||
$js->sNamespace = $sNamespace;
|
||||
$js->sCoreJsFile = $sCoreJsFile;
|
||||
$js->pluginJsFile = Array();
|
||||
$js->pluginJsFile = array();
|
||||
|
||||
if (is_string($pluginJsFile)) {
|
||||
$js->pluginJsFile[] = $pluginJsFile;
|
||||
@@ -930,7 +891,6 @@ class PMPluginRegistry
|
||||
*/
|
||||
public function executeTriggers($triggerId, $oData)
|
||||
{
|
||||
|
||||
foreach ($this->_aTriggers as $row => $detail) {
|
||||
if ($triggerId == $detail->sTriggerId) {
|
||||
//review all folders registered for this namespace
|
||||
@@ -979,7 +939,6 @@ class PMPluginRegistry
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return $found;
|
||||
@@ -1051,8 +1010,8 @@ class PMPluginRegistry
|
||||
require_once($sFilename);
|
||||
}
|
||||
$sClassName = $aDetails[0];
|
||||
$oPlugin =& new $sClassName($sFilename);
|
||||
$this->_aPlugins[$sNamespace] =& $oPlugin;
|
||||
$oPlugin = new $sClassName($sFilename);
|
||||
$this->_aPlugins[$sNamespace] = $oPlugin;
|
||||
return $oPlugin;
|
||||
*/
|
||||
return $oPlugin;
|
||||
@@ -1102,9 +1061,9 @@ class PMPluginRegistry
|
||||
{
|
||||
try {
|
||||
$iPlugins = 0;
|
||||
$oServerConf = ServerConf::getSingleton();
|
||||
$oServerConf->addPlugin(config("system.workspace"), $this->_aPluginDetails);
|
||||
|
||||
$oServerConf = & ServerConf::getSingleton();
|
||||
$oServerConf->addPlugin( config("system.workspace"), $this->_aPluginDetails );
|
||||
foreach ($this->_aPluginDetails as $namespace => $detail) {
|
||||
if (isset($detail->enabled) && $detail->enabled) {
|
||||
if (!empty($detail->sFilename) && file_exists($detail->sFilename)) {
|
||||
@@ -1210,7 +1169,7 @@ class PMPluginRegistry
|
||||
//Found a License
|
||||
if (class_exists('pmLicenseManager')) {
|
||||
$sSerializedFile = PATH_DATA_SITE . 'lmn.singleton';
|
||||
$pmLicenseManagerO = &PmLicenseManager::getSingleton();
|
||||
$pmLicenseManagerO = PmLicenseManager::getSingleton();
|
||||
if (file_exists($sSerializedFile)) {
|
||||
$pmLicenseManagerO->unSerializeInstance(file_get_contents($sSerializedFile));
|
||||
}
|
||||
@@ -1504,7 +1463,7 @@ class PMPluginRegistry
|
||||
* @param string $sNamespace
|
||||
* @param bool $enable
|
||||
*/
|
||||
function enableRestService($sNamespace, $enable)
|
||||
public function enableRestService($sNamespace, $enable)
|
||||
{
|
||||
$this->_restServiceEnabled[$sNamespace] = $enable;
|
||||
}
|
||||
@@ -1541,7 +1500,7 @@ class PMPluginRegistry
|
||||
//Update plugin attributes
|
||||
require_once(PATH_PLUGINS . $pluginFileName);
|
||||
|
||||
$pmPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
$pmPluginRegistry = PMPluginRegistry::getSingleton();
|
||||
|
||||
$pluginDetails = $pmPluginRegistry->getPluginDetails($pluginFileName);
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class PmDynaform
|
||||
$this->context = \Bootstrap::getDefaultContextLog();
|
||||
$this->dataSources = array("database", "dataVariable");
|
||||
$this->pathRTLCss = '/lib/pmdynaform/build/css/PMDynaform-rtl.css';
|
||||
$this->serverConf = &ServerConf::getSingleton();
|
||||
$this->serverConf = ServerConf::getSingleton();
|
||||
$this->isRTL = ($this->serverConf->isRtl(SYS_LANG)) ? 'true' : 'false';
|
||||
$this->fields = $fields;
|
||||
$this->propertiesToExclude = array('dataVariable');
|
||||
@@ -546,7 +546,7 @@ class PmDynaform
|
||||
$json->data->label = $io->label;
|
||||
}
|
||||
}
|
||||
$_SESSION["TRIGGER_DEBUG"]["DATA"][] = Array("key" => $json->name . "_label", "value" => $json->data->label);
|
||||
$_SESSION["TRIGGER_DEBUG"]["DATA"][] = array("key" => $json->name . "_label", "value" => $json->data->label);
|
||||
}
|
||||
}
|
||||
if ($key === "type" && ($value === "checkgroup")) {
|
||||
@@ -554,8 +554,9 @@ class PmDynaform
|
||||
$dataValue = array();
|
||||
$dataLabel = array();
|
||||
$dv = array();
|
||||
if (isset($this->fields["APP_DATA"][$json->name]))
|
||||
if (isset($this->fields["APP_DATA"][$json->name])) {
|
||||
$dv = $this->fields["APP_DATA"][$json->name];
|
||||
}
|
||||
if (!is_array($dv)) {
|
||||
$dv = explode(",", $dv);
|
||||
}
|
||||
@@ -575,13 +576,13 @@ class PmDynaform
|
||||
}
|
||||
$json->data->value = $dataValue;
|
||||
$json->data->label = G::json_encode($dataLabel);
|
||||
$_SESSION["TRIGGER_DEBUG"]["DATA"][] = Array("key" => $json->name . "_label", "value" => $json->data->label);
|
||||
$_SESSION["TRIGGER_DEBUG"]["DATA"][] = array("key" => $json->name . "_label", "value" => $json->data->label);
|
||||
}
|
||||
}
|
||||
if ($key === "type" && ($value === "datetime")) {
|
||||
if (isset($this->fields["APP_DATA"]["__VAR_CHANGED__"]) && in_array($json->name, explode(",", $this->fields["APP_DATA"]["__VAR_CHANGED__"]))) {
|
||||
$json->data->label = $json->data->value;
|
||||
$_SESSION["TRIGGER_DEBUG"]["DATA"][] = Array("key" => $json->name . "_label", "value" => $json->data->label);
|
||||
$_SESSION["TRIGGER_DEBUG"]["DATA"][] = array("key" => $json->name . "_label", "value" => $json->data->label);
|
||||
}
|
||||
}
|
||||
//clear optionsSql
|
||||
@@ -711,7 +712,8 @@ class PmDynaform
|
||||
if ($value[0] === $json->variable) {
|
||||
continue;
|
||||
}
|
||||
$jsonSearch = $this->jsonsf(G::json_decode($this->record["DYN_CONTENT"]), $value[0], $json->variable === "" ? "id" : "variable");
|
||||
$jsonDecode = G::json_decode($this->record["DYN_CONTENT"]);
|
||||
$jsonSearch = $this->jsonsf($jsonDecode, $value[0], $json->variable === "" ? "id" : "variable");
|
||||
$a = $this->getValuesDependentFields($jsonSearch);
|
||||
foreach ($a as $i => $v) {
|
||||
$data[$i] = $v;
|
||||
@@ -1132,12 +1134,15 @@ class PmDynaform
|
||||
$msg = "";
|
||||
if (isset($_SESSION['G_MESSAGE_TYPE']) && isset($_SESSION['G_MESSAGE'])) {
|
||||
$color = "green";
|
||||
if ($_SESSION['G_MESSAGE_TYPE'] === "ERROR")
|
||||
if ($_SESSION['G_MESSAGE_TYPE'] === "ERROR") {
|
||||
$color = "red";
|
||||
if ($_SESSION['G_MESSAGE_TYPE'] === "WARNING")
|
||||
}
|
||||
if ($_SESSION['G_MESSAGE_TYPE'] === "WARNING") {
|
||||
$color = "#C3C380";
|
||||
if ($_SESSION['G_MESSAGE_TYPE'] === "INFO")
|
||||
}
|
||||
if ($_SESSION['G_MESSAGE_TYPE'] === "INFO") {
|
||||
$color = "green";
|
||||
}
|
||||
$msg = "<div style='background-color:" . $color . ";color: white;padding: 1px 2px 1px 5px;' class='userGroupTitle'>" . $_SESSION['G_MESSAGE_TYPE'] . ": " . $_SESSION['G_MESSAGE'] . "</div>";
|
||||
unset($_SESSION['G_MESSAGE_TYPE']);
|
||||
unset($_SESSION['G_MESSAGE']);
|
||||
@@ -1171,7 +1176,7 @@ class PmDynaform
|
||||
"</script>\n" .
|
||||
"<script type='text/javascript' src='/jscore/cases/core/cases_Step.js'></script>\n" .
|
||||
"<script type='text/javascript' src='/jscore/cases/core/pmDynaform.js'></script>\n" .
|
||||
($this->fields["PRO_SHOW_MESSAGE"] === 1 ? '' : $title ) .
|
||||
($this->fields["PRO_SHOW_MESSAGE"] === 1 ? '' : $title) .
|
||||
"<div style='width:100%;padding:0px 10px 0px 10px;margin:15px 0px 0px 0px;'>\n" .
|
||||
" <img src='/images/bulletButtonLeft.gif' style='float:left;'> \n" .
|
||||
" <a id='dyn_backward' href='" . $this->fields["APP_DATA"]["__DYNAFORM_OPTIONS"]["PREVIOUS_STEP"] . "' style='float:left;font-size:12px;line-height:1;margin:0px 0px 1px 5px;'>\n" .
|
||||
@@ -1456,16 +1461,21 @@ class PmDynaform
|
||||
if (!$sw1 && !$sw2) {
|
||||
if ($key === "variable" && $json->variable === $oldVariable["VAR_NAME"]) {
|
||||
$json->variable = $newVariable["VAR_NAME"];
|
||||
if (isset($json->dataType))
|
||||
if (isset($json->dataType)) {
|
||||
$json->dataType = $newVariable["VAR_FIELD_TYPE"];
|
||||
if (isset($json->name))
|
||||
}
|
||||
if (isset($json->name)) {
|
||||
$json->name = $newVariable["VAR_NAME"];
|
||||
if (isset($json->dbConnection) && $json->dbConnection === $oldVariable["VAR_DBCONNECTION"])
|
||||
}
|
||||
if (isset($json->dbConnection) && $json->dbConnection === $oldVariable["VAR_DBCONNECTION"]) {
|
||||
$json->dbConnection = $newVariable["VAR_DBCONNECTION"];
|
||||
if (isset($json->dbConnectionLabel) && $json->dbConnectionLabel === $oldVariable["VAR_DBCONNECTION_LABEL"])
|
||||
}
|
||||
if (isset($json->dbConnectionLabel) && $json->dbConnectionLabel === $oldVariable["VAR_DBCONNECTION_LABEL"]) {
|
||||
$json->dbConnectionLabel = $newVariable["VAR_DBCONNECTION_LABEL"];
|
||||
if (isset($json->sql) && $json->sql === $oldVariable["VAR_SQL"])
|
||||
}
|
||||
if (isset($json->sql) && $json->sql === $oldVariable["VAR_SQL"]) {
|
||||
$json->sql = $newVariable["VAR_SQL"];
|
||||
}
|
||||
if (isset($json->options) && G::json_encode($json->options) === $oldVariable["VAR_ACCEPTED_VALUES"]) {
|
||||
$json->options = G::json_decode($newVariable["VAR_ACCEPTED_VALUES"]);
|
||||
}
|
||||
@@ -1656,8 +1666,9 @@ class PmDynaform
|
||||
$sw2 = is_object($value);
|
||||
if ($sw1 || $sw2) {
|
||||
$val = $this->jsonsf($value, $id, $for);
|
||||
if ($val !== null)
|
||||
if ($val !== null) {
|
||||
return $val;
|
||||
}
|
||||
}
|
||||
if (!$sw1 && !$sw2) {
|
||||
if ($key === $for && $id === $value) {
|
||||
@@ -1792,7 +1803,7 @@ class PmDynaform
|
||||
if ($oPro->getDynLabel() !== null && $oPro->getDynLabel() !== "") {
|
||||
$dyn_labels = G::json_decode($oPro->getDynLabel());
|
||||
}
|
||||
$dyn_labels->$name[count($name) - 2] = $content;
|
||||
$dyn_labels->{$name[count($name) - 2]} = $content;
|
||||
|
||||
$oPro->setDynLabel(G::json_encode($dyn_labels));
|
||||
$oPro->save();
|
||||
@@ -1897,7 +1908,7 @@ class PmDynaform
|
||||
{
|
||||
$result = array();
|
||||
$previusFunction = $this->onPropertyRead;
|
||||
$this->onPropertyRead = function($json, $key, $value) use (&$post) {
|
||||
$this->onPropertyRead = function ($json, $key, $value) use (&$post) {
|
||||
if ($key === "type" && isset($json->variable) && !empty($json->variable)) {
|
||||
//clears the data in the appData for grids
|
||||
$isThereIdIntoPost = array_key_exists($json->id, $post);
|
||||
@@ -2047,7 +2058,8 @@ class PmDynaform
|
||||
break;
|
||||
case 'form':
|
||||
$arrayGrid = array_merge(
|
||||
$arrayGrid, self::getGridsAndFields($field, $flagGridAssocToVar)
|
||||
$arrayGrid,
|
||||
self::getGridsAndFields($field, $flagGridAssocToVar)
|
||||
);
|
||||
break;
|
||||
}
|
||||
@@ -2143,7 +2155,8 @@ class PmDynaform
|
||||
$value === "suggest" ||
|
||||
$value === "hidden" ||
|
||||
$value === "file" ||
|
||||
$value === "grid")) {
|
||||
$value === "grid"
|
||||
)) {
|
||||
if ($value === "grid" && $property === "data") {
|
||||
$json->{$property} = [];
|
||||
} else {
|
||||
|
||||
@@ -29,7 +29,7 @@ class PmGoogleApi
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$licensedFeatures = &PMLicensedFeatures::getSingleton();
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
if (!($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09') || $licensedFeatures->verifyfeature('AhKNjBEVXZlWUFpWE8wVTREQ0FObmo0aTdhVzhvalFic1M='))) {
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
@@ -64,7 +64,7 @@ class PmGoogleApi
|
||||
$this->configuration->loadConfig($gmail, 'GOOGLE_API_SETTINGS', '');
|
||||
}
|
||||
|
||||
public function setConfigGmail ($id, $value)
|
||||
public function setConfigGmail($id, $value)
|
||||
{
|
||||
$this->configuration->aConfig[$id] = $value;
|
||||
$this->configuration->saveConfig('GOOGLE_API_SETTINGS', '', '', '');
|
||||
@@ -81,7 +81,7 @@ class PmGoogleApi
|
||||
return $this->serviceAccountEmail;
|
||||
}
|
||||
|
||||
public function setServiceAccountCertificate ($serviceAccountCertificate)
|
||||
public function setServiceAccountCertificate($serviceAccountCertificate)
|
||||
{
|
||||
$this->setConfigGmail('serviceAccountCertificate', $serviceAccountCertificate);
|
||||
$this->serviceAccountCertificate = $serviceAccountCertificate;
|
||||
@@ -94,7 +94,7 @@ class PmGoogleApi
|
||||
|
||||
public function setServiceGmailStatus($status)
|
||||
{
|
||||
$licensedFeatures = &PMLicensedFeatures::getSingleton();
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
if (!$licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
|
||||
$status = false;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ class PmGoogleApi
|
||||
|
||||
public function setServiceDriveStatus($status)
|
||||
{
|
||||
$licensedFeatures = &PMLicensedFeatures::getSingleton();
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
if (!$licensedFeatures->verifyfeature('AhKNjBEVXZlWUFpWE8wVTREQ0FObmo0aTdhVzhvalFic1M=')) {
|
||||
$status = false;
|
||||
}
|
||||
@@ -183,7 +183,6 @@ class PmGoogleApi
|
||||
*/
|
||||
public function testService($credentials)
|
||||
{
|
||||
|
||||
$scope = array(
|
||||
static::DRIVE,
|
||||
static::DRIVE_FILE,
|
||||
|
||||
@@ -15,7 +15,7 @@ class PmLicenseManager
|
||||
|
||||
public function __construct($flagActivatePlugins = true)
|
||||
{
|
||||
$oServerConf = &ServerConf::getSingleton();
|
||||
$oServerConf = ServerConf::getSingleton();
|
||||
|
||||
if ($oServerConf->getProperty('LOGIN_NO_WS') === null || $oServerConf->getProperty('LOGIN_NO_WS') === false) {
|
||||
$oServerConf->setProperty('LOGIN_NO_WS', true);
|
||||
@@ -65,7 +65,7 @@ class PmLicenseManager
|
||||
$this->licensedfeaturesList = isset($results ['DATA']['LICENSED_FEATURES_LIST']) ? $results ['DATA']['LICENSED_FEATURES_LIST'] : null;
|
||||
$this->status = $this->getCurrentLicenseStatus();
|
||||
|
||||
if (isset ($results ['LIC'])) {
|
||||
if (isset($results ['LIC'])) {
|
||||
$resultsRegister = $results['LIC'];
|
||||
$this->server = $results['LIC']['SRV'];
|
||||
$this->file = $results['LIC']['FILE'];
|
||||
@@ -183,8 +183,10 @@ class PmLicenseManager
|
||||
}
|
||||
if (!(empty($aDenied))) {
|
||||
if ((SYS_COLLECTION == "enterprise") && (SYS_TARGET == "pluginsList")) {
|
||||
G::SendMessageText("The following plugins were restricted due to your enterprise license: " . implode(", ",
|
||||
$aDenied), "INFO");
|
||||
G::SendMessageText("The following plugins were restricted due to your enterprise license: " . implode(
|
||||
", ",
|
||||
$aDenied
|
||||
), "INFO");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -353,7 +355,7 @@ class PmLicenseManager
|
||||
|
||||
public function validateLicense($path)
|
||||
{
|
||||
$application = new license_application ($path, false, true, false, true, true);
|
||||
$application = new license_application($path, false, true, false, true, true);
|
||||
$results = $application->validate(false, false, "", "", "80", true);
|
||||
|
||||
if ($results ['RESULT'] != 'OK') {
|
||||
@@ -365,7 +367,7 @@ class PmLicenseManager
|
||||
|
||||
public function installLicense($path, $redirect = true, $includeExpired = true)
|
||||
{
|
||||
$application = new license_application ($path, false, true, false, true, true);
|
||||
$application = new license_application($path, false, true, false, true, true);
|
||||
|
||||
$results = $application->validate(false, false, "", "", "80", true);
|
||||
|
||||
@@ -383,8 +385,7 @@ class PmLicenseManager
|
||||
G::SendTemporalMessage('ID_ISNT_LICENSE', 'tmp-info', 'labels');
|
||||
return false;
|
||||
} else {
|
||||
|
||||
$oServerConf = &ServerConf::getSingleton();
|
||||
$oServerConf = ServerConf::getSingleton();
|
||||
$oServerConf->setProperty('ACTIVE_LICENSE', [config("system.workspace") => $path]);
|
||||
$this->saveDataLicense($results, $path, $redirect);
|
||||
if ($redirect) {
|
||||
@@ -424,16 +425,16 @@ class PmLicenseManager
|
||||
{
|
||||
require_once("classes/model/LicenseManager.php");
|
||||
//obtening info in a row that has ACTIVE status
|
||||
$oCtia = new Criteria ('workflow');
|
||||
$oCtia = new Criteria('workflow');
|
||||
$oCtia->add(LicenseManagerPeer::LICENSE_STATUS, 'ACTIVE');
|
||||
$oDataset = LicenseManagerPeer::doSelectRS($oCtia);
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
|
||||
$oCtiaA = new Criteria ('workflow');
|
||||
$oCtiaA = new Criteria('workflow');
|
||||
$oCtiaA->add(LicenseManagerPeer::LICENSE_UID, $aRow [0]);
|
||||
|
||||
$oCtiaB = new Criteria ('workflow');
|
||||
$oCtiaB = new Criteria('workflow');
|
||||
$oCtiaB->add(LicenseManagerPeer::LICENSE_STATUS, 'INACTIVE');
|
||||
BasePeer::doUpdate($oCtiaA, $oCtiaB, Propel::getConnection('workflow'));
|
||||
return 'ACTIVE';
|
||||
@@ -468,7 +469,7 @@ class PmLicenseManager
|
||||
//if exists the row in the database propel will update it, otherwise will insert.
|
||||
$tr = LicenseManagerPeer::retrieveByPK($LicenseUid);
|
||||
if (!(is_object($tr) && get_class($tr) == 'LicenseManager')) {
|
||||
$tr = new LicenseManager ();
|
||||
$tr = new LicenseManager();
|
||||
}
|
||||
$tr->setLicenseUid($LicenseUid);
|
||||
$tr->setLicenseUser($LicenseUser);
|
||||
@@ -492,7 +493,7 @@ class PmLicenseManager
|
||||
{
|
||||
try {
|
||||
require_once("classes/model/LicenseManager.php");
|
||||
$oCriteria = new Criteria ('workflow');
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(LicenseManagerPeer::LICENSE_USER);
|
||||
$oCriteria->addSelectColumn(LicenseManagerPeer::LICENSE_START);
|
||||
$oCriteria->addSelectColumn(LicenseManagerPeer::LICENSE_PATH);
|
||||
|
||||
@@ -452,7 +452,8 @@ class PmTable
|
||||
$previous = null;
|
||||
$queryStack = array();
|
||||
$aDNS = $con->getDSN();
|
||||
$dbEngine = $aDNS["phptype"];
|
||||
$dbEngine = $aDNS['phptype'] === 'mysqli' ? 'mysql' : $aDNS['phptype'];
|
||||
|
||||
|
||||
foreach ($lines as $j => $line) {
|
||||
switch ($dbEngine) {
|
||||
|
||||
@@ -433,7 +433,6 @@ class ProcessMap
|
||||
$oProcess = new Process();
|
||||
|
||||
if (!is_null($oProcess)) {
|
||||
|
||||
$calendar = new Calendar();
|
||||
$files = Processes::getProcessFiles($sProcessUID, 'mail');
|
||||
|
||||
@@ -820,7 +819,7 @@ class ProcessMap
|
||||
}
|
||||
|
||||
global $_DBArray;
|
||||
$_DBArray = (isset($_SESSION['_DBArray']) ? $_SESSION['_DBArray'] : '');
|
||||
$_DBArray = isset($_SESSION['_DBArray']) ? $_SESSION['_DBArray'] : [];
|
||||
$_DBArray['steps'] = $aSteps;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
@@ -910,7 +909,6 @@ class ProcessMap
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
|
||||
if (($aRow['INP_DOC_TITLE'] == null) || ($aRow['INP_DOC_TITLE'] == "")) {
|
||||
// There is no transaltion for this Document name, try to get/regenerate the label
|
||||
$oInputDocument = new InputDocument;
|
||||
@@ -1191,7 +1189,8 @@ class ProcessMap
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$oCriteria->add(
|
||||
$oCriteria->getNewCriterion(UsersPeer::USR_STATUS, "ACTIVE", Criteria::EQUAL)->addOr(
|
||||
$oCriteria->getNewCriterion(UsersPeer::USR_STATUS, "VACATION", Criteria::EQUAL))
|
||||
$oCriteria->getNewCriterion(UsersPeer::USR_STATUS, "VACATION", Criteria::EQUAL)
|
||||
)
|
||||
);
|
||||
$oCriteria->add(UsersPeer::USR_UID, $aUIDS2, Criteria::NOT_IN);
|
||||
$oDataset = UsersPeer::doSelectRS($oCriteria);
|
||||
@@ -1398,7 +1397,6 @@ class ProcessMap
|
||||
* Task Notifications *
|
||||
*/
|
||||
if ($iForm == 7 || $iForm == 1) {
|
||||
|
||||
$files = Processes::getProcessFiles($aFields['PRO_UID'], 'mail');
|
||||
|
||||
$templates = array();
|
||||
@@ -1453,7 +1451,7 @@ class ProcessMap
|
||||
if ($iForm == 8) {
|
||||
$oCaseConsolidated = CaseConsolidatedCorePeer::retrieveByPK($_SESSION["cDhTajE2T2lxSkhqMzZUTXVacWYyNcKwV3A4eWYybDdyb1p3"]["TAS_UID"]);
|
||||
if ((is_object($oCaseConsolidated)) && get_class($oCaseConsolidated) == "CaseConsolidatedCore") {
|
||||
require_once ("classes/model/ReportTable.php");
|
||||
require_once("classes/model/ReportTable.php");
|
||||
|
||||
$aFields["CON_STATUS"] = $oCaseConsolidated->getConStatus();
|
||||
$aFields["DYN_UID"] = $oCaseConsolidated->getDynUid();
|
||||
@@ -2005,7 +2003,7 @@ class ProcessMap
|
||||
$oDataset = InputDocumentPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$inputDocArray = "";
|
||||
$inputDocArray = [];
|
||||
$inputDocArray[] = array('INP_DOC_UID' => 'char', 'PRO_UID' => 'char', 'INP_DOC_TITLE' => 'char', 'INP_DOC_DESCRIPTION' => 'char' );
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
if (($aRow['INP_DOC_TITLE'] == null) || ($aRow['INP_DOC_TITLE'] == "")) {
|
||||
@@ -2073,12 +2071,11 @@ class ProcessMap
|
||||
$oDataset = TriggersPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$triggersArray = "";
|
||||
$triggersArray = [];
|
||||
$triggersArray[] = array('TRI_UID' => 'char', 'PRO_UID' => 'char', 'TRI_TITLE' => 'char', 'TRI_DESCRIPTION' => 'char');
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
|
||||
if (($aRow['TRI_TITLE'] == null) || ($aRow['TRI_TITLE'] == "")) {
|
||||
// There is no transaltion for this Trigger name, try to get/regenerate the label
|
||||
// There is no translation for this Trigger name, try to get/regenerate the label
|
||||
$triggerO = new Triggers();
|
||||
$triggerObj = $triggerO->load($aRow['TRI_UID']);
|
||||
$aRow['TRI_TITLE'] = $triggerObj['TRI_TITLE'];
|
||||
@@ -2099,7 +2096,7 @@ class ProcessMap
|
||||
|
||||
public function getTriggers($sProcessUID = '')
|
||||
{
|
||||
$aTriggers = Array();
|
||||
$aTriggers = array();
|
||||
$oCriteria = $this->getTriggersCriteria($sProcessUID);
|
||||
|
||||
$oDataset = RoutePeer::doSelectRS($oCriteria);
|
||||
@@ -2144,9 +2141,9 @@ class ProcessMap
|
||||
$oLogCaseScheduler = new LogCasesScheduler();
|
||||
$aRows = $oLogCaseScheduler->getAll();
|
||||
|
||||
$fieldNames = Array('PRO_UID' => 'char', 'TAS_UID' => 'char', 'USR_NAME' => 'char', 'EXEC_DATE' => 'char', 'EXEC_HOUR' => 'char', 'RESULT' => 'char', 'SCH_UID' => 'char', 'WS_CREATE_CASE_STATUS' => 'char', 'WS_ROUTE_CASE_STATUS' => 'char' );
|
||||
$fieldNames = array('PRO_UID' => 'char', 'TAS_UID' => 'char', 'USR_NAME' => 'char', 'EXEC_DATE' => 'char', 'EXEC_HOUR' => 'char', 'RESULT' => 'char', 'SCH_UID' => 'char', 'WS_CREATE_CASE_STATUS' => 'char', 'WS_ROUTE_CASE_STATUS' => 'char' );
|
||||
|
||||
$aRows = array_merge(Array($fieldNames), $aRows);
|
||||
$aRows = array_merge(array($fieldNames), $aRows);
|
||||
|
||||
$_DBArray['log_cases_scheduler'] = $aRows;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
@@ -2339,7 +2336,6 @@ class ProcessMap
|
||||
throw new Exception(G::loadTranslation('ID_INVALID_ROU_TYPE_DEFINITION_ON_ROUTE_TABLE'));
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
throw new Exception(G::loadTranslation('ID_NO_DERIVATIONS_DEFINED'));
|
||||
}
|
||||
@@ -2455,7 +2451,6 @@ class ProcessMap
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
switch ($sType) {
|
||||
@@ -3114,8 +3109,7 @@ class ProcessMap
|
||||
*/
|
||||
public function listNoProcessesUser($sProcessUID)
|
||||
{
|
||||
|
||||
$memcache = & PMmemcached::getSingleton(config("system.workspace"));
|
||||
$memcache = PMmemcached::getSingleton(config("system.workspace"));
|
||||
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(ProcessUserPeer::USR_UID);
|
||||
@@ -3228,7 +3222,7 @@ class ProcessMap
|
||||
*/
|
||||
public function assignProcessUser($sProcessUID, $sUsrUID, $sTypeUID)
|
||||
{
|
||||
$oProcessUser = new ProcessUser ( );
|
||||
$oProcessUser = new ProcessUser();
|
||||
$puType = 'SUPERVISOR';
|
||||
if ($sTypeUID == 'Group') {
|
||||
$puType = 'GROUP_SUPERVISOR';
|
||||
@@ -3256,7 +3250,6 @@ class ProcessMap
|
||||
*/
|
||||
public function getObjectsPermissionsCriteria($sProcessUID)
|
||||
{
|
||||
|
||||
$aObjectsPermissions = array();
|
||||
$aObjectsPermissions[] = array('OP_UID' => 'char', 'TASK_TARGET' => 'char', 'GROUP_USER' => 'char', 'TASK_SOURCE' => 'char', 'OBJECT_TYPE' => 'char', 'OBJECT' => 'char', 'PARTICIPATED' => 'char', 'ACTION' => 'char', 'OP_CASE_STATUS' => 'char');
|
||||
$oCriteria = new Criteria('workflow');
|
||||
@@ -3434,7 +3427,6 @@ class ProcessMap
|
||||
|
||||
public function getExtObjectsPermissions($start, $limit, $sProcessUID)
|
||||
{
|
||||
|
||||
$aObjectsPermissions = array();
|
||||
//$aObjectsPermissions [] = array('OP_UID' => 'char', 'TASK_TARGET' => 'char', 'GROUP_USER' => 'char', 'TASK_SOURCE' => 'char', 'OBJECT_TYPE' => 'char', 'OBJECT' => 'char', 'PARTICIPATED' => 'char', 'ACTION' => 'char', 'OP_CASE_STATUS' => 'char');
|
||||
$oCriteria = new Criteria('workflow');
|
||||
@@ -3663,13 +3655,19 @@ class ProcessMap
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_NewObjectPermission', '',
|
||||
$G_PUBLISH->AddContent(
|
||||
'xmlform',
|
||||
'xmlform',
|
||||
'processes/processes_NewObjectPermission',
|
||||
'',
|
||||
array('GROUP_USER' => $usersGroups,
|
||||
'LANG' => SYS_LANG,
|
||||
'PRO_UID' => $sProcessUID,
|
||||
'ID_DELETE' => G::LoadTranslation('ID_DELETE'),
|
||||
'ID_RESEND' => G::LoadTranslation('ID_RESEND')
|
||||
), 'processes_SaveObjectPermission');
|
||||
),
|
||||
'processes_SaveObjectPermission'
|
||||
);
|
||||
G::RenderPage('publish', 'raw');
|
||||
return true;
|
||||
}
|
||||
@@ -3683,7 +3681,6 @@ class ProcessMap
|
||||
*/
|
||||
public function editObjectPermission($sOP_UID, $sProcessUID)
|
||||
{
|
||||
|
||||
$user = '';
|
||||
$oCriteria = new Criteria();
|
||||
$oCriteria->add(ObjectPermissionPeer::OP_UID, $sOP_UID);
|
||||
@@ -4111,7 +4108,6 @@ class ProcessMap
|
||||
*/
|
||||
public function processFilesManager($sProcessUID)
|
||||
{
|
||||
|
||||
global $_DBArray;
|
||||
global $G_PUBLISH;
|
||||
|
||||
@@ -4462,7 +4458,7 @@ class ProcessMap
|
||||
try {
|
||||
global $G_PUBLISH;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile('/jscore/events/events.js');
|
||||
|
||||
switch ($type) {
|
||||
@@ -4579,7 +4575,7 @@ class ProcessMap
|
||||
public function loadProcessCategory()
|
||||
{
|
||||
$aProcessCategory = '';
|
||||
require_once ("classes/model/ProcessCategory.php");
|
||||
require_once("classes/model/ProcessCategory.php");
|
||||
$Criteria = new Criteria('workflow');
|
||||
$Criteria->clearSelectColumns();
|
||||
|
||||
@@ -4679,7 +4675,6 @@ class ProcessMap
|
||||
*/
|
||||
public function getAllProcesses()
|
||||
{
|
||||
|
||||
$aProcesses = array();
|
||||
//$aProcesses [] = array ('PRO_UID' => 'char', 'PRO_TITLE' => 'char');
|
||||
$oCriteria = new Criteria('workflow');
|
||||
@@ -5773,7 +5768,6 @@ class ProcessMap
|
||||
*/
|
||||
public function listExtProcessesSupervisors($start, $limit, $sProcessUID)
|
||||
{
|
||||
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(ProcessUserPeer::PU_UID);
|
||||
$oCriteria->addSelectColumn(ProcessUserPeer::USR_UID);
|
||||
@@ -5811,8 +5805,7 @@ class ProcessMap
|
||||
*/
|
||||
public function listExtNoProcessesUser($sProcessUID)
|
||||
{
|
||||
|
||||
$memcache = & PMmemcached::getSingleton(config("system.workspace"));
|
||||
$memcache = PMmemcached::getSingleton(config("system.workspace"));
|
||||
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(ProcessUserPeer::USR_UID);
|
||||
@@ -6819,7 +6812,6 @@ class ProcessMap
|
||||
$triggersArray = "";
|
||||
$triggersArray[] = array('TRI_UID' => 'char', 'PRO_UID' => 'char', 'TRI_TITLE' => 'char', 'TRI_DESCRIPTION' => 'char' );
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
|
||||
if (($aRow['TRI_TITLE'] == null) || ($aRow['TRI_TITLE'] == "")) {
|
||||
// There is no translation for this Trigger name, try to get/regenerate the label
|
||||
$triggerO = new Triggers();
|
||||
@@ -6867,4 +6859,3 @@ class ProcessMap
|
||||
return (int) $row['MAX_X'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,11 +5,26 @@
|
||||
*/
|
||||
class ReportTables
|
||||
{
|
||||
private $aDef = array('mysql' => array('number' => 'DOUBLE', 'char' => 'VARCHAR(255)', 'text' => 'TEXT', 'date' => 'DATETIME'
|
||||
), 'pgsql' => array('number' => 'DOUBLE', 'char' => 'VARCHAR(255)', 'text' => 'TEXT', 'date' => 'DATETIME'
|
||||
), 'mssql' => array('number' => 'FLOAT', 'char' => 'NVARCHAR(255)', 'text' => 'TEXT', 'date' => 'CHAR(19)'
|
||||
) /* Changed DATETIME CHAR(19) for compatibility issues. */);
|
||||
//private $sPrefix = 'REP_';
|
||||
private $aDef = array(
|
||||
'mysql' => array(
|
||||
'number' => 'DOUBLE',
|
||||
'char' => 'VARCHAR(255)',
|
||||
'text' => 'TEXT',
|
||||
'date' => 'DATETIME'
|
||||
),
|
||||
'pgsql' => array(
|
||||
'number' => 'DOUBLE',
|
||||
'char' => 'VARCHAR(255)',
|
||||
'text' => 'TEXT',
|
||||
'date' => 'DATETIME'
|
||||
),
|
||||
'mssql' => array(
|
||||
'number' => 'FLOAT',
|
||||
'char' => 'NVARCHAR(255)',
|
||||
'text' => 'TEXT',
|
||||
'date' => 'CHAR(19)'
|
||||
) /* Changed DATETIME CHAR(19) for compatibility issues. */
|
||||
);
|
||||
private $sPrefix = '';
|
||||
|
||||
/**
|
||||
@@ -17,7 +32,9 @@ class ReportTables
|
||||
* This function delete all reports
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $$sRepTabUid
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function deleteAllReportVars($sRepTabUid = '')
|
||||
@@ -36,8 +53,10 @@ class ReportTables
|
||||
* This function removes the table
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $sTableName Table name
|
||||
* @param string $sConnection Conexion
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function dropTable($sTableName, $sConnection = 'report')
|
||||
@@ -54,7 +73,7 @@ class ReportTables
|
||||
break;
|
||||
case 'mssql':
|
||||
$rs = $stmt->executeQuery("IF OBJECT_ID (N'" . $sTableName . "', N'U') IS NOT NULL
|
||||
DROP TABLE [" . $sTableName . "]");
|
||||
DROP TABLE [" . $sTableName . "]");
|
||||
break;
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
@@ -67,14 +86,22 @@ class ReportTables
|
||||
* This Function creates the table
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $sTableName Table name
|
||||
* @param string $sConnection Connection name
|
||||
* @param string $sType
|
||||
* @param array $aFields
|
||||
* @param string $bDefaultFields
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function createTable($sTableName, $sConnection = 'report', $sType = 'NORMAL', $aFields = array(), $bDefaultFields = true)
|
||||
public function createTable(
|
||||
$sTableName,
|
||||
$sConnection = 'report',
|
||||
$sType = 'NORMAL',
|
||||
$aFields = array(),
|
||||
$bDefaultFields = true
|
||||
)
|
||||
{
|
||||
$sTableName = $this->sPrefix . $sTableName;
|
||||
//we have to do the propel connection
|
||||
@@ -108,7 +135,7 @@ class ReportTables
|
||||
}
|
||||
}
|
||||
if ($bDefaultFields) {
|
||||
$sQuery .= 'PRIMARY KEY (APP_UID' . ($sType == 'GRID' ? ',ROW' : '') . ')) ';
|
||||
$sQuery .= 'PRIMARY KEY (APP_UID' . ($sType === 'GRID' ? ',ROW' : '') . ')) ';
|
||||
}
|
||||
$sQuery .= ' DEFAULT CHARSET=utf8;';
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
@@ -157,15 +184,24 @@ class ReportTables
|
||||
* This Function fills the table
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $sTableName Table name
|
||||
* @param string $sConnection Connection name
|
||||
* @param string $sType
|
||||
* @param array $aFields
|
||||
* @param string $sProcessUid
|
||||
* @param string $sGrid
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function populateTable($sTableName, $sConnection = 'report', $sType = 'NORMAL', $aFields = array(), $sProcessUid = '', $sGrid = '')
|
||||
public function populateTable(
|
||||
$sTableName,
|
||||
$sConnection = 'report',
|
||||
$sType = 'NORMAL',
|
||||
$aFields = array(),
|
||||
$sProcessUid = '',
|
||||
$sGrid = ''
|
||||
)
|
||||
{
|
||||
$sTableName = $this->sPrefix . $sTableName;
|
||||
//we have to do the propel connection
|
||||
@@ -201,14 +237,21 @@ class ReportTables
|
||||
foreach ($aFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset($aData[$aField['sFieldName']]) ? (float)str_replace(',', '', $aData[$aField['sFieldName']]) : '0');
|
||||
$sQuery .= ',' . (isset($aData[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aData[$aField['sFieldName']]
|
||||
) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aData[$aField['sFieldName']])) {
|
||||
$aData[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset($aData[$aField['sFieldName']]) ? @mysql_real_escape_string($aData[$aField['sFieldName']]) : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aData[$aField['sFieldName']]) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aData[$aField['sFieldName']]
|
||||
) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$value = (isset($aData[$aField['sFieldName']]) && trim($aData[$aField['sFieldName']])) != '' ? "'" . $aData[$aField['sFieldName']] . "'" : 'NULL';
|
||||
@@ -230,14 +273,21 @@ class ReportTables
|
||||
foreach ($aFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset($aGridRow[$aField['sFieldName']]) ? (float)str_replace(',', '', $aGridRow[$aField['sFieldName']]) : '0');
|
||||
$sQuery .= ',' . (isset($aGridRow[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aGridRow[$aField['sFieldName']]
|
||||
) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aGridRow[$aField['sFieldName']])) {
|
||||
$aGridRow[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? mysql_real_escape_string($aGridRow[$aField['sFieldName']]) : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aGridRow[$aField['sFieldName']]
|
||||
) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$value = (isset($aGridRow[$aField['sFieldName']]) && trim($aGridRow[$aField['sFieldName']])) != '' ? "'" . $aGridRow[$aField['sFieldName']] . "'" : 'NULL';
|
||||
@@ -266,7 +316,11 @@ class ReportTables
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aData = unserialize($aRow['APP_DATA']);
|
||||
mysql_query('DELETE FROM [' . $sTableName . "] WHERE APP_UID = '" . $aRow['APP_UID'] . "'");
|
||||
//verify use mssql
|
||||
mysqli_query(
|
||||
$con->getResource(),
|
||||
'DELETE FROM [' . $sTableName . "] WHERE APP_UID = '" . $aRow['APP_UID'] . "'"
|
||||
);
|
||||
if ($sType == 'NORMAL') {
|
||||
$sQuery = 'INSERT INTO [' . $sTableName . '] (';
|
||||
$sQuery .= '[APP_UID],[APP_NUMBER]';
|
||||
@@ -277,14 +331,21 @@ class ReportTables
|
||||
foreach ($aFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset($aData[$aField['sFieldName']]) ? (float)str_replace(',', '', $aData[$aField['sFieldName']]) : '0');
|
||||
$sQuery .= ',' . (isset($aData[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aData[$aField['sFieldName']]
|
||||
) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aData[$aField['sFieldName']])) {
|
||||
$aData[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset($aData[$aField['sFieldName']]) ? mysql_real_escape_string($aData[$aField['sFieldName']]) : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aData[$aField['sFieldName']]) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aData[$aField['sFieldName']]
|
||||
) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$sQuery .= ",'" . (isset($aData[$aField['sFieldName']]) ? $aData[$aField['sFieldName']] : '') . "'";
|
||||
@@ -305,14 +366,21 @@ class ReportTables
|
||||
foreach ($aFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset($aGridRow[$aField['sFieldName']]) ? (float)str_replace(',', '', $aGridRow[$aField['sFieldName']]) : '0');
|
||||
$sQuery .= ',' . (isset($aGridRow[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aGridRow[$aField['sFieldName']]
|
||||
) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aGridRow[$aField['sFieldName']])) {
|
||||
$aGridRow[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? mysql_real_escape_string($aGridRow[$aField['sFieldName']]) : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aGridRow[$aField['sFieldName']]
|
||||
) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? $aGridRow[$aField['sFieldName']] : '') . "'";
|
||||
@@ -338,8 +406,10 @@ class ReportTables
|
||||
* Function getTableVars
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $sRepTabUid
|
||||
* @param boolean $bWhitType
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getTableVars($sRepTabUid, $bWhitType = false)
|
||||
@@ -356,7 +426,9 @@ class ReportTables
|
||||
if ($bWhitType) {
|
||||
if (!in_array($aRow['REP_VAR_NAME'], $aImportedVars)) {
|
||||
$aImportedVars[] = $aRow['REP_VAR_NAME'];
|
||||
$aVars[] = array('sFieldName' => $aRow['REP_VAR_NAME'], 'sType' => $aRow['REP_VAR_TYPE']
|
||||
$aVars[] = array(
|
||||
'sFieldName' => $aRow['REP_VAR_NAME'],
|
||||
'sType' => $aRow['REP_VAR_TYPE']
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@@ -375,7 +447,9 @@ class ReportTables
|
||||
* This Function deletes report table
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $sRepTabUid
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function deleteReportTable($sRepTabUid)
|
||||
@@ -400,8 +474,10 @@ class ReportTables
|
||||
* This function gets the split date
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param date $date
|
||||
* @param string $mask
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getSplitDate($date, $mask)
|
||||
@@ -465,7 +541,10 @@ class ReportTables
|
||||
break;
|
||||
}
|
||||
}
|
||||
return Array(isset($d1) ? $d1 : '', isset($d2) ? $d2 : '', isset($d3) ? $d3 : ''
|
||||
return array(
|
||||
isset($d1) ? $d1 : '',
|
||||
isset($d2) ? $d2 : '',
|
||||
isset($d3) ? $d3 : ''
|
||||
);
|
||||
}
|
||||
|
||||
@@ -474,13 +553,14 @@ class ReportTables
|
||||
* This function returns the date formated
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param date $sDate
|
||||
* @param date $sMask
|
||||
*
|
||||
* @return date
|
||||
*/
|
||||
public function getFormatDate($sDate, $sMask)
|
||||
{
|
||||
//print $sDate." *** ". $sMask."<BR>";
|
||||
$dateTime = explode(" ", $sDate); //To accept the Hour part
|
||||
$aDate = explode('-', str_replace("/", "-", $dateTime[0]));
|
||||
$bResult = true;
|
||||
@@ -512,10 +592,12 @@ class ReportTables
|
||||
* This function updated the Report Tables
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $sProcessUid
|
||||
* @param string $sApplicationUid
|
||||
* @param string $iApplicationNumber
|
||||
* @param string $aFields
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function updateTables($sProcessUid, $sApplicationUid, $iApplicationNumber, $aFields)
|
||||
@@ -545,6 +627,7 @@ class ReportTables
|
||||
$aRow['REP_TAB_NAME'] = $this->sPrefix . $aRow['REP_TAB_NAME'];
|
||||
$PropelDatabase = $this->chooseDB($aRow['REP_TAB_CONNECTION']);
|
||||
$con = Propel::getConnection($PropelDatabase);
|
||||
$con->getResource();
|
||||
$stmt = $con->createStatement();
|
||||
switch (DB_ADAPTER) {
|
||||
case 'mysql':
|
||||
@@ -570,7 +653,11 @@ class ReportTables
|
||||
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(',', '', $aFields[$aField['sFieldName']]) : '0') . ',';
|
||||
$sQuery .= (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '0') . ',';
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
@@ -583,7 +670,10 @@ class ReportTables
|
||||
if (is_array($aFields[$aField['sFieldName']])) {
|
||||
$sQuery .= "'" . (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']][0] : '') . "',";
|
||||
} else {
|
||||
$sQuery .= '\'' . ((isset($aFields[$aField['sFieldName']])) ? @mysql_real_escape_string($aFields[$aField['sFieldName']]) : '') . '\',';
|
||||
$sQuery .= '\'' . ((isset($aFields[$aField['sFieldName']])) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '') . '\',';
|
||||
}
|
||||
break;
|
||||
case 'date':
|
||||
@@ -605,9 +695,15 @@ class ReportTables
|
||||
try {
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog('sqlExecution', 400, 'Sql Execution', ['sql' => $sQuery,'error' => $e->getMessage()], config("system.workspace"), 'processmaker.log');
|
||||
Bootstrap::registerMonolog(
|
||||
'sqlExecution',
|
||||
400,
|
||||
'Sql Execution',
|
||||
['sql' => $sQuery, 'error' => $e->getMessage()],
|
||||
config("system.workspace"),
|
||||
'processmaker.log'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
$sQuery = 'INSERT INTO `' . $aRow['REP_TAB_NAME'] . '` (';
|
||||
@@ -619,14 +715,21 @@ class ReportTables
|
||||
foreach ($aTableFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(',', '', $aFields[$aField['sFieldName']]) : '0');
|
||||
$sQuery .= ',' . (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aFields[$aField['sFieldName']])) {
|
||||
$aFields[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset($aFields[$aField['sFieldName']]) ? mysql_real_escape_string($aFields[$aField['sFieldName']]) : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aFields[$aField['sFieldName']]) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$mysqlDate = (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']] : '');
|
||||
@@ -644,7 +747,14 @@ class ReportTables
|
||||
try {
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
} catch (Exception $e) {
|
||||
Bootstrap::registerMonolog('sqlExecution', 400, 'Sql Execution', ['sql' => $sQuery,'error' => $e->getMessage()], config("system.workspace"), 'processmaker.log');
|
||||
Bootstrap::registerMonolog(
|
||||
'sqlExecution',
|
||||
400,
|
||||
'Sql Execution',
|
||||
['sql' => $sQuery, 'error' => $e->getMessage()],
|
||||
config("system.workspace"),
|
||||
'processmaker.log'
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -665,14 +775,21 @@ class ReportTables
|
||||
foreach ($aTableFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset($aGridRow[$aField['sFieldName']]) ? (float)str_replace(',', '', $aGridRow[$aField['sFieldName']]) : '0');
|
||||
$sQuery .= ',' . (isset($aGridRow[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aGridRow[$aField['sFieldName']]
|
||||
) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aGridRow[$aField['sFieldName']])) {
|
||||
$aGridRow[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? mysql_real_escape_string($aGridRow[$aField['sFieldName']]) : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aGridRow[$aField['sFieldName']]
|
||||
) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? $aGridRow[$aField['sFieldName']] : '') . "'";
|
||||
@@ -700,14 +817,21 @@ class ReportTables
|
||||
$sQuery .= '[' . $aField['sFieldName'] . '] = ';
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(',', '', $aFields[$aField['sFieldName']]) : '0') . ',';
|
||||
$sQuery .= (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '0') . ',';
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aFields[$aField['sFieldName']])) {
|
||||
$aFields[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= "'" . (isset($aFields[$aField['sFieldName']]) ? mysql_real_escape_string($aFields[$aField['sFieldName']]) : '') . "',";
|
||||
$sQuery .= "'" . (isset($aFields[$aField['sFieldName']]) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '') . "',";
|
||||
break;
|
||||
case 'date':
|
||||
$sQuery .= "'" . (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']] : '') . "',";
|
||||
@@ -726,14 +850,21 @@ class ReportTables
|
||||
foreach ($aTableFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(',', '', $aFields[$aField['sFieldName']]) : '0');
|
||||
$sQuery .= ',' . (isset($aFields[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aFields[$aField['sFieldName']])) {
|
||||
$aFields[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset($aFields[$aField['sFieldName']]) ? mysql_real_escape_string($aFields[$aField['sFieldName']]) : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aFields[$aField['sFieldName']]) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aFields[$aField['sFieldName']]
|
||||
) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$sQuery .= ",'" . (isset($aFields[$aField['sFieldName']]) ? $aFields[$aField['sFieldName']] : '') . "'";
|
||||
@@ -744,7 +875,11 @@ class ReportTables
|
||||
}
|
||||
$rs = $stmt->executeQuery($sQuery);
|
||||
} else {
|
||||
mysql_query('DELETE FROM [' . $aRow['REP_TAB_NAME'] . "] WHERE APP_UID = '" . $sApplicationUid . "'");
|
||||
//Verify use in mssql
|
||||
mysqli_query(
|
||||
$con->getResource(),
|
||||
'DELETE FROM [' . $aRow['REP_TAB_NAME'] . "] WHERE APP_UID = '" . $sApplicationUid . "'"
|
||||
);
|
||||
$aAux = explode('-', $aRow['REP_TAB_GRID']);
|
||||
if (isset($aFields[$aAux[0]])) {
|
||||
foreach ($aFields[$aAux[0]] as $iRow => $aGridRow) {
|
||||
@@ -757,14 +892,21 @@ class ReportTables
|
||||
foreach ($aTableFields as $aField) {
|
||||
switch ($aField['sType']) {
|
||||
case 'number':
|
||||
$sQuery .= ',' . (isset($aGridRow[$aField['sFieldName']]) ? (float)str_replace(',', '', $aGridRow[$aField['sFieldName']]) : '0');
|
||||
$sQuery .= ',' . (isset($aGridRow[$aField['sFieldName']]) ? (float)str_replace(
|
||||
',',
|
||||
'',
|
||||
$aGridRow[$aField['sFieldName']]
|
||||
) : '0');
|
||||
break;
|
||||
case 'char':
|
||||
case 'text':
|
||||
if (!isset($aGridRow[$aField['sFieldName']])) {
|
||||
$aGridRow[$aField['sFieldName']] = '';
|
||||
}
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? mysql_real_escape_string($aGridRow[$aField['sFieldName']]) : '') . "'";
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? mysqli_real_escape_string(
|
||||
$con->getResource(),
|
||||
$aGridRow[$aField['sFieldName']]
|
||||
) : '') . "'";
|
||||
break;
|
||||
case 'date':
|
||||
$sQuery .= ",'" . (isset($aGridRow[$aField['sFieldName']]) ? $aGridRow[$aField['sFieldName']] : '') . "'";
|
||||
@@ -809,7 +951,9 @@ class ReportTables
|
||||
* Choose the database to connect
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $TabConnectionk
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function chooseDB($TabConnectionk)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -2,10 +2,10 @@
|
||||
|
||||
class XMLConnection
|
||||
{
|
||||
var $phptype = 'myxml';
|
||||
var $caseFolding = true;
|
||||
var $xmldoc = null;
|
||||
var $xmlFile = '';
|
||||
public $phptype = 'myxml';
|
||||
public $caseFolding = true;
|
||||
public $xmldoc = null;
|
||||
public $xmlFile = '';
|
||||
|
||||
/**
|
||||
* XMLConnection
|
||||
@@ -13,10 +13,10 @@ class XMLConnection
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
public function XMLConnection ($file)
|
||||
public function XMLConnection($file)
|
||||
{
|
||||
$this->xmldoc = new Xml_Document();
|
||||
$this->xmldoc->parseXmlFile( $file );
|
||||
$this->xmldoc->parseXmlFile($file);
|
||||
$this->xmlFile = $file;
|
||||
}
|
||||
|
||||
@@ -27,74 +27,74 @@ class XMLConnection
|
||||
* @param string $sql
|
||||
* @return object(XMLResult) $result
|
||||
*/
|
||||
public function &query ($sql)
|
||||
public function &query($sql)
|
||||
{
|
||||
if (! isset( $this->xmldoc )) {
|
||||
$err = new DB_Error( "Error: Closed xmlConnection." );
|
||||
if (! isset($this->xmldoc)) {
|
||||
$err = new DB_Error("Error: Closed xmlConnection.");
|
||||
return $err;
|
||||
}
|
||||
if (1 === preg_match( '/^\s*SELECT\s+([\w\W]+?)(?:\s+FROM\s+`?([^`]+?)`?)(?:\s+WHERE\s+([\w\W]+?))?(?:\s+GROUP\s+BY\s+([\w\W]+?))?(?:\s+ORDER\s+BY\s+([\w\W]+?))?(?:\s+BETWEEN\s+([\w\W]+?)\s+AND\s+([\w\W]+?))?(?:\s+LIMIT\s+(\d+)\s*,\s*(\d+))?\s*$/im', $sql, $matches )) {
|
||||
if (1 === preg_match('/^\s*SELECT\s+([\w\W]+?)(?:\s+FROM\s+`?([^`]+?)`?)(?:\s+WHERE\s+([\w\W]+?))?(?:\s+GROUP\s+BY\s+([\w\W]+?))?(?:\s+ORDER\s+BY\s+([\w\W]+?))?(?:\s+BETWEEN\s+([\w\W]+?)\s+AND\s+([\w\W]+?))?(?:\s+LIMIT\s+(\d+)\s*,\s*(\d+))?\s*$/im', $sql, $matches)) {
|
||||
$sqlColumns = $matches[1];
|
||||
$sqlFrom = isset( $matches[2] ) ? $matches[2] : '';
|
||||
$sqlWhere = isset( $matches[3] ) ? $matches[3] : '';
|
||||
$sqlGroupBy = isset( $matches[4] ) ? $matches[4] : '';
|
||||
$sqlOrderBy = isset( $matches[5] ) ? $matches[5] : '';
|
||||
$sqlLowLimit = isset( $matches[8] ) ? $matches[8] : '';
|
||||
$sqlHighLimit = isset( $matches[9] ) ? $matches[9] : '';
|
||||
$sqlFrom = isset($matches[2]) ? $matches[2] : '';
|
||||
$sqlWhere = isset($matches[3]) ? $matches[3] : '';
|
||||
$sqlGroupBy = isset($matches[4]) ? $matches[4] : '';
|
||||
$sqlOrderBy = isset($matches[5]) ? $matches[5] : '';
|
||||
$sqlLowLimit = isset($matches[8]) ? $matches[8] : '';
|
||||
$sqlHighLimit = isset($matches[9]) ? $matches[9] : '';
|
||||
/* Start Block: Fields list */
|
||||
$count = preg_match_all( '/\s*(\*|[\w\.]+)(?:\s+AS\s+([\w\.]+))?/im', $sqlColumns, $match, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE );
|
||||
$fieldsList = array ();
|
||||
$count = preg_match_all('/\s*(\*|[\w\.]+)(?:\s+AS\s+([\w\.]+))?/im', $sqlColumns, $match, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
|
||||
$fieldsList = array();
|
||||
for ($r = 0; $r < $count; $r ++) {
|
||||
$name = (is_array( $match[2][$r] ) && $match[2][$r][0] !== '') ? $match[2][$r][0] : $match[1][$r][0];
|
||||
$name = (is_array($match[2][$r]) && $match[2][$r][0] !== '') ? $match[2][$r][0] : $match[1][$r][0];
|
||||
$fieldsList[$name] = $match[1][$r][0];
|
||||
}
|
||||
/* End Block */
|
||||
/* Start Block: Order list */
|
||||
$count = preg_match_all( '/\s*(\*|[\w\.]+)(\s+ASC|\s+DESC)?\s*,?/im', $sqlOrderBy, $match, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE );
|
||||
$orderList = array ();
|
||||
$count = preg_match_all('/\s*(\*|[\w\.]+)(\s+ASC|\s+DESC)?\s*,?/im', $sqlOrderBy, $match, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
|
||||
$orderList = array();
|
||||
for ($r = $count - 1; $r >= 0; $r --) {
|
||||
$direction = (is_array( $match[2][$r] ) && $match[2][$r][0] !== '') ? $match[2][$r][0] : 'ASC';
|
||||
$direction = strtoupper( $direction );
|
||||
$direction = (is_array($match[2][$r]) && $match[2][$r][0] !== '') ? $match[2][$r][0] : 'ASC';
|
||||
$direction = strtoupper($direction);
|
||||
$orderList[$match[1][$r][0]] = $direction;
|
||||
}
|
||||
/* End Block */
|
||||
$xmlFrom = '/' . str_replace( '.', '/', $sqlFrom );
|
||||
$node = & $this->xmldoc->findNode( $xmlFrom );
|
||||
if (! isset( $node )) {
|
||||
$xmlFrom = '/' . str_replace('.', '/', $sqlFrom);
|
||||
$node = $this->xmldoc->findNode($xmlFrom);
|
||||
if (! isset($node)) {
|
||||
//$err = new DB_Error( "$xmlFrom node not found in $dsn." );
|
||||
throw new Exception( "$xmlFrom node not found in " . $this->xmlFile . "." );
|
||||
throw new Exception("$xmlFrom node not found in " . $this->xmlFile . ".");
|
||||
return $err;
|
||||
} else {
|
||||
$res = $this->fetchChildren( $node );
|
||||
$res = $this->fetchChildren($node);
|
||||
}
|
||||
/* Start Block: WHERE*/
|
||||
if ($sqlWhere !== '') {
|
||||
/*Start Block: Replace the operator */
|
||||
$blocks = preg_split( '/("(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\')/im', $sqlWhere, - 1, PREG_SPLIT_DELIM_CAPTURE );
|
||||
$blocks = preg_split('/("(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\')/im', $sqlWhere, - 1, PREG_SPLIT_DELIM_CAPTURE);
|
||||
$sqlWhere = '';
|
||||
for ($r = 0; $r < sizeof( $blocks ); $r ++) {
|
||||
for ($r = 0; $r < sizeof($blocks); $r ++) {
|
||||
if (($r % 2) === 0) {
|
||||
$blocks[$r] = str_replace( '=', '==', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( '<>', '!=', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'AND', '&&', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'and', '&&', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'OR', '||', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'or', '||', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'NOT', '!', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'not', '!', $blocks[$r] );
|
||||
$blocks[$r] = preg_replace( '/\b[a-zA-Z_][\w\.]*\b/im', '$res[$r][\'$0\']', $blocks[$r] );
|
||||
$blocks[$r] = preg_replace( '/\$res\[\$r\]\[\'(like)\'\]/im', '$1', $blocks[$r] );
|
||||
$blocks[$r] = str_replace('=', '==', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('<>', '!=', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('AND', '&&', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('and', '&&', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('OR', '||', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('or', '||', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('NOT', '!', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('not', '!', $blocks[$r]);
|
||||
$blocks[$r] = preg_replace('/\b[a-zA-Z_][\w\.]*\b/im', '$res[$r][\'$0\']', $blocks[$r]);
|
||||
$blocks[$r] = preg_replace('/\$res\[\$r\]\[\'(like)\'\]/im', '$1', $blocks[$r]);
|
||||
}
|
||||
$sqlWhere .= $blocks[$r];
|
||||
}
|
||||
$sqlWhere = preg_replace_callback( '/(.+)\s+like\s+("(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\')/im', array ('XMLConnection','sqlWhereLike'
|
||||
), $sqlWhere );
|
||||
$sqlWhere = preg_replace_callback( '/"(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\'/im', array ('XMLConnection','sqlString'
|
||||
), $sqlWhere );
|
||||
$newRes = array ();
|
||||
for ($r = 0; $r < sizeof( $res ); $r ++) {
|
||||
$sqlWhere = preg_replace_callback('/(.+)\s+like\s+("(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\')/im', array('XMLConnection','sqlWhereLike'
|
||||
), $sqlWhere);
|
||||
$sqlWhere = preg_replace_callback('/"(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\'/im', array('XMLConnection','sqlString'
|
||||
), $sqlWhere);
|
||||
$newRes = array();
|
||||
for ($r = 0; $r < sizeof($res); $r ++) {
|
||||
$evalWhere = false;
|
||||
@eval( '$evalWhere = ' . $sqlWhere . ';' );
|
||||
@eval('$evalWhere = ' . $sqlWhere . ';');
|
||||
if ($evalWhere) {
|
||||
$newRes[] = $res[$r];
|
||||
}
|
||||
@@ -105,14 +105,14 @@ class XMLConnection
|
||||
/* Start Block: Expands the resultant data according to fill an array
|
||||
* with the required fields in the query.
|
||||
*/
|
||||
for ($r = 0; $r < sizeof( $res ); $r ++) {
|
||||
$res[$r] = $this->expandFields( $res[$r], $fieldsList );
|
||||
for ($r = 0; $r < sizeof($res); $r ++) {
|
||||
$res[$r] = $this->expandFields($res[$r], $fieldsList);
|
||||
}
|
||||
/* End Block */
|
||||
/* Start Block: ORDER BY*/
|
||||
foreach ($orderList as $field => $direction) {
|
||||
for ($i = 0; $i < sizeof( $res ); $i ++) {
|
||||
for ($j = $i + 1; $j < sizeof( $res ); $j ++) {
|
||||
for ($i = 0; $i < sizeof($res); $i ++) {
|
||||
for ($j = $i + 1; $j < sizeof($res); $j ++) {
|
||||
$condition = ($direction === 'ASC') ? ($res[$j] < $res[$i]) : ($res[$j] > $res[$i]);
|
||||
if ($condition) {
|
||||
$swap = $res[$i];
|
||||
@@ -127,169 +127,169 @@ class XMLConnection
|
||||
if ($sqlLowLimit != '' && $sqlHighLimit != '') {
|
||||
$sqlLowLimit = (int) $sqlLowLimit;
|
||||
$sqlHighLimit = (int) $sqlHighLimit;
|
||||
$res = array_slice( $res, $sqlLowLimit, $sqlHighLimit );
|
||||
$res = array_slice($res, $sqlLowLimit, $sqlHighLimit);
|
||||
}
|
||||
/* End Block */
|
||||
$result = new XMLResult( $res );
|
||||
$result = new XMLResult($res);
|
||||
return $result;
|
||||
} elseif (1 === preg_match( '/^\s*DELETE\s+FROM\s+`?([^`]+?)`?(?:\s+WHERE\s+([\w\W]+?))?\s*$/im', $sql, $matches )) {
|
||||
$sqlFrom = isset( $matches[1] ) ? $matches[1] : '';
|
||||
$sqlWhere = isset( $matches[2] ) ? $matches[2] : '1';
|
||||
} elseif (1 === preg_match('/^\s*DELETE\s+FROM\s+`?([^`]+?)`?(?:\s+WHERE\s+([\w\W]+?))?\s*$/im', $sql, $matches)) {
|
||||
$sqlFrom = isset($matches[1]) ? $matches[1] : '';
|
||||
$sqlWhere = isset($matches[2]) ? $matches[2] : '1';
|
||||
/* Start Block: WHERE*/
|
||||
/*Start Block: Replace the operator */
|
||||
$blocks = preg_split( '/("(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\')/im', $sqlWhere, - 1, PREG_SPLIT_DELIM_CAPTURE );
|
||||
$blocks = preg_split('/("(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\')/im', $sqlWhere, - 1, PREG_SPLIT_DELIM_CAPTURE);
|
||||
$sqlWhere = '';
|
||||
for ($r = 0; $r < sizeof( $blocks ); $r ++) {
|
||||
for ($r = 0; $r < sizeof($blocks); $r ++) {
|
||||
if (($r % 2) === 0) {
|
||||
$blocks[$r] = str_replace( '=', '==', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( '<>', '!=', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'AND', '&&', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'and', '&&', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'OR', '||', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'or', '||', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'NOT', '!', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'not', '!', $blocks[$r] );
|
||||
$blocks[$r] = preg_replace( '/\b[a-zA-Z_][\w\.]*\b/im', '$res[$r][\'$0\']', $blocks[$r] );
|
||||
$blocks[$r] = preg_replace( '/\$res\[\$r\]\[\'(like)\'\]/im', '$1', $blocks[$r] );
|
||||
$blocks[$r] = str_replace('=', '==', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('<>', '!=', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('AND', '&&', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('and', '&&', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('OR', '||', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('or', '||', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('NOT', '!', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('not', '!', $blocks[$r]);
|
||||
$blocks[$r] = preg_replace('/\b[a-zA-Z_][\w\.]*\b/im', '$res[$r][\'$0\']', $blocks[$r]);
|
||||
$blocks[$r] = preg_replace('/\$res\[\$r\]\[\'(like)\'\]/im', '$1', $blocks[$r]);
|
||||
}
|
||||
$sqlWhere .= $blocks[$r];
|
||||
}
|
||||
/* End Block */
|
||||
$sqlWhere = preg_replace_callback( '/(.+)\s+like\s+("(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\')/im', array ('XMLConnection','sqlWhereLike'
|
||||
), $sqlWhere );
|
||||
$sqlWhere = preg_replace_callback( '/"(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\'/im', array ('XMLConnection','sqlString'
|
||||
), $sqlWhere );
|
||||
$sqlWhere = preg_replace_callback('/(.+)\s+like\s+("(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\')/im', array('XMLConnection','sqlWhereLike'
|
||||
), $sqlWhere);
|
||||
$sqlWhere = preg_replace_callback('/"(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\'/im', array('XMLConnection','sqlString'
|
||||
), $sqlWhere);
|
||||
|
||||
/*Start Block: Removing fields */
|
||||
$xmlFrom = '/' . str_replace( '.', '/', $sqlFrom );
|
||||
$node = & $this->xmldoc->findNode( $xmlFrom );
|
||||
if (! isset( $node )) {
|
||||
$err = new DB_Error( "$xmlFrom node not found!." );
|
||||
$xmlFrom = '/' . str_replace('.', '/', $sqlFrom);
|
||||
$node = $this->xmldoc->findNode($xmlFrom);
|
||||
if (! isset($node)) {
|
||||
$err = new DB_Error("$xmlFrom node not found!.");
|
||||
return $err;
|
||||
} else {
|
||||
$res = $this->fetchChildren( $node );
|
||||
$res = $this->fetchChildren($node);
|
||||
}
|
||||
$newRes = array ();
|
||||
for ($r = 0; $r < sizeof( $res ); $r ++) {
|
||||
$newRes = array();
|
||||
for ($r = 0; $r < sizeof($res); $r ++) {
|
||||
$evalWhere = false;
|
||||
@eval( '$evalWhere = ' . $sqlWhere . ';' );
|
||||
@eval('$evalWhere = ' . $sqlWhere . ';');
|
||||
if ($evalWhere) {
|
||||
unset( $node->children[$r] );
|
||||
unset($node->children[$r]);
|
||||
$newRes[] = $res[$r];
|
||||
}
|
||||
}
|
||||
//Re-index
|
||||
$node->children = array_values( $node->children );
|
||||
$node->children = array_values($node->children);
|
||||
/* End Block */
|
||||
$this->xmldoc->save( $this->xmlFile );
|
||||
$result = new XMLResult( $newRes );
|
||||
$this->xmldoc->save($this->xmlFile);
|
||||
$result = new XMLResult($newRes);
|
||||
return $result;
|
||||
} elseif (1 === preg_match( '/^\s*INSERT\s+INTO\s+`?([^`]+?)`?\s*\(([\w\W]+?)\)\s+VALUES\s*\(([\w\W]+?)\)\s*$/im', $sql, $matches )) {
|
||||
$sqlFrom = isset( $matches[1] ) ? $matches[1] : '';
|
||||
$sqlColumns = isset( $matches[2] ) ? $matches[2] : '1';
|
||||
$sqlValues = isset( $matches[3] ) ? $matches[3] : '1';
|
||||
$xmlFrom = '/' . str_replace( '.', '/', $sqlFrom );
|
||||
$node = & $this->xmldoc->findNode( $xmlFrom );
|
||||
} elseif (1 === preg_match('/^\s*INSERT\s+INTO\s+`?([^`]+?)`?\s*\(([\w\W]+?)\)\s+VALUES\s*\(([\w\W]+?)\)\s*$/im', $sql, $matches)) {
|
||||
$sqlFrom = isset($matches[1]) ? $matches[1] : '';
|
||||
$sqlColumns = isset($matches[2]) ? $matches[2] : '1';
|
||||
$sqlValues = isset($matches[3]) ? $matches[3] : '1';
|
||||
$xmlFrom = '/' . str_replace('.', '/', $sqlFrom);
|
||||
$node = $this->xmldoc->findNode($xmlFrom);
|
||||
/* Start Block: Fields list */
|
||||
$count = preg_match_all( '/([\w\.]+)/im', $sqlColumns, $match, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE );
|
||||
$fieldsList = array ();
|
||||
$count = preg_match_all('/([\w\.]+)/im', $sqlColumns, $match, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
|
||||
$fieldsList = array();
|
||||
for ($r = 0; $r < $count; $r ++) {
|
||||
$fieldsList[] = $match[1][$r][0];
|
||||
}
|
||||
/* End Block */
|
||||
/* Start Block: Fields Values */
|
||||
$count = preg_match_all( '/("(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\'|\d+)/im', $sqlValues, $match, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE );
|
||||
$fieldsValues = array ();
|
||||
$count = preg_match_all('/("(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\'|\d+)/im', $sqlValues, $match, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
|
||||
$fieldsValues = array();
|
||||
for ($r = 0; $r < $count; $r ++) {
|
||||
if (substr( $match[1][$r][0], 0, 1 ) === '"') {
|
||||
$match[1][$r][0] = substr( $match[1][$r][0], 1, - 1 );
|
||||
$match[1][$r][0] = str_replace( '""', '"', $match[1][$r][0] );
|
||||
$match[1][$r][0] = str_replace( "''", "'", $match[1][$r][0] );
|
||||
if (substr($match[1][$r][0], 0, 1) === '"') {
|
||||
$match[1][$r][0] = substr($match[1][$r][0], 1, - 1);
|
||||
$match[1][$r][0] = str_replace('""', '"', $match[1][$r][0]);
|
||||
$match[1][$r][0] = str_replace("''", "'", $match[1][$r][0]);
|
||||
}
|
||||
if (substr( $match[1][$r][0], 0, 1 ) === "'") {
|
||||
$match[1][$r][0] = substr( $match[1][$r][0], 1, - 1 );
|
||||
$match[1][$r][0] = str_replace( "''", "'", $match[1][$r][0] );
|
||||
$match[1][$r][0] = str_replace( '""', '"', $match[1][$r][0] );
|
||||
if (substr($match[1][$r][0], 0, 1) === "'") {
|
||||
$match[1][$r][0] = substr($match[1][$r][0], 1, - 1);
|
||||
$match[1][$r][0] = str_replace("''", "'", $match[1][$r][0]);
|
||||
$match[1][$r][0] = str_replace('""', '"', $match[1][$r][0]);
|
||||
}
|
||||
$fieldsValues[$fieldsList[$r]] = $match[1][$r][0];
|
||||
}
|
||||
/* End Block */
|
||||
$AAA = getNames( $this->xmldoc->children[0]->children );
|
||||
$this->insertRow( $node, $fieldsValues );
|
||||
$DDD = getNames( $this->xmldoc->children[0]->children );
|
||||
$this->xmldoc->save( $this->xmlFile );
|
||||
$result = new XMLResult( array ($fieldsValues
|
||||
) );
|
||||
$AAA = getNames($this->xmldoc->children[0]->children);
|
||||
$this->insertRow($node, $fieldsValues);
|
||||
$DDD = getNames($this->xmldoc->children[0]->children);
|
||||
$this->xmldoc->save($this->xmlFile);
|
||||
$result = new XMLResult(array($fieldsValues
|
||||
));
|
||||
return $result;
|
||||
} elseif (1 === preg_match( '/^\s*UPDATE\s+`?([^`]+?)`?\s+SET\s+((?:(?:[a-z][\w\.]*)\s*=\s*(?:"(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\'|\d+)\s*(?:,\s*)?)+)(?:\s+WHERE\s+([\w\W]+?))?\s*$/im', $sql, $matches )) {
|
||||
$sqlFrom = isset( $matches[1] ) ? $matches[1] : '';
|
||||
$sqlColumns = isset( $matches[2] ) ? $matches[2] : '';
|
||||
$sqlWhere = isset( $matches[3] ) ? $matches[3] : '1';
|
||||
$count = preg_match_all( '/([a-z][\w\.]*)\s*=\s*("(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\'|\d+)/im', $sqlColumns, $match, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE );
|
||||
$fieldsValues = array ();
|
||||
} elseif (1 === preg_match('/^\s*UPDATE\s+`?([^`]+?)`?\s+SET\s+((?:(?:[a-z][\w\.]*)\s*=\s*(?:"(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\'|\d+)\s*(?:,\s*)?)+)(?:\s+WHERE\s+([\w\W]+?))?\s*$/im', $sql, $matches)) {
|
||||
$sqlFrom = isset($matches[1]) ? $matches[1] : '';
|
||||
$sqlColumns = isset($matches[2]) ? $matches[2] : '';
|
||||
$sqlWhere = isset($matches[3]) ? $matches[3] : '1';
|
||||
$count = preg_match_all('/([a-z][\w\.]*)\s*=\s*("(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\'|\d+)/im', $sqlColumns, $match, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
|
||||
$fieldsValues = array();
|
||||
for ($r = 0; $r < $count; $r ++) {
|
||||
if (substr( $match[2][$r][0], 0, 1 ) === '"') {
|
||||
$match[2][$r][0] = substr( $match[2][$r][0], 1, - 1 );
|
||||
$match[2][$r][0] = str_replace( '""', '"', $match[2][$r][0] );
|
||||
$match[2][$r][0] = str_replace( "''", "'", $match[2][$r][0] );
|
||||
if (substr($match[2][$r][0], 0, 1) === '"') {
|
||||
$match[2][$r][0] = substr($match[2][$r][0], 1, - 1);
|
||||
$match[2][$r][0] = str_replace('""', '"', $match[2][$r][0]);
|
||||
$match[2][$r][0] = str_replace("''", "'", $match[2][$r][0]);
|
||||
}
|
||||
if (substr( $match[2][$r][0], 0, 1 ) === "'") {
|
||||
$match[2][$r][0] = substr( $match[2][$r][0], 1, - 1 );
|
||||
$match[2][$r][0] = str_replace( "''", "'", $match[2][$r][0] );
|
||||
$match[2][$r][0] = str_replace( '""', '"', $match[2][$r][0] );
|
||||
if (substr($match[2][$r][0], 0, 1) === "'") {
|
||||
$match[2][$r][0] = substr($match[2][$r][0], 1, - 1);
|
||||
$match[2][$r][0] = str_replace("''", "'", $match[2][$r][0]);
|
||||
$match[2][$r][0] = str_replace('""', '"', $match[2][$r][0]);
|
||||
}
|
||||
$fieldsValues[$match[1][$r][0]] = $match[2][$r][0];
|
||||
}
|
||||
/* Start Block: WHERE*/
|
||||
/*Start Block: Replace the operator */
|
||||
$blocks = preg_split( '/("(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\')/im', $sqlWhere, - 1, PREG_SPLIT_DELIM_CAPTURE );
|
||||
$blocks = preg_split('/("(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\')/im', $sqlWhere, - 1, PREG_SPLIT_DELIM_CAPTURE);
|
||||
$sqlWhere = '';
|
||||
for ($r = 0; $r < sizeof( $blocks ); $r ++) {
|
||||
for ($r = 0; $r < sizeof($blocks); $r ++) {
|
||||
if (($r % 2) === 0) {
|
||||
$blocks[$r] = str_replace( '=', '==', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( '<>', '!=', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'AND', '&&', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'and', '&&', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'OR', '||', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'or', '||', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'NOT', '!', $blocks[$r] );
|
||||
$blocks[$r] = str_replace( 'not', '!', $blocks[$r] );
|
||||
$blocks[$r] = preg_replace( '/\b[a-zA-Z_][\w\.]*\b/im', '$res[$r][\'$0\']', $blocks[$r] );
|
||||
$blocks[$r] = preg_replace( '/\$res\[\$r\]\[\'(like)\'\]/im', '$1', $blocks[$r] );
|
||||
$blocks[$r] = str_replace('=', '==', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('<>', '!=', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('AND', '&&', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('and', '&&', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('OR', '||', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('or', '||', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('NOT', '!', $blocks[$r]);
|
||||
$blocks[$r] = str_replace('not', '!', $blocks[$r]);
|
||||
$blocks[$r] = preg_replace('/\b[a-zA-Z_][\w\.]*\b/im', '$res[$r][\'$0\']', $blocks[$r]);
|
||||
$blocks[$r] = preg_replace('/\$res\[\$r\]\[\'(like)\'\]/im', '$1', $blocks[$r]);
|
||||
}
|
||||
$sqlWhere .= $blocks[$r];
|
||||
}
|
||||
/* End Block */
|
||||
$sqlWhere = preg_replace_callback( '/(.+)\s+like\s+("(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\')/im', array ('XMLConnection','sqlWhereLike'
|
||||
), $sqlWhere );
|
||||
$sqlWhere = preg_replace_callback( '/"(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\'/im', array ('XMLConnection','sqlString'
|
||||
), $sqlWhere );
|
||||
$sqlWhere = preg_replace_callback('/(.+)\s+like\s+("(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\')/im', array('XMLConnection','sqlWhereLike'
|
||||
), $sqlWhere);
|
||||
$sqlWhere = preg_replace_callback('/"(?:(?:[^"]|"")*)"|\'(?:(?:[^\']|\'\')*)\'/im', array('XMLConnection','sqlString'
|
||||
), $sqlWhere);
|
||||
/*Start Block: Removing fields */
|
||||
$xmlFrom = '/' . str_replace( '.', '/', $sqlFrom );
|
||||
$node = & $this->xmldoc->findNode( $xmlFrom );
|
||||
if (! isset( $node )) {
|
||||
$err = new DB_Error( "$xmlFrom node not found in $dsn." );
|
||||
$xmlFrom = '/' . str_replace('.', '/', $sqlFrom);
|
||||
$node = $this->xmldoc->findNode($xmlFrom);
|
||||
if (! isset($node)) {
|
||||
$err = new DB_Error("$xmlFrom node not found in $dsn.");
|
||||
return $err;
|
||||
} else {
|
||||
$res = $this->fetchChildren( $node );
|
||||
$res = $this->fetchChildren($node);
|
||||
}
|
||||
$newRes = array ();
|
||||
for ($r = 0; $r < sizeof( $res ); $r ++) {
|
||||
$newRes = array();
|
||||
for ($r = 0; $r < sizeof($res); $r ++) {
|
||||
$evalWhere = false;
|
||||
@eval( '$evalWhere = ' . $sqlWhere . ';' );
|
||||
@eval('$evalWhere = ' . $sqlWhere . ';');
|
||||
if ($evalWhere) {
|
||||
$this->updateRow( $node->children[$r], $fieldsValues );
|
||||
$newRes[] = array_merge( $res[$r], $fieldsValues );
|
||||
$this->updateRow($node->children[$r], $fieldsValues);
|
||||
$newRes[] = array_merge($res[$r], $fieldsValues);
|
||||
}
|
||||
}
|
||||
/* End Block */
|
||||
$nodeTEST = & $this->xmldoc->findNode( $xmlFrom );
|
||||
$this->xmldoc->save( $this->xmlFile );
|
||||
$result = new XMLResult( $newRes );
|
||||
$nodeTEST = $this->xmldoc->findNode($xmlFrom);
|
||||
$this->xmldoc->save($this->xmlFile);
|
||||
$result = new XMLResult($newRes);
|
||||
return $result;
|
||||
} else {
|
||||
echo ($sql);
|
||||
$err = new DB_Error( "SQL Query is not well formed." );
|
||||
echo($sql);
|
||||
$err = new DB_Error("SQL Query is not well formed.");
|
||||
return $err;
|
||||
}
|
||||
}
|
||||
@@ -300,12 +300,12 @@ class XMLConnection
|
||||
* @param string $a
|
||||
* @return void $b
|
||||
*/
|
||||
public function sqlLike ($a, $b)
|
||||
public function sqlLike($a, $b)
|
||||
{
|
||||
$b = addcslashes( $b, '[]()\/{}.?' );
|
||||
$b = str_replace( "%", '.*', $b );
|
||||
$b = addcslashes($b, '[]()\/{}.?');
|
||||
$b = str_replace("%", '.*', $b);
|
||||
$b = '/^' . $b . '$/im';
|
||||
return preg_match( $b, $a );
|
||||
return preg_match($b, $a);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -315,16 +315,16 @@ class XMLConnection
|
||||
* @param string $fieldsList
|
||||
* @return array $res
|
||||
*/
|
||||
public function expandFields ($resRow, $fieldsList)
|
||||
public function expandFields($resRow, $fieldsList)
|
||||
{
|
||||
$res = array ();
|
||||
$res = array();
|
||||
foreach ($fieldsList as $key => $value) {
|
||||
if ($key === '*') {
|
||||
foreach ($resRow as $k => $v) {
|
||||
$res[$k] = $v;
|
||||
}
|
||||
} else {
|
||||
$res[$key] = array_key_exists( $value, $resRow ) ? $resRow[$value] : null;
|
||||
$res[$key] = array_key_exists($value, $resRow) ? $resRow[$value] : null;
|
||||
}
|
||||
}
|
||||
return $res;
|
||||
@@ -336,13 +336,13 @@ class XMLConnection
|
||||
* @param object &$node
|
||||
* @return array $res
|
||||
*/
|
||||
public function fetchNode (&$node)
|
||||
public function fetchNode(&$node)
|
||||
{
|
||||
$res = array ('XMLNODE_NAME' => $node->name,'XMLNODE_TYPE' => $node->type,'XMLNODE_VALUE' => $node->value
|
||||
$res = array('XMLNODE_NAME' => $node->name,'XMLNODE_TYPE' => $node->type,'XMLNODE_VALUE' => $node->value
|
||||
);
|
||||
foreach ($node->attributes as $name => $value) {
|
||||
if ($this->caseFolding) {
|
||||
$name = strtoupper( $name );
|
||||
$name = strtoupper($name);
|
||||
}
|
||||
$res[$name] = $value;
|
||||
}
|
||||
@@ -355,11 +355,11 @@ class XMLConnection
|
||||
* @param string &$node
|
||||
* @return array $res
|
||||
*/
|
||||
public function fetchChildren (&$node)
|
||||
public function fetchChildren(&$node)
|
||||
{
|
||||
$res = array ();
|
||||
$res = array();
|
||||
foreach ($node->children as $name => $child) {
|
||||
$res[] = $this->fetchNode( $child );
|
||||
$res[] = $this->fetchNode($child);
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
@@ -369,9 +369,9 @@ class XMLConnection
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function disconnect ()
|
||||
public function disconnect()
|
||||
{
|
||||
unset( $this->xmldoc );
|
||||
unset($this->xmldoc);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -379,9 +379,9 @@ class XMLConnection
|
||||
* @param array $match
|
||||
* @return object(DB_Error) $err
|
||||
*/
|
||||
public function sqlWhereLike ($match)
|
||||
public function sqlWhereLike($match)
|
||||
{
|
||||
switch (substr( $match[2], 0, 1 )) {
|
||||
switch (substr($match[2], 0, 1)) {
|
||||
case '"':
|
||||
return ' $this->sqlLike( ' . $match[1] . ', ' . $match[2] . ' ) ';
|
||||
break;
|
||||
@@ -389,7 +389,7 @@ class XMLConnection
|
||||
return ' $this->sqlLike( ' . $match[1] . ', ' . $match[2] . ' ) ';
|
||||
break;
|
||||
default:
|
||||
$err = new DB_Error( "XMLDB: Syntax error on $match[0]" );
|
||||
$err = new DB_Error("XMLDB: Syntax error on $match[0]");
|
||||
die();
|
||||
return $err;
|
||||
}
|
||||
@@ -401,25 +401,25 @@ class XMLConnection
|
||||
* @param array $match
|
||||
* @return object(DB_Error) $err
|
||||
*/
|
||||
public function sqlString ($match)
|
||||
public function sqlString($match)
|
||||
{
|
||||
switch (substr( $match[0], 0, 1 )) {
|
||||
switch (substr($match[0], 0, 1)) {
|
||||
case '"':
|
||||
$match[0] = substr( $match[0], 1, - 1 );
|
||||
$match[0] = str_replace( '""', '"', $match[0] );
|
||||
$match[0] = str_replace( "''", "'", $match[0] );
|
||||
$match[0] = addcslashes( $match[0], '\\\'' );
|
||||
$match[0] = substr($match[0], 1, - 1);
|
||||
$match[0] = str_replace('""', '"', $match[0]);
|
||||
$match[0] = str_replace("''", "'", $match[0]);
|
||||
$match[0] = addcslashes($match[0], '\\\'');
|
||||
return "'$match[0]'";
|
||||
break;
|
||||
case "'":
|
||||
$match[0] = substr( $match[0], 1, - 1 );
|
||||
$match[0] = str_replace( "''", "'", $match[0] );
|
||||
$match[0] = str_replace( '""', '"', $match[0] );
|
||||
$match[0] = addcslashes( $match[0], '\\\'' );
|
||||
$match[0] = substr($match[0], 1, - 1);
|
||||
$match[0] = str_replace("''", "'", $match[0]);
|
||||
$match[0] = str_replace('""', '"', $match[0]);
|
||||
$match[0] = addcslashes($match[0], '\\\'');
|
||||
return "'$match[0]'";
|
||||
break;
|
||||
default:
|
||||
$err = new DB_Error( "XMLDB: Syntax error on $match[0]" );
|
||||
$err = new DB_Error("XMLDB: Syntax error on $match[0]");
|
||||
die();
|
||||
return $err;
|
||||
}
|
||||
@@ -432,9 +432,9 @@ class XMLConnection
|
||||
* @param object $values
|
||||
* @return void
|
||||
*/
|
||||
public function insertRow (&$node, $values)
|
||||
public function insertRow(&$node, $values)
|
||||
{
|
||||
$attributes = array ();
|
||||
$attributes = array();
|
||||
foreach ($values as $field => $value) {
|
||||
switch ($field) {
|
||||
case 'XMLNODE_NAME':
|
||||
@@ -442,13 +442,13 @@ class XMLConnection
|
||||
case 'XMLNODE_VALUE':
|
||||
break;
|
||||
default:
|
||||
$attributes[strtolower( $field )] = $value;
|
||||
$attributes[strtolower($field)] = $value;
|
||||
}
|
||||
}
|
||||
$values['XMLNODE_NAME'] = ! isset( $values['XMLNODE_NAME'] ) ? '' : $values['XMLNODE_NAME'];
|
||||
$values['XMLNODE_TYPE'] = ! isset( $values['XMLNODE_TYPE'] ) ? 'open' : $values['XMLNODE_TYPE'];
|
||||
$values['XMLNODE_VALUE'] = ! isset( $values['XMLNODE_VALUE'] ) ? '' : $values['XMLNODE_VALUE'];
|
||||
$node->addChildNode( new Xml_Node( $values['XMLNODE_NAME'], $values['XMLNODE_TYPE'], $values['XMLNODE_VALUE'], $attributes ) );
|
||||
$values['XMLNODE_NAME'] = ! isset($values['XMLNODE_NAME']) ? '' : $values['XMLNODE_NAME'];
|
||||
$values['XMLNODE_TYPE'] = ! isset($values['XMLNODE_TYPE']) ? 'open' : $values['XMLNODE_TYPE'];
|
||||
$values['XMLNODE_VALUE'] = ! isset($values['XMLNODE_VALUE']) ? '' : $values['XMLNODE_VALUE'];
|
||||
$node->addChildNode(new Xml_Node($values['XMLNODE_NAME'], $values['XMLNODE_TYPE'], $values['XMLNODE_VALUE'], $attributes));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -458,7 +458,7 @@ class XMLConnection
|
||||
* @param object $values
|
||||
* @return void
|
||||
*/
|
||||
public function updateRow (&$node, $values)
|
||||
public function updateRow(&$node, $values)
|
||||
{
|
||||
foreach ($values as $field => $value) {
|
||||
switch ($field) {
|
||||
@@ -472,7 +472,7 @@ class XMLConnection
|
||||
$node->value = $value;
|
||||
break;
|
||||
default:
|
||||
$node->attributes[strtolower( $field )] = $value;
|
||||
$node->attributes[strtolower($field)] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class XmlFormFieldTextPm extends XmlFormFieldSimpleText
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function renderGrid($values = array(), $owner)
|
||||
public function renderGrid($values = array(), $owner = null, $paramDummy3 = null, $paramDummy4 = null)
|
||||
{
|
||||
$result = array();
|
||||
$r = 1;
|
||||
|
||||
@@ -23,7 +23,7 @@ class XmlFormFieldTextareaPm extends XmlFormField
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function render($value = null, $owner)
|
||||
public function render($value = null, $owner = null)
|
||||
{
|
||||
if ($this->showVars == 1) {
|
||||
$this->process = G::replaceDataField($this->process, $owner->values);
|
||||
@@ -53,8 +53,11 @@ class XmlFormFieldTextareaPm extends XmlFormField
|
||||
* @param eter string owner
|
||||
* @return string
|
||||
*/
|
||||
public function renderGrid($owner, $values = null)
|
||||
public function renderGrid($owner = null, $values = null, $onlyValue = false, $therow = -1)
|
||||
{
|
||||
if ($values === null) {
|
||||
$values = [];
|
||||
}
|
||||
$result = array();
|
||||
$r = 1;
|
||||
foreach ($values as $v) {
|
||||
|
||||
@@ -35,12 +35,12 @@ class XmlFormFieldToolBar extends XmlFormField
|
||||
* @param string $value
|
||||
* @return string
|
||||
*/
|
||||
public function render($value)
|
||||
public function render($value = null, $paramDummy2 = NULL)
|
||||
{
|
||||
$this->toolBar = new ToolBar($this->xmlfile, $this->home);
|
||||
$template = PATH_CORE . 'templates/' . $this->type . '.html';
|
||||
$out = $this->toolBar->render($template, $scriptCode);
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile($this->toolBar->scriptURL);
|
||||
$oHeadPublisher->addScriptCode($scriptCode);
|
||||
return $out;
|
||||
|
||||
@@ -303,13 +303,12 @@ function executeQuery ($SqlStatement, $DBConnectionUID = 'workflow', $aParameter
|
||||
switch (true) {
|
||||
case preg_match( "/^(SELECT|EXECUTE|EXEC|SHOW|DESCRIBE|EXPLAIN|BEGIN)\s/i", $statement ):
|
||||
$rs = $con->executeQuery( $SqlStatement );
|
||||
$con->commit();
|
||||
|
||||
$result = Array ();
|
||||
$i = 1;
|
||||
while ($rs->next()) {
|
||||
$result[$i ++] = $rs->getRow();
|
||||
}
|
||||
$con->commit();
|
||||
break;
|
||||
case preg_match( "/^INSERT\s/i", $statement ):
|
||||
$rs = $con->executeUpdate( $SqlStatement );
|
||||
@@ -2767,7 +2766,8 @@ function PMFDeleteCase ($caseUid)
|
||||
function PMFCancelCase ($caseUid, $delIndex, $userUid)
|
||||
{
|
||||
$ws = new WsBase();
|
||||
$result = $ws->cancelCase( $caseUid, $delIndex, $userUid );
|
||||
$result = $ws->cancelCase($caseUid, $delIndex, $userUid);
|
||||
$result = (object)$result;
|
||||
|
||||
if ($result->status_code == 0) {
|
||||
if (isset($_SESSION['APPLICATION']) && isset($_SESSION['INDEX'])) {
|
||||
@@ -2776,10 +2776,17 @@ function PMFCancelCase ($caseUid, $delIndex, $userUid)
|
||||
G::header('Location: ../cases/casesListExtJsRedirector');
|
||||
die();
|
||||
} else {
|
||||
die(G::LoadTranslation('ID_PM_FUNCTION_CHANGE_CASE', SYS_LANG, array('PMFCancelCase', G::LoadTranslation('ID_CANCELLED'))));
|
||||
die(
|
||||
G::LoadTranslation(
|
||||
'ID_PM_FUNCTION_CHANGE_CASE',
|
||||
SYS_LANG,
|
||||
['PMFCancelCase', G::LoadTranslation('ID_CANCELLED')]
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
/**
|
||||
* class.webdav.php
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
|
||||
@@ -399,7 +401,6 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
|
||||
*/
|
||||
public function GET(&$options)
|
||||
{
|
||||
|
||||
$filter = new InputFilter();
|
||||
$options = $filter->xssFilterHard($options);
|
||||
$paths = $filter->xssFilterHard($this->paths);
|
||||
@@ -743,13 +744,13 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
|
||||
|
||||
if (is_dir($path)) {
|
||||
$query = "DELETE FROM properties WHERE path LIKE '" . $this->_slashify($options["path"]) . "%'";
|
||||
mysql_query($query);
|
||||
mysqli_query($query);
|
||||
PearSystem::rm("-rf $path");
|
||||
} else {
|
||||
unlink($path);
|
||||
}
|
||||
$query = "DELETE FROM properties WHERE path = '$options[path]'";
|
||||
mysql_query($query);
|
||||
mysqli_query($query);
|
||||
|
||||
return "204 No Content";
|
||||
}
|
||||
@@ -838,13 +839,13 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
|
||||
$query = "UPDATE properties
|
||||
SET path = REPLACE(path, '" . $options["path"] . "', '" . $destpath . "')
|
||||
WHERE path LIKE '" . $this->_slashify($options["path"]) . "%'";
|
||||
mysql_query($query);
|
||||
mysqli_query($query);
|
||||
}
|
||||
|
||||
$query = "UPDATE properties
|
||||
SET path = '" . $destpath . "'
|
||||
WHERE path = '" . $options["path"] . "'";
|
||||
mysql_query($query);
|
||||
mysqli_query($query);
|
||||
} else {
|
||||
if (is_dir($source)) {
|
||||
$files = PearSystem::find($source);
|
||||
@@ -898,9 +899,9 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
|
||||
if (isset($options["update"])) {
|
||||
// Lock Update
|
||||
$query = "UPDATE locks SET expires = " . (time() + 300);
|
||||
mysql_query($query);
|
||||
mysqli_query($query);
|
||||
|
||||
if (mysql_affected_rows()) {
|
||||
if (mysqli_affected_rows()) {
|
||||
$options["timeout"] = 300; // 5min hardcoded
|
||||
return true;
|
||||
} else {
|
||||
@@ -917,9 +918,9 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
|
||||
, owner = '$options[owner]'
|
||||
, expires = '$options[timeout]'
|
||||
, exclusivelock = " . ($options['scope'] === "exclusive" ? "1" : "0");
|
||||
mysql_query($query);
|
||||
mysqli_query($query);
|
||||
|
||||
return mysql_affected_rows() ? "200 OK" : "409 Conflict";
|
||||
return mysqli_affected_rows() ? "200 OK" : "409 Conflict";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -933,9 +934,9 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
|
||||
$query = "DELETE FROM locks
|
||||
WHERE path = '$options[path]'
|
||||
AND token = '$options[token]'";
|
||||
mysql_query($query);
|
||||
mysqli_query($query);
|
||||
|
||||
return mysql_affected_rows() ? "204 No Content" : "409 Conflict";
|
||||
return mysqli_affected_rows() ? "204 No Content" : "409 Conflict";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -946,7 +947,6 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
|
||||
*/
|
||||
public function checkLock($path)
|
||||
{
|
||||
|
||||
$filter = new InputFilter();
|
||||
$path = $filter->validateInput($path, 'nosql');
|
||||
$result = false;
|
||||
@@ -955,11 +955,11 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
|
||||
FROM locks
|
||||
WHERE path = '%s' ";
|
||||
$query = $filter->preventSqlInjection($query, array($path));
|
||||
$res = mysql_query($query);
|
||||
$res = mysqli_query($query);
|
||||
|
||||
if ($res) {
|
||||
$row = mysql_fetch_array($res);
|
||||
mysql_free_result($res);
|
||||
$row = mysqli_fetch_array($res);
|
||||
mysqli_free_result($res);
|
||||
|
||||
if ($row) {
|
||||
$result = array("type" => "write", "scope" => $row["exclusivelock"] ? "exclusive" : "shared", "depth" => 0, "owner" => $row['owner'], "token" => $row['token'], "expires" => $row['expires']
|
||||
@@ -982,4 +982,3 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ require_once 'classes/model/om/BaseAdditionalTables.php';
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
|
||||
function validateType ($value, $type)
|
||||
function validateType($value, $type)
|
||||
{
|
||||
switch ($type) {
|
||||
case 'INTEGER':
|
||||
@@ -35,16 +35,16 @@ function validateType ($value, $type)
|
||||
$posPoint = ($posPoint === false) ? 0 : $posPoint;
|
||||
|
||||
if ($pos > $posPoint) {
|
||||
$value2 = substr($value, $pos+1);
|
||||
$value2 = substr($value, $pos + 1);
|
||||
$value1 = substr($value, 0, $pos);
|
||||
$value1 = str_replace(".", "", $value1);
|
||||
$value = $value1.".".$value2;
|
||||
$value = $value1 . "." . $value2;
|
||||
} else {
|
||||
if($posPoint) {
|
||||
$value2 = substr($value, $posPoint+1);
|
||||
if ($posPoint) {
|
||||
$value2 = substr($value, $posPoint + 1);
|
||||
$value1 = substr($value, 0, $posPoint);
|
||||
$value1 = str_replace(",", "", $value1);
|
||||
$value = $value1.".".$value2;
|
||||
$value = $value1 . "." . $value2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -138,6 +138,14 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
return $this->primaryKeys;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load Additional table by name
|
||||
*
|
||||
* @param string $name
|
||||
* @return array
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function loadByName($name)
|
||||
{
|
||||
try {
|
||||
@@ -146,12 +154,6 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_NAME);
|
||||
$oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_CLASS_NAME);
|
||||
$oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_DESCRIPTION);
|
||||
//DEPRECATED! $oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_LOG_INSERT);
|
||||
// $oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_LOG_UPDATE);
|
||||
// $oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_LOG_DELETE);
|
||||
// $oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_LOG_SELECT);
|
||||
// $oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_MAX_LENGTH);
|
||||
// $oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_SDW_AUTO_DELETE);
|
||||
$oCriteria->addSelectColumn(AdditionalTablesPeer::ADD_TAB_PLG_UID);
|
||||
$oCriteria->addSelectColumn(AdditionalTablesPeer::DBS_UID);
|
||||
$oCriteria->addSelectColumn(AdditionalTablesPeer::PRO_UID);
|
||||
@@ -203,7 +205,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
'SHD_DATE' => date('Y-m-d H:i:s')));
|
||||
*/
|
||||
|
||||
$addTabDescription = ($aData["ADD_TAB_DESCRIPTION"] != "")? ", Description: " . $aData["ADD_TAB_DESCRIPTION"] : ".";
|
||||
$addTabDescription = ($aData["ADD_TAB_DESCRIPTION"] != "") ? ", Description: " . $aData["ADD_TAB_DESCRIPTION"] : ".";
|
||||
G::auditLog("CreatePmtable", "PM Table Name: " . $aData['ADD_TAB_NAME'] . $addTabDescription);
|
||||
return $aData['ADD_TAB_UID'];
|
||||
} else {
|
||||
@@ -232,7 +234,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$iResult = $oAdditionalTables->save();
|
||||
$oConnection->commit();
|
||||
$addTabDescription = (isset($aData["ADD_TAB_DESCRIPTION"]) && $aData["ADD_TAB_DESCRIPTION"] != "") ? ", Description: " . $aData["ADD_TAB_DESCRIPTION"] : ".";
|
||||
G::auditLog("UpdatePmtable", "PM Table Name: " . ( isset($aData['ADD_TAB_NAME']) ? $aData['ADD_TAB_NAME'] : $aData['ADD_TAB_TAG']) . $addTabDescription . ", PM Table ID: (" . $aData['ADD_TAB_UID'] . ") ");
|
||||
G::auditLog("UpdatePmtable", "PM Table Name: " . (isset($aData['ADD_TAB_NAME']) ? $aData['ADD_TAB_NAME'] : $aData['ADD_TAB_TAG']) . $addTabDescription . ", PM Table ID: (" . $aData['ADD_TAB_UID'] . ") ");
|
||||
} else {
|
||||
$sMessage = '';
|
||||
$aValidationFailures = $oAdditionalTables->getValidationFailures();
|
||||
@@ -274,9 +276,9 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
/**
|
||||
* verify if Additional Table row specified in [sUID] exists.
|
||||
*
|
||||
* @param string $sUID the uid of the additional table
|
||||
* @param string $sUID the uid of the additional table
|
||||
*/
|
||||
public function exists ($sUID)
|
||||
public function exists($sUID)
|
||||
{
|
||||
$con = Propel::getConnection(AdditionalTablesPeer::DATABASE_NAME);
|
||||
|
||||
@@ -334,8 +336,8 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$aData = $this->load($sUID, true);
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
|
||||
if (file_exists($sPath . $sClassName . '.php')) {
|
||||
require_once $sPath . $sClassName . '.php';
|
||||
@@ -347,7 +349,6 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$con = Propel::getConnection($aData['DBS_UID']);
|
||||
$oCriteria = new Criteria($aData['DBS_UID']);
|
||||
|
||||
//eval('$oCriteria->addSelectColumn(' . $sClassPeerName . '::PM_UNIQUE_ID);');
|
||||
eval('$oCriteria->addSelectColumn("\'1\' AS DUMMY");');
|
||||
foreach ($aData['FIELDS'] as $aField) {
|
||||
eval('$oCriteria->addSelectColumn(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ');');
|
||||
@@ -357,18 +358,13 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
case 'VARCHAR':
|
||||
case 'TEXT':
|
||||
case 'DATE':
|
||||
// if($aField['FLD_NULL']!=1)
|
||||
// eval('$oCriteria->add(' . $sClassPeerName . '::' . $aField['FLD_NAME']
|
||||
//. ', \'(<28>_<EFBFBD>_<EFBFBD>)\', Criteria::NOT_EQUAL);');
|
||||
break;
|
||||
case 'INT';
|
||||
case 'INT':
|
||||
case 'FLOAT':
|
||||
eval('$oCriteria->add(' . $sClassPeerName . '::' . $aField['FLD_NAME']
|
||||
.', -99999999999, Criteria::NOT_EQUAL);');
|
||||
. ', -99999999999, Criteria::NOT_EQUAL);');
|
||||
break;
|
||||
}
|
||||
//eval('$oCriteria->addAscendingOrderByColumn(' . $sClassPeerName . '::PM_UNIQUE_ID);');
|
||||
//echo $oCriteria->toString();
|
||||
return $oCriteria;
|
||||
} catch (Exception $oError) {
|
||||
throw($oError);
|
||||
@@ -385,8 +381,8 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$aData['DBS_UID'] = $aData['DBS_UID'] ? $aData['DBS_UID'] : 'workflow';
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
|
||||
if (file_exists($sPath . $sClassName . '.php')) {
|
||||
require_once $sPath . $sClassName . '.php';
|
||||
@@ -398,7 +394,6 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$con = Propel::getConnection($aData['DBS_UID']);
|
||||
$oCriteria = new Criteria($aData['DBS_UID']);
|
||||
|
||||
//eval('$oCriteria->addSelectColumn("\'1\' AS DUMMY");');
|
||||
|
||||
/*
|
||||
* data type:
|
||||
@@ -414,13 +409,9 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$field = '$oCriteria->addAsColumn("' . $aField['FLD_NAME'] . '", "round(" . ' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ' . ", ' . ($aField['FLD_TYPE'] == 'DOUBLE' ? '8' : '2') . ')");';
|
||||
}
|
||||
eval($field);
|
||||
/*if ($aField['FLD_KEY'] == '1') {
|
||||
eval('$oCriteria->addAscendingOrderByColumn('. $sClassPeerName . '::' . $aField['FLD_NAME'] . ');');
|
||||
}*/
|
||||
}
|
||||
}
|
||||
$oCriteriaCount = clone $oCriteria;
|
||||
//$count = $sClassPeerName::doCount($oCriteria);
|
||||
eval('$count = ' . $sClassPeerName . '::doCount($oCriteria);');
|
||||
|
||||
if ($filter != '' && is_string($filter)) {
|
||||
@@ -428,17 +419,17 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$closure = '';
|
||||
$types = array('INTEGER', 'BIGINT', 'SMALLINT', 'TINYINT', 'DECIMAL', 'DOUBLE', 'FLOAT', 'REAL');
|
||||
foreach ($aData['FIELDS'] as $aField) {
|
||||
if (($appUid == false && $aField['FLD_NAME'] != 'APP_UID') || ($appUid == true)) {
|
||||
if (in_array($aField['FLD_TYPE'], $types)) {
|
||||
if (is_numeric($filter)) {
|
||||
$stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "' . $filter . '", Criteria::EQUAL)' . $closure . ';';
|
||||
$closure = '->addOr($a)';
|
||||
}
|
||||
} else {
|
||||
$stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "%' . $filter . '%", Criteria::LIKE)' . $closure . ';';
|
||||
$closure = '->addOr($a)';
|
||||
}
|
||||
}
|
||||
if (($appUid == false && $aField['FLD_NAME'] != 'APP_UID') || ($appUid == true)) {
|
||||
if (in_array($aField['FLD_TYPE'], $types)) {
|
||||
if (is_numeric($filter)) {
|
||||
$stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "' . $filter . '", Criteria::EQUAL)' . $closure . ';';
|
||||
$closure = '->addOr($a)';
|
||||
}
|
||||
} else {
|
||||
$stringOr = $stringOr . '$a = $oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', "%' . $filter . '%", Criteria::LIKE)' . $closure . ';';
|
||||
$closure = '->addOr($a)';
|
||||
}
|
||||
}
|
||||
}
|
||||
$stringOr = $stringOr . '$oCriteria->add($a);';
|
||||
eval($stringOr);
|
||||
@@ -488,7 +479,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
eval('$count = ' . $sClassPeerName . '::doCount($oCriteria);');
|
||||
}
|
||||
|
||||
$filter = new InputFilter();
|
||||
$filter = new InputFilter();
|
||||
$sClassPeerName = $filter->validateInput($sClassPeerName);
|
||||
|
||||
if (isset($_POST['sort'])) {
|
||||
@@ -515,11 +506,10 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
if (isset($start)) {
|
||||
$oCriteria->setOffset($start);
|
||||
}
|
||||
//$rs = $sClassPeerName::doSelectRS($oCriteria);
|
||||
eval('$rs = ' . $sClassPeerName . '::doSelectRS($oCriteria);');
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$rows = Array();
|
||||
$rows = array();
|
||||
while ($rs->next()) {
|
||||
$rows[] = $rs->getRow();
|
||||
}
|
||||
@@ -533,8 +523,8 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$aData = $this->load($sUID, true);
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
|
||||
if (file_exists($sPath . $sClassName . '.php')) {
|
||||
return $sClassName;
|
||||
@@ -552,9 +542,8 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$aData = $this->load($sUID, true);
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
// $oConnection = Propel::getConnection(FieldsPeer::DATABASE_NAME);
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
$oConnection = Propel::getConnection($aData['DBS_UID']);
|
||||
$stmt = $oConnection->createStatement();
|
||||
require_once $sPath . $sClassName . '.php';
|
||||
@@ -606,8 +595,8 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$aData = $this->load($sUID, true);
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
require_once $sPath . $sClassName . '.php';
|
||||
$sKeys = '';
|
||||
foreach ($aKeys as $sName => $vValue) {
|
||||
@@ -616,7 +605,6 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
}
|
||||
$sKeys = substr($sKeys, 0, -1);
|
||||
eval('$oClass = ' . $sClassName . 'Peer::retrieveByPK(' . $sKeys . ');');
|
||||
//eval('$oClass = ' . $sClassName . 'Peer::retrieveByPK($sPMUID);');
|
||||
if (!is_null($oClass)) {
|
||||
return $oClass->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
} else {
|
||||
@@ -630,12 +618,11 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
public function updateDataInTable($sUID, $aFields)
|
||||
{
|
||||
try {
|
||||
//$sPMUID = $aFields['PM_UNIQUE_ID'];
|
||||
$aData = $this->load($sUID, true);
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
$oConnection = Propel::getConnection(FieldsPeer::DATABASE_NAME);
|
||||
require_once $sPath . $sClassName . '.php';
|
||||
$sKeys = '';
|
||||
@@ -648,7 +635,6 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
}
|
||||
$sKeys = substr($sKeys, 0, -1);
|
||||
eval('$oClass = ' . $sClassName . 'Peer::retrieveByPK(' . $sKeys . ');');
|
||||
//eval('$oClass = ' . $sClassName . 'Peer::retrieveByPK($sPMUID);');
|
||||
if (!is_null($oClass)) {
|
||||
$oClass->fromArray($aFields, BasePeer::TYPE_FIELDNAME);
|
||||
if ($oClass->validate()) {
|
||||
@@ -681,8 +667,8 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$aData = $this->load($sUID, true);
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
$oConnection = Propel::getConnection(FieldsPeer::DATABASE_NAME);
|
||||
require_once $sPath . $sClassName . '.php';
|
||||
$sKeys = '';
|
||||
@@ -692,7 +678,6 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
}
|
||||
$sKeys = substr($sKeys, 0, -1);
|
||||
eval('$oClass = ' . $sClassName . 'Peer::retrieveByPK(' . $sKeys . ');');
|
||||
//eval('$oClass = ' . $sClassName . 'Peer::retrieveByPK($sPMUID);');
|
||||
if (!is_null($oClass)) {
|
||||
if ($oClass->validate()) {
|
||||
$oConnection->begin();
|
||||
@@ -728,8 +713,8 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$this->classPeerName = $this->className . 'Peer';
|
||||
|
||||
if (!file_exists(PATH_WORKSPACE . 'classes/' . $this->className . '.php')) {
|
||||
throw new Exception( "ERROR: " . PATH_WORKSPACE . 'classes/' . $this->className . '.php'
|
||||
. " class file doesn't exit!");
|
||||
throw new Exception("ERROR: " . PATH_WORKSPACE . 'classes/' . $this->className . '.php'
|
||||
. " class file doesn't exit!");
|
||||
}
|
||||
|
||||
require_once PATH_WORKSPACE . 'classes/' . $this->className . '.php';
|
||||
@@ -765,7 +750,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
case 'FLOAT':
|
||||
case 'DOUBLE':
|
||||
case 'INTEGER':
|
||||
$fieldTypes[] = array($rowfield['FLD_NAME']=>$rowfield['FLD_TYPE']);
|
||||
$fieldTypes[] = array($rowfield['FLD_NAME'] => $rowfield['FLD_TYPE']);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -780,11 +765,11 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$j = key($dValue);
|
||||
$dValue = (is_array($dValue[$j])) ? $dValue : $dValue[$j];
|
||||
}
|
||||
if (!is_array($dValue)) {
|
||||
if (is_string($dValue)) {
|
||||
foreach ($fieldTypes as $key => $fieldType) {
|
||||
foreach ($fieldType as $name => $theType) {
|
||||
if (strtoupper($dKey) == $name) {
|
||||
$caseData[$dKey] = validateType ($dValue, $theType);
|
||||
$caseData[$dKey] = validateType($dValue, $theType);
|
||||
unset($name);
|
||||
}
|
||||
}
|
||||
@@ -795,11 +780,13 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
}
|
||||
} else {
|
||||
// grids
|
||||
foreach ($caseData[$dKey] as $dIndex => $dRow) {
|
||||
if (is_array($dRow)) {
|
||||
foreach ($dRow as $k => $v) {
|
||||
if (trim($v) === '') {
|
||||
$caseData[$dKey][$dIndex][$k] = null;
|
||||
if (is_array($caseData[$dKey])) {
|
||||
foreach ($caseData[$dKey] as $dIndex => $dRow) {
|
||||
if (is_array($dRow)) {
|
||||
foreach ($dRow as $k => $v) {
|
||||
if (is_string($v) && trim($v) === '') {
|
||||
$caseData[$dKey][$dIndex][$k] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -807,7 +794,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
}
|
||||
}
|
||||
|
||||
if ($type == 'GRID') {
|
||||
if ($type === 'GRID') {
|
||||
list($gridName, $gridUid) = explode('-', $gridKey);
|
||||
$gridData = isset($caseData[$gridName]) ? $caseData[$gridName] : array();
|
||||
|
||||
@@ -883,7 +870,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
case 'FLOAT':
|
||||
case 'DOUBLE':
|
||||
case 'INTEGER':
|
||||
$fieldTypes[] = array($rowfield['FLD_NAME']=>$rowfield['FLD_TYPE']);
|
||||
$fieldTypes[] = array($rowfield['FLD_NAME'] => $rowfield['FLD_TYPE']);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -904,8 +891,8 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
}
|
||||
foreach ($fieldTypes as $key => $fieldType) {
|
||||
foreach ($fieldType as $name => $type) {
|
||||
if ( strtoupper ( $i) == $name) {
|
||||
$v = validateType ($v, $type);
|
||||
if (strtoupper($i) == $name) {
|
||||
$v = validateType($v, $type);
|
||||
unset($name);
|
||||
}
|
||||
}
|
||||
@@ -954,8 +941,8 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
foreach ($gridRow as $j => $v) {
|
||||
foreach ($fieldTypes as $key => $fieldType) {
|
||||
foreach ($fieldType as $name => $type) {
|
||||
if ( strtoupper ( $j) == $name) {
|
||||
$v = validateType ($v, $type);
|
||||
if (strtoupper($j) == $name) {
|
||||
$v = validateType($v, $type);
|
||||
unset($name);
|
||||
}
|
||||
}
|
||||
@@ -995,9 +982,9 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
if ($bWhitType) {
|
||||
if (!in_array($aRow['FLD_NAME'], $aImportedVars)) {
|
||||
$aImportedVars[] = $aRow['FLD_NAME'];
|
||||
$aVars[] = array('sFieldName' => $aRow['FLD_NAME'],
|
||||
'sFieldDynName' => $aRow['FLD_DYN_NAME'],
|
||||
'sType' => $aRow['FLD_TYPE']);
|
||||
$aVars[] = array('sFieldName' => $aRow['FLD_NAME'],
|
||||
'sFieldDynName' => $aRow['FLD_DYN_NAME'],
|
||||
'sType' => $aRow['FLD_TYPE']);
|
||||
}
|
||||
} else {
|
||||
$aVars[] = $aRow['FLD_NAME'];
|
||||
@@ -1034,7 +1021,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
}
|
||||
return $reportTables;
|
||||
}
|
||||
|
||||
|
||||
public function getAll($start = 0, $limit = 20, $filter = '', $process = null)
|
||||
{
|
||||
$oCriteria = new Criteria('workflow');
|
||||
@@ -1058,8 +1045,9 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
|
||||
if ($filter != '' && is_string($filter)) {
|
||||
$oCriteria->add(
|
||||
$oCriteria->getNewCriterion(AdditionalTablesPeer::ADD_TAB_NAME, '%' . $filter . '%', Criteria::LIKE)->addOr(
|
||||
$oCriteria->getNewCriterion(AdditionalTablesPeer::ADD_TAB_DESCRIPTION, '%' . $filter . '%', Criteria::LIKE))
|
||||
$oCriteria->getNewCriterion(AdditionalTablesPeer::ADD_TAB_NAME, '%' . $filter . '%', Criteria::LIKE)->addOr(
|
||||
$oCriteria->getNewCriterion(AdditionalTablesPeer::ADD_TAB_DESCRIPTION, '%' . $filter . '%', Criteria::LIKE)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1082,8 +1070,8 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$oDataset = AdditionalTablesPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$addTables = Array();
|
||||
$proUids = Array();
|
||||
$addTables = array();
|
||||
$proUids = array();
|
||||
|
||||
while ($oDataset->next()) {
|
||||
$row = $oDataset->getRow();
|
||||
@@ -1095,12 +1083,11 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
}
|
||||
|
||||
//process details will have the info about the processes
|
||||
$procDetails = Array();
|
||||
$procDetails = array();
|
||||
|
||||
if (count($proUids) > 0) {
|
||||
//now get the labels for all process, using an array of Uids,
|
||||
$c = new Criteria('workflow');
|
||||
//$c->add ( ContentPeer::CON_CATEGORY, 'PRO_TITLE', Criteria::EQUAL );
|
||||
$c->add(ProcessPeer::PRO_UID, $proUids, Criteria::IN);
|
||||
$dt = ProcessPeer::doSelectRS($c);
|
||||
$dt->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
@@ -1143,17 +1130,17 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
array_unshift($aFields, $aUID); */
|
||||
$aTypes = array(
|
||||
'VARCHAR' => 'string',
|
||||
'TEXT' => 'string',
|
||||
'DATE' => 'int',
|
||||
'INT' => 'int',
|
||||
'FLOAT' => 'double'
|
||||
'TEXT' => 'string',
|
||||
'DATE' => 'int',
|
||||
'INT' => 'int',
|
||||
'FLOAT' => 'double'
|
||||
);
|
||||
$aCreoleTypes = array(
|
||||
'VARCHAR' => 'VARCHAR',
|
||||
'TEXT' => 'LONGVARCHAR',
|
||||
'DATE' => 'TIMESTAMP',
|
||||
'INT' => 'INTEGER',
|
||||
'FLOAT' => 'DOUBLE'
|
||||
'TEXT' => 'LONGVARCHAR',
|
||||
'DATE' => 'TIMESTAMP',
|
||||
'INT' => 'INTEGER',
|
||||
'FLOAT' => 'DOUBLE'
|
||||
);
|
||||
if ($sClassName == '') {
|
||||
$sClassName = $this->getPHPName($sTableName);
|
||||
@@ -1177,8 +1164,8 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$aData['GUID'] = $sAddTabUid;
|
||||
|
||||
$aData['firstColumn'] = isset($aFields[0])
|
||||
? strtoupper($aFields[0]['FLD_NAME'])
|
||||
: ($aFields[1]['FLD_NAME']);
|
||||
? strtoupper($aFields[0]['FLD_NAME'])
|
||||
: ($aFields[1]['FLD_NAME']);
|
||||
$aData['totalColumns'] = count($aFields);
|
||||
$aData['useIdGenerator'] = 'false';
|
||||
$oTP1 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'Table.tpl');
|
||||
@@ -1205,14 +1192,14 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
'creoleType' => $aCreoleTypes[$aField['FLD_TYPE']],
|
||||
'notNull' => ($aField['FLD_NULL'] == 'on' ? 'true' : 'false'),
|
||||
'size' => (($aField['FLD_TYPE'] == 'VARCHAR')
|
||||
|| ($aField['FLD_TYPE'] == 'INT')
|
||||
|| ($aField['FLD_TYPE'] == 'FLOAT') ? $aField['FLD_SIZE'] : 'null'),
|
||||
|| ($aField['FLD_TYPE'] == 'INT')
|
||||
|| ($aField['FLD_TYPE'] == 'FLOAT') ? $aField['FLD_SIZE'] : 'null'),
|
||||
'var' => strtolower($aField['FLD_NAME']),
|
||||
'attribute' => (($aField['FLD_TYPE'] == 'VARCHAR')
|
||||
|| ($aField['FLD_TYPE'] == 'TEXT')
|
||||
|| ($aField['FLD_TYPE'] == 'DATE')
|
||||
? '$' . strtolower($aField['FLD_NAME']) . " = ''"
|
||||
: '$' . strtolower($aField['FLD_NAME']) . ' = 0'),
|
||||
|| ($aField['FLD_TYPE'] == 'TEXT')
|
||||
|| ($aField['FLD_TYPE'] == 'DATE')
|
||||
? '$' . strtolower($aField['FLD_NAME']) . " = ''"
|
||||
: '$' . strtolower($aField['FLD_NAME']) . ' = 0'),
|
||||
'index' => $i,
|
||||
);
|
||||
if ($aField['FLD_TYPE'] == 'DATE') {
|
||||
@@ -1327,7 +1314,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$i++;
|
||||
}
|
||||
$oTP3 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'map'
|
||||
. PATH_SEP . 'TableMapBuilder.tpl');
|
||||
. PATH_SEP . 'TableMapBuilder.tpl');
|
||||
$oTP3->prepare();
|
||||
$oTP3->assignGlobal($aData);
|
||||
foreach ($aPKs as $iIndex => $aColumn) {
|
||||
@@ -1346,7 +1333,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
}
|
||||
}
|
||||
file_put_contents($sPath . PATH_SEP . 'map' . PATH_SEP . $sClassName
|
||||
. 'MapBuilder.php', $oTP3->getOutputContent());
|
||||
. 'MapBuilder.php', $oTP3->getOutputContent());
|
||||
$oTP4 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'om' . PATH_SEP . 'BaseTable.tpl');
|
||||
$oTP4->prepare();
|
||||
switch (count($aPKs)) {
|
||||
@@ -1363,9 +1350,9 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$aData['setPrimaryKeyFunction'] = '';
|
||||
foreach ($aPKs as $iIndex => $aColumn) {
|
||||
$aData['getPrimaryKeyFunction'] .= '$pks[' . $iIndex . '] = $this->get'
|
||||
. $aColumn['phpName'] . '();' . "\n";
|
||||
. $aColumn['phpName'] . '();' . "\n";
|
||||
$aData['setPrimaryKeyFunction'] .= '$this->set' . $aColumn['phpName']
|
||||
. '($keys[' . $iIndex . ']);' . "\n";
|
||||
. '($keys[' . $iIndex . ']);' . "\n";
|
||||
}
|
||||
$aData['getPrimaryKeyFunction'] .= 'return $pks;' . "\n";
|
||||
break;
|
||||
@@ -1443,7 +1430,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
}
|
||||
}
|
||||
file_put_contents($sPath . PATH_SEP . 'om' . PATH_SEP . 'Base'
|
||||
. $sClassName . '.php', $oTP4->getOutputContent());
|
||||
. $sClassName . '.php', $oTP4->getOutputContent());
|
||||
$oTP5 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'om' . PATH_SEP . 'BaseTablePeer.tpl');
|
||||
$oTP5->prepare();
|
||||
$sKeys = '';
|
||||
@@ -1526,10 +1513,9 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
}
|
||||
}
|
||||
file_put_contents($sPath . PATH_SEP . 'om' . PATH_SEP . 'Base'
|
||||
. $sClassName . 'Peer.php', $oTP5->getOutputContent());
|
||||
. $sClassName . 'Peer.php', $oTP5->getOutputContent());
|
||||
} catch (Exception $oError) {
|
||||
throw($oError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ class AddonsManager extends BaseAddonsManager
|
||||
$filter = new InputFilter();
|
||||
$requiredPath = PATH_PLUGINS . $this->getAddonName() . ".php";
|
||||
$requiredPath = $filter->validateInput($requiredPath, 'path');
|
||||
require_once ($requiredPath);
|
||||
require_once($requiredPath);
|
||||
|
||||
if ($enable) {
|
||||
$oPluginRegistry->enablePlugin($this->getAddonName());
|
||||
@@ -223,7 +223,7 @@ class AddonsManager extends BaseAddonsManager
|
||||
}
|
||||
|
||||
///////
|
||||
$licenseManager = &PmLicenseManager::getSingleton();
|
||||
$licenseManager = PmLicenseManager::getSingleton();
|
||||
$activeLicense = $licenseManager->getActiveLicense();
|
||||
|
||||
$data = $data . "Content-Disposition: form-data; name=\"licenseFile\"; filename=\"" . $licenseManager->file . "\"\n";
|
||||
@@ -474,18 +474,18 @@ class AddonsManager extends BaseAddonsManager
|
||||
*/
|
||||
public function update($data)
|
||||
{
|
||||
$con = Propel::getConnection( AddonsManagerPeer::DATABASE_NAME );
|
||||
$con = Propel::getConnection(AddonsManagerPeer::DATABASE_NAME);
|
||||
try {
|
||||
$con->begin();
|
||||
$this->setNew( false );
|
||||
$this->fromArray( $data, BasePeer::TYPE_FIELDNAME );
|
||||
$this->setNew(false);
|
||||
$this->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($this->validate()) {
|
||||
$result = $this->save();
|
||||
$con->commit();
|
||||
return $result;
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw (new Exception( "Failed Validation in class " . get_class( $this ) . "." ));
|
||||
throw (new Exception("Failed Validation in class " . get_class($this) . "."));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
|
||||
@@ -35,7 +35,7 @@ class AddonsStore extends BaseAddonsStore
|
||||
public static function checkLicenseStore()
|
||||
{
|
||||
//getting the licenseManager....
|
||||
$licenseManager = &PmLicenseManager::getSingleton();
|
||||
$licenseManager = PmLicenseManager::getSingleton();
|
||||
|
||||
if (isset($licenseManager->id)) {
|
||||
//Remove any license store that is not the active license
|
||||
@@ -72,7 +72,7 @@ class AddonsStore extends BaseAddonsStore
|
||||
|
||||
AddonsStore::checkLicenseStore();
|
||||
|
||||
$licenseManager = &PmLicenseManager::getSingleton(); //Getting the licenseManager
|
||||
$licenseManager = PmLicenseManager::getSingleton(); //Getting the licenseManager
|
||||
|
||||
$result["store_errors"] = array();
|
||||
list($stores, $errors) = AddonsStore::updateAll(false, $type);
|
||||
@@ -155,7 +155,7 @@ class AddonsStore extends BaseAddonsStore
|
||||
if ($addon->getAddonId() == "enterprise" && $status== 'ready') {
|
||||
$status = 'installed';
|
||||
}
|
||||
if ($status == 'minus-circle' ) {
|
||||
if ($status == 'minus-circle') {
|
||||
$status = "available";
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ class AddonsStore extends BaseAddonsStore
|
||||
|
||||
AddonsStore::checkLicenseStore();
|
||||
|
||||
$licenseManager = &PmLicenseManager::getSingleton(); //Getting the licenseManager
|
||||
$licenseManager = PmLicenseManager::getSingleton(); //Getting the licenseManager
|
||||
|
||||
$result["store_errors"] = array();
|
||||
list($stores, $errors) = AddonsStore::updateAll(false);
|
||||
@@ -256,7 +256,7 @@ class AddonsStore extends BaseAddonsStore
|
||||
if ($addon->getAddonId() == "enterprise" && $status== 'ready') {
|
||||
$status = 'installed';
|
||||
}
|
||||
if ($status == 'minus-circle' ) {
|
||||
if ($status == 'minus-circle') {
|
||||
$status = "available";
|
||||
}
|
||||
|
||||
@@ -358,7 +358,7 @@ class AddonsStore extends BaseAddonsStore
|
||||
$aPluginsPP = unserialize(trim(file_get_contents(PATH_DATA_SITE . 'ee')));
|
||||
}
|
||||
|
||||
$pmLicenseManagerO = &PmLicenseManager::getSingleton();
|
||||
$pmLicenseManagerO = PmLicenseManager::getSingleton();
|
||||
$localPlugins = array();
|
||||
|
||||
if ($type == 'plugin') {
|
||||
@@ -436,7 +436,7 @@ class AddonsStore extends BaseAddonsStore
|
||||
if (is_array($list)) {
|
||||
foreach ($list['addons'] as $key => $feature) {
|
||||
$addon = new AddonsManager();
|
||||
if($addon->exists($feature['name'],$feature['guid'])){
|
||||
if ($addon->exists($feature['name'], $feature['guid'])) {
|
||||
$arrayData['ADDON_ID'] = $feature['name'];
|
||||
$arrayData['STORE_ID'] = $feature['guid'];
|
||||
$arrayData['ADDON_NAME'] = $feature['name'];
|
||||
|
||||
@@ -10,7 +10,7 @@ class AppAssignSelfServiceValue extends BaseAppAssignSelfServiceValue
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
public function create($applicationUid, $delIndex, array $arrayData, $dataVariable)
|
||||
public function create($applicationUid, $delIndex, array $arrayData, $dataVariable = [])
|
||||
{
|
||||
try {
|
||||
$cnn = Propel::getConnection(AppAssignSelfServiceValuePeer::DATABASE_NAME);
|
||||
|
||||
@@ -1,12 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* AppDelay.php
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
|
||||
//require_once 'classes/model/om/BaseAppDelay.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'APP_DELAY' table.
|
||||
*
|
||||
@@ -20,93 +12,112 @@
|
||||
*/
|
||||
class AppDelay extends BaseAppDelay
|
||||
{
|
||||
const APP_TYPE_CANCEL = 'CANCEL';
|
||||
const APP_TYPE_UNCANCEL = 'UNCANCEL';
|
||||
const APP_TYPE_PAUSE = 'PAUSE';
|
||||
|
||||
/**
|
||||
* Create the application delay registry
|
||||
* @param array $aData
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @return string
|
||||
* @throws Exception
|
||||
**/
|
||||
public function create($aData)
|
||||
public function create($data)
|
||||
{
|
||||
$oConnection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
|
||||
$connection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
|
||||
try {
|
||||
if ( isset ( $aData['APP_DELAY_UID'] ) && $aData['APP_DELAY_UID']== '' ) {
|
||||
unset ( $aData['APP_DELAY_UID'] );
|
||||
if (isset ($data['APP_DELAY_UID']) && $data['APP_DELAY_UID'] == '') {
|
||||
unset ($data['APP_DELAY_UID']);
|
||||
}
|
||||
if ( !isset ( $aData['APP_DELAY_UID'] ) ) {
|
||||
$aData['APP_DELAY_UID'] = G::generateUniqueID();
|
||||
if (!isset ($data['APP_DELAY_UID'])) {
|
||||
$data['APP_DELAY_UID'] = G::generateUniqueID();
|
||||
}
|
||||
$oAppDelay = new AppDelay();
|
||||
$oAppDelay->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||
if ($oAppDelay->validate()) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oAppDelay->save();
|
||||
$oConnection->commit();
|
||||
return $aData['APP_DELAY_UID'];
|
||||
$appDelay = new AppDelay();
|
||||
$appDelay->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($appDelay->validate()) {
|
||||
$connection->begin();
|
||||
$result = $appDelay->save();
|
||||
$connection->commit();
|
||||
|
||||
return $data['APP_DELAY_UID'];
|
||||
} else {
|
||||
$sMessage = '';
|
||||
$aValidationFailures = $oAppDelay->getValidationFailures();
|
||||
foreach ($aValidationFailures as $oValidationFailure) {
|
||||
$sMessage .= $oValidationFailure->getMessage() . '<br />';
|
||||
$message = '';
|
||||
$validationFailures = $appDelay->getValidationFailures();
|
||||
foreach ($validationFailures as $validationFailure) {
|
||||
$message .= $validationFailure->getMessage() . '<br />';
|
||||
}
|
||||
throw(new Exception('The registry cannot be created!<br />'.$sMessage));
|
||||
throw(new Exception('The registry cannot be created!<br />' . $message));
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw($oError);
|
||||
} catch (Exception $error) {
|
||||
$connection->rollback();
|
||||
throw($error);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the application delay registry
|
||||
* @param array $aData
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @return string
|
||||
* @throws Exception
|
||||
**/
|
||||
public function update($aData)
|
||||
public function update($data)
|
||||
{
|
||||
$oConnection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
|
||||
$connection = Propel::getConnection(AppDelayPeer::DATABASE_NAME);
|
||||
try {
|
||||
$oAppDelay = AppDelayPeer::retrieveByPK($aData['APP_DELAY_UID']);
|
||||
if (!is_null($oAppDelay)) {
|
||||
$oAppDelay->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||
if ($oAppDelay->validate()) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oAppDelay->save();
|
||||
$oConnection->commit();
|
||||
return $iResult;
|
||||
$appDelay = AppDelayPeer::retrieveByPK($data['APP_DELAY_UID']);
|
||||
if (!is_null($appDelay)) {
|
||||
$appDelay->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
if ($appDelay->validate()) {
|
||||
$connection->begin();
|
||||
$result = $appDelay->save();
|
||||
$connection->commit();
|
||||
return $result;
|
||||
} else {
|
||||
$sMessage = '';
|
||||
$aValidationFailures = $oAppDelay->getValidationFailures();
|
||||
foreach ($aValidationFailures as $oValidationFailure) {
|
||||
$sMessage .= $oValidationFailure->getMessage() . '<br />';
|
||||
$message = '';
|
||||
$validationFailures = $appDelay->getValidationFailures();
|
||||
foreach ($validationFailures as $validationFailure) {
|
||||
$message .= $validationFailure->getMessage() . '<br />';
|
||||
}
|
||||
throw(new Exception('The registry cannot be updated!<br />'.$sMessage));
|
||||
throw(new Exception('The registry cannot be updated!<br />'.$message));
|
||||
}
|
||||
} else {
|
||||
throw(new Exception('This row doesn\'t exist!'));
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
throw($oError);
|
||||
} catch (Exception $error) {
|
||||
$connection->rollback();
|
||||
throw($error);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Review if the application in a specific index is paused
|
||||
*
|
||||
* @param string $appUid
|
||||
* @param integer $delIndex
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function isPaused($appUid, $delIndex)
|
||||
{
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(AppDelayPeer::APP_UID, $appUid);
|
||||
$oCriteria->add(AppDelayPeer::APP_DEL_INDEX, $delIndex);
|
||||
$oCriteria->add(AppDelayPeer::APP_TYPE, 'PAUSE');
|
||||
$oCriteria->add(
|
||||
$oCriteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, 0, Criteria::EQUAL)->addOr(
|
||||
$oCriteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, null, Criteria::ISNULL))
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(AppDelayPeer::APP_UID, $appUid);
|
||||
$criteria->add(AppDelayPeer::APP_DEL_INDEX, $delIndex);
|
||||
$criteria->add(AppDelayPeer::APP_TYPE, AppDelay::APP_TYPE_PAUSE);
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, 0, Criteria::EQUAL)->addOr(
|
||||
$criteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, null, Criteria::ISNULL))
|
||||
);
|
||||
|
||||
$oDataset = AppDelayPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
$dataset = AppDelayPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$row = $dataset->getRow();
|
||||
|
||||
if ($aRow) {
|
||||
if ($row) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -117,20 +128,116 @@ class AppDelay extends BaseAppDelay
|
||||
* Verify if the case is Paused or cancelled
|
||||
*
|
||||
* @param $appUid string
|
||||
* @return $oDataset array
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public function getCasesCancelOrPaused($appUid)
|
||||
{
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( AppDelayPeer::APP_UID );
|
||||
$oCriteria->addSelectColumn( AppDelayPeer::APP_DEL_INDEX );
|
||||
$oCriteria->add( AppDelayPeer::APP_UID, $appUid );
|
||||
$oCriteria->add( $oCriteria->getNewCriterion( AppDelayPeer::APP_TYPE, 'PAUSE' )->addOr( $oCriteria->getNewCriterion( AppDelayPeer::APP_TYPE, 'CANCEL' ) ) );
|
||||
$oCriteria->addAscendingOrderByColumn( AppDelayPeer::APP_ENABLE_ACTION_DATE );
|
||||
$oDataset = AppDelayPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
return $oDataset->getRow();
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->addSelectColumn(AppDelayPeer::APP_UID);
|
||||
$criteria->addSelectColumn(AppDelayPeer::APP_DEL_INDEX);
|
||||
$criteria->add(AppDelayPeer::APP_UID, $appUid);
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion(AppDelayPeer::APP_TYPE, AppDelay::APP_TYPE_PAUSE)->addOr(
|
||||
$criteria->getNewCriterion(AppDelayPeer::APP_TYPE, AppDelay::APP_TYPE_CANCEL)
|
||||
)
|
||||
);
|
||||
$criteria->addAscendingOrderByColumn(AppDelayPeer::APP_ENABLE_ACTION_DATE);
|
||||
$dataset = AppDelayPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
|
||||
return $dataset->getRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the row for the appDelay to be inserted
|
||||
*
|
||||
* @param string $proUid
|
||||
* @param integer $proId
|
||||
* @param string $appUid
|
||||
* @param integer $appNumber
|
||||
* @param integer $appThreadIndex
|
||||
* @param integer $delIndex
|
||||
* @param string $appType
|
||||
* @param string $appStatus
|
||||
* @param string $usrUid
|
||||
* @param integer $usrId
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function buildAppDelayRow(
|
||||
$proUid = '',
|
||||
$proId = 0,
|
||||
$appUid = '',
|
||||
$appNumber = 0,
|
||||
$appThreadIndex = 0,
|
||||
$delIndex = 0,
|
||||
$appType = 'CANCEL',
|
||||
$appStatus = 'CANCELLED',
|
||||
$usrUid = '',
|
||||
$usrId = 0
|
||||
) {
|
||||
$row = [];
|
||||
$row['PRO_UID'] = $proUid;
|
||||
$row['APP_UID'] = $appUid;
|
||||
$row['APP_NUMBER'] = $appNumber;
|
||||
$row['APP_THREAD_INDEX'] = $appThreadIndex;
|
||||
$row['APP_DEL_INDEX'] = $delIndex;
|
||||
$row['APP_TYPE'] = $appType;
|
||||
$row['APP_STATUS'] = $appStatus;
|
||||
$row['APP_ENABLE_ACTION_DATE'] = date('Y-m-d H:i:s');
|
||||
|
||||
//Load the PRO_ID if does not exit
|
||||
if (empty($proId) || $proId === 0) {
|
||||
$u = new Process();
|
||||
$proId = $u->load($proUid)['PRO_ID'];
|
||||
}
|
||||
|
||||
$row['PRO_ID'] = $proId;
|
||||
//Define the user that execute the insert
|
||||
if (empty($usrUid)) {
|
||||
global $RBAC;
|
||||
$usrUid = $RBAC->aUserInfo['USER_INFO']['USR_UID'];
|
||||
$u = new Users();
|
||||
$usrId = $u->load($usrUid)['USR_ID'];
|
||||
}
|
||||
$row['APP_DELEGATION_USER'] = $usrUid;
|
||||
$row['APP_ENABLE_ACTION_USER'] = $usrUid;
|
||||
$row['APP_DELEGATION_USER_ID'] = $usrId;
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all threads with the status canceled
|
||||
*
|
||||
* @param string $appUid
|
||||
* @param string $status
|
||||
*
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getThreadByStatus($appUid, $status)
|
||||
{
|
||||
try {
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(AppDelayPeer::APP_UID, $appUid);
|
||||
$criteria->add(AppDelayPeer::APP_STATUS, $status);
|
||||
$criteria->addDescendingOrderByColumn(AppDelayPeer::APP_ENABLE_ACTION_DATE);
|
||||
$dataset = AppDelayPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$result = [];
|
||||
while ($row = $dataset->getRow()) {
|
||||
$result[] = $row;
|
||||
$dataset->next();
|
||||
}
|
||||
|
||||
return $result;
|
||||
} catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,26 +100,26 @@ class AppDelegation extends BaseAppDelegation
|
||||
* @param $isSubprocess is a subprocess inside a process?
|
||||
* @return delegation index of the application delegation.
|
||||
*/
|
||||
public function createAppDelegation ($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $iPriority = 3, $isSubprocess = false, $sPrevious = -1, $sNextTasParam = null, $flagControl = false, $flagControlMulInstance = false, $delPrevious = 0, $appNumber = 0, $taskId = 0, $userId = 0, $proId = 0)
|
||||
public function createAppDelegation($sProUid, $sAppUid, $sTasUid, $sUsrUid, $sAppThread, $iPriority = 3, $isSubprocess = false, $sPrevious = -1, $sNextTasParam = null, $flagControl = false, $flagControlMulInstance = false, $delPrevious = 0, $appNumber = 0, $taskId = 0, $userId = 0, $proId = 0)
|
||||
{
|
||||
if (! isset( $sProUid ) || strlen( $sProUid ) == 0) {
|
||||
throw (new Exception( 'Column "PRO_UID" cannot be null.' ));
|
||||
if (! isset($sProUid) || strlen($sProUid) == 0) {
|
||||
throw (new Exception('Column "PRO_UID" cannot be null.'));
|
||||
}
|
||||
|
||||
if (! isset( $sAppUid ) || strlen( $sAppUid ) == 0) {
|
||||
throw (new Exception( 'Column "APP_UID" cannot be null.' ));
|
||||
if (! isset($sAppUid) || strlen($sAppUid) == 0) {
|
||||
throw (new Exception('Column "APP_UID" cannot be null.'));
|
||||
}
|
||||
|
||||
if (! isset( $sTasUid ) || strlen( $sTasUid ) == 0) {
|
||||
throw (new Exception( 'Column "TAS_UID" cannot be null.' ));
|
||||
if (! isset($sTasUid) || strlen($sTasUid) == 0) {
|
||||
throw (new Exception('Column "TAS_UID" cannot be null.'));
|
||||
}
|
||||
|
||||
if (! isset( $sUsrUid ) /*|| strlen($sUsrUid ) == 0*/ ) {
|
||||
throw (new Exception( 'Column "USR_UID" cannot be null.' ));
|
||||
if (! isset($sUsrUid) /*|| strlen($sUsrUid ) == 0*/) {
|
||||
throw (new Exception('Column "USR_UID" cannot be null.'));
|
||||
}
|
||||
|
||||
if (! isset( $sAppThread ) || strlen( $sAppThread ) == 0) {
|
||||
throw (new Exception( 'Column "APP_THREAD" cannot be null.' ));
|
||||
if (! isset($sAppThread) || strlen($sAppThread) == 0) {
|
||||
throw (new Exception('Column "APP_THREAD" cannot be null.'));
|
||||
}
|
||||
|
||||
$this->delegation_id = null;
|
||||
@@ -161,17 +161,17 @@ class AppDelegation extends BaseAppDelegation
|
||||
}
|
||||
}
|
||||
//Verify successors: parrallel submit in the same time
|
||||
if($flagControl){
|
||||
if ($flagControl) {
|
||||
$nextTaskUid = $sTasUid;
|
||||
$index = $this->getAllTasksBeforeSecJoin($nextTaskUid, $sAppUid, $delPreviousFather);
|
||||
if($this->createThread($index, $sAppUid)){
|
||||
if ($this->createThread($index, $sAppUid)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if($flagControlMulInstance){
|
||||
if ($flagControlMulInstance) {
|
||||
$nextTaskUid = $sTasUid;
|
||||
$index = $this->getAllTheardMultipleInstance($delPreviousFather, $sAppUid);
|
||||
if($this->createThread($index, $sAppUid, $sUsrUid)){
|
||||
if ($this->createThread($index, $sAppUid, $sUsrUid)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -181,18 +181,18 @@ class AppDelegation extends BaseAppDelegation
|
||||
$criteriaUpdate->add(AppDelegationPeer::DEL_LAST_INDEX, 0);
|
||||
BasePeer::doUpdate($criteria, $criteriaUpdate, Propel::getConnection('workflow'));
|
||||
|
||||
$this->setAppUid( $sAppUid );
|
||||
$this->setProUid( $sProUid );
|
||||
$this->setTasUid( $sTasUid );
|
||||
$this->setDelIndex( $delIndex );
|
||||
$this->setAppUid($sAppUid);
|
||||
$this->setProUid($sProUid);
|
||||
$this->setTasUid($sTasUid);
|
||||
$this->setDelIndex($delIndex);
|
||||
$this->setDelLastIndex(1);
|
||||
$this->setDelPrevious( $sPrevious == - 1 ? 0 : $sPrevious );
|
||||
$this->setUsrUid( $sUsrUid );
|
||||
$this->setDelType( 'NORMAL' );
|
||||
$this->setDelPriority( ($iPriority != '' ? $iPriority : '3') );
|
||||
$this->setDelThread( $sAppThread );
|
||||
$this->setDelThreadStatus( 'OPEN' );
|
||||
$this->setDelDelegateDate( 'now' );
|
||||
$this->setDelPrevious($sPrevious == - 1 ? 0 : $sPrevious);
|
||||
$this->setUsrUid($sUsrUid);
|
||||
$this->setDelType('NORMAL');
|
||||
$this->setDelPriority(($iPriority != '' ? $iPriority : '3'));
|
||||
$this->setDelThread($sAppThread);
|
||||
$this->setDelThreadStatus('OPEN');
|
||||
$this->setDelDelegateDate('now');
|
||||
$this->setAppNumber($appNumber);
|
||||
$this->setTasId($taskId);
|
||||
$this->setUsrId($userId);
|
||||
@@ -206,17 +206,17 @@ class AppDelegation extends BaseAppDelegation
|
||||
$this->setDelTaskDueDate($delTaskDueDate);
|
||||
$this->setDelRiskDate($delRiskDate);
|
||||
|
||||
if ((defined( "DEBUG_CALENDAR_LOG" )) && (DEBUG_CALENDAR_LOG)) {
|
||||
if ((defined("DEBUG_CALENDAR_LOG")) && (DEBUG_CALENDAR_LOG)) {
|
||||
//$this->setDelData( $delTaskDueDate['DUE_DATE_LOG'] ); // Log of actions made by Calendar Engine
|
||||
$this->setDelData( $delTaskDueDate );
|
||||
$this->setDelData($delTaskDueDate);
|
||||
} else {
|
||||
$this->setDelData( '' );
|
||||
$this->setDelData('');
|
||||
}
|
||||
|
||||
// this condition assures that an internal delegation like a subprocess dont have an initial date setted
|
||||
if ($delIndex == 1 && ! $isSubprocess) {
|
||||
//the first delegation, init date this should be now for draft applications, in other cases, should be null.
|
||||
$this->setDelInitDate( 'now' );
|
||||
$this->setDelInitDate('now');
|
||||
}
|
||||
|
||||
if ($this->validate()) {
|
||||
@@ -233,13 +233,13 @@ class AppDelegation extends BaseAppDelegation
|
||||
foreach ($validationFailuresArray as $objValidationFailure) {
|
||||
$msg .= $objValidationFailure->getMessage() . "<br/>";
|
||||
}
|
||||
throw (new Exception( 'Failed Data validation. ' . $msg ));
|
||||
throw (new Exception('Failed Data validation. ' . $msg));
|
||||
}
|
||||
|
||||
$delIndex = $this->getDelIndex();
|
||||
|
||||
// Hook for the trigger PM_CREATE_NEW_DELEGATION
|
||||
if (defined( 'PM_CREATE_NEW_DELEGATION' )) {
|
||||
if (defined('PM_CREATE_NEW_DELEGATION')) {
|
||||
$bpmn = new \ProcessMaker\Project\Bpmn();
|
||||
$flagActionsByEmail = true;
|
||||
|
||||
@@ -268,7 +268,7 @@ class AppDelegation extends BaseAppDelegation
|
||||
if ($resultAbe->next()) {
|
||||
$dataAbe = $resultAbe->getRow();
|
||||
$flagActionsByEmail = false;
|
||||
if($dataAbe['ABE_TYPE']!='' && $data->USR_UID!=''){
|
||||
if ($dataAbe['ABE_TYPE']!='' && $data->USR_UID!='') {
|
||||
$actionsByEmail = new ActionsByEmailCoreClass();
|
||||
$actionsByEmail->sendActionsByEmail($data, $dataAbe);
|
||||
}
|
||||
@@ -278,10 +278,10 @@ class AppDelegation extends BaseAppDelegation
|
||||
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$licensedFeatures = &PMLicensedFeatures::getSingleton ();
|
||||
if ($licensedFeatures->verifyfeature ( '7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09' )) {
|
||||
try{
|
||||
$pmGoogle = new PmGoogleApi ();
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
|
||||
try {
|
||||
$pmGoogle = new PmGoogleApi();
|
||||
if ($pmGoogle->getServiceGmailStatus()) {
|
||||
$Pmgmail = new \ProcessMaker\BusinessModel\Pmgmail();
|
||||
$Pmgmail->gmailsForRouting($sUsrUid, $sTasUid, $sAppUid, $delIndex, $isSubprocess);
|
||||
@@ -331,58 +331,51 @@ class AppDelegation extends BaseAppDelegation
|
||||
}
|
||||
}
|
||||
|
||||
/* Load the Application Delegation row specified in [app_id] column value.
|
||||
/**
|
||||
* Load the Application Delegation row specified in [app_id] column value.
|
||||
*
|
||||
* @param string $appUid the uid of the application
|
||||
* @param integer $index the index of the delegation
|
||||
*
|
||||
* @param string $AppUid the uid of the application
|
||||
* @param string $index the index of the delegation
|
||||
* @return array $Fields the fields
|
||||
*/
|
||||
|
||||
public function LoadParallel ($AppUid, $index = "")
|
||||
public function LoadParallel($appUid, $index = 0)
|
||||
{
|
||||
$aCases = array();
|
||||
$cases = [];
|
||||
|
||||
$c = new Criteria( 'workflow' );
|
||||
$c->addSelectColumn( AppDelegationPeer::APP_UID );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_INDEX );
|
||||
$c->addSelectColumn( AppDelegationPeer::PRO_UID );
|
||||
$c->addSelectColumn( AppDelegationPeer::TAS_UID );
|
||||
$c->addSelectColumn( AppDelegationPeer::USR_UID );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_DELEGATE_DATE );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_INIT_DATE );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_TASK_DUE_DATE );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_FINISH_DATE );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_PREVIOUS );
|
||||
$c = new Criteria('workflow');
|
||||
$c->addSelectColumn(AppDelegationPeer::APP_UID);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$c->addSelectColumn(AppDelegationPeer::PRO_UID);
|
||||
$c->addSelectColumn(AppDelegationPeer::TAS_UID);
|
||||
$c->addSelectColumn(AppDelegationPeer::USR_UID);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_THREAD);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_PREVIOUS);
|
||||
$c->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN');
|
||||
$c->add(AppDelegationPeer::APP_UID, $appUid);
|
||||
|
||||
$c->add( AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN' );
|
||||
$c->add( AppDelegationPeer::APP_UID, $AppUid );
|
||||
if(!empty($index)) {
|
||||
$c->add( AppDelegationPeer::DEL_INDEX, $index );
|
||||
if ($index > 0) {
|
||||
$c->add(AppDelegationPeer::DEL_INDEX, $index);
|
||||
}
|
||||
$c->addDescendingOrderByColumn( AppDelegationPeer::DEL_INDEX );
|
||||
$rs = AppDelegationPeer::doSelectRS( $c );
|
||||
$row= $rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$c->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$rs = AppDelegationPeer::doSelectRS($c);
|
||||
$row = $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
|
||||
while (is_array($row)) {
|
||||
$case = array();
|
||||
$case['TAS_UID'] = $row['TAS_UID'];
|
||||
$case['USR_UID'] = $row['USR_UID'];
|
||||
$case['DEL_INDEX'] = $row['DEL_INDEX'];
|
||||
$case['TAS_UID'] = $row['TAS_UID'];
|
||||
$case['DEL_DELEGATE_DATE'] = $row['DEL_DELEGATE_DATE'];
|
||||
$case['DEL_INIT_DATE'] = $row['DEL_INIT_DATE'];
|
||||
$case['DEL_TASK_DUE_DATE'] = $row['DEL_TASK_DUE_DATE'];
|
||||
$case['DEL_FINISH_DATE'] = $row['DEL_FINISH_DATE'];
|
||||
$case['DEL_PREVIOUS'] = $row['DEL_PREVIOUS'];
|
||||
$aCases[] = $case;
|
||||
$cases[] = $row;
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
}
|
||||
|
||||
return $aCases;
|
||||
return $cases;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -393,14 +386,14 @@ class AppDelegation extends BaseAppDelegation
|
||||
*
|
||||
*/
|
||||
|
||||
public function update ($aData)
|
||||
public function update($aData)
|
||||
{
|
||||
$con = Propel::getConnection( AppDelegationPeer::DATABASE_NAME );
|
||||
$con = Propel::getConnection(AppDelegationPeer::DATABASE_NAME);
|
||||
try {
|
||||
$con->begin();
|
||||
$oApp = AppDelegationPeer::retrieveByPK( $aData['APP_UID'], $aData['DEL_INDEX'] );
|
||||
if (is_object( $oApp ) && get_class( $oApp ) == 'AppDelegation') {
|
||||
$oApp->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||
$oApp = AppDelegationPeer::retrieveByPK($aData['APP_UID'], $aData['DEL_INDEX']);
|
||||
if (is_object($oApp) && get_class($oApp) == 'AppDelegation') {
|
||||
$oApp->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||
if ($oApp->validate()) {
|
||||
$res = $oApp->save();
|
||||
$con->commit();
|
||||
@@ -411,24 +404,24 @@ class AppDelegation extends BaseAppDelegation
|
||||
$msg .= $objValidationFailure->getMessage() . "<br/>";
|
||||
}
|
||||
|
||||
throw (new PropelException( 'The row cannot be created!', new PropelException( $msg ) ));
|
||||
throw (new PropelException('The row cannot be created!', new PropelException($msg)));
|
||||
}
|
||||
} else {
|
||||
$con->rollback();
|
||||
throw (new Exception( "This AppDelegation row doesn't exist!" ));
|
||||
throw (new Exception("This AppDelegation row doesn't exist!"));
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
public function remove ($sApplicationUID, $iDelegationIndex)
|
||||
public function remove($sApplicationUID, $iDelegationIndex)
|
||||
{
|
||||
$oConnection = Propel::getConnection( StepTriggerPeer::DATABASE_NAME );
|
||||
$oConnection = Propel::getConnection(StepTriggerPeer::DATABASE_NAME);
|
||||
try {
|
||||
$oConnection->begin();
|
||||
$oApp = AppDelegationPeer::retrieveByPK( $sApplicationUID, $iDelegationIndex );
|
||||
if (is_object( $oApp ) && get_class( $oApp ) == 'AppDelegation') {
|
||||
$oApp = AppDelegationPeer::retrieveByPK($sApplicationUID, $iDelegationIndex);
|
||||
if (is_object($oApp) && get_class($oApp) == 'AppDelegation') {
|
||||
$result = $oApp->delete();
|
||||
}
|
||||
$oConnection->commit();
|
||||
@@ -441,20 +434,20 @@ class AppDelegation extends BaseAppDelegation
|
||||
|
||||
// TasTypeDay = 1 => working days
|
||||
// TasTypeDay = 2 => calendar days
|
||||
public function calculateDueDate ($sNextTasParam)
|
||||
public function calculateDueDate($sNextTasParam)
|
||||
{
|
||||
//Get Task properties
|
||||
$task = TaskPeer::retrieveByPK( $this->getTasUid() );
|
||||
$task = TaskPeer::retrieveByPK($this->getTasUid());
|
||||
|
||||
$aData = array();
|
||||
$aData['TAS_UID'] = $this->getTasUid();
|
||||
//Added to allow User defined Timing Control at Run time from Derivation screen
|
||||
if (isset( $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] ) && $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] == 'true') {
|
||||
if (isset($sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY']) && $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] == 'true') {
|
||||
$aData['TAS_DURATION'] = $sNextTasParam['NEXT_TASK']['TAS_DURATION'];
|
||||
$aData['TAS_TIMEUNIT'] = $sNextTasParam['NEXT_TASK']['TAS_TIMEUNIT'];
|
||||
$aData['TAS_TYPE_DAY'] = $sNextTasParam['NEXT_TASK']['TAS_TYPE_DAY'];
|
||||
|
||||
if (isset( $sNextTasParam['NEXT_TASK']['TAS_CALENDAR'] ) && $sNextTasParam['NEXT_TASK']['TAS_CALENDAR'] != '') {
|
||||
if (isset($sNextTasParam['NEXT_TASK']['TAS_CALENDAR']) && $sNextTasParam['NEXT_TASK']['TAS_CALENDAR'] != '') {
|
||||
$aCalendarUID = $sNextTasParam['NEXT_TASK']['TAS_CALENDAR'];
|
||||
} else {
|
||||
$aCalendarUID = '';
|
||||
@@ -462,9 +455,9 @@ class AppDelegation extends BaseAppDelegation
|
||||
|
||||
//Updating the task Table , so that user will see updated values in the assign screen in consequent cases
|
||||
$oTask = new Task();
|
||||
$oTask->update( $aData );
|
||||
$oTask->update($aData);
|
||||
} else {
|
||||
if (is_null( $task )) {
|
||||
if (is_null($task)) {
|
||||
return 0;
|
||||
}
|
||||
$aData['TAS_DURATION'] = $task->getTasDuration();
|
||||
@@ -496,13 +489,12 @@ class AppDelegation extends BaseAppDelegation
|
||||
public function calculateRiskDate($dueDate, $risk)
|
||||
{
|
||||
try {
|
||||
|
||||
$data = array();
|
||||
if (isset( $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] ) && $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] == 'true') {
|
||||
if (isset($sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY']) && $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] == 'true') {
|
||||
$data['TAS_DURATION'] = $sNextTasParam['NEXT_TASK']['TAS_DURATION'];
|
||||
$data['TAS_TIMEUNIT'] = $sNextTasParam['NEXT_TASK']['TAS_TIMEUNIT'];
|
||||
} else {
|
||||
$task = TaskPeer::retrieveByPK( $this->getTasUid() );
|
||||
$task = TaskPeer::retrieveByPK($this->getTasUid());
|
||||
$data['TAS_DURATION'] = $task->getTasDuration();
|
||||
$data['TAS_TIMEUNIT'] = $task->getTasTimeUnit();
|
||||
}
|
||||
@@ -529,47 +521,47 @@ class AppDelegation extends BaseAppDelegation
|
||||
}
|
||||
}
|
||||
|
||||
public function getDiffDate ($date1, $date2)
|
||||
public function getDiffDate($date1, $date2)
|
||||
{
|
||||
return ($date1 - $date2) / (24 * 60 * 60); //days
|
||||
return ($date1 - $date2) / 3600;
|
||||
}
|
||||
|
||||
//usually this function is called when routing in the flow, so by default cron =0
|
||||
public function calculateDuration($cron = 0)
|
||||
{
|
||||
$this->writeFileIfCalledFromCronForCalculateDuration($cron);
|
||||
$this->patchDataWithValuesForCalculateDuration();
|
||||
$rs = $this->recordSetForCalculateDuration();
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
$i = 0;
|
||||
$calendar = new Calendar();
|
||||
$now = new DateTime();
|
||||
while (is_array ($row)) {
|
||||
$oAppDel = AppDelegationPeer::retrieveByPk( $row['APP_UID'], $row['DEL_INDEX'] );
|
||||
//usually this function is called when routing in the flow, so by default cron =0
|
||||
public function calculateDuration($cron = 0)
|
||||
{
|
||||
$this->writeFileIfCalledFromCronForCalculateDuration($cron);
|
||||
$this->patchDataWithValuesForCalculateDuration();
|
||||
$rs = $this->recordSetForCalculateDuration();
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
$i = 0;
|
||||
$calendar = new Calendar();
|
||||
$now = new DateTime();
|
||||
while (is_array($row)) {
|
||||
$oAppDel = AppDelegationPeer::retrieveByPk($row['APP_UID'], $row['DEL_INDEX']);
|
||||
$calendar = new Calendar();
|
||||
$calendar->getCalendar($row['USR_UID'], $row['PRO_UID'], $row['TAS_UID']);
|
||||
$calData = $calendar->getCalendarData();
|
||||
$calculatedValues = $this->getValuesToStoreForCalculateDuration($row, $calendar, $calData, $now);
|
||||
|
||||
$oAppDel->setDelStarted($calculatedValues['isStarted']);
|
||||
$oAppDel->setDelFinished($calculatedValues['isFinished']);
|
||||
$oAppDel->setDelDelayed($calculatedValues['isDelayed']);
|
||||
$oAppDel->setDelQueueDuration($calculatedValues['queueTime']);
|
||||
$oAppDel->setDelDelayDuration($calculatedValues['delayTime']);
|
||||
$oAppDel->setDelDuration($calculatedValues['durationTime']);
|
||||
$oAppDel->setAppOverduePercentage($calculatedValues['percentDelay']);
|
||||
$RES = $oAppDel->save();
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
}
|
||||
}
|
||||
$oAppDel->setDelStarted($calculatedValues['isStarted']);
|
||||
$oAppDel->setDelFinished($calculatedValues['isFinished']);
|
||||
$oAppDel->setDelDelayed($calculatedValues['isDelayed']);
|
||||
$oAppDel->setDelQueueDuration($calculatedValues['queueTime']);
|
||||
$oAppDel->setDelDelayDuration($calculatedValues['delayTime']);
|
||||
$oAppDel->setDelDuration($calculatedValues['durationTime']);
|
||||
$oAppDel->setAppOverduePercentage($calculatedValues['percentDelay']);
|
||||
$RES = $oAppDel->save();
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
}
|
||||
}
|
||||
|
||||
public function getValuesToStoreForCalculateDuration($row, $calendar, $calData, $nowDate)
|
||||
{
|
||||
public function getValuesToStoreForCalculateDuration($row, $calendar, $calData, $nowDate)
|
||||
{
|
||||
$rowValues = $this->completeRowDataForCalculateDuration($row, $nowDate);
|
||||
return Array(
|
||||
return array(
|
||||
'isStarted' => $this->createDateFromString($row['DEL_INIT_DATE']) != null ? 1 : 0,
|
||||
'isFinished' => $this->createDateFromString($row['DEL_FINISH_DATE']) != null ? 1: 0,
|
||||
'isDelayed' => $this->calculateDelayTime($calendar, $calData, $rowValues) > 0 ? 1 : 0,
|
||||
@@ -577,11 +569,11 @@ class AppDelegation extends BaseAppDelegation
|
||||
'delayTime' => $this->calculateDelayTime($calendar, $calData, $rowValues),
|
||||
'durationTime' => $this->calculateNetProcessingTime($calendar, $calData, $rowValues),
|
||||
'percentDelay' => $this->calculateOverduePercentage($calendar, $calData, $rowValues)
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
private function calculateOverduePercentage($calendar, $calData, $rowValues)
|
||||
{
|
||||
private function calculateOverduePercentage($calendar, $calData, $rowValues)
|
||||
{
|
||||
if ($rowValues['fTaskDuration'] == 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -591,203 +583,210 @@ class AppDelegation extends BaseAppDelegation
|
||||
: $rowValues['fTaskDuration'] / 24;
|
||||
|
||||
return $this->calculateDelayTime($calendar, $calData, $rowValues) * 100/ $taskTime;
|
||||
}
|
||||
}
|
||||
|
||||
//time in days from init or delegate date to finish or today's date
|
||||
private function calculateNetProcessingTime($calendar, $calData, $rowValues)
|
||||
{
|
||||
$initDateForCalc = $this->selectDate ($rowValues['dInitDate'], $rowValues['dDelegateDate'], 'max');
|
||||
$endDateForCalc = $this->selectDate ($rowValues['dFinishDate'], $rowValues['dNow'], 'min');
|
||||
return $calendar->dashCalculateDurationWithCalendar(
|
||||
$initDateForCalc->format('Y-m-d H:i:s'),
|
||||
$endDateForCalc->format('Y-m-d H:i:s'),
|
||||
$calData)/(24*60*60);
|
||||
}
|
||||
//time in days from init or delegate date to finish or today's date
|
||||
private function calculateNetProcessingTime($calendar, $calData, $rowValues)
|
||||
{
|
||||
$initDateForCalc = $this->selectDate($rowValues['dInitDate'], $rowValues['dDelegateDate'], 'max');
|
||||
$endDateForCalc = $this->selectDate($rowValues['dFinishDate'], $rowValues['dNow'], 'min');
|
||||
return $calendar->dashCalculateDurationWithCalendar(
|
||||
$initDateForCalc->format('Y-m-d H:i:s'),
|
||||
$endDateForCalc->format('Y-m-d H:i:s'),
|
||||
$calData
|
||||
)/(24*60*60);
|
||||
}
|
||||
|
||||
//time in days from delegate date to init date
|
||||
private function calculateQueueTime($calendar, $calData, $rowValues)
|
||||
{
|
||||
$initDateForCalc = $rowValues['dDelegateDate'];
|
||||
$endDateForCalc = $this->selectDate ($rowValues['dInitDate'], $rowValues['dNow'], 'min');
|
||||
return $calendar->dashCalculateDurationWithCalendar(
|
||||
$initDateForCalc->format('Y-m-d H:i:s'),
|
||||
$endDateForCalc->format('Y-m-d H:i:s'),
|
||||
$calData)/(24*60*60);
|
||||
}
|
||||
//time in days from delegate date to init date
|
||||
private function calculateQueueTime($calendar, $calData, $rowValues)
|
||||
{
|
||||
$initDateForCalc = $rowValues['dDelegateDate'];
|
||||
$endDateForCalc = $this->selectDate($rowValues['dInitDate'], $rowValues['dNow'], 'min');
|
||||
return $calendar->dashCalculateDurationWithCalendar(
|
||||
$initDateForCalc->format('Y-m-d H:i:s'),
|
||||
$endDateForCalc->format('Y-m-d H:i:s'),
|
||||
$calData
|
||||
)/(24*60*60);
|
||||
}
|
||||
|
||||
//time in days from due date to finish or today date
|
||||
private function calculateDelayTime($calendar, $calData, $rowValues)
|
||||
{
|
||||
$initDateForCalc = $this->selectDate($rowValues['dDueDate'], $rowValues['dDelegateDate'], 'max');
|
||||
$endDateForCalc = $this->selectDate ($rowValues['dFinishDate'], $rowValues['dNow'], 'min');
|
||||
return $calendar->dashCalculateDurationWithCalendar(
|
||||
$initDateForCalc->format('Y-m-d H:i:s'),
|
||||
$endDateForCalc->format('Y-m-d H:i:s'),
|
||||
$calData)/(24*60*60);
|
||||
}
|
||||
//time in days from due date to finish or today date
|
||||
private function calculateDelayTime($calendar, $calData, $rowValues)
|
||||
{
|
||||
$initDateForCalc = $this->selectDate($rowValues['dDueDate'], $rowValues['dDelegateDate'], 'max');
|
||||
$endDateForCalc = $this->selectDate($rowValues['dFinishDate'], $rowValues['dNow'], 'min');
|
||||
return $calendar->dashCalculateDurationWithCalendar(
|
||||
$initDateForCalc->format('Y-m-d H:i:s'),
|
||||
$endDateForCalc->format('Y-m-d H:i:s'),
|
||||
$calData
|
||||
)/(24*60*60);
|
||||
}
|
||||
|
||||
//to avoid aplying many times the same conversions and functions the row data
|
||||
//is used to create dates as DateTime objects and other fields are stracted also,
|
||||
//so the array returned will work as a "context" object for the rest of the functions.
|
||||
private function completeRowDataForCalculateDuration($row, $nowDate)
|
||||
{
|
||||
return Array(
|
||||
'dDelegateDate' => $this->createDateFromString ($row['DEL_DELEGATE_DATE']),
|
||||
'dInitDate' => $this->createDateFromString ($row['DEL_INIT_DATE']),
|
||||
'dDueDate' => $this->createDateFromString ($row['DEL_TASK_DUE_DATE']),
|
||||
'dFinishDate' => $this->createDateFromString ($row['DEL_FINISH_DATE']),
|
||||
'fTaskDuration' => $row['TAS_DURATION'] * 1.0,
|
||||
'cTaskDurationUnit' => $row['TAS_TIMEUNIT'],
|
||||
'dNow' => $nowDate,
|
||||
'row' => $row
|
||||
);
|
||||
}
|
||||
private function completeRowDataForCalculateDuration($row, $nowDate)
|
||||
{
|
||||
return array(
|
||||
'dDelegateDate' => $this->createDateFromString($row['DEL_DELEGATE_DATE']),
|
||||
'dInitDate' => $this->createDateFromString($row['DEL_INIT_DATE']),
|
||||
'dDueDate' => $this->createDateFromString($row['DEL_TASK_DUE_DATE']),
|
||||
'dFinishDate' => $this->createDateFromString($row['DEL_FINISH_DATE']),
|
||||
'fTaskDuration' => $row['TAS_DURATION'] * 1.0,
|
||||
'cTaskDurationUnit' => $row['TAS_TIMEUNIT'],
|
||||
'dNow' => $nowDate,
|
||||
'row' => $row
|
||||
);
|
||||
}
|
||||
|
||||
//by default min function returns de null value if one of the params is null
|
||||
//by default min function returns de null value if one of the params is null
|
||||
//to avoid that behaviour this function was created so the function returns the first
|
||||
//not null date or if both are not null the mix/max date
|
||||
//NOTE date1 and date2 are DateTime objects.
|
||||
private function selectDate($date1, $date2, $compareFunction)
|
||||
{
|
||||
if ($date1 == null)
|
||||
return $date2;
|
||||
private function selectDate($date1, $date2, $compareFunction)
|
||||
{
|
||||
if ($date1 == null) {
|
||||
return $date2;
|
||||
}
|
||||
|
||||
if ($date2 == null)
|
||||
return $date1;
|
||||
if ($date2 == null) {
|
||||
return $date1;
|
||||
}
|
||||
|
||||
return $compareFunction($date1, $date2);
|
||||
}
|
||||
return $compareFunction($date1, $date2);
|
||||
}
|
||||
|
||||
//Creates a DateTime object from a string. If the string is null or empty a null object is returned
|
||||
private function createDateFromString($stringDate) {
|
||||
if ($stringDate == null || $stringDate == '')
|
||||
return null;
|
||||
return new DateTime($stringDate);
|
||||
}
|
||||
|
||||
private function recordSetForCalculateDuration()
|
||||
{
|
||||
//walk in all rows with DEL_STARTED = 0 or DEL_FINISHED = 0
|
||||
$c = new Criteria( 'workflow' );
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn( AppDelegationPeer::APP_UID );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_INDEX );
|
||||
$c->addSelectColumn( AppDelegationPeer::USR_UID);
|
||||
$c->addSelectColumn( AppDelegationPeer::PRO_UID);
|
||||
$c->addSelectColumn( AppDelegationPeer::TAS_UID);
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_DELEGATE_DATE );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_INIT_DATE );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_TASK_DUE_DATE );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_FINISH_DATE );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_DURATION );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_QUEUE_DURATION );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_DELAY_DURATION );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_STARTED );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_FINISHED );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_DELAYED );
|
||||
$c->addSelectColumn( TaskPeer::TAS_DURATION );
|
||||
$c->addSelectColumn( TaskPeer::TAS_TIMEUNIT );
|
||||
$c->addSelectColumn( TaskPeer::TAS_TYPE_DAY );
|
||||
|
||||
$c->addJoin( AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN );
|
||||
$cton1 = $c->getNewCriterion( AppDelegationPeer::DEL_STARTED, 0 );
|
||||
$cton2 = $c->getNewCriterion( AppDelegationPeer::DEL_FINISHED, 0 );
|
||||
$cton1->addOR( $cton2 );
|
||||
$c->add( $cton1 );
|
||||
$rs = AppDelegationPeer::doSelectRS( $c );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
return $rs;
|
||||
}
|
||||
private function writeFileIfCalledFromCronForCalculateDuration($cron)
|
||||
{
|
||||
if ($cron == 1) {
|
||||
$arrayCron = unserialize( trim( @file_get_contents( PATH_DATA . "cron" ) ) );
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents( PATH_DATA . "cron", serialize( $arrayCron ) );
|
||||
}
|
||||
}
|
||||
|
||||
private function patchDataWithValuesForCalculateDuration()
|
||||
{
|
||||
//patch rows with initdate = null and finish_date
|
||||
$c = new Criteria();
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn( AppDelegationPeer::APP_UID );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_INDEX );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_DELEGATE_DATE );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_FINISH_DATE );
|
||||
$c->add( AppDelegationPeer::DEL_INIT_DATE, null, Criteria::ISNULL );
|
||||
$c->add( AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNOTNULL );
|
||||
//$c->add(AppDelegationPeer::DEL_INDEX, 1);
|
||||
|
||||
|
||||
$rs = AppDelegationPeer::doSelectRS( $c );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
|
||||
while (is_array( $row )) {
|
||||
$oAppDel = AppDelegationPeer::retrieveByPk( $row['APP_UID'], $row['DEL_INDEX'] );
|
||||
if (isset( $row['DEL_FINISH_DATE'] )) {
|
||||
$oAppDel->setDelInitDate( $row['DEL_FINISH_DATE'] );
|
||||
} else {
|
||||
$oAppDel->setDelInitDate( $row['DEL_INIT_DATE'] );
|
||||
}
|
||||
$oAppDel->save();
|
||||
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getLastDeleration ($APP_UID)
|
||||
private function createDateFromString($stringDate)
|
||||
{
|
||||
$c = new Criteria( 'workflow' );
|
||||
$c->addSelectColumn( AppDelegationPeer::APP_UID );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_INDEX );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_DELEGATE_DATE );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_INIT_DATE );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_TASK_DUE_DATE );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_FINISH_DATE );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_DURATION );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_QUEUE_DURATION );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_DELAY_DURATION );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_STARTED );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_FINISHED );
|
||||
$c->addSelectColumn( AppDelegationPeer::DEL_DELAYED );
|
||||
$c->addSelectColumn( AppDelegationPeer::USR_UID );
|
||||
if ($stringDate == null || $stringDate == '') {
|
||||
return null;
|
||||
}
|
||||
return new DateTime($stringDate);
|
||||
}
|
||||
|
||||
$c->add( AppDelegationPeer::APP_UID, $APP_UID );
|
||||
$c->addDescendingOrderByColumn( AppDelegationPeer::DEL_INDEX );
|
||||
$rs = AppDelegationPeer::doSelectRS( $c );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
private function recordSetForCalculateDuration()
|
||||
{
|
||||
//walk in all rows with DEL_STARTED = 0 or DEL_FINISHED = 0
|
||||
$c = new Criteria('workflow');
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn(AppDelegationPeer::APP_UID);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$c->addSelectColumn(AppDelegationPeer::USR_UID);
|
||||
$c->addSelectColumn(AppDelegationPeer::PRO_UID);
|
||||
$c->addSelectColumn(AppDelegationPeer::TAS_UID);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_DURATION);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_QUEUE_DURATION);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_DELAY_DURATION);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_STARTED);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_FINISHED);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_DELAYED);
|
||||
$c->addSelectColumn(TaskPeer::TAS_DURATION);
|
||||
$c->addSelectColumn(TaskPeer::TAS_TIMEUNIT);
|
||||
$c->addSelectColumn(TaskPeer::TAS_TYPE_DAY);
|
||||
|
||||
$c->addJoin(AppDelegationPeer::TAS_UID, TaskPeer::TAS_UID, Criteria::LEFT_JOIN);
|
||||
$cton1 = $c->getNewCriterion(AppDelegationPeer::DEL_STARTED, 0);
|
||||
$cton2 = $c->getNewCriterion(AppDelegationPeer::DEL_FINISHED, 0);
|
||||
$cton1->addOR($cton2);
|
||||
$c->add($cton1);
|
||||
$rs = AppDelegationPeer::doSelectRS($c);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
return $rs;
|
||||
}
|
||||
private function writeFileIfCalledFromCronForCalculateDuration($cron)
|
||||
{
|
||||
if ($cron == 1) {
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
}
|
||||
}
|
||||
|
||||
private function patchDataWithValuesForCalculateDuration()
|
||||
{
|
||||
//patch rows with initdate = null and finish_date
|
||||
$c = new Criteria();
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn(AppDelegationPeer::APP_UID);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
|
||||
$c->add(AppDelegationPeer::DEL_INIT_DATE, null, Criteria::ISNULL);
|
||||
$c->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNOTNULL);
|
||||
//$c->add(AppDelegationPeer::DEL_INDEX, 1);
|
||||
|
||||
|
||||
$rs = AppDelegationPeer::doSelectRS($c);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
|
||||
while (is_array($row)) {
|
||||
$oAppDel = AppDelegationPeer::retrieveByPk($row['APP_UID'], $row['DEL_INDEX']);
|
||||
if (isset($row['DEL_FINISH_DATE'])) {
|
||||
$oAppDel->setDelInitDate($row['DEL_FINISH_DATE']);
|
||||
} else {
|
||||
$oAppDel->setDelInitDate($row['DEL_INIT_DATE']);
|
||||
}
|
||||
$oAppDel->save();
|
||||
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getLastDeleration($APP_UID)
|
||||
{
|
||||
$c = new Criteria('workflow');
|
||||
$c->addSelectColumn(AppDelegationPeer::APP_UID);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_DELEGATE_DATE);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_FINISH_DATE);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_DURATION);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_QUEUE_DURATION);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_DELAY_DURATION);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_STARTED);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_FINISHED);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_DELAYED);
|
||||
$c->addSelectColumn(AppDelegationPeer::USR_UID);
|
||||
|
||||
$c->add(AppDelegationPeer::APP_UID, $APP_UID);
|
||||
$c->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$rs = AppDelegationPeer::doSelectRS($c);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
return $rs->getRow();
|
||||
}
|
||||
|
||||
public function getCurrentIndex ($appUid)
|
||||
public function getCurrentIndex($appUid)
|
||||
{
|
||||
$oCriteria = new Criteria();
|
||||
$oCriteria->addSelectColumn( AppDelegationPeer::DEL_INDEX );
|
||||
$oCriteria->add( AppDelegationPeer::APP_UID, $appUid );
|
||||
$oCriteria->addDescendingOrderByColumn( AppDelegationPeer::DEL_INDEX );
|
||||
$oRuleSet = AppDelegationPeer::doSelectRS( $oCriteria );
|
||||
$oRuleSet->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$oCriteria->add(AppDelegationPeer::APP_UID, $appUid);
|
||||
$oCriteria->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$oRuleSet = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oRuleSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oRuleSet->next();
|
||||
$data = $oRuleSet->getRow();
|
||||
return (int)$data['DEL_INDEX'];
|
||||
}
|
||||
|
||||
public function getCurrentTask ($appUid)
|
||||
public function getCurrentTask($appUid)
|
||||
{
|
||||
$oCriteria = new Criteria();
|
||||
$oCriteria->addSelectColumn( AppDelegationPeer::TAS_UID );
|
||||
$oCriteria->add( AppDelegationPeer::APP_UID, $appUid );
|
||||
$oCriteria->addDescendingOrderByColumn( AppDelegationPeer::DEL_INDEX );
|
||||
$oRuleSet = AppDelegationPeer::doSelectRS( $oCriteria );
|
||||
$oRuleSet->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::TAS_UID);
|
||||
$oCriteria->add(AppDelegationPeer::APP_UID, $appUid);
|
||||
$oCriteria->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$oRuleSet = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oRuleSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oRuleSet->next();
|
||||
$data = $oRuleSet->getRow();
|
||||
return $data['TAS_UID'];
|
||||
@@ -801,18 +800,16 @@ class AppDelegation extends BaseAppDelegation
|
||||
*/
|
||||
public function getCurrentUsers($appUid, $index)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn( AppDelegationPeer::USR_UID );
|
||||
$criteria->add( AppDelegationPeer::APP_UID, $appUid );
|
||||
$criteria->add( AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN' );
|
||||
$criteria->add( AppDelegationPeer::DEL_INDEX, $index );
|
||||
$dataResult = AppDelegationPeer::doSelectRS( $criteria );
|
||||
$dataResult->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
if($dataResult->next()) {
|
||||
return $dataResult->getRow();
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
$oCriteria = new Criteria();
|
||||
$oCriteria->addSelectColumn(AppDelegationPeer::USR_UID);
|
||||
$oCriteria->add(AppDelegationPeer::APP_UID, $appUid);
|
||||
$oCriteria->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN');
|
||||
$oCriteria->add(AppDelegationPeer::DEL_INDEX, $index);
|
||||
$oRuleSet = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oRuleSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oRuleSet->next();
|
||||
$data = $oRuleSet->getRow();
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -822,7 +819,7 @@ class AppDelegation extends BaseAppDelegation
|
||||
* @return array $Fields the fields
|
||||
*/
|
||||
|
||||
public function alreadyRouted ($appUid, $sDelIndex)
|
||||
public function alreadyRouted($appUid, $sDelIndex)
|
||||
{
|
||||
$c = new Criteria("workflow");
|
||||
$c->clearSelectColumns();
|
||||
@@ -832,7 +829,7 @@ class AppDelegation extends BaseAppDelegation
|
||||
$c->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNOTNULL);
|
||||
$result = AppDelegationPeer::doSelectRS($c);
|
||||
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
if($result->next()) {
|
||||
if ($result->next()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -858,7 +855,8 @@ class AppDelegation extends BaseAppDelegation
|
||||
* @param string $sAppUid
|
||||
* @return array $index
|
||||
*/
|
||||
public static function getAllTasksBeforeSecJoin($nextTaskUid, $sAppUid, $sDelPrevious, $threadStatus = ''){
|
||||
public static function getAllTasksBeforeSecJoin($nextTaskUid, $sAppUid, $sDelPrevious, $threadStatus = '')
|
||||
{
|
||||
$criteriaR = new Criteria('workflow');
|
||||
$criteriaR->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$criteriaR->addSelectColumn(AppDelegationPeer::DEL_PREVIOUS);
|
||||
@@ -874,7 +872,7 @@ class AppDelegation extends BaseAppDelegation
|
||||
$rsCriteriaR->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$index = array();
|
||||
$c = 0;
|
||||
while($rsCriteriaR->next()){
|
||||
while ($rsCriteriaR->next()) {
|
||||
$row = $rsCriteriaR->getRow();
|
||||
$index[$c++] = $row['DEL_INDEX'];
|
||||
}
|
||||
@@ -889,13 +887,14 @@ class AppDelegation extends BaseAppDelegation
|
||||
* @param string $sUsrUid
|
||||
* @return boolean $res
|
||||
*/
|
||||
public static function createThread($index, $sAppUid, $sUsrUid = ''){
|
||||
public static function createThread($index, $sAppUid, $sUsrUid = '')
|
||||
{
|
||||
$criteriaDel = new Criteria("workflow");
|
||||
$criteriaDel->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$criteriaDel->addSelectColumn(AppDelegationPeer::DEL_PREVIOUS);
|
||||
$criteriaDel->add(AppDelegationPeer::APP_UID, $sAppUid);
|
||||
$criteriaDel->add(AppDelegationPeer::DEL_PREVIOUS, $index, Criteria::IN);
|
||||
if($sUsrUid !== ''){
|
||||
if ($sUsrUid !== '') {
|
||||
$criteriaDel->add(AppDelegationPeer::USR_UID, $sUsrUid);
|
||||
}
|
||||
$criteriaDel = AppDelegationPeer::doSelectRS($criteriaDel);
|
||||
@@ -911,7 +910,8 @@ class AppDelegation extends BaseAppDelegation
|
||||
* @param string $sAppUid
|
||||
* @return array $index
|
||||
*/
|
||||
public static function getAllTheardMultipleInstance($sPrevious, $sAppUid){
|
||||
public static function getAllTheardMultipleInstance($sPrevious, $sAppUid)
|
||||
{
|
||||
$criteriaR = new Criteria('workflow');
|
||||
$criteriaR->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$criteriaR->add(AppDelegationPeer::APP_UID, $sAppUid, Criteria::EQUAL);
|
||||
@@ -920,7 +920,7 @@ class AppDelegation extends BaseAppDelegation
|
||||
$rsCriteriaR->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$index = array();
|
||||
$c = 0;
|
||||
while($rsCriteriaR->next()){
|
||||
while ($rsCriteriaR->next()) {
|
||||
$row = $rsCriteriaR->getRow();
|
||||
$index[$c++] = $row['DEL_INDEX'];
|
||||
}
|
||||
@@ -999,5 +999,51 @@ class AppDelegation extends BaseAppDelegation
|
||||
|
||||
return $proId;
|
||||
}
|
||||
/**
|
||||
* Get the last index by a specific status
|
||||
*
|
||||
* @param integer $appNumber
|
||||
* @param string $status
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public static function getLastIndexByStatus($appNumber, $status = 'OPEN')
|
||||
{
|
||||
$delIndex = 0;
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(AppDelegationPeer::APP_NUMBER, $appNumber);
|
||||
$criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, $status);
|
||||
$criteria->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$dataset = AppDelegationPeer::doSelectOne($criteria);
|
||||
if (!is_null($dataset)) {
|
||||
$delIndex = $dataset->getDelIndex();
|
||||
}
|
||||
|
||||
return $delIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the last index assigned to the user by a specific status
|
||||
*
|
||||
* @param integer $appNumber
|
||||
* @param integer $usrId
|
||||
* @param string $status
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public static function getLastIndexByUserAndStatus($appNumber, $usrId, $status = 'OPEN')
|
||||
{
|
||||
$delIndex = 0;
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(AppDelegationPeer::APP_NUMBER, $appNumber);
|
||||
$criteria->add(AppDelegationPeer::USR_ID, $usrId);
|
||||
$criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, $status);
|
||||
$criteria->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$dataset = AppDelegationPeer::doSelectOne($criteria);
|
||||
if (!is_null($dataset)) {
|
||||
$delIndex = $dataset->getDelIndex();
|
||||
}
|
||||
|
||||
return $delIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,13 +115,23 @@ class AppThread extends BaseAppThread
|
||||
}
|
||||
}
|
||||
|
||||
public function countStatus($appUid, $status='OPEN'){
|
||||
/**
|
||||
* Count the open threads
|
||||
*
|
||||
* @param string $appUid
|
||||
* @param string $status
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public static function countStatus($appUid, $status = 'OPEN')
|
||||
{
|
||||
$c = new Criteria('workflow');
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn( AppThreadPeer::APP_THREAD_PARENT );
|
||||
$c->add(AppThreadPeer::APP_UID, $appUid );
|
||||
$c->add(AppThreadPeer::APP_THREAD_STATUS , $status );
|
||||
$c->addSelectColumn(AppThreadPeer::APP_THREAD_PARENT);
|
||||
$c->add(AppThreadPeer::APP_UID, $appUid);
|
||||
$c->add(AppThreadPeer::APP_THREAD_STATUS, $status);
|
||||
$cant = AppThreadPeer::doCount($c);
|
||||
|
||||
return $cant;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,9 +46,11 @@ class Application extends BaseApplication
|
||||
* This value goes in the content table
|
||||
* @var string
|
||||
*/
|
||||
const APP_STATUS_CANCELLED = 'CANCELLED';
|
||||
const APP_STATUS_TODO = 'TO_DO';
|
||||
public static $app_status_values = ['DRAFT' => 1, 'TO_DO' => 2, 'COMPLETED' => 3, 'CANCELLED' => 4];
|
||||
protected $app_title_content = '';
|
||||
protected $app_description_content = '';
|
||||
public static $app_status_values = ['DRAFT' => 1, 'TO_DO' => 2, 'COMPLETED' => 3, 'CANCELLED' => 4];
|
||||
|
||||
/**
|
||||
* Get the [app_title_content] column value.
|
||||
|
||||
@@ -1,43 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Content.php
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
//require_once 'classes/model/om/BaseContent.php';
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'CONTENT' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
class Content extends BaseContent
|
||||
{
|
||||
public $langs;
|
||||
@@ -51,18 +15,18 @@ class Content extends BaseContent
|
||||
* @param string $sUID
|
||||
* @return variant
|
||||
*/
|
||||
public static function load ($ConCategory, $ConParent, $ConId, $ConLang)
|
||||
public static function load($ConCategory, $ConParent, $ConId, $ConLang)
|
||||
{
|
||||
$content = ContentPeer::retrieveByPK( $ConCategory, $ConParent, $ConId, $ConLang );
|
||||
if (is_null( $content )) {
|
||||
$content = ContentPeer::retrieveByPK($ConCategory, $ConParent, $ConId, $ConLang);
|
||||
if (is_null($content)) {
|
||||
//we dont find any value for this field and language in CONTENT table;
|
||||
$ConValue = Content::autoLoadSave( $ConCategory, $ConParent, $ConId, $ConLang );
|
||||
$ConValue = Content::autoLoadSave($ConCategory, $ConParent, $ConId, $ConLang);
|
||||
} else {
|
||||
//krumo($content);
|
||||
$ConValue = $content->getConValue();
|
||||
if ($ConValue == "") {
|
||||
//try to find a valid translation
|
||||
$ConValue = Content::autoLoadSave( $ConCategory, $ConParent, $ConId, $ConLang );
|
||||
$ConValue = Content::autoLoadSave($ConCategory, $ConParent, $ConId, $ConLang);
|
||||
}
|
||||
}
|
||||
return $ConValue;
|
||||
@@ -76,27 +40,27 @@ class Content extends BaseContent
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
public static function getDefaultContentLang ($ConCategory, $ConParent, $ConId, $destConLang)
|
||||
public static function getDefaultContentLang($ConCategory, $ConParent, $ConId, $destConLang)
|
||||
{
|
||||
$Criteria = new Criteria( 'workflow' );
|
||||
$Criteria = new Criteria('workflow');
|
||||
$Criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
|
||||
$Criteria->addSelectColumn( ContentPeer::CON_CATEGORY );
|
||||
$Criteria->addSelectColumn( ContentPeer::CON_PARENT );
|
||||
$Criteria->addSelectColumn( ContentPeer::CON_ID );
|
||||
$Criteria->addSelectColumn( ContentPeer::CON_LANG );
|
||||
$Criteria->addSelectColumn( ContentPeer::CON_VALUE );
|
||||
$Criteria->addSelectColumn(ContentPeer::CON_CATEGORY);
|
||||
$Criteria->addSelectColumn(ContentPeer::CON_PARENT);
|
||||
$Criteria->addSelectColumn(ContentPeer::CON_ID);
|
||||
$Criteria->addSelectColumn(ContentPeer::CON_LANG);
|
||||
$Criteria->addSelectColumn(ContentPeer::CON_VALUE);
|
||||
|
||||
$Criteria->add( ContentPeer::CON_CATEGORY, $ConCategory, CRITERIA::EQUAL );
|
||||
$Criteria->add( ContentPeer::CON_PARENT, $ConParent, CRITERIA::EQUAL );
|
||||
$Criteria->add( ContentPeer::CON_ID, $ConId, CRITERIA::EQUAL );
|
||||
$Criteria->add( ContentPeer::CON_LANG, $destConLang, CRITERIA::NOT_EQUAL );
|
||||
$Criteria->add(ContentPeer::CON_CATEGORY, $ConCategory, CRITERIA::EQUAL);
|
||||
$Criteria->add(ContentPeer::CON_PARENT, $ConParent, CRITERIA::EQUAL);
|
||||
$Criteria->add(ContentPeer::CON_ID, $ConId, CRITERIA::EQUAL);
|
||||
$Criteria->add(ContentPeer::CON_LANG, $destConLang, CRITERIA::NOT_EQUAL);
|
||||
|
||||
$rs = ContentPeer::doSelectRS( $Criteria );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rs = ContentPeer::doSelectRS($Criteria);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
|
||||
if (is_array( $row = $rs->getRow() )) {
|
||||
if (is_array($row = $rs->getRow())) {
|
||||
$defaultLang = $row['CON_LANG'];
|
||||
} else {
|
||||
$defaultLang = "";
|
||||
@@ -113,7 +77,7 @@ class Content extends BaseContent
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
public static function updateEqualValue ($ConCategory, $ConParent, $ConId, $ConValue)
|
||||
public static function updateEqualValue($ConCategory, $ConParent, $ConId, $ConValue)
|
||||
{
|
||||
$con = Propel::getConnection('workflow');
|
||||
$c1 = new Criteria('workflow');
|
||||
@@ -136,18 +100,18 @@ class Content extends BaseContent
|
||||
* @return string
|
||||
* if the row doesn't exist, it will be created automatically, even the default 'en' language
|
||||
*/
|
||||
public static function autoLoadSave ($ConCategory, $ConParent, $ConId, $destConLang)
|
||||
public static function autoLoadSave($ConCategory, $ConParent, $ConId, $destConLang)
|
||||
{
|
||||
//search in 'en' language, the default language
|
||||
$content = ContentPeer::retrieveByPK( $ConCategory, $ConParent, $ConId, 'en' );
|
||||
$content = ContentPeer::retrieveByPK($ConCategory, $ConParent, $ConId, 'en');
|
||||
|
||||
if ((is_null( $content )) || ($content->getConValue() == "")) {
|
||||
$differentLang = Content::getDefaultContentLang( $ConCategory, $ConParent, $ConId, $destConLang );
|
||||
$content = ContentPeer::retrieveByPK( $ConCategory, $ConParent, $ConId, $differentLang );
|
||||
if ((is_null($content)) || ($content->getConValue() == "")) {
|
||||
$differentLang = Content::getDefaultContentLang($ConCategory, $ConParent, $ConId, $destConLang);
|
||||
$content = ContentPeer::retrieveByPK($ConCategory, $ConParent, $ConId, $differentLang);
|
||||
}
|
||||
|
||||
//to do: review if the $destConLang is a valid language/
|
||||
if (is_null( $content )) {
|
||||
if (is_null($content)) {
|
||||
$ConValue = '';
|
||||
//we dont find any value for this field and language in CONTENT table
|
||||
} else {
|
||||
@@ -155,15 +119,15 @@ class Content extends BaseContent
|
||||
}
|
||||
|
||||
try {
|
||||
$con = ContentPeer::retrieveByPK( $ConCategory, $ConParent, $ConId, $destConLang );
|
||||
if (is_null( $con )) {
|
||||
$con = ContentPeer::retrieveByPK($ConCategory, $ConParent, $ConId, $destConLang);
|
||||
if (is_null($con)) {
|
||||
$con = new Content();
|
||||
}
|
||||
$con->setConCategory( $ConCategory );
|
||||
$con->setConParent( $ConParent );
|
||||
$con->setConId( $ConId );
|
||||
$con->setConLang( $destConLang );
|
||||
$con->setConValue( $ConValue );
|
||||
$con->setConCategory($ConCategory);
|
||||
$con->setConParent($ConParent);
|
||||
$con->setConId($ConId);
|
||||
$con->setConLang($destConLang);
|
||||
$con->setConValue($ConValue);
|
||||
if ($con->validate()) {
|
||||
$res = $con->save();
|
||||
}
|
||||
@@ -183,32 +147,32 @@ class Content extends BaseContent
|
||||
* @param string $ConValue
|
||||
* @return variant
|
||||
*/
|
||||
public static function addContent ($ConCategory, $ConParent, $ConId, $ConLang, $ConValue)
|
||||
public static function addContent($ConCategory, $ConParent, $ConId, $ConLang, $ConValue)
|
||||
{
|
||||
try {
|
||||
if ($ConLang != 'en') {
|
||||
$baseLangContent = ContentPeer::retrieveByPk( $ConCategory, $ConParent, $ConId, 'en' );
|
||||
$baseLangContent = ContentPeer::retrieveByPk($ConCategory, $ConParent, $ConId, 'en');
|
||||
if ($baseLangContent === null) {
|
||||
Content::addContent( $ConCategory, $ConParent, $ConId, 'en', $ConValue );
|
||||
Content::addContent($ConCategory, $ConParent, $ConId, 'en', $ConValue);
|
||||
}
|
||||
}
|
||||
|
||||
$con = ContentPeer::retrieveByPK( $ConCategory, $ConParent, $ConId, $ConLang );
|
||||
$con = ContentPeer::retrieveByPK($ConCategory, $ConParent, $ConId, $ConLang);
|
||||
|
||||
if (is_null( $con )) {
|
||||
if (is_null($con)) {
|
||||
$con = new Content();
|
||||
$con->setConCategory( $ConCategory );
|
||||
$con->setConCategory($ConCategory);
|
||||
if ($con->getConParent() != $ConParent) {
|
||||
$con->setConParent( $ConParent );
|
||||
$con->setConParent($ConParent);
|
||||
}
|
||||
$con->setConId( $ConId );
|
||||
$con->setConLang( $ConLang );
|
||||
$con->setConValue( $ConValue );
|
||||
$con->setConId($ConId);
|
||||
$con->setConLang($ConLang);
|
||||
$con->setConValue($ConValue);
|
||||
if ($con->validate()) {
|
||||
$res = $con->save();
|
||||
return $res;
|
||||
} else {
|
||||
$e = new Exception( "Error in addcontent, the row $ConCategory, $ConParent, $ConId, $ConLang is not Valid" );
|
||||
$e = new Exception("Error in addcontent, the row $ConCategory, $ConParent, $ConId, $ConLang is not Valid");
|
||||
throw ($e);
|
||||
}
|
||||
} else {
|
||||
@@ -216,7 +180,7 @@ class Content extends BaseContent
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Content::updateEqualValue( $ConCategory, $ConParent, $ConId, $ConValue );
|
||||
Content::updateEqualValue($ConCategory, $ConParent, $ConId, $ConValue);
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
throw ($e);
|
||||
@@ -232,20 +196,20 @@ class Content extends BaseContent
|
||||
* @param string $ConValue
|
||||
* @return variant
|
||||
*/
|
||||
public function insertContent ($ConCategory, $ConParent, $ConId, $ConLang, $ConValue)
|
||||
public function insertContent($ConCategory, $ConParent, $ConId, $ConLang, $ConValue)
|
||||
{
|
||||
try {
|
||||
$con = new Content();
|
||||
$con->setConCategory( $ConCategory );
|
||||
$con->setConParent( $ConParent );
|
||||
$con->setConId( $ConId );
|
||||
$con->setConLang( $ConLang );
|
||||
$con->setConValue( $ConValue );
|
||||
$con->setConCategory($ConCategory);
|
||||
$con->setConParent($ConParent);
|
||||
$con->setConId($ConId);
|
||||
$con->setConLang($ConLang);
|
||||
$con->setConValue($ConValue);
|
||||
if ($con->validate()) {
|
||||
$res = $con->save();
|
||||
return $res;
|
||||
} else {
|
||||
$e = new Exception( "Error in addcontent, the row $ConCategory, $ConParent, $ConId, $ConLang is not Valid" );
|
||||
$e = new Exception("Error in addcontent, the row $ConCategory, $ConParent, $ConId, $ConLang is not Valid");
|
||||
throw ($e);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
@@ -262,25 +226,24 @@ class Content extends BaseContent
|
||||
* @param string $ConValue
|
||||
* @return variant
|
||||
*/
|
||||
public static function removeContent ($ConCategory, $ConParent, $ConId)
|
||||
public static function removeContent($ConCategory, $ConParent, $ConId)
|
||||
{
|
||||
try {
|
||||
$c = new Criteria();
|
||||
$c->add( ContentPeer::CON_CATEGORY, $ConCategory );
|
||||
$c->add( ContentPeer::CON_PARENT, $ConParent );
|
||||
$c->add( ContentPeer::CON_ID, $ConId );
|
||||
$result = ContentPeer::doSelectRS( $c );
|
||||
$c->add(ContentPeer::CON_CATEGORY, $ConCategory);
|
||||
$c->add(ContentPeer::CON_PARENT, $ConParent);
|
||||
$c->add(ContentPeer::CON_ID, $ConId);
|
||||
$result = ContentPeer::doSelectRS($c);
|
||||
$result->next();
|
||||
$row = $result->getRow();
|
||||
while (is_array( $row )) {
|
||||
ContentPeer::doDelete( array ($ConCategory,$ConParent,$ConId,$row[3]) );
|
||||
while (is_array($row)) {
|
||||
ContentPeer::doDelete(array($ConCategory,$ConParent,$ConId,$row[3]));
|
||||
$result->next();
|
||||
$row = $result->getRow();
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
throw ($e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -293,11 +256,11 @@ class Content extends BaseContent
|
||||
* @param string $ConValue
|
||||
* @return boolean true or false
|
||||
*/
|
||||
public function Exists ($ConCategory, $ConParent, $ConId, $ConLang)
|
||||
public function Exists($ConCategory, $ConParent, $ConId, $ConLang)
|
||||
{
|
||||
try {
|
||||
$oPro = ContentPeer::retrieveByPk( $ConCategory, $ConParent, $ConId, $ConLang );
|
||||
if (is_object( $oPro ) && get_class( $oPro ) == 'Content') {
|
||||
$oPro = ContentPeer::retrieveByPk($ConCategory, $ConParent, $ConId, $ConLang);
|
||||
if (is_object($oPro) && get_class($oPro) == 'Content') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -318,14 +281,14 @@ class Content extends BaseContent
|
||||
$workSpace = config("system.workspace");
|
||||
}
|
||||
//Search the language
|
||||
$key = array_search( 'en', $langs );
|
||||
$key = array_search('en', $langs);
|
||||
if ($key === false) {
|
||||
$key = array_search( SYS_LANG, $langs );
|
||||
$key = array_search(SYS_LANG, $langs);
|
||||
if ($key === false) {
|
||||
$key = '0';
|
||||
}
|
||||
}
|
||||
$this->langsAsoc = array ();
|
||||
$this->langsAsoc = [];
|
||||
foreach ($langs as $key => $value) {
|
||||
$this->langsAsoc[$value] = $value;
|
||||
}
|
||||
@@ -336,154 +299,154 @@ class Content extends BaseContent
|
||||
$this->rowsUnchanged = 0;
|
||||
$this->rowsClustered = 0;
|
||||
|
||||
//Creating table CONTENT_BACKUP
|
||||
$connection = Propel::getConnection( 'workflow' );
|
||||
$oStatement = $connection->prepareStatement( "CREATE TABLE IF NOT EXISTS `CONTENT_BACKUP` (
|
||||
$workSpace = new WorkspaceTools($workSpace);
|
||||
$workSpace->getDBInfo();
|
||||
|
||||
$connection = 'regenerate';
|
||||
InstallerModule::setNewConnection(
|
||||
$connection,
|
||||
$workSpace->dbHost,
|
||||
$workSpace->dbUser,
|
||||
$workSpace->dbPass,
|
||||
$workSpace->dbName,
|
||||
'',
|
||||
['PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET SESSION SQL_BIG_SELECTS=1']);
|
||||
|
||||
$query = "CREATE TABLE IF NOT EXISTS `CONTENT_BACKUP` (
|
||||
`CON_CATEGORY` VARCHAR(30) default '' NOT NULL,
|
||||
`CON_PARENT` VARCHAR(32) default '' NOT NULL,
|
||||
`CON_ID` VARCHAR(100) default '' NOT NULL,
|
||||
`CON_LANG` VARCHAR(10) default '' NOT NULL,
|
||||
`CON_VALUE` MEDIUMTEXT NOT NULL,
|
||||
CONSTRAINT CONTENT_BACKUP_PK PRIMARY KEY (CON_CATEGORY,CON_PARENT,CON_ID,CON_LANG)
|
||||
)Engine=InnoDB DEFAULT CHARSET='utf8' COMMENT='Table for add content';" );
|
||||
$oStatement->executeQuery();
|
||||
)Engine=InnoDB DEFAULT CHARSET='utf8' COMMENT='Table for add content'";
|
||||
|
||||
$sql = " SELECT DISTINCT CON_LANG
|
||||
FROM CONTENT ";
|
||||
$stmt = $connection->createStatement();
|
||||
$rs = $stmt->executeQuery( $sql, ResultSet::FETCHMODE_ASSOC );
|
||||
while ($rs->next()) {
|
||||
$row = $rs->getRow();
|
||||
$language = $row['CON_LANG'];
|
||||
if (array_search( $row['CON_LANG'], $langs ) === false) {
|
||||
Content::removeLanguageContent( $row['CON_LANG'] );
|
||||
DB::connection($connection)->statement($query);
|
||||
|
||||
$languages = DB::table('CONTENT')->select('CON_LANG')->distinct()->get();
|
||||
|
||||
foreach ($languages as $value) {
|
||||
if (array_search($value->CON_LANG, $langs) === false) {
|
||||
Content::removeLanguageContent($value->CON_LANG);
|
||||
}
|
||||
}
|
||||
|
||||
$sql = " SELECT CON_ID, CON_CATEGORY, CON_LANG, CON_PARENT, CON_VALUE
|
||||
FROM CONTENT
|
||||
ORDER BY CON_ID, CON_CATEGORY, CON_PARENT, CON_LANG";
|
||||
DB::connection($connection)->statement('SET NAMES "utf8"');
|
||||
DB::connection($connection)->statement('SET FOREIGN_KEY_CHECKS=0');
|
||||
DB::connection($connection)->statement('SET SQL_BIG_SELECTS=1');
|
||||
|
||||
$workSpace = new WorkspaceTools( $workSpace );
|
||||
$workSpace->getDBInfo();
|
||||
$result = DB::table('CONTENT')
|
||||
->select('CON_ID', 'CON_CATEGORY', 'CON_LANG', 'CON_PARENT', 'CON_VALUE')
|
||||
->orderBy('CON_ID', 'CON_CATEGORY', 'CON_LANG', 'CON_PARENT', 'CON_VALUE')
|
||||
->get();
|
||||
$list = [];
|
||||
$default = [];
|
||||
$sw = ['CON_ID' => '', 'CON_CATEGORY' => '', 'CON_PARENT' => ''];
|
||||
|
||||
$link = @mysql_pconnect( $workSpace->dbHost, $workSpace->dbUser, $workSpace->dbPass) or die( "Could not connect" );
|
||||
|
||||
mysql_select_db( $workSpace->dbName, $link );
|
||||
mysql_query( "SET NAMES 'utf8';" );
|
||||
mysql_query( "SET FOREIGN_KEY_CHECKS=0;" );
|
||||
mysql_query( 'SET OPTION SQL_BIG_SELECTS=1' );
|
||||
$result = mysql_unbuffered_query( $sql, $link );
|
||||
$list = array ();
|
||||
$default = array ();
|
||||
$sw = array ('CON_ID' => '','CON_CATEGORY' => '','CON_PARENT' => ''
|
||||
);
|
||||
while ($row = mysql_fetch_assoc( $result )) {
|
||||
if ($sw['CON_ID'] == $row['CON_ID'] && $sw['CON_CATEGORY'] == $row['CON_CATEGORY'] && $sw['CON_PARENT'] == $row['CON_PARENT']) {
|
||||
foreach ($result as $value) {
|
||||
$row = (array)$value;
|
||||
if ($sw['CON_ID'] === $row['CON_ID'] && $sw['CON_CATEGORY'] === $row['CON_CATEGORY'] && $sw['CON_PARENT'] === $row['CON_PARENT']) {
|
||||
$list[] = $row;
|
||||
} else {
|
||||
$this->rowsClustered ++;
|
||||
if (count( $langs ) != count( $list )) {
|
||||
$this->checkLanguage( $list, $default );
|
||||
$this->rowsClustered++;
|
||||
if (count($langs) !== count($list)) {
|
||||
$this->checkLanguage($list, $default);
|
||||
} else {
|
||||
$this->rowsUnchanged = $this->rowsUnchanged + count( $langs );
|
||||
$this->rowsUnchanged += count($langs);
|
||||
}
|
||||
$sw = array ();
|
||||
$sw = [];
|
||||
$sw['CON_ID'] = $row['CON_ID'];
|
||||
$sw['CON_CATEGORY'] = $row['CON_CATEGORY'];
|
||||
$sw['CON_LANG'] = $row['CON_LANG'];
|
||||
$sw['CON_PARENT'] = $row['CON_PARENT'];
|
||||
unset( $list );
|
||||
unset( $default );
|
||||
$list = array ();
|
||||
$default = array ();
|
||||
unset($list);
|
||||
unset($default);
|
||||
$list = [];
|
||||
$default = [];
|
||||
$list[] = $row;
|
||||
}
|
||||
if ($sw['CON_LANG'] == $langs[$key]) {
|
||||
if ($sw['CON_LANG'] === $langs[$key]) {
|
||||
$default = $row;
|
||||
}
|
||||
$this->rowsProcessed ++;
|
||||
$this->rowsProcessed++;
|
||||
}
|
||||
if (count( $langs ) != count( $list )) {
|
||||
$this->checkLanguage( $list, $default );
|
||||
|
||||
if (count($langs) !== count($list)) {
|
||||
$this->checkLanguage($list, $default);
|
||||
} else {
|
||||
$this->rowsUnchanged = $this->rowsUnchanged + count( $langs );
|
||||
$this->rowsUnchanged += count($langs);
|
||||
}
|
||||
mysql_free_result( $result );
|
||||
$total = $this->rowsProcessed + $this->rowsInserted;
|
||||
|
||||
$statement = $connection->prepareStatement( "REPLACE INTO CONTENT
|
||||
DB::connection($connection)->statement('REPLACE INTO CONTENT
|
||||
SELECT CON_CATEGORY, CON_PARENT, CON_ID , CON_LANG, CON_VALUE
|
||||
FROM CONTENT_BACKUP" );
|
||||
$statement->executeQuery();
|
||||
FROM CONTENT_BACKUP');
|
||||
|
||||
$statement = $connection->prepareStatement( "DROP TABLE CONTENT_BACKUP" );
|
||||
$statement->executeQuery();
|
||||
DB::connection($connection)->statement('DROP TABLE CONTENT_BACKUP');
|
||||
|
||||
//close connection
|
||||
$sql = "SELECT * FROM information_schema.processlist WHERE command = 'Sleep' and user = SUBSTRING_INDEX(USER(),'@',1) and db = DATABASE() ORDER BY id;";
|
||||
$stmt = $connection->createStatement();
|
||||
$rs = $stmt->executeQuery( $sql, ResultSet::FETCHMODE_ASSOC );
|
||||
while ($rs->next()) {
|
||||
$row = $rs->getRow();
|
||||
$oStatement = $connection->prepareStatement( "kill ". $row['ID'] );
|
||||
$oStatement->executeQuery();
|
||||
$result = DB::connection($connection)
|
||||
->select("SELECT * FROM information_schema.processlist WHERE command = 'Sleep' and user = SUBSTRING_INDEX(USER(),'@',1) and db = DATABASE() ORDER BY id");
|
||||
|
||||
foreach ($result as $value) {
|
||||
DB::connection($connection)->statement('kill ' . $value->ID);
|
||||
}
|
||||
|
||||
if (! isset( $_SERVER['SERVER_NAME'] )) {
|
||||
CLI::logging( "Rows Processed ---> $this->rowsProcessed ..... \n" );
|
||||
CLI::logging( "Rows Clustered ---> $this->rowsClustered ..... \n" );
|
||||
CLI::logging( "Rows Unchanged ---> $this->rowsUnchanged ..... \n" );
|
||||
CLI::logging( "Rows Inserted ---> $this->rowsInserted ..... \n" );
|
||||
CLI::logging( "Rows Total ---> $total ..... \n" );
|
||||
if (!isset($_SERVER['SERVER_NAME'])) {
|
||||
CLI::logging("Rows Processed ---> $this->rowsProcessed ..... \n");
|
||||
CLI::logging("Rows Clustered ---> $this->rowsClustered ..... \n");
|
||||
CLI::logging("Rows Unchanged ---> $this->rowsUnchanged ..... \n");
|
||||
CLI::logging("Rows Inserted ---> $this->rowsInserted ..... \n");
|
||||
CLI::logging("Rows Total ---> $total ..... \n");
|
||||
}
|
||||
}
|
||||
|
||||
public function checkLanguage ($content, $default)
|
||||
public function checkLanguage($content, $default)
|
||||
{
|
||||
if (count( $content ) > 0) {
|
||||
if (count($content) > 0) {
|
||||
$langs = $this->langs;
|
||||
$langsAsoc = $this->langsAsoc;
|
||||
//Element default
|
||||
$default = (count( $default ) > 0) ? $default : $content[0];
|
||||
$default = (count($default) > 0) ? $default : $content[0];
|
||||
foreach ($content as $key => $value) {
|
||||
unset( $langsAsoc[$value['CON_LANG']] );
|
||||
unset($langsAsoc[$value['CON_LANG']]);
|
||||
}
|
||||
foreach ($langsAsoc as $key => $value) {
|
||||
$this->rowsInserted ++;
|
||||
$this->fastInsertContent( $default['CON_CATEGORY'], $default['CON_PARENT'], $default['CON_ID'], $value, $default['CON_VALUE'] );
|
||||
$this->fastInsertContent($default['CON_CATEGORY'], $default['CON_PARENT'], $default['CON_ID'], $value, $default['CON_VALUE']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function fastInsertContent ($ConCategory, $ConParent, $ConId, $ConLang, $ConValue)
|
||||
public function fastInsertContent($ConCategory, $ConParent, $ConId, $ConLang, $ConValue)
|
||||
{
|
||||
$ConValue = mysql_real_escape_string( $ConValue );
|
||||
$connection = Propel::getConnection( 'workflow' );
|
||||
$statement = $connection->prepareStatement( "INSERT INTO CONTENT_BACKUP (
|
||||
CON_CATEGORY, CON_PARENT, CON_ID , CON_LANG, CON_VALUE)
|
||||
VALUES ('$ConCategory', '$ConParent', '$ConId', '$ConLang', '$ConValue');" );
|
||||
$statement->executeQuery();
|
||||
DB::table('CONTENT_BACKUP')
|
||||
->insert([
|
||||
'CON_CATEGORY' => $ConCategory,
|
||||
'CON_PARENT' => $ConParent,
|
||||
'CON_ID' => $ConId,
|
||||
'CON_LANG' => $ConLang,
|
||||
'CON_VALUE' => $ConValue
|
||||
]);
|
||||
}
|
||||
|
||||
public function removeLanguageContent ($lanId)
|
||||
public function removeLanguageContent($lanId)
|
||||
{
|
||||
try {
|
||||
$c = new Criteria();
|
||||
$c->addSelectColumn( ContentPeer::CON_CATEGORY );
|
||||
$c->addSelectColumn( ContentPeer::CON_PARENT );
|
||||
$c->addSelectColumn( ContentPeer::CON_ID );
|
||||
$c->addSelectColumn( ContentPeer::CON_LANG );
|
||||
$c->addSelectColumn(ContentPeer::CON_CATEGORY);
|
||||
$c->addSelectColumn(ContentPeer::CON_PARENT);
|
||||
$c->addSelectColumn(ContentPeer::CON_ID);
|
||||
$c->addSelectColumn(ContentPeer::CON_LANG);
|
||||
|
||||
$c->add( ContentPeer::CON_LANG, $lanId );
|
||||
$c->add(ContentPeer::CON_LANG, $lanId);
|
||||
|
||||
$result = ContentPeer::doSelectRS( $c );
|
||||
$result->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$result = ContentPeer::doSelectRS($c);
|
||||
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$result->next();
|
||||
$row = $result->getRow();
|
||||
|
||||
while (is_array( $row )) {
|
||||
$content = ContentPeer::retrieveByPK( $row['CON_CATEGORY'], $row['CON_PARENT'], $row['CON_ID'], $lanId );
|
||||
while (is_array($row)) {
|
||||
$content = ContentPeer::retrieveByPK($row['CON_CATEGORY'], $row['CON_PARENT'], $row['CON_ID'], $lanId);
|
||||
|
||||
if ($content !== null) {
|
||||
$content->delete();
|
||||
@@ -491,29 +454,32 @@ class Content extends BaseContent
|
||||
$result->next();
|
||||
$row = $result->getRow();
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw ($e);
|
||||
}
|
||||
}
|
||||
|
||||
//Added by Enrique at Feb 9th,2011
|
||||
//Gets all Role Names by Role
|
||||
public function getAllContentsByRole ($sys_lang = SYS_LANG)
|
||||
/**
|
||||
* Gets all Role Names by Role
|
||||
*
|
||||
* @param string $sys_lang language
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAllContentsByRole($sys_lang = SYS_LANG)
|
||||
{
|
||||
if (! isset( $sys_lang )) {
|
||||
if (! isset($sys_lang)) {
|
||||
$sys_lang = 'en';
|
||||
}
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->clearSelectColumns();
|
||||
$oCriteria->addSelectColumn( ContentPeer::CON_ID );
|
||||
$oCriteria->addAsColumn( 'ROL_NAME', ContentPeer::CON_VALUE );
|
||||
//$oCriteria->addAsColumn('ROL_UID', ContentPeer::CON_ID);
|
||||
$oCriteria->add( ContentPeer::CON_CATEGORY, 'ROL_NAME' );
|
||||
$oCriteria->add( ContentPeer::CON_LANG, $sys_lang );
|
||||
$oDataset = ContentPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$aRoles = Array ();
|
||||
$oCriteria->addSelectColumn(ContentPeer::CON_ID);
|
||||
$oCriteria->addAsColumn('ROL_NAME', ContentPeer::CON_VALUE);
|
||||
$oCriteria->add(ContentPeer::CON_CATEGORY, 'ROL_NAME');
|
||||
$oCriteria->add(ContentPeer::CON_LANG, $sys_lang);
|
||||
$oDataset = ContentPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$aRoles = [];
|
||||
while ($oDataset->next()) {
|
||||
$xRow = $oDataset->getRow();
|
||||
$aRoles[$xRow['CON_ID']] = $xRow['ROL_NAME'];
|
||||
@@ -521,4 +487,3 @@ class Content extends BaseContent
|
||||
return $aRoles;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ require_once 'classes/model/om/BaseDashboardIndicator.php';
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'DASHBOARD_INDICATOR' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
@@ -16,68 +16,75 @@ require_once 'classes/model/om/BaseDashboardIndicator.php';
|
||||
*/
|
||||
class DashboardIndicator extends BaseDashboardIndicator
|
||||
{
|
||||
public function load ($dasIndUid)
|
||||
public function load($dasIndUid)
|
||||
{
|
||||
try {
|
||||
$dashboardIndicator = DashboardIndicatorPeer::retrieveByPK($dasIndUid);
|
||||
$fields = $dashboardIndicator->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$dashboardIndicator->fromArray( $fields, BasePeer::TYPE_FIELDNAME );
|
||||
$dashboardIndicator->fromArray($fields, BasePeer::TYPE_FIELDNAME);
|
||||
return $fields;
|
||||
} catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
function loadbyDasUid ($dasUid, $vcompareDate, $vmeasureDate, $userUid)
|
||||
{
|
||||
|
||||
public function loadbyDasUid($dasUid, $vcompareDate, $vmeasureDate, $userUid)
|
||||
{
|
||||
$calculator = new \IndicatorsCalculator();
|
||||
|
||||
try {
|
||||
$connection = Propel::getConnection('workflow');
|
||||
$qryString = "select * from CONFIGURATION where CFG_UID = 'DASHBOARDS_SETTINGS' and USR_UID = '$userUid'";
|
||||
$qry = $connection->PrepareStatement($qryString);
|
||||
$dataSet = $qry->executeQuery();
|
||||
$dashConfig = array();
|
||||
while ($dataSet->next()) {
|
||||
$row = $dataSet->getRow();
|
||||
$dashConfig = unserialize($row['CFG_VALUE']);
|
||||
}
|
||||
|
||||
$connection = Propel::getConnection('workflow');
|
||||
$qryString = "select * from CONFIGURATION where CFG_UID = 'DASHBOARDS_SETTINGS' and USR_UID = '$userUid'";
|
||||
$qry = $connection->PrepareStatement($qryString);
|
||||
$dataSet = $qry->executeQuery();
|
||||
$dashConfig = array();
|
||||
while ($dataSet->next()){
|
||||
$row = $dataSet->getRow();
|
||||
$dashConfig = unserialize($row['CFG_VALUE']);
|
||||
}
|
||||
|
||||
$criteria = new Criteria( 'workflow' );
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->clearSelectColumns()->clearOrderByColumns();
|
||||
|
||||
$criteria->add( DashboardIndicatorPeer::DAS_UID, $dasUid, criteria::EQUAL );
|
||||
$criteria->add(DashboardIndicatorPeer::DAS_UID, $dasUid, criteria::EQUAL);
|
||||
|
||||
$rs = DashboardIndicatorPeer::doSelectRS( $criteria );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rs = DashboardIndicatorPeer::doSelectRS($criteria);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dashboardIndicator = array();
|
||||
|
||||
while ($rs->next()) {
|
||||
$row = $rs->getRow();
|
||||
|
||||
//$currentDate = new DateTime (date("Y-m-d"));
|
||||
$measureDate = new DateTime ($vmeasureDate);
|
||||
$compareDate = new DateTime ($vcompareDate);
|
||||
$uid = ($row['DAS_UID_PROCESS'] == '0' ? null: $row['DAS_UID_PROCESS']) ;
|
||||
switch ($row['DAS_IND_TYPE']) {
|
||||
case '1010':
|
||||
$value = current(reset($calculator->peiHistoric($uid, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$oldValue = current(reset($calculator->peiHistoric($uid, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$row['DAS_IND_VARIATION'] = $value - $oldValue;
|
||||
$row['DAS_IND_OLD_VALUE'] = $oldValue;
|
||||
$row['DAS_IND_PERCENT_VARIATION'] = $oldValue != 0
|
||||
? round(($value - $oldValue) * 100 / $oldValue)
|
||||
: "--";
|
||||
break;
|
||||
case '1030':
|
||||
$value = current(reset($calculator->ueiHistoric(null, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$oldValue = current(reset($calculator->ueiHistoric($uid, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$row['DAS_IND_VARIATION'] = $value - $oldValue;
|
||||
$row['DAS_IND_OLD_VALUE'] = $oldValue;
|
||||
$row['DAS_IND_PERCENT_VARIATION'] = $oldValue != 0
|
||||
? round(($value - $oldValue) * 100 / $oldValue)
|
||||
: "--";
|
||||
break;
|
||||
$measureDate = new DateTime($vmeasureDate);
|
||||
$compareDate = new DateTime($vcompareDate);
|
||||
$uid = ($row['DAS_UID_PROCESS'] == '0' ? null : $row['DAS_UID_PROCESS']);
|
||||
switch ($row['DAS_IND_TYPE']) {
|
||||
case '1010':
|
||||
$value = $calculator->peiHistoric($uid, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE);
|
||||
$value = reset($value);
|
||||
$value = current($value);
|
||||
$oldValue = $calculator->peiHistoric($uid, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE);
|
||||
$oldValue = reset($oldValue);
|
||||
$oldValue = current($oldValue);
|
||||
$row['DAS_IND_VARIATION'] = $value - $oldValue;
|
||||
$row['DAS_IND_OLD_VALUE'] = $oldValue;
|
||||
$row['DAS_IND_PERCENT_VARIATION'] = $oldValue != 0
|
||||
? round(($value - $oldValue) * 100 / $oldValue)
|
||||
: "--";
|
||||
break;
|
||||
case '1030':
|
||||
$value = $calculator->ueiHistoric(null, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE);
|
||||
$value = reset($value);
|
||||
$value = current($value);
|
||||
$oldValue = $calculator->ueiHistoric($uid, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE);
|
||||
$oldValue = reset($oldValue);
|
||||
$oldValue = current($oldValue);
|
||||
$row['DAS_IND_VARIATION'] = $value - $oldValue;
|
||||
$row['DAS_IND_OLD_VALUE'] = $oldValue;
|
||||
$row['DAS_IND_PERCENT_VARIATION'] = $oldValue != 0
|
||||
? round(($value - $oldValue) * 100 / $oldValue)
|
||||
: "--";
|
||||
break;
|
||||
case '1050':
|
||||
$value = $calculator->statusIndicatorGeneral($userUid);
|
||||
$row['OVERDUE'] = 0;
|
||||
@@ -94,41 +101,41 @@ class DashboardIndicator extends BaseDashboardIndicator
|
||||
|
||||
$total = $row['OVERDUE'] + $row['AT_RISK'] + $row['ON_TIME'];
|
||||
if ($total != 0) {
|
||||
$row['PERCENTAGE_OVERDUE'] = ($row['OVERDUE']*100)/$total;
|
||||
$row['PERCENTAGE_AT_RISK'] = ($row['AT_RISK']*100)/$total;
|
||||
$row['PERCENTAGE_ON_TIME'] = ($row['ON_TIME']*100)/$total;
|
||||
$row['PERCENTAGE_OVERDUE'] = ($row['OVERDUE'] * 100) / $total;
|
||||
$row['PERCENTAGE_AT_RISK'] = ($row['AT_RISK'] * 100) / $total;
|
||||
$row['PERCENTAGE_ON_TIME'] = ($row['ON_TIME'] * 100) / $total;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$arrResult = $calculator->generalIndicatorData($row['DAS_IND_UID'], $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE);
|
||||
$value = $arrResult[0]['value'];
|
||||
$row['DAS_IND_VARIATION'] = $row['DAS_IND_GOAL'];
|
||||
break;
|
||||
}
|
||||
$row['DAS_IND_VALUE'] = $value;
|
||||
default:
|
||||
$arrResult = $calculator->generalIndicatorData($row['DAS_IND_UID'], $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE);
|
||||
$value = $arrResult[0]['value'];
|
||||
$row['DAS_IND_VARIATION'] = $row['DAS_IND_GOAL'];
|
||||
break;
|
||||
}
|
||||
$row['DAS_IND_VALUE'] = $value;
|
||||
|
||||
$indId = $row['DAS_IND_UID'];
|
||||
$row['DAS_IND_X'] = 0;
|
||||
$row['DAS_IND_Y'] = 0;
|
||||
$row['DAS_IND_WIDTH'] = 0;
|
||||
$row['DAS_IND_HEIGHT'] = 0;
|
||||
$row['DAS_IND_FAVORITE'] = 0;
|
||||
|
||||
foreach ($dashConfig as $dashId=>$oneDash) {
|
||||
if($dashId == $dasUid && is_array($oneDash['dashData'])) {
|
||||
foreach($oneDash['dashData'] as $graphConfig) {
|
||||
if ($graphConfig['indicatorId'] == $indId) {
|
||||
$row['DAS_IND_X'] = $graphConfig['x'];
|
||||
$row['DAS_IND_Y'] = $graphConfig['y'];
|
||||
$row['DAS_IND_WIDTH'] = $graphConfig['width'];
|
||||
$row['DAS_IND_HEIGHT'] = $graphConfig['height'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$indId = $row['DAS_IND_UID'];
|
||||
$row['DAS_IND_X'] = 0;
|
||||
$row['DAS_IND_Y'] = 0;
|
||||
$row['DAS_IND_WIDTH'] = 0;
|
||||
$row['DAS_IND_HEIGHT'] = 0;
|
||||
$row['DAS_IND_FAVORITE'] = 0;
|
||||
|
||||
$dashboardIndicator[] = $row;
|
||||
foreach ($dashConfig as $dashId => $oneDash) {
|
||||
if ($dashId == $dasUid && is_array($oneDash['dashData'])) {
|
||||
foreach ($oneDash['dashData'] as $graphConfig) {
|
||||
if ($graphConfig['indicatorId'] == $indId) {
|
||||
$row['DAS_IND_X'] = $graphConfig['x'];
|
||||
$row['DAS_IND_Y'] = $graphConfig['y'];
|
||||
$row['DAS_IND_WIDTH'] = $graphConfig['width'];
|
||||
$row['DAS_IND_HEIGHT'] = $graphConfig['height'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$dashboardIndicator[] = $row;
|
||||
}
|
||||
return $dashboardIndicator;
|
||||
} catch (Exception $error) {
|
||||
@@ -137,7 +144,6 @@ class DashboardIndicator extends BaseDashboardIndicator
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function createOrUpdate($data)
|
||||
{
|
||||
$connection = Propel::getConnection(DashboardIndicatorPeer::DATABASE_NAME);
|
||||
@@ -158,10 +164,10 @@ class DashboardIndicator extends BaseDashboardIndicator
|
||||
$result = $dashboardIndicator->save();
|
||||
$connection->commit();
|
||||
|
||||
if ((!isset($_SESSION['USER_LOGGED']) || $_SESSION['USER_LOGGED'] == '') && isset($data['USR_UID']) && $data['USR_UID'] != '') {
|
||||
if ((!isset($_SESSION['USER_LOGGED']) || $_SESSION['USER_LOGGED'] == '') && isset($data['USR_UID']) && $data['USR_UID'] != '') {
|
||||
$this->setUser($data['USR_UID']);
|
||||
}
|
||||
G::auditLog($msg, "Dashboard Indicator Name: ".$dashboardIndicator->getDasIndTitle()." Dashboard indicator ID: (".$dashboardIndicator->getDasIndUid() .") ");
|
||||
G::auditLog($msg, "Dashboard Indicator Name: " . $dashboardIndicator->getDasIndTitle() . " Dashboard indicator ID: (" . $dashboardIndicator->getDasIndUid() . ") ");
|
||||
return $dashboardIndicator->getDasIndUid();
|
||||
} else {
|
||||
$message = '';
|
||||
@@ -177,7 +183,7 @@ class DashboardIndicator extends BaseDashboardIndicator
|
||||
}
|
||||
}
|
||||
|
||||
public function remove($dasIndUid, $userLogged ='')
|
||||
public function remove($dasIndUid, $userLogged = '')
|
||||
{
|
||||
$connection = Propel::getConnection(DashboardIndicatorPeer::DATABASE_NAME);
|
||||
try {
|
||||
@@ -191,10 +197,10 @@ class DashboardIndicator extends BaseDashboardIndicator
|
||||
if ((!isset($_SESSION['USER_LOGGED']) || $_SESSION['USER_LOGGED'] == '') && $userLogged != '') {
|
||||
$this->setUser($userLogged);
|
||||
}
|
||||
G::auditLog("Delete", "Dashboard Indicator Name: ". $dashboardIndicatorData['DAS_IND_TITLE']." Dashboard Instance ID: (".$dasIndUid.") ");
|
||||
G::auditLog("Delete", "Dashboard Indicator Name: " . $dashboardIndicatorData['DAS_IND_TITLE'] . " Dashboard Instance ID: (" . $dasIndUid . ") ");
|
||||
return $result;
|
||||
} else {
|
||||
throw new Exception('Error trying to delete: The row "' . $dasIndUid. '" does not exist.');
|
||||
throw new Exception('Error trying to delete: The row "' . $dasIndUid . '" does not exist.');
|
||||
}
|
||||
} catch (Exception $error) {
|
||||
$connection->rollback();
|
||||
@@ -202,11 +208,11 @@ class DashboardIndicator extends BaseDashboardIndicator
|
||||
}
|
||||
}
|
||||
|
||||
public function setUser($usrId) {
|
||||
$user = new Users ();
|
||||
public function setUser($usrId)
|
||||
{
|
||||
$user = new Users();
|
||||
$user = $user->loadDetails($usrId);
|
||||
$_SESSION['USER_LOGGED'] = $user['USR_UID'];
|
||||
$_SESSION['USR_FULLNAME'] = $user['USR_FULLNAME'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -217,5 +217,99 @@ class GroupUser extends BaseGroupUser
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load All users by groupUid
|
||||
*
|
||||
* @param $groupUid
|
||||
* @param string $type
|
||||
* @param string $filter
|
||||
* @param string $sortField
|
||||
* @param string $sortDir
|
||||
* @param int $start
|
||||
* @param int $limit
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getUsersbyGroup($groupUid, $type = 'USERS', $filter = '', $sortField = 'USR_USERNAME', $sortDir = 'ASC', $start = 0, $limit = null)
|
||||
{
|
||||
try {
|
||||
$validSorting = ['USR_UID', 'USR_USERNAME', 'USR_FIRSTNAME', 'USR_LASTNAME', 'USR_EMAIL', 'USR_STATUS'];
|
||||
$response = [
|
||||
'start' => !empty($start) ? $start : 0,
|
||||
'limit' => !empty($limit) ? $limit : 0,
|
||||
'filter' => !empty($filter) ? $filter : '',
|
||||
'data' => []
|
||||
];
|
||||
|
||||
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
|
||||
if ($type === 'AVAILABLE-USERS') {
|
||||
$subQuery = 'SELECT ' . GroupUserPeer::USR_UID .
|
||||
' FROM ' . GroupUserPeer::TABLE_NAME .
|
||||
' WHERE ' . GroupUserPeer::GRP_UID . ' = "' . $groupUid . '" ' .
|
||||
'UNION SELECT "' . RBAC::GUEST_USER_UID . '"';
|
||||
|
||||
$criteria->add(UsersPeer::USR_UID, UsersPeer::USR_UID . " NOT IN ($subQuery)", Criteria::CUSTOM);
|
||||
} else {
|
||||
//USERS - SUPERVISOR
|
||||
$criteria->addJoin(GroupUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
|
||||
$criteria->add(GroupUserPeer::GRP_UID, $groupUid, Criteria::EQUAL);
|
||||
}
|
||||
|
||||
if (!empty($filter)) {
|
||||
$criteria->add($criteria->getNewCriterion(UsersPeer::USR_USERNAME, '%' . $filter . '%', Criteria::LIKE)->
|
||||
addOr($criteria->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', Criteria::LIKE)->
|
||||
addOr($criteria->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $filter . '%', Criteria::LIKE))));
|
||||
}
|
||||
$response['total'] = UsersPeer::doCount($criteria);
|
||||
|
||||
$criteria->addSelectColumn(UsersPeer::USR_UID);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_EMAIL);
|
||||
$criteria->addSelectColumn(UsersPeer::USR_STATUS);
|
||||
|
||||
$sort = UsersPeer::USR_USERNAME;
|
||||
if (!empty($sortField) && in_array($sortField, $validSorting, true)) {
|
||||
$sort = UsersPeer::TABLE_NAME . '.' . $sortField;
|
||||
}
|
||||
|
||||
if (!empty($sortDir) && strtoupper($sortDir) === 'DESC') {
|
||||
$criteria->addDescendingOrderByColumn($sort);
|
||||
} else {
|
||||
$criteria->addAscendingOrderByColumn($sort);
|
||||
}
|
||||
|
||||
if (!empty($start)) {
|
||||
$criteria->setOffset((int)$start);
|
||||
}
|
||||
|
||||
if (!empty($limit)) {
|
||||
$criteria->setLimit((int)$limit);
|
||||
}
|
||||
|
||||
$dataSet = UsersPeer::doSelectRS($criteria);
|
||||
$dataSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$userRbac = new RbacUsers();
|
||||
while ($dataSet->next()) {
|
||||
$row = $dataSet->getRow();
|
||||
if ($type === 'SUPERVISOR') {
|
||||
if ($userRbac->verifyPermission($row['USR_UID'], 'PM_SUPERVISOR')) {
|
||||
$response['data'][] = $row;
|
||||
}
|
||||
} else {
|
||||
$response['data'][] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
return $response;
|
||||
|
||||
} catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -571,7 +571,8 @@ class Language extends BaseLanguage
|
||||
$buildhash = file_get_contents($buildhash);
|
||||
|
||||
$michelangeloFE = PATH_HTML . "lib/js";
|
||||
$pathFileMafe = array_pop(glob($michelangeloFE . '/' . '*' . $buildhash . '*', GLOB_BRACE));
|
||||
$array = glob($michelangeloFE . '/' . '*' . $buildhash . '*', GLOB_BRACE);
|
||||
$pathFileMafe = array_pop($array);
|
||||
if (file_exists($pathFileMafe) && is_readable($pathFileMafe)) {
|
||||
$labels = self::readLabelsDirectory($pathFileMafe, true);
|
||||
}
|
||||
|
||||
@@ -2,29 +2,17 @@
|
||||
|
||||
require_once 'classes/model/om/BaseListCanceled.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'LIST_CANCELED' table.
|
||||
*
|
||||
*
|
||||
*
|
||||
* You should add additional methods to this class to meet the
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListCanceled extends BaseListCanceled implements ListInterface
|
||||
{
|
||||
use ListBaseTrait;
|
||||
|
||||
// @codingStandardsIgnoreEnd
|
||||
/**
|
||||
* Create List Canceled Table
|
||||
*
|
||||
* @param type $data
|
||||
* @return type
|
||||
* @param array $data
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*
|
||||
*/
|
||||
public function create($data)
|
||||
@@ -182,16 +170,17 @@ class ListCanceled extends BaseListCanceled implements ListInterface
|
||||
/**
|
||||
* Remove List Canceled
|
||||
*
|
||||
* @param type $seqName
|
||||
* @return type
|
||||
* @throws type
|
||||
* @param string $appUid
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*
|
||||
*/
|
||||
public function remove($app_uid)
|
||||
public function remove($appUid)
|
||||
{
|
||||
$con = Propel::getConnection(ListCanceledPeer::DATABASE_NAME);
|
||||
try {
|
||||
$this->setAppUid($app_uid);
|
||||
$this->setAppUid($appUid);
|
||||
$con->begin();
|
||||
$this->delete();
|
||||
$con->commit();
|
||||
@@ -201,6 +190,25 @@ class ListCanceled extends BaseListCanceled implements ListInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all records related to the APP_UID
|
||||
*
|
||||
* @param string $appUid
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function removeAll($appUid)
|
||||
{
|
||||
try {
|
||||
$criteria = new Criteria("workflow");
|
||||
$criteria->add(ListCanceledPeer::APP_UID, $appUid);
|
||||
ListCanceledPeer::doDelete($criteria);
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
public function loadFilters(&$criteria, $filters)
|
||||
{
|
||||
$filter = isset($filters['filter']) ? $filters['filter'] : "";
|
||||
@@ -351,4 +359,5 @@ class ListCanceled extends BaseListCanceled implements ListInterface
|
||||
return $this->getCountListFromPeer
|
||||
(ListCanceledPeer::class, $usrUid, $filters);
|
||||
}
|
||||
|
||||
} // ListCanceled
|
||||
|
||||
@@ -15,6 +15,9 @@ use ProcessMaker\BusinessModel\Cases\InputDocument;
|
||||
|
||||
class ObjectPermission extends BaseObjectPermission
|
||||
{
|
||||
const OP_PARTICIPATE_NO = 0;
|
||||
const OP_PARTICIPATE_YES = 1;
|
||||
const OP_PARTICIPATE_NONE = 2;
|
||||
/**
|
||||
* Get the fields related to the user uid
|
||||
*
|
||||
@@ -161,32 +164,21 @@ class ObjectPermission extends BaseObjectPermission
|
||||
* @param string $proUid the uid of the process
|
||||
* @param string $tasUid the uid of the task
|
||||
* @param string $action for the object permissions VIEW, BLOCK, RESEND
|
||||
* this parameter is no used for the permission REASSIGN_MY_CASES
|
||||
* @param array $caseData for review the case status DRAFT, TODO, COMPLETED, PAUSED
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function verifyObjectPermissionPerUser ($usrUid, $proUid, $tasUid = '', $action = '', $caseData = array())
|
||||
{
|
||||
$userPermissions = array();
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(
|
||||
$oCriteria->getNewCriterion(ObjectPermissionPeer::USR_UID, $usrUid)->addOr(
|
||||
$oCriteria->getNewCriterion(ObjectPermissionPeer::USR_UID, '')->addOr(
|
||||
$oCriteria->getNewCriterion(ObjectPermissionPeer::USR_UID, '0')
|
||||
)
|
||||
)
|
||||
);
|
||||
$oCriteria->add(ObjectPermissionPeer::PRO_UID, $proUid);
|
||||
$oCriteria->add(ObjectPermissionPeer::OP_ACTION, $action);
|
||||
$oCriteria->add(
|
||||
$oCriteria->getNewCriterion(ObjectPermissionPeer::TAS_UID, $tasUid)->addOr(
|
||||
$oCriteria->getNewCriterion(ObjectPermissionPeer::TAS_UID, '')->addOr(
|
||||
$oCriteria->getNewCriterion(ObjectPermissionPeer::TAS_UID, '0')
|
||||
)
|
||||
)
|
||||
);
|
||||
$userPermissions = [];
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(ObjectPermissionPeer::USR_UID, ['','0',$usrUid], Criteria::IN);
|
||||
$criteria->add(ObjectPermissionPeer::PRO_UID, $proUid);
|
||||
$criteria->add(ObjectPermissionPeer::OP_ACTION, ['','0',$action], Criteria::IN);
|
||||
$criteria->add(ObjectPermissionPeer::TAS_UID, ['','0',$tasUid], Criteria::IN);
|
||||
|
||||
$rs = ObjectPermissionPeer::doSelectRS($oCriteria);
|
||||
$rs = ObjectPermissionPeer::doSelectRS($criteria);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rs->next()) {
|
||||
@@ -219,19 +211,13 @@ class ObjectPermission extends BaseObjectPermission
|
||||
$groupPermissions = array();
|
||||
|
||||
foreach ($records as $group) {
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(ObjectPermissionPeer::USR_UID, $group);
|
||||
$oCriteria->add(ObjectPermissionPeer::PRO_UID, $proUid);
|
||||
$oCriteria->add(ObjectPermissionPeer::OP_ACTION, $action);
|
||||
$oCriteria->add(
|
||||
$oCriteria->getNewCriterion(ObjectPermissionPeer::TAS_UID, $tasUid)->addOr(
|
||||
$oCriteria->getNewCriterion(ObjectPermissionPeer::TAS_UID, '')->addOr(
|
||||
$oCriteria->getNewCriterion(ObjectPermissionPeer::TAS_UID, '0')
|
||||
)
|
||||
)
|
||||
);
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(ObjectPermissionPeer::USR_UID, $group);
|
||||
$criteria->add(ObjectPermissionPeer::PRO_UID, $proUid);
|
||||
$criteria->add(ObjectPermissionPeer::OP_ACTION, ['','0',$action], Criteria::IN);
|
||||
$criteria->add(ObjectPermissionPeer::TAS_UID, ['','0',$tasUid], Criteria::IN);
|
||||
|
||||
$rs = ObjectPermissionPeer::doSelectRS($oCriteria);
|
||||
$rs = ObjectPermissionPeer::doSelectRS($criteria);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
while ($rs->next()) {
|
||||
$row = $rs->getRow();
|
||||
@@ -425,6 +411,44 @@ class ObjectPermission extends BaseObjectPermission
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify the access to the permission REASSIGN_MY_CASES over the case
|
||||
* Check if the case is TO_DO and if the $tasUid is not empty we will to consider the thread in this task
|
||||
*
|
||||
* @param string $appUid the uid of the case
|
||||
* @param string $proUid the uid of the process
|
||||
* @param string $tasUid the uid of the target Task
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function objectPermissionByReassignCases($appUid, $proUid, $tasUid = '')
|
||||
{
|
||||
$result = [];
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_UID);
|
||||
$criteria->add(ApplicationPeer::APP_UID, $appUid, Criteria::EQUAL);
|
||||
$criteria->add(ApplicationPeer::PRO_UID, $proUid, Criteria::EQUAL);
|
||||
$criteria->add(ApplicationPeer::APP_STATUS, 'TO_DO', Criteria::EQUAL);
|
||||
|
||||
//Review if the target task is OPEN
|
||||
if (!empty($tasUid)) {
|
||||
$criteria->addJoin(AppDelegationPeer::APP_NUMBER, ApplicationPeer::APP_NUMBER, Criteria::LEFT_JOIN);
|
||||
$criteria->add(AppDelegationPeer::TAS_UID, $tasUid, Criteria::EQUAL);
|
||||
$criteria->add(AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN', Criteria::EQUAL);
|
||||
}
|
||||
|
||||
$dataset = ApplicationPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
if ($row = $dataset->getRow()) {
|
||||
$result[] = $row['APP_UID'];
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if the user has a objectPermission for some process
|
||||
*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -264,7 +264,7 @@ class Route extends BaseRoute
|
||||
$c->add(RoutePeer::ROU_NEXT_TASK, $aData['ROU_NEXT_TASK'], Criteria::EQUAL);
|
||||
}
|
||||
|
||||
$query =$c->toString();
|
||||
$query = $c->toString();
|
||||
$rs = RoutePeer::doSelectRS($c);
|
||||
$rs->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$routes = array();
|
||||
|
||||
@@ -111,5 +111,22 @@ class SubApplication extends BaseSubApplication
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if is a case related to the subProcess
|
||||
*
|
||||
* @param string $appUid
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static function isCaseSubProcess($appUid)
|
||||
{
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(SubApplicationPeer::APP_UID, $appUid);
|
||||
$criteria->add(SubApplicationPeer::SA_STATUS, 'ACTIVE');
|
||||
$dataset = SubApplicationPeer::doSelectOne($criteria);
|
||||
|
||||
return !is_null($dataset);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,12 +16,19 @@
|
||||
*/
|
||||
class Task extends BaseTask
|
||||
{
|
||||
const tas_type_events = [
|
||||
'INTERMEDIATE-THROW-MESSAGE-EVENT',
|
||||
'INTERMEDIATE-THROW-EMAIL-EVENT',
|
||||
'INTERMEDIATE-CATCH-TIMER-EVENT',
|
||||
'INTERMEDIATE-CATCH-MESSAGE-EVENT'
|
||||
];
|
||||
/**
|
||||
* This value goes in the content table
|
||||
* @var string
|
||||
*/
|
||||
protected $tas_title_content = '';
|
||||
|
||||
|
||||
/**
|
||||
* Get the tas_title column value.
|
||||
* @return string
|
||||
|
||||
@@ -24,41 +24,41 @@ class UsersProperties extends BaseUsersProperties
|
||||
public $usrID = '';
|
||||
public $lang = 'en';
|
||||
|
||||
public function __construct ()
|
||||
public function __construct()
|
||||
{
|
||||
$this->lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
|
||||
$this->lang = defined('SYS_LANG') ? SYS_LANG : 'en';
|
||||
}
|
||||
|
||||
public function UserPropertyExists ($sUserUID)
|
||||
public function UserPropertyExists($sUserUID)
|
||||
{
|
||||
$oUserProperty = UsersPropertiesPeer::retrieveByPk( $sUserUID );
|
||||
if (! is_null( $oUserProperty ) && is_object( $oUserProperty ) && get_class( $oUserProperty ) == 'UsersProperties') {
|
||||
$this->fields = $oUserProperty->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$this->fromArray( $this->fields, BasePeer::TYPE_FIELDNAME );
|
||||
$oUserProperty = UsersPropertiesPeer::retrieveByPk($sUserUID);
|
||||
if (! is_null($oUserProperty) && is_object($oUserProperty) && get_class($oUserProperty) == 'UsersProperties') {
|
||||
$this->fields = $oUserProperty->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$this->fromArray($this->fields, BasePeer::TYPE_FIELDNAME);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function load ($sUserUID)
|
||||
public function load($sUserUID)
|
||||
{
|
||||
$oUserProperty = UsersPropertiesPeer::retrieveByPK( $sUserUID );
|
||||
if (! is_null( $oUserProperty )) {
|
||||
$aFields = $oUserProperty->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
|
||||
$oUserProperty = UsersPropertiesPeer::retrieveByPK($sUserUID);
|
||||
if (! is_null($oUserProperty)) {
|
||||
$aFields = $oUserProperty->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$this->fromArray($aFields, BasePeer::TYPE_FIELDNAME);
|
||||
return $aFields;
|
||||
} else {
|
||||
throw new Exception( "User with $sUserUID does not exist!" );
|
||||
throw new Exception("User with $sUserUID does not exist!");
|
||||
}
|
||||
}
|
||||
|
||||
public function create ($aData)
|
||||
public function create($aData)
|
||||
{
|
||||
$oConnection = Propel::getConnection( UsersPropertiesPeer::DATABASE_NAME );
|
||||
$oConnection = Propel::getConnection(UsersPropertiesPeer::DATABASE_NAME);
|
||||
try {
|
||||
$oUserProperty = new UsersProperties();
|
||||
$oUserProperty->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||
$oUserProperty->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||
if ($oUserProperty->validate()) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oUserProperty->save();
|
||||
@@ -70,7 +70,7 @@ class UsersProperties extends BaseUsersProperties
|
||||
foreach ($aValidationFailures as $oValidationFailure) {
|
||||
$sMessage .= $oValidationFailure->getMessage() . '<br />';
|
||||
}
|
||||
throw (new Exception( 'The registry cannot be created!<br />' . $sMessage ));
|
||||
throw (new Exception('The registry cannot be created!<br />' . $sMessage));
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
@@ -78,13 +78,13 @@ class UsersProperties extends BaseUsersProperties
|
||||
}
|
||||
}
|
||||
|
||||
public function update ($aData)
|
||||
public function update($aData)
|
||||
{
|
||||
$oConnection = Propel::getConnection( UsersPropertiesPeer::DATABASE_NAME );
|
||||
$oConnection = Propel::getConnection(UsersPropertiesPeer::DATABASE_NAME);
|
||||
try {
|
||||
$oUserProperty = UsersPropertiesPeer::retrieveByPK( $aData['USR_UID'] );
|
||||
if (! is_null( $oUserProperty )) {
|
||||
$oUserProperty->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
|
||||
$oUserProperty = UsersPropertiesPeer::retrieveByPK($aData['USR_UID']);
|
||||
if (! is_null($oUserProperty)) {
|
||||
$oUserProperty->fromArray($aData, BasePeer::TYPE_FIELDNAME);
|
||||
if ($oUserProperty->validate()) {
|
||||
$oConnection->begin();
|
||||
$iResult = $oUserProperty->save();
|
||||
@@ -96,10 +96,10 @@ class UsersProperties extends BaseUsersProperties
|
||||
foreach ($aValidationFailures as $oValidationFailure) {
|
||||
$sMessage .= $oValidationFailure->getMessage() . '<br />';
|
||||
}
|
||||
throw (new Exception( 'The registry cannot be updated!<br />' . $sMessage ));
|
||||
throw (new Exception('The registry cannot be updated!<br />' . $sMessage));
|
||||
}
|
||||
} else {
|
||||
throw (new Exception( 'This row doesn\'t exist!' ));
|
||||
throw (new Exception('This row doesn\'t exist!'));
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
$oConnection->rollback();
|
||||
@@ -107,17 +107,17 @@ class UsersProperties extends BaseUsersProperties
|
||||
}
|
||||
}
|
||||
|
||||
public function loadOrCreateIfNotExists ($sUserUID, $aUserProperty = array())
|
||||
public function loadOrCreateIfNotExists($sUserUID, $aUserProperty = array())
|
||||
{
|
||||
if (! $this->UserPropertyExists( $sUserUID )) {
|
||||
if (! $this->UserPropertyExists($sUserUID)) {
|
||||
$aUserProperty['USR_UID'] = $sUserUID;
|
||||
if (! isset( $aUserProperty['USR_LAST_UPDATE_DATE'] )) {
|
||||
$aUserProperty['USR_LAST_UPDATE_DATE'] = date( 'Y-m-d H:i:s' );
|
||||
if (! isset($aUserProperty['USR_LAST_UPDATE_DATE'])) {
|
||||
$aUserProperty['USR_LAST_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
}
|
||||
if (! isset( $aUserProperty['USR_LOGGED_NEXT_TIME'] )) {
|
||||
if (! isset($aUserProperty['USR_LOGGED_NEXT_TIME'])) {
|
||||
$aUserProperty['USR_LOGGED_NEXT_TIME'] = 0;
|
||||
}
|
||||
$this->create( $aUserProperty );
|
||||
$this->create($aUserProperty);
|
||||
} else {
|
||||
$aUserProperty = $this->fields;
|
||||
}
|
||||
@@ -125,32 +125,32 @@ class UsersProperties extends BaseUsersProperties
|
||||
return $aUserProperty;
|
||||
}
|
||||
|
||||
public function validatePassword ($sPassword, $sLastUpdate, $iChangePasswordNextTime, $nowLogin = false)
|
||||
public function validatePassword($sPassword, $sLastUpdate, $iChangePasswordNextTime, $nowLogin = false)
|
||||
{
|
||||
if (! defined( 'PPP_MINIMUM_LENGTH' )) {
|
||||
define( 'PPP_MINIMUM_LENGTH', 5 );
|
||||
if (! defined('PPP_MINIMUM_LENGTH')) {
|
||||
define('PPP_MINIMUM_LENGTH', 5);
|
||||
}
|
||||
if (! defined( 'PPP_MAXIMUM_LENGTH' )) {
|
||||
define( 'PPP_MAXIMUM_LENGTH', 20 );
|
||||
if (! defined('PPP_MAXIMUM_LENGTH')) {
|
||||
define('PPP_MAXIMUM_LENGTH', 20);
|
||||
}
|
||||
if (! defined( 'PPP_NUMERICAL_CHARACTER_REQUIRED' )) {
|
||||
define( 'PPP_NUMERICAL_CHARACTER_REQUIRED', 0 );
|
||||
if (! defined('PPP_NUMERICAL_CHARACTER_REQUIRED')) {
|
||||
define('PPP_NUMERICAL_CHARACTER_REQUIRED', 0);
|
||||
}
|
||||
if (! defined( 'PPP_UPPERCASE_CHARACTER_REQUIRED' )) {
|
||||
define( 'PPP_UPPERCASE_CHARACTER_REQUIRED', 0 );
|
||||
if (! defined('PPP_UPPERCASE_CHARACTER_REQUIRED')) {
|
||||
define('PPP_UPPERCASE_CHARACTER_REQUIRED', 0);
|
||||
}
|
||||
if (! defined( 'PPP_SPECIAL_CHARACTER_REQUIRED' )) {
|
||||
define( 'PPP_SPECIAL_CHARACTER_REQUIRED', 0 );
|
||||
if (! defined('PPP_SPECIAL_CHARACTER_REQUIRED')) {
|
||||
define('PPP_SPECIAL_CHARACTER_REQUIRED', 0);
|
||||
}
|
||||
if (! defined( 'PPP_EXPIRATION_IN' )) {
|
||||
define( 'PPP_EXPIRATION_IN', 0 );
|
||||
if (! defined('PPP_EXPIRATION_IN')) {
|
||||
define('PPP_EXPIRATION_IN', 0);
|
||||
}
|
||||
if (function_exists( 'mb_strlen' )) {
|
||||
$iLength = mb_strlen( $sPassword );
|
||||
if (function_exists('mb_strlen')) {
|
||||
$iLength = mb_strlen($sPassword);
|
||||
} else {
|
||||
$iLength = strlen( $sPassword );
|
||||
$iLength = strlen($sPassword);
|
||||
}
|
||||
$aErrors = array ();
|
||||
$aErrors = array();
|
||||
if ($iLength < PPP_MINIMUM_LENGTH || $nowLogin) {
|
||||
$aErrors[] = 'ID_PPP_MINIMUM_LENGTH';
|
||||
}
|
||||
@@ -158,17 +158,17 @@ class UsersProperties extends BaseUsersProperties
|
||||
$aErrors[] = 'ID_PPP_MAXIMUM_LENGTH';
|
||||
}
|
||||
if (PPP_NUMERICAL_CHARACTER_REQUIRED == 1) {
|
||||
if (preg_match_all( '/[0-9]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE ) == 0 || $nowLogin) {
|
||||
if (preg_match_all('/[0-9]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE) == 0 || $nowLogin) {
|
||||
$aErrors[] = 'ID_PPP_NUMERICAL_CHARACTER_REQUIRED';
|
||||
}
|
||||
}
|
||||
if (PPP_UPPERCASE_CHARACTER_REQUIRED == 1) {
|
||||
if (preg_match_all( '/[A-Z]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE ) == 0 || $nowLogin) {
|
||||
if (preg_match_all('/[A-Z]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE) == 0 || $nowLogin) {
|
||||
$aErrors[] = 'ID_PPP_UPPERCASE_CHARACTER_REQUIRED';
|
||||
}
|
||||
}
|
||||
if (PPP_SPECIAL_CHARACTER_REQUIRED == 1) {
|
||||
if (preg_match_all( '/[<5B><>\\!|"@<40>#$~%<25>&<26>\/()=\'?<3F><>*+\-_.:,;]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE ) == 0 || $nowLogin) {
|
||||
if (preg_match_all('/[<5B><>\\!|"@<40>#$~%<25>&<26>\/()=\'?<3F><>*+\-_.:,;]/', $sPassword, $aMatch, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE) == 0 || $nowLogin) {
|
||||
$aErrors[] = 'ID_PPP_SPECIAL_CHARACTER_REQUIRED';
|
||||
}
|
||||
}
|
||||
@@ -176,11 +176,11 @@ class UsersProperties extends BaseUsersProperties
|
||||
$oCalendar = new Calendar();
|
||||
|
||||
if ($oCalendar->pmCalendarUid == '') {
|
||||
$oCalendar->pmCalendarUid = '00000000000000000000000000000001';
|
||||
$oCalendar->getCalendarData();
|
||||
$oCalendar->pmCalendarUid = '00000000000000000000000000000001';
|
||||
$oCalendar->getCalendarData();
|
||||
}
|
||||
|
||||
$fDays = $oCalendar->calculateDuration( date( 'Y-m-d H:i:s' ), $sLastUpdate );
|
||||
$fDays = $oCalendar->calculateDuration(date('Y-m-d H:i:s'), $sLastUpdate);
|
||||
if ($fDays > (PPP_EXPIRATION_IN * 24) || $nowLogin) {
|
||||
$aErrors[] = 'ID_PPP_EXPIRATION_IN';
|
||||
}
|
||||
@@ -195,24 +195,24 @@ class UsersProperties extends BaseUsersProperties
|
||||
* get user location
|
||||
* defined by precedence plugin->ux->default
|
||||
*/
|
||||
public function redirectTo ($usrID, $lang = '')
|
||||
public function redirectTo($usrID, $lang = '')
|
||||
{
|
||||
$this->usrID = $usrID;
|
||||
$this->lang = empty( $lang ) ? $this->lang : $lang;
|
||||
$this->lang = empty($lang) ? $this->lang : $lang;
|
||||
|
||||
$url = $this->_getPluginLocation();
|
||||
|
||||
if (empty( $url )) {
|
||||
if (empty($url)) {
|
||||
$url = $this->_getUXLocation();
|
||||
}
|
||||
|
||||
$urlUx = $this->_getUXSkinVariant();
|
||||
if (empty( $url ) && ! empty( $urlUx )) {
|
||||
if (empty($url) && ! empty($urlUx)) {
|
||||
$_SESSION['_defaultUserLocation'] = $url;
|
||||
$url = $urlUx;
|
||||
}
|
||||
|
||||
if (empty( $url )) {
|
||||
if (empty($url)) {
|
||||
$url = $this->_getDefaultLocation();
|
||||
}
|
||||
|
||||
@@ -224,19 +224,19 @@ class UsersProperties extends BaseUsersProperties
|
||||
* defined by precedence plugin->default
|
||||
* note that is getting location without User Inbox Simplified varification
|
||||
*/
|
||||
public function getUserLocation ($usrID, $lang = 'en')
|
||||
public function getUserLocation($usrID, $lang = 'en')
|
||||
{
|
||||
$this->usrID = $usrID;
|
||||
$this->lang = empty( $lang ) ? $this->lang : $lang;
|
||||
$this->lang = empty($lang) ? $this->lang : $lang;
|
||||
|
||||
$url = $this->_getPluginLocation();
|
||||
|
||||
if (empty( $url )) {
|
||||
if (empty($url)) {
|
||||
$url = $this->_getDefaultLocation();
|
||||
}
|
||||
|
||||
$urlUx = $this->_getUXSkinVariant();
|
||||
if (! empty( $urlUx )) {
|
||||
if (! empty($urlUx)) {
|
||||
$_SESSION['_defaultUserLocation'] = $url;
|
||||
$url = $urlUx;
|
||||
}
|
||||
@@ -248,13 +248,13 @@ class UsersProperties extends BaseUsersProperties
|
||||
* to verify if the user is using some "ux..." skin variant
|
||||
* if that is the case, the redirection will change to 'main' controller
|
||||
*/
|
||||
public function _getUXSkinVariant ()
|
||||
public function _getUXSkinVariant()
|
||||
{
|
||||
$url = '';
|
||||
|
||||
if (substr( SYS_SKIN, 0, 2 ) == 'ux' && SYS_SKIN != 'uxs') {
|
||||
if (substr(SYS_SKIN, 0, 2) == 'ux' && SYS_SKIN != 'uxs') {
|
||||
if (isset($_COOKIE['workspaceSkin'])) {
|
||||
if (substr( $_COOKIE['workspaceSkin'], 0, 2 ) != 'ux') {
|
||||
if (substr($_COOKIE['workspaceSkin'], 0, 2) != 'ux') {
|
||||
$url = $this->_getDefaultLocation();
|
||||
return $url;
|
||||
} else {
|
||||
@@ -265,8 +265,8 @@ class UsersProperties extends BaseUsersProperties
|
||||
}
|
||||
global $RBAC;
|
||||
$oConf = new Configurations();
|
||||
$oConf->loadConfig( $x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '' );
|
||||
if (sizeof( $oConf->aConfig ) > 0) {
|
||||
$oConf->loadConfig($x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '');
|
||||
if (sizeof($oConf->aConfig) > 0) {
|
||||
if ($oConf->aConfig['DEFAULT_MENU'] == 'PM_USERS') {
|
||||
$oConf->aConfig['DEFAULT_MENU'] = 'PM_SETUP';
|
||||
}
|
||||
@@ -275,27 +275,27 @@ class UsersProperties extends BaseUsersProperties
|
||||
|
||||
switch ($oConf->aConfig['DEFAULT_MENU']) {
|
||||
case 'PM_SETUP':
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP' ) == 1) {
|
||||
if ($RBAC->userCanAccess('PM_SETUP') == 1) {
|
||||
$getUrl = 'admin';
|
||||
}
|
||||
break;
|
||||
case 'PM_FACTORY':
|
||||
if ($RBAC->userCanAccess( 'PM_FACTORY' ) == 1) {
|
||||
if ($RBAC->userCanAccess('PM_FACTORY') == 1) {
|
||||
$getUrl = 'designer';
|
||||
}
|
||||
break;
|
||||
case 'PM_CASES':
|
||||
if ($RBAC->userCanAccess( 'PM_CASES' ) == 1) {
|
||||
if ($RBAC->userCanAccess('PM_CASES') == 1) {
|
||||
$getUrl = 'home';
|
||||
}
|
||||
break;
|
||||
case 'PM_USERS':
|
||||
if ($RBAC->userCanAccess( 'PM_USERS' ) == 1) {
|
||||
if ($RBAC->userCanAccess('PM_USERS') == 1) {
|
||||
$getUrl = 'admin';
|
||||
}
|
||||
break;
|
||||
case 'PM_DASHBOARD':
|
||||
if ($RBAC->userCanAccess( 'PM_DASHBOARD' ) == 1) {
|
||||
if ($RBAC->userCanAccess('PM_DASHBOARD') == 1) {
|
||||
$getUrl = 'dashboard';
|
||||
}
|
||||
break;
|
||||
@@ -311,14 +311,14 @@ class UsersProperties extends BaseUsersProperties
|
||||
* get the plugins, and check if there is redirectLogins
|
||||
* if yes, then redirect goes according his Role
|
||||
*/
|
||||
public function _getPluginLocation ()
|
||||
public function _getPluginLocation()
|
||||
{
|
||||
global $RBAC;
|
||||
$url = '';
|
||||
|
||||
if (class_exists( 'redirectDetail' )) {
|
||||
if (class_exists('redirectDetail')) {
|
||||
//to do: complete the validation
|
||||
if (isset( $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'] )) {
|
||||
if (isset($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'])) {
|
||||
$userRole = $RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'];
|
||||
}
|
||||
|
||||
@@ -347,10 +347,10 @@ class UsersProperties extends BaseUsersProperties
|
||||
*
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com>
|
||||
*/
|
||||
public function _getUXLocation ()
|
||||
public function _getUXLocation()
|
||||
{
|
||||
require_once 'classes/model/Users.php';
|
||||
$u = UsersPeer::retrieveByPK( $this->usrID );
|
||||
$u = UsersPeer::retrieveByPK($this->usrID);
|
||||
$url = '';
|
||||
|
||||
$uxType = $u->getUsrUx();
|
||||
@@ -360,7 +360,7 @@ class UsersProperties extends BaseUsersProperties
|
||||
if ($uxType == '' || $uxType == 'NORMAL') {
|
||||
require_once 'classes/model/GroupUser.php';
|
||||
$gu = new GroupUser();
|
||||
$ugList = $gu->getAllUserGroups( $this->usrID );
|
||||
$ugList = $gu->getAllUserGroups($this->usrID);
|
||||
|
||||
foreach ($ugList as $row) {
|
||||
if ($row['GRP_UX'] != 'NORMAL' && $row['GRP_UX'] != '') {
|
||||
@@ -387,11 +387,11 @@ class UsersProperties extends BaseUsersProperties
|
||||
* get user preferences for default redirect
|
||||
* verifying if it has any preferences on configurations table
|
||||
*/
|
||||
public function _getDefaultLocation ()
|
||||
public function _getDefaultLocation()
|
||||
{
|
||||
global $RBAC;
|
||||
$oConf = new Configurations();
|
||||
$oConf->loadConfig( $x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '' );
|
||||
$oConf->loadConfig($x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '');
|
||||
|
||||
if (isset($_COOKIE['workspaceSkin'])) {
|
||||
$baseUrl = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/';
|
||||
@@ -400,7 +400,7 @@ class UsersProperties extends BaseUsersProperties
|
||||
}
|
||||
$url = '';
|
||||
|
||||
if (sizeof( $oConf->aConfig ) > 0) {
|
||||
if (sizeof($oConf->aConfig) > 0) {
|
||||
// this user has a configuration record
|
||||
// backward compatibility, because now, we don't have user and dashboard menu.
|
||||
if ($oConf->aConfig['DEFAULT_MENU'] == 'PM_USERS') {
|
||||
@@ -409,34 +409,34 @@ class UsersProperties extends BaseUsersProperties
|
||||
|
||||
switch ($oConf->aConfig['DEFAULT_MENU']) {
|
||||
case 'PM_SETUP':
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP' ) == 1 || $RBAC->userCanAccess('PM_USERS') == 1) {
|
||||
if ($RBAC->userCanAccess('PM_SETUP') == 1 || $RBAC->userCanAccess('PM_USERS') == 1) {
|
||||
$url = 'setup/main';
|
||||
}
|
||||
break;
|
||||
case 'PM_FACTORY':
|
||||
if ($RBAC->userCanAccess( 'PM_FACTORY' ) == 1) {
|
||||
if ($RBAC->userCanAccess('PM_FACTORY') == 1) {
|
||||
$url = 'processes/main';
|
||||
}
|
||||
break;
|
||||
case 'PM_CASES':
|
||||
if ($RBAC->userCanAccess( 'PM_CASES' ) == 1) {
|
||||
if ($RBAC->userCanAccess('PM_CASES') == 1) {
|
||||
$url = 'cases/main';
|
||||
}
|
||||
break;
|
||||
case 'PM_USERS':
|
||||
if ($RBAC->userCanAccess( 'PM_USERS' ) == 1) {
|
||||
if ($RBAC->userCanAccess('PM_USERS') == 1) {
|
||||
$url = 'setup/main';
|
||||
}
|
||||
break;
|
||||
case 'PM_DASHBOARD':
|
||||
if ($RBAC->userCanAccess( 'PM_DASHBOARD' ) == 1) {
|
||||
if ($RBAC->userCanAccess('PM_DASHBOARD') == 1) {
|
||||
$url = 'dashboard/main';
|
||||
}
|
||||
break;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
case 'PM_STRATEGIC_DASHBOARD':
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=') && $RBAC->userCanAccess( 'PM_SETUP' ) == 1) {
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=') && $RBAC->userCanAccess('PM_SETUP') == 1) {
|
||||
$url = 'strategicDashboard/main';
|
||||
}
|
||||
break;
|
||||
@@ -444,16 +444,16 @@ class UsersProperties extends BaseUsersProperties
|
||||
}
|
||||
}
|
||||
|
||||
if (empty( $url )) {
|
||||
if ($RBAC->userCanAccess( 'PM_FACTORY' ) == 1) {
|
||||
if (empty($url)) {
|
||||
if ($RBAC->userCanAccess('PM_FACTORY') == 1) {
|
||||
$url = 'processes/main';
|
||||
} elseif ($RBAC->userCanAccess( 'PM_SETUP' ) == 1) {
|
||||
} elseif ($RBAC->userCanAccess('PM_SETUP') == 1) {
|
||||
$url = 'setup/main';
|
||||
} elseif ($RBAC->userCanAccess( 'PM_CASES' ) == 1) {
|
||||
} elseif ($RBAC->userCanAccess('PM_CASES') == 1) {
|
||||
$url = 'cases/main';
|
||||
} elseif ($RBAC->userCanAccess( 'PM_USERS' ) == 1) {
|
||||
} elseif ($RBAC->userCanAccess('PM_USERS') == 1) {
|
||||
$url = 'setup/main';
|
||||
} elseif ($RBAC->userCanAccess( 'PM_DASHBOARD' ) == 1) {
|
||||
} elseif ($RBAC->userCanAccess('PM_DASHBOARD') == 1) {
|
||||
$url = 'dashboard/dashboard';
|
||||
} else {
|
||||
$url = 'users/myInfo';
|
||||
@@ -463,4 +463,3 @@ class UsersProperties extends BaseUsersProperties
|
||||
return $baseUrl . $url;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,8 @@ class ListCanceledMapBuilder
|
||||
|
||||
$tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addPrimaryKey('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addColumn('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
@@ -83,8 +85,6 @@ class ListCanceledMapBuilder
|
||||
|
||||
$tMap->addColumn('APP_CANCELED_DATE', 'AppCanceledDate', 'int', CreoleTypes::TIMESTAMP, false, null);
|
||||
|
||||
$tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addColumn('DEL_PREVIOUS_USR_UID', 'DelPreviousUsrUid', 'string', CreoleTypes::VARCHAR, false, 32);
|
||||
|
||||
$tMap->addColumn('DEL_CURRENT_USR_USERNAME', 'DelCurrentUsrUsername', 'string', CreoleTypes::VARCHAR, false, 100);
|
||||
|
||||
@@ -79,7 +79,7 @@ class ObjectPermissionMapBuilder
|
||||
|
||||
$tMap->addColumn('OP_PARTICIPATE', 'OpParticipate', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addColumn('OP_OBJ_TYPE', 'OpObjType', 'string', CreoleTypes::VARCHAR, true, 15);
|
||||
$tMap->addColumn('OP_OBJ_TYPE', 'OpObjType', 'string', CreoleTypes::VARCHAR, true, 20);
|
||||
|
||||
$tMap->addColumn('OP_OBJ_UID', 'OpObjUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
@@ -115,7 +115,7 @@ class ObjectPermissionMapBuilder
|
||||
|
||||
$tMap->addValidator('OP_PARTICIPATE', 'required', 'propel.validator.RequiredValidator', '', 'Participation is required.');
|
||||
|
||||
$tMap->addValidator('OP_OBJ_TYPE', 'maxLength', 'propel.validator.MaxLengthValidator', '15', 'Object type can be no larger than 15 in size');
|
||||
$tMap->addValidator('OP_OBJ_TYPE', 'maxLength', 'propel.validator.MaxLengthValidator', '20', 'Object type can be no larger than 20 in size');
|
||||
|
||||
$tMap->addValidator('OP_OBJ_TYPE', 'required', 'propel.validator.RequiredValidator', '', 'Object type is required.');
|
||||
|
||||
|
||||
@@ -33,6 +33,12 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
|
||||
*/
|
||||
protected $app_uid = '';
|
||||
|
||||
/**
|
||||
* The value for the del_index field.
|
||||
* @var int
|
||||
*/
|
||||
protected $del_index = 0;
|
||||
|
||||
/**
|
||||
* The value for the usr_uid field.
|
||||
* @var string
|
||||
@@ -81,12 +87,6 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
|
||||
*/
|
||||
protected $app_canceled_date;
|
||||
|
||||
/**
|
||||
* The value for the del_index field.
|
||||
* @var int
|
||||
*/
|
||||
protected $del_index = 0;
|
||||
|
||||
/**
|
||||
* The value for the del_previous_usr_uid field.
|
||||
* @var string
|
||||
@@ -178,6 +178,17 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
|
||||
return $this->app_uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [del_index] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getDelIndex()
|
||||
{
|
||||
|
||||
return $this->del_index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [usr_uid] column value.
|
||||
*
|
||||
@@ -287,17 +298,6 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [del_index] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getDelIndex()
|
||||
{
|
||||
|
||||
return $this->del_index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [del_previous_usr_uid] column value.
|
||||
*
|
||||
@@ -504,6 +504,28 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
|
||||
|
||||
} // setAppUid()
|
||||
|
||||
/**
|
||||
* Set the value of [del_index] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setDelIndex($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is integer,
|
||||
// we will cast the input value to an int (if it is not).
|
||||
if ($v !== null && !is_int($v) && is_numeric($v)) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->del_index !== $v || $v === 0) {
|
||||
$this->del_index = $v;
|
||||
$this->modifiedColumns[] = ListCanceledPeer::DEL_INDEX;
|
||||
}
|
||||
|
||||
} // setDelIndex()
|
||||
|
||||
/**
|
||||
* Set the value of [usr_uid] column.
|
||||
*
|
||||
@@ -687,28 +709,6 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
|
||||
|
||||
} // setAppCanceledDate()
|
||||
|
||||
/**
|
||||
* Set the value of [del_index] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setDelIndex($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is integer,
|
||||
// we will cast the input value to an int (if it is not).
|
||||
if ($v !== null && !is_int($v) && is_numeric($v)) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->del_index !== $v || $v === 0) {
|
||||
$this->del_index = $v;
|
||||
$this->modifiedColumns[] = ListCanceledPeer::DEL_INDEX;
|
||||
}
|
||||
|
||||
} // setDelIndex()
|
||||
|
||||
/**
|
||||
* Set the value of [del_previous_usr_uid] column.
|
||||
*
|
||||
@@ -991,23 +991,23 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
|
||||
|
||||
$this->app_uid = $rs->getString($startcol + 0);
|
||||
|
||||
$this->usr_uid = $rs->getString($startcol + 1);
|
||||
$this->del_index = $rs->getInt($startcol + 1);
|
||||
|
||||
$this->tas_uid = $rs->getString($startcol + 2);
|
||||
$this->usr_uid = $rs->getString($startcol + 2);
|
||||
|
||||
$this->pro_uid = $rs->getString($startcol + 3);
|
||||
$this->tas_uid = $rs->getString($startcol + 3);
|
||||
|
||||
$this->app_number = $rs->getInt($startcol + 4);
|
||||
$this->pro_uid = $rs->getString($startcol + 4);
|
||||
|
||||
$this->app_title = $rs->getString($startcol + 5);
|
||||
$this->app_number = $rs->getInt($startcol + 5);
|
||||
|
||||
$this->app_pro_title = $rs->getString($startcol + 6);
|
||||
$this->app_title = $rs->getString($startcol + 6);
|
||||
|
||||
$this->app_tas_title = $rs->getString($startcol + 7);
|
||||
$this->app_pro_title = $rs->getString($startcol + 7);
|
||||
|
||||
$this->app_canceled_date = $rs->getTimestamp($startcol + 8, null);
|
||||
$this->app_tas_title = $rs->getString($startcol + 8);
|
||||
|
||||
$this->del_index = $rs->getInt($startcol + 9);
|
||||
$this->app_canceled_date = $rs->getTimestamp($startcol + 9, null);
|
||||
|
||||
$this->del_previous_usr_uid = $rs->getString($startcol + 10);
|
||||
|
||||
@@ -1244,31 +1244,31 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
|
||||
return $this->getAppUid();
|
||||
break;
|
||||
case 1:
|
||||
return $this->getUsrUid();
|
||||
return $this->getDelIndex();
|
||||
break;
|
||||
case 2:
|
||||
return $this->getTasUid();
|
||||
return $this->getUsrUid();
|
||||
break;
|
||||
case 3:
|
||||
return $this->getProUid();
|
||||
return $this->getTasUid();
|
||||
break;
|
||||
case 4:
|
||||
return $this->getAppNumber();
|
||||
return $this->getProUid();
|
||||
break;
|
||||
case 5:
|
||||
return $this->getAppTitle();
|
||||
return $this->getAppNumber();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getAppProTitle();
|
||||
return $this->getAppTitle();
|
||||
break;
|
||||
case 7:
|
||||
return $this->getAppTasTitle();
|
||||
return $this->getAppProTitle();
|
||||
break;
|
||||
case 8:
|
||||
return $this->getAppCanceledDate();
|
||||
return $this->getAppTasTitle();
|
||||
break;
|
||||
case 9:
|
||||
return $this->getDelIndex();
|
||||
return $this->getAppCanceledDate();
|
||||
break;
|
||||
case 10:
|
||||
return $this->getDelPreviousUsrUid();
|
||||
@@ -1324,15 +1324,15 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
|
||||
$keys = ListCanceledPeer::getFieldNames($keyType);
|
||||
$result = array(
|
||||
$keys[0] => $this->getAppUid(),
|
||||
$keys[1] => $this->getUsrUid(),
|
||||
$keys[2] => $this->getTasUid(),
|
||||
$keys[3] => $this->getProUid(),
|
||||
$keys[4] => $this->getAppNumber(),
|
||||
$keys[5] => $this->getAppTitle(),
|
||||
$keys[6] => $this->getAppProTitle(),
|
||||
$keys[7] => $this->getAppTasTitle(),
|
||||
$keys[8] => $this->getAppCanceledDate(),
|
||||
$keys[9] => $this->getDelIndex(),
|
||||
$keys[1] => $this->getDelIndex(),
|
||||
$keys[2] => $this->getUsrUid(),
|
||||
$keys[3] => $this->getTasUid(),
|
||||
$keys[4] => $this->getProUid(),
|
||||
$keys[5] => $this->getAppNumber(),
|
||||
$keys[6] => $this->getAppTitle(),
|
||||
$keys[7] => $this->getAppProTitle(),
|
||||
$keys[8] => $this->getAppTasTitle(),
|
||||
$keys[9] => $this->getAppCanceledDate(),
|
||||
$keys[10] => $this->getDelPreviousUsrUid(),
|
||||
$keys[11] => $this->getDelCurrentUsrUsername(),
|
||||
$keys[12] => $this->getDelCurrentUsrFirstname(),
|
||||
@@ -1379,31 +1379,31 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
|
||||
$this->setAppUid($value);
|
||||
break;
|
||||
case 1:
|
||||
$this->setUsrUid($value);
|
||||
$this->setDelIndex($value);
|
||||
break;
|
||||
case 2:
|
||||
$this->setTasUid($value);
|
||||
$this->setUsrUid($value);
|
||||
break;
|
||||
case 3:
|
||||
$this->setProUid($value);
|
||||
$this->setTasUid($value);
|
||||
break;
|
||||
case 4:
|
||||
$this->setAppNumber($value);
|
||||
$this->setProUid($value);
|
||||
break;
|
||||
case 5:
|
||||
$this->setAppTitle($value);
|
||||
$this->setAppNumber($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setAppProTitle($value);
|
||||
$this->setAppTitle($value);
|
||||
break;
|
||||
case 7:
|
||||
$this->setAppTasTitle($value);
|
||||
$this->setAppProTitle($value);
|
||||
break;
|
||||
case 8:
|
||||
$this->setAppCanceledDate($value);
|
||||
$this->setAppTasTitle($value);
|
||||
break;
|
||||
case 9:
|
||||
$this->setDelIndex($value);
|
||||
$this->setAppCanceledDate($value);
|
||||
break;
|
||||
case 10:
|
||||
$this->setDelPreviousUsrUid($value);
|
||||
@@ -1466,39 +1466,39 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[1], $arr)) {
|
||||
$this->setUsrUid($arr[$keys[1]]);
|
||||
$this->setDelIndex($arr[$keys[1]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[2], $arr)) {
|
||||
$this->setTasUid($arr[$keys[2]]);
|
||||
$this->setUsrUid($arr[$keys[2]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[3], $arr)) {
|
||||
$this->setProUid($arr[$keys[3]]);
|
||||
$this->setTasUid($arr[$keys[3]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[4], $arr)) {
|
||||
$this->setAppNumber($arr[$keys[4]]);
|
||||
$this->setProUid($arr[$keys[4]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[5], $arr)) {
|
||||
$this->setAppTitle($arr[$keys[5]]);
|
||||
$this->setAppNumber($arr[$keys[5]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[6], $arr)) {
|
||||
$this->setAppProTitle($arr[$keys[6]]);
|
||||
$this->setAppTitle($arr[$keys[6]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[7], $arr)) {
|
||||
$this->setAppTasTitle($arr[$keys[7]]);
|
||||
$this->setAppProTitle($arr[$keys[7]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[8], $arr)) {
|
||||
$this->setAppCanceledDate($arr[$keys[8]]);
|
||||
$this->setAppTasTitle($arr[$keys[8]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[9], $arr)) {
|
||||
$this->setDelIndex($arr[$keys[9]]);
|
||||
$this->setAppCanceledDate($arr[$keys[9]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[10], $arr)) {
|
||||
@@ -1560,6 +1560,10 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
|
||||
$criteria->add(ListCanceledPeer::APP_UID, $this->app_uid);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(ListCanceledPeer::DEL_INDEX)) {
|
||||
$criteria->add(ListCanceledPeer::DEL_INDEX, $this->del_index);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(ListCanceledPeer::USR_UID)) {
|
||||
$criteria->add(ListCanceledPeer::USR_UID, $this->usr_uid);
|
||||
}
|
||||
@@ -1592,10 +1596,6 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
|
||||
$criteria->add(ListCanceledPeer::APP_CANCELED_DATE, $this->app_canceled_date);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(ListCanceledPeer::DEL_INDEX)) {
|
||||
$criteria->add(ListCanceledPeer::DEL_INDEX, $this->del_index);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(ListCanceledPeer::DEL_PREVIOUS_USR_UID)) {
|
||||
$criteria->add(ListCanceledPeer::DEL_PREVIOUS_USR_UID, $this->del_previous_usr_uid);
|
||||
}
|
||||
@@ -1657,28 +1657,40 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
|
||||
$criteria = new Criteria(ListCanceledPeer::DATABASE_NAME);
|
||||
|
||||
$criteria->add(ListCanceledPeer::APP_UID, $this->app_uid);
|
||||
$criteria->add(ListCanceledPeer::DEL_INDEX, $this->del_index);
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the primary key for this object (row).
|
||||
* @return string
|
||||
* Returns the composite primary key for this object.
|
||||
* The array elements will be in same order as specified in XML.
|
||||
* @return array
|
||||
*/
|
||||
public function getPrimaryKey()
|
||||
{
|
||||
return $this->getAppUid();
|
||||
$pks = array();
|
||||
|
||||
$pks[0] = $this->getAppUid();
|
||||
|
||||
$pks[1] = $this->getDelIndex();
|
||||
|
||||
return $pks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic method to set the primary key (app_uid column).
|
||||
* Set the [composite] primary key.
|
||||
*
|
||||
* @param string $key Primary key.
|
||||
* @param array $keys The elements of the composite key (order must match the order in XML file).
|
||||
* @return void
|
||||
*/
|
||||
public function setPrimaryKey($key)
|
||||
public function setPrimaryKey($keys)
|
||||
{
|
||||
$this->setAppUid($key);
|
||||
|
||||
$this->setAppUid($keys[0]);
|
||||
|
||||
$this->setDelIndex($keys[1]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1710,8 +1722,6 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
|
||||
|
||||
$copyObj->setAppCanceledDate($this->app_canceled_date);
|
||||
|
||||
$copyObj->setDelIndex($this->del_index);
|
||||
|
||||
$copyObj->setDelPreviousUsrUid($this->del_previous_usr_uid);
|
||||
|
||||
$copyObj->setDelCurrentUsrUsername($this->del_current_usr_username);
|
||||
@@ -1739,6 +1749,8 @@ abstract class BaseListCanceled extends BaseObject implements Persistent
|
||||
|
||||
$copyObj->setAppUid(''); // this is a pkey column, so set to default value
|
||||
|
||||
$copyObj->setDelIndex('0'); // this is a pkey column, so set to default value
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,6 +34,9 @@ abstract class BaseListCanceledPeer
|
||||
/** the column name for the APP_UID field */
|
||||
const APP_UID = 'LIST_CANCELED.APP_UID';
|
||||
|
||||
/** the column name for the DEL_INDEX field */
|
||||
const DEL_INDEX = 'LIST_CANCELED.DEL_INDEX';
|
||||
|
||||
/** the column name for the USR_UID field */
|
||||
const USR_UID = 'LIST_CANCELED.USR_UID';
|
||||
|
||||
@@ -58,9 +61,6 @@ abstract class BaseListCanceledPeer
|
||||
/** the column name for the APP_CANCELED_DATE field */
|
||||
const APP_CANCELED_DATE = 'LIST_CANCELED.APP_CANCELED_DATE';
|
||||
|
||||
/** the column name for the DEL_INDEX field */
|
||||
const DEL_INDEX = 'LIST_CANCELED.DEL_INDEX';
|
||||
|
||||
/** the column name for the DEL_PREVIOUS_USR_UID field */
|
||||
const DEL_PREVIOUS_USR_UID = 'LIST_CANCELED.DEL_PREVIOUS_USR_UID';
|
||||
|
||||
@@ -105,9 +105,9 @@ abstract class BaseListCanceledPeer
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('AppUid', 'UsrUid', 'TasUid', 'ProUid', 'AppNumber', 'AppTitle', 'AppProTitle', 'AppTasTitle', 'AppCanceledDate', 'DelIndex', 'DelPreviousUsrUid', 'DelCurrentUsrUsername', 'DelCurrentUsrFirstname', 'DelCurrentUsrLastname', 'DelDelegateDate', 'DelInitDate', 'DelDueDate', 'DelPriority', 'ProId', 'UsrId', 'TasId', ),
|
||||
BasePeer::TYPE_COLNAME => array (ListCanceledPeer::APP_UID, ListCanceledPeer::USR_UID, ListCanceledPeer::TAS_UID, ListCanceledPeer::PRO_UID, ListCanceledPeer::APP_NUMBER, ListCanceledPeer::APP_TITLE, ListCanceledPeer::APP_PRO_TITLE, ListCanceledPeer::APP_TAS_TITLE, ListCanceledPeer::APP_CANCELED_DATE, ListCanceledPeer::DEL_INDEX, ListCanceledPeer::DEL_PREVIOUS_USR_UID, ListCanceledPeer::DEL_CURRENT_USR_USERNAME, ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME, ListCanceledPeer::DEL_CURRENT_USR_LASTNAME, ListCanceledPeer::DEL_DELEGATE_DATE, ListCanceledPeer::DEL_INIT_DATE, ListCanceledPeer::DEL_DUE_DATE, ListCanceledPeer::DEL_PRIORITY, ListCanceledPeer::PRO_ID, ListCanceledPeer::USR_ID, ListCanceledPeer::TAS_ID, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'USR_UID', 'TAS_UID', 'PRO_UID', 'APP_NUMBER', 'APP_TITLE', 'APP_PRO_TITLE', 'APP_TAS_TITLE', 'APP_CANCELED_DATE', 'DEL_INDEX', 'DEL_PREVIOUS_USR_UID', 'DEL_CURRENT_USR_USERNAME', 'DEL_CURRENT_USR_FIRSTNAME', 'DEL_CURRENT_USR_LASTNAME', 'DEL_DELEGATE_DATE', 'DEL_INIT_DATE', 'DEL_DUE_DATE', 'DEL_PRIORITY', 'PRO_ID', 'USR_ID', 'TAS_ID', ),
|
||||
BasePeer::TYPE_PHPNAME => array ('AppUid', 'DelIndex', 'UsrUid', 'TasUid', 'ProUid', 'AppNumber', 'AppTitle', 'AppProTitle', 'AppTasTitle', 'AppCanceledDate', 'DelPreviousUsrUid', 'DelCurrentUsrUsername', 'DelCurrentUsrFirstname', 'DelCurrentUsrLastname', 'DelDelegateDate', 'DelInitDate', 'DelDueDate', 'DelPriority', 'ProId', 'UsrId', 'TasId', ),
|
||||
BasePeer::TYPE_COLNAME => array (ListCanceledPeer::APP_UID, ListCanceledPeer::DEL_INDEX, ListCanceledPeer::USR_UID, ListCanceledPeer::TAS_UID, ListCanceledPeer::PRO_UID, ListCanceledPeer::APP_NUMBER, ListCanceledPeer::APP_TITLE, ListCanceledPeer::APP_PRO_TITLE, ListCanceledPeer::APP_TAS_TITLE, ListCanceledPeer::APP_CANCELED_DATE, ListCanceledPeer::DEL_PREVIOUS_USR_UID, ListCanceledPeer::DEL_CURRENT_USR_USERNAME, ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME, ListCanceledPeer::DEL_CURRENT_USR_LASTNAME, ListCanceledPeer::DEL_DELEGATE_DATE, ListCanceledPeer::DEL_INIT_DATE, ListCanceledPeer::DEL_DUE_DATE, ListCanceledPeer::DEL_PRIORITY, ListCanceledPeer::PRO_ID, ListCanceledPeer::USR_ID, ListCanceledPeer::TAS_ID, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'DEL_INDEX', 'USR_UID', 'TAS_UID', 'PRO_UID', 'APP_NUMBER', 'APP_TITLE', 'APP_PRO_TITLE', 'APP_TAS_TITLE', 'APP_CANCELED_DATE', 'DEL_PREVIOUS_USR_UID', 'DEL_CURRENT_USR_USERNAME', 'DEL_CURRENT_USR_FIRSTNAME', 'DEL_CURRENT_USR_LASTNAME', 'DEL_DELEGATE_DATE', 'DEL_INIT_DATE', 'DEL_DUE_DATE', 'DEL_PRIORITY', 'PRO_ID', 'USR_ID', 'TAS_ID', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, )
|
||||
);
|
||||
|
||||
@@ -118,9 +118,9 @@ abstract class BaseListCanceledPeer
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'UsrUid' => 1, 'TasUid' => 2, 'ProUid' => 3, 'AppNumber' => 4, 'AppTitle' => 5, 'AppProTitle' => 6, 'AppTasTitle' => 7, 'AppCanceledDate' => 8, 'DelIndex' => 9, 'DelPreviousUsrUid' => 10, 'DelCurrentUsrUsername' => 11, 'DelCurrentUsrFirstname' => 12, 'DelCurrentUsrLastname' => 13, 'DelDelegateDate' => 14, 'DelInitDate' => 15, 'DelDueDate' => 16, 'DelPriority' => 17, 'ProId' => 18, 'UsrId' => 19, 'TasId' => 20, ),
|
||||
BasePeer::TYPE_COLNAME => array (ListCanceledPeer::APP_UID => 0, ListCanceledPeer::USR_UID => 1, ListCanceledPeer::TAS_UID => 2, ListCanceledPeer::PRO_UID => 3, ListCanceledPeer::APP_NUMBER => 4, ListCanceledPeer::APP_TITLE => 5, ListCanceledPeer::APP_PRO_TITLE => 6, ListCanceledPeer::APP_TAS_TITLE => 7, ListCanceledPeer::APP_CANCELED_DATE => 8, ListCanceledPeer::DEL_INDEX => 9, ListCanceledPeer::DEL_PREVIOUS_USR_UID => 10, ListCanceledPeer::DEL_CURRENT_USR_USERNAME => 11, ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME => 12, ListCanceledPeer::DEL_CURRENT_USR_LASTNAME => 13, ListCanceledPeer::DEL_DELEGATE_DATE => 14, ListCanceledPeer::DEL_INIT_DATE => 15, ListCanceledPeer::DEL_DUE_DATE => 16, ListCanceledPeer::DEL_PRIORITY => 17, ListCanceledPeer::PRO_ID => 18, ListCanceledPeer::USR_ID => 19, ListCanceledPeer::TAS_ID => 20, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'USR_UID' => 1, 'TAS_UID' => 2, 'PRO_UID' => 3, 'APP_NUMBER' => 4, 'APP_TITLE' => 5, 'APP_PRO_TITLE' => 6, 'APP_TAS_TITLE' => 7, 'APP_CANCELED_DATE' => 8, 'DEL_INDEX' => 9, 'DEL_PREVIOUS_USR_UID' => 10, 'DEL_CURRENT_USR_USERNAME' => 11, 'DEL_CURRENT_USR_FIRSTNAME' => 12, 'DEL_CURRENT_USR_LASTNAME' => 13, 'DEL_DELEGATE_DATE' => 14, 'DEL_INIT_DATE' => 15, 'DEL_DUE_DATE' => 16, 'DEL_PRIORITY' => 17, 'PRO_ID' => 18, 'USR_ID' => 19, 'TAS_ID' => 20, ),
|
||||
BasePeer::TYPE_PHPNAME => array ('AppUid' => 0, 'DelIndex' => 1, 'UsrUid' => 2, 'TasUid' => 3, 'ProUid' => 4, 'AppNumber' => 5, 'AppTitle' => 6, 'AppProTitle' => 7, 'AppTasTitle' => 8, 'AppCanceledDate' => 9, 'DelPreviousUsrUid' => 10, 'DelCurrentUsrUsername' => 11, 'DelCurrentUsrFirstname' => 12, 'DelCurrentUsrLastname' => 13, 'DelDelegateDate' => 14, 'DelInitDate' => 15, 'DelDueDate' => 16, 'DelPriority' => 17, 'ProId' => 18, 'UsrId' => 19, 'TasId' => 20, ),
|
||||
BasePeer::TYPE_COLNAME => array (ListCanceledPeer::APP_UID => 0, ListCanceledPeer::DEL_INDEX => 1, ListCanceledPeer::USR_UID => 2, ListCanceledPeer::TAS_UID => 3, ListCanceledPeer::PRO_UID => 4, ListCanceledPeer::APP_NUMBER => 5, ListCanceledPeer::APP_TITLE => 6, ListCanceledPeer::APP_PRO_TITLE => 7, ListCanceledPeer::APP_TAS_TITLE => 8, ListCanceledPeer::APP_CANCELED_DATE => 9, ListCanceledPeer::DEL_PREVIOUS_USR_UID => 10, ListCanceledPeer::DEL_CURRENT_USR_USERNAME => 11, ListCanceledPeer::DEL_CURRENT_USR_FIRSTNAME => 12, ListCanceledPeer::DEL_CURRENT_USR_LASTNAME => 13, ListCanceledPeer::DEL_DELEGATE_DATE => 14, ListCanceledPeer::DEL_INIT_DATE => 15, ListCanceledPeer::DEL_DUE_DATE => 16, ListCanceledPeer::DEL_PRIORITY => 17, ListCanceledPeer::PRO_ID => 18, ListCanceledPeer::USR_ID => 19, ListCanceledPeer::TAS_ID => 20, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'DEL_INDEX' => 1, 'USR_UID' => 2, 'TAS_UID' => 3, 'PRO_UID' => 4, 'APP_NUMBER' => 5, 'APP_TITLE' => 6, 'APP_PRO_TITLE' => 7, 'APP_TAS_TITLE' => 8, 'APP_CANCELED_DATE' => 9, 'DEL_PREVIOUS_USR_UID' => 10, 'DEL_CURRENT_USR_USERNAME' => 11, 'DEL_CURRENT_USR_FIRSTNAME' => 12, 'DEL_CURRENT_USR_LASTNAME' => 13, 'DEL_DELEGATE_DATE' => 14, 'DEL_INIT_DATE' => 15, 'DEL_DUE_DATE' => 16, 'DEL_PRIORITY' => 17, 'PRO_ID' => 18, 'USR_ID' => 19, 'TAS_ID' => 20, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, )
|
||||
);
|
||||
|
||||
@@ -224,6 +224,8 @@ abstract class BaseListCanceledPeer
|
||||
|
||||
$criteria->addSelectColumn(ListCanceledPeer::APP_UID);
|
||||
|
||||
$criteria->addSelectColumn(ListCanceledPeer::DEL_INDEX);
|
||||
|
||||
$criteria->addSelectColumn(ListCanceledPeer::USR_UID);
|
||||
|
||||
$criteria->addSelectColumn(ListCanceledPeer::TAS_UID);
|
||||
@@ -240,8 +242,6 @@ abstract class BaseListCanceledPeer
|
||||
|
||||
$criteria->addSelectColumn(ListCanceledPeer::APP_CANCELED_DATE);
|
||||
|
||||
$criteria->addSelectColumn(ListCanceledPeer::DEL_INDEX);
|
||||
|
||||
$criteria->addSelectColumn(ListCanceledPeer::DEL_PREVIOUS_USR_UID);
|
||||
|
||||
$criteria->addSelectColumn(ListCanceledPeer::DEL_CURRENT_USR_USERNAME);
|
||||
@@ -479,6 +479,9 @@ abstract class BaseListCanceledPeer
|
||||
$comparison = $criteria->getComparison(ListCanceledPeer::APP_UID);
|
||||
$selectCriteria->add(ListCanceledPeer::APP_UID, $criteria->remove(ListCanceledPeer::APP_UID), $comparison);
|
||||
|
||||
$comparison = $criteria->getComparison(ListCanceledPeer::DEL_INDEX);
|
||||
$selectCriteria->add(ListCanceledPeer::DEL_INDEX, $criteria->remove(ListCanceledPeer::DEL_INDEX), $comparison);
|
||||
|
||||
} else {
|
||||
$criteria = $values->buildCriteria(); // gets full criteria
|
||||
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
||||
@@ -540,7 +543,22 @@ abstract class BaseListCanceledPeer
|
||||
} else {
|
||||
// it must be the primary key
|
||||
$criteria = new Criteria(self::DATABASE_NAME);
|
||||
$criteria->add(ListCanceledPeer::APP_UID, (array) $values, Criteria::IN);
|
||||
// primary key is composite; we therefore, expect
|
||||
// the primary key passed to be an array of pkey
|
||||
// values
|
||||
if (count($values) == count($values, COUNT_RECURSIVE)) {
|
||||
// array is not multi-dimensional
|
||||
$values = array($values);
|
||||
}
|
||||
$vals = array();
|
||||
foreach ($values as $value) {
|
||||
|
||||
$vals[0][] = $value[0];
|
||||
$vals[1][] = $value[1];
|
||||
}
|
||||
|
||||
$criteria->add(ListCanceledPeer::APP_UID, $vals[0], Criteria::IN);
|
||||
$criteria->add(ListCanceledPeer::DEL_INDEX, $vals[1], Criteria::IN);
|
||||
}
|
||||
|
||||
// Set the correct dbName
|
||||
@@ -600,51 +618,23 @@ abstract class BaseListCanceledPeer
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single object by pkey.
|
||||
*
|
||||
* @param mixed $pk the primary key.
|
||||
* @param Connection $con the connection to use
|
||||
* Retrieve object using using composite pkey values.
|
||||
* @param string $app_uid
|
||||
* @param int $del_index
|
||||
* @param Connection $con
|
||||
* @return ListCanceled
|
||||
*/
|
||||
public static function retrieveByPK($pk, $con = null)
|
||||
public static function retrieveByPK($app_uid, $del_index, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$criteria = new Criteria(ListCanceledPeer::DATABASE_NAME);
|
||||
|
||||
$criteria->add(ListCanceledPeer::APP_UID, $pk);
|
||||
|
||||
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(ListCanceledPeer::APP_UID, $app_uid);
|
||||
$criteria->add(ListCanceledPeer::DEL_INDEX, $del_index);
|
||||
$v = ListCanceledPeer::doSelect($criteria, $con);
|
||||
|
||||
return !empty($v) > 0 ? $v[0] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve multiple objects by pkey.
|
||||
*
|
||||
* @param array $pks List of primary keys
|
||||
* @param Connection $con the connection to use
|
||||
* @throws PropelException Any exceptions caught during processing will be
|
||||
* rethrown wrapped into a PropelException.
|
||||
*/
|
||||
public static function retrieveByPKs($pks, $con = null)
|
||||
{
|
||||
if ($con === null) {
|
||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||
}
|
||||
|
||||
$objs = null;
|
||||
if (empty($pks)) {
|
||||
$objs = array();
|
||||
} else {
|
||||
$criteria = new Criteria();
|
||||
$criteria->add(ListCanceledPeer::APP_UID, $pks, Criteria::IN);
|
||||
$objs = ListCanceledPeer::doSelect($criteria, $con);
|
||||
}
|
||||
return $objs;
|
||||
return !empty($v) ? $v[0] : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ use ProcessMaker\Core\System;
|
||||
*/
|
||||
class Zimbra
|
||||
{
|
||||
|
||||
public $debug = false;
|
||||
public $error;
|
||||
protected $_connected = false; // boolean to determine if the connect function has been called
|
||||
@@ -119,7 +118,6 @@ class Zimbra
|
||||
$option_string = '';
|
||||
|
||||
try {
|
||||
|
||||
$soap = '<CreateAccountRequest xmlns="urn:zimbraAccount">
|
||||
<name>' . $name . '@' . $this->_server1 . '</name>
|
||||
<password>' . $password . '</password>' . $option_string . '
|
||||
@@ -820,7 +818,6 @@ class Zimbra
|
||||
protected function message($message)
|
||||
{
|
||||
if ($this->debug) {
|
||||
|
||||
$filter = new InputFilter();
|
||||
$message = $filter->xssFilterHard($message);
|
||||
echo $message;
|
||||
@@ -843,7 +840,6 @@ class Zimbra
|
||||
*/
|
||||
protected function soapRequest($body, $header = false, $connecting = false)
|
||||
{
|
||||
|
||||
$filter = new InputFilter();
|
||||
|
||||
if (!$connecting && !$this->_connected) {
|
||||
@@ -865,7 +861,7 @@ class Zimbra
|
||||
|
||||
curl_setopt($this->_curl, CURLOPT_POSTFIELDS, $soap_message);
|
||||
|
||||
$this->_curl = $filter->xssFilterHard($this->_curl,"url");
|
||||
$this->_curl = $filter->xssFilterHard($this->_curl, "url");
|
||||
$response = curl_exec($this->_curl);
|
||||
if (!$response) {
|
||||
$this->error = 'ERROR: curl_exec - (' . curl_errno($this->_curl) . ') ' . curl_error($this->_curl);
|
||||
@@ -928,7 +924,6 @@ class Zimbra
|
||||
// this is our target
|
||||
$ret = array();
|
||||
foreach ($values as $key => $val) {
|
||||
|
||||
switch ($val['type']) {
|
||||
case 'open':
|
||||
array_push($hash_stack, $val['tag']);
|
||||
@@ -983,7 +978,7 @@ class Zimbra
|
||||
|
||||
// does the current element refer to a list
|
||||
if (sizeof($elements) > 0) {
|
||||
$array[$element][sizeof($array[$element]) - 1] = &$this->composeArray($array[$element][sizeof($array[$element]) - 1], $elements, $value);
|
||||
$array[$element][sizeof($array[$element]) - 1] = $this->composeArray($array[$element][sizeof($array[$element]) - 1], $elements, $value);
|
||||
} else {
|
||||
// if (is_array($value))
|
||||
$array[$element][sizeof($array[$element])] = $value;
|
||||
|
||||
@@ -25,8 +25,9 @@
|
||||
|
||||
if (defined('PATH_DB') && !empty(config("system.workspace"))) {
|
||||
|
||||
if (!file_exists(PATH_DB . config("system.workspace") . '/db.php'))
|
||||
if (!file_exists(PATH_DB . config("system.workspace") . '/db.php')) {
|
||||
throw new Exception("Could not find db.php in current workspace " . config("system.workspace"));
|
||||
}
|
||||
|
||||
require_once(PATH_DB . config("system.workspace") . '/db.php');
|
||||
//to do: enable for other databases
|
||||
@@ -63,7 +64,15 @@ if (defined('PATH_DB') && !empty(config("system.workspace"))) {
|
||||
|
||||
$pro ['datasources']['rp']['connection'] = $dsnReport;
|
||||
$pro ['datasources']['rp']['adapter'] = DB_ADAPTER;
|
||||
|
||||
|
||||
$dbHost = explode(':', DB_HOST);
|
||||
config(['database.connections.workflow.host' => $dbHost[0]]);
|
||||
config(['database.connections.workflow.database' => DB_NAME]);
|
||||
config(['database.connections.workflow.username' => DB_USER]);
|
||||
config(['database.connections.workflow.password' => DB_PASS]);
|
||||
if (count($dbHost) > 1) {
|
||||
config(['database.connections.workflow.port' => $dbHost[1]]);
|
||||
}
|
||||
}
|
||||
|
||||
$pro ['datasources']['dbarray']['connection'] = 'dbarray://user:pass@localhost/pm_os';
|
||||
|
||||
44
workflow/engine/config/propel.mysqli.ini
Normal file
44
workflow/engine/config/propel.mysqli.ini
Normal file
@@ -0,0 +1,44 @@
|
||||
propel.targetPackage = classes.model
|
||||
propel.packageObjectModel = true
|
||||
propel.project = opensource
|
||||
propel.database = mysql
|
||||
propel.database.createUrl = mysql://root@localhost/
|
||||
propel.database.url = mysql://root@localhost/base_workflow
|
||||
|
||||
propel.addGenericAccessors = true
|
||||
propel.addGenericMutators = true
|
||||
propel.addTimeStamp = false
|
||||
|
||||
propel.schema.validate = false
|
||||
|
||||
; directories
|
||||
propel.home = .
|
||||
propel.output.dir = .
|
||||
propel.schema.dir = ${propel.output.dir}config
|
||||
propel.conf.dir = ${propel.output.dir}config
|
||||
propel.phpconf.dir = ${propel.output.dir}config
|
||||
propel.sql.dir = ${propel.output.dir}data/mysqli
|
||||
propel.runtime.conf.file = runtime-conf.xml
|
||||
propel.php.dir = ${propel.output.dir}
|
||||
propel.default.schema.basename = schema
|
||||
propel.datadump.mapper.from = *schema.xml
|
||||
propel.datadump.mapper.to = *data.xml
|
||||
|
||||
; builder settings
|
||||
;_propel.builder.peer.class = addon.propel.builder.SfPeerBuilder
|
||||
;propel.builder.object.class = addon.propel.builder.SfObjectBuilder
|
||||
|
||||
;propel.builder.objectstub.class = addon.propel.builder.SfExtensionObjectBuilder
|
||||
;propel.builder.peerstub.class = addon.propel.builder.SfExtensionPeerBuilder
|
||||
;propel.builder.objectmultiextend.class = addon.propel.builder.SfMultiExtendObjectBuilder
|
||||
;propel.builder.mapbuilder.class = addon.propel.builder.SfMapBuilderBuilder
|
||||
propel.builder.interface.class = propel.engine.builder.om.php5.PHP5InterfaceBuilder
|
||||
propel.builder.node.class = propel.engine.builder.om.php5.PHP5NodeBuilder
|
||||
propel.builder.nodepeer.class = propel.engine.builder.om.php5.PHP5NodePeerBuilder
|
||||
propel.builder.nodestub.class = propel.engine.builder.om.php5.PHP5ExtensionNodeBuilder
|
||||
propel.builder.nodepeerstub.class = propel.engine.builder.om.php5.PHP5ExtensionNodePeerBuilder
|
||||
|
||||
propel.builder.addIncludes = false
|
||||
propel.builder.addComments = false
|
||||
|
||||
propel.builder.addBehaviors = false
|
||||
@@ -1998,7 +1998,7 @@
|
||||
<column name="OP_USER_RELATION" type="INTEGER" required="true" default="0"/>
|
||||
<column name="OP_TASK_SOURCE" type="VARCHAR" size="32" required="" default="0"/>
|
||||
<column name="OP_PARTICIPATE" type="INTEGER" required="true" default="0"/>
|
||||
<column name="OP_OBJ_TYPE" type="VARCHAR" size="15" required="true" default="0"/>
|
||||
<column name="OP_OBJ_TYPE" type="VARCHAR" size="20" required="true" default="0"/>
|
||||
<column name="OP_OBJ_UID" type="VARCHAR" size="32" required="true" default="0"/>
|
||||
<column name="OP_ACTION" type="VARCHAR" size="10" required="true" default="0"/>
|
||||
<column name="OP_CASE_STATUS" type="VARCHAR" size="10" required="false" default="0"/>
|
||||
@@ -2031,7 +2031,7 @@
|
||||
<rule name="required" message="Participation is required."/>
|
||||
</validator>
|
||||
<validator column="OP_OBJ_TYPE">
|
||||
<rule name="maxLength" value="15" message="Object type can be no larger than ${value} in size"/>
|
||||
<rule name="maxLength" value="20" message="Object type can be no larger than ${value} in size"/>
|
||||
<rule name="required" message="Object type is required."/>
|
||||
</validator>
|
||||
<validator column="OP_OBJ_UID">
|
||||
@@ -4180,7 +4180,7 @@
|
||||
<column name="ADDON_NICK" type="VARCHAR" size="255" required="true"/>
|
||||
<column name="ADDON_DOWNLOAD_FILENAME" type="VARCHAR" size="1024" required="false"/>
|
||||
<column name="ADDON_DESCRIPTION" type="VARCHAR" size="2048" required="false"/>
|
||||
<column name="ADDON_STATE" type="VARCHAR" size="255" required="true"/>
|
||||
<column name="ADDON_STATE" type="VARCHAR" size="255" required="true" default=""/>
|
||||
<column name="ADDON_STATE_CHANGED" type="TIMESTAMP" required="false"/>
|
||||
<column name="ADDON_STATUS" type="VARCHAR" size="255" required="true"/>
|
||||
<column name="ADDON_VERSION" type="VARCHAR" size="255" required="true"/>
|
||||
@@ -4624,6 +4624,7 @@
|
||||
<parameter name="Comment" value="Canceled list"/>
|
||||
</vendor>
|
||||
<column name="APP_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/>
|
||||
<column name="DEL_INDEX" type="INTEGER" required="true" primaryKey="true" default="0"/>
|
||||
<column name="USR_UID" type="VARCHAR" size="32" required="true" default=""/>
|
||||
<column name="TAS_UID" type="VARCHAR" size="32" required="true" default=""/>
|
||||
<column name="PRO_UID" type="VARCHAR" size="32" required="true" default=""/>
|
||||
@@ -4632,7 +4633,6 @@
|
||||
<column name="APP_PRO_TITLE" type="LONGVARCHAR" required="false"/>
|
||||
<column name="APP_TAS_TITLE" type="LONGVARCHAR" required="false"/>
|
||||
<column name="APP_CANCELED_DATE" type="TIMESTAMP" required="false"/>
|
||||
<column name="DEL_INDEX" type="INTEGER" required="true" default="0"/>
|
||||
<column name="DEL_PREVIOUS_USR_UID" type="VARCHAR" size="32" default=""/>
|
||||
<column name="DEL_CURRENT_USR_USERNAME" type="VARCHAR" size="100" default=""/>
|
||||
<column name="DEL_CURRENT_USR_FIRSTNAME" type="VARCHAR" size="50" default=""/>
|
||||
|
||||
@@ -2,7 +2,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: ProcessMaker (Branch 3.2.3)\n"
|
||||
"POT-Creation-Date: \n"
|
||||
"PO-Revision-Date: 2017-11-22 20:50:02\n"
|
||||
"PO-Revision-Date: 2018-02-19 20:22:41\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Colosa Developers Team <developers@colosa.com>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -8321,6 +8321,18 @@ msgstr "The file {filename} doesn't contain class: {className}"
|
||||
msgid "File \"{0}\" imported successfully."
|
||||
msgstr "File \"{0}\" imported successfully."
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_FILE_LOG_CREATED
|
||||
#: LABEL/ID_FILE_LOG_CREATED
|
||||
msgid "Created on"
|
||||
msgstr "Created on"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_FILE_LOG_SIZE
|
||||
#: LABEL/ID_FILE_LOG_SIZE
|
||||
msgid "File size"
|
||||
msgstr "File size"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_FILE_NAME
|
||||
#: LABEL/ID_FILE_NAME
|
||||
@@ -8783,6 +8795,12 @@ msgstr "Displaying emails {0} - {1} of {2}"
|
||||
msgid "Displaying events {0} - {1} of {2}"
|
||||
msgstr "Displaying events {0} - {1} of {2}"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_GRID_PAGE_DISPLAYING_FILE_LOGS
|
||||
#: LABEL/ID_GRID_PAGE_DISPLAYING_FILE_LOGS
|
||||
msgid "Displaying log files {0} - {1} of {2}"
|
||||
msgstr "Displaying log files {0} - {1} of {2}"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_GRID_PAGE_DISPLAYING_GROUPS_MESSAGE
|
||||
#: LABEL/ID_GRID_PAGE_DISPLAYING_GROUPS_MESSAGE
|
||||
@@ -9911,6 +9929,18 @@ msgstr "Insufficient privileges to execute this function"
|
||||
msgid "INT"
|
||||
msgstr "INT"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_INTERMEDIATE_CATCH_MESSAGE_EVENT
|
||||
#: LABEL/ID_INTERMEDIATE_CATCH_MESSAGE_EVENT
|
||||
msgid "Untitled - Intermediate Send Message Event"
|
||||
msgstr "Untitled - Intermediate Send Message Event"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_INTERMEDIATE_CATCH_TIMER_EVENT
|
||||
#: LABEL/ID_INTERMEDIATE_CATCH_TIMER_EVENT
|
||||
msgid "Untitled - Intermediate Timer Event"
|
||||
msgstr "Untitled - Intermediate Timer Event"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_INTERMEDIATE_MESSAGE_EVENT
|
||||
#: LABEL/ID_INTERMEDIATE_MESSAGE_EVENT
|
||||
@@ -9935,6 +9965,18 @@ msgstr "Intermediate Timer Event (Multiple Event)"
|
||||
msgid "[LABEL/ID_INTERMEDIATE_TIMER_EVENTS] Intermediate Timer Event (Multiple Event)"
|
||||
msgstr "Intermediate Timer Event (Multiple Event)"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_INTERMEDIATE_THROW_EMAIL_EVENT
|
||||
#: LABEL/ID_INTERMEDIATE_THROW_EMAIL_EVENT
|
||||
msgid "Untitled - Intermediate Email Event"
|
||||
msgstr "Untitled - Intermediate Email Event"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_INTERMEDIATE_THROW_MESSAGE_EVENT
|
||||
#: LABEL/ID_INTERMEDIATE_THROW_MESSAGE_EVENT
|
||||
msgid "Untitled - Intermediate Receive Message Event"
|
||||
msgstr "Untitled - Intermediate Receive Message Event"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_INTERNATIONAL
|
||||
#: LABEL/ID_INTERNATIONAL
|
||||
@@ -10199,12 +10241,6 @@ msgstr "Issued to"
|
||||
msgid "is not registered!"
|
||||
msgstr "is not registered!"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_THE_USERNAME_EMAIL_IS_INCORRECT
|
||||
#: LABEL/ID_THE_USERNAME_EMAIL_IS_INCORRECT
|
||||
msgid "The username or email is incorrect"
|
||||
msgstr "The username or email is incorrect"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_IS_REQUIRED
|
||||
#: LABEL/ID_IS_REQUIRED
|
||||
@@ -10949,6 +10985,12 @@ msgstr "toolbar placement"
|
||||
msgid "(HH:MM) Format 24 hrs."
|
||||
msgstr "(HH:MM) Format 24 hrs."
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_0a10134c1999989ce854ac519eb97249
|
||||
#: LABEL/ID_MAFE_0a10134c1999989ce854ac519eb97249
|
||||
msgid "Web Entry Anonymous Authentication"
|
||||
msgstr "Web Entry Anonymous Authentication"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_0a33cdf242201623275b9897d8b4d8c4
|
||||
#: LABEL/ID_MAFE_0a33cdf242201623275b9897d8b4d8c4
|
||||
@@ -10997,12 +11039,24 @@ msgstr "View all"
|
||||
msgid "Please configure a script to send a signal."
|
||||
msgstr "Please configure a script to send a signal."
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_0b9d04ab06dac3da0142bb369637bfa4
|
||||
#: LABEL/ID_MAFE_0b9d04ab06dac3da0142bb369637bfa4
|
||||
msgid "qr code"
|
||||
msgstr "qr code"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_0bb8309239953b782fec18706fe60b4a
|
||||
#: LABEL/ID_MAFE_0bb8309239953b782fec18706fe60b4a
|
||||
msgid "Digital"
|
||||
msgstr "Digital"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_0bf7c19f7eac3bfa5ad960a50ad602dc
|
||||
#: LABEL/ID_MAFE_0bf7c19f7eac3bfa5ad960a50ad602dc
|
||||
msgid "[LABEL/ID_MAFE_0bf7c19f7eac3bfa5ad960a50ad602dc] subtitle"
|
||||
msgstr "subtitle"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_0c06d45a9f58aba5f4c4d50b03f65b04
|
||||
#: LABEL/ID_MAFE_0c06d45a9f58aba5f4c4d50b03f65b04
|
||||
@@ -11837,6 +11891,12 @@ msgstr "An unexpected error while deleting the step, please try again later."
|
||||
msgid "B5"
|
||||
msgstr "B5"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_2a304a1348456ccd2234cd71a81bd338
|
||||
#: LABEL/ID_MAFE_2a304a1348456ccd2234cd71a81bd338
|
||||
msgid "[LABEL/ID_MAFE_2a304a1348456ccd2234cd71a81bd338] link"
|
||||
msgstr "link"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_2a37d240713f300cf06d390798b0efad
|
||||
#: LABEL/ID_MAFE_2a37d240713f300cf06d390798b0efad
|
||||
@@ -11993,6 +12053,18 @@ msgstr "Store value in"
|
||||
msgid "is duplicated."
|
||||
msgstr "is duplicated."
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_30a2dae0a135701b862050465b3e4e97
|
||||
#: LABEL/ID_MAFE_30a2dae0a135701b862050465b3e4e97
|
||||
msgid "Triggers after and before a step are not supported when working offline"
|
||||
msgstr "Triggers after and before a step are not supported when working offline"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_30c40215e6d00c574ca23451003db9b9
|
||||
#: LABEL/ID_MAFE_30c40215e6d00c574ca23451003db9b9
|
||||
msgid "[LABEL/ID_MAFE_30c40215e6d00c574ca23451003db9b9] checkgroup"
|
||||
msgstr "checkgroup"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_3120001274fa32a921770c1b41e6dc0a
|
||||
#: LABEL/ID_MAFE_3120001274fa32a921770c1b41e6dc0a
|
||||
@@ -12467,6 +12539,12 @@ msgstr "August"
|
||||
msgid "Messages"
|
||||
msgstr "Messages"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_41e80c3ce414de15ab19d996f7072429
|
||||
#: LABEL/ID_MAFE_41e80c3ce414de15ab19d996f7072429
|
||||
msgid "fileupload"
|
||||
msgstr "fileupload"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_41fffd09332a35491d3bed5a34f91410
|
||||
#: LABEL/ID_MAFE_41fffd09332a35491d3bed5a34f91410
|
||||
@@ -12479,6 +12557,12 @@ msgstr "http://eonasdan.github.io/bootstrap-datetimepicker/</a>"
|
||||
msgid "[LABEL/ID_MAFE_42184184a95464c63c790acc3a69e564] Routing History"
|
||||
msgstr "Routing History"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_421b47ffd946ca083b65cd668c6b17e6
|
||||
#: LABEL/ID_MAFE_421b47ffd946ca083b65cd668c6b17e6
|
||||
msgid "video"
|
||||
msgstr "video"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_4252b72e6ebcd4d4b4c2e46a786f03d2
|
||||
#: LABEL/ID_MAFE_4252b72e6ebcd4d4b4c2e46a786f03d2
|
||||
@@ -12833,6 +12917,12 @@ msgstr "Generate Link"
|
||||
msgid "Please insert variable before adding to the list."
|
||||
msgstr "Please insert variable before adding to the list."
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_5174307b9097d47b1a506bc8171c2bb3
|
||||
#: LABEL/ID_MAFE_5174307b9097d47b1a506bc8171c2bb3
|
||||
msgid "textbox"
|
||||
msgstr "textbox"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_5174d1309f275ba6f275db3af9eb3e18
|
||||
#: LABEL/ID_MAFE_5174d1309f275ba6f275db3af9eb3e18
|
||||
@@ -13607,6 +13697,12 @@ msgstr "Inclusive Gateway"
|
||||
msgid "Assignee saved successfully"
|
||||
msgstr "Assignee saved successfully"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_6be8bfc7078373aa92b3a862b5253e7e
|
||||
#: LABEL/ID_MAFE_6be8bfc7078373aa92b3a862b5253e7e
|
||||
msgid "Mobile controls"
|
||||
msgstr "Mobile controls"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_6c24f6923944d3f9d84bcf924661abff
|
||||
#: LABEL/ID_MAFE_6c24f6923944d3f9d84bcf924661abff
|
||||
@@ -13769,12 +13865,6 @@ msgstr "Properties saved successfully"
|
||||
msgid "Error Update File"
|
||||
msgstr "Error Update File"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_7215ee9c7d9dc229d2921a40e899ec5f
|
||||
#: LABEL/ID_MAFE_7215ee9c7d9dc229d2921a40e899ec5f
|
||||
msgid "[LABEL/ID_MAFE_7215ee9c7d9dc229d2921a40e899ec5f] "
|
||||
msgstr ""
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_725255d7ccc0cf426c1da6abe0afe7e4
|
||||
#: LABEL/ID_MAFE_725255d7ccc0cf426c1da6abe0afe7e4
|
||||
@@ -13907,6 +13997,12 @@ msgstr "Sub-process"
|
||||
msgid "Routing"
|
||||
msgstr "Routing"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_78805a221a988e79ef3f42d7c5bfd418
|
||||
#: LABEL/ID_MAFE_78805a221a988e79ef3f42d7c5bfd418
|
||||
msgid "image"
|
||||
msgstr "image"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_788287625aa640447c5d9fff50644915
|
||||
#: LABEL/ID_MAFE_788287625aa640447c5d9fff50644915
|
||||
@@ -15335,6 +15431,12 @@ msgstr "Do you want to delete this permission?"
|
||||
msgid "setOrientation(): parameter is not valid"
|
||||
msgstr "setOrientation(): parameter is not valid"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_a5ca0b5894324f8bb54bb9fffad29d1e
|
||||
#: LABEL/ID_MAFE_a5ca0b5894324f8bb54bb9fffad29d1e
|
||||
msgid "audio"
|
||||
msgstr "audio"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_a603905470e2a5b8c13e96b579ef0dba
|
||||
#: LABEL/ID_MAFE_a603905470e2a5b8c13e96b579ef0dba
|
||||
@@ -15509,6 +15611,12 @@ msgstr "Text to search"
|
||||
msgid "Create Message Type"
|
||||
msgstr "Create Message Type"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_ac201fd270c3b96beab24f2829780ab2
|
||||
#: LABEL/ID_MAFE_ac201fd270c3b96beab24f2829780ab2
|
||||
msgid "signature"
|
||||
msgstr "signature"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_ac48a7776ff0e8dc13b0a1300fc0a75f
|
||||
#: LABEL/ID_MAFE_ac48a7776ff0e8dc13b0a1300fc0a75f
|
||||
@@ -15533,6 +15641,12 @@ msgstr "required"
|
||||
msgid "forms"
|
||||
msgstr "forms"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_acd6337dfeb8a29685e3856bfa76756c
|
||||
#: LABEL/ID_MAFE_acd6337dfeb8a29685e3856bfa76756c
|
||||
msgid "History of use"
|
||||
msgstr "History of use"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_ad7bdeed2bf3d72e17abe1a8d0508958
|
||||
#: LABEL/ID_MAFE_ad7bdeed2bf3d72e17abe1a8d0508958
|
||||
@@ -15761,6 +15875,12 @@ msgstr "<tr><td><b>Hour</b></td><td>H</td><td>0 1 ... 22 23</td></tr><tr><td></t
|
||||
msgid "[LABEL/ID_MAFE_b5a7adde1af5c87d7fd797b6245c2a39] Description"
|
||||
msgstr "Description"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_b5ceb80c90c6b834060fcd7e0d2c0c28
|
||||
#: LABEL/ID_MAFE_b5ceb80c90c6b834060fcd7e0d2c0c28
|
||||
msgid "subform"
|
||||
msgstr "subform"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_b5d4d25fe3fa9f8263b5f279a372b709
|
||||
#: LABEL/ID_MAFE_b5d4d25fe3fa9f8263b5f279a372b709
|
||||
@@ -16259,6 +16379,12 @@ msgstr "OutPut Document (s)"
|
||||
msgid "Execute a trigger when a case is opened"
|
||||
msgstr "Execute a trigger when a case is opened"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_c79bdf421714f5087fc34b7c538b6807
|
||||
#: LABEL/ID_MAFE_c79bdf421714f5087fc34b7c538b6807
|
||||
msgid "[LABEL/ID_MAFE_c79bdf421714f5087fc34b7c538b6807] submit"
|
||||
msgstr "submit"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_c7f8f8652db6d74e086d297129179d2f
|
||||
#: LABEL/ID_MAFE_c7f8f8652db6d74e086d297129179d2f
|
||||
@@ -16451,6 +16577,12 @@ msgstr "multiple"
|
||||
msgid "[LABEL/ID_MAFE_ce4d4b319a571fda7b689cee71432d5d] Custom Trigger"
|
||||
msgstr "Custom Trigger"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_ce50a09343724eb82df11390e2c1de18
|
||||
#: LABEL/ID_MAFE_ce50a09343724eb82df11390e2c1de18
|
||||
msgid "[LABEL/ID_MAFE_ce50a09343724eb82df11390e2c1de18] button"
|
||||
msgstr "button"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_ce5f8a0a2fea8e45ddfd3fe51ae60703
|
||||
#: LABEL/ID_MAFE_ce5f8a0a2fea8e45ddfd3fe51ae60703
|
||||
@@ -16901,6 +17033,12 @@ msgstr "Variable for Case priority"
|
||||
msgid "Parallel gateway"
|
||||
msgstr "Parallel gateway"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_dfeaaeb4316477bd556ea5e8c3295887
|
||||
#: LABEL/ID_MAFE_dfeaaeb4316477bd556ea5e8c3295887
|
||||
msgid "datetime"
|
||||
msgstr "datetime"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_e019dd49d439bb6d6765f7d2f6915333
|
||||
#: LABEL/ID_MAFE_e019dd49d439bb6d6765f7d2f6915333
|
||||
@@ -17147,6 +17285,12 @@ msgstr "Days"
|
||||
msgid "- Select an input document -"
|
||||
msgstr "- Select an input document -"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_e889b1ca9624a9fbe23c4f062d7e5f01
|
||||
#: LABEL/ID_MAFE_e889b1ca9624a9fbe23c4f062d7e5f01
|
||||
msgid "geomap"
|
||||
msgstr "geomap"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_e8be55bf3a30501aef09d2e74de97976
|
||||
#: LABEL/ID_MAFE_e8be55bf3a30501aef09d2e74de97976
|
||||
@@ -17435,6 +17579,12 @@ msgstr "Flow"
|
||||
msgid "Step editing successfully."
|
||||
msgstr "Step editing successfully."
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_f1e5d7a5fe13498abbdeb0f1f19136a8
|
||||
#: LABEL/ID_MAFE_f1e5d7a5fe13498abbdeb0f1f19136a8
|
||||
msgid "panel"
|
||||
msgstr "panel"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_f217bd2ed27f82d5c856035f95801373
|
||||
#: LABEL/ID_MAFE_f217bd2ed27f82d5c856035f95801373
|
||||
@@ -17765,6 +17915,12 @@ msgstr "Saved correctly"
|
||||
msgid "textfield"
|
||||
msgstr "textfield"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_ff4a008470319a22d9cf3d14af485977
|
||||
#: LABEL/ID_MAFE_ff4a008470319a22d9cf3d14af485977
|
||||
msgid "[LABEL/ID_MAFE_ff4a008470319a22d9cf3d14af485977] grid"
|
||||
msgstr "grid"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_MAFE_ffc1dca70df11105d22d9f427a9e260b
|
||||
#: LABEL/ID_MAFE_ffc1dca70df11105d22d9f427a9e260b
|
||||
@@ -19109,6 +19265,12 @@ msgstr "After routing notify the next assigned user(s)"
|
||||
msgid "Notify users of case"
|
||||
msgstr "Notify users of case"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_NOT_ABLE_REASSIGN
|
||||
#: LABEL/ID_NOT_ABLE_REASSIGN
|
||||
msgid "You are not able to reassign cases of this process."
|
||||
msgstr "You are not able to reassign cases of this process."
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_NOT_AVAILABLE_DATABASE
|
||||
#: LABEL/ID_NOT_AVAILABLE_DATABASE
|
||||
@@ -20117,6 +20279,12 @@ msgstr "PHP Information"
|
||||
msgid "php-mssql is Not Installed"
|
||||
msgstr "php-mssql is Not Installed"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_PHP_MYSQLI_NOT_INSTALL
|
||||
#: LABEL/ID_PHP_MYSQLI_NOT_INSTALL
|
||||
msgid "php-mysqli is Not Installed"
|
||||
msgstr "php-mysqli is Not Installed"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_PHP_MYSQL_NOT _INSTALL
|
||||
#: LABEL/ID_PHP_MYSQL_NOT _INSTALL
|
||||
@@ -21056,8 +21224,8 @@ msgstr "Open SSL is optional"
|
||||
# TRANSLATION
|
||||
# LABEL/ID_PROCESSMAKER_REQUIREMENTS_PHP
|
||||
#: LABEL/ID_PROCESSMAKER_REQUIREMENTS_PHP
|
||||
msgid "PHP recommended version 5.6 or higher (7.0 not supported)"
|
||||
msgstr "PHP recommended version 5.6 or higher (7.0 not supported)"
|
||||
msgid "PHP recommended version 5.6 or higher"
|
||||
msgstr "PHP recommended version 5.6 or higher"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_PROCESSMAKER_REQUIREMENTS_SOAP
|
||||
@@ -21737,6 +21905,12 @@ msgstr "Case #{APP_NUMBER} was reassigned to user {USER}."
|
||||
msgid "Reassign All Cases by Task"
|
||||
msgstr "Reassign All Cases by Task"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_REASSIGN_CASE
|
||||
#: LABEL/ID_REASSIGN_CASE
|
||||
msgid "Reassign Case"
|
||||
msgstr "Reassign Case"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_REASSIGN_CASES
|
||||
#: LABEL/ID_REASSIGN_CASES
|
||||
@@ -21749,6 +21923,12 @@ msgstr "Reassign Cases"
|
||||
msgid "Do you want to reassign the case?"
|
||||
msgstr "Do you want to reassign the case?"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_REASSIGN_MY_CASES
|
||||
#: LABEL/ID_REASSIGN_MY_CASES
|
||||
msgid "Reassign my cases"
|
||||
msgstr "Reassign my cases"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_REASSIGN_TO
|
||||
#: LABEL/ID_REASSIGN_TO
|
||||
@@ -23771,6 +23951,12 @@ msgstr "Stage"
|
||||
msgid "Stages"
|
||||
msgstr "Stages"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_STANDARD_LOGGING
|
||||
#: LABEL/ID_STANDARD_LOGGING
|
||||
msgid "Log Files"
|
||||
msgstr "Log Files"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_STARTED_CASES
|
||||
#: LABEL/ID_STARTED_CASES
|
||||
@@ -24545,6 +24731,12 @@ msgstr "The change might cause data loss in the PM table. Do you want to continu
|
||||
msgid "Please complete the reassign reason."
|
||||
msgstr "Please complete the reassign reason."
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_THE_USERNAME_EMAIL_IS_INCORRECT
|
||||
#: LABEL/ID_THE_USERNAME_EMAIL_IS_INCORRECT
|
||||
msgid "The username or email is incorrect"
|
||||
msgstr "The username or email is incorrect"
|
||||
|
||||
# TRANSLATION
|
||||
# LABEL/ID_THIS_MONTH
|
||||
#: LABEL/ID_THIS_MONTH
|
||||
@@ -28124,7 +28316,7 @@ msgstr "File"
|
||||
# additionalTables/doExport.xml?SIZE
|
||||
# additionalTables/doExport.xml
|
||||
#: caption - SIZE
|
||||
msgid "File size"
|
||||
msgid "[additionalTables/doExport.xml?SIZE] File size"
|
||||
msgstr "File size"
|
||||
|
||||
# additionalTables/doExport.xml?META
|
||||
|
||||
107
workflow/engine/controllers/FileLogs.php
Normal file
107
workflow/engine/controllers/FileLogs.php
Normal 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
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 © 2003-' . date( 'Y' ) . ' Colosa, Inc. All rights reserved.';
|
||||
$footerText = 'Copyright © 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -952,7 +952,7 @@ CREATE TABLE `OBJECT_PERMISSION`
|
||||
`OP_USER_RELATION` INTEGER default 0 NOT NULL,
|
||||
`OP_TASK_SOURCE` VARCHAR(32) default '0',
|
||||
`OP_PARTICIPATE` INTEGER default 0 NOT NULL,
|
||||
`OP_OBJ_TYPE` VARCHAR(15) default '0' NOT NULL,
|
||||
`OP_OBJ_TYPE` VARCHAR(20) default '0' NOT NULL,
|
||||
`OP_OBJ_UID` VARCHAR(32) default '0' NOT NULL,
|
||||
`OP_ACTION` VARCHAR(10) default '0' NOT NULL,
|
||||
`OP_CASE_STATUS` VARCHAR(10) default '0',
|
||||
@@ -2297,7 +2297,7 @@ CREATE TABLE `ADDONS_MANAGER`
|
||||
`ADDON_NICK` VARCHAR(255) NOT NULL,
|
||||
`ADDON_DOWNLOAD_FILENAME` VARCHAR(1024),
|
||||
`ADDON_DESCRIPTION` VARCHAR(2048),
|
||||
`ADDON_STATE` VARCHAR(255) NOT NULL,
|
||||
`ADDON_STATE` VARCHAR(255) NOT NULL DEFAULT '',
|
||||
`ADDON_STATE_CHANGED` DATETIME,
|
||||
`ADDON_STATUS` VARCHAR(255) NOT NULL,
|
||||
`ADDON_VERSION` VARCHAR(255) NOT NULL,
|
||||
@@ -2569,6 +2569,7 @@ DROP TABLE IF EXISTS `LIST_CANCELED`;
|
||||
CREATE TABLE `LIST_CANCELED`
|
||||
(
|
||||
`APP_UID` VARCHAR(32) default '' NOT NULL,
|
||||
`DEL_INDEX` INTEGER default 0 NOT NULL,
|
||||
`USR_UID` VARCHAR(32) default '' NOT NULL,
|
||||
`TAS_UID` VARCHAR(32) default '' NOT NULL,
|
||||
`PRO_UID` VARCHAR(32) default '' NOT NULL,
|
||||
@@ -2577,7 +2578,6 @@ CREATE TABLE `LIST_CANCELED`
|
||||
`APP_PRO_TITLE` MEDIUMTEXT,
|
||||
`APP_TAS_TITLE` MEDIUMTEXT,
|
||||
`APP_CANCELED_DATE` DATETIME,
|
||||
`DEL_INDEX` INTEGER default 0 NOT NULL,
|
||||
`DEL_PREVIOUS_USR_UID` VARCHAR(32) default '',
|
||||
`DEL_CURRENT_USR_USERNAME` VARCHAR(100) default '',
|
||||
`DEL_CURRENT_USR_FIRSTNAME` VARCHAR(50) default '',
|
||||
@@ -2589,7 +2589,7 @@ CREATE TABLE `LIST_CANCELED`
|
||||
`PRO_ID` INTEGER default 0,
|
||||
`USR_ID` INTEGER default 0,
|
||||
`TAS_ID` INTEGER default 0,
|
||||
PRIMARY KEY (`APP_UID`),
|
||||
PRIMARY KEY (`APP_UID`,`DEL_INDEX`),
|
||||
KEY `INDEX_PRO_ID`(`PRO_ID`),
|
||||
KEY `INDEX_USR_ID`(`USR_ID`),
|
||||
KEY `INDEX_TAS_ID`(`TAS_ID`),
|
||||
|
||||
@@ -31,65 +31,115 @@ global $RBAC;
|
||||
global $G_TMP_MENU;
|
||||
|
||||
$G_TMP_MENU->AddIdRawOption('FOLDERS', '', G::LoadTranslation('ID_CASES_MENU_FOLDERS'), '', '', 'blockHeader');
|
||||
$G_TMP_MENU->AddIdRawOption('CASES_START_CASE', 'casesStartPage?action=startCase',
|
||||
G::LoadTranslation('ID_NEW_CASE'), '');
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CASES_START_CASE',
|
||||
'casesStartPage?action=startCase',
|
||||
G::LoadTranslation('ID_NEW_CASE'),
|
||||
''
|
||||
);
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('7TTeDBQeWRoZTZKYjh4eFpYUlRDUUEyVERPU3FxellWank=')) {
|
||||
$G_TMP_MENU->AddIdRawOption('CONSOLIDATED_CASES', 'casesConsolidatedListExtJs?action=consolidated',
|
||||
G::LoadTranslation('ID_BATCH_ROUTING'), '');
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CONSOLIDATED_CASES',
|
||||
'casesConsolidatedListExtJs?action=consolidated',
|
||||
G::LoadTranslation('ID_BATCH_ROUTING'),
|
||||
''
|
||||
);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
$G_TMP_MENU->AddIdRawOption('CASES_INBOX', 'casesListExtJs?action=todo', G::LoadTranslation('ID_INBOX'),
|
||||
'icon-cases-inbox.png');
|
||||
$G_TMP_MENU->AddIdRawOption('CASES_DRAFT', 'casesListExtJs?action=draft', G::LoadTranslation('ID_DRAFT'),
|
||||
'mail-mark-task.png' );
|
||||
$G_TMP_MENU->AddIdRawOption('CASES_SENT', 'casesListExtJs?action=sent', G::LoadTranslation('ID_SENT'),
|
||||
'icon-cases-outbox.png');
|
||||
$G_TMP_MENU->AddIdRawOption('CASES_SELFSERVICE', 'casesListExtJs?action=selfservice',
|
||||
G::LoadTranslation('ID_UNASSIGNED'),'rotate_cw.png');
|
||||
$G_TMP_MENU->AddIdRawOption('CASES_PAUSED', 'casesListExtJs?action=paused', G::LoadTranslation('ID_PAUSED'),
|
||||
'mail-queue.png');
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CASES_INBOX',
|
||||
'casesListExtJs?action=todo',
|
||||
G::LoadTranslation('ID_INBOX'),
|
||||
'icon-cases-inbox.png'
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CASES_DRAFT',
|
||||
'casesListExtJs?action=draft',
|
||||
G::LoadTranslation('ID_DRAFT'),
|
||||
'mail-mark-task.png'
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CASES_SENT',
|
||||
'casesListExtJs?action=sent',
|
||||
G::LoadTranslation('ID_SENT'),
|
||||
'icon-cases-outbox.png'
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CASES_SELFSERVICE',
|
||||
'casesListExtJs?action=selfservice',
|
||||
G::LoadTranslation('ID_UNASSIGNED'),
|
||||
'rotate_cw.png'
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CASES_PAUSED',
|
||||
'casesListExtJs?action=paused',
|
||||
G::LoadTranslation('ID_PAUSED'),
|
||||
'mail-queue.png'
|
||||
);
|
||||
|
||||
$G_TMP_MENU->AddIdRawOption('SEARCHS', '', G::LoadTranslation('ID_CASES_MENU_SEARCH'), '', '', 'blockHeader');
|
||||
|
||||
if ($RBAC->userCanAccess('PM_ALLCASES') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('CASES_SEARCH', 'casesListExtJs?action=search',
|
||||
G::LoadTranslation('ID_ADVANCEDSEARCH'), 'system-search.png' );
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CASES_SEARCH',
|
||||
'casesListExtJs?action=search',
|
||||
G::LoadTranslation('ID_ADVANCEDSEARCH'),
|
||||
'system-search.png'
|
||||
);
|
||||
}
|
||||
|
||||
$G_TMP_MENU->AddIdRawOption('ADMIN', '', G::LoadTranslation('ID_CASES_MENU_ADMIN'), '', '', 'blockHeader');
|
||||
if ($RBAC->userCanAccess('PM_SUPERVISOR') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('CASES_TO_REVISE', 'casesListExtJs?action=to_revise',
|
||||
G::LoadTranslation('ID_TO_REVISE'), 'document-review.png');
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CASES_TO_REVISE',
|
||||
'casesListExtJs?action=to_revise',
|
||||
G::LoadTranslation('ID_TO_REVISE'),
|
||||
'document-review.png'
|
||||
);
|
||||
}
|
||||
|
||||
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1 || $RBAC->userCanAccess('PM_REASSIGNCASE_SUPERVISOR') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('CASES_TO_REASSIGN', 'casesListExtJs?action=to_reassign',
|
||||
G::LoadTranslation('ID_TO_REASSIGN'), 'reassing.png' );
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CASES_TO_REASSIGN',
|
||||
'casesListExtJs?action=to_reassign',
|
||||
G::LoadTranslation('ID_TO_REASSIGN'),
|
||||
'reassing.png'
|
||||
);
|
||||
}
|
||||
|
||||
if ($RBAC->userCanAccess('PM_FOLDERS_VIEW') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('CASES_FOLDERS', 'casesStartPage?action=documents', G::LoadTranslation('ID_FOLDERS'),
|
||||
'folderV2.gif', '', 'blockHeaderNoChild' );
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CASES_FOLDERS',
|
||||
'casesStartPage?action=documents',
|
||||
G::LoadTranslation('ID_FOLDERS'),
|
||||
'folderV2.gif',
|
||||
'',
|
||||
'blockHeaderNoChild'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//Load Other registered Dashboards (From plugins)
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
/** @var \ProcessMaker\Plugins\Interfaces\DashboardPage[] $dashBoardPages */
|
||||
$dashBoardPages = $oPluginRegistry->getDashboardPages ();
|
||||
$dashBoardPages = $oPluginRegistry->getDashboardPages();
|
||||
if (count($dashBoardPages)>0) {
|
||||
$G_TMP_MENU->AddIdRawOption('PLUGINS', '', G::LoadTranslation('ID_PLUGINS'), '', '', 'blockHeader');
|
||||
foreach ($dashBoardPages as $key => $tabInfo) {
|
||||
$tabNameSpace=$tabInfo->getNamespace();
|
||||
$tabName=$tabInfo->getName();
|
||||
$tabIcon=str_replace("ICON_","",$tabInfo->getIcon());
|
||||
$tabIcon=str_replace("ICON_", "", $tabInfo->getIcon());
|
||||
if ($tabName!= "") {
|
||||
$G_TMP_MENU->AddIdRawOption($tabIcon, 'casesStartPage?action='.$tabNameSpace.'-'.$tabName,
|
||||
ucwords(strtolower($tabName)), '');
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
$tabIcon,
|
||||
'casesStartPage?action='.$tabNameSpace.'-'.$tabName,
|
||||
ucwords(strtolower($tabName)),
|
||||
''
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,67 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* processmaker.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*************************************
|
||||
* ---= Processmaker main menu=---
|
||||
*************************************/
|
||||
|
||||
global $G_TMP_MENU;
|
||||
global $RBAC;
|
||||
|
||||
// HOME MODULE
|
||||
if ($RBAC->userCanAccess('PM_CASES') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('CASES', 'cases/main', G::LoadTranslation('ID_HOME'), '', '', '', 'x-pm-home');
|
||||
}
|
||||
|
||||
// DESIGNER MODULE
|
||||
if ($RBAC->userCanAccess('PM_FACTORY') == 1 ) {
|
||||
$G_TMP_MENU->AddIdRawOption('PROCESSES', 'processes/main', G::LoadTranslation('ID_DESIGNER'), '', '', '', 'x-pm-designer');
|
||||
}
|
||||
|
||||
// DASHBOARD MODULE
|
||||
if ($RBAC->userCanAccess('PM_DASHBOARD') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('DASHBOARD', 'dashboard/main', G::LoadTranslation('ID_DASHBOARD'), '', '', '', 'x-pm-dashboard');
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($RBAC->userCanAccess('PM_DASHBOARD') == 1) {
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=') ) {
|
||||
$G_TMP_MENU->AddIdRawOption('DASHBOARD+', 'strategicDashboard/main', G::LoadTranslation('ID_STRATEGIC_DASHBOARD'), '', '', '', 'x-pm-dashboard');
|
||||
}
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
// ADMIN MODULE
|
||||
if ($RBAC->userCanAccess('PM_SETUP') == 1 || $RBAC->userCanAccess('PM_USERS') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('SETUP', 'setup/main', strtolower(G::LoadTranslation('ID_SETUP')), '', '', '', 'x-pm-setup');
|
||||
}
|
||||
|
||||
|
||||
// PLUGINS MENUS
|
||||
if( file_exists(PATH_CORE . 'menus/plugin.php') ) {
|
||||
require_once(PATH_CORE . 'menus/plugin.php');
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* processmaker.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*************************************
|
||||
* ---= Processmaker main menu=---
|
||||
*************************************/
|
||||
|
||||
global $G_TMP_MENU;
|
||||
global $RBAC;
|
||||
|
||||
// HOME MODULE
|
||||
if ($RBAC->userCanAccess('PM_CASES') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('CASES', 'cases/main', G::LoadTranslation('ID_HOME'), '', '', '', 'x-pm-home');
|
||||
}
|
||||
|
||||
// DESIGNER MODULE
|
||||
if ($RBAC->userCanAccess('PM_FACTORY') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('PROCESSES', 'processes/main', G::LoadTranslation('ID_DESIGNER'), '', '', '', 'x-pm-designer');
|
||||
}
|
||||
|
||||
// DASHBOARD MODULE
|
||||
if ($RBAC->userCanAccess('PM_DASHBOARD') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('DASHBOARD', 'dashboard/main', G::LoadTranslation('ID_DASHBOARD'), '', '', '', 'x-pm-dashboard');
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($RBAC->userCanAccess('PM_DASHBOARD') == 1) {
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=')) {
|
||||
$G_TMP_MENU->AddIdRawOption('DASHBOARD+', 'strategicDashboard/main', G::LoadTranslation('ID_STRATEGIC_DASHBOARD'), '', '', '', 'x-pm-dashboard');
|
||||
}
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
// ADMIN MODULE
|
||||
if ($RBAC->userCanAccess('PM_SETUP') == 1 || $RBAC->userCanAccess('PM_USERS') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('SETUP', 'setup/main', strtolower(G::LoadTranslation('ID_SETUP')), '', '', '', 'x-pm-setup');
|
||||
}
|
||||
|
||||
|
||||
// PLUGINS MENUS
|
||||
if (file_exists(PATH_CORE . 'menus/plugin.php')) {
|
||||
require_once(PATH_CORE . 'menus/plugin.php');
|
||||
}
|
||||
|
||||
@@ -1,307 +1,295 @@
|
||||
<?php
|
||||
/**
|
||||
* setup.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
global $G_TMP_MENU;
|
||||
global $RBAC;
|
||||
$partnerFlag = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : false;
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$conf = new Configurations();
|
||||
$sAudit = $conf->getConfiguration('AUDIT_LOG', 'log');
|
||||
$licensedFeatures = &PMLicensedFeatures::getSingleton();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($RBAC->userCanAccess('PM_SETUP') === 1) {
|
||||
$pmSetupPermission = true;
|
||||
if ($RBAC->userCanAccess('PM_SETUP_LOGO') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'LOGO', '../admin/pmLogo',
|
||||
G::LoadTranslation('ID_LOGO'),
|
||||
'icon-pmlogo.png', '','settings'
|
||||
);
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_SETUP_EMAIL') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
"EMAIL_SERVER", "../emailServer/emailServer",
|
||||
G::LoadTranslation("ID_EMAIL_SERVER_TITLE"),
|
||||
"icon-email-settings1.png", "", "settings"
|
||||
);
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_SETUP_CALENDAR') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CALENDAR', 'calendarList',
|
||||
G::LoadTranslation('ID_CALENDAR'),
|
||||
'icon-calendar.png', '', 'settings'
|
||||
);
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_SETUP_PROCESS_CATEGORIES') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'PROCESS_CATEGORY', '../processCategory/processCategoryList',
|
||||
G::LoadTranslation('ID_PROCESS_CATEGORY'),
|
||||
"rules.png", '', 'settings'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($RBAC->userCanAccess('PM_SETUP') === 1) {
|
||||
if ($RBAC->userCanAccess('PM_SETUP_SKIN') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'SKINS', 'skinsList',
|
||||
G::LoadTranslation('ID_SKINS'),
|
||||
'icon-skins.png', '', 'settings'
|
||||
);
|
||||
}
|
||||
if (!$partnerFlag) {
|
||||
/**
|
||||
* Remove heartbeat config from core, it will probably be used again
|
||||
* when the functionality will be redesigned.
|
||||
*/
|
||||
if ($RBAC->userCanAccess('PM_SETUP_HEART_BEAT') === 1 && false) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'HEARTBEAT', 'processHeartBeatConfig',
|
||||
G::LoadTranslation('ID_HEARTBEAT_CONFIG'),
|
||||
"heartBeat.jpg", '', 'settings'
|
||||
);
|
||||
}
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_SETUP_ENVIRONMENT') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'ENVIRONMENT_SETTINGS', 'environmentSettings',
|
||||
G::LoadTranslation('ID_ENVIRONMENT_SETTINGS'),
|
||||
"", '', 'settings'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($RBAC->userCanAccess('PM_SETUP') === 1) {
|
||||
if ($RBAC->userCanAccess('PM_SETUP_CLEAR_CACHE') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CLEAR_CACHE', 'clearCompiled',
|
||||
G::LoadTranslation('ID_CLEAR_CACHE'),
|
||||
'icon-rebuild-clean.png', "", 'settings'
|
||||
);
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_SETUP_PM_TABLES') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'PM_TABLES', '../pmTables',
|
||||
G::LoadTranslation('ID_ADDITIONAL_TABLES'),
|
||||
'icon-tables.png', '', 'settings'
|
||||
);
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_SETUP_LOGIN') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'LOGIN', 'loginSettings',
|
||||
G::LoadTranslation('LOGIN'),
|
||||
"", '', 'settings'
|
||||
);
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_SETUP_DASHBOARDS') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'DASHBOARD', '../DashboardModule/dashletsList',
|
||||
ucfirst(G::LoadTranslation('ID_DASHBOARD')),
|
||||
'', '', 'settings'
|
||||
);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=')) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'STRATEGIC_DASHBOARD', '../strategicDashboard/dashboardList',
|
||||
ucfirst(G::LoadTranslation('ID_STRATEGIC_DASHBOARD')),
|
||||
'', '', 'settings'
|
||||
);
|
||||
}
|
||||
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'PMGMAIL', '../pmGmail/formPMGmail',
|
||||
ucfirst(G::LoadTranslation('ID_PMGMAIL')),
|
||||
'', '', 'settings'
|
||||
);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
}
|
||||
//tools options
|
||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') === 1) {
|
||||
if ($RBAC->userCanAccess('PM_SETUP_LANGUAGE') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'LANGUAGES', 'languages',
|
||||
G::LoadTranslation('ID_LANGUAGES'),
|
||||
'icon-language.png','', 'settings'
|
||||
);
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_SETUP_CASES_LIST_CACHE_BUILDER') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'APPCACHEVIEW_SETUP', '../setup/appCacheViewConf',
|
||||
G::LoadTranslation('ID_APPCACHE_SETUP'),
|
||||
"", '', 'settings'
|
||||
);
|
||||
}
|
||||
if (!$partnerFlag) {
|
||||
if ($RBAC->userCanAccess('PM_SETUP_PLUGINS') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'PLUGINS', 'pluginsMain',
|
||||
G::LoadTranslation('ID_PLUGINS_MANAGER'),
|
||||
'icon-plugins.png', '', 'plugins'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//users options
|
||||
if ($RBAC->userCanAccess('PM_USERS') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('USERS', '../users/users_List', G::LoadTranslation('ID_USERS_LIST'),
|
||||
'icon-webservices.png', '', 'users');
|
||||
$G_TMP_MENU->AddIdRawOption('GROUPS', '../groups/groups', G::LoadTranslation('ID_GROUPS'), '', '', 'users');
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'DEPARTAMENTS', '../departments/departments',
|
||||
G::LoadTranslation('ID_DEPARTMENTS_USERS'),
|
||||
'', '', 'users'
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption('ROLES', '../roles/roles_List',
|
||||
G::LoadTranslation('ID_ROLES'),
|
||||
'', '', 'users'
|
||||
);
|
||||
}
|
||||
|
||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') === 1 && $RBAC->userCanAccess('PM_USERS') === 1 && $RBAC->userCanAccess
|
||||
('PM_SETUP_USERS_AUTHENTICATION_SOURCES') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'AUTHSOURCES', '../authSources/authSources_List',
|
||||
G::LoadTranslation('ID_AUTH_SOURCES'),
|
||||
'', '', 'users'
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption('UX', '../admin/uxList', G::LoadTranslation('ID_USER_EXPERIENCE'), '', '', 'users');
|
||||
$G_TMP_MENU->AddIdRawOption('SYSTEM', '../admin/system', G::LoadTranslation('ID_SYSTEM'), '', '', 'settings');
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'INFORMATION', '../setup/systemInfo?option=processInfo',
|
||||
G::LoadTranslation('ID_SYSTEM_INFO'),
|
||||
'', '', 'settings'
|
||||
);
|
||||
}
|
||||
|
||||
if ($RBAC->userCanAccess('PM_SETUP') === 1 && $RBAC->userCanAccess('PM_SETUP_LOGS') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('EVENT', '../events/eventList', G::LoadTranslation('ID_EVENTS_CLASSIC'), '', '', 'logs');
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'LOG_CASE_SCHEDULER', '../cases/cases_Scheduler_Log',
|
||||
G::LoadTranslation('ID_CASE_SCHEDULER_CLASSIC'),
|
||||
"icon-logs-list.png", '', 'logs'
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption("CRON", "../setup/cron", G::LoadTranslation("ID_CRON_ACTIONS"), null, null, 'logs');
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'EMAILS', '../mails/emailList',
|
||||
ucfirst(strtolower(G::LoadTranslation('ID_EMAILS'))),
|
||||
'', '', 'logs'
|
||||
);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (isset($sAudit) && $sAudit !== false && $licensedFeatures->verifyfeature
|
||||
('vtSeHNhT0JnSmo1bTluUVlTYUxUbUFSVStEeXVqc1pEUG5EeXc0MGd2Q3ErYz0=')
|
||||
) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'AUDIT_LOG', '../setup/auditLog',
|
||||
ucfirst(G::LoadTranslation('ID_AUDITLOG_DISPLAY')),
|
||||
'', '', 'logs'
|
||||
);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
if ($RBAC->userCanAccess('PM_SETUP') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'PM_REQUIREMENTS', '../setup/systemInfo',
|
||||
G::LoadTranslation('ID_PROCESSMAKER_REQUIREMENTS_CHECK'),
|
||||
'', '', 'settings'
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'PHP_INFO', '../setup/systemInfo?option=php',
|
||||
G::LoadTranslation('ID_PHP_INFO'),
|
||||
'','', 'settings'
|
||||
);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($licensedFeatures->verifyfeature('vtSeHNhT0JnSmo1bTluUVlTYUxUbUFSVStEeXVqc1pEUG5EeXc0MGd2Q3ErYz0=')) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
"AUDIT_LOG", "auditLogConfig",
|
||||
G::LoadTranslation("ID_AUDITLOG_DISPLAY"),
|
||||
"", "","settings"
|
||||
);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (!file_exists(PATH_DATA_SITE . "plugin.singleton")) {
|
||||
require_once PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEP . 'enterprise.php';
|
||||
$enterprise = new enterprisePlugin('enterprise');
|
||||
$enterprise->enable();
|
||||
$enterprise->setup();
|
||||
}
|
||||
$pmLicenseManagerO = &PmLicenseManager::getSingleton();
|
||||
$licenseStatusInfo = $pmLicenseManagerO->getCurrentLicenseStatus();
|
||||
$licStatusMsg = null;
|
||||
|
||||
if ((isset($pmLicenseManagerO->plan)) && ($pmLicenseManagerO->plan != "")) {
|
||||
$lines = explode(" - ", $pmLicenseManagerO->plan);
|
||||
if (isset($lines[0])) {
|
||||
$licStatusMsg .= "<br><i><small> " . $lines[0] . "</small></i>";
|
||||
}
|
||||
if ((isset($lines[1])) && ($lines[1] != $lines[0])) {
|
||||
$licStatusMsg .= "<br><i><small> " . $lines[1] . "</small></i>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($licenseStatusInfo["message"] != "") {
|
||||
$licStatusMsg = " <font color=\"red\">(" . $licenseStatusInfo["message"] . ")</font>";
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($RBAC->userCanAccess('PM_SETUP') == 1) {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'PMENTERPRISE', '../enterprise/addonsStore',
|
||||
G::LoadTranslation('ID_MENU_NAME') . $licStatusMsg,
|
||||
'', '', 'plugins'
|
||||
);
|
||||
if ($RBAC->userCanAccess('PM_SETUP_CUSTOM_CASES_LIST') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CASES_LIST_SETUP', '../cases/casesListSetup',
|
||||
G::LoadTranslation('ID_CUSTOM_CASES_LISTS'),
|
||||
'', '', 'settings');
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
$status = $pluginRegistry->getStatusPlugin('actionsByEmail');
|
||||
|
||||
if ((string)($status) !== 'enabled' &&
|
||||
$licensedFeatures->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=') &&
|
||||
$RBAC->userCanAccess('PM_SETUP_LOGS') == 1
|
||||
) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'PM_ACTIONS_BY_EMAIL_LOGS',
|
||||
'../actionsByEmail/ActionByEmail.php',
|
||||
G::LoadTranslation("ID_ACTIONS_BY_EMAIL_LOG"),
|
||||
'', '', 'logs'
|
||||
);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
<?php
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
global $G_TMP_MENU;
|
||||
global $RBAC;
|
||||
$partnerFlag = (defined('PARTNER_FLAG')) ? PARTNER_FLAG : false;
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$conf = new Configurations();
|
||||
$sAudit = $conf->getConfiguration('AUDIT_LOG', 'log');
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($RBAC->userCanAccess('PM_SETUP') === 1) {
|
||||
$pmSetupPermission = true;
|
||||
if ($RBAC->userCanAccess('PM_SETUP_LOGO') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'LOGO', '../admin/pmLogo',
|
||||
G::LoadTranslation('ID_LOGO'),
|
||||
'icon-pmlogo.png', '', 'settings'
|
||||
);
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_SETUP_EMAIL') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
"EMAIL_SERVER", "../emailServer/emailServer",
|
||||
G::LoadTranslation("ID_EMAIL_SERVER_TITLE"),
|
||||
"icon-email-settings1.png", "", "settings"
|
||||
);
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_SETUP_CALENDAR') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CALENDAR', 'calendarList',
|
||||
G::LoadTranslation('ID_CALENDAR'),
|
||||
'icon-calendar.png', '', 'settings'
|
||||
);
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_SETUP_PROCESS_CATEGORIES') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'PROCESS_CATEGORY', '../processCategory/processCategoryList',
|
||||
G::LoadTranslation('ID_PROCESS_CATEGORY'),
|
||||
"rules.png", '', 'settings'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($RBAC->userCanAccess('PM_SETUP') === 1) {
|
||||
if ($RBAC->userCanAccess('PM_SETUP_SKIN') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'SKINS', 'skinsList',
|
||||
G::LoadTranslation('ID_SKINS'),
|
||||
'icon-skins.png', '', 'settings'
|
||||
);
|
||||
}
|
||||
if (!$partnerFlag) {
|
||||
/**
|
||||
* Remove heartbeat config from core, it will probably be used again
|
||||
* when the functionality will be redesigned.
|
||||
*/
|
||||
if ($RBAC->userCanAccess('PM_SETUP_HEART_BEAT') === 1 && false) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'HEARTBEAT', 'processHeartBeatConfig',
|
||||
G::LoadTranslation('ID_HEARTBEAT_CONFIG'),
|
||||
"heartBeat.jpg", '', 'settings'
|
||||
);
|
||||
}
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_SETUP_ENVIRONMENT') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'ENVIRONMENT_SETTINGS', 'environmentSettings',
|
||||
G::LoadTranslation('ID_ENVIRONMENT_SETTINGS'),
|
||||
"", '', 'settings'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($RBAC->userCanAccess('PM_SETUP') === 1) {
|
||||
if ($RBAC->userCanAccess('PM_SETUP_CLEAR_CACHE') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CLEAR_CACHE', 'clearCompiled',
|
||||
G::LoadTranslation('ID_CLEAR_CACHE'),
|
||||
'icon-rebuild-clean.png', "", 'settings'
|
||||
);
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_SETUP_PM_TABLES') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'PM_TABLES', '../pmTables',
|
||||
G::LoadTranslation('ID_ADDITIONAL_TABLES'),
|
||||
'icon-tables.png', '', 'settings'
|
||||
);
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_SETUP_LOGIN') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'LOGIN', 'loginSettings',
|
||||
G::LoadTranslation('LOGIN'),
|
||||
"", '', 'settings'
|
||||
);
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_SETUP_DASHBOARDS') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'DASHBOARD', '../DashboardModule/dashletsList',
|
||||
ucfirst(G::LoadTranslation('ID_DASHBOARD')),
|
||||
'', '', 'settings'
|
||||
);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=')) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'STRATEGIC_DASHBOARD', '../strategicDashboard/dashboardList',
|
||||
ucfirst(G::LoadTranslation('ID_STRATEGIC_DASHBOARD')),
|
||||
'', '', 'settings'
|
||||
);
|
||||
}
|
||||
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'PMGMAIL', '../pmGmail/formPMGmail',
|
||||
ucfirst(G::LoadTranslation('ID_PMGMAIL')),
|
||||
'', '', 'settings'
|
||||
);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
}
|
||||
//tools options
|
||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') === 1) {
|
||||
if ($RBAC->userCanAccess('PM_SETUP_LANGUAGE') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'LANGUAGES', 'languages',
|
||||
G::LoadTranslation('ID_LANGUAGES'),
|
||||
'icon-language.png', '', 'settings'
|
||||
);
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_SETUP_CASES_LIST_CACHE_BUILDER') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'APPCACHEVIEW_SETUP', '../setup/appCacheViewConf',
|
||||
G::LoadTranslation('ID_APPCACHE_SETUP'),
|
||||
"", '', 'settings'
|
||||
);
|
||||
}
|
||||
if (!$partnerFlag) {
|
||||
if ($RBAC->userCanAccess('PM_SETUP_PLUGINS') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'PLUGINS', 'pluginsMain',
|
||||
G::LoadTranslation('ID_PLUGINS_MANAGER'),
|
||||
'icon-plugins.png', '', 'plugins'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//users options
|
||||
if ($RBAC->userCanAccess('PM_USERS') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('USERS', '../users/users_List', G::LoadTranslation('ID_USERS_LIST'),
|
||||
'icon-webservices.png', '', 'users');
|
||||
$G_TMP_MENU->AddIdRawOption('GROUPS', '../groups/groups', G::LoadTranslation('ID_GROUPS'), '', '', 'users');
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'DEPARTAMENTS', '../departments/departments',
|
||||
G::LoadTranslation('ID_DEPARTMENTS_USERS'),
|
||||
'', '', 'users'
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption('ROLES', '../roles/roles_List',
|
||||
G::LoadTranslation('ID_ROLES'),
|
||||
'', '', 'users'
|
||||
);
|
||||
}
|
||||
|
||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') === 1 && $RBAC->userCanAccess('PM_USERS') === 1 && $RBAC->userCanAccess
|
||||
('PM_SETUP_USERS_AUTHENTICATION_SOURCES') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'AUTHSOURCES', '../authSources/authSources_List',
|
||||
G::LoadTranslation('ID_AUTH_SOURCES'),
|
||||
'', '', 'users'
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption('UX', '../admin/uxList', G::LoadTranslation('ID_USER_EXPERIENCE'), '', '', 'users');
|
||||
$G_TMP_MENU->AddIdRawOption('SYSTEM', '../admin/system', G::LoadTranslation('ID_SYSTEM'), '', '', 'settings');
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'INFORMATION', '../setup/systemInfo?option=processInfo',
|
||||
G::LoadTranslation('ID_SYSTEM_INFO'),
|
||||
'', '', 'settings'
|
||||
);
|
||||
}
|
||||
|
||||
if ($RBAC->userCanAccess('PM_SETUP') === 1 && $RBAC->userCanAccess('PM_SETUP_LOGS') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('EVENT', '../events/eventList', G::LoadTranslation('ID_EVENTS_CLASSIC'), '', '',
|
||||
'logs');
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'LOG_CASE_SCHEDULER', '../cases/cases_Scheduler_Log',
|
||||
G::LoadTranslation('ID_CASE_SCHEDULER_CLASSIC'),
|
||||
"icon-logs-list.png", '', 'logs'
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption("CRON", "../setup/cron", G::LoadTranslation("ID_CRON_ACTIONS"), null, null, 'logs');
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'EMAILS', '../mails/emailList',
|
||||
ucfirst(strtolower(G::LoadTranslation('ID_EMAILS'))),
|
||||
'', '', 'logs'
|
||||
);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (isset($sAudit) && $sAudit !== false && $licensedFeatures->verifyfeature
|
||||
('vtSeHNhT0JnSmo1bTluUVlTYUxUbUFSVStEeXVqc1pEUG5EeXc0MGd2Q3ErYz0=')
|
||||
) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'AUDIT_LOG', '../setup/auditLog',
|
||||
ucfirst(G::LoadTranslation('ID_AUDITLOG_DISPLAY')),
|
||||
'', '', 'logs'
|
||||
);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($RBAC->userCanAccess('PM_SETUP_LOG_FILES') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'STANDARD_LOGGING', '../FileLogs/fileList',
|
||||
G::LoadTranslation('ID_STANDARD_LOGGING'), '', '', 'logs'
|
||||
);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
|
||||
if ($RBAC->userCanAccess('PM_SETUP') === 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'PM_REQUIREMENTS', '../setup/systemInfo',
|
||||
G::LoadTranslation('ID_PROCESSMAKER_REQUIREMENTS_CHECK'),
|
||||
'', '', 'settings'
|
||||
);
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'PHP_INFO', '../setup/systemInfo?option=php',
|
||||
G::LoadTranslation('ID_PHP_INFO'),
|
||||
'', '', 'settings'
|
||||
);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($licensedFeatures->verifyfeature('vtSeHNhT0JnSmo1bTluUVlTYUxUbUFSVStEeXVqc1pEUG5EeXc0MGd2Q3ErYz0=')) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
"AUDIT_LOG", "auditLogConfig",
|
||||
G::LoadTranslation("ID_AUDITLOG_DISPLAY"),
|
||||
"", "", "settings"
|
||||
);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (!file_exists(PATH_DATA_SITE . "plugin.singleton")) {
|
||||
require_once PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEP . 'enterprise.php';
|
||||
$enterprise = new enterprisePlugin('enterprise');
|
||||
$enterprise->enable();
|
||||
$enterprise->setup();
|
||||
}
|
||||
$pmLicenseManagerO = PmLicenseManager::getSingleton();
|
||||
$licenseStatusInfo = $pmLicenseManagerO->getCurrentLicenseStatus();
|
||||
$licStatusMsg = null;
|
||||
|
||||
if ((isset($pmLicenseManagerO->plan)) && ($pmLicenseManagerO->plan != "")) {
|
||||
$lines = explode(" - ", $pmLicenseManagerO->plan);
|
||||
if (isset($lines[0])) {
|
||||
$licStatusMsg .= "<br><i><small> " . $lines[0] . "</small></i>";
|
||||
}
|
||||
if ((isset($lines[1])) && ($lines[1] != $lines[0])) {
|
||||
$licStatusMsg .= "<br><i><small> " . $lines[1] . "</small></i>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($licenseStatusInfo["message"] != "") {
|
||||
$licStatusMsg = " <font color=\"red\">(" . $licenseStatusInfo["message"] . ")</font>";
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($RBAC->userCanAccess('PM_SETUP') == 1) {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'PMENTERPRISE', '../enterprise/addonsStore',
|
||||
G::LoadTranslation('ID_MENU_NAME') . $licStatusMsg,
|
||||
'', '', 'plugins'
|
||||
);
|
||||
if ($RBAC->userCanAccess('PM_SETUP_CUSTOM_CASES_LIST') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'CASES_LIST_SETUP', '../cases/casesListSetup',
|
||||
G::LoadTranslation('ID_CUSTOM_CASES_LISTS'),
|
||||
'', '', 'settings');
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
$status = $pluginRegistry->getStatusPlugin('actionsByEmail');
|
||||
|
||||
if ((string)($status) !== 'enabled' &&
|
||||
$licensedFeatures->verifyfeature('zLhSk5TeEQrNFI2RXFEVktyUGpnczV1WEJNWVp6cjYxbTU3R29mVXVZNWhZQT0=') &&
|
||||
$RBAC->userCanAccess('PM_SETUP_LOGS') == 1
|
||||
) {
|
||||
$G_TMP_MENU->AddIdRawOption(
|
||||
'PM_ACTIONS_BY_EMAIL_LOGS',
|
||||
'../actionsByEmail/ActionByEmail.php',
|
||||
G::LoadTranslation("ID_ACTIONS_BY_EMAIL_LOG"),
|
||||
'', '', 'logs'
|
||||
);
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -49,7 +49,7 @@ if (!isset($_REQUEST["tab"])) {
|
||||
|
||||
$authenticationSource = array("AUTH_SOURCE_UID" => $_REQUEST["authUid"], "CURRENT_TAB" => ($_REQUEST["tab"] == "synchronizeDepartments" ? 0 : 1));
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript("authSources/authSourcesSynchronize", false);
|
||||
$oHeadPublisher->addContent("authSources/authSourcesSynchronize");
|
||||
$oHeadPublisher->assign("AUTHENTICATION_SOURCE", $authenticationSource);
|
||||
@@ -58,4 +58,3 @@ global $G_PUBLISH;
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
G::RenderPage("publish", "extJs");
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ class treeNode extends stdclass
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
$json = new Services_JSON();
|
||||
header("Content-Type: application/json;");
|
||||
|
||||
@@ -46,8 +45,8 @@ try {
|
||||
global $baseDN;
|
||||
|
||||
$ldapAdvanced = getLDAPAdvanceInstance($_REQUEST["authUid"]);
|
||||
$RBAC =& RBAC::getSingleton();
|
||||
$authenticationSource = $RBAC->authSourcesObj->load($_REQUEST["authUid"]);
|
||||
$RBAC = RBAC::getSingleton();
|
||||
$authenticationSource = $RBAC->authSourcesObj->load($_REQUEST["authUid"]);
|
||||
$baseDN = $authenticationSource["AUTH_SOURCE_BASE_DN"];
|
||||
$departments = $ldapAdvanced->searchDepartments();
|
||||
$terminatedOu = $ldapAdvanced->getTerminatedOu();
|
||||
@@ -55,11 +54,11 @@ try {
|
||||
die($json->encode($nodes));
|
||||
break;
|
||||
case "saveDepartments":
|
||||
$depsToCheck = ($_REQUEST['departmentsDN'] != '')? explode('|', $_REQUEST['departmentsDN']) : [];
|
||||
$depsToCheck = ($_REQUEST['departmentsDN'] != '') ? explode('|', $_REQUEST['departmentsDN']) : [];
|
||||
$depsToCheck = array_map("urldecode", $depsToCheck);
|
||||
$depsToUncheck = getDepartmentsToUncheck($depsToCheck);
|
||||
$RBAC =& RBAC::getSingleton();
|
||||
$authenticationSource = $RBAC->authSourcesObj->load($_REQUEST["authUid"]);
|
||||
$RBAC = RBAC::getSingleton();
|
||||
$authenticationSource = $RBAC->authSourcesObj->load($_REQUEST["authUid"]);
|
||||
$ldapAdvanced = getLDAPAdvanceInstance($_REQUEST["authUid"]);
|
||||
|
||||
foreach ($depsToCheck as $departmentDn) {
|
||||
@@ -82,9 +81,10 @@ try {
|
||||
$parentUid == ''
|
||||
) {
|
||||
$response = new stdClass();
|
||||
$response->status = 'ERROR';
|
||||
$response->status = 'ERROR';
|
||||
$response->message = G::LoadTranslation(
|
||||
'ID_DEPARTMENT_CHECK_PARENT_DEPARTMENT', [$parentDn, $departmentTitle]
|
||||
'ID_DEPARTMENT_CHECK_PARENT_DEPARTMENT',
|
||||
[$parentDn, $departmentTitle]
|
||||
);
|
||||
|
||||
echo $json->encode($response);
|
||||
@@ -95,15 +95,15 @@ try {
|
||||
$department = new Department();
|
||||
|
||||
$departmentUid = $department->create([
|
||||
'DEP_TITLE' => stripslashes($departmentTitle),
|
||||
'DEP_PARENT' => $parentUid,
|
||||
'DEP_LDAP_DN' => $departmentDn,
|
||||
'DEP_TITLE' => stripslashes($departmentTitle),
|
||||
'DEP_PARENT' => $parentUid,
|
||||
'DEP_LDAP_DN' => $departmentDn,
|
||||
'DEP_REF_CODE' => ''
|
||||
]);
|
||||
|
||||
if ($departmentUid === false) {
|
||||
$response = new stdClass();
|
||||
$response->status = 'ERROR';
|
||||
$response->status = 'ERROR';
|
||||
$response->message = G::LoadTranslation('ID_DEPARTMENT_ERROR_CREATE');
|
||||
|
||||
echo $json->encode($response);
|
||||
@@ -159,8 +159,8 @@ try {
|
||||
$groupsToCheck = explode("|", $_REQUEST["groupsDN"]);
|
||||
$groupsToCheck = array_map("urldecode", $groupsToCheck);
|
||||
$groupsToUncheck = getGroupsToUncheck($groupsToCheck);
|
||||
$RBAC =& RBAC::getSingleton();
|
||||
$authenticationSource = $RBAC->authSourcesObj->load($_REQUEST["authUid"]);
|
||||
$RBAC = RBAC::getSingleton();
|
||||
$authenticationSource = $RBAC->authSourcesObj->load($_REQUEST["authUid"]);
|
||||
$ldapAdvanced = getLDAPAdvanceInstance($_REQUEST["authUid"]);
|
||||
|
||||
foreach ($groupsToCheck as $groupDN) {
|
||||
@@ -185,7 +185,7 @@ try {
|
||||
|
||||
if ($groupUID == "") {
|
||||
$group = new Groupwf();
|
||||
$row["GRP_TITLE"] = stripslashes($groupTitle);
|
||||
$row["GRP_TITLE"] = stripslashes($groupTitle);
|
||||
$row["GRP_LDAP_DN"] = $groupDN;
|
||||
$groupUID = $group->create($row);
|
||||
|
||||
@@ -234,7 +234,7 @@ try {
|
||||
|
||||
function getLDAPAdvanceInstance($authUid)
|
||||
{
|
||||
$RBAC = &RBAC::getSingleton();
|
||||
$RBAC = RBAC::getSingleton();
|
||||
$ldapAdvanced = new LdapAdvanced();
|
||||
$ldapAdvanced->sAuthSource = $authUid;
|
||||
$ldapAdvanced->sSystem = $RBAC->sSystem;
|
||||
@@ -300,7 +300,7 @@ function lookForChildrenDeps($parent)
|
||||
$departmentUid = $ldapAdvanced->getDepUidIfExistsDN($department["DEP_DN"]);
|
||||
|
||||
if ($departmentUid != "") {
|
||||
$departmentObject->text .= " (" . ((isset($arrayDepartmentNumberOfUsersFromDb[$departmentUid]))? $arrayDepartmentNumberOfUsersFromDb[$departmentUid] : 0) . ")";
|
||||
$departmentObject->text .= " (" . ((isset($arrayDepartmentNumberOfUsersFromDb[$departmentUid])) ? $arrayDepartmentNumberOfUsersFromDb[$departmentUid] : 0) . ")";
|
||||
$departmentObject->checked = true;
|
||||
} else {
|
||||
$departmentObject->checked = false;
|
||||
@@ -394,7 +394,7 @@ function lookForChildrenGroups()
|
||||
$groupUid = $ldapAdvanced->getGrpUidIfExistsDN($group["GRP_DN"]);
|
||||
|
||||
if ($groupUid != "") {
|
||||
$groupObject->text .= " (" . ((isset($arrayGroupNumberOfUsersFromDb[$groupUid]))? $arrayGroupNumberOfUsersFromDb[$groupUid] : 0) . ")";
|
||||
$groupObject->text .= " (" . ((isset($arrayGroupNumberOfUsersFromDb[$groupUid])) ? $arrayGroupNumberOfUsersFromDb[$groupUid] : 0) . ")";
|
||||
$groupObject->checked = true;
|
||||
} else {
|
||||
$groupObject->checked = false;
|
||||
@@ -450,9 +450,10 @@ function custom_ldap_explode_dn($dn)
|
||||
unset($result["count"]);
|
||||
|
||||
foreach ($result as $key => $value) {
|
||||
$result[$key] = addcslashes(preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''", $value), '<>,"');
|
||||
$result[$key] = addcslashes(preg_replace_callback("/\\\([0-9A-Fa-f]{2})/", function ($m) {
|
||||
return chr(hexdec($m[1]));
|
||||
}, $value), '<>,"');
|
||||
}
|
||||
|
||||
return($result);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,128 +1,126 @@
|
||||
<?php
|
||||
/**
|
||||
* authSources_Edit.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
}
|
||||
|
||||
if (! isset( $_GET['sUID'] )) {
|
||||
G::SendTemporalMessage( 'ID_ERROR_OBJECT_NOT_EXISTS', 'error', 'labels' );
|
||||
G::header( 'location: authSources_List' );
|
||||
die();
|
||||
}
|
||||
|
||||
if ($_GET['sUID'] == '') {
|
||||
G::SendTemporalMessage( 'ID_ERROR_OBJECT_NOT_EXISTS', 'error', 'labels' );
|
||||
G::header( 'location: authSources_List' );
|
||||
die();
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||
|
||||
$fields = $RBAC->getAuthSource( $_GET['sUID'] );
|
||||
|
||||
if (is_array( $fields['AUTH_SOURCE_DATA'] )) {
|
||||
foreach ($fields['AUTH_SOURCE_DATA'] as $field => $value) {
|
||||
$fields[$field] = $value;
|
||||
}
|
||||
}
|
||||
$fields['AUTH_SOURCE_SHOWGRID_FLAG'] = 0;
|
||||
if (isset($fields['AUTH_SOURCE_DATA']['AUTH_SOURCE_SHOWGRID']) && $fields['AUTH_SOURCE_DATA']['AUTH_SOURCE_SHOWGRID'] == 'on') {
|
||||
$fields["AUTH_SOURCE_SHOWGRID_FLAG"] = 1;
|
||||
}
|
||||
unset( $fields['AUTH_SOURCE_DATA'] );
|
||||
|
||||
$textAttribute = '';
|
||||
if (isset($fields['AUTH_SOURCE_GRID_ATTRIBUTE']) && count($fields['AUTH_SOURCE_GRID_ATTRIBUTE'])) {
|
||||
foreach ($fields['AUTH_SOURCE_GRID_ATTRIBUTE'] as $value) {
|
||||
$textAttribute .= '|' . $value['attributeLdap'] . '/' . $value['attributeUser'];
|
||||
}
|
||||
}
|
||||
$fields['AUTH_SOURCE_GRID_TEXT'] = $textAttribute;
|
||||
|
||||
//fixing a problem with dropdown with int values,
|
||||
//the problem : the value was integer, but the dropdown was expecting a string value, and they returns always the first item of dropdown
|
||||
if (isset( $fields['AUTH_SOURCE_ENABLED_TLS'] )) {
|
||||
$fields['AUTH_SOURCE_ENABLED_TLS'] = sprintf( '%d', $fields['AUTH_SOURCE_ENABLED_TLS'] );
|
||||
}
|
||||
if (isset( $fields['AUTH_ANONYMOUS'] )) {
|
||||
$fields['AUTH_ANONYMOUS'] = sprintf( '%d', $fields['AUTH_ANONYMOUS'] );
|
||||
}
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
if ($fields['AUTH_SOURCE_PROVIDER'] == 'ldap') {
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'authSources/authSourcesEdit', false );
|
||||
$oHeadPublisher->assign( 'sUID', $_GET['sUID'] );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
} else {
|
||||
if (file_exists( PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' )) {
|
||||
$pluginEnabled = 1;
|
||||
|
||||
if ($pluginEnabled == 1) {
|
||||
|
||||
$data = executeQuery("DESCRIBE USERS");
|
||||
$fieldSet = array("USR_UID", "USR_USERNAME", "USR_PASSWORD", "USR_CREATE_DATE", "USR_UPDATE_DATE", "USR_COUNTRY", "USR_CITY", "USR_LOCATION", "DEP_UID", "USR_RESUME", "USR_ROLE", "USR_REPORTS_TO", "USR_REPLACED_BY", "USR_UX");
|
||||
$attributes = null;
|
||||
|
||||
foreach ($data as $value) {
|
||||
if (!(in_array($value["Field"], $fieldSet))) {
|
||||
$attributes = $attributes . $value["Field"] . "|";
|
||||
}
|
||||
}
|
||||
|
||||
$fields["AUTH_SOURCE_ATTRIBUTE_IDS"] = $attributes;
|
||||
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Flag')) {
|
||||
$oHeadPublisher = & headPublisher::getSingleton ();
|
||||
|
||||
$oHeadPublisher->assign("Fields", $fields);
|
||||
$oHeadPublisher->addExtJsScript (PATH_TPL. 'ldapAdvanced/library', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_TPL. 'ldapAdvanced/ldapAdvancedForm', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_TPL. 'ldapAdvanced/ldapAdvancedList', false, true );
|
||||
G::RenderPage ('publish', 'extJs');
|
||||
die();
|
||||
}
|
||||
$G_PUBLISH->AddContent("xmlform", "xmlform", 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
|
||||
} else {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => G::LoadTranslation( 'ID_AUTH_SOURCE_MISSING' )
|
||||
) );
|
||||
}
|
||||
} else {
|
||||
if (file_exists( PATH_XMLFORM . 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' )) {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save' );
|
||||
} else {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => 'File: ' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' . ' not exists.'
|
||||
) );
|
||||
}
|
||||
}
|
||||
|
||||
G::RenderPage("publish", "blank");
|
||||
}
|
||||
|
||||
<?php
|
||||
/**
|
||||
* authSources_Edit.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die();
|
||||
}
|
||||
|
||||
if (! isset($_GET['sUID'])) {
|
||||
G::SendTemporalMessage('ID_ERROR_OBJECT_NOT_EXISTS', 'error', 'labels');
|
||||
G::header('location: authSources_List');
|
||||
die();
|
||||
}
|
||||
|
||||
if ($_GET['sUID'] == '') {
|
||||
G::SendTemporalMessage('ID_ERROR_OBJECT_NOT_EXISTS', 'error', 'labels');
|
||||
G::header('location: authSources_List');
|
||||
die();
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||
|
||||
$fields = $RBAC->getAuthSource($_GET['sUID']);
|
||||
|
||||
if (is_array($fields['AUTH_SOURCE_DATA'])) {
|
||||
foreach ($fields['AUTH_SOURCE_DATA'] as $field => $value) {
|
||||
$fields[$field] = $value;
|
||||
}
|
||||
}
|
||||
$fields['AUTH_SOURCE_SHOWGRID_FLAG'] = 0;
|
||||
if (isset($fields['AUTH_SOURCE_DATA']['AUTH_SOURCE_SHOWGRID']) && $fields['AUTH_SOURCE_DATA']['AUTH_SOURCE_SHOWGRID'] == 'on') {
|
||||
$fields["AUTH_SOURCE_SHOWGRID_FLAG"] = 1;
|
||||
}
|
||||
unset($fields['AUTH_SOURCE_DATA']);
|
||||
|
||||
$textAttribute = '';
|
||||
if (isset($fields['AUTH_SOURCE_GRID_ATTRIBUTE']) && count($fields['AUTH_SOURCE_GRID_ATTRIBUTE'])) {
|
||||
foreach ($fields['AUTH_SOURCE_GRID_ATTRIBUTE'] as $value) {
|
||||
$textAttribute .= '|' . $value['attributeLdap'] . '/' . $value['attributeUser'];
|
||||
}
|
||||
}
|
||||
$fields['AUTH_SOURCE_GRID_TEXT'] = $textAttribute;
|
||||
|
||||
//fixing a problem with dropdown with int values,
|
||||
//the problem : the value was integer, but the dropdown was expecting a string value, and they returns always the first item of dropdown
|
||||
if (isset($fields['AUTH_SOURCE_ENABLED_TLS'])) {
|
||||
$fields['AUTH_SOURCE_ENABLED_TLS'] = sprintf('%d', $fields['AUTH_SOURCE_ENABLED_TLS']);
|
||||
}
|
||||
if (isset($fields['AUTH_ANONYMOUS'])) {
|
||||
$fields['AUTH_ANONYMOUS'] = sprintf('%d', $fields['AUTH_ANONYMOUS']);
|
||||
}
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
if ($fields['AUTH_SOURCE_PROVIDER'] == 'ldap') {
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('authSources/authSourcesEdit', false);
|
||||
$oHeadPublisher->assign('sUID', $_GET['sUID']);
|
||||
G::RenderPage('publish', 'extJs');
|
||||
} else {
|
||||
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
|
||||
$pluginEnabled = 1;
|
||||
|
||||
if ($pluginEnabled == 1) {
|
||||
$data = executeQuery("DESCRIBE USERS");
|
||||
$fieldSet = array("USR_UID", "USR_USERNAME", "USR_PASSWORD", "USR_CREATE_DATE", "USR_UPDATE_DATE", "USR_COUNTRY", "USR_CITY", "USR_LOCATION", "DEP_UID", "USR_RESUME", "USR_ROLE", "USR_REPORTS_TO", "USR_REPLACED_BY", "USR_UX");
|
||||
$attributes = null;
|
||||
|
||||
foreach ($data as $value) {
|
||||
if (!(in_array($value["Field"], $fieldSet))) {
|
||||
$attributes = $attributes . $value["Field"] . "|";
|
||||
}
|
||||
}
|
||||
|
||||
$fields["AUTH_SOURCE_ATTRIBUTE_IDS"] = $attributes;
|
||||
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Flag')) {
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
|
||||
$oHeadPublisher->assign("Fields", $fields);
|
||||
$oHeadPublisher->addExtJsScript(PATH_TPL. 'ldapAdvanced/library', false, true);
|
||||
$oHeadPublisher->addExtJsScript(PATH_TPL. 'ldapAdvanced/ldapAdvancedForm', false, true);
|
||||
$oHeadPublisher->addExtJsScript(PATH_TPL. 'ldapAdvanced/ldapAdvancedList', false, true);
|
||||
G::RenderPage('publish', 'extJs');
|
||||
die();
|
||||
}
|
||||
$G_PUBLISH->AddContent("xmlform", "xmlform", 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
|
||||
} else {
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => G::LoadTranslation('ID_AUTH_SOURCE_MISSING')
|
||||
));
|
||||
}
|
||||
} else {
|
||||
if (file_exists(PATH_XMLFORM . 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
|
||||
} else {
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => 'File: ' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' . ' not exists.'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
G::RenderPage("publish", "blank");
|
||||
}
|
||||
|
||||
@@ -1,54 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* authSources_List.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
}
|
||||
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration( 'authSourcesList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'authSources/authSourcesList', false ); //adding a javascript file .js
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($licensedFeatures->verifyfeature('sywN09PSzh1MVdOajZBdnhMbFhCSnpNT1lLTEFwVklmOTE=')) {
|
||||
$oHeadPublisher->addExtJsScript( 'authSources/authSourcesListSyn', false ); //adding a javascript file .js
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$oHeadPublisher->addContent( 'authSources/authSourcesList' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
||||
$oHeadPublisher->assign( 'CONFIG', $Config );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
<?php
|
||||
/**
|
||||
* authSources_List.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die();
|
||||
}
|
||||
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration('authSourcesList', 'pageSize', '', $_SESSION['USER_LOGGED']);
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('authSources/authSourcesList', false); //adding a javascript file .js
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($licensedFeatures->verifyfeature('sywN09PSzh1MVdOajZBdnhMbFhCSnpNT1lLTEFwVklmOTE=')) {
|
||||
$oHeadPublisher->addExtJsScript('authSources/authSourcesListSyn', false); //adding a javascript file .js
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$oHeadPublisher->addContent('authSources/authSourcesList'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('FORMATS', $c->getFormats());
|
||||
$oHeadPublisher->assign('CONFIG', $Config);
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
@@ -1,78 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* authSources_New.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||
|
||||
$fields = array ('AUTH_SOURCE_PROVIDER' => $_REQUEST['AUTH_SOURCE_PROVIDER']);
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
if (file_exists( PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' )) {
|
||||
$pluginEnabled = 1;
|
||||
if ($pluginEnabled == 1) {
|
||||
//The attributes the users
|
||||
|
||||
$data = executeQuery("DESCRIBE USERS");
|
||||
$fieldSet = array("USR_UID", "USR_USERNAME", "USR_PASSWORD", "USR_CREATE_DATE", "USR_UPDATE_DATE", "USR_COUNTRY", "USR_CITY", "USR_LOCATION", "DEP_UID", "USR_RESUME", "USR_ROLE", "USR_REPORTS_TO", "USR_REPLACED_BY", "USR_UX");
|
||||
$attributes = null;
|
||||
|
||||
foreach ($data as $value) {
|
||||
if (!(in_array($value["Field"], $fieldSet))) {
|
||||
$attributes = $attributes . $value["Field"] . "|";
|
||||
}
|
||||
}
|
||||
$fields["AUTH_SOURCE_ATTRIBUTE_IDS"] = $attributes;
|
||||
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Flag')) {
|
||||
$oHeadPublisher = & headPublisher::getSingleton ();
|
||||
|
||||
$oHeadPublisher->assign("Fields", $fields);
|
||||
$oHeadPublisher->addExtJsScript (PATH_TPL. 'ldapAdvanced/library', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_TPL. 'ldapAdvanced/ldapAdvancedForm', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_TPL. 'ldapAdvanced/ldapAdvancedList', false, true );
|
||||
G::RenderPage ('publish', 'extJs');
|
||||
die();
|
||||
}
|
||||
$G_PUBLISH->AddContent("xmlform", "xmlform", 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
|
||||
} else {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => G::LoadTranslation( 'ID_AUTH_SOURCE_MISSING' )) );
|
||||
}
|
||||
} else {
|
||||
if (file_exists( PATH_XMLFORM . 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' )) {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save' );
|
||||
} else {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => 'File: ' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' . ' not exists.') );
|
||||
}
|
||||
}
|
||||
|
||||
G::RenderPage("publish", "blank");
|
||||
|
||||
<?php
|
||||
/**
|
||||
* authSources_New.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die();
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||
|
||||
$fields = array('AUTH_SOURCE_PROVIDER' => $_REQUEST['AUTH_SOURCE_PROVIDER']);
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
|
||||
$pluginEnabled = 1;
|
||||
if ($pluginEnabled == 1) {
|
||||
//The attributes the users
|
||||
|
||||
$data = executeQuery("DESCRIBE USERS");
|
||||
$fieldSet = array("USR_UID", "USR_USERNAME", "USR_PASSWORD", "USR_CREATE_DATE", "USR_UPDATE_DATE", "USR_COUNTRY", "USR_CITY", "USR_LOCATION", "DEP_UID", "USR_RESUME", "USR_ROLE", "USR_REPORTS_TO", "USR_REPLACED_BY", "USR_UX");
|
||||
$attributes = null;
|
||||
|
||||
foreach ($data as $value) {
|
||||
if (!(in_array($value["Field"], $fieldSet))) {
|
||||
$attributes = $attributes . $value["Field"] . "|";
|
||||
}
|
||||
}
|
||||
$fields["AUTH_SOURCE_ATTRIBUTE_IDS"] = $attributes;
|
||||
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Flag')) {
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
|
||||
$oHeadPublisher->assign("Fields", $fields);
|
||||
$oHeadPublisher->addExtJsScript(PATH_TPL. 'ldapAdvanced/library', false, true);
|
||||
$oHeadPublisher->addExtJsScript(PATH_TPL. 'ldapAdvanced/ldapAdvancedForm', false, true);
|
||||
$oHeadPublisher->addExtJsScript(PATH_TPL. 'ldapAdvanced/ldapAdvancedList', false, true);
|
||||
G::RenderPage('publish', 'extJs');
|
||||
die();
|
||||
}
|
||||
$G_PUBLISH->AddContent("xmlform", "xmlform", 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
|
||||
} else {
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => G::LoadTranslation('ID_AUTH_SOURCE_MISSING')));
|
||||
}
|
||||
} else {
|
||||
if (file_exists(PATH_XMLFORM . 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'authSources/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit', '', $fields, '../authSources/authSources_Save');
|
||||
} else {
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => 'File: ' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' . ' not exists.'));
|
||||
}
|
||||
}
|
||||
|
||||
G::RenderPage("publish", "blank");
|
||||
|
||||
@@ -1,74 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* authSources_SearchUsers.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$fields = $RBAC->getAuthSource( $_GET['sUID'] );
|
||||
if (file_exists( PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml' )) {
|
||||
$pluginEnabled = 0;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('sywN09PSzh1MVdOajZBdnhMbFhCSnpNT1lLTEFwVklmOTE=')) {
|
||||
$pluginEnabled = 1;
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($pluginEnabled == 0) {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => G::LoadTranslation( 'ID_AUTH_SOURCE_FEATURE_MISSING' ) ) );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
} else {
|
||||
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration('additionalTablesList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton ();
|
||||
|
||||
$oHeadPublisher->assign("FORMATS", $c->getFormats());
|
||||
$oHeadPublisher->assign("CONFIG", $Config);
|
||||
|
||||
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Flag')) {
|
||||
$oHeadPublisher = & headPublisher::getSingleton ();
|
||||
|
||||
$oHeadPublisher->assign("Fields", $fields);
|
||||
$oHeadPublisher->addExtJsScript (PATH_TPL. 'ldapAdvanced/library', false, true );
|
||||
$oHeadPublisher->addExtJsScript (PATH_TPL. 'ldapAdvanced/ldapAdvancedSearch', false, true );
|
||||
G::RenderPage ('publish', 'extJs');
|
||||
die();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'authSources/authSources_SearchUsers', '', array ('AUTH_SOURCE_UID' => $_GET['sUID']), '../authSources/authSources_ImportUsers' );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
|
||||
<?php
|
||||
/**
|
||||
* authSources_SearchUsers.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die();
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$fields = $RBAC->getAuthSource($_GET['sUID']);
|
||||
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
|
||||
$pluginEnabled = 0;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('sywN09PSzh1MVdOajZBdnhMbFhCSnpNT1lLTEFwVklmOTE=')) {
|
||||
$pluginEnabled = 1;
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if ($pluginEnabled == 0) {
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => G::LoadTranslation('ID_AUTH_SOURCE_FEATURE_MISSING') ));
|
||||
G::RenderPage('publish', 'blank');
|
||||
} else {
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration('additionalTablesList', 'pageSize', '', $_SESSION['USER_LOGGED']);
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
|
||||
$oHeadPublisher->assign("FORMATS", $c->getFormats());
|
||||
$oHeadPublisher->assign("CONFIG", $Config);
|
||||
|
||||
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Flag')) {
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
|
||||
$oHeadPublisher->assign("Fields", $fields);
|
||||
$oHeadPublisher->addExtJsScript(PATH_TPL. 'ldapAdvanced/library', false, true);
|
||||
$oHeadPublisher->addExtJsScript(PATH_TPL. 'ldapAdvanced/ldapAdvancedSearch', false, true);
|
||||
G::RenderPage('publish', 'extJs');
|
||||
die();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'authSources/authSources_SearchUsers', '', array('AUTH_SOURCE_UID' => $_GET['sUID']), '../authSources/authSources_ImportUsers');
|
||||
G::RenderPage('publish', 'blank');
|
||||
|
||||
@@ -1,54 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* authSources_SelectType.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||
|
||||
$aAuthSourceTypes = array (array ('sType' => 'char','sLabel' => 'char'));
|
||||
$oDirectory = dir( PATH_RBAC . 'plugins' . PATH_SEP );
|
||||
while ($sObject = $oDirectory->read()) {
|
||||
if (($sObject != '.') && ($sObject != '..') && ($sObject != '.svn') && ($sObject != 'ldap')) {
|
||||
if (is_file( PATH_RBAC . 'plugins' . PATH_SEP . $sObject )) {
|
||||
$sType = trim( str_replace( 'class.', '', str_replace( '.php', '', $sObject ) ) );
|
||||
$aAuthSourceTypes[] = array ('sType' => $sType,'sLabel' => $sType );
|
||||
}
|
||||
}
|
||||
}
|
||||
global $_DBArray;
|
||||
$_DBArray['authSourceTypes'] = $aAuthSourceTypes;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'authSources/authSourcesListNew', true ); //adding a javascript file .js
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
<?php
|
||||
/**
|
||||
* authSources_SelectType.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die();
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||
|
||||
$aAuthSourceTypes = array(array('sType' => 'char','sLabel' => 'char'));
|
||||
$oDirectory = dir(PATH_RBAC . 'plugins' . PATH_SEP);
|
||||
while ($sObject = $oDirectory->read()) {
|
||||
if (($sObject != '.') && ($sObject != '..') && ($sObject != '.svn') && ($sObject != 'ldap')) {
|
||||
if (is_file(PATH_RBAC . 'plugins' . PATH_SEP . $sObject)) {
|
||||
$sType = trim(str_replace('class.', '', str_replace('.php', '', $sObject)));
|
||||
$aAuthSourceTypes[] = array('sType' => $sType,'sLabel' => $sType );
|
||||
}
|
||||
}
|
||||
}
|
||||
global $_DBArray;
|
||||
$_DBArray['authSourceTypes'] = $aAuthSourceTypes;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('authSources/authSourcesListNew', true); //adding a javascript file .js
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
@@ -1,42 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* authSources_SelectType.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
}
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||
|
||||
$aAuthSourceTypes = array (array ('sType' => 'char','sLabel' => 'char'));
|
||||
$oDirectory = dir( PATH_RBAC . 'plugins' . PATH_SEP );
|
||||
$G_PUBLISH = new Publisher();
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'authSources/authSourceskindof', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->assign( 'sprovider', $_GET['sprovider'] );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
<?php
|
||||
/**
|
||||
* authSources_SelectType.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die();
|
||||
}
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'users';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||
|
||||
$aAuthSourceTypes = array(array('sType' => 'char','sLabel' => 'char'));
|
||||
$oDirectory = dir(PATH_RBAC . 'plugins' . PATH_SEP);
|
||||
$G_PUBLISH = new Publisher();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript('authSources/authSourceskindof', true); //adding a javascript file .js
|
||||
$oHeadPublisher->assign('sprovider', $_GET['sprovider']);
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use ProcessMaker\BusinessModel\Cases as BmCases;
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
@@ -7,7 +8,7 @@ if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
$responseObject->error = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||
$responseObject->success = true;
|
||||
$responseObject->lostSession = true;
|
||||
print G::json_encode( $responseObject );
|
||||
print G::json_encode($responseObject);
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -15,38 +16,54 @@ $filter = new InputFilter();
|
||||
$_REQUEST = $filter->xssFilterHard($_REQUEST);
|
||||
$_POST = $filter->xssFilterHard($_POST);
|
||||
|
||||
if(isset($_REQUEST['action']) && $_REQUEST['action'] == "verifySession" ) {
|
||||
if (isset($_REQUEST['action']) && $_REQUEST['action'] == "verifySession") {
|
||||
if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
$response = new stdclass();
|
||||
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||
$response->lostSession = true;
|
||||
print G::json_encode( $response );
|
||||
print G::json_encode($response);
|
||||
die();
|
||||
} else {
|
||||
$response = new stdclass();
|
||||
//When the user has session we will to validate the permissions over other actions
|
||||
/** Action: Reassign from openCase */
|
||||
global $RBAC;
|
||||
$proUid = isset($_SESSION['PROCESS']) ? $_SESSION['PROCESS'] : '';
|
||||
$appUid = isset($_SESSION['APPLICATION']) ? $_SESSION['APPLICATION'] : '';
|
||||
$tasUid = isset($_SESSION['TASK']) ? $_SESSION['TASK'] : '';
|
||||
|
||||
//Check if the user is a supervisor to this Process
|
||||
GLOBAL $RBAC;
|
||||
if($RBAC->userCanAccess('PM_REASSIGNCASE') == 1){
|
||||
$response->reassigncase = true;
|
||||
$response->message = '';
|
||||
} elseif ($RBAC->userCanAccess('PM_REASSIGNCASE_SUPERVISOR') == 1) {
|
||||
$response->reassigncase = false;
|
||||
$response->message = G::LoadTranslation('ID_NOT_ABLE_REASSIGN');
|
||||
$processUser = new ProcessUser();
|
||||
$listProcess = $processUser->getProUidSupervisor($_SESSION['USER_LOGGED']);
|
||||
if (in_array($_SESSION['PROCESS'], $listProcess)) {
|
||||
$response = new stdclass();
|
||||
$userAuthorization = [];
|
||||
if (!empty($proUid) && !empty($appUid)) {
|
||||
$cases = new BmCases();
|
||||
$userAuthorization = $cases->userAuthorization(
|
||||
$RBAC->aUserInfo['USER_INFO']['USR_UID'],
|
||||
$proUid,
|
||||
$appUid,
|
||||
['PM_REASSIGNCASE', 'PM_REASSIGNCASE_SUPERVISOR'],
|
||||
['REASSIGN_MY_CASES' => ''],
|
||||
true,
|
||||
$tasUid
|
||||
);
|
||||
|
||||
if (
|
||||
$userAuthorization['rolesPermissions']['PM_REASSIGNCASE'] ||
|
||||
($userAuthorization['rolesPermissions']['PM_REASSIGNCASE_SUPERVISOR'] && $userAuthorization['supervisor']) ||
|
||||
in_array($appUid, $userAuthorization['objectPermissions']['REASSIGN_MY_CASES'])
|
||||
) {
|
||||
$response->reassigncase = true;
|
||||
$response->message = '';
|
||||
}
|
||||
}
|
||||
$response->reassigncase = false;
|
||||
$response->message = G::LoadTranslation('ID_NOT_ABLE_REASSIGN');
|
||||
|
||||
print G::json_encode( $response );
|
||||
print G::json_encode($response);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
class Ajax
|
||||
{
|
||||
|
||||
public function getCaseMenu($params)
|
||||
{
|
||||
global $G_TMP_MENU;
|
||||
@@ -57,13 +74,13 @@ class Ajax
|
||||
$oMenu = new Menu();
|
||||
$oMenu->load('caseOptions');
|
||||
|
||||
$menuOptions = Array();
|
||||
$menuOptions = array();
|
||||
foreach ($oMenu->Options as $i => $action) {
|
||||
$option = Array('id' => $oMenu->Id[$i], 'label' => $oMenu->Labels[$i], 'action' => $action);
|
||||
$option = array('id' => $oMenu->Id[$i], 'label' => $oMenu->Labels[$i], 'action' => $action);
|
||||
|
||||
switch ($option['id']) {
|
||||
case 'STEPS':
|
||||
$option['options'] = Array();
|
||||
$option['options'] = array();
|
||||
break;
|
||||
case 'ACTIONS':
|
||||
$option['options'] = $this->getActionOptions();
|
||||
@@ -84,7 +101,7 @@ class Ajax
|
||||
$response = new stdclass();
|
||||
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||
$response->lostSession = true;
|
||||
print G::json_encode( $response );
|
||||
print G::json_encode($response);
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -131,82 +148,104 @@ class Ajax
|
||||
|
||||
public function getInformationOptions()
|
||||
{
|
||||
$options = Array();
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_PROCESS_MAP'), 'fn' => 'processMap');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_PROCESS_INFORMATION'), 'fn' => 'processInformation');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_TASK_INFORMATION'), 'fn' => 'taskInformation');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_CASE_HISTORY'), 'fn' => 'caseHistory');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_HISTORY_MESSAGE_CASE'), 'fn' => 'messageHistory');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_DYNAFORMS'), 'fn' => 'dynaformHistory');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_DYNAFORM_HISTORY'), 'fn' => 'changeLogHistory');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_UPLOADED_DOCUMENTS'), 'fn' => 'uploadedDocuments');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_GENERATED_DOCUMENTS'), 'fn' => 'generatedDocuments');
|
||||
$options = array();
|
||||
$options[] = array('text' => G::LoadTranslation('ID_PROCESS_MAP'), 'fn' => 'processMap');
|
||||
$options[] = array('text' => G::LoadTranslation('ID_PROCESS_INFORMATION'), 'fn' => 'processInformation');
|
||||
$options[] = array('text' => G::LoadTranslation('ID_TASK_INFORMATION'), 'fn' => 'taskInformation');
|
||||
$options[] = array('text' => G::LoadTranslation('ID_CASE_HISTORY'), 'fn' => 'caseHistory');
|
||||
$options[] = array('text' => G::LoadTranslation('ID_HISTORY_MESSAGE_CASE'), 'fn' => 'messageHistory');
|
||||
$options[] = array('text' => G::LoadTranslation('ID_DYNAFORMS'), 'fn' => 'dynaformHistory');
|
||||
$options[] = array('text' => G::LoadTranslation('ID_DYNAFORM_HISTORY'), 'fn' => 'changeLogHistory');
|
||||
$options[] = array('text' => G::LoadTranslation('ID_UPLOADED_DOCUMENTS'), 'fn' => 'uploadedDocuments');
|
||||
$options[] = array('text' => G::LoadTranslation('ID_GENERATED_DOCUMENTS'), 'fn' => 'generatedDocuments');
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the options menu from action
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getActionOptions()
|
||||
{
|
||||
$APP_UID = $_SESSION['APPLICATION'];
|
||||
$appUid = $_SESSION['APPLICATION'];
|
||||
$index = $_SESSION['INDEX'];
|
||||
$proUid = $_SESSION['PROCESS'];
|
||||
$tasUid = $_SESSION['TASK'];
|
||||
|
||||
$c = new Criteria('workflow');
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn(AppThreadPeer::APP_THREAD_PARENT);
|
||||
$c->add(AppThreadPeer::APP_UID, $APP_UID);
|
||||
$c->add(AppThreadPeer::APP_UID, $appUid);
|
||||
$c->add(AppThreadPeer::APP_THREAD_STATUS, 'OPEN');
|
||||
$cant = AppThreadPeer::doCount($c);
|
||||
|
||||
$oCase = new Cases();
|
||||
$aFields = $oCase->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX']);
|
||||
$aFields = $oCase->loadCase($appUid, $index);
|
||||
|
||||
GLOBAL $RBAC;
|
||||
global $RBAC;
|
||||
|
||||
$options = Array();
|
||||
$options = [];
|
||||
|
||||
switch ($aFields['APP_STATUS']) {
|
||||
case 'DRAFT':
|
||||
if (!AppDelay::isPaused($_SESSION['APPLICATION'], $_SESSION['INDEX'])) {
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_PAUSED_CASE'), 'fn' => 'setUnpauseCaseDate');
|
||||
if (!AppDelay::isPaused($appUid, $index)) {
|
||||
$options[] = ['text' => G::LoadTranslation('ID_PAUSED_CASE'), 'fn' => 'setUnpauseCaseDate'];
|
||||
} else {
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_UNPAUSE'), 'fn' => 'unpauseCase');
|
||||
$options[] = ['text' => G::LoadTranslation('ID_UNPAUSE'), 'fn' => 'unpauseCase'];
|
||||
}
|
||||
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_DELETE'), 'fn' => 'deleteCase');
|
||||
$options[] = ['text' => G::LoadTranslation('ID_DELETE'), 'fn' => 'deleteCase'];
|
||||
|
||||
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1 || $RBAC->userCanAccess('PM_REASSIGNCASE_SUPERVISOR') == 1) {
|
||||
if (!AppDelay::isPaused($_SESSION['APPLICATION'], $_SESSION['INDEX'])) {
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_REASSIGN'), 'fn' => 'getUsersToReassign');
|
||||
if (!AppDelay::isPaused($appUid, $index)) {
|
||||
$options[] = ['text' => G::LoadTranslation('ID_REASSIGN'), 'fn' => 'getUsersToReassign'];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'TO_DO':
|
||||
if (!AppDelay::isPaused($_SESSION['APPLICATION'], $_SESSION['INDEX'])) {
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_PAUSED_CASE'), 'fn' => 'setUnpauseCaseDate');
|
||||
if (!AppDelay::isPaused($appUid, $index)) {
|
||||
$options[] = ['text' => G::LoadTranslation('ID_PAUSED_CASE'), 'fn' => 'setUnpauseCaseDate'];
|
||||
if ($cant == 1) {
|
||||
if ($RBAC->userCanAccess('PM_CANCELCASE') == 1) {
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_CANCEL'), 'fn' => 'cancelCase');
|
||||
$options[] = ['text' => G::LoadTranslation('ID_CANCEL'), 'fn' => 'cancelCase'];
|
||||
} else {
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_CANCEL'), 'fn' => 'cancelCase', 'hide' => 'hiden');
|
||||
$options[] = ['text' => G::LoadTranslation('ID_CANCEL'), 'fn' => 'cancelCase', 'hide' => 'hiden'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_UNPAUSE'), 'fn' => 'unpauseCase');
|
||||
$options[] = ['text' => G::LoadTranslation('ID_UNPAUSE'), 'fn' => 'unpauseCase'];
|
||||
}
|
||||
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1 || $RBAC->userCanAccess('PM_REASSIGNCASE_SUPERVISOR') == 1) {
|
||||
if (!AppDelay::isPaused($_SESSION['APPLICATION'], $_SESSION['INDEX'])) {
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_REASSIGN'), 'fn' => 'getUsersToReassign');
|
||||
$cases = new BmCases();
|
||||
$userAuthorization = $cases->userAuthorization(
|
||||
$RBAC->aUserInfo['USER_INFO']['USR_UID'],
|
||||
$proUid,
|
||||
$appUid,
|
||||
[],
|
||||
['REASSIGN_MY_CASES' => ''],
|
||||
false,
|
||||
$tasUid
|
||||
);
|
||||
if (
|
||||
$RBAC->userCanAccess('PM_REASSIGNCASE') == 1
|
||||
|| $RBAC->userCanAccess('PM_REASSIGNCASE_SUPERVISOR') == 1
|
||||
|| in_array($appUid, $userAuthorization['objectPermissions']['REASSIGN_MY_CASES'])
|
||||
) {
|
||||
if (!AppDelay::isPaused($appUid, $index)) {
|
||||
$options[] = ['text' => G::LoadTranslation('ID_REASSIGN'), 'fn' => 'getUsersToReassign'];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'CANCELLED':
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_REACTIVATE'), 'fn' => 'reactivateCase');
|
||||
$options[] = ['text' => G::LoadTranslation('ID_REACTIVATE'), 'fn' => 'reactivateCase'];
|
||||
break;
|
||||
}
|
||||
|
||||
if ($_SESSION["TASK"] != "" && $_SESSION["TASK"] != "-1") {
|
||||
$oTask = new Task();
|
||||
$tasksInParallel = explode('|', $_SESSION['TASK']);
|
||||
$tasksInParallel = array_filter($tasksInParallel, function($value) {
|
||||
$tasksInParallel = array_filter($tasksInParallel, function ($value) {
|
||||
return !empty($value);
|
||||
});
|
||||
$nTasksInParallel = count($tasksInParallel);
|
||||
@@ -218,9 +257,10 @@ class Ajax
|
||||
}
|
||||
|
||||
if ($aTask['TAS_TYPE'] == 'ADHOC') {
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_ADHOC_ASSIGNMENT'), 'fn' => 'adhocAssignmentUsers');
|
||||
$options[] = ['text' => G::LoadTranslation('ID_ADHOC_ASSIGNMENT'), 'fn' => 'adhocAssignmentUsers'];
|
||||
}
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
@@ -236,7 +276,7 @@ class Ajax
|
||||
$oTemplatePower->prepare();
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
|
||||
//$oHeadPublisher->addScriptfile('/jscore/processmap/core/processmap.js');
|
||||
$oHeadPublisher->addScriptCode('
|
||||
@@ -329,7 +369,7 @@ class Ajax
|
||||
$response = new stdclass();
|
||||
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||
$response->lostSession = true;
|
||||
print G::json_encode( $response );
|
||||
print G::json_encode($response);
|
||||
die();
|
||||
}
|
||||
$process = new Process();
|
||||
@@ -346,7 +386,7 @@ class Ajax
|
||||
$conf = new Configurations();
|
||||
$conf->getFormats();
|
||||
$processData['PRO_CREATE_DATE'] = $conf->getSystemDate($processData['PRO_CREATE_DATE']);
|
||||
print (G::json_encode($processData));
|
||||
print(G::json_encode($processData));
|
||||
}
|
||||
|
||||
public function getTaskInformation()
|
||||
@@ -355,7 +395,7 @@ class Ajax
|
||||
$response = new stdclass();
|
||||
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||
$response->lostSession = true;
|
||||
print G::json_encode( $response );
|
||||
print G::json_encode($response);
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -367,14 +407,14 @@ class Ajax
|
||||
|
||||
$taskData = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($taskData);
|
||||
|
||||
print (G::json_encode($taskData));
|
||||
print(G::json_encode($taskData));
|
||||
}
|
||||
|
||||
public function caseHistory()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript('cases/caseHistory', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/caseHistory'); //adding a html file .html.
|
||||
@@ -386,7 +426,7 @@ class Ajax
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript('cases/caseMessageHistory', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/caseMessageHistory'); //adding a html file .html.
|
||||
@@ -398,7 +438,7 @@ class Ajax
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript('cases/caseHistoryDynaformPage', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/caseHistoryDynaformPage'); //adding a html file .html.
|
||||
@@ -417,7 +457,7 @@ class Ajax
|
||||
$_SESSION['TASK']
|
||||
);
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript('cases/caseChangeLog', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/caseChangeLog'); //adding a html file .html.
|
||||
@@ -431,12 +471,12 @@ class Ajax
|
||||
$response = new stdclass();
|
||||
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||
$response->lostSession = true;
|
||||
print G::json_encode( $response );
|
||||
print G::json_encode($response);
|
||||
die();
|
||||
}
|
||||
global $G_PUBLISH;
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript('cases/casesUploadedDocumentsPage', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesUploadedDocumentsPage'); //adding a html file .html.
|
||||
@@ -449,7 +489,7 @@ class Ajax
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript('cases/casesUploadedDocumentsPage', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesUploadedDocumentsPage'); //adding a html file .html.
|
||||
@@ -462,7 +502,7 @@ class Ajax
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript('cases/casesGenerateDocumentPage', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesGenerateDocumentPage'); //adding a html file .html.
|
||||
@@ -475,7 +515,7 @@ class Ajax
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript('cases/casesGenerateDocumentPage', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesGenerateDocumentPage'); //adding a html file .html.
|
||||
@@ -508,7 +548,7 @@ class Ajax
|
||||
|
||||
// Save the note pause reason
|
||||
if ($_POST['NOTE_REASON'] != '') {
|
||||
require_once ("classes/model/AppNotes.php");
|
||||
require_once("classes/model/AppNotes.php");
|
||||
$appNotes = new AppNotes();
|
||||
$noteContent = addslashes($_POST['NOTE_REASON']);
|
||||
$appNotes->postNewNote($APP_UID, $_SESSION['USER_LOGGED'], $noteContent, $_POST['NOTIFY_PAUSE']);
|
||||
@@ -531,11 +571,11 @@ class Ajax
|
||||
$response = new stdclass();
|
||||
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||
$response->lostSession = true;
|
||||
print G::json_encode( $response );
|
||||
print G::json_encode($response);
|
||||
die();
|
||||
}
|
||||
|
||||
if(isset($_SESSION['TASK']) && $_SESSION['TASK'] != '-1'){
|
||||
if (isset($_SESSION['TASK']) && $_SESSION['TASK'] != '-1') {
|
||||
$taskUid = $_SESSION['TASK'];
|
||||
} else {
|
||||
$taskUid = $_SESSION['CURRENT_TASK'];
|
||||
@@ -551,7 +591,7 @@ class Ajax
|
||||
$response = [];
|
||||
|
||||
try {
|
||||
$case = new \ProcessMaker\BusinessModel\Cases();
|
||||
$case = new BmCases();
|
||||
|
||||
$result = $case->getUsersToReassign($_SESSION['USER_LOGGED'], $taskUid, ['filter' => $search], $sortField, $sortDir, $start, $limit);
|
||||
|
||||
@@ -578,13 +618,13 @@ class Ajax
|
||||
$TO_USR_UID = $_POST['USR_UID'];
|
||||
try {
|
||||
//Current users of OPEN DEL_INDEX thread
|
||||
if(isset($_SESSION['APPLICATION']) && isset($_SESSION['INDEX'])){
|
||||
if (isset($_SESSION['APPLICATION']) && isset($_SESSION['INDEX'])) {
|
||||
$aCurUser = $oAppDel->getCurrentUsers($_SESSION['APPLICATION'], $_SESSION['INDEX']);
|
||||
}
|
||||
$flagReassign = true;
|
||||
if(!empty($aCurUser)){
|
||||
if (!empty($aCurUser)) {
|
||||
foreach ($aCurUser as $key => $value) {
|
||||
if($value === $TO_USR_UID){
|
||||
if ($value === $TO_USR_UID) {
|
||||
$flagReassign = false;
|
||||
}
|
||||
}
|
||||
@@ -594,7 +634,7 @@ class Ajax
|
||||
}
|
||||
|
||||
//If the currentUser is diferent to nextUser, create the thread
|
||||
if($flagReassign){
|
||||
if ($flagReassign) {
|
||||
$cases->reassignCase($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], $TO_USR_UID);
|
||||
}
|
||||
|
||||
@@ -608,7 +648,7 @@ class Ajax
|
||||
|
||||
// Save the note reassign reason
|
||||
if (isset($_POST['NOTE_REASON']) && $_POST['NOTE_REASON'] !== '') {
|
||||
require_once ("classes/model/AppNotes.php");
|
||||
require_once("classes/model/AppNotes.php");
|
||||
$appNotes = new AppNotes();
|
||||
$noteContent = addslashes($_POST['NOTE_REASON']);
|
||||
$notifyReassign = $_POST['NOTIFY_REASSIGN'] === 'true' ? true: false;
|
||||
@@ -641,7 +681,7 @@ class Ajax
|
||||
|
||||
// Save the note pause reason
|
||||
if ($_REQUEST['NOTE_REASON'] != '') {
|
||||
require_once ("classes/model/AppNotes.php");
|
||||
require_once("classes/model/AppNotes.php");
|
||||
$appNotes = new AppNotes();
|
||||
$noteContent = addslashes($_REQUEST['NOTE_REASON']);
|
||||
$appNotes->postNewNote($APP_UID, $_SESSION['USER_LOGGED'], $noteContent, $_REQUEST['NOTIFY_PAUSE']);
|
||||
@@ -750,7 +790,7 @@ class Ajax
|
||||
$response = new stdclass();
|
||||
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||
$response->lostSession = true;
|
||||
print G::json_encode( $response );
|
||||
print G::json_encode($response);
|
||||
die();
|
||||
}
|
||||
try {
|
||||
@@ -770,8 +810,7 @@ class Ajax
|
||||
$result = new stdclass();
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('view', 'cases/cases_DynaformHistory');
|
||||
?>
|
||||
$G_PUBLISH->AddContent('view', 'cases/cases_DynaformHistory'); ?>
|
||||
<link rel="stylesheet" type="text/css" href="/css/classic.css" />
|
||||
<style type="text/css">
|
||||
html {
|
||||
@@ -948,22 +987,19 @@ class Ajax
|
||||
$a->printView();
|
||||
} else {
|
||||
$G_PUBLISH->AddContent("dynaform", "xmlform", $_SESSION["PROCESS"] . "/" . $_POST["DYN_UID"], "", $Fields["APP_DATA"], "", "", "view");
|
||||
}
|
||||
?>
|
||||
} ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
<?php
|
||||
global $G_FORM;
|
||||
?>
|
||||
global $G_FORM; ?>
|
||||
|
||||
function loadForm_<?php echo $G_FORM->id; ?>(parametro1) {
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
G::RenderPage("publish", "raw");
|
||||
?>
|
||||
G::RenderPage("publish", "raw"); ?>
|
||||
|
||||
<style type="text/css">
|
||||
html {
|
||||
@@ -978,8 +1014,7 @@ class Ajax
|
||||
<script type="text/javascript">
|
||||
|
||||
<?php
|
||||
global $G_FORM;
|
||||
?>
|
||||
global $G_FORM; ?>
|
||||
|
||||
function loadForm_<?php echo $G_FORM->id; ?>(parametro1) {
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Cases as ClassesCases;
|
||||
use ProcessMaker\Util\DateTime;
|
||||
|
||||
$actionAjax = isset($_REQUEST['actionAjax']) ? $_REQUEST['actionAjax'] : null;
|
||||
@@ -7,7 +8,10 @@ $actionAjax = isset($_REQUEST['actionAjax']) ? $_REQUEST['actionAjax'] : null;
|
||||
switch ($actionAjax) {
|
||||
case 'historyGridList_JXP':
|
||||
global $G_PUBLISH;
|
||||
$criteria = Cases::getTransferHistoryCriteria($_SESSION['APPLICATION']);
|
||||
$appUid = $_SESSION['APPLICATION'];
|
||||
$case = new ClassesCases();
|
||||
$fields = $case->loadCase($appUid);
|
||||
$criteria = Cases::getTransferHistoryCriteria($fields['APP_NUMBER']);
|
||||
|
||||
$dataSet = GulliverBasePeer::doSelectRs($criteria);
|
||||
$totalCount = $dataSet->getRecordCount();
|
||||
|
||||
@@ -9,7 +9,7 @@ $oCriteria = new Criteria("workflow");
|
||||
$oCriteria->add(CaseConsolidatedCorePeer::CON_STATUS, 'ACTIVE');
|
||||
$activeNumRows = CaseConsolidatedCorePeer::doCount($oCriteria);
|
||||
|
||||
$headPublisher = &headPublisher::getSingleton();
|
||||
$headPublisher = headPublisher::getSingleton();
|
||||
$usrUid = $_SESSION["USER_LOGGED"];
|
||||
$conf = new Configurations();
|
||||
|
||||
@@ -115,7 +115,7 @@ if (count($arrayTabItem) > 0) {
|
||||
$headPublisher->assign("varSkin", SYS_SKIN); //Sending the current Skin
|
||||
$headPublisher->assign("FORMATS", $conf->getFormats());
|
||||
$headPublisher->assign("urlProxy", $urlProxy);
|
||||
$headPublisher->assign('credentials', $clientToken );
|
||||
$headPublisher->assign('credentials', $clientToken);
|
||||
|
||||
$oHeadPublisher->assign('isIE', Bootstrap::isIE());
|
||||
|
||||
@@ -177,7 +177,7 @@ function getProcessArray($action, $userUid)
|
||||
|
||||
function getConsolidated()
|
||||
{
|
||||
$caseColumns = array ();
|
||||
$caseColumns = array();
|
||||
$caseColumns[] = array("header" =>"#", "dataIndex" => "APP_NUMBER", "width" => 45, "align" => "center");
|
||||
$caseColumns[] = array("header" =>"Case", "dataIndex" => "APP_TITLE", "width" => 150);
|
||||
$caseColumns[] = array("header" =>"UserUid", "dataIndex" => "USR_UID", "width" => 50, "hidden" => true, "hideable" => false);
|
||||
@@ -269,4 +269,4 @@ function getAuthorizationCode($client)
|
||||
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=')+5, 40);
|
||||
|
||||
return $code;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,23 +21,23 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
$actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
|
||||
$actionAjax = isset($_REQUEST['actionAjax']) ? $_REQUEST['actionAjax'] : null;
|
||||
|
||||
function casesShowOuputDocumentExist ($url)
|
||||
function casesShowOuputDocumentExist($url)
|
||||
{
|
||||
$urlArray = explode( "?", $url );
|
||||
$urlArray = explode("?", $url);
|
||||
$urlParametroString = $urlArray[1];
|
||||
|
||||
parse_str( $urlParametroString, $_GET );
|
||||
parse_str($urlParametroString, $_GET);
|
||||
|
||||
require_once ("classes/model/AppDocumentPeer.php");
|
||||
require_once("classes/model/AppDocumentPeer.php");
|
||||
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'], (isset( $_GET['v'] )) ? $_GET['v'] : null );
|
||||
$oAppDocument->Fields = $oAppDocument->load($_GET['a'], (isset($_GET['v'])) ? $_GET['v'] : null);
|
||||
|
||||
$sAppDocUid = $oAppDocument->getAppDocUid();
|
||||
$info = pathinfo( $oAppDocument->getAppDocFilename() );
|
||||
if (! isset( $_GET['ext'] )) {
|
||||
$info = pathinfo($oAppDocument->getAppDocFilename());
|
||||
if (! isset($_GET['ext'])) {
|
||||
$ext = $info['extension'];
|
||||
} else {
|
||||
if ($_GET['ext'] != '') {
|
||||
@@ -46,7 +46,7 @@ function casesShowOuputDocumentExist ($url)
|
||||
$ext = $info['extension'];
|
||||
}
|
||||
}
|
||||
$ver = (isset( $_GET['v'] ) && $_GET['v'] != '') ? '_' . $_GET['v'] : '';
|
||||
$ver = (isset($_GET['v']) && $_GET['v'] != '') ? '_' . $_GET['v'] : '';
|
||||
|
||||
if (! $ver) {
|
||||
//This code is in the case the outputdocument won't be versioned
|
||||
@@ -57,12 +57,12 @@ function casesShowOuputDocumentExist ($url)
|
||||
$realPath1 = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $info['basename'] . $ver . '.' . $ext;
|
||||
$realPath2 = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $info['basename'] . '.' . $ext;
|
||||
$sw_file_exists = false;
|
||||
if (file_exists( $realPath )) {
|
||||
if (file_exists($realPath)) {
|
||||
$sw_file_exists = true;
|
||||
} elseif (file_exists( $realPath1 )) {
|
||||
} elseif (file_exists($realPath1)) {
|
||||
$sw_file_exists = true;
|
||||
$realPath = $realPath1;
|
||||
} elseif (file_exists( $realPath2 )) {
|
||||
} elseif (file_exists($realPath2)) {
|
||||
$sw_file_exists = true;
|
||||
$realPath = $realPath2;
|
||||
}
|
||||
@@ -76,39 +76,38 @@ function casesShowOuputDocumentExist ($url)
|
||||
|
||||
if ($actionAjax == 'casesGenerateDocumentPage') {
|
||||
global $G_PUBLISH;
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript( 'cases/casesGenerateDocumentPage', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/casesGenerateDocumentPage' ); //adding a html file .html.
|
||||
$oHeadPublisher->addExtJsScript('cases/casesGenerateDocumentPage', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesGenerateDocumentPage'); //adding a html file .html.
|
||||
$oHeadPublisher->assign("FORMATS", $conf->getFormats());
|
||||
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
$oHeadPublisher->assign('pageSize', $conf->getEnvSetting('casesListRowNumber'));
|
||||
G::RenderPage('publish', 'extJs');
|
||||
}
|
||||
if ($actionAjax == 'generateDocumentGrid_Ajax') {
|
||||
|
||||
global $G_PUBLISH;
|
||||
$oCase = new Cases();
|
||||
|
||||
$aProcesses = Array ();
|
||||
$aProcesses = array();
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$c = $oCase->getAllGeneratedDocumentsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED'] );
|
||||
$c = $oCase->getAllGeneratedDocumentsCriteria($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED']);
|
||||
if ($c->getDbName() == 'dbarray') {
|
||||
$rs = ArrayBasePeer::doSelectRs( $c );
|
||||
$rs = ArrayBasePeer::doSelectRs($c);
|
||||
} else {
|
||||
$rs = GulliverBasePeer::doSelectRs( $c );
|
||||
$rs = GulliverBasePeer::doSelectRs($c);
|
||||
}
|
||||
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
|
||||
$totalCount = 0;
|
||||
for ($j = 0; $j < $rs->getRecordCount(); $j ++) {
|
||||
$result = $rs->getRow();
|
||||
|
||||
$result["FILEDOCEXIST"] = casesShowOuputDocumentExist( $result["FILEDOC"] );
|
||||
$result["FILEPDFEXIST"] = casesShowOuputDocumentExist( $result["FILEPDF"] );
|
||||
$result["FILEDOCEXIST"] = casesShowOuputDocumentExist($result["FILEDOC"]);
|
||||
$result["FILEPDFEXIST"] = casesShowOuputDocumentExist($result["FILEPDF"]);
|
||||
|
||||
$aProcesses[] = $result;
|
||||
|
||||
@@ -120,19 +119,18 @@ if ($actionAjax == 'generateDocumentGrid_Ajax') {
|
||||
|
||||
$conf = new Configurations();
|
||||
try {
|
||||
$generalConfCasesList = $conf->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
|
||||
$generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||
} catch (Exception $e) {
|
||||
$generalConfCasesList = array ();
|
||||
$generalConfCasesList = array();
|
||||
}
|
||||
$dateFormat = "";
|
||||
if (isset( $generalConfCasesList['casesListDateFormat'] ) && ! empty( $generalConfCasesList['casesListDateFormat'] )) {
|
||||
if (isset($generalConfCasesList['casesListDateFormat']) && ! empty($generalConfCasesList['casesListDateFormat'])) {
|
||||
$dateFormat = $generalConfCasesList['casesListDateFormat'];
|
||||
}
|
||||
$newDir = '/tmp/test/directory';
|
||||
$r = G::verifyPath( $newDir );
|
||||
$r = G::verifyPath($newDir);
|
||||
$r->data = $aProcesses;
|
||||
$r->totalCount = $totalCount;
|
||||
$r->dataFormat = $dateFormat;
|
||||
echo G::json_encode( $r );
|
||||
echo G::json_encode($r);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,34 +28,38 @@ $_GET = $filter->xssFilterHard($_GET);
|
||||
$_POST = $filter->xssFilterHard($_POST);
|
||||
$_REQUEST = $filter->xssFilterHard($_REQUEST);
|
||||
|
||||
$actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
|
||||
$actionAjax = isset($_REQUEST['actionAjax']) ? $_REQUEST['actionAjax'] : null;
|
||||
|
||||
if ($actionAjax == "historyDynaformPage") {
|
||||
global $G_PUBLISH;
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript( 'cases/caseHistoryDynaformPage', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/caseHistoryDynaformPage' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
$oHeadPublisher->addExtJsScript('cases/caseHistoryDynaformPage', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/caseHistoryDynaformPage'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('pageSize', $conf->getEnvSetting('casesListRowNumber'));
|
||||
G::RenderPage('publish', 'extJs');
|
||||
}
|
||||
if ($actionAjax == 'historyDynaformGrid_Ajax') {
|
||||
|
||||
global $G_PUBLISH;
|
||||
$oCase = new Cases();
|
||||
|
||||
$aProcesses = Array ();
|
||||
$c = $oCase->getallDynaformsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['CURRENT_TASK'],
|
||||
$_SESSION['USER_LOGGED'] , $_SESSION['INDEX']);
|
||||
$aProcesses = array();
|
||||
$c = $oCase->getallDynaformsCriteria(
|
||||
$_SESSION['PROCESS'],
|
||||
$_SESSION['APPLICATION'],
|
||||
$_SESSION['CURRENT_TASK'],
|
||||
$_SESSION['USER_LOGGED'],
|
||||
$_SESSION['INDEX']
|
||||
);
|
||||
|
||||
if ($c->getDbName() == 'dbarray') {
|
||||
$rs = ArrayBasePeer::doSelectRs( $c );
|
||||
$rs = ArrayBasePeer::doSelectRs($c);
|
||||
} else {
|
||||
$rs = GulliverBasePeer::doSelectRs( $c );
|
||||
$rs = GulliverBasePeer::doSelectRs($c);
|
||||
}
|
||||
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$rs->next();
|
||||
|
||||
for ($j = 0; $j < $rs->getRecordCount(); $j ++) {
|
||||
@@ -66,13 +70,13 @@ if ($actionAjax == 'historyDynaformGrid_Ajax') {
|
||||
}
|
||||
|
||||
$newDir = '/tmp/test/directory';
|
||||
G::verifyPath( $newDir );
|
||||
G::verifyPath($newDir);
|
||||
|
||||
$r = new stdclass();
|
||||
$r->data = $aProcesses;
|
||||
$r->totalCount = 2;
|
||||
|
||||
echo G::json_encode( $r );
|
||||
echo G::json_encode($r);
|
||||
}
|
||||
|
||||
if ($actionAjax == 'showHistoryMessage') {
|
||||
@@ -110,19 +114,16 @@ if ($actionAjax == 'showHistoryMessage') {
|
||||
$G_PUBLISH = new Publisher();
|
||||
$oCase = new Cases();
|
||||
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_MessagesView', '', $oCase->getHistoryMessagesTrackerView( $_POST['APP_UID'], $_POST['APP_MSG_UID'] ) );
|
||||
|
||||
?>
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_MessagesView', '', $oCase->getHistoryMessagesTrackerView($_POST['APP_UID'], $_POST['APP_MSG_UID'])); ?>
|
||||
<script language="javascript">
|
||||
<?php
|
||||
global $G_FORM;
|
||||
?>
|
||||
function loadForm_<?php echo $G_FORM->id;?>(parametro1) {
|
||||
global $G_FORM; ?>
|
||||
function loadForm_<?php echo $G_FORM->id; ?>(parametro1) {
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
G::RenderPage('publish', 'raw');
|
||||
}
|
||||
|
||||
if ($actionAjax == 'showDynaformListHistory') {
|
||||
@@ -130,9 +131,7 @@ if ($actionAjax == 'showDynaformListHistory') {
|
||||
$_POST["APP_UID"] = $_REQUEST["APP_UID"];
|
||||
$_POST["DYN_UID"] = $_REQUEST["DYN_UID"];
|
||||
$_POST["PRO_UID"] = $_REQUEST["PRO_UID"];
|
||||
$_POST["TAS_UID"] = $_REQUEST["TAS_UID"];
|
||||
|
||||
?>
|
||||
$_POST["TAS_UID"] = $_REQUEST["TAS_UID"]; ?>
|
||||
<link rel="stylesheet" type="text/css" href="/css/classic.css" />
|
||||
<style type="text/css">
|
||||
html {
|
||||
@@ -341,13 +340,12 @@ if ($actionAjax == 'showDynaformListHistory') {
|
||||
|
||||
require_once 'classes/model/AppHistory.php';
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/cases_DynaformHistory' );
|
||||
$G_PUBLISH->AddContent('view', 'cases/cases_DynaformHistory');
|
||||
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
G::RenderPage('publish', 'raw');
|
||||
}
|
||||
|
||||
if ($actionAjax == 'dynaformChangeLogViewHistory') {
|
||||
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="/css/classic.css" />
|
||||
<style type="text/css">
|
||||
@@ -395,8 +393,7 @@ if ($actionAjax == 'dynaformChangeLogViewHistory') {
|
||||
$a->printView();
|
||||
} else {
|
||||
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view');
|
||||
}
|
||||
?>
|
||||
} ?>
|
||||
|
||||
<script language="javascript">
|
||||
window.onload = function () {
|
||||
@@ -412,14 +409,13 @@ if ($actionAjax == 'dynaformChangeLogViewHistory') {
|
||||
|
||||
<script language="javascript">
|
||||
<?php
|
||||
global $G_FORM;
|
||||
?>
|
||||
function loadForm_<?php echo $G_FORM->id;?>(parametro1) {
|
||||
global $G_FORM; ?>
|
||||
function loadForm_<?php echo $G_FORM->id; ?>(parametro1) {
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
G::RenderPage('publish', 'raw');
|
||||
}
|
||||
if ($actionAjax == 'historyDynaformGridPreview') {
|
||||
?>
|
||||
@@ -453,13 +449,12 @@ if ($actionAjax == 'historyDynaformGridPreview') {
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$oCase = new Cases();
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
$Fields = $oCase->loadCase($_SESSION['APPLICATION']);
|
||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
|
||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
|
||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#';
|
||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;';
|
||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['DYNUIDPRINT'] = $_POST['DYN_UID'];
|
||||
?>
|
||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['DYNUIDPRINT'] = $_POST['DYN_UID']; ?>
|
||||
|
||||
<script language="javascript">
|
||||
window.onload = function () {
|
||||
@@ -484,21 +479,18 @@ if ($actionAjax == 'historyDynaformGridPreview') {
|
||||
$a->printView();
|
||||
} else {
|
||||
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view');
|
||||
}
|
||||
?>
|
||||
} ?>
|
||||
<script language="javascript">
|
||||
|
||||
function popUp(URL, width, height, left, top, resizable) {
|
||||
window.open(URL, '', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable='+resizable+',width='+width+',height='+height+',left = '+left+',top = '+top+'');
|
||||
}
|
||||
<?php
|
||||
global $G_FORM;
|
||||
?>
|
||||
function loadForm_<?php echo $G_FORM->id;?>(parametro1) {
|
||||
global $G_FORM; ?>
|
||||
function loadForm_<?php echo $G_FORM->id; ?>(parametro1) {
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
G::RenderPage('publish', 'blank');
|
||||
}
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ use ProcessMaker\Plugins\PluginRegistry;
|
||||
unset($_SESSION['APPLICATION']);
|
||||
|
||||
//get the action from GET or POST, default is todo
|
||||
$action = isset( $_GET['action'] ) ? $_GET['action'] : (isset( $_POST['action'] ) ? $_POST['action'] : 'todo');
|
||||
$action = isset($_GET['action']) ? $_GET['action'] : (isset($_POST['action']) ? $_POST['action'] : 'todo');
|
||||
$openApplicationUid = (isset($_GET['openApplicationUid']))? $_GET['openApplicationUid'] : null;
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$filterAction = isset( $_GET['filterAction'] ) ? $_GET['filterAction'] : (isset( $_POST['filterAction'] ) ? $_POST['filterAction'] : '');
|
||||
$filterAction = isset($_GET['filterAction']) ? $_GET['filterAction'] : (isset($_POST['filterAction']) ? $_POST['filterAction'] : '');
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
//fix a previous inconsistency
|
||||
@@ -59,32 +59,32 @@ switch ($action) {
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
// oHeadPublisher->setExtSkin( 'xtheme-blue');
|
||||
//get the configuration for this action
|
||||
$conf = new Configurations();
|
||||
try {
|
||||
// the setup for search is the same as the Sent (participated)
|
||||
$confCasesList = $conf->getConfiguration( 'casesList', ($action == 'search' || $action == 'simple_search') ? 'search' : $action );
|
||||
$confCasesList = $conf->getConfiguration('casesList', ($action == 'search' || $action == 'simple_search') ? 'search' : $action);
|
||||
|
||||
$table = null;
|
||||
if (isset($confCasesList['PMTable'])) {
|
||||
$aditionalTable = new AdditionalTables();
|
||||
$table = $aditionalTable->load($confCasesList['PMTable']);
|
||||
}
|
||||
$confCasesList = ($table != null) ? $confCasesList : array ();
|
||||
$confCasesList = ($table != null) ? $confCasesList : array();
|
||||
|
||||
$generalConfCasesList = $conf->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
|
||||
$generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||
} catch (Exception $e) {
|
||||
$confCasesList = array ();
|
||||
$generalConfCasesList = array ();
|
||||
$confCasesList = array();
|
||||
$generalConfCasesList = array();
|
||||
}
|
||||
|
||||
// reassign header configuration
|
||||
$confReassignList = getReassignList();
|
||||
|
||||
// evaluates an action and the configuration for the list that will be rendered
|
||||
$config = getAdditionalFields( $action, $confCasesList );
|
||||
$config = getAdditionalFields($action, $confCasesList);
|
||||
|
||||
$columns = $config['caseColumns'];
|
||||
$readerFields = $config['caseReaderFields'];
|
||||
@@ -92,14 +92,14 @@ $reassignColumns = $confReassignList['caseColumns'];
|
||||
$reassignReaderFields = $confReassignList['caseReaderFields'];
|
||||
|
||||
// if the general settings has been set the pagesize values are extracted from that record
|
||||
if (isset( $generalConfCasesList['casesListRowNumber'] ) && ! empty( $generalConfCasesList['casesListRowNumber'] )) {
|
||||
$pageSize = intval( $generalConfCasesList['casesListRowNumber'] );
|
||||
if (isset($generalConfCasesList['casesListRowNumber']) && ! empty($generalConfCasesList['casesListRowNumber'])) {
|
||||
$pageSize = intval($generalConfCasesList['casesListRowNumber']);
|
||||
} else {
|
||||
$pageSize = intval( $config['rowsperpage'] );
|
||||
$pageSize = intval($config['rowsperpage']);
|
||||
}
|
||||
|
||||
// if the general settings has been set the dateFormat values are extracted from that record
|
||||
if (isset( $generalConfCasesList['casesListDateFormat'] ) && ! empty( $generalConfCasesList['casesListDateFormat'] )) {
|
||||
if (isset($generalConfCasesList['casesListDateFormat']) && ! empty($generalConfCasesList['casesListDateFormat'])) {
|
||||
$dateFormat = $generalConfCasesList['casesListDateFormat'];
|
||||
} else {
|
||||
$dateFormat = $config['dateformat'];
|
||||
@@ -109,14 +109,14 @@ if ($action == 'draft') {
|
||||
//array_unshift ( $columns, array( 'header'=> '', 'width'=> 50, 'sortable'=> false, 'id'=> 'deleteLink' ) );
|
||||
}
|
||||
if ($action == 'selfservice') {
|
||||
array_unshift( $columns, array ('header' => '','width' => 50,'sortable' => false,'id' => 'viewLink') );
|
||||
array_unshift($columns, array('header' => '','width' => 50,'sortable' => false,'id' => 'viewLink'));
|
||||
}
|
||||
|
||||
if ($action == 'paused') {
|
||||
//array_unshift ( $columns, array( 'header'=> '', 'width'=> 50, 'sortable'=> false, 'id'=> 'unpauseLink' ) );
|
||||
}
|
||||
|
||||
$userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
|
||||
$userUid = (isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
|
||||
$oAppCache = new AppCacheView();
|
||||
$oAppCache->confCasesList = $confCasesList;
|
||||
$solrEnabled = 0;
|
||||
@@ -164,8 +164,8 @@ $oHeadPublisher->assign('columnSearchValues', $columnToSearch); //Sending the li
|
||||
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=') ) {
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=')) {
|
||||
$filterStatus[] = array('', G::LoadTranslation('ID_ALL_STATUS'));
|
||||
$filterStatus[] = array('ON_TIME', G::LoadTranslation('ID_ON_TIME'));
|
||||
$filterStatus[] = array('AT_RISK', G::LoadTranslation('ID_AT_RISK'));
|
||||
@@ -184,17 +184,18 @@ if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjB
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
//menu permissions
|
||||
/** Define actions menu in the cases list */
|
||||
$cnt = '';
|
||||
$reassignCase = ($RBAC->userCanAccess( 'PM_REASSIGNCASE' ) == 1) ? 'true' : 'false';
|
||||
$reassignCaseSup = ($RBAC->userCanAccess( 'PM_REASSIGNCASE_SUPERVISOR' ) == 1) ? 'true':'false';
|
||||
$oHeadPublisher->assign( 'varReassignCase', $reassignCase );
|
||||
$oHeadPublisher->assign( 'varReassignCaseSupervisor', $reassignCaseSup );
|
||||
$reassignCase = ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) ? 'true' : 'false';
|
||||
$reassignCaseSup = ($RBAC->userCanAccess('PM_REASSIGNCASE_SUPERVISOR') == 1) ? 'true' : 'false';
|
||||
$oHeadPublisher->assign('varReassignCase', $reassignCase);
|
||||
$oHeadPublisher->assign('varReassignCaseSupervisor', $reassignCaseSup);
|
||||
|
||||
$c = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript( 'app/main', true );
|
||||
$oHeadPublisher->addExtJsScript( 'cases/casesList', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/casesListExtJs' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
||||
$oHeadPublisher->addExtJsScript('app/main', true);
|
||||
$oHeadPublisher->addExtJsScript('cases/casesList', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesListExtJs'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('FORMATS', $c->getFormats());
|
||||
$oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState());
|
||||
$oHeadPublisher->assign('isIE', Bootstrap::isIE());
|
||||
$oHeadPublisher->assign('__OPEN_APPLICATION_UID__', $openApplicationUid);
|
||||
@@ -202,39 +203,39 @@ $oHeadPublisher->assign('__OPEN_APPLICATION_UID__', $openApplicationUid);
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$fromPlugin = $oPluginRegistry->getOpenReassignCallback();
|
||||
$jsFunction = false;
|
||||
if(sizeof($fromPlugin)) {
|
||||
if (sizeof($fromPlugin)) {
|
||||
/** @var \ProcessMaker\Plugins\Interfaces\OpenReassignCallback $jsFile */
|
||||
foreach($fromPlugin as $jsFile) {
|
||||
foreach ($fromPlugin as $jsFile) {
|
||||
$jsFile = $jsFile->getCallBackFile();
|
||||
if(is_file($jsFile)) {
|
||||
if (is_file($jsFile)) {
|
||||
$jsFile = file_get_contents($jsFile);
|
||||
if(!empty($jsFile)) {
|
||||
if (!empty($jsFile)) {
|
||||
$jsFunction[] = $jsFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$oHeadPublisher->assign( 'openReassignCallback', $jsFunction );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
$oHeadPublisher->assign('openReassignCallback', $jsFunction);
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
function getCategoryArray ()
|
||||
function getCategoryArray()
|
||||
{
|
||||
global $oAppCache;
|
||||
require_once 'classes/model/ProcessCategory.php';
|
||||
$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 );
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_UID);
|
||||
$criteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
|
||||
$criteria->addAscendingOrderByColumn(ProcessCategoryPeer::CATEGORY_NAME);
|
||||
|
||||
$dataset = ProcessCategoryPeer::doSelectRS( $criteria );
|
||||
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$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;
|
||||
@@ -247,9 +248,9 @@ function getStatusArray($action, $userUid)
|
||||
$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;
|
||||
@@ -259,66 +260,66 @@ function getStatusArray($action, $userUid)
|
||||
* get the list configuration headers of the cases checked for reassign, for the
|
||||
* reassign cases list.
|
||||
*/
|
||||
function getReassignList ()
|
||||
function getReassignList()
|
||||
{
|
||||
$caseColumns = array ();
|
||||
$caseColumns[] = array ('header' => '#','dataIndex' => 'APP_NUMBER','width' => 40);
|
||||
$caseColumns[] = array ('header' => G::LoadTranslation( 'ID_SUMMARY' ),'dataIndex' => 'CASE_SUMMARY','width' => 45,'hidden' => true
|
||||
$caseColumns = array();
|
||||
$caseColumns[] = array('header' => '#','dataIndex' => 'APP_NUMBER','width' => 40);
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_SUMMARY'),'dataIndex' => 'CASE_SUMMARY','width' => 45,'hidden' => true
|
||||
);
|
||||
$caseColumns[] = array ('header' => G::LoadTranslation( 'ID_CASES_NOTES' ),'dataIndex' => 'CASE_NOTES_COUNT','width' => 45,'hidden' => true
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_CASES_NOTES'),'dataIndex' => 'CASE_NOTES_COUNT','width' => 45,'hidden' => true
|
||||
);
|
||||
$caseColumns[] = array ('header' => G::LoadTranslation( 'ID_CASE' ),'dataIndex' => 'APP_TITLE','width' => 100,'hidden' => true
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_CASE'),'dataIndex' => 'APP_TITLE','width' => 100,'hidden' => true
|
||||
);
|
||||
$caseColumns[] = array ('header' => 'CaseId','dataIndex' => 'APP_UID','width' => 200,'hidden' => true,'hideable' => false
|
||||
$caseColumns[] = array('header' => 'CaseId','dataIndex' => 'APP_UID','width' => 200,'hidden' => true,'hideable' => false
|
||||
);
|
||||
$caseColumns[] = array ('header' => 'User','dataIndex' => 'USR_UID','width' => 200,'hidden' => true,'hideable' => false
|
||||
$caseColumns[] = array('header' => 'User','dataIndex' => 'USR_UID','width' => 200,'hidden' => true,'hideable' => false
|
||||
);
|
||||
$caseColumns[] = array ('header' => G::LoadTranslation( 'ID_TASK' ),'dataIndex' => 'APP_TAS_TITLE','width' => 120
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_TASK'),'dataIndex' => 'APP_TAS_TITLE','width' => 120
|
||||
);
|
||||
$caseColumns[] = array ('header' => G::LoadTranslation( 'ID_PROCESS' ),'dataIndex' => 'APP_PRO_TITLE','width' => 120
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_PROCESS'),'dataIndex' => 'APP_PRO_TITLE','width' => 120
|
||||
);
|
||||
$caseColumns[] = array ('header' => 'Reassigned Uid','dataIndex' => 'APP_REASSIGN_USER_UID','width' => 120,'hidden' => true,'hideable' => false
|
||||
$caseColumns[] = array('header' => 'Reassigned Uid','dataIndex' => 'APP_REASSIGN_USER_UID','width' => 120,'hidden' => true,'hideable' => false
|
||||
);
|
||||
$caseColumns[] = array ('header' => 'Reassigned Uid','dataIndex' => 'TAS_UID','width' => 120,'hidden' => true,'hideable' => false
|
||||
$caseColumns[] = array('header' => 'Reassigned Uid','dataIndex' => 'TAS_UID','width' => 120,'hidden' => true,'hideable' => false
|
||||
);
|
||||
$caseColumns[] = array ('header' => G::LoadTranslation( 'ID_ASSIGNED_TO' ),'dataIndex' => 'APP_CURRENT_USER','width' => 170
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_ASSIGNED_TO'),'dataIndex' => 'APP_CURRENT_USER','width' => 170
|
||||
);
|
||||
$caseColumns[] = array ('header' => G::LoadTranslation( 'ID_REASSIGNED_TO' ),'dataIndex' => 'APP_REASSIGN_USER','width' => 170
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_REASSIGNED_TO'),'dataIndex' => 'APP_REASSIGN_USER','width' => 170
|
||||
);
|
||||
$caseColumns[] = array ('header' => G::LoadTranslation( 'ID_REASON' ),'dataIndex' => 'NOTE_REASON','width' => 170
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_REASON'),'dataIndex' => 'NOTE_REASON','width' => 170
|
||||
);
|
||||
$caseColumns[] = array('header' => G::LoadTranslation('ID_NOTIFY'), 'dataIndex' => 'NOTIFY_REASSIGN', 'width' => 100
|
||||
);
|
||||
|
||||
$caseReaderFields = array ();
|
||||
$caseReaderFields[] = array ('name' => 'APP_NUMBER');
|
||||
$caseReaderFields[] = array ('name' => 'APP_TITLE');
|
||||
$caseReaderFields[] = array ('name' => 'APP_UID');
|
||||
$caseReaderFields[] = array ('name' => 'USR_UID');
|
||||
$caseReaderFields[] = array ('name' => 'APP_TAS_TITLE');
|
||||
$caseReaderFields[] = array ('name' => 'APP_PRO_TITLE');
|
||||
$caseReaderFields[] = array ('name' => 'APP_REASSIGN_USER_UID');
|
||||
$caseReaderFields[] = array ('name' => 'TAS_UID');
|
||||
$caseReaderFields[] = array ('name' => 'APP_REASSIGN_USER');
|
||||
$caseReaderFields[] = array ('name' => 'CASE_SUMMARY');
|
||||
$caseReaderFields[] = array ('name' => 'CASE_NOTES_COUNT');
|
||||
$caseReaderFields[] = array ('name' => 'APP_CURRENT_USER');
|
||||
$caseReaderFields = array();
|
||||
$caseReaderFields[] = array('name' => 'APP_NUMBER');
|
||||
$caseReaderFields[] = array('name' => 'APP_TITLE');
|
||||
$caseReaderFields[] = array('name' => 'APP_UID');
|
||||
$caseReaderFields[] = array('name' => 'USR_UID');
|
||||
$caseReaderFields[] = array('name' => 'APP_TAS_TITLE');
|
||||
$caseReaderFields[] = array('name' => 'APP_PRO_TITLE');
|
||||
$caseReaderFields[] = array('name' => 'APP_REASSIGN_USER_UID');
|
||||
$caseReaderFields[] = array('name' => 'TAS_UID');
|
||||
$caseReaderFields[] = array('name' => 'APP_REASSIGN_USER');
|
||||
$caseReaderFields[] = array('name' => 'CASE_SUMMARY');
|
||||
$caseReaderFields[] = array('name' => 'CASE_NOTES_COUNT');
|
||||
$caseReaderFields[] = array('name' => 'APP_CURRENT_USER');
|
||||
|
||||
return array ('caseColumns' => $caseColumns,'caseReaderFields' => $caseReaderFields,'rowsperpage' => 20,'dateformat' => 'M d, Y'
|
||||
return array('caseColumns' => $caseColumns,'caseReaderFields' => $caseReaderFields,'rowsperpage' => 20,'dateformat' => 'M d, Y'
|
||||
);
|
||||
}
|
||||
|
||||
function getReassignUsersList ()
|
||||
function getReassignUsersList()
|
||||
{
|
||||
$caseColumns = array ();
|
||||
$caseColumns = array();
|
||||
|
||||
$caseReaderFields = array ();
|
||||
$caseReaderFields[] = array ('name' => 'userUid'
|
||||
$caseReaderFields = array();
|
||||
$caseReaderFields[] = array('name' => 'userUid'
|
||||
);
|
||||
$caseReaderFields[] = array ('name' => 'userFullname'
|
||||
$caseReaderFields[] = array('name' => 'userFullname'
|
||||
);
|
||||
|
||||
return array ('caseColumns' => $caseColumns,'caseReaderFields' => $caseReaderFields,'rowsperpage' => 20,'dateformat' => 'M d, Y'
|
||||
return array('caseColumns' => $caseColumns,'caseReaderFields' => $caseReaderFields,'rowsperpage' => 20,'dateformat' => 'M d, Y'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -390,7 +391,7 @@ function getAdditionalFields($action, $confCasesList = array())
|
||||
* This function define the possibles columns for apply the specific search
|
||||
* @return array $filters values of the dropdown
|
||||
*/
|
||||
function getColumnsSearchArray ()
|
||||
function getColumnsSearchArray()
|
||||
{
|
||||
$filters = [];
|
||||
$filters[] = ['APP_TITLE', G::LoadTranslation('ID_CASE_TITLE')];
|
||||
@@ -435,4 +436,4 @@ function getAuthorizationCode($client)
|
||||
|
||||
return $code;
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
@@ -4,14 +4,13 @@ if (typeof window.parent != 'undefined') {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$pathDerivateGmail = 'derivatedGmail';
|
||||
$statusPMGmail = false;
|
||||
$licensedFeatures = &PMLicensedFeatures::getSingleton();
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
|
||||
|
||||
$pmGoogle = new PmGoogleApi();
|
||||
$statusPMGmail = $pmGoogle->getServiceGmailStatus();
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (isset( $_GET['ux'] )) {
|
||||
if (isset($_GET['ux'])) {
|
||||
switch ($_GET['ux']) {
|
||||
case 'SIMPLIFIED':
|
||||
case 'SWITCHABLE':
|
||||
@@ -21,25 +20,25 @@ if (isset( $_GET['ux'] )) {
|
||||
default:
|
||||
$url = 'casesListExtJs';
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
} else if( $statusPMGmail ){
|
||||
/*----------------------------------********---------------------------------*/
|
||||
} elseif ($statusPMGmail) {
|
||||
$url = $pathDerivateGmail;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
/*----------------------------------********---------------------------------*/
|
||||
} else {
|
||||
$url = 'casesListExtJs';
|
||||
}
|
||||
if (isset( $_GET['ux'] )) {
|
||||
if (isset($_GET['ux'])) {
|
||||
echo 'if (typeof window.parent.ux_env != \'undefined\') {';
|
||||
}
|
||||
echo " window.parent.location.href = '$url';";
|
||||
if (isset( $_GET['ux'] )) {
|
||||
if (isset($_GET['ux'])) {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if(PMLicensedFeatures::getSingleton()->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09') && $statusPMGmail){
|
||||
if (PMLicensedFeatures::getSingleton()->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09') && $statusPMGmail) {
|
||||
echo '} else { window.parent.location.href = \''.$pathDerivateGmail.'\'; }';
|
||||
} else {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
/*----------------------------------********---------------------------------*/
|
||||
echo '} else { window.parent.location.href = \'casesListExtJs\'; }';
|
||||
/*----------------------------------********---------------------------------*/
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
@@ -8,12 +8,11 @@ if ($RBAC->userCanAccess("PM_SETUP") != 1 || $RBAC->userCanAccess("PM_SETUP_ADVA
|
||||
|
||||
$availableFields = array();
|
||||
|
||||
$oHeadPublisher = &headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
|
||||
$oHeadPublisher->addExtJsScript( 'cases/casesListSetup', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/casesListSetup' ); //adding a html file .html.
|
||||
$oHeadPublisher->addExtJsScript('cases/casesListSetup', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesListSetup'); //adding a html file .html.
|
||||
$oHeadPublisher->assignNumber("pageSize", 20); //sending the page size
|
||||
$oHeadPublisher->assignNumber("availableFields", G::json_encode($availableFields));
|
||||
|
||||
G::RenderPage("publish", "extJs");
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
$response = new stdClass();
|
||||
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||
@@ -146,8 +147,10 @@ if ($actionAjax == "verifySession") {
|
||||
print G::json_encode($response);
|
||||
die();
|
||||
} else {
|
||||
$response = new stdclass();
|
||||
/** Action: Reassign from casesList */
|
||||
GLOBAL $RBAC;
|
||||
$response = new stdclass();
|
||||
|
||||
//Check if the user is a supervisor to this Process
|
||||
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) {
|
||||
$response->reassigncase = true;
|
||||
@@ -160,7 +163,6 @@ if ($actionAjax == "verifySession") {
|
||||
$listProcess = $processUser->getProUidSupervisor($_SESSION['USER_LOGGED']);
|
||||
$response->processeslist = G::json_encode($listProcess);
|
||||
}
|
||||
|
||||
print G::json_encode($response);
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
$action = isset( $_GET['action'] ) ? G::sanitizeInput($_GET['action']) : 'default';
|
||||
$action = isset($_GET['action']) ? G::sanitizeInput($_GET['action']) : 'default';
|
||||
|
||||
$userId = isset( $_SESSION['USER_LOGGED'] ) ? $_SESSION['USER_LOGGED'] : '00000000000000000000000000000000';
|
||||
$userId = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '00000000000000000000000000000000';
|
||||
switch ($action) {
|
||||
case 'getAllCounters':
|
||||
getAllCounters();
|
||||
@@ -17,22 +17,22 @@ switch ($action) {
|
||||
break;
|
||||
}
|
||||
|
||||
function getLoadTreeMenuData ()
|
||||
function getLoadTreeMenuData()
|
||||
{
|
||||
header( "content-type: text/xml" );
|
||||
header("content-type: text/xml");
|
||||
|
||||
global $G_TMP_MENU;
|
||||
$oMenu = new Menu();
|
||||
$oMenu->load( 'cases' );
|
||||
$oMenu->load('cases');
|
||||
|
||||
$oCases = new Cases();
|
||||
$aTypes = Array ('to_do','draft','cancelled','sent','paused','completed','selfservice');
|
||||
$aTypes = array('to_do','draft','cancelled','sent','paused','completed','selfservice');
|
||||
//'to_revise',
|
||||
//'to_reassign'
|
||||
$aTypesID = Array ('CASES_INBOX' => 'to_do','CASES_DRAFT' => 'draft','CASES_CANCELLED' => 'cancelled','CASES_SENT' => 'sent','CASES_PAUSED' => 'paused','CASES_COMPLETED' => 'completed','CASES_SELFSERVICE' => 'selfservice');
|
||||
$aTypesID = array('CASES_INBOX' => 'to_do','CASES_DRAFT' => 'draft','CASES_CANCELLED' => 'cancelled','CASES_SENT' => 'sent','CASES_PAUSED' => 'paused','CASES_COMPLETED' => 'completed','CASES_SELFSERVICE' => 'selfservice');
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('7TTeDBQeWRoZTZKYjh4eFpYUlRDUUEyVERPU3FxellWank=')) {
|
||||
$aTypesID['CONSOLIDATED_CASES'] = 'batch_routing';
|
||||
$aTypes[] = 'batch_routing';
|
||||
@@ -41,10 +41,10 @@ function getLoadTreeMenuData ()
|
||||
|
||||
//'CASES_TO_REVISE'=>'to_revise',
|
||||
//'CASES_TO_REASSIGN'=>'to_reassign'
|
||||
$list = array ();
|
||||
$list = array();
|
||||
$list['count'] = ' ';
|
||||
|
||||
$empty = array ();
|
||||
$empty = array();
|
||||
foreach ($aTypes as $key => $val) {
|
||||
$empty[$val] = $list;
|
||||
}
|
||||
@@ -53,7 +53,7 @@ function getLoadTreeMenuData ()
|
||||
$processNameMaxSize = 20;
|
||||
|
||||
//now drawing the treeview using the menu options from menu/cases.php
|
||||
$menuCases = array ();
|
||||
$menuCases = array();
|
||||
for ($i = 0; $i < count($oMenu->Options); $i++) {
|
||||
if ($oMenu->Types[$i] == 'blockHeader') {
|
||||
$CurrentBlockID = $oMenu->Id[$i];
|
||||
@@ -72,7 +72,7 @@ function getLoadTreeMenuData ()
|
||||
$menuCases[$CurrentBlockID]['blockType'] = $oMenu->Types[$i];
|
||||
$menuCases[$CurrentBlockID]['link'] = $oMenu->Options[$i];
|
||||
} elseif ($oMenu->Types[$i] == 'rootNode') {
|
||||
$menuCases[$CurrentBlockID]['blockItems'][$oMenu->Id[$i]] = array (
|
||||
$menuCases[$CurrentBlockID]['blockItems'][$oMenu->Id[$i]] = array(
|
||||
'label' => $oMenu->Labels[$i],
|
||||
'link' => $oMenu->Options[$i],
|
||||
'icon' => (isset($oMenu->Icons[$i]) && $oMenu->Icons[$i] != '') ? $oMenu->Icons[$i] : 'kcmdf.png'
|
||||
@@ -85,13 +85,13 @@ function getLoadTreeMenuData ()
|
||||
|
||||
$i = $index;
|
||||
} else {
|
||||
$menuCases[$CurrentBlockID]['blockItems'][$oMenu->Id[$i]] = array (
|
||||
$menuCases[$CurrentBlockID]['blockItems'][$oMenu->Id[$i]] = array(
|
||||
'label' => $oMenu->Labels[$i],
|
||||
'link' => $oMenu->Options[$i],
|
||||
'icon' => (isset($oMenu->Icons[$i]) && $oMenu->Icons[$i] != '') ? $oMenu->Icons[$i] : 'kcmdf.png'
|
||||
);
|
||||
|
||||
if (isset( $aTypesID[$oMenu->Id[$i]] )) {
|
||||
if (isset($aTypesID[$oMenu->Id[$i]])) {
|
||||
$menuCases[$CurrentBlockID]['blockItems'][$oMenu->Id[$i]]['cases_count'] = $aCount[$aTypesID[$oMenu->Id[$i]]]['count'];
|
||||
}
|
||||
}
|
||||
@@ -114,7 +114,7 @@ function getLoadTreeMenuData ()
|
||||
}
|
||||
}
|
||||
|
||||
//This function generates an xml, so it prevents the output of a badly formed xml
|
||||
//This function generates an xml, so it prevents the output of a badly formed xml
|
||||
//by cleaning any content prior to this function with ob_clean
|
||||
ob_clean();
|
||||
echo $xml->asXML();
|
||||
@@ -135,8 +135,7 @@ function getLoadTreeMenuData ()
|
||||
}
|
||||
|
||||
// adding "menu_block" childs nodes
|
||||
foreach ($menuBlock['blockItems'] as $id => $menu)
|
||||
{
|
||||
foreach ($menuBlock['blockItems'] as $id => $menu) {
|
||||
if (! empty($menu['childs'])) {
|
||||
$rootNode = $menuBlockNode->addChild('menu_block');
|
||||
$rootNode->addAttribute('id', $id);
|
||||
@@ -178,7 +177,7 @@ function getLoadTreeMenuData ()
|
||||
}
|
||||
}
|
||||
|
||||
//This function generates an xml, so it prevents the output of a badly formed xml
|
||||
//This function generates an xml, so it prevents the output of a badly formed xml
|
||||
//by cleaning any content prior to this function with ob_clean
|
||||
ob_clean();
|
||||
echo $xml->asXML();
|
||||
@@ -199,11 +198,11 @@ function getAllCountersEnterprise()
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
function getAllCounters ()
|
||||
function getAllCounters()
|
||||
{
|
||||
$userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
|
||||
$userUid = (isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
|
||||
|
||||
$aTypes = Array ();
|
||||
$aTypes = array();
|
||||
$aTypes['to_do'] = 'CASES_INBOX';
|
||||
$aTypes['draft'] = 'CASES_DRAFT';
|
||||
$aTypes['cancelled'] = 'CASES_CANCELLED';
|
||||
@@ -217,7 +216,7 @@ function getAllCounters ()
|
||||
$case = new \ProcessMaker\BusinessModel\Cases();
|
||||
$aCount = $case->getListCounters($userUid, array_keys($aTypes));
|
||||
|
||||
$response = Array ();
|
||||
$response = array();
|
||||
$i = 0;
|
||||
foreach ($aCount as $type => $count) {
|
||||
$response[$i] = new stdclass();
|
||||
@@ -225,7 +224,7 @@ function getAllCounters ()
|
||||
$response[$i]->count = $count;
|
||||
$i ++;
|
||||
}
|
||||
echo G::json_encode( $response );
|
||||
echo G::json_encode($response);
|
||||
}
|
||||
|
||||
function getChilds($menu, $index)
|
||||
@@ -234,7 +233,6 @@ function getChilds($menu, $index)
|
||||
|
||||
for ($i = $index; $i < count($menu->Options); $i++) {
|
||||
if ($menu->Types[$i] == 'childNode') {
|
||||
|
||||
$childs[$menu->Id[$i]] = array(
|
||||
'label' => $menu->Labels[$i],
|
||||
'link' => $menu->Options[$i],
|
||||
@@ -248,4 +246,3 @@ function getChilds($menu, $index)
|
||||
|
||||
return array($childs, --$i);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,44 +1,43 @@
|
||||
<?php
|
||||
unset( $_SESSION['__currentTabDashboard'] );
|
||||
if (isset( $_GET['action'] )) {
|
||||
unset($_SESSION['__currentTabDashboard']);
|
||||
if (isset($_GET['action'])) {
|
||||
$_SESSION['__currentTabDashboard'] = $_GET['action'];
|
||||
}
|
||||
$page = "";
|
||||
if (isset( $_GET['action'] )) {
|
||||
if (isset($_GET['action'])) {
|
||||
$page = $_GET['action'];
|
||||
}
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
global $RBAC;
|
||||
switch ($page) {
|
||||
case "startCase":
|
||||
$oHeadPublisher->addExtJsScript( 'cases/casesStartCase', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/casesStartCase' ); //adding a html file .html.
|
||||
$oHeadPublisher->addExtJsScript('cases/casesStartCase', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesStartCase'); //adding a html file .html.
|
||||
$c = new Configurations();
|
||||
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
||||
$oHeadPublisher->assign('FORMATS', $c->getFormats());
|
||||
$oHeadPublisher->assign('isIE', Bootstrap::isIE());
|
||||
break;
|
||||
case "documents":
|
||||
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration( 'documentsModule', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
$configEnv = $c->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
|
||||
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
|
||||
$oHeadPublisher->assign( 'CONFIG', $Config );
|
||||
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
||||
$configPage = $c->getConfiguration('documentsModule', 'pageSize', '', $_SESSION['USER_LOGGED']);
|
||||
$configEnv = $c->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
$oHeadPublisher->assign('CONFIG', $Config);
|
||||
$oHeadPublisher->assign('FORMATS', $c->getFormats());
|
||||
|
||||
$oHeadPublisher->assign( 'permitodelete', $RBAC->userCanAccess( 'PM_FOLDER_DELETE' ) );
|
||||
$oHeadPublisher->assign( 'permitoaddfile', $RBAC->userCanAccess( 'PM_FOLDERS_ADD_FILE' ) );
|
||||
$oHeadPublisher->assign( 'permitoaddfolder', $RBAC->userCanAccess( 'PM_FOLDERS_ADD_FOLDER' ) );
|
||||
$oHeadPublisher->assign('permitodelete', $RBAC->userCanAccess('PM_FOLDER_DELETE'));
|
||||
$oHeadPublisher->assign('permitoaddfile', $RBAC->userCanAccess('PM_FOLDERS_ADD_FILE'));
|
||||
$oHeadPublisher->assign('permitoaddfolder', $RBAC->userCanAccess('PM_FOLDERS_ADD_FOLDER'));
|
||||
|
||||
$oHeadPublisher->addExtJsScript( 'cases/casesDocuments', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/casesDocuments' ); //adding a html file .html.
|
||||
$oHeadPublisher->addExtJsScript('cases/casesDocuments', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesDocuments'); //adding a html file .html.
|
||||
break;
|
||||
default:
|
||||
$oHeadPublisher->addExtJsScript( 'cases/casesStartPage', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/casesStartPage' ); //adding a html file .html.
|
||||
$oHeadPublisher->addExtJsScript('cases/casesStartPage', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesStartPage'); //adding a html file .html.
|
||||
break;
|
||||
|
||||
}
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
<?php
|
||||
// $oHeadPublisher =& headPublisher::getSingleton();
|
||||
// $TRANSLATIONS = array_merge($TRANSLATIONS, $TRANSLATIONS2);
|
||||
|
||||
$delIndex = $_GET['DEL_INDEX'];
|
||||
$appUid = $_GET['APP_UID'];
|
||||
// $oHeadPublisher->assign( 'TRANSLATIONS', $TRANSLATIONS); //translations
|
||||
$casesPanelUrl = 'casesToReviseTreeContent?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex;
|
||||
$oHeadPublisher->assign( 'casesPanelUrl', $casesPanelUrl ); //translations
|
||||
$oHeadPublisher->assign( 'treeTitle', G::loadtranslation( 'ID_STEP_LIST' ) ); //translations
|
||||
$oHeadPublisher->addExtJsScript( 'cases/casesToRevisePanel', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/casesToRevisePanel' ); //adding a html file .html.
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
$oHeadPublisher->assign('casesPanelUrl', $casesPanelUrl); //translations
|
||||
$oHeadPublisher->assign('treeTitle', G::loadtranslation('ID_STEP_LIST')); //translations
|
||||
$oHeadPublisher->addExtJsScript('cases/casesToRevisePanel', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesToRevisePanel'); //adding a html file .html.
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,25 +26,25 @@ if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
$responseObject->error = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||
$responseObject->success = true;
|
||||
$responseObject->lostSession = true;
|
||||
print G::json_encode( $responseObject );
|
||||
print G::json_encode($responseObject);
|
||||
die();
|
||||
}
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
switch ($RBAC->userCanAccess('PM_CASES')) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
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();
|
||||
break;
|
||||
}
|
||||
|
||||
if (isset( $_POST['form']['BTN_CANCEL'] )) {
|
||||
header( "Location: ../cases/main" );
|
||||
if (isset($_POST['form']['BTN_CANCEL'])) {
|
||||
header("Location: ../cases/main");
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -55,16 +55,16 @@ $sAppUid = $_SESSION['APPLICATION'];
|
||||
$iDelIndex = $_SESSION['INDEX'];
|
||||
|
||||
$oAppDelegation = new AppDelegation();
|
||||
$aDelegation = $oAppDelegation->load( $sAppUid, $iDelIndex );
|
||||
$aDelegation = $oAppDelegation->load($sAppUid, $iDelIndex);
|
||||
|
||||
//if there are no user in the delegation row, this case is still in selfservice
|
||||
if ($aDelegation['USR_UID'] == "") {
|
||||
$oCase->setCatchUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'] );
|
||||
$oCase->setCatchUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED']);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$licensedFeatures = &PMLicensedFeatures::getSingleton();
|
||||
$licensedFeatures = PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
|
||||
$pmGoogle = new PmGoogleApi();
|
||||
if($pmGoogle->getServiceGmailStatus()) {
|
||||
if ($pmGoogle->getServiceGmailStatus()) {
|
||||
$labGmail = new labelsGmail();
|
||||
$labGmail->addRelabelingToQueue($sAppUid, $iDelIndex, -1, true);
|
||||
}
|
||||
@@ -81,20 +81,20 @@ if ($aDelegation['USR_UID'] == "") {
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
//changing email labels if the claim comes from gmail
|
||||
if(array_key_exists('gmail',$_SESSION) && $_SESSION['gmail'] == 1){
|
||||
die( '<script type="text/javascript">
|
||||
if (array_key_exists('gmail', $_SESSION) && $_SESSION['gmail'] == 1) {
|
||||
die('<script type="text/javascript">
|
||||
parent.document.getElementById("iframePM").setAttribute("src", "'.$_SESSION["server"].'cases/cases_Open?APP_UID=' . $_SESSION["APPLICATION"] . '&DEL_INDEX=' . $_SESSION["INDEX"] . '&action=unassigned");
|
||||
</script>' );
|
||||
</script>');
|
||||
}
|
||||
} else {
|
||||
G::SendMessageText( G::LoadTranslation( 'ID_CASE_ALREADY_DERIVATED' ), 'error' );
|
||||
G::SendMessageText(G::LoadTranslation('ID_CASE_ALREADY_DERIVATED'), 'error');
|
||||
}
|
||||
|
||||
$validation = (SYS_SKIN != 'uxs') ? 'true' : 'false';
|
||||
|
||||
unset($_SESSION['TASK']);
|
||||
|
||||
die( '<script type="text/javascript">
|
||||
die('<script type="text/javascript">
|
||||
if (' . $validation . ') {
|
||||
if (window.parent.frames.length != 0) {
|
||||
parent.location = "open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=unassigned";
|
||||
@@ -104,5 +104,4 @@ die( '<script type="text/javascript">
|
||||
} else {
|
||||
window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=unassigned";
|
||||
}
|
||||
</script>' );
|
||||
|
||||
</script>');
|
||||
|
||||
@@ -22,51 +22,51 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
switch ($RBAC->userCanAccess('PM_CASES')) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
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();
|
||||
break;
|
||||
}
|
||||
|
||||
$oCase = new Cases();
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
|
||||
$Fields = $oCase->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX']);
|
||||
|
||||
/* Render page */
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
|
||||
$objProc = new Process();
|
||||
$aProc = $objProc->load( $Fields['PRO_UID'] );
|
||||
$aProc = $objProc->load($Fields['PRO_UID']);
|
||||
$Fields['PRO_TITLE'] = $aProc['PRO_TITLE'];
|
||||
|
||||
$objTask = new Task();
|
||||
$aTask = $objTask->load( $Fields['TAS_UID'] );
|
||||
$aTask = $objTask->load($Fields['TAS_UID']);
|
||||
$Fields['TAS_TITLE'] = $aTask['TAS_TITLE'];
|
||||
|
||||
$Fields['STATUS'] .= ' ( ' . G::LoadTranslation( 'ID_UNASSIGNED' ) . ' )';
|
||||
$Fields['STATUS'] .= ' ( ' . G::LoadTranslation('ID_UNASSIGNED') . ' )';
|
||||
|
||||
//now getting information about the PREVIOUS task. If is the first task then no preious, use 1
|
||||
$oAppDel = new AppDelegation();
|
||||
$oAppDel->Load( $Fields['APP_UID'], ($Fields['DEL_PREVIOUS'] == 0 ? $Fields['DEL_PREVIOUS'] = 1 : $Fields['DEL_PREVIOUS']) );
|
||||
$oAppDel->Load($Fields['APP_UID'], ($Fields['DEL_PREVIOUS'] == 0 ? $Fields['DEL_PREVIOUS'] = 1 : $Fields['DEL_PREVIOUS']));
|
||||
|
||||
$aAppDel = $oAppDel->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$aAppDel = $oAppDel->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
try {
|
||||
$oCurUser = new Users();
|
||||
$oCurUser->load( $aAppDel['USR_UID'] );
|
||||
$oCurUser->load($aAppDel['USR_UID']);
|
||||
$Fields['PREVIOUS_USER'] = $oCurUser->getUsrFirstname() . ' ' . $oCurUser->getUsrLastname();
|
||||
} catch (Exception $oError) {
|
||||
$Fields['PREVIOUS_USER'] = G::LoadTranslation( 'ID_NO_PREVIOUS_USR_UID' );
|
||||
$Fields['PREVIOUS_USER'] = G::LoadTranslation('ID_NO_PREVIOUS_USR_UID');
|
||||
}
|
||||
|
||||
$objTask = new Task();
|
||||
$aTask = $objTask->load( $aAppDel['TAS_UID'] );
|
||||
$aTask = $objTask->load($aAppDel['TAS_UID']);
|
||||
$Fields['PREVIOUS_TASK'] = $aTask['TAS_TITLE'];
|
||||
|
||||
//To enable information (dynaforms, steps) before claim a case
|
||||
@@ -75,14 +75,14 @@ $G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'caseOptions';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = '_';
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptCode( "
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptCode("
|
||||
if (typeof parent != 'undefined') {
|
||||
if (parent.showCaseNavigatorPanel) {
|
||||
parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}');
|
||||
}
|
||||
}" );
|
||||
$oHeadPublisher->addScriptCode( '
|
||||
}");
|
||||
$oHeadPublisher->addScriptCode('
|
||||
var Cse = {};
|
||||
Cse.panels = {};
|
||||
var leimnud = new maborak();
|
||||
@@ -92,13 +92,12 @@ $oHeadPublisher->addScriptCode( '
|
||||
leimnud.Package.Load("cases_Step",{Type:"file",Absolute:true,Path:"/jscore/cases/core/cases_Step.js"});
|
||||
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
|
||||
leimnud.exec(leimnud.fix.memoryLeak);
|
||||
' );
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile( '/jscore/cases/core/cases_Step.js' );
|
||||
');
|
||||
$oHeadPublisher = headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile('/jscore/cases/core/cases_Step.js');
|
||||
|
||||
$Fields['isIE'] = Bootstrap::isIE();
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_CatchSelfService.xml', '', $Fields, 'cases_CatchExecute' );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_CatchSelfService.xml', '', $Fields, 'cases_CatchExecute');
|
||||
G::RenderPage('publish', 'blank');
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user