CODE STYLE, workflow/engine/controllers/
FILES: caseSchedulerProxy.php dashboard.php home.php installer.php main.php
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class caseSchedulerProxy extends HttpProxyController
|
class caseSchedulerProxy extends HttpProxyController
|
||||||
{
|
{
|
||||||
|
|
||||||
function load($params){
|
function load ($params)
|
||||||
|
{
|
||||||
require_once "classes/model/Event.php";
|
require_once "classes/model/Event.php";
|
||||||
$PRO_UID = $params->PRO_UID;
|
$PRO_UID = $params->PRO_UID;
|
||||||
$EVN_UID = $params->EVN_UID;
|
$EVN_UID = $params->EVN_UID;
|
||||||
@@ -13,10 +15,9 @@ class caseSchedulerProxy extends HttpProxyController
|
|||||||
|
|
||||||
if ($sch_uid != '') {
|
if ($sch_uid != '') {
|
||||||
G::LoadClass( 'processMap' );
|
G::LoadClass( 'processMap' );
|
||||||
$oProcessMap = new processMap(new DBConnection);
|
$oProcessMap = new processMap( new DBConnection() );
|
||||||
$rows = $oProcessMap->caseNewSchedulerList( $sch_uid );
|
$rows = $oProcessMap->caseNewSchedulerList( $sch_uid );
|
||||||
if($rows['SCH_OPTION'] == '3')
|
if ($rows['SCH_OPTION'] == '3') {
|
||||||
{
|
|
||||||
$sch_start_day = explode( '|', $rows['SCH_START_DAY'] );
|
$sch_start_day = explode( '|', $rows['SCH_START_DAY'] );
|
||||||
$count = count( $sch_start_day );
|
$count = count( $sch_start_day );
|
||||||
switch ($count) {
|
switch ($count) {
|
||||||
@@ -34,13 +35,11 @@ class caseSchedulerProxy extends HttpProxyController
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($rows['SCH_START_DATE'] != '')
|
if ($rows['SCH_START_DATE'] != '') {
|
||||||
{
|
|
||||||
$sch_str_dt = explode( ' ', $rows['SCH_START_DATE'] );
|
$sch_str_dt = explode( ' ', $rows['SCH_START_DATE'] );
|
||||||
$rows['SCH_START_DATE'] = $sch_str_dt[0];
|
$rows['SCH_START_DATE'] = $sch_str_dt[0];
|
||||||
}
|
}
|
||||||
if($rows['SCH_END_DATE'] != '')
|
if ($rows['SCH_END_DATE'] != '') {
|
||||||
{
|
|
||||||
$sch_str_dt = explode( ' ', $rows['SCH_END_DATE'] );
|
$sch_str_dt = explode( ' ', $rows['SCH_END_DATE'] );
|
||||||
$rows['SCH_END_DATE'] = $sch_str_dt[0];
|
$rows['SCH_END_DATE'] = $sch_str_dt[0];
|
||||||
}
|
}
|
||||||
@@ -51,7 +50,8 @@ class caseSchedulerProxy extends HttpProxyController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete($params){
|
function delete ($params)
|
||||||
|
{
|
||||||
require_once 'classes/model/CaseScheduler.php';
|
require_once 'classes/model/CaseScheduler.php';
|
||||||
require_once 'classes/model/Event.php';
|
require_once 'classes/model/Event.php';
|
||||||
$SCH_UID = $params->SCH_UID;
|
$SCH_UID = $params->SCH_UID;
|
||||||
@@ -68,7 +68,8 @@ class caseSchedulerProxy extends HttpProxyController
|
|||||||
$this->msg = G::LoadTranslation( 'ID_SCHEDULER_SUCCESS_DELETE' );
|
$this->msg = G::LoadTranslation( 'ID_SCHEDULER_SUCCESS_DELETE' );
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeStatus($params){
|
function changeStatus ($params)
|
||||||
|
{
|
||||||
require_once 'classes/model/CaseScheduler.php';
|
require_once 'classes/model/CaseScheduler.php';
|
||||||
$SCH_UID = $params->SCH_UID;
|
$SCH_UID = $params->SCH_UID;
|
||||||
$oCaseScheduler = new CaseScheduler();
|
$oCaseScheduler = new CaseScheduler();
|
||||||
@@ -79,7 +80,8 @@ class caseSchedulerProxy extends HttpProxyController
|
|||||||
$this->msg = G::LoadTranslation( 'ID_SCHEDULER_SUCCESS_CHANGE_STATUS' );
|
$this->msg = G::LoadTranslation( 'ID_SCHEDULER_SUCCESS_CHANGE_STATUS' );
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkCredentials($params){
|
function checkCredentials ($params)
|
||||||
|
{
|
||||||
require_once 'classes/model/Event.php';
|
require_once 'classes/model/Event.php';
|
||||||
require_once 'classes/model/Users.php';
|
require_once 'classes/model/Users.php';
|
||||||
require_once 'classes/model/TaskUser.php';
|
require_once 'classes/model/TaskUser.php';
|
||||||
@@ -89,19 +91,21 @@ function checkCredentials($params){
|
|||||||
$sWS_USER = trim( $params->WS_USER );
|
$sWS_USER = trim( $params->WS_USER );
|
||||||
$sWS_PASS = trim( $params->WS_PASS );
|
$sWS_PASS = trim( $params->WS_PASS );
|
||||||
|
|
||||||
if (G::is_https ())
|
if (G::is_https()) {
|
||||||
$http = 'https://';
|
$http = 'https://';
|
||||||
else
|
} else {
|
||||||
$http = 'http://';
|
$http = 'http://';
|
||||||
|
}
|
||||||
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
|
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
|
||||||
@$client = new SoapClient( $endpoint );
|
@$client = new SoapClient( $endpoint );
|
||||||
|
|
||||||
$user = $sWS_USER;
|
$user = $sWS_USER;
|
||||||
$pass = $sWS_PASS;
|
$pass = $sWS_PASS;
|
||||||
|
|
||||||
$parameters = array ('userid' => $user, 'password' => $pass );
|
$parameters = array ('userid' => $user,'password' => $pass
|
||||||
$result = $client->__SoapCall ( 'login', array ($parameters) );
|
);
|
||||||
|
$result = $client->__SoapCall( 'login', array ($parameters
|
||||||
|
) );
|
||||||
|
|
||||||
$fields['status_code'] = $result->status_code;
|
$fields['status_code'] = $result->status_code;
|
||||||
$fields['message'] = 'ProcessMaker WebService version: ' . $result->version . "\n" . $result->message;
|
$fields['message'] = 'ProcessMaker WebService version: ' . $result->version . "\n" . $result->message;
|
||||||
@@ -162,7 +166,8 @@ function checkCredentials($params){
|
|||||||
$this->msg = $message;
|
$this->msg = $message;
|
||||||
}
|
}
|
||||||
|
|
||||||
function save($params){
|
function save ($params)
|
||||||
|
{
|
||||||
require_once 'classes/model/CaseScheduler.php';
|
require_once 'classes/model/CaseScheduler.php';
|
||||||
$oCaseScheduler = new CaseScheduler();
|
$oCaseScheduler = new CaseScheduler();
|
||||||
|
|
||||||
@@ -174,6 +179,7 @@ function checkCredentials($params){
|
|||||||
$aData['PRO_UID'] = $params->pro_uid; //$_POST['form']['PRO_UID'];
|
$aData['PRO_UID'] = $params->pro_uid; //$_POST['form']['PRO_UID'];
|
||||||
$aData['TAS_UID'] = $params->tas_uid; //$_POST['form']['TAS_UID'];
|
$aData['TAS_UID'] = $params->tas_uid; //$_POST['form']['TAS_UID'];
|
||||||
|
|
||||||
|
|
||||||
$aData['SCH_STATE'] = 'ACTIVE';
|
$aData['SCH_STATE'] = 'ACTIVE';
|
||||||
$aData['SCH_LAST_STATE'] = 'CREATED'; // 'ACTIVE';
|
$aData['SCH_LAST_STATE'] = 'CREATED'; // 'ACTIVE';
|
||||||
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
||||||
@@ -181,10 +187,18 @@ function checkCredentials($params){
|
|||||||
$sOption = $params->fType; //$_POST['form']['SCH_OPTION'];
|
$sOption = $params->fType; //$_POST['form']['SCH_OPTION'];
|
||||||
|
|
||||||
switch ($sOption) {
|
switch ($sOption) {
|
||||||
case 'Daily' : $sOption = '1'; break;
|
case 'Daily':
|
||||||
case 'Weekly' : $sOption = '2'; break;
|
$sOption = '1';
|
||||||
case 'Monthly' : $sOption = '3'; break;
|
break;
|
||||||
default : $sOption = '4'; break;
|
case 'Weekly':
|
||||||
|
$sOption = '2';
|
||||||
|
break;
|
||||||
|
case 'Monthly':
|
||||||
|
$sOption = '3';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$sOption = '4';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$aData['SCH_OPTION'] = $sOption;
|
$aData['SCH_OPTION'] = $sOption;
|
||||||
@@ -195,17 +209,21 @@ function checkCredentials($params){
|
|||||||
// $sDateTmp = date('Y-m-d');
|
// $sDateTmp = date('Y-m-d');
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
$sDateTmp = $params->SCH_START_DATE;
|
$sDateTmp = $params->SCH_START_DATE;
|
||||||
$sTimeTmp = $params->SCH_START_TIME; //$_POST['form']['SCH_START_TIME'];
|
$sTimeTmp = $params->SCH_START_TIME; //$_POST['form']['SCH_START_TIME'];
|
||||||
|
|
||||||
|
|
||||||
$aData['SCH_START_TIME'] = date( 'Y-m-d', strtotime( $sDateTmp ) ) . ' ' . date( 'H:i:s', strtotime( $sTimeTmp ) );
|
$aData['SCH_START_TIME'] = date( 'Y-m-d', strtotime( $sDateTmp ) ) . ' ' . date( 'H:i:s', strtotime( $sTimeTmp ) );
|
||||||
$aData['SCH_START_DATE'] = date( 'Y-m-d', strtotime( $sDateTmp ) ) . ' ' . date( 'H:i:s', strtotime( $sTimeTmp ) );
|
$aData['SCH_START_DATE'] = date( 'Y-m-d', strtotime( $sDateTmp ) ) . ' ' . date( 'H:i:s', strtotime( $sTimeTmp ) );
|
||||||
|
|
||||||
//g::pr($aData);
|
//g::pr($aData);
|
||||||
|
|
||||||
|
|
||||||
$nActualTime = $sTimeTmp; //date("Y-m-d H:i:s"); // time();
|
$nActualTime = $sTimeTmp; //date("Y-m-d H:i:s"); // time();
|
||||||
//$nActualDate = date("Y-m-d H:i:s");
|
//$nActualDate = date("Y-m-d H:i:s");
|
||||||
|
|
||||||
|
|
||||||
$sValue = '';
|
$sValue = '';
|
||||||
$sDaysPerformTask = '';
|
$sDaysPerformTask = '';
|
||||||
$sWeeks = '';
|
$sWeeks = '';
|
||||||
@@ -214,12 +232,12 @@ function checkCredentials($params){
|
|||||||
$sStartDay = '';
|
$sStartDay = '';
|
||||||
$nSW = 0;
|
$nSW = 0;
|
||||||
|
|
||||||
|
|
||||||
switch ($sOption) {
|
switch ($sOption) {
|
||||||
case '1': // Option 1
|
case '1': // Option 1
|
||||||
$sValue = isset( $params->SCH_DAYS_PERFORM_TASK ) ? $params->SCH_DAYS_PERFORM_TASK : '1'; //$_POST['form']['SCH_DAYS_PERFORM_TASK'];
|
$sValue = isset( $params->SCH_DAYS_PERFORM_TASK ) ? $params->SCH_DAYS_PERFORM_TASK : '1'; //$_POST['form']['SCH_DAYS_PERFORM_TASK'];
|
||||||
switch ($sValue) {
|
switch ($sValue) {
|
||||||
case '1' : $aData['SCH_DAYS_PERFORM_TASK'] = $sValue . '|1';
|
case '1':
|
||||||
|
$aData['SCH_DAYS_PERFORM_TASK'] = $sValue . '|1';
|
||||||
break;
|
break;
|
||||||
case '2':
|
case '2':
|
||||||
$aData['SCH_OPTION'] = '2';
|
$aData['SCH_OPTION'] = '2';
|
||||||
@@ -232,35 +250,48 @@ function checkCredentials($params){
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '2': // If the option is zero, set by default 1
|
case '2': // If the option is zero, set by default 1
|
||||||
$sWeeks = '';
|
$sWeeks = '';
|
||||||
if (isset( $params->W1 )) {
|
if (isset( $params->W1 )) {
|
||||||
if ($sWeeks != '') $sWeeks .= '|';
|
if ($sWeeks != '') {
|
||||||
|
$sWeeks .= '|';
|
||||||
|
}
|
||||||
$sWeeks .= '1';
|
$sWeeks .= '1';
|
||||||
}
|
}
|
||||||
if (isset( $params->W2 )) {
|
if (isset( $params->W2 )) {
|
||||||
if ($sWeeks != '') $sWeeks .= '|';
|
if ($sWeeks != '') {
|
||||||
|
$sWeeks .= '|';
|
||||||
|
}
|
||||||
$sWeeks .= '2';
|
$sWeeks .= '2';
|
||||||
}
|
}
|
||||||
if (isset( $params->W3 )) {
|
if (isset( $params->W3 )) {
|
||||||
if ($sWeeks != '') $sWeeks .= '|';
|
if ($sWeeks != '') {
|
||||||
|
$sWeeks .= '|';
|
||||||
|
}
|
||||||
$sWeeks .= '3';
|
$sWeeks .= '3';
|
||||||
}
|
}
|
||||||
if (isset( $params->W4 )) {
|
if (isset( $params->W4 )) {
|
||||||
if ($sWeeks != '') $sWeeks .= '|';
|
if ($sWeeks != '') {
|
||||||
|
$sWeeks .= '|';
|
||||||
|
}
|
||||||
$sWeeks .= '4';
|
$sWeeks .= '4';
|
||||||
}
|
}
|
||||||
if (isset( $params->W5 )) {
|
if (isset( $params->W5 )) {
|
||||||
if ($sWeeks != '') $sWeeks .= '|';
|
if ($sWeeks != '') {
|
||||||
|
$sWeeks .= '|';
|
||||||
|
}
|
||||||
$sWeeks .= '5';
|
$sWeeks .= '5';
|
||||||
}
|
}
|
||||||
if (isset( $params->W6 )) {
|
if (isset( $params->W6 )) {
|
||||||
if ($sWeeks != '') $sWeeks .= '|';
|
if ($sWeeks != '') {
|
||||||
|
$sWeeks .= '|';
|
||||||
|
}
|
||||||
$sWeeks .= '6';
|
$sWeeks .= '6';
|
||||||
}
|
}
|
||||||
if (isset( $params->W7 )) {
|
if (isset( $params->W7 )) {
|
||||||
if ($sWeeks != '') $sWeeks .= '|';
|
if ($sWeeks != '') {
|
||||||
|
$sWeeks .= '|';
|
||||||
|
}
|
||||||
$sWeeks .= '7';
|
$sWeeks .= '7';
|
||||||
}
|
}
|
||||||
$sStartTime = $params->SCH_START_TIME;
|
$sStartTime = $params->SCH_START_TIME;
|
||||||
@@ -269,79 +300,131 @@ function checkCredentials($params){
|
|||||||
break;
|
break;
|
||||||
case '3':
|
case '3':
|
||||||
$nStartDay = $params->SCH_START_DAY;
|
$nStartDay = $params->SCH_START_DAY;
|
||||||
if ($nStartDay=='Day of Month') $nStartDay = 1;
|
if ($nStartDay == 'Day of Month') {
|
||||||
if ($nStartDay=='The Day') $nStartDay = 2;
|
$nStartDay = 1;
|
||||||
|
}
|
||||||
|
if ($nStartDay == 'The Day') {
|
||||||
|
$nStartDay = 2;
|
||||||
|
}
|
||||||
if ($nStartDay == 1) {
|
if ($nStartDay == 1) {
|
||||||
$aData['SCH_START_DAY'] = $nStartDay . '|' . $params->SCH_START_DAY_OPT_1;
|
$aData['SCH_START_DAY'] = $nStartDay . '|' . $params->SCH_START_DAY_OPT_1;
|
||||||
} else {
|
} else {
|
||||||
$opt2weeks = $params->SCH_START_DAY_OPT_2_WEEKS;
|
$opt2weeks = $params->SCH_START_DAY_OPT_2_WEEKS;
|
||||||
switch ($opt2weeks) {
|
switch ($opt2weeks) {
|
||||||
case 'First': $opt2weeks = 1; break;
|
case 'First':
|
||||||
case 'Second': $opt2weeks = 2; break;
|
$opt2weeks = 1;
|
||||||
case 'Third': $opt2weeks = 3; break;
|
break;
|
||||||
case 'Fourth': $opt2weeks = 4; break;
|
case 'Second':
|
||||||
case 'Last': $opt2weeks = 5; break;
|
$opt2weeks = 2;
|
||||||
|
break;
|
||||||
|
case 'Third':
|
||||||
|
$opt2weeks = 3;
|
||||||
|
break;
|
||||||
|
case 'Fourth':
|
||||||
|
$opt2weeks = 4;
|
||||||
|
break;
|
||||||
|
case 'Last':
|
||||||
|
$opt2weeks = 5;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
$opt2days = $params->SCH_START_DAY_OPT_2_DAYS_WEEK;
|
$opt2days = $params->SCH_START_DAY_OPT_2_DAYS_WEEK;
|
||||||
switch ($opt2days) {
|
switch ($opt2days) {
|
||||||
case 'Monday': $opt2days = 1; break;
|
case 'Monday':
|
||||||
case 'Tuesday': $opt2days = 2; break;
|
$opt2days = 1;
|
||||||
case 'Wednesday': $opt2days = 3; break;
|
break;
|
||||||
case 'Thursday': $opt2days = 4; break;
|
case 'Tuesday':
|
||||||
case 'Friday': $opt2days = 5; break;
|
$opt2days = 2;
|
||||||
case 'Saturday': $opt2days = 6; break;
|
break;
|
||||||
case 'Sunday': $opt2days = 7; break;
|
case 'Wednesday':
|
||||||
|
$opt2days = 3;
|
||||||
|
break;
|
||||||
|
case 'Thursday':
|
||||||
|
$opt2days = 4;
|
||||||
|
break;
|
||||||
|
case 'Friday':
|
||||||
|
$opt2days = 5;
|
||||||
|
break;
|
||||||
|
case 'Saturday':
|
||||||
|
$opt2days = 6;
|
||||||
|
break;
|
||||||
|
case 'Sunday':
|
||||||
|
$opt2days = 7;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
$aData['SCH_START_DAY'] = $nStartDay . '|' . $opt2weeks . '|' . $opt2days;
|
$aData['SCH_START_DAY'] = $nStartDay . '|' . $opt2weeks . '|' . $opt2days;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sMonths = '';
|
$sMonths = '';
|
||||||
if (isset( $params->M1 )) {
|
if (isset( $params->M1 )) {
|
||||||
if ($sMonths != '') $sMonths .= '|';
|
if ($sMonths != '') {
|
||||||
|
$sMonths .= '|';
|
||||||
|
}
|
||||||
$sMonths .= '1';
|
$sMonths .= '1';
|
||||||
}
|
}
|
||||||
if (isset( $params->M2 )) {
|
if (isset( $params->M2 )) {
|
||||||
if ($sMonths != '') $sMonths .= '|';
|
if ($sMonths != '') {
|
||||||
|
$sMonths .= '|';
|
||||||
|
}
|
||||||
$sMonths .= '2';
|
$sMonths .= '2';
|
||||||
}
|
}
|
||||||
if (isset( $params->M3 )) {
|
if (isset( $params->M3 )) {
|
||||||
if ($sMonths != '') $sMonths .= '|';
|
if ($sMonths != '') {
|
||||||
|
$sMonths .= '|';
|
||||||
|
}
|
||||||
$sMonths .= '3';
|
$sMonths .= '3';
|
||||||
}
|
}
|
||||||
if (isset( $params->M4 )) {
|
if (isset( $params->M4 )) {
|
||||||
if ($sMonths != '') $sMonths .= '|';
|
if ($sMonths != '') {
|
||||||
|
$sMonths .= '|';
|
||||||
|
}
|
||||||
$sMonths .= '4';
|
$sMonths .= '4';
|
||||||
}
|
}
|
||||||
if (isset( $params->M5 )) {
|
if (isset( $params->M5 )) {
|
||||||
if ($sMonths != '') $sMonths .= '|';
|
if ($sMonths != '') {
|
||||||
|
$sMonths .= '|';
|
||||||
|
}
|
||||||
$sMonths .= '5';
|
$sMonths .= '5';
|
||||||
}
|
}
|
||||||
if (isset( $params->M6 )) {
|
if (isset( $params->M6 )) {
|
||||||
if ($sMonths != '') $sMonths .= '|';
|
if ($sMonths != '') {
|
||||||
|
$sMonths .= '|';
|
||||||
|
}
|
||||||
$sMonths .= '6';
|
$sMonths .= '6';
|
||||||
}
|
}
|
||||||
if (isset( $params->M7 )) {
|
if (isset( $params->M7 )) {
|
||||||
if ($sMonths != '') $sMonths .= '|';
|
if ($sMonths != '') {
|
||||||
|
$sMonths .= '|';
|
||||||
|
}
|
||||||
$sMonths .= '7';
|
$sMonths .= '7';
|
||||||
}
|
}
|
||||||
if (isset( $params->M8 )) {
|
if (isset( $params->M8 )) {
|
||||||
if ($sMonths != '') $sMonths .= '|';
|
if ($sMonths != '') {
|
||||||
|
$sMonths .= '|';
|
||||||
|
}
|
||||||
$sMonths .= '8';
|
$sMonths .= '8';
|
||||||
}
|
}
|
||||||
if (isset( $params->M9 )) {
|
if (isset( $params->M9 )) {
|
||||||
if ($sMonths != '') $sMonths .= '|';
|
if ($sMonths != '') {
|
||||||
|
$sMonths .= '|';
|
||||||
|
}
|
||||||
$sMonths .= '9';
|
$sMonths .= '9';
|
||||||
}
|
}
|
||||||
if (isset( $params->M10 )) {
|
if (isset( $params->M10 )) {
|
||||||
if ($sMonths != '') $sMonths .= '|';
|
if ($sMonths != '') {
|
||||||
|
$sMonths .= '|';
|
||||||
|
}
|
||||||
$sMonths .= '10';
|
$sMonths .= '10';
|
||||||
}
|
}
|
||||||
if (isset( $params->M11 )) {
|
if (isset( $params->M11 )) {
|
||||||
if ($sMonths != '') $sMonths .= '|';
|
if ($sMonths != '') {
|
||||||
|
$sMonths .= '|';
|
||||||
|
}
|
||||||
$sMonths .= '11';
|
$sMonths .= '11';
|
||||||
}
|
}
|
||||||
if (isset( $params->M12 )) {
|
if (isset( $params->M12 )) {
|
||||||
if ($sMonths != '') $sMonths .= '|';
|
if ($sMonths != '') {
|
||||||
|
$sMonths .= '|';
|
||||||
|
}
|
||||||
$sMonths .= '12';
|
$sMonths .= '12';
|
||||||
}
|
}
|
||||||
// if(!empty($params->SCH_MONTHS)){
|
// if(!empty($params->SCH_MONTHS)){
|
||||||
@@ -367,7 +450,6 @@ function checkCredentials($params){
|
|||||||
$sValue = $nStartDay;
|
$sValue = $nStartDay;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (($sOption != '1') && ($sOption != '4')) {
|
if (($sOption != '1') && ($sOption != '4')) {
|
||||||
if ($sStartDay == '') {
|
if ($sStartDay == '') {
|
||||||
@@ -408,12 +490,11 @@ function checkCredentials($params){
|
|||||||
|
|
||||||
if (! empty( $params->SCH_REPEAT_TASK_CHK )) {
|
if (! empty( $params->SCH_REPEAT_TASK_CHK )) {
|
||||||
$nOptEvery = $params->SCH_REPEAT_EVERY_OPT;
|
$nOptEvery = $params->SCH_REPEAT_EVERY_OPT;
|
||||||
if($nOptEvery ==2)
|
if ($nOptEvery == 2) {
|
||||||
$aData['SCH_REPEAT_EVERY'] = $params->SCH_REPEAT_EVERY_OPT * 60;
|
$aData['SCH_REPEAT_EVERY'] = $params->SCH_REPEAT_EVERY_OPT * 60;
|
||||||
else
|
} else {
|
||||||
$aData['SCH_REPEAT_EVERY'] = $params->SCH_REPEAT_EVERY_OPT;
|
$aData['SCH_REPEAT_EVERY'] = $params->SCH_REPEAT_EVERY_OPT;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((isset( $_POST['form']['CASE_SH_PLUGIN_UID'] )) && ($_POST['form']['CASE_SH_PLUGIN_UID'] != "")) {
|
if ((isset( $_POST['form']['CASE_SH_PLUGIN_UID'] )) && ($_POST['form']['CASE_SH_PLUGIN_UID'] != "")) {
|
||||||
@@ -440,7 +521,6 @@ function checkCredentials($params){
|
|||||||
foreach ($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail) {
|
foreach ($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail) {
|
||||||
if (($caseSchedulerPluginDetail->sNamespace == $params[0]) && ($caseSchedulerPluginDetail->sActionId == $params[1])) {
|
if (($caseSchedulerPluginDetail->sNamespace == $params[0]) && ($caseSchedulerPluginDetail->sActionId == $params[1])) {
|
||||||
$caseSchedulerSelected = $caseSchedulerPluginDetail;
|
$caseSchedulerSelected = $caseSchedulerPluginDetail;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((isset( $caseSchedulerSelected )) && (is_object( $caseSchedulerSelected ))) {
|
if ((isset( $caseSchedulerSelected )) && (is_object( $caseSchedulerSelected ))) {
|
||||||
@@ -467,6 +547,7 @@ function checkCredentials($params){
|
|||||||
$event->update( $editEvent );
|
$event->update( $editEvent );
|
||||||
//End Adding
|
//End Adding
|
||||||
|
|
||||||
|
|
||||||
$sch = new CaseScheduler();
|
$sch = new CaseScheduler();
|
||||||
$sch->load( $sch_uid );
|
$sch->load( $sch_uid );
|
||||||
|
|
||||||
@@ -475,13 +556,15 @@ function checkCredentials($params){
|
|||||||
$this->NEXT = $sch->getSchTimeNextRun();
|
$this->NEXT = $sch->getSchTimeNextRun();
|
||||||
$this->DESCRIPTION = $sch->getSchName();
|
$this->DESCRIPTION = $sch->getSchName();
|
||||||
$this->TAS_NAME = $tas_name;
|
$this->TAS_NAME = $tas_name;
|
||||||
if ($sw_update)
|
if ($sw_update) {
|
||||||
$this->msg = G::LoadTranslation( 'ID_SCHEDULER_SUCCESS_UPDATE' );
|
$this->msg = G::LoadTranslation( 'ID_SCHEDULER_SUCCESS_UPDATE' );
|
||||||
else
|
} else {
|
||||||
$this->msg = G::LoadTranslation( 'ID_SCHEDULER_SUCCESS_NEW' );
|
$this->msg = G::LoadTranslation( 'ID_SCHEDULER_SUCCESS_NEW' );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function loadCS($params){
|
function loadCS ($params)
|
||||||
|
{
|
||||||
require_once 'classes/model/CaseScheduler.php';
|
require_once 'classes/model/CaseScheduler.php';
|
||||||
$SCH_UID = $params->SCH_UID;
|
$SCH_UID = $params->SCH_UID;
|
||||||
$oCaseScheduler = new CaseScheduler();
|
$oCaseScheduler = new CaseScheduler();
|
||||||
@@ -503,13 +586,27 @@ function checkCredentials($params){
|
|||||||
$w1 = $w2 = $w3 = $w4 = $w5 = $w6 = $w7 = false;
|
$w1 = $w2 = $w3 = $w4 = $w5 = $w6 = $w7 = false;
|
||||||
foreach ($week as $w) {
|
foreach ($week as $w) {
|
||||||
switch ($w) {
|
switch ($w) {
|
||||||
case 1: $w1 = true; break;
|
case 1:
|
||||||
case 2: $w2 = true; break;
|
$w1 = true;
|
||||||
case 3: $w3 = true; break;
|
break;
|
||||||
case 4: $w4 = true; break;
|
case 2:
|
||||||
case 5: $w5 = true; break;
|
$w2 = true;
|
||||||
case 6: $w6 = true; break;
|
break;
|
||||||
case 7: $w7 = true; break;
|
case 3:
|
||||||
|
$w3 = true;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
$w4 = true;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
$w5 = true;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
$w6 = true;
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
$w7 = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$data['W1'] = $w1;
|
$data['W1'] = $w1;
|
||||||
@@ -525,18 +622,42 @@ function checkCredentials($params){
|
|||||||
$m1 = $m2 = $m3 = $m4 = $m5 = $m6 = $m7 = $m8 = $m9 = $m10 = $m11 = $m12 = false;
|
$m1 = $m2 = $m3 = $m4 = $m5 = $m6 = $m7 = $m8 = $m9 = $m10 = $m11 = $m12 = false;
|
||||||
foreach ($year as $month) {
|
foreach ($year as $month) {
|
||||||
switch ($month) {
|
switch ($month) {
|
||||||
case 1: $m1 = true; break;
|
case 1:
|
||||||
case 2: $m2 = true; break;
|
$m1 = true;
|
||||||
case 3: $m3 = true; break;
|
break;
|
||||||
case 4: $m4 = true; break;
|
case 2:
|
||||||
case 5: $m5 = true; break;
|
$m2 = true;
|
||||||
case 6: $m6 = true; break;
|
break;
|
||||||
case 7: $m7 = true; break;
|
case 3:
|
||||||
case 8: $m8 = true; break;
|
$m3 = true;
|
||||||
case 9: $m9 = true; break;
|
break;
|
||||||
case 10: $m10 = true; break;
|
case 4:
|
||||||
case 11: $m11 = true; break;
|
$m4 = true;
|
||||||
case 12: $m12 = true; break;
|
break;
|
||||||
|
case 5:
|
||||||
|
$m5 = true;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
$m6 = true;
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
$m7 = true;
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
$m8 = true;
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
$m9 = true;
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
$m10 = true;
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
$m11 = true;
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
$m12 = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -567,3 +688,4 @@ function checkCredentials($params){
|
|||||||
}
|
}
|
||||||
|
|
||||||
} //End caseSchedulerProxy
|
} //End caseSchedulerProxy
|
||||||
|
|
||||||
|
|||||||
@@ -1,36 +1,42 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dashboard controller
|
* Dashboard controller
|
||||||
* @inherits Controller
|
* @inherits Controller
|
||||||
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Dashboard extends Controller {
|
class Dashboard extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
// Class properties
|
// Class properties
|
||||||
private $pmDashlet;
|
private $pmDashlet;
|
||||||
|
|
||||||
// Class constructor
|
// Class constructor
|
||||||
public function __construct() {
|
public function __construct ()
|
||||||
|
{
|
||||||
G::LoadClass( 'pmDashlet' );
|
G::LoadClass( 'pmDashlet' );
|
||||||
$this->pmDashlet = new PMDashlet();
|
$this->pmDashlet = new PMDashlet();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Functions for the dashboards users module - Start
|
// Functions for the dashboards users module - Start
|
||||||
|
|
||||||
public function index($httpData) {
|
|
||||||
|
public function index ($httpData)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$this->setJSVar( 'dashletsInstances', $this->getDashletsInstancesForCurrentUser() );
|
$this->setJSVar( 'dashletsInstances', $this->getDashletsInstancesForCurrentUser() );
|
||||||
$this->includeExtJS( 'dashboard/index' );
|
$this->includeExtJS( 'dashboard/index' );
|
||||||
$this->includeExtJSLib( 'ux/portal' );
|
$this->includeExtJSLib( 'ux/portal' );
|
||||||
G::RenderPage( 'publish', 'extJs' );
|
G::RenderPage( 'publish', 'extJs' );
|
||||||
}
|
} catch (Exception $error) {
|
||||||
catch (Exception $error) {
|
|
||||||
//ToDo: Display a error message
|
//ToDo: Display a error message
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderDashletInstance($data) {
|
public function renderDashletInstance ($data)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
if (! isset( $data->DAS_INS_UID )) {
|
if (! isset( $data->DAS_INS_UID )) {
|
||||||
$data->DAS_INS_UID = '';
|
$data->DAS_INS_UID = '';
|
||||||
@@ -42,35 +48,36 @@ class Dashboard extends Controller {
|
|||||||
|
|
||||||
if (! isset( $_REQUEST['w'] )) {
|
if (! isset( $_REQUEST['w'] )) {
|
||||||
$width = 300;
|
$width = 300;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$width = $_REQUEST['w'];
|
$width = $_REQUEST['w'];
|
||||||
}
|
}
|
||||||
$this->pmDashlet->render( $width );
|
$this->pmDashlet->render( $width );
|
||||||
}
|
} catch (Exception $error) {
|
||||||
catch (Exception $error) {
|
|
||||||
//ToDo: Show the error message
|
//ToDo: Show the error message
|
||||||
echo $error->getMessage();
|
echo $error->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getDashletsInstancesForCurrentUser() {
|
private function getDashletsInstancesForCurrentUser ()
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
if (! isset( $_SESSION['USER_LOGGED'] )) {
|
if (! isset( $_SESSION['USER_LOGGED'] )) {
|
||||||
throw new Exception( 'The session has expired.' );
|
throw new Exception( 'The session has expired.' );
|
||||||
}
|
}
|
||||||
return $this->pmDashlet->getDashletsInstancesForUser( $_SESSION['USER_LOGGED'] );
|
return $this->pmDashlet->getDashletsInstancesForUser( $_SESSION['USER_LOGGED'] );
|
||||||
}
|
} catch (Exception $error) {
|
||||||
catch (Exception $error) {
|
|
||||||
throw $error;
|
throw $error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Functions for the dashboards users module - End
|
// Functions for the dashboards users module - End
|
||||||
|
|
||||||
|
|
||||||
// Functions for the dasboards administration module - Start
|
// Functions for the dasboards administration module - Start
|
||||||
|
|
||||||
public function dashletsList() {
|
|
||||||
|
public function dashletsList ()
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$this->includeExtJS( 'dashboard/dashletsList' );
|
$this->includeExtJS( 'dashboard/dashletsList' );
|
||||||
if (isset( $_SESSION['__DASHBOARD_ERROR__'] )) {
|
if (isset( $_SESSION['__DASHBOARD_ERROR__'] )) {
|
||||||
@@ -79,13 +86,13 @@ class Dashboard extends Controller {
|
|||||||
}
|
}
|
||||||
$this->setView( 'dashboard/dashletsList' );
|
$this->setView( 'dashboard/dashletsList' );
|
||||||
G::RenderPage( 'publish', 'extJs' );
|
G::RenderPage( 'publish', 'extJs' );
|
||||||
}
|
} catch (Exception $error) {
|
||||||
catch (Exception $error) {
|
|
||||||
//ToDo: Display a error message
|
//ToDo: Display a error message
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDashletsInstances($data) {
|
public function getDashletsInstances ($data)
|
||||||
|
{
|
||||||
$this->setResponseType( 'json' );
|
$this->setResponseType( 'json' );
|
||||||
$result = new stdclass();
|
$result = new stdclass();
|
||||||
$result->status = 'OK';
|
$result->status = 'OK';
|
||||||
@@ -98,15 +105,15 @@ class Dashboard extends Controller {
|
|||||||
}
|
}
|
||||||
$result->dashletsInstances = $this->pmDashlet->getDashletsInstances( $data->start, $data->limit );
|
$result->dashletsInstances = $this->pmDashlet->getDashletsInstances( $data->start, $data->limit );
|
||||||
$result->totalDashletsInstances = $this->pmDashlet->getDashletsInstancesQuantity();
|
$result->totalDashletsInstances = $this->pmDashlet->getDashletsInstancesQuantity();
|
||||||
}
|
} catch (Exception $error) {
|
||||||
catch (Exception $error) {
|
|
||||||
$result->status = 'ERROR';
|
$result->status = 'ERROR';
|
||||||
$result->message = $error->getMessage();
|
$result->message = $error->getMessage();
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function dashletInstanceForm($data) {
|
public function dashletInstanceForm ($data)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$this->includeExtJS( 'dashboard/dashletInstanceForm', false );
|
$this->includeExtJS( 'dashboard/dashletInstanceForm', false );
|
||||||
$this->setView( 'dashboard/dashletInstanceForm' );
|
$this->setView( 'dashboard/dashletInstanceForm' );
|
||||||
@@ -119,8 +126,7 @@ class Dashboard extends Controller {
|
|||||||
$this->pmDashlet->setup( $data->DAS_INS_UID );
|
$this->pmDashlet->setup( $data->DAS_INS_UID );
|
||||||
$this->setJSVar( 'dashletInstance', $this->pmDashlet->getDashletInstance() );
|
$this->setJSVar( 'dashletInstance', $this->pmDashlet->getDashletInstance() );
|
||||||
$this->setJSVar( 'additionalFields', PMDashlet::getAdditionalFields( get_class( $this->pmDashlet->getDashletObject() ) ) );
|
$this->setJSVar( 'additionalFields', PMDashlet::getAdditionalFields( get_class( $this->pmDashlet->getDashletObject() ) ) );
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$dashletInstance = new stdclass();
|
$dashletInstance = new stdclass();
|
||||||
$dashletInstance->DAS_UID = $dashlets[0][0];
|
$dashletInstance->DAS_UID = $dashlets[0][0];
|
||||||
$dashlet = new Dashlet();
|
$dashlet = new Dashlet();
|
||||||
@@ -130,29 +136,29 @@ class Dashboard extends Controller {
|
|||||||
}
|
}
|
||||||
G::RenderPage( 'publish', 'extJs' );
|
G::RenderPage( 'publish', 'extJs' );
|
||||||
return null;
|
return null;
|
||||||
}
|
} catch (Exception $error) {
|
||||||
catch (Exception $error) {
|
|
||||||
$_SESSION['__DASHBOARD_ERROR__'] = $error->getMessage();
|
$_SESSION['__DASHBOARD_ERROR__'] = $error->getMessage();
|
||||||
G::header( 'Location: dashletsList' );
|
G::header( 'Location: dashletsList' );
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function saveDashletInstance($data) {
|
public function saveDashletInstance ($data)
|
||||||
|
{
|
||||||
$this->setResponseType( 'json' );
|
$this->setResponseType( 'json' );
|
||||||
$result = new stdclass();
|
$result = new stdclass();
|
||||||
$result->status = 'OK';
|
$result->status = 'OK';
|
||||||
try {
|
try {
|
||||||
$this->pmDashlet->saveDashletInstance( get_object_vars( $data ) );
|
$this->pmDashlet->saveDashletInstance( get_object_vars( $data ) );
|
||||||
}
|
} catch (Exception $error) {
|
||||||
catch (Exception $error) {
|
|
||||||
$result->status = 'ERROR';
|
$result->status = 'ERROR';
|
||||||
$result->message = $error->getMessage();
|
$result->message = $error->getMessage();
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteDashletInstance($data) {
|
public function deleteDashletInstance ($data)
|
||||||
|
{
|
||||||
$this->setResponseType( 'json' );
|
$this->setResponseType( 'json' );
|
||||||
$result = new stdclass();
|
$result = new stdclass();
|
||||||
$result->status = 'OK';
|
$result->status = 'OK';
|
||||||
@@ -164,15 +170,15 @@ class Dashboard extends Controller {
|
|||||||
throw new Exception( 'Parameter "DAS_INS_UID" is empty.' );
|
throw new Exception( 'Parameter "DAS_INS_UID" is empty.' );
|
||||||
}
|
}
|
||||||
$this->pmDashlet->deleteDashletInstance( $data->DAS_INS_UID );
|
$this->pmDashlet->deleteDashletInstance( $data->DAS_INS_UID );
|
||||||
}
|
} catch (Exception $error) {
|
||||||
catch (Exception $error) {
|
|
||||||
$result->status = 'ERROR';
|
$result->status = 'ERROR';
|
||||||
$result->message = $error->getMessage();
|
$result->message = $error->getMessage();
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAdditionalFields($data) {
|
public function getAdditionalFields ($data)
|
||||||
|
{
|
||||||
$this->setResponseType( 'json' );
|
$this->setResponseType( 'json' );
|
||||||
$result = new stdclass();
|
$result = new stdclass();
|
||||||
$result->status = 'OK';
|
$result->status = 'OK';
|
||||||
@@ -181,19 +187,18 @@ class Dashboard extends Controller {
|
|||||||
$dashletFields = $dashlet->load( $data->DAS_UID );
|
$dashletFields = $dashlet->load( $data->DAS_UID );
|
||||||
if (! is_null( $dashletFields )) {
|
if (! is_null( $dashletFields )) {
|
||||||
$result->additionalFields = PMDashlet::getAdditionalFields( $dashletFields['DAS_CLASS'] );
|
$result->additionalFields = PMDashlet::getAdditionalFields( $dashletFields['DAS_CLASS'] );
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
throw new Exception( 'Dashlet "' . $data->DAS_UID . '" does not exist.' );
|
throw new Exception( 'Dashlet "' . $data->DAS_UID . '" does not exist.' );
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception $error) {
|
||||||
catch (Exception $error) {
|
|
||||||
$result->status = 'ERROR';
|
$result->status = 'ERROR';
|
||||||
$result->message = $error->getMessage();
|
$result->message = $error->getMessage();
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOwnersByType($data) {
|
public function getOwnersByType ($data)
|
||||||
|
{
|
||||||
$this->setResponseType( 'json' );
|
$this->setResponseType( 'json' );
|
||||||
$result = new stdclass();
|
$result = new stdclass();
|
||||||
$result->status = 'OK';
|
$result->status = 'OK';
|
||||||
@@ -211,7 +216,8 @@ class Dashboard extends Controller {
|
|||||||
$usersInstance = new Users();
|
$usersInstance = new Users();
|
||||||
$allUsers = $usersInstance->getAll();
|
$allUsers = $usersInstance->getAll();
|
||||||
foreach ($allUsers->data as $user) {
|
foreach ($allUsers->data as $user) {
|
||||||
$users[] = array('OWNER_UID' => $user['USR_UID'], 'OWNER_NAME' => $user['USR_FIRSTNAME'] . ' ' . $user['USR_LASTNAME']);
|
$users[] = array ('OWNER_UID' => $user['USR_UID'],'OWNER_NAME' => $user['USR_FIRSTNAME'] . ' ' . $user['USR_LASTNAME']
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result->total = $allUsers->totalCount;
|
$result->total = $allUsers->totalCount;
|
||||||
@@ -229,9 +235,12 @@ class Dashboard extends Controller {
|
|||||||
$criteria->addSelectColumn( ContentPeer::CON_VALUE );
|
$criteria->addSelectColumn( ContentPeer::CON_VALUE );
|
||||||
//FROM
|
//FROM
|
||||||
$conditions = array ();
|
$conditions = array ();
|
||||||
$conditions[] = array(DepartmentPeer::DEP_UID, ContentPeer::CON_ID);
|
$conditions[] = array (DepartmentPeer::DEP_UID,ContentPeer::CON_ID
|
||||||
$conditions[] = array(ContentPeer::CON_CATEGORY, DBAdapter::getStringDelimiter() . 'DEPO_TITLE' . DBAdapter::getStringDelimiter());
|
);
|
||||||
$conditions[] = array(ContentPeer::CON_LANG, DBAdapter::getStringDelimiter() . 'en' . DBAdapter::getStringDelimiter());
|
$conditions[] = array (ContentPeer::CON_CATEGORY,DBAdapter::getStringDelimiter() . 'DEPO_TITLE' . DBAdapter::getStringDelimiter()
|
||||||
|
);
|
||||||
|
$conditions[] = array (ContentPeer::CON_LANG,DBAdapter::getStringDelimiter() . 'en' . DBAdapter::getStringDelimiter()
|
||||||
|
);
|
||||||
$criteria->addJoinMC( $conditions, Criteria::LEFT_JOIN );
|
$criteria->addJoinMC( $conditions, Criteria::LEFT_JOIN );
|
||||||
//WHERE
|
//WHERE
|
||||||
$criteria->add( DepartmentPeer::DEP_STATUS, 'ACTIVE' );
|
$criteria->add( DepartmentPeer::DEP_STATUS, 'ACTIVE' );
|
||||||
@@ -242,7 +251,8 @@ class Dashboard extends Controller {
|
|||||||
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
$dataset->next();
|
$dataset->next();
|
||||||
while ($row = $dataset->getRow()) {
|
while ($row = $dataset->getRow()) {
|
||||||
$departments[] = array('OWNER_UID' => $row['DEP_UID'], 'OWNER_NAME' => $row['CON_VALUE']);
|
$departments[] = array ('OWNER_UID' => $row['DEP_UID'],'OWNER_NAME' => $row['CON_VALUE']
|
||||||
|
);
|
||||||
$dataset->next();
|
$dataset->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,9 +271,12 @@ class Dashboard extends Controller {
|
|||||||
$criteria->addSelectColumn( ContentPeer::CON_VALUE );
|
$criteria->addSelectColumn( ContentPeer::CON_VALUE );
|
||||||
//FROM
|
//FROM
|
||||||
$conditions = array ();
|
$conditions = array ();
|
||||||
$conditions[] = array(GroupwfPeer::GRP_UID, ContentPeer::CON_ID);
|
$conditions[] = array (GroupwfPeer::GRP_UID,ContentPeer::CON_ID
|
||||||
$conditions[] = array(ContentPeer::CON_CATEGORY, DBAdapter::getStringDelimiter() . 'GRP_TITLE' . DBAdapter::getStringDelimiter());
|
);
|
||||||
$conditions[] = array(ContentPeer::CON_LANG, DBAdapter::getStringDelimiter() . 'en' . DBAdapter::getStringDelimiter());
|
$conditions[] = array (ContentPeer::CON_CATEGORY,DBAdapter::getStringDelimiter() . 'GRP_TITLE' . DBAdapter::getStringDelimiter()
|
||||||
|
);
|
||||||
|
$conditions[] = array (ContentPeer::CON_LANG,DBAdapter::getStringDelimiter() . 'en' . DBAdapter::getStringDelimiter()
|
||||||
|
);
|
||||||
$criteria->addJoinMC( $conditions, Criteria::LEFT_JOIN );
|
$criteria->addJoinMC( $conditions, Criteria::LEFT_JOIN );
|
||||||
//WHERE
|
//WHERE
|
||||||
$criteria->add( GroupwfPeer::GRP_STATUS, 'ACTIVE' );
|
$criteria->add( GroupwfPeer::GRP_STATUS, 'ACTIVE' );
|
||||||
@@ -274,7 +287,8 @@ class Dashboard extends Controller {
|
|||||||
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
$dataset->next();
|
$dataset->next();
|
||||||
while ($row = $dataset->getRow()) {
|
while ($row = $dataset->getRow()) {
|
||||||
$groups[] = array('OWNER_UID' => $row['GRP_UID'], 'OWNER_NAME' => $row['CON_VALUE']);
|
$groups[] = array ('OWNER_UID' => $row['GRP_UID'],'OWNER_NAME' => $row['CON_VALUE']
|
||||||
|
);
|
||||||
$dataset->next();
|
$dataset->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,15 +296,15 @@ class Dashboard extends Controller {
|
|||||||
$result->owners = $groups;
|
$result->owners = $groups;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception $error) {
|
||||||
catch (Exception $error) {
|
|
||||||
$result->status = 'ERROR';
|
$result->status = 'ERROR';
|
||||||
$result->message = $error->getMessage();
|
$result->message = $error->getMessage();
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getDashlets() {
|
private function getDashlets ()
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
require_once 'classes/model/Dashlet.php';
|
require_once 'classes/model/Dashlet.php';
|
||||||
|
|
||||||
@@ -307,12 +321,12 @@ class Dashboard extends Controller {
|
|||||||
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
$dataset->next();
|
$dataset->next();
|
||||||
while ($row = $dataset->getRow()) {
|
while ($row = $dataset->getRow()) {
|
||||||
$dashlets[] = array($row['DAS_UID'], $row['DAS_TITLE']);
|
$dashlets[] = array ($row['DAS_UID'],$row['DAS_TITLE']
|
||||||
|
);
|
||||||
$dataset->next();
|
$dataset->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} catch (Exception $error) {
|
||||||
catch (Exception $error) {
|
|
||||||
throw $error;
|
throw $error;
|
||||||
}
|
}
|
||||||
return $dashlets;
|
return $dashlets;
|
||||||
@@ -320,3 +334,4 @@ class Dashboard extends Controller {
|
|||||||
|
|
||||||
// Functions for the dasboards administration module - End
|
// Functions for the dasboards administration module - End
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Home controller
|
* Home controller
|
||||||
*
|
*
|
||||||
@@ -53,7 +54,8 @@ class Home extends Controller
|
|||||||
$skin = $this->clientBrowser['name'] == 'msie' ? $this->lastSkin : 'simplified';
|
$skin = $this->clientBrowser['name'] == 'msie' ? $this->lastSkin : 'simplified';
|
||||||
|
|
||||||
if (! is_array( $data )) {
|
if (! is_array( $data )) {
|
||||||
$data = array('u'=>'', 'p'=>'', 'm'=>'');
|
$data = array ('u' => '','p' => '','m' => ''
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setVar( 'msg', $data['m'] );
|
$this->setVar( 'msg', $data['m'] );
|
||||||
@@ -67,6 +69,7 @@ class Home extends Controller
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* getting default list
|
* getting default list
|
||||||
|
*
|
||||||
* @param string $httpData (opional)
|
* @param string $httpData (opional)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -112,18 +115,12 @@ class Home extends Controller
|
|||||||
|
|
||||||
if (! empty( $mnu->Options )) {
|
if (! empty( $mnu->Options )) {
|
||||||
foreach ($mnu->Options as $index => $value) {
|
foreach ($mnu->Options as $index => $value) {
|
||||||
$option = array(
|
$option = array ('id' => $mnu->Id[$index],'url' => $mnu->Options[$index],'label' => $mnu->Labels[$index],'icon' => $mnu->Icons[$index],'class' => $mnu->ElementClass[$index]
|
||||||
'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') {
|
if ($mnu->Id[$index] != 'S_NEW_CASE') {
|
||||||
$arrayMnuOption[] = $option;
|
$arrayMnuOption[] = $option;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$mnuNewCase = $option;
|
$mnuNewCase = $option;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,7 +147,7 @@ class Home extends Controller
|
|||||||
G::LoadClass( 'applications' );
|
G::LoadClass( 'applications' );
|
||||||
|
|
||||||
$apps = new Applications();
|
$apps = new Applications();
|
||||||
$step = new Step;
|
$step = new Step();
|
||||||
|
|
||||||
$cases = $apps->getAll( $this->userID, 0, 1, 'todo' );
|
$cases = $apps->getAll( $this->userID, 0, 1, 'todo' );
|
||||||
|
|
||||||
@@ -247,6 +244,7 @@ class Home extends Controller
|
|||||||
$cases = $apps->getAll( $this->userID, $start, $limit, $type );
|
$cases = $apps->getAll( $this->userID, $start, $limit, $type );
|
||||||
//g::pr($cases['data']); die;
|
//g::pr($cases['data']); die;
|
||||||
|
|
||||||
|
|
||||||
// formating & complitting apps data with 'Notes'
|
// formating & complitting apps data with 'Notes'
|
||||||
foreach ($cases['data'] as $i => $row) {
|
foreach ($cases['data'] as $i => $row) {
|
||||||
// Formatting
|
// Formatting
|
||||||
@@ -257,8 +255,7 @@ class Home extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset( $row['DEL_DELEGATE_DATE'] )) {
|
if (isset( $row['DEL_DELEGATE_DATE'] )) {
|
||||||
$cases['data'][$i]['DEL_DELEGATE_DATE'] = G::getformatedDate($row['DEL_DELEGATE_DATE'],
|
$cases['data'][$i]['DEL_DELEGATE_DATE'] = G::getformatedDate( $row['DEL_DELEGATE_DATE'], 'M d, yyyy - h:i:s' );
|
||||||
'M d, yyyy - h:i:s');
|
|
||||||
}
|
}
|
||||||
if (isset( $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'] );
|
$cases['data'][$i]['APP_DEL_PREVIOUS_USER'] = ucwords( $row['APP_DEL_PREVIOUS_USER'] );
|
||||||
@@ -305,11 +302,15 @@ class Home extends Controller
|
|||||||
$httpData->no = isset( $httpData->no ) ? $httpData->no : 0;
|
$httpData->no = isset( $httpData->no ) ? $httpData->no : 0;
|
||||||
|
|
||||||
switch ($httpData->no) {
|
switch ($httpData->no) {
|
||||||
case 2: $tpl = $this->userUxBaseTemplate . PATH_SEP . 'noAppsMsg'; break;
|
case 2:
|
||||||
default: $tpl = $this->userUxBaseTemplate . PATH_SEP . 'error';
|
$tpl = $this->userUxBaseTemplate . PATH_SEP . 'noAppsMsg';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$tpl = $this->userUxBaseTemplate . PATH_SEP . 'error';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setView( $tpl );
|
$this->setView( $tpl );
|
||||||
$this->render();
|
$this->render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Install Controller
|
* Install Controller
|
||||||
*
|
*
|
||||||
@@ -16,6 +17,7 @@ class Installer extends Controller
|
|||||||
|
|
||||||
public $link; #resource for database connection
|
public $link; #resource for database connection
|
||||||
|
|
||||||
|
|
||||||
public function __construct ()
|
public function __construct ()
|
||||||
{
|
{
|
||||||
$this->path_config = PATH_CORE . 'config/';
|
$this->path_config = PATH_CORE . 'config/';
|
||||||
@@ -29,20 +31,14 @@ class Installer extends Controller
|
|||||||
|
|
||||||
public function index ($httpData)
|
public function index ($httpData)
|
||||||
{
|
{
|
||||||
$step1_txt = 'If any of these items is not supported (marked as No) then please take actions to correct them.<br><br>' .
|
$step1_txt = 'If any of these items is not supported (marked as No) then please take actions to correct them.<br><br>' . 'Failure to do so could lead to your ProcessMaker installation not functioning correctly!<br><br>' .
|
||||||
'Failure to do so could lead to your ProcessMaker installation not functioning correctly!<br><br>' .
|
|
||||||
//'(*) MSSQL Support is optional.<br><br>' .
|
//'(*) MSSQL Support is optional.<br><br>' .
|
||||||
'(*) OpenSSL is optional.<br><br>' .
|
'(*) OpenSSL is optional.<br><br>' . '(*) LDAP is optional.';
|
||||||
'(*) LDAP is optional.';
|
|
||||||
|
|
||||||
$step2_txt = 'These settings are recommended for PHP in order to ensure full compatibility with ProcessMaker. <> ' .
|
$step2_txt = 'These settings are recommended for PHP in order to ensure full compatibility with ProcessMaker. <> ' . 'However, ProcessMaker still operate if your settings do not quite match the recommended';
|
||||||
'However, ProcessMaker still operate if your settings do not quite match the recommended';
|
$step3_txt = 'In order for ProcessMaker to work correctly, it needs to be able read and write to certain directories and their files.<br>' . 'Make sure to give read and write access to the directories listed below and all their subdirectories and files.';
|
||||||
$step3_txt = 'In order for ProcessMaker to work correctly, it needs to be able read and write to certain directories and their files.<br>' .
|
$step4_txt = 'ProcessMaker stores all of its data in a database. Enter the address and port number used by the database. Also enter' . 'the username and password of the database user who will set up the databases used by ProcessMaker<br>';
|
||||||
'Make sure to give read and write access to the directories listed below and all their subdirectories and files.';
|
$step5_txt = 'ProcessMaker uses workspaces to store data in the database. Please enter a valid workspace name and a username and password to login' . ' as the administrator.';
|
||||||
$step4_txt = 'ProcessMaker stores all of its data in a database. Enter the address and port number used by the database. Also enter' .
|
|
||||||
'the username and password of the database user who will set up the databases used by ProcessMaker<br>';
|
|
||||||
$step5_txt = 'ProcessMaker uses workspaces to store data in the database. Please enter a valid workspace name and a username and password to login'.
|
|
||||||
' as the administrator.';
|
|
||||||
$step6_txt = 'xxx';
|
$step6_txt = 'xxx';
|
||||||
|
|
||||||
$licenseContent = file_get_contents( PATH_TRUNK . 'LICENSE.txt' );
|
$licenseContent = file_get_contents( PATH_TRUNK . 'LICENSE.txt' );
|
||||||
@@ -78,8 +74,7 @@ class Installer extends Controller
|
|||||||
|
|
||||||
public function newSite ()
|
public function newSite ()
|
||||||
{
|
{
|
||||||
$textStep1 = 'ProcessMaker stores all of its data in a database. This screen gives the installation program the information needed to create this database.<br><br>' .
|
$textStep1 = 'ProcessMaker stores all of its data in a database. This screen gives the installation program the information needed to create this database.<br><br>' . 'If you are installing ProcessMaker on a remote web server, you will need to get this information from your Database Server.';
|
||||||
'If you are installing ProcessMaker on a remote web server, you will need to get this information from your Database Server.';
|
|
||||||
$textStep2 = 'ProcessMaker uses a workspaces to store data. Please select a valid workspace name and credentials to log in it.';
|
$textStep2 = 'ProcessMaker uses a workspaces to store data. Please select a valid workspace name and credentials to log in it.';
|
||||||
|
|
||||||
$this->includeExtJS( 'installer/CardLayout', false );
|
$this->includeExtJS( 'installer/CardLayout', false );
|
||||||
@@ -216,8 +211,7 @@ class Installer extends Controller
|
|||||||
$info->memory->version = $memory . 'M';
|
$info->memory->version = $memory . 'M';
|
||||||
if ($memory > 80) {
|
if ($memory > 80) {
|
||||||
$info->memory->result = true;
|
$info->memory->result = true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$info->memory->result = false;
|
$info->memory->result = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,8 +236,7 @@ class Installer extends Controller
|
|||||||
$info->pathConfig->result = G::is_writable_r( $_REQUEST['pathConfig'], $noWritableFiles );
|
$info->pathConfig->result = G::is_writable_r( $_REQUEST['pathConfig'], $noWritableFiles );
|
||||||
if ($info->pathConfig->result) {
|
if ($info->pathConfig->result) {
|
||||||
$info->pathConfig->message = 'writeable';
|
$info->pathConfig->message = 'writeable';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$info->success = false;
|
$info->success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,8 +244,7 @@ class Installer extends Controller
|
|||||||
$info->pathLanguages->result = G::is_writable_r( $_REQUEST['pathLanguages'], $noWritableFiles );
|
$info->pathLanguages->result = G::is_writable_r( $_REQUEST['pathLanguages'], $noWritableFiles );
|
||||||
if ($info->pathLanguages->result) {
|
if ($info->pathLanguages->result) {
|
||||||
$info->pathLanguages->message = 'writeable';
|
$info->pathLanguages->message = 'writeable';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$info->success = false;
|
$info->success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,8 +252,7 @@ class Installer extends Controller
|
|||||||
$info->pathPlugins->result = G::is_writable_r( $_REQUEST['pathPlugins'], $noWritableFiles );
|
$info->pathPlugins->result = G::is_writable_r( $_REQUEST['pathPlugins'], $noWritableFiles );
|
||||||
if ($info->pathPlugins->result) {
|
if ($info->pathPlugins->result) {
|
||||||
$info->pathPlugins->message = 'writeable';
|
$info->pathPlugins->message = 'writeable';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$info->success = false;
|
$info->success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,8 +260,7 @@ class Installer extends Controller
|
|||||||
$info->pathXmlforms->result = G::is_writable_r( $_REQUEST['pathXmlforms'], $noWritableFiles );
|
$info->pathXmlforms->result = G::is_writable_r( $_REQUEST['pathXmlforms'], $noWritableFiles );
|
||||||
if ($info->pathXmlforms->result) {
|
if ($info->pathXmlforms->result) {
|
||||||
$info->pathXmlforms->message = 'writeable';
|
$info->pathXmlforms->message = 'writeable';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$info->success = false;
|
$info->success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,8 +268,7 @@ class Installer extends Controller
|
|||||||
$info->pathPublic->result = G::is_writable_r( $_REQUEST['pathPublic'], $noWritableFiles );
|
$info->pathPublic->result = G::is_writable_r( $_REQUEST['pathPublic'], $noWritableFiles );
|
||||||
if ($info->pathPublic->result) {
|
if ($info->pathPublic->result) {
|
||||||
$info->pathShared->message = 'writeable';
|
$info->pathShared->message = 'writeable';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$info->success = false;
|
$info->success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,15 +276,15 @@ class Installer extends Controller
|
|||||||
$info->pathShared->result = G::is_writable_r( $_REQUEST['pathShared'], $noWritableFiles );
|
$info->pathShared->result = G::is_writable_r( $_REQUEST['pathShared'], $noWritableFiles );
|
||||||
if ($info->pathShared->result) {
|
if ($info->pathShared->result) {
|
||||||
$info->pathShared->message = 'writeable';
|
$info->pathShared->message = 'writeable';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
G::verifyPath( $_REQUEST['pathShared'], true );
|
G::verifyPath( $_REQUEST['pathShared'], true );
|
||||||
$info->pathShared->result = G::is_writable_r( $_REQUEST['pathShared'], $noWritableFiles );
|
$info->pathShared->result = G::is_writable_r( $_REQUEST['pathShared'], $noWritableFiles );
|
||||||
if ( $info->pathShared->result )
|
if ($info->pathShared->result) {
|
||||||
$info->pathShared->message = 'writeable';
|
$info->pathShared->message = 'writeable';
|
||||||
else
|
} else {
|
||||||
$info->success = false;
|
$info->success = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($info->pathShared->result) {
|
if ($info->pathShared->result) {
|
||||||
$aux = pathinfo( $_REQUEST['pathLogFile'] );
|
$aux = pathinfo( $_REQUEST['pathLogFile'] );
|
||||||
@@ -316,8 +305,7 @@ class Installer extends Controller
|
|||||||
|
|
||||||
if ($info->success) {
|
if ($info->success) {
|
||||||
$info->notify = 'Success, all required directories are writable.';
|
$info->notify = 'Success, all required directories are writable.';
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$info->notify = 'Some directories and/or files inside it are not writable.';
|
$info->notify = 'Some directories and/or files inside it are not writable.';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,8 +319,7 @@ class Installer extends Controller
|
|||||||
$this->setResponseType( 'json' );
|
$this->setResponseType( 'json' );
|
||||||
if ($_REQUEST['db_engine'] == 'mysql') {
|
if ($_REQUEST['db_engine'] == 'mysql') {
|
||||||
return $this->testMySQLconnection();
|
return $this->testMySQLconnection();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return $this->testMSSQLconnection();
|
return $this->testMSSQLconnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -346,22 +333,23 @@ class Installer extends Controller
|
|||||||
{
|
{
|
||||||
$serverAddr = $_SERVER['SERVER_ADDR'];
|
$serverAddr = $_SERVER['SERVER_ADDR'];
|
||||||
//if this function is called outside the createWorkspace, just returns and do nothing
|
//if this function is called outside the createWorkspace, just returns and do nothing
|
||||||
if ( !isset( $_REQUEST['pathShared']) )
|
if (! isset( $_REQUEST['pathShared'] )) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
//log file is in shared/logs
|
//log file is in shared/logs
|
||||||
$pathShared = trim( $_REQUEST['pathShared'] );
|
$pathShared = trim( $_REQUEST['pathShared'] );
|
||||||
if ( substr($pathShared,-1) != '/' ) $pathShared .= '/';
|
if (substr( $pathShared, - 1 ) != '/') {
|
||||||
|
$pathShared .= '/';
|
||||||
|
}
|
||||||
$logFile = $pathShared . 'log/install.log';
|
$logFile = $pathShared . 'log/install.log';
|
||||||
|
|
||||||
if (! is_file( $logFile )) {
|
if (! is_file( $logFile )) {
|
||||||
G::mk_dir( dirname( $pathShared ) );
|
G::mk_dir( dirname( $pathShared ) );
|
||||||
$fpt = fopen( $logFile, 'w' );
|
$fpt = fopen( $logFile, 'w' );
|
||||||
if ( $fpt !== NULL ) {
|
if ($fpt !== null) {
|
||||||
fwrite( $fpt, sprintf( "%s %s\n", date( 'Y:m:d H:i:s' ), '----- starting log file ------' ) );
|
fwrite( $fpt, sprintf( "%s %s\n", date( 'Y:m:d H:i:s' ), '----- starting log file ------' ) );
|
||||||
fclose( $fpt );
|
fclose( $fpt );
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
throw (new Exception( sprintf( "File '%s' is not writeable. Please check permission before continue", $logFile ) ));
|
throw (new Exception( sprintf( "File '%s' is not writeable. Please check permission before continue", $logFile ) ));
|
||||||
return $false;
|
return $false;
|
||||||
}
|
}
|
||||||
@@ -382,8 +370,7 @@ class Installer extends Controller
|
|||||||
$this->setResponseType( 'json' );
|
$this->setResponseType( 'json' );
|
||||||
if ($_REQUEST['db_engine'] == 'mysql') {
|
if ($_REQUEST['db_engine'] == 'mysql') {
|
||||||
$info = $this->createMySQLWorkspace();
|
$info = $this->createMySQLWorkspace();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$info = $this->createMSSQLWorkspace();
|
$info = $this->createMSSQLWorkspace();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -454,12 +441,14 @@ class Installer extends Controller
|
|||||||
// $content = file_get_contents($file);
|
// $content = file_get_contents($file);
|
||||||
// $queries = explode(';', $content);
|
// $queries = explode(';', $content);
|
||||||
|
|
||||||
|
|
||||||
// foreach( $queries as $sql) {
|
// foreach( $queries as $sql) {
|
||||||
// if (trim($sql) != '') {
|
// if (trim($sql) != '') {
|
||||||
// $query = @mysql_query($sql, $this->link);
|
// $query = @mysql_query($sql, $this->link);
|
||||||
// if (!$query) {
|
// if (!$query) {
|
||||||
// $errorMessage = mysql_error($this->link);
|
// $errorMessage = mysql_error($this->link);
|
||||||
|
|
||||||
|
|
||||||
// $this->installLog ( sprintf ( 'MySQL error: %s Query: %s ', $errorMessage, $sql ) );
|
// $this->installLog ( sprintf ( 'MySQL error: %s Query: %s ', $errorMessage, $sql ) );
|
||||||
// throw ( new Exception ( $errorMessage ) );
|
// throw ( new Exception ( $errorMessage ) );
|
||||||
// return false;
|
// return false;
|
||||||
@@ -467,15 +456,18 @@ class Installer extends Controller
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
//erik: New Update, to support more complex queries
|
//erik: New Update, to support more complex queries
|
||||||
|
|
||||||
|
|
||||||
$lines = file( $file );
|
$lines = file( $file );
|
||||||
$previous = NULL;
|
$previous = null;
|
||||||
$errors = '';
|
$errors = '';
|
||||||
@mysql_query( "SET NAMES 'utf8';" );
|
@mysql_query( "SET NAMES 'utf8';" );
|
||||||
foreach ($lines as $j => $line) {
|
foreach ($lines as $j => $line) {
|
||||||
$line = trim( $line ); // Remove comments from the script
|
$line = trim( $line ); // Remove comments from the script
|
||||||
|
|
||||||
|
|
||||||
if (strpos( $line, "--" ) === 0) {
|
if (strpos( $line, "--" ) === 0) {
|
||||||
$line = substr( $line, 0, strpos( $line, "--" ) );
|
$line = substr( $line, 0, strpos( $line, "--" ) );
|
||||||
}
|
}
|
||||||
@@ -496,7 +488,7 @@ class Installer extends Controller
|
|||||||
if ($previous) {
|
if ($previous) {
|
||||||
$line = $previous . " " . $line;
|
$line = $previous . " " . $line;
|
||||||
}
|
}
|
||||||
$previous = NULL;
|
$previous = null;
|
||||||
|
|
||||||
// If the current line doesnt end with ; then put this line together
|
// If the current line doesnt end with ; then put this line together
|
||||||
// with the next one, thus supporting multi-line statements.
|
// with the next one, thus supporting multi-line statements.
|
||||||
@@ -627,7 +619,9 @@ class Installer extends Controller
|
|||||||
$adminUsername = trim( $_REQUEST['adminUsername'] );
|
$adminUsername = trim( $_REQUEST['adminUsername'] );
|
||||||
$deleteDB = ($_REQUEST['deleteDB'] == 'true');
|
$deleteDB = ($_REQUEST['deleteDB'] == 'true');
|
||||||
|
|
||||||
if ( substr($pathShared,-1) != '/' ) $pathShared .= '/';
|
if (substr( $pathShared, - 1 ) != '/') {
|
||||||
|
$pathShared .= '/';
|
||||||
|
}
|
||||||
|
|
||||||
$this->installLog( '-------------------------------------------' );
|
$this->installLog( '-------------------------------------------' );
|
||||||
$this->installLog( sprintf( "Creating workspace '%s' ", $workspace ) );
|
$this->installLog( sprintf( "Creating workspace '%s' ", $workspace ) );
|
||||||
@@ -715,7 +709,6 @@ class Installer extends Controller
|
|||||||
$this->installLog( 'Creating: ' . $databases_file );
|
$this->installLog( 'Creating: ' . $databases_file );
|
||||||
file_put_contents( $databases_file, $databasesText );
|
file_put_contents( $databases_file, $databasesText );
|
||||||
|
|
||||||
|
|
||||||
// Execute scripts to create and populates databases
|
// Execute scripts to create and populates databases
|
||||||
$query = sprintf( "USE %s;", $rb );
|
$query = sprintf( "USE %s;", $rb );
|
||||||
$this->mysqlQuery( $query );
|
$this->mysqlQuery( $query );
|
||||||
@@ -729,11 +722,7 @@ class Installer extends Controller
|
|||||||
$this->mysqlFileQuery( PATH_HOME . 'engine/data/mysql/insert.sql' );
|
$this->mysqlFileQuery( PATH_HOME . 'engine/data/mysql/insert.sql' );
|
||||||
|
|
||||||
// Create the triggers
|
// Create the triggers
|
||||||
if (file_exists(PATH_HOME . 'engine/methods/setup/setupSchemas/triggerAppDelegationInsert.sql') &&
|
if (file_exists( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerAppDelegationInsert.sql' ) && file_exists( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerAppDelegationUpdate.sql' ) && file_exists( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerApplicationUpdate.sql' ) && file_exists( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerApplicationDelete.sql' ) && file_exists( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerContentUpdate.sql' )) {
|
||||||
file_exists(PATH_HOME . 'engine/methods/setup/setupSchemas/triggerAppDelegationUpdate.sql') &&
|
|
||||||
file_exists(PATH_HOME . 'engine/methods/setup/setupSchemas/triggerApplicationUpdate.sql') &&
|
|
||||||
file_exists(PATH_HOME . 'engine/methods/setup/setupSchemas/triggerApplicationDelete.sql') &&
|
|
||||||
file_exists(PATH_HOME . 'engine/methods/setup/setupSchemas/triggerContentUpdate.sql')) {
|
|
||||||
$this->mysqlQuery( @file_get_contents( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerAppDelegationInsert.sql' ) );
|
$this->mysqlQuery( @file_get_contents( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerAppDelegationInsert.sql' ) );
|
||||||
$this->mysqlQuery( @file_get_contents( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerAppDelegationUpdate.sql' ) );
|
$this->mysqlQuery( @file_get_contents( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerAppDelegationUpdate.sql' ) );
|
||||||
$this->mysqlQuery( @file_get_contents( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerApplicationUpdate.sql' ) );
|
$this->mysqlQuery( @file_get_contents( PATH_HOME . 'engine/methods/setup/setupSchemas/triggerApplicationUpdate.sql' ) );
|
||||||
@@ -745,7 +734,8 @@ class Installer extends Controller
|
|||||||
)
|
)
|
||||||
VALUES (
|
VALUES (
|
||||||
'APP_CACHE_VIEW_ENGINE',
|
'APP_CACHE_VIEW_ENGINE',
|
||||||
'" . mysql_real_escape_string(serialize(array('LANG' => 'en', 'STATUS' => 'active'))) . "'
|
'" . mysql_real_escape_string( serialize( array ('LANG' => 'en','STATUS' => 'active'
|
||||||
|
) ) ) . "'
|
||||||
)" );
|
)" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -816,6 +806,7 @@ class Installer extends Controller
|
|||||||
|
|
||||||
//end AppCacheView Build
|
//end AppCacheView Build
|
||||||
|
|
||||||
|
|
||||||
//erik: for new env conf handling
|
//erik: for new env conf handling
|
||||||
G::loadClass( 'system' );
|
G::loadClass( 'system' );
|
||||||
$envFile = PATH_CONFIG . 'env.ini';
|
$envFile = PATH_CONFIG . 'env.ini';
|
||||||
@@ -826,8 +817,7 @@ class Installer extends Controller
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
G::update_php_ini( $envFile, $updatedConf );
|
G::update_php_ini( $envFile, $updatedConf );
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch (Exception $e) {
|
|
||||||
$info->result = false;
|
$info->result = false;
|
||||||
$info->message = "ProcessMaker couldn't write on configuration file: $envFile.<br/>";
|
$info->message = "ProcessMaker couldn't write on configuration file: $envFile.<br/>";
|
||||||
$info->message .= "The new ProcessMaker UI couldn't be applied on installation, you can enable it after from Admin->System settings.";
|
$info->message .= "The new ProcessMaker UI couldn't be applied on installation, you can enable it after from Admin->System settings.";
|
||||||
@@ -840,12 +830,9 @@ class Installer extends Controller
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// update the main index file
|
// update the main index file
|
||||||
$indexFileUpdated = System::updateIndexFile(array(
|
$indexFileUpdated = System::updateIndexFile( array ('lang' => 'en','skin' => $updatedConf['default_skin']
|
||||||
'lang' => 'en',
|
|
||||||
'skin' => $updatedConf['default_skin']
|
|
||||||
) );
|
) );
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch (Exception $e) {
|
|
||||||
$info->result = false;
|
$info->result = false;
|
||||||
$info->message = "ProcessMaker couldn't write on configuration file: " . PATH_HTML . "index.html.<br/>";
|
$info->message = "ProcessMaker couldn't write on configuration file: " . PATH_HTML . "index.html.<br/>";
|
||||||
$info->message .= "The new ProcessMaker UI couldn't be applied on installation, you can enable it after from Admin->System settings.";
|
$info->message .= "The new ProcessMaker UI couldn't be applied on installation, you can enable it after from Admin->System settings.";
|
||||||
@@ -858,8 +845,7 @@ class Installer extends Controller
|
|||||||
|
|
||||||
$info->result = true;
|
$info->result = true;
|
||||||
$info->message = 'Succesfully OK';
|
$info->message = 'Succesfully OK';
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch (Exception $e) {
|
|
||||||
$info->canRedirect = false;
|
$info->canRedirect = false;
|
||||||
$info->result = false;
|
$info->result = false;
|
||||||
$info->message = $e->getMessage();
|
$info->message = $e->getMessage();
|
||||||
@@ -890,7 +876,9 @@ class Installer extends Controller
|
|||||||
$adminUsername = trim( $_REQUEST['adminUsername'] );
|
$adminUsername = trim( $_REQUEST['adminUsername'] );
|
||||||
$deleteDB = ($_REQUEST['deleteDB'] == 'true');
|
$deleteDB = ($_REQUEST['deleteDB'] == 'true');
|
||||||
|
|
||||||
if ( substr($pathShared,-1) != '/' ) $pathShared .= '/';
|
if (substr( $pathShared, - 1 ) != '/') {
|
||||||
|
$pathShared .= '/';
|
||||||
|
}
|
||||||
|
|
||||||
$this->installLog( '-------------------------------------------' );
|
$this->installLog( '-------------------------------------------' );
|
||||||
$this->installLog( sprintf( "Creating workspace '%s' ", $workspace ) );
|
$this->installLog( sprintf( "Creating workspace '%s' ", $workspace ) );
|
||||||
@@ -994,11 +982,7 @@ class Installer extends Controller
|
|||||||
$this->mssqlFileQuery( PATH_HOME . 'engine/data/mssql/insert.sql' );
|
$this->mssqlFileQuery( PATH_HOME . 'engine/data/mssql/insert.sql' );
|
||||||
|
|
||||||
// Create the triggers
|
// Create the triggers
|
||||||
if (file_exists(PATH_HOME . 'engine/plugins/enterprise/data/triggerAppDelegationInsert.sql') &&
|
if (file_exists( PATH_HOME . 'engine/plugins/enterprise/data/triggerAppDelegationInsert.sql' ) && file_exists( PATH_HOME . 'engine/plugins/enterprise/data/triggerAppDelegationUpdate.sql' ) && file_exists( PATH_HOME . 'engine/plugins/enterprise/data/triggerApplicationUpdate.sql' ) && file_exists( PATH_HOME . 'engine/plugins/enterprise/data/triggerApplicationDelete.sql' ) && file_exists( PATH_HOME . 'engine/plugins/enterprise/data/triggerContentUpdate.sql' )) {
|
||||||
file_exists(PATH_HOME . 'engine/plugins/enterprise/data/triggerAppDelegationUpdate.sql') &&
|
|
||||||
file_exists(PATH_HOME . 'engine/plugins/enterprise/data/triggerApplicationUpdate.sql') &&
|
|
||||||
file_exists(PATH_HOME . 'engine/plugins/enterprise/data/triggerApplicationDelete.sql') &&
|
|
||||||
file_exists(PATH_HOME . 'engine/plugins/enterprise/data/triggerContentUpdate.sql')) {
|
|
||||||
$this->mssqlQuery( @file_get_contents( PATH_HOME . 'engine/plugins/enterprise/data/triggerAppDelegationInsert.sql' ) );
|
$this->mssqlQuery( @file_get_contents( PATH_HOME . 'engine/plugins/enterprise/data/triggerAppDelegationInsert.sql' ) );
|
||||||
$this->mssqlQuery( @file_get_contents( PATH_HOME . 'engine/plugins/enterprise/data/triggerAppDelegationUpdate.sql' ) );
|
$this->mssqlQuery( @file_get_contents( PATH_HOME . 'engine/plugins/enterprise/data/triggerAppDelegationUpdate.sql' ) );
|
||||||
$this->mssqlQuery( @file_get_contents( PATH_HOME . 'engine/plugins/enterprise/data/triggerApplicationUpdate.sql' ) );
|
$this->mssqlQuery( @file_get_contents( PATH_HOME . 'engine/plugins/enterprise/data/triggerApplicationUpdate.sql' ) );
|
||||||
@@ -1010,7 +994,8 @@ class Installer extends Controller
|
|||||||
)
|
)
|
||||||
VALUES (
|
VALUES (
|
||||||
'APP_CACHE_VIEW_ENGINE',
|
'APP_CACHE_VIEW_ENGINE',
|
||||||
'" . addslashes(serialize(array('LANG' => 'en', 'STATUS' => 'active'))) . "'
|
'" . addslashes( serialize( array ('LANG' => 'en','STATUS' => 'active'
|
||||||
|
) ) ) . "'
|
||||||
)" );
|
)" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1043,8 +1028,7 @@ class Installer extends Controller
|
|||||||
$info->result = true;
|
$info->result = true;
|
||||||
$info->message = 'Succesfully';
|
$info->message = 'Succesfully';
|
||||||
$info->url = '/sys' . $_REQUEST['workspace'] . '/en/classic/main/login';
|
$info->url = '/sys' . $_REQUEST['workspace'] . '/en/classic/main/login';
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch (Exception $e) {
|
|
||||||
$info->result = false;
|
$info->result = false;
|
||||||
$info->message = $e->getMessage();
|
$info->message = $e->getMessage();
|
||||||
}
|
}
|
||||||
@@ -1061,13 +1045,15 @@ class Installer extends Controller
|
|||||||
$engine->label = 'MySQL';
|
$engine->label = 'MySQL';
|
||||||
$engines[] = $engine;
|
$engines[] = $engine;
|
||||||
}
|
}
|
||||||
/** DISABLED TEMPORARELY
|
/**
|
||||||
if (function_exists('mssql_query')) {
|
* DISABLED TEMPORARELY
|
||||||
$engine = new stdclass();
|
* if (function_exists('mssql_query')) {
|
||||||
$engine->id = 'mssql';
|
* $engine = new stdclass();
|
||||||
$engine->label = 'Microsoft SQL Server';
|
* $engine->id = 'mssql';
|
||||||
$engines[] = $engine;
|
* $engine->label = 'Microsoft SQL Server';
|
||||||
}*/
|
* $engines[] = $engine;
|
||||||
|
* }
|
||||||
|
*/
|
||||||
return $engines;
|
return $engines;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1084,8 +1070,7 @@ class Installer extends Controller
|
|||||||
$info->rbDatabaseExists = (@mysql_num_rows( $dataset ) > 0);
|
$info->rbDatabaseExists = (@mysql_num_rows( $dataset ) > 0);
|
||||||
$dataset = @mysql_query( "show databases like '" . $_REQUEST['rpDatabase'] . "'", $link );
|
$dataset = @mysql_query( "show databases like '" . $_REQUEST['rpDatabase'] . "'", $link );
|
||||||
$info->rpDatabaseExists = (@mysql_num_rows( $dataset ) > 0);
|
$info->rpDatabaseExists = (@mysql_num_rows( $dataset ) > 0);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$link = @mssql_connect( $_REQUEST['db_hostname'], $_REQUEST['db_username'], $_REQUEST['db_password'] );
|
$link = @mssql_connect( $_REQUEST['db_hostname'], $_REQUEST['db_username'], $_REQUEST['db_password'] );
|
||||||
$dataset = @mssql_query( "select * from sys.databases where name = '" . $_REQUEST['wfDatabase'] . "'", $link );
|
$dataset = @mssql_query( "select * from sys.databases where name = '" . $_REQUEST['wfDatabase'] . "'", $link );
|
||||||
$info->wfDatabaseExists = (@mssql_num_rows( $dataset ) > 0);
|
$info->wfDatabaseExists = (@mssql_num_rows( $dataset ) > 0);
|
||||||
@@ -1177,7 +1162,9 @@ class Installer extends Controller
|
|||||||
$res = @mssql_query( "EXEC sp_helpsrvrolemember 'dbcreator' ", $link );
|
$res = @mssql_query( "EXEC sp_helpsrvrolemember 'dbcreator' ", $link );
|
||||||
$row = mssql_fetch_array( $res );
|
$row = mssql_fetch_array( $res );
|
||||||
while (is_array( $row )) {
|
while (is_array( $row )) {
|
||||||
if ( $row['MemberName'] == $db_username ) $hasDbCreator = true;
|
if ($row['MemberName'] == $db_username) {
|
||||||
|
$hasDbCreator = true;
|
||||||
|
}
|
||||||
$row = mssql_fetch_array( $res );
|
$row = mssql_fetch_array( $res );
|
||||||
}
|
}
|
||||||
mssql_free_result( $res );
|
mssql_free_result( $res );
|
||||||
@@ -1185,7 +1172,9 @@ class Installer extends Controller
|
|||||||
$res = @mssql_query( "EXEC sp_helpsrvrolemember 'sysadmin' ", $link );
|
$res = @mssql_query( "EXEC sp_helpsrvrolemember 'sysadmin' ", $link );
|
||||||
$row = mssql_fetch_array( $res );
|
$row = mssql_fetch_array( $res );
|
||||||
while (is_array( $row )) {
|
while (is_array( $row )) {
|
||||||
if ( $row['MemberName'] == $db_username ) $hasSysAdmin = true;
|
if ($row['MemberName'] == $db_username) {
|
||||||
|
$hasSysAdmin = true;
|
||||||
|
}
|
||||||
$row = mssql_fetch_array( $res );
|
$row = mssql_fetch_array( $res );
|
||||||
}
|
}
|
||||||
mssql_free_result( $res );
|
mssql_free_result( $res );
|
||||||
@@ -1193,7 +1182,9 @@ class Installer extends Controller
|
|||||||
$res = @mssql_query( "EXEC sp_helpsrvrolemember 'SecurityAdmin' ", $link );
|
$res = @mssql_query( "EXEC sp_helpsrvrolemember 'SecurityAdmin' ", $link );
|
||||||
$row = mssql_fetch_array( $res );
|
$row = mssql_fetch_array( $res );
|
||||||
while (is_array( $row )) {
|
while (is_array( $row )) {
|
||||||
if ( $row['MemberName'] == $db_username ) $hasSecurityAdmin = true;
|
if ($row['MemberName'] == $db_username) {
|
||||||
|
$hasSecurityAdmin = true;
|
||||||
|
}
|
||||||
$row = mssql_fetch_array( $res );
|
$row = mssql_fetch_array( $res );
|
||||||
}
|
}
|
||||||
mssql_free_result( $res );
|
mssql_free_result( $res );
|
||||||
@@ -1208,3 +1199,4 @@ class Installer extends Controller
|
|||||||
return $info;
|
return $info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main Controller for processMaker v2.1
|
* Main Controller for processMaker v2.1
|
||||||
* @date Jul 17, 2011
|
* @date Jul 17, 2011
|
||||||
|
*
|
||||||
* @author Erik Amaru Ortiz <erik@colosa.com>
|
* @author Erik Amaru Ortiz <erik@colosa.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -26,7 +28,7 @@ class Main extends Controller
|
|||||||
{
|
{
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
$RBAC->requirePermissions( 'PM_LOGIN' );
|
$RBAC->requirePermissions( 'PM_LOGIN' );
|
||||||
$meta = new stdClass;
|
$meta = new stdClass();
|
||||||
$showSystemInfo = $RBAC->userCanAccess( 'PM_SETUP' ) == 1;
|
$showSystemInfo = $RBAC->userCanAccess( 'PM_SETUP' ) == 1;
|
||||||
|
|
||||||
// setting variables for template
|
// setting variables for template
|
||||||
@@ -50,7 +52,8 @@ class Main extends Controller
|
|||||||
$this->setVar( 'licenseNotification', $expireInLabel );
|
$this->setVar( 'licenseNotification', $expireInLabel );
|
||||||
|
|
||||||
// setting variables on javascript env.
|
// setting variables on javascript env.
|
||||||
$this->setJSVar('meta', array('menu'=>$this->getMenu()));
|
$this->setJSVar( 'meta', array ('menu' => $this->getMenu()
|
||||||
|
) );
|
||||||
|
|
||||||
$activeTab = 0;
|
$activeTab = 0;
|
||||||
if (isset( $_SESSION['_defaultUserLocation'] )) {
|
if (isset( $_SESSION['_defaultUserLocation'] )) {
|
||||||
@@ -89,10 +92,7 @@ class Main extends Controller
|
|||||||
$data = array ();
|
$data = array ();
|
||||||
|
|
||||||
foreach ($infoList as $row) {
|
foreach ($infoList as $row) {
|
||||||
$data[] = array(
|
$data[] = array ('label' => $row[0],'value' => $row[1],'section' => $row[2]
|
||||||
'label' => $row[0],
|
|
||||||
'value' => $row[1],
|
|
||||||
'section' => $row[2],
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
@@ -106,7 +106,7 @@ class Main extends Controller
|
|||||||
require_once 'classes/model/LoginLog.php';
|
require_once 'classes/model/LoginLog.php';
|
||||||
G::LoadClass( 'system' );
|
G::LoadClass( 'system' );
|
||||||
G::loadClass( 'configuration' );
|
G::loadClass( 'configuration' );
|
||||||
$this->conf = new Configurations;
|
$this->conf = new Configurations();
|
||||||
|
|
||||||
// getting posibles errors passed by GET method
|
// getting posibles errors passed by GET method
|
||||||
$this->getInUrlError();
|
$this->getInUrlError();
|
||||||
@@ -130,8 +130,7 @@ class Main extends Controller
|
|||||||
//close the session, if the current session_id was used in PM.
|
//close the session, if the current session_id was used in PM.
|
||||||
$oCriteria = new Criteria( 'workflow' );
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
$oCriteria->add( LoginLogPeer::LOG_SID, session_id() );
|
$oCriteria->add( LoginLogPeer::LOG_SID, session_id() );
|
||||||
$oCriteria->add (LoginLogPeer::USR_UID, isset ($_SESSION ['USER_LOGGED']) ?
|
$oCriteria->add( LoginLogPeer::USR_UID, isset( $_SESSION['USER_LOGGED'] ) ? $_SESSION['USER_LOGGED'] : '-' );
|
||||||
$_SESSION ['USER_LOGGED'] : '-');
|
|
||||||
$oCriteria->add( LoginLogPeer::LOG_STATUS, 'ACTIVE' );
|
$oCriteria->add( LoginLogPeer::LOG_STATUS, 'ACTIVE' );
|
||||||
$oCriteria->add( LoginLogPeer::LOG_END_DATE, null, Criteria::ISNULL );
|
$oCriteria->add( LoginLogPeer::LOG_END_DATE, null, Criteria::ISNULL );
|
||||||
$oDataset = LoginLogPeer::doSelectRS( $oCriteria );
|
$oDataset = LoginLogPeer::doSelectRS( $oCriteria );
|
||||||
@@ -177,6 +176,7 @@ class Main extends Controller
|
|||||||
}
|
}
|
||||||
//end log
|
//end log
|
||||||
|
|
||||||
|
|
||||||
//start new session
|
//start new session
|
||||||
@session_destroy();
|
@session_destroy();
|
||||||
session_start();
|
session_start();
|
||||||
@@ -232,11 +232,10 @@ class Main extends Controller
|
|||||||
$this->setJSVar( 'flagGettingStarted', ($flagGettingStarted == 0) );
|
$this->setJSVar( 'flagGettingStarted', ($flagGettingStarted == 0) );
|
||||||
|
|
||||||
G::loadClass( 'configuration' );
|
G::loadClass( 'configuration' );
|
||||||
$oConf = new Configurations;
|
$oConf = new Configurations();
|
||||||
$oConf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
|
$oConf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
|
||||||
|
|
||||||
$flagForgotPassword = isset($oConf->aConfig['login_enableForgotPassword'])?
|
$flagForgotPassword = isset( $oConf->aConfig['login_enableForgotPassword'] ) ? $oConf->aConfig['login_enableForgotPassword'] : 'off';
|
||||||
$oConf->aConfig['login_enableForgotPassword']: 'off';
|
|
||||||
|
|
||||||
$this->includeExtJSLib( 'ux/virtualkeyboard' );
|
$this->includeExtJSLib( 'ux/virtualkeyboard' );
|
||||||
$this->includeExtJS( 'main/login' );
|
$this->includeExtJS( 'main/login' );
|
||||||
@@ -244,12 +243,9 @@ class Main extends Controller
|
|||||||
|
|
||||||
$oConf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
|
$oConf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
|
||||||
|
|
||||||
$forgotPasswd = isset($oConf->aConfig['login_enableForgotPassword'])?
|
$forgotPasswd = isset( $oConf->aConfig['login_enableForgotPassword'] ) ? $oConf->aConfig['login_enableForgotPassword'] : false;
|
||||||
$oConf->aConfig['login_enableForgotPassword']: false;
|
$virtualKeyboad = isset( $oConf->aConfig['login_enableVirtualKeyboard'] ) ? $oConf->aConfig['login_enableVirtualKeyboard'] : false;
|
||||||
$virtualKeyboad = isset($oConf->aConfig['login_enableVirtualKeyboard'])?
|
$defaultLanguaje = isset( $oConf->aConfig['login_defaultLanguage'] ) ? $oConf->aConfig['login_defaultLanguage'] : 'en';
|
||||||
$oConf->aConfig['login_enableVirtualKeyboard']: false;
|
|
||||||
$defaultLanguaje = isset($oConf->aConfig['login_defaultLanguage'])?
|
|
||||||
$oConf->aConfig['login_defaultLanguage']: 'en';
|
|
||||||
|
|
||||||
$this->setJSVar( 'forgotPasswd', $forgotPasswd );
|
$this->setJSVar( 'forgotPasswd', $forgotPasswd );
|
||||||
$this->setJSVar( 'virtualKeyboad', $virtualKeyboad );
|
$this->setJSVar( 'virtualKeyboad', $virtualKeyboad );
|
||||||
@@ -304,7 +300,8 @@ class Main extends Controller
|
|||||||
$availableWorkspaceList = array ();
|
$availableWorkspaceList = array ();
|
||||||
|
|
||||||
foreach ($availableWorkspace as $ws) {
|
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' );
|
||||||
@@ -365,8 +362,7 @@ class Main extends Controller
|
|||||||
$userData = $rbacUser->getByUsername( $httpData->username );
|
$userData = $rbacUser->getByUsername( $httpData->username );
|
||||||
|
|
||||||
if (! $userData) {
|
if (! $userData) {
|
||||||
$msg = G::LoadTranslation('ID_USER') . ' <b>' . $httpData->username . '</b> '.
|
$msg = G::LoadTranslation( 'ID_USER' ) . ' <b>' . $httpData->username . '</b> ' . G::LoadTranslation( 'ID_IS_NOT_REGISTERED' );
|
||||||
G::LoadTranslation('ID_IS_NOT_REGISTERED');
|
|
||||||
throw new Exception( $msg );
|
throw new Exception( $msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,9 +407,11 @@ class Main extends Controller
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** *
|
/**
|
||||||
|
* *
|
||||||
* Private Functions *
|
* Private Functions *
|
||||||
* **/
|
* *
|
||||||
|
*/
|
||||||
private function getMenu ()
|
private function getMenu ()
|
||||||
{
|
{
|
||||||
global $G_MAIN_MENU;
|
global $G_MAIN_MENU;
|
||||||
@@ -428,8 +426,7 @@ class Main extends Controller
|
|||||||
$G_ID_MENU_SELECTED = 'BPMN';
|
$G_ID_MENU_SELECTED = 'BPMN';
|
||||||
|
|
||||||
$oMenu = new Menu();
|
$oMenu = new Menu();
|
||||||
$menus = $oMenu->generateArrayForTemplate($G_MAIN_MENU, 'SelectedMenu', 'mainMenu', $G_MENU_SELECTED,
|
$menus = $oMenu->generateArrayForTemplate( $G_MAIN_MENU, 'SelectedMenu', 'mainMenu', $G_MENU_SELECTED, $G_ID_MENU_SELECTED );
|
||||||
$G_ID_MENU_SELECTED);
|
|
||||||
|
|
||||||
foreach ($menus as $i => $menu) {
|
foreach ($menus as $i => $menu) {
|
||||||
if (strpos( $menu['target'], 'cases/main' ) !== false) {
|
if (strpos( $menu['target'], 'cases/main' ) !== false) {
|
||||||
@@ -447,8 +444,9 @@ class Main extends Controller
|
|||||||
if (strpos( $menu['target'], 'dashboard/main' ) !== false) {
|
if (strpos( $menu['target'], 'dashboard/main' ) !== false) {
|
||||||
$menus[$i]['target'] = str_replace( 'dashboard/main', 'dashboard', $menus[$i]['target'] );
|
$menus[$i]['target'] = str_replace( 'dashboard/main', 'dashboard', $menus[$i]['target'] );
|
||||||
}
|
}
|
||||||
$menus[$i]['elementclass'] = preg_replace(array('/class=/', '/"/'), array('', ''),
|
$menus[$i]['elementclass'] = preg_replace( array ('/class=/','/"/'
|
||||||
$menus[$i]['elementclass']) ;
|
), array ('',''
|
||||||
|
), $menus[$i]['elementclass'] );
|
||||||
}
|
}
|
||||||
return $menus;
|
return $menus;
|
||||||
}
|
}
|
||||||
@@ -478,8 +476,7 @@ class Main extends Controller
|
|||||||
if (($aFotoSelect = $this->memcache->get( 'aFotoSelect' )) === false) {
|
if (($aFotoSelect = $this->memcache->get( 'aFotoSelect' )) === false) {
|
||||||
G::LoadClass( 'replacementLogo' );
|
G::LoadClass( 'replacementLogo' );
|
||||||
$oLogoR = new replacementLogo();
|
$oLogoR = new replacementLogo();
|
||||||
$aFotoSelect = $oLogoR->getNameLogo((isset($_SESSION['USER_LOGGED'])) ?
|
$aFotoSelect = $oLogoR->getNameLogo( (isset( $_SESSION['USER_LOGGED'] )) ? $_SESSION['USER_LOGGED'] : '' );
|
||||||
$_SESSION['USER_LOGGED'] : '');
|
|
||||||
$this->memcache->set( 'aFotoSelect', $aFotoSelect, 1 * 3600 );
|
$this->memcache->set( 'aFotoSelect', $aFotoSelect, 1 * 3600 );
|
||||||
}
|
}
|
||||||
if (is_array( $aFotoSelect )) {
|
if (is_array( $aFotoSelect )) {
|
||||||
@@ -494,8 +491,7 @@ class Main extends Controller
|
|||||||
$sCompanyLogo = $logoPlugin;
|
$sCompanyLogo = $logoPlugin;
|
||||||
} elseif (isset( $sFotoSelect ) && $sFotoSelect != '' && ! (strcmp( $sWspaceSelect, SYS_SYS ))) {
|
} elseif (isset( $sFotoSelect ) && $sFotoSelect != '' && ! (strcmp( $sWspaceSelect, SYS_SYS ))) {
|
||||||
$sCompanyLogo = $oPluginRegistry->getCompanyLogo( $sFotoSelect );
|
$sCompanyLogo = $oPluginRegistry->getCompanyLogo( $sFotoSelect );
|
||||||
$sCompanyLogo = "/sys".SYS_SYS."/".SYS_LANG."/".SYS_SKIN."/adminProxy/showLogoFile?id=".
|
$sCompanyLogo = "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/adminProxy/showLogoFile?id=" . base64_encode( $sCompanyLogo );
|
||||||
base64_encode($sCompanyLogo);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $sCompanyLogo;
|
return $sCompanyLogo;
|
||||||
@@ -519,7 +515,8 @@ class Main extends Controller
|
|||||||
$LANG_NAME = $locale['LANGUAGE'];
|
$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 );
|
||||||
}
|
}
|
||||||
@@ -621,11 +618,7 @@ class Main extends Controller
|
|||||||
|
|
||||||
private function setFlyNotify ($type, $title, $text, $time = 5)
|
private function setFlyNotify ($type, $title, $text, $time = 5)
|
||||||
{
|
{
|
||||||
$this->flyNotify = array(
|
$this->flyNotify = array ('type' => $type,'title' => $title,'text' => $text,'time' => $time
|
||||||
'type' => $type,
|
|
||||||
'title' => $title,
|
|
||||||
'text' => $text,
|
|
||||||
'time' => $time
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$_SESSION['G_MESSAGE'] = $text;
|
$_SESSION['G_MESSAGE'] = $text;
|
||||||
@@ -741,34 +734,53 @@ class Main extends Controller
|
|||||||
|
|
||||||
$properties = array ();
|
$properties = array ();
|
||||||
$ee = class_exists( 'pmLicenseManager' ) ? " - Enterprise Edition" : '';
|
$ee = class_exists( 'pmLicenseManager' ) ? " - Enterprise Edition" : '';
|
||||||
$properties[] = array('ProcessMaker Ver.', System::getVersion() . $ee, $pmSection);
|
$properties[] = array ('ProcessMaker Ver.',System::getVersion() . $ee,$pmSection
|
||||||
$properties[] = array('Operating System', $redhat, $sysSection);
|
);
|
||||||
$properties[] = array('Time Zone', (defined('TIME_ZONE')) ? TIME_ZONE : "Unknown", $sysSection);
|
$properties[] = array ('Operating System',$redhat,$sysSection
|
||||||
$properties[] = array('Web Server', getenv ('SERVER_SOFTWARE'), $sysSection);
|
);
|
||||||
$properties[] = array('Server Name', getenv ('SERVER_NAME'), $pmSection);
|
$properties[] = array ('Time Zone',(defined( 'TIME_ZONE' )) ? TIME_ZONE : "Unknown",$sysSection
|
||||||
$properties[] = array('Server IP Address', $this->lookup ($ip), $sysSection);
|
);
|
||||||
$properties[] = array('PHP Version', phpversion(), $sysSection);
|
$properties[] = array ('Web Server',getenv( 'SERVER_SOFTWARE' ),$sysSection
|
||||||
|
);
|
||||||
|
$properties[] = array ('Server Name',getenv( 'SERVER_NAME' ),$pmSection
|
||||||
|
);
|
||||||
|
$properties[] = array ('Server IP Address',$this->lookup( $ip ),$sysSection
|
||||||
|
);
|
||||||
|
$properties[] = array ('PHP Version',phpversion(),$sysSection
|
||||||
|
);
|
||||||
|
|
||||||
if (defined( "DB_HOST" )) {
|
if (defined( "DB_HOST" )) {
|
||||||
$properties[] = array('Data Base', $dbNetView->dbName(DB_ADAPTER) . ' (Version ' . $sMySQLVersion . ')',
|
$properties[] = array ('Data Base',$dbNetView->dbName( DB_ADAPTER ) . ' (Version ' . $sMySQLVersion . ')',$pmSection
|
||||||
$pmSection);
|
);
|
||||||
$properties[] = array('Data Base Server', DB_HOST, $pmSection);
|
$properties[] = array ('Data Base Server',DB_HOST,$pmSection
|
||||||
$properties[] = array('Data Base Name', DB_NAME, $pmSection);
|
);
|
||||||
$properties[] = array('Available DB Engines', $availdb, $sysSection);
|
$properties[] = array ('Data Base Name',DB_NAME,$pmSection
|
||||||
|
);
|
||||||
|
$properties[] = array ('Available DB Engines',$availdb,$sysSection
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
$properties[] = array('Data Base', "Not defined", $pmSection);
|
$properties[] = array ('Data Base',"Not defined",$pmSection
|
||||||
$properties[] = array('Data Base Server', "Not defined", $pmSection);
|
);
|
||||||
$properties[] = array('Data Base Name', "Not defined", $pmSection);
|
$properties[] = array ('Data Base Server',"Not defined",$pmSection
|
||||||
$properties[] = array('Available DB Engines', "Not defined", $sysSection);
|
);
|
||||||
|
$properties[] = array ('Data Base Name',"Not defined",$pmSection
|
||||||
|
);
|
||||||
|
$properties[] = array ('Available DB Engines',"Not defined",$sysSection
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$properties[] = array('Workspace', defined ("SYS_SYS") ? SYS_SYS : "Not defined", $pmSection);
|
$properties[] = array ('Workspace',defined( "SYS_SYS" ) ? SYS_SYS : "Not defined",$pmSection
|
||||||
|
);
|
||||||
|
|
||||||
$properties[] = array('Server Protocol', getenv ('SERVER_PROTOCOL'), $sysSection);
|
$properties[] = array ('Server Protocol',getenv( 'SERVER_PROTOCOL' ),$sysSection
|
||||||
$properties[] = array('Server Port', getenv ('SERVER_PORT'), $sysSection);
|
);
|
||||||
|
$properties[] = array ('Server Port',getenv( 'SERVER_PORT' ),$sysSection
|
||||||
|
);
|
||||||
//$properties[] = array('Remote Host', getenv ('REMOTE_HOST'), $sysSection);
|
//$properties[] = array('Remote Host', getenv ('REMOTE_HOST'), $sysSection);
|
||||||
$properties[] = array('Server Addr.', getenv ('SERVER_ADDR'), $sysSection);
|
$properties[] = array ('Server Addr.',getenv( 'SERVER_ADDR' ),$sysSection
|
||||||
$properties[] = array('User\'s Browser', getenv ('HTTP_USER_AGENT'), $sysSection);
|
);
|
||||||
|
$properties[] = array ('User\'s Browser',getenv( 'HTTP_USER_AGENT' ),$sysSection
|
||||||
|
);
|
||||||
|
|
||||||
return $properties;
|
return $properties;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user