HOR-4408
This commit is contained in:
@@ -1,41 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* cases/ajaxListener.php Ajax Listener for Cases rpc requests
|
||||
*
|
||||
* 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;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com>
|
||||
* @date Jan 3th, 2010
|
||||
*/
|
||||
//require_once 'classes/model/Application.php';
|
||||
//require_once 'classes/model/Users.php';
|
||||
//require_once 'classes/model/AppThread.php';
|
||||
//require_once 'classes/model/AppDelay.php';
|
||||
//require_once 'classes/model/Process.php';
|
||||
//require_once 'classes/model/Task.php';
|
||||
|
||||
if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
$responseObject = new stdclass();
|
||||
$responseObject->error = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||
@@ -45,7 +11,6 @@ if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
$filter = new InputFilter();
|
||||
$_REQUEST = $filter->xssFilterHard($_REQUEST);
|
||||
$_POST = $filter->xssFilterHard($_POST);
|
||||
@@ -68,9 +33,9 @@ if(isset($_REQUEST['action']) && $_REQUEST['action'] == "verifySession" ) {
|
||||
} elseif ($RBAC->userCanAccess('PM_REASSIGNCASE_SUPERVISOR') == 1) {
|
||||
$response->reassigncase = false;
|
||||
$response->message = G::LoadTranslation('ID_NOT_ABLE_REASSIGN');
|
||||
$oAppCache = new AppCacheView();
|
||||
$aProcesses = $oAppCache->getProUidSupervisor($_SESSION['USER_LOGGED']);
|
||||
if(in_array($_SESSION['PROCESS'], $aProcesses)){
|
||||
$processUser = new ProcessUser();
|
||||
$listProcess = $processUser->getProUidSupervisor($_SESSION['USER_LOGGED']);
|
||||
if (in_array($_SESSION['PROCESS'], $listProcess)) {
|
||||
$response->reassigncase = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ if ($sStatus == '1') {
|
||||
|
||||
$oAdditionalTables->createPropelClasses($tableName, $sClassName, $aFieldsClases, $sTasUid);
|
||||
} else {
|
||||
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
@unlink($sPath . $sClassName . '.php');
|
||||
@unlink($sPath . $sClassName . 'Peer.php');
|
||||
@unlink($sPath . PATH_SEP . 'map' . PATH_SEP . $sClassName . 'MapBuilder.php');
|
||||
|
||||
@@ -1,148 +1,115 @@
|
||||
<?php
|
||||
/**
|
||||
* processes_List.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 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.
|
||||
*/
|
||||
|
||||
$actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
|
||||
use ProcessMaker\Util\DateTime;
|
||||
|
||||
if ($actionAjax == 'historyGridList_JXP') {
|
||||
$actionAjax = isset($_REQUEST['actionAjax']) ? $_REQUEST['actionAjax'] : null;
|
||||
|
||||
global $G_PUBLISH;
|
||||
$criteria = Cases::getTransferHistoryCriteria($_SESSION['APPLICATION']);
|
||||
switch ($actionAjax) {
|
||||
case 'historyGridList_JXP':
|
||||
global $G_PUBLISH;
|
||||
$criteria = Cases::getTransferHistoryCriteria($_SESSION['APPLICATION']);
|
||||
|
||||
$rs = GulliverBasePeer::doSelectRs($criteria);
|
||||
$totalCount = $rs->getRecordCount();
|
||||
$dataSet = GulliverBasePeer::doSelectRs($criteria);
|
||||
$totalCount = $dataSet->getRecordCount();
|
||||
|
||||
$start = $_REQUEST["start"];
|
||||
$limit = $_REQUEST["limit"];
|
||||
$start = $_REQUEST['start'];
|
||||
$limit = $_REQUEST['limit'];
|
||||
|
||||
$criteria->setLimit($limit);
|
||||
$criteria->setOffset($start);
|
||||
$criteria->setLimit($limit);
|
||||
$criteria->setOffset($start);
|
||||
|
||||
$rs = GulliverBasePeer::doSelectRs($criteria);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$result = new stdClass();
|
||||
$aProcesses = Array();
|
||||
while ($rs->next()) {
|
||||
$result = $rs->getRow();
|
||||
$result["ID_HISTORY"] = $result["PRO_UID"] . '_' . $result["APP_UID"] . '_' . $result["TAS_UID"];
|
||||
$aProcesses[] = $result;
|
||||
}
|
||||
$dataSet = GulliverBasePeer::doSelectRs($criteria);
|
||||
$dataSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$result = new stdClass();
|
||||
$process = [];
|
||||
while ($dataSet->next()) {
|
||||
$result = $dataSet->getRow();
|
||||
$result['ID_HISTORY'] = $result['PRO_UID'] . '_' . $result['APP_UID'] . '_' . $result['TAS_UID'];
|
||||
$process[] = $result;
|
||||
}
|
||||
|
||||
$newDir = '/tmp/test/directory';
|
||||
G::verifyPath($newDir);
|
||||
$r = new stdclass();
|
||||
$r->data = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($aProcesses);
|
||||
$r->totalCount = $totalCount;
|
||||
$response = new stdclass();
|
||||
$response->data = DateTime::convertUtcToTimeZone($process);
|
||||
$response->totalCount = $totalCount;
|
||||
|
||||
echo G::json_encode($r);
|
||||
echo G::json_encode($response);
|
||||
break;
|
||||
case '':
|
||||
//!dataInput
|
||||
$idHistory = $_REQUEST['idHistory'];
|
||||
|
||||
//!dataSytem
|
||||
$idHistoryArray = explode('*', $idHistory);
|
||||
$_REQUEST['PRO_UID'] = $idHistoryArray[0];
|
||||
$_REQUEST['APP_UID'] = $idHistoryArray[1];
|
||||
$_REQUEST['TAS_UID'] = $idHistoryArray[2];
|
||||
$_REQUEST['DYN_UID'] = '';
|
||||
|
||||
?>
|
||||
|
||||
<table bgcolor="white" height=100% width=100%>
|
||||
<tr>
|
||||
<td height=99%>
|
||||
<div style="width: 100%; overflow-y: scroll; overflow-x: hidden; max-height: 310px; _height: 310px; height: 310px; visibility: inherit;">
|
||||
<?php
|
||||
require_once 'classes/model/AppHistory.php';
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('view', 'cases/cases_DynaformHistory');
|
||||
G::RenderPage('publish', 'raw');
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height=30 valign=top>
|
||||
|
||||
<table align=center cellspacing="0" class="x-btn x-btn-noicon"
|
||||
id="ext-comp-1043" style="width: 75px; margin-top: 0px;">
|
||||
<tbody class="x-btn-small x-btn-icon-small-left">
|
||||
<tr>
|
||||
<td class="x-btn-tl"><i> </i></td>
|
||||
<td class="x-btn-tc"></td>
|
||||
<td class="x-btn-tr"><i> </i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="x-btn-ml"><i> </i></td>
|
||||
<td class="x-btn-mc"><em unselectable="on" class="">
|
||||
<button type="button" id="ext-gen105" class=" x-btn-text">OK</button>
|
||||
</em></td>
|
||||
<td class="x-btn-mr"><i> </i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="x-btn-bl"><i> </i></td>
|
||||
<td class="x-btn-bc"></td>
|
||||
<td class="x-btn-br"><i> </i></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
break;
|
||||
case 'showDynaformHistoryGetNomDynaform_JXP':
|
||||
//!dataInput
|
||||
$idDin = $_REQUEST['idDin'];
|
||||
$dynDate = $_REQUEST["dynDate"];
|
||||
|
||||
//!dataOuput
|
||||
|
||||
$dynaform = new Dynaform();
|
||||
$row = $dynaform->Load($idDin);
|
||||
|
||||
$title = '';
|
||||
if ($row) {
|
||||
$title = $row['DYN_TITLE'];
|
||||
}
|
||||
|
||||
//assign task
|
||||
$result = new stdClass();
|
||||
$result->dynTitle = $title;
|
||||
$result->md5Hash = G::encryptOld($idDin . $dynDate);
|
||||
|
||||
echo G::json_encode($result);
|
||||
break;
|
||||
}
|
||||
|
||||
if ($actionAjax == 'historyGridListChangeLogPanelBody_JXP') {
|
||||
//!dataInput
|
||||
$idHistory = $_REQUEST["idHistory"];
|
||||
//!dataInput
|
||||
|
||||
|
||||
//!dataSytem
|
||||
$idHistoryArray = explode( "*", $idHistory );
|
||||
$_REQUEST["PRO_UID"] = $idHistoryArray[0];
|
||||
$_REQUEST["APP_UID"] = $idHistoryArray[1];
|
||||
$_REQUEST["TAS_UID"] = $idHistoryArray[2];
|
||||
$_REQUEST["DYN_UID"] = "";
|
||||
|
||||
?>
|
||||
|
||||
<table bgcolor="white" height=100% width=100%>
|
||||
<tr>
|
||||
<td height=99%>
|
||||
<div
|
||||
style="width: 100%; overflow-y: scroll; overflow-x: hidden; max-height: 310px; _height: 310px; height: 310px; visibility: inherit;">
|
||||
<?php
|
||||
require_once 'classes/model/AppHistory.php';
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/cases_DynaformHistory' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height=30 valign=top>
|
||||
|
||||
<table align=center cellspacing="0" class="x-btn x-btn-noicon"
|
||||
id="ext-comp-1043" style="width: 75px; margin-top: 0px;">
|
||||
<tbody class="x-btn-small x-btn-icon-small-left">
|
||||
<tr>
|
||||
<td class="x-btn-tl"><i> </i></td>
|
||||
<td class="x-btn-tc"></td>
|
||||
<td class="x-btn-tr"><i> </i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="x-btn-ml"><i> </i></td>
|
||||
<td class="x-btn-mc"><em unselectable="on" class="">
|
||||
<button type="button" id="ext-gen105" class=" x-btn-text">OK</button>
|
||||
</em></td>
|
||||
<td class="x-btn-mr"><i> </i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="x-btn-bl"><i> </i></td>
|
||||
<td class="x-btn-bc"></td>
|
||||
<td class="x-btn-br"><i> </i></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
if ($actionAjax == "showDynaformHistoryGetNomDynaform_JXP") {
|
||||
|
||||
//!dataInput
|
||||
$idDin = $_REQUEST['idDin'];
|
||||
$dynDate = $_REQUEST["dynDate"];
|
||||
|
||||
//!dataOuput
|
||||
$md5Hash = "";
|
||||
$dynTitle = '';
|
||||
|
||||
$dynaform = new Dynaform();
|
||||
$row = $dynaform->Load($idDin);
|
||||
|
||||
if ($row) {
|
||||
$dynTitle = $row['DYN_TITLE'];
|
||||
}
|
||||
|
||||
$md5Hash = G::encryptOld( $idDin . $dynDate );
|
||||
|
||||
//assign task
|
||||
$result = new stdClass();
|
||||
$result->dynTitle = $dynTitle;
|
||||
$result->md5Hash = $md5Hash;
|
||||
|
||||
echo G::json_encode( $result );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,26 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* processes_List.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 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.
|
||||
*/
|
||||
|
||||
use ProcessMaker\Core\System;
|
||||
|
||||
@@ -28,187 +6,188 @@ $filter = new InputFilter();
|
||||
$_POST = $filter->xssFilterHard($_POST);
|
||||
$_REQUEST = $filter->xssFilterHard($_REQUEST);
|
||||
|
||||
$arrayToTranslation = array(
|
||||
"TRIGGER" => G::LoadTranslation("ID_TRIGGER_DB"),
|
||||
"DERIVATION" => G::LoadTranslation("ID_DERIVATION_DB")
|
||||
);
|
||||
$arrayToTranslation = [
|
||||
'TRIGGER' => G::LoadTranslation('ID_TRIGGER_DB'),
|
||||
'DERIVATION' => G::LoadTranslation('ID_DERIVATION_DB')
|
||||
];
|
||||
|
||||
$actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
|
||||
$actionAjax = isset($_REQUEST['actionAjax']) ? $_REQUEST['actionAjax'] : null;
|
||||
|
||||
if ($actionAjax == 'messageHistoryGridList_JXP') {
|
||||
|
||||
if (!isset($_REQUEST['start']) || $_REQUEST['start'] =='') {
|
||||
$_REQUEST['start'] = 0;
|
||||
}
|
||||
|
||||
if (!isset($_REQUEST['limit']) || $_REQUEST['limit'] =='') {
|
||||
$_REQUEST['limit'] = 20;
|
||||
}
|
||||
|
||||
$dir = isset( $_POST['dir'] ) ? $_POST['dir'] : 'ASC';
|
||||
$sort = isset( $_POST['sort'] ) ? $_POST['sort'] : '';
|
||||
|
||||
global $G_PUBLISH;
|
||||
$oCase = new Cases();
|
||||
$oCase->dir = $dir;
|
||||
$oCase->sort = $sort;
|
||||
|
||||
$appMessageArray = $oCase->getHistoryMessagesTrackerExt( $_SESSION['APPLICATION'], true, $_REQUEST['start'], $_REQUEST['limit']);
|
||||
$appMessageCountArray = $oCase->getHistoryMessagesTrackerExt( $_SESSION['APPLICATION'], true);
|
||||
$result = new stdClass();
|
||||
$aProcesses = Array ();
|
||||
|
||||
|
||||
$proUid = $_SESSION['PROCESS'];
|
||||
$appUid = $_SESSION['APPLICATION'];
|
||||
$tasUid = $_SESSION['TASK'];
|
||||
$usrUid = $_SESSION['USER_LOGGED'];
|
||||
|
||||
$respBlock = $oCase->getAllObjectsFrom( $proUid, $appUid, $tasUid, $usrUid, 'BLOCK' );
|
||||
$respView = $oCase->getAllObjectsFrom( $proUid, $appUid, $tasUid, $usrUid, 'VIEW' );
|
||||
$respResend = $oCase->getAllObjectsFrom( $proUid, $appUid, $tasUid, $usrUid, 'RESEND' );
|
||||
|
||||
$delIndex = array();
|
||||
$respMess = "";
|
||||
|
||||
if (count($respBlock["MSGS_HISTORY"]) > 0) {
|
||||
$respMess = $respBlock["MSGS_HISTORY"]["PERMISSION"];
|
||||
if (isset($respBlock["MSGS_HISTORY"]["DEL_INDEX"])) {
|
||||
$delIndex = $respBlock["MSGS_HISTORY"]["DEL_INDEX"];
|
||||
switch ($actionAjax) {
|
||||
case 'messageHistoryGridList_JXP':
|
||||
if (!isset($_REQUEST['start']) || $_REQUEST['start'] == '') {
|
||||
$_REQUEST['start'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (count($respView["MSGS_HISTORY"]) > 0) {
|
||||
$respMess = $respView["MSGS_HISTORY"]["PERMISSION"];
|
||||
if (isset($respView["MSGS_HISTORY"]["DEL_INDEX"])) {
|
||||
$delIndex = $respView["MSGS_HISTORY"]["DEL_INDEX"];
|
||||
if (!isset($_REQUEST['limit']) || $_REQUEST['limit'] == '') {
|
||||
$_REQUEST['limit'] = 20;
|
||||
}
|
||||
}
|
||||
|
||||
if (count($respResend["MSGS_HISTORY"]) > 0) {
|
||||
$respMess = $respResend["MSGS_HISTORY"]["PERMISSION"];
|
||||
if (isset($respResend["MSGS_HISTORY"]["DEL_INDEX"])) {
|
||||
$delIndex = $respResend["MSGS_HISTORY"]["DEL_INDEX"];
|
||||
}
|
||||
}
|
||||
$dir = isset($_POST['dir']) ? $_POST['dir'] : 'ASC';
|
||||
$sort = isset($_POST['sort']) ? $_POST['sort'] : '';
|
||||
|
||||
$totalCount = 0;
|
||||
foreach ($appMessageArray as $index => $value) {
|
||||
if (($appMessageArray[$index]['APP_MSG_SHOW_MESSAGE'] == 1 && $respMess != 'BLOCK' ) &&
|
||||
($appMessageArray[$index]['DEL_INDEX'] == 0 || in_array($appMessageArray[$index]['DEL_INDEX'], $delIndex ))) {
|
||||
global $G_PUBLISH;
|
||||
$case = new Cases();
|
||||
$case->dir = $dir;
|
||||
$case->sort = $sort;
|
||||
|
||||
$appMessageArray[$index]['ID_MESSAGE'] = $appMessageArray[$index]['APP_UID'] . '_' . $appMessageArray[$index]['APP_MSG_UID'];
|
||||
if ($respMess == 'BLOCK' || $respMess == '') {
|
||||
$appMessageArray[$index]['APP_MSG_BODY'] = "";
|
||||
$appMessageArray = $case->getHistoryMessagesTrackerExt($_SESSION['APPLICATION'], true, $_REQUEST['start'], $_REQUEST['limit']);
|
||||
$appMessageCountArray = $case->getHistoryMessagesTrackerExt($_SESSION['APPLICATION'], true);
|
||||
$result = new stdClass();
|
||||
$process = [];
|
||||
|
||||
|
||||
$proUid = $_SESSION['PROCESS'];
|
||||
$appUid = $_SESSION['APPLICATION'];
|
||||
$tasUid = $_SESSION['TASK'];
|
||||
$usrUid = $_SESSION['USER_LOGGED'];
|
||||
|
||||
$respBlock = $case->getAllObjectsFrom($proUid, $appUid, $tasUid, $usrUid, 'BLOCK');
|
||||
$respView = $case->getAllObjectsFrom($proUid, $appUid, $tasUid, $usrUid, 'VIEW');
|
||||
$respResend = $case->getAllObjectsFrom($proUid, $appUid, $tasUid, $usrUid, 'RESEND');
|
||||
|
||||
$delIndex = [];
|
||||
$respMess = '';
|
||||
|
||||
if (count($respBlock['MSGS_HISTORY']) > 0) {
|
||||
$respMess = $respBlock['MSGS_HISTORY']['PERMISSION'];
|
||||
if (isset($respBlock['MSGS_HISTORY']['DEL_INDEX'])) {
|
||||
$delIndex = $respBlock['MSGS_HISTORY']['DEL_INDEX'];
|
||||
}
|
||||
$appMessageArray[$index]['APP_MSG_BODY'] = str_replace('\"','"',$appMessageArray[$index]['APP_MSG_BODY']);
|
||||
$appMessageArray[$index]['APP_MSG_BODY'] = str_replace('"','\"',$appMessageArray[$index]['APP_MSG_BODY']);
|
||||
$aProcesses[] = array_merge($appMessageArray[$index], array('MSGS_HISTORY' => $respMess));
|
||||
$totalCount ++;
|
||||
}
|
||||
}
|
||||
|
||||
$aProcesses = array_splice($aProcesses, $_REQUEST['start'], $_REQUEST['limit']);
|
||||
|
||||
$newDir = '/tmp/test/directory';
|
||||
G::verifyPath( $newDir );
|
||||
$r = new stdclass();
|
||||
$r->data = $aProcesses;
|
||||
$r->totalCount = $totalCount;
|
||||
|
||||
if (!empty($aProcesses)) {
|
||||
if (!isset($r->data[0])) {
|
||||
$r->data[0] = array('APP_MSG_TYPE' => '');
|
||||
}
|
||||
|
||||
foreach ($r->data as $key => $value) {
|
||||
$r->data[$key]["APP_MSG_TYPE"] = array_key_exists($r->data[$key]["APP_MSG_TYPE"], $arrayToTranslation) ?
|
||||
$arrayToTranslation[$r->data[$key]["APP_MSG_TYPE"]] :
|
||||
$r->data[$key]["APP_MSG_TYPE"];
|
||||
if (count($respView['MSGS_HISTORY']) > 0) {
|
||||
$respMess = $respView['MSGS_HISTORY']['PERMISSION'];
|
||||
if (isset($respView['MSGS_HISTORY']['DEL_INDEX'])) {
|
||||
$delIndex = $respView['MSGS_HISTORY']['DEL_INDEX'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo G::json_encode( $r );
|
||||
}
|
||||
if ($actionAjax == 'showHistoryMessage') {
|
||||
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="/css/classic.css" />
|
||||
<style type="text/css">
|
||||
html {
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
body {
|
||||
color: black !important;
|
||||
}
|
||||
</style>
|
||||
<script language="Javascript">
|
||||
//!Code that simulated reload library javascript maborak
|
||||
var leimnud = {};
|
||||
leimnud.exec = "";
|
||||
leimnud.fix = {};
|
||||
leimnud.fix.memoryLeak = "";
|
||||
leimnud.browser = {};
|
||||
leimnud.browser.isIphone = "";
|
||||
leimnud.iphone = {};
|
||||
leimnud.iphone.make = function(){};
|
||||
function ajax_function(ajax_server, funcion, parameters, method){
|
||||
if (count($respResend['MSGS_HISTORY']) > 0) {
|
||||
$respMess = $respResend['MSGS_HISTORY']['PERMISSION'];
|
||||
if (isset($respResend['MSGS_HISTORY']['DEL_INDEX'])) {
|
||||
$delIndex = $respResend['MSGS_HISTORY']['DEL_INDEX'];
|
||||
}
|
||||
}
|
||||
//!
|
||||
</script>
|
||||
<?php
|
||||
|
||||
$oCase = new Cases();
|
||||
$totalCount = 0;
|
||||
foreach ($appMessageArray as $index => $value) {
|
||||
if (($appMessageArray[$index]['APP_MSG_SHOW_MESSAGE'] == 1 && $respMess != 'BLOCK') &&
|
||||
($appMessageArray[$index]['DEL_INDEX'] == 0 || in_array($appMessageArray[$index]['DEL_INDEX'], $delIndex))) {
|
||||
$appMessageArray[$index]['ID_MESSAGE'] = $appMessageArray[$index]['APP_UID'] . '_' . $appMessageArray[$index]['APP_MSG_UID'];
|
||||
if ($respMess == 'BLOCK' || $respMess == '') {
|
||||
$appMessageArray[$index]['APP_MSG_BODY'] = '';
|
||||
}
|
||||
$process[] = array_merge($appMessageArray[$index], ['MSGS_HISTORY' => $respMess]);
|
||||
$totalCount++;
|
||||
}
|
||||
}
|
||||
|
||||
$_POST["APP_UID"] = $_REQUEST["APP_UID"];
|
||||
$_POST['APP_MSG_UID'] = $_REQUEST["APP_MSG_UID"];
|
||||
$process = array_splice($process, $_REQUEST['start'], $_REQUEST['limit']);
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$oCase = new Cases();
|
||||
$response = new stdclass();
|
||||
$response->data = $process;
|
||||
$response->totalCount = $totalCount;
|
||||
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_MessagesView', '', $oCase->getHistoryMessagesTrackerView( $_POST['APP_UID'], $_POST['APP_MSG_UID'] ) );
|
||||
if (!empty($process)) {
|
||||
if (!isset($response->data[0])) {
|
||||
$response->data[0] = array('APP_MSG_TYPE' => '');
|
||||
}
|
||||
|
||||
?>
|
||||
<script language="javascript">
|
||||
<?php
|
||||
global $G_FORM;
|
||||
?>
|
||||
function loadForm_<?php echo $G_FORM->id;?>(parametro1){
|
||||
}
|
||||
foreach ($response->data as $key => $value) {
|
||||
$response->data[$key]['APP_MSG_TYPE'] = array_key_exists($response->data[$key]['APP_MSG_TYPE'], $arrayToTranslation) ?
|
||||
$arrayToTranslation[$response->data[$key]['APP_MSG_TYPE']] :
|
||||
$response->data[$key]['APP_MSG_TYPE'];
|
||||
}
|
||||
}
|
||||
|
||||
echo G::json_encode($response);
|
||||
break;
|
||||
case 'showHistoryMessage':
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="/css/classic.css"/>
|
||||
<style type="text/css">
|
||||
html {
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
body {
|
||||
color: black !important;
|
||||
}
|
||||
</style>
|
||||
<script language="Javascript">
|
||||
//!Code that simulated reload library javascript maborak
|
||||
var leimnud = {};
|
||||
leimnud.exec = "";
|
||||
leimnud.fix = {};
|
||||
leimnud.fix.memoryLeak = "";
|
||||
leimnud.browser = {};
|
||||
leimnud.browser.isIphone = "";
|
||||
leimnud.iphone = {};
|
||||
leimnud.iphone.make = function () {
|
||||
};
|
||||
|
||||
function ajax_function(ajax_server, funcion, parameters, method) {
|
||||
}
|
||||
|
||||
//!
|
||||
</script>
|
||||
<?php
|
||||
<?php
|
||||
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
}
|
||||
$case = new Cases();
|
||||
|
||||
if ($actionAjax == 'sendMailMessage_JXP') {
|
||||
//!dataSystem
|
||||
$errorMessage = "";
|
||||
try {
|
||||
//!dataInput
|
||||
$_POST['APP_UID'] = $_REQUEST['APP_UID'];
|
||||
$_POST['APP_MSG_UID'] = $_REQUEST['APP_MSG_UID'];
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$case = new Cases();
|
||||
|
||||
$oCase = new Cases();
|
||||
$data = $oCase->getHistoryMessagesTrackerView( $_POST['APP_UID'], $_POST['APP_MSG_UID'] );
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_MessagesView', '', $case->getHistoryMessagesTrackerView($_POST['APP_UID'], $_POST['APP_MSG_UID']));
|
||||
?>
|
||||
<script language="javascript">
|
||||
<?php
|
||||
global $G_FORM; ?>
|
||||
function loadForm_ <?php echo $G_FORM->id; ?>(parameter) {
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
|
||||
$aSetup = System::getEmailConfiguration();
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
case 'sendMailMessage_JXP':
|
||||
//!dataSystem
|
||||
$message = '';
|
||||
try {
|
||||
//!dataInput
|
||||
$_POST['APP_UID'] = $_REQUEST['APP_UID'];
|
||||
$_POST['APP_MSG_UID'] = $_REQUEST['APP_MSG_UID'];
|
||||
|
||||
$oSpool = new SpoolRun();
|
||||
$case = new Cases();
|
||||
$data = $case->getHistoryMessagesTrackerView($_POST['APP_UID'], $_POST['APP_MSG_UID']);
|
||||
|
||||
$oSpool->setConfig($aSetup);
|
||||
$oSpool->create( array ('msg_uid' => $data['MSG_UID'],'app_uid' => $data['APP_UID'],'del_index' => $data['DEL_INDEX'],'app_msg_type' => $data['APP_MSG_TYPE'],'app_msg_subject' => $data['APP_MSG_SUBJECT'],'app_msg_from' => $data['APP_MSG_FROM'],'app_msg_to' => $data['APP_MSG_TO'],'app_msg_body' => $data['APP_MSG_BODY'],'app_msg_cc' => $data['APP_MSG_CC'],'app_msg_bcc' => $data['APP_MSG_BCC'],'app_msg_attach' => $data['APP_MSG_ATTACH'],'app_msg_template' => $data['APP_MSG_TEMPLATE'],'app_msg_status' => 'pending'
|
||||
) );
|
||||
$oSpool->sendMail();
|
||||
$spool = new SpoolRun();
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
$errorMessage = $e->getMessage();
|
||||
}
|
||||
|
||||
echo $errorMessage;
|
||||
$spool->setConfig(System::getEmailConfiguration());
|
||||
$spool->create([
|
||||
'msg_uid' => $data['MSG_UID'],
|
||||
'app_uid' => $data['APP_UID'],
|
||||
'del_index' => $data['DEL_INDEX'],
|
||||
'app_msg_type' => $data['APP_MSG_TYPE'],
|
||||
'app_msg_subject' => $data['APP_MSG_SUBJECT'],
|
||||
'app_msg_from' => $data['APP_MSG_FROM'],
|
||||
'app_msg_to' => $data['APP_MSG_TO'],
|
||||
'app_msg_body' => $data['APP_MSG_BODY'],
|
||||
'app_msg_cc' => $data['APP_MSG_CC'],
|
||||
'app_msg_bcc' => $data['APP_MSG_BCC'],
|
||||
'app_msg_attach' => $data['APP_MSG_ATTACH'],
|
||||
'app_msg_template' => $data['APP_MSG_TEMPLATE'],
|
||||
'app_msg_status' => 'pending'
|
||||
]);
|
||||
$spool->sendMail();
|
||||
} catch (Exception $error) {
|
||||
$message = $error->getMessage();
|
||||
}
|
||||
|
||||
echo $message;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ while ($rsSql->next()) {
|
||||
}
|
||||
|
||||
if (count($arrayTabItem) > 0) {
|
||||
$urlProxy = System::getHttpServerHostnameRequestsFrontEnd() . '/api/1.0/' . SYS_SYS . '/consolidated/';
|
||||
$urlProxy = System::getHttpServerHostnameRequestsFrontEnd() . '/api/1.0/' . config("system.workspace") . '/consolidated/';
|
||||
$clientId = 'x-pm-local-client';
|
||||
$client = getClientCredentials($clientId);
|
||||
$authCode = getAuthorizationCode($client);
|
||||
|
||||
@@ -176,9 +176,9 @@ if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjB
|
||||
if (isset($_COOKIE['dashboardListInbox'])) {
|
||||
$oHeadPublisher->assign('valueFilterStatus', $_COOKIE['dashboardListInbox']);
|
||||
if (PHP_VERSION < 5.2) {
|
||||
setcookie("dashboardListInbox", '', time() + (24 * 60 * 60), "/sys" . SYS_SYS, "; HttpOnly");
|
||||
setcookie("dashboardListInbox", '', time() + (24 * 60 * 60), "/sys" . config("system.workspace"), "; HttpOnly");
|
||||
} else {
|
||||
setcookie("dashboardListInbox", '', time() + (24 * 60 * 60), "/sys" . SYS_SYS, null, false, true);
|
||||
setcookie("dashboardListInbox", '', time() + (24 * 60 * 60), "/sys" . config("system.workspace"), null, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,28 +6,6 @@ if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
print G::json_encode($response);
|
||||
die();
|
||||
}
|
||||
/**
|
||||
* casesList_Ajax.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 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.
|
||||
*/
|
||||
|
||||
$actionAjax = isset($_REQUEST['actionAjax']) ? $_REQUEST['actionAjax'] : null;
|
||||
|
||||
@@ -39,13 +17,14 @@ function filterUserListArray($users = array(), $filter = '')
|
||||
$filteredUsers[] = $user;
|
||||
}
|
||||
}
|
||||
|
||||
return $filteredUsers;
|
||||
}
|
||||
|
||||
//Load the suggest list of users
|
||||
if ($actionAjax == "userValues") {
|
||||
$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : null;
|
||||
$query = isset( $_REQUEST['query'] ) ? $_REQUEST['query'] : null;
|
||||
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
|
||||
$query = isset($_REQUEST['query']) ? $_REQUEST['query'] : null;
|
||||
|
||||
$conf = new Configurations();
|
||||
$confEnvSetting = $conf->getFormats();
|
||||
@@ -69,8 +48,8 @@ if ($actionAjax == "userValues") {
|
||||
if (!is_null($query)) {
|
||||
$filters = $cUsers->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $query . '%', Criteria::LIKE)->addOr(
|
||||
$cUsers->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $query . '%', Criteria::LIKE)->addOr(
|
||||
$cUsers->getNewCriterion(UsersPeer::USR_USERNAME, '%' . $query . '%', Criteria::LIKE)));
|
||||
$cUsers->addOr($filters);
|
||||
$cUsers->getNewCriterion(UsersPeer::USR_USERNAME, '%' . $query . '%', Criteria::LIKE)));
|
||||
$cUsers->addOr($filters);
|
||||
}
|
||||
$cUsers->setLimit(20);
|
||||
$cUsers->addAscendingOrderByColumn(UsersPeer::TABLE_NAME . "." . $conf->userNameFormatGetFirstFieldByUsersTable());
|
||||
@@ -79,7 +58,8 @@ if ($actionAjax == "userValues") {
|
||||
|
||||
while ($oDataset->next()) {
|
||||
$row = $oDataset->getRow();
|
||||
$usrFullName = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $row["USR_USERNAME"], $row["USR_FIRSTNAME"], $row["USR_LASTNAME"]);
|
||||
$usrFullName = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $row["USR_USERNAME"],
|
||||
$row["USR_FIRSTNAME"], $row["USR_LASTNAME"]);
|
||||
if ($action === 'search') {
|
||||
//Only for the advanced search we used the USR_ID column
|
||||
$users[] = array("USR_UID" => $row["USR_ID"], "USR_FULLNAME" => $usrFullName);
|
||||
@@ -87,6 +67,7 @@ if ($actionAjax == "userValues") {
|
||||
$users[] = array("USR_UID" => $row["USR_UID"], "USR_FULLNAME" => $usrFullName);
|
||||
}
|
||||
}
|
||||
|
||||
return print G::json_encode($users);
|
||||
}
|
||||
|
||||
@@ -126,18 +107,18 @@ if ($actionAjax == "processListExtJs") {
|
||||
$cProcess->addAnd($filters);
|
||||
}
|
||||
|
||||
if ($action==='to_revise') {
|
||||
$oAppCache = new AppCacheView();
|
||||
$aProcesses = $oAppCache->getProUidSupervisor($_SESSION['USER_LOGGED']);
|
||||
$cProcess->add(ProcessPeer::PRO_UID, $aProcesses, Criteria::IN);
|
||||
if ($action === 'to_revise') {
|
||||
$processUser = new ProcessUser();
|
||||
$listProcess = $processUser->getProUidSupervisor($_SESSION['USER_LOGGED']);
|
||||
$cProcess->add(ProcessPeer::PRO_UID, $listProcess, Criteria::IN);
|
||||
}
|
||||
|
||||
if ($action==='to_reassign') {
|
||||
if ($action === 'to_reassign') {
|
||||
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) {
|
||||
} elseif ($RBAC->userCanAccess('PM_REASSIGNCASE_SUPERVISOR') == 1) {
|
||||
$oAppCache = new AppCacheView();
|
||||
$aProcesses = $oAppCache->getProUidSupervisor($_SESSION['USER_LOGGED']);
|
||||
$cProcess->add(ProcessPeer::PRO_UID, $aProcesses, Criteria::IN);
|
||||
$processUser = new ProcessUser();
|
||||
$listProcess = $processUser->getProUidSupervisor($_SESSION['USER_LOGGED']);
|
||||
$cProcess->add(ProcessPeer::PRO_UID, $listProcess, Criteria::IN);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,6 +134,7 @@ if ($actionAjax == "processListExtJs") {
|
||||
}
|
||||
$processes[] = $aRow;
|
||||
}
|
||||
|
||||
return print G::json_encode($processes);
|
||||
}
|
||||
|
||||
@@ -161,7 +143,7 @@ if ($actionAjax == "verifySession") {
|
||||
$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();
|
||||
@@ -174,32 +156,33 @@ if ($actionAjax == "verifySession") {
|
||||
} elseif ($RBAC->userCanAccess('PM_REASSIGNCASE_SUPERVISOR') == 1) {
|
||||
$response->reassigncase = true;
|
||||
$response->message = G::LoadTranslation('ID_NOT_ABLE_REASSIGN');
|
||||
$oAppCache = new AppCacheView();
|
||||
$aProcesses = $oAppCache->getProUidSupervisor($_SESSION['USER_LOGGED']);
|
||||
$response->processeslist = G::json_encode( $aProcesses );
|
||||
$processUser = new ProcessUser();
|
||||
$listProcess = $processUser->getProUidSupervisor($_SESSION['USER_LOGGED']);
|
||||
$response->processeslist = G::json_encode($listProcess);
|
||||
}
|
||||
|
||||
print G::json_encode( $response );
|
||||
print G::json_encode($response);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
if ($actionAjax == "getUsersToReassign") {
|
||||
$taskUid = $_POST['taskUid'];
|
||||
$search = $_POST['search'];
|
||||
$taskUid = $_POST['taskUid'];
|
||||
$search = $_POST['search'];
|
||||
$pageSize = $_POST['pageSize'];
|
||||
|
||||
$sortField = (isset($_POST['sort']))? $_POST['sort'] : '';
|
||||
$sortDir = (isset($_POST['dir']))? $_POST['dir'] : '';
|
||||
$start = (isset($_POST['start']))? $_POST['start'] : 0;
|
||||
$limit = (isset($_POST['limit']))? $_POST['limit'] : $pageSize;
|
||||
$sortField = (isset($_POST['sort'])) ? $_POST['sort'] : '';
|
||||
$sortDir = (isset($_POST['dir'])) ? $_POST['dir'] : '';
|
||||
$start = (isset($_POST['start'])) ? $_POST['start'] : 0;
|
||||
$limit = (isset($_POST['limit'])) ? $_POST['limit'] : $pageSize;
|
||||
|
||||
$response = [];
|
||||
|
||||
try {
|
||||
$case = new \ProcessMaker\BusinessModel\Cases();
|
||||
|
||||
$result = $case->getUsersToReassign($_SESSION['USER_LOGGED'], $taskUid, ['filter' => $search], $sortField, $sortDir, $start, $limit);
|
||||
$result = $case->getUsersToReassign($_SESSION['USER_LOGGED'], $taskUid, ['filter' => $search], $sortField,
|
||||
$sortDir, $start, $limit);
|
||||
|
||||
$response['status'] = 'OK';
|
||||
$response['success'] = true;
|
||||
@@ -232,9 +215,9 @@ if ($actionAjax == 'reassignCase') {
|
||||
//Current users of OPEN DEL_INDEX thread
|
||||
$aCurUser = $oAppDel->getCurrentUsers($APP_UID, $DEL_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;
|
||||
}
|
||||
}
|
||||
@@ -244,7 +227,7 @@ if ($actionAjax == 'reassignCase') {
|
||||
}
|
||||
|
||||
//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);
|
||||
}
|
||||
|
||||
@@ -258,11 +241,12 @@ if ($actionAjax == 'reassignCase') {
|
||||
|
||||
// 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;
|
||||
$res = $appNotes->postNewNote($_SESSION['APPLICATION'], $_SESSION['USER_LOGGED'], $noteContent, $notifyReassign);
|
||||
$notifyReassign = $_POST['NOTIFY_REASSIGN'] === 'true' ? true : false;
|
||||
$res = $appNotes->postNewNote($_SESSION['APPLICATION'], $_SESSION['USER_LOGGED'], $noteContent,
|
||||
$notifyReassign);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$result->status = 1;
|
||||
@@ -294,10 +278,12 @@ if ($actionAjax == 'showHistoryMessage') {
|
||||
leimnud.browser = {};
|
||||
leimnud.browser.isIphone = "";
|
||||
leimnud.iphone = {};
|
||||
leimnud.iphone.make = function(){
|
||||
leimnud.iphone.make = function() {
|
||||
};
|
||||
|
||||
function ajax_function(ajax_server, funcion, parameters, method) {
|
||||
}
|
||||
|
||||
//!
|
||||
</script>
|
||||
<?php
|
||||
@@ -310,7 +296,8 @@ 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']));
|
||||
|
||||
?>
|
||||
|
||||
@@ -320,7 +307,7 @@ if ($actionAjax == 'showHistoryMessage') {
|
||||
<?php
|
||||
global $G_FORM;
|
||||
?>
|
||||
function loadForm_<?php echo $G_FORM->id;?>(parametro1){
|
||||
function loadForm_<?php echo $G_FORM->id;?>(parametro1) {
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
@@ -342,6 +329,7 @@ if ($actionAjax == 'showDynaformListHistory') {
|
||||
html {
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
body {
|
||||
color: black !important;
|
||||
}
|
||||
@@ -351,6 +339,7 @@ if ($actionAjax == 'showDynaformListHistory') {
|
||||
raw = raw || false;
|
||||
hexcase = hexcase || false;
|
||||
chrsz = chrsz || 8;
|
||||
|
||||
function safe_add(x, y) {
|
||||
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
|
||||
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
||||
@@ -505,6 +494,7 @@ if ($actionAjax == 'showDynaformListHistory') {
|
||||
leimnud.iphone = {};
|
||||
leimnud.iphone.make = function () {
|
||||
};
|
||||
|
||||
function ajax_function(ajax_server, funcion, parameters, method) {
|
||||
}
|
||||
|
||||
@@ -534,6 +524,7 @@ if ($actionAjax == 'showDynaformListHistory') {
|
||||
showDynaformHistoryGlobal.tablename = '';
|
||||
showDynaformHistoryGlobal.dynDate = '';
|
||||
showDynaformHistoryGlobal.dynTitle = '';
|
||||
|
||||
function showDynaformHistory(dynUID, tablename, dynDate, dynTitle) {
|
||||
showDynaformHistoryGlobal.dynUID = dynUID;
|
||||
showDynaformHistoryGlobal.tablename = tablename;
|
||||
@@ -591,8 +582,10 @@ if ($actionAjax == 'dynaformChangeLogViewHistory') {
|
||||
leimnud.iphone = {};
|
||||
leimnud.iphone.make = function () {
|
||||
};
|
||||
|
||||
function ajax_function(ajax_server, funcion, parameters, method) {
|
||||
}
|
||||
|
||||
//!
|
||||
</script>
|
||||
<?php
|
||||
@@ -647,8 +640,10 @@ if ($actionAjax == 'historyDynaformGridPreview') {
|
||||
leimnud.iphone = {};
|
||||
leimnud.iphone.make = function () {
|
||||
};
|
||||
|
||||
function ajax_function(ajax_server, funcion, parameters, method) {
|
||||
}
|
||||
|
||||
//!
|
||||
</script>
|
||||
<?php
|
||||
@@ -666,7 +661,7 @@ if ($actionAjax == 'historyDynaformGridPreview') {
|
||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;';
|
||||
$_SESSION['DYN_UID_PRINT'] = $_POST['DYN_UID'];
|
||||
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '',
|
||||
$Fields['APP_DATA'],
|
||||
$Fields['APP_DATA'],
|
||||
'', '', 'view');
|
||||
|
||||
?>
|
||||
|
||||
@@ -161,6 +161,8 @@ if ($Fields['APP_STATUS'] != 'COMPLETED') {
|
||||
if (isset($row['USR_UID']) && !empty($row['USR_UID'])) {
|
||||
$aUser = $objUser->loadDetails ($row['USR_UID']);
|
||||
$FieldsPar['CURRENT_USER'] = $aUser['USR_FULLNAME'];
|
||||
} else {
|
||||
$FieldsPar['CURRENT_USER'] = '';
|
||||
}
|
||||
$FieldsPar['DEL_DELEGATE_DATE'] = $row['DEL_DELEGATE_DATE'];
|
||||
$FieldsPar['DEL_INIT_DATE'] = $row['DEL_INIT_DATE'];
|
||||
|
||||
@@ -142,8 +142,8 @@ if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
|
||||
if($res->status == 0){
|
||||
$message = $res->message;
|
||||
G::SendMessageText( $message, "ERROR" );
|
||||
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
|
||||
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -156,8 +156,8 @@ if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
|
||||
if ($inpDocMaxFilesize > 0 && $fileSizeByField > 0) {
|
||||
if ($fileSizeByField > $inpDocMaxFilesize) {
|
||||
G::SendMessageText(G::LoadTranslation("ID_SIZE_VERY_LARGE_PERMITTED"), "ERROR");
|
||||
$arrayAux1 = explode("sys" . SYS_SYS, $_SERVER["HTTP_REFERER"]);
|
||||
G::header("location: /sys" . SYS_SYS . $arrayAux1[1]);
|
||||
$arrayAux1 = explode("sys" . config("system.workspace"), $_SERVER["HTTP_REFERER"]);
|
||||
G::header("location: /sys" . config("system.workspace") . $arrayAux1[1]);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,8 +54,8 @@ if ((isset( $_FILES['form'] )) && ($_FILES['form']['error']['APP_DOC_FILENAME']
|
||||
break;
|
||||
}
|
||||
G::SendMessageText( $message, "ERROR" );
|
||||
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
|
||||
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ if(isset($_FILES["form"]["name"]["APP_DOC_FILENAME"]) && isset($_FILES["form"]["
|
||||
if($res->status == 0){
|
||||
$message = $res->message;
|
||||
G::SendMessageText( $message, "ERROR" );
|
||||
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
|
||||
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -134,8 +134,8 @@ if (isset($_FILES) && isset($_FILES["form"]) && count($_FILES["form"]) > 0) {
|
||||
} catch (Exception $e) {
|
||||
G::SendMessageText($e->getMessage(), "ERROR");
|
||||
|
||||
$arrayAux = explode("sys" . SYS_SYS, $_SERVER["HTTP_REFERER"]);
|
||||
G::header("location: /sys" . SYS_SYS . $arrayAux[1]);
|
||||
$arrayAux = explode("sys" . config("system.workspace"), $_SERVER["HTTP_REFERER"]);
|
||||
G::header("location: /sys" . config("system.workspace") . $arrayAux[1]);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ if (G::is_https()) {
|
||||
$http = 'http://';
|
||||
}
|
||||
|
||||
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
|
||||
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
|
||||
$client = new SoapClient($endpoint, $streamContext);
|
||||
|
||||
$user = $sWS_USER;
|
||||
|
||||
@@ -109,8 +109,8 @@ if (! $sw_file_exists) {
|
||||
print G::json_encode( $res );
|
||||
} else {
|
||||
G::SendMessageText( $error_message, "ERROR" );
|
||||
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
|
||||
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
@@ -122,8 +122,8 @@ if (!$sw_file_exists) {
|
||||
print G::json_encode( $res );
|
||||
} else {
|
||||
G::SendMessageText( $error_message, "ERROR" );
|
||||
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
|
||||
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
|
||||
die();
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ if (!$sw_file_exists) {
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (!$downloadStatus) {
|
||||
G::streamFile( $realPath, $download, $nameFile); //download
|
||||
G::streamFile( $realPath, $download, G::inflect($nameFile)); //download
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
use ProcessMaker\Util\DateTime;
|
||||
|
||||
|
||||
$filter = new InputFilter();
|
||||
|
||||
@@ -339,14 +341,14 @@ try {
|
||||
$FieldsPmDynaform["STEP_MODE"] = $oStep->getStepMode();
|
||||
$FieldsPmDynaform["PRO_SHOW_MESSAGE"] = $noShowTitle;
|
||||
$FieldsPmDynaform["TRIGGER_DEBUG"] = $_SESSION['TRIGGER_DEBUG']['ISSET'];
|
||||
$a = new PmDynaform(\ProcessMaker\Util\DateTime::convertUtcToTimeZone($FieldsPmDynaform));
|
||||
$a = new PmDynaform(DateTime::convertUtcToTimeZone($FieldsPmDynaform));
|
||||
if ($a->isResponsive()) {
|
||||
$a->printEdit();
|
||||
} else {
|
||||
if(array_key_exists('gmail',$_GET) && $_GET['gmail'] == 1){
|
||||
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_GET['UID'], '', \ProcessMaker\Util\DateTime::convertUtcToTimeZone($Fields['APP_DATA']), 'cases_SaveData?UID=' . $_GET['UID'] . '&APP_UID=' . $_SESSION['APPLICATION'] . '&gmail=1', '', (strtolower($oStep->getStepMode()) != 'edit' ? strtolower($oStep->getStepMode()) : ''));
|
||||
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_GET['UID'], '', DateTime::convertUtcToTimeZone($Fields['APP_DATA']), 'cases_SaveData?UID=' . $_GET['UID'] . '&APP_UID=' . $_SESSION['APPLICATION'] . '&gmail=1', '', (strtolower($oStep->getStepMode()) != 'edit' ? strtolower($oStep->getStepMode()) : ''));
|
||||
}else{
|
||||
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_GET['UID'], '', \ProcessMaker\Util\DateTime::convertUtcToTimeZone($Fields['APP_DATA']), 'cases_SaveData?UID=' . $_GET['UID'] . '&APP_UID=' . $_SESSION['APPLICATION'], '', (strtolower($oStep->getStepMode()) != 'edit' ? strtolower($oStep->getStepMode()) : ''));
|
||||
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_GET['UID'], '', DateTime::convertUtcToTimeZone($Fields['APP_DATA']), 'cases_SaveData?UID=' . $_GET['UID'] . '&APP_UID=' . $_SESSION['APPLICATION'], '', (strtolower($oStep->getStepMode()) != 'edit' ? strtolower($oStep->getStepMode()) : ''));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -710,6 +712,7 @@ try {
|
||||
$oAppDocument = new AppDocument();
|
||||
$lastVersion = $oAppDocument->getLastAppDocVersion( $_GET['DOC'], $_SESSION['APPLICATION'] );
|
||||
$aFields = $oAppDocument->load( $_GET['DOC'], $lastVersion );
|
||||
$aFields['APP_DOC_CREATE_DATE'] = DateTime::convertUtcToTimeZone($aFields['APP_DOC_CREATE_DATE']);
|
||||
$listing = false;
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
if ($oPluginRegistry->existsTrigger( PM_CASE_DOCUMENT_LIST )) {
|
||||
|
||||
@@ -29,7 +29,7 @@ $oHeadPublisher->addExtJsScript( "cases/main", false ); //Adding a javascript fi
|
||||
$oHeadPublisher->addContent( "cases/main" ); //Adding a html file .html.
|
||||
|
||||
$keyMem = "USER_PREFERENCES" . $_SESSION["USER_LOGGED"];
|
||||
$memcache = &PMmemcached::getSingleton( SYS_SYS );
|
||||
$memcache = &PMmemcached::getSingleton( config("system.workspace") );
|
||||
|
||||
if (($arrayConfig = $memcache->get( $keyMem )) === false) {
|
||||
$conf->loadConfig( $x, "USER_PREFERENCES", "", "", $_SESSION["USER_LOGGED"], "" );
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
*/
|
||||
|
||||
$tBarGmail = false;
|
||||
if(isset( $_GET['gmail']) && $_GET['gmail'] == 1){
|
||||
if (isset($_GET['gmail']) && $_GET['gmail'] == 1) {
|
||||
$_SESSION['gmail'] = 1;
|
||||
$tBarGmail = true;
|
||||
}
|
||||
@@ -42,7 +42,7 @@ if (!isset($_GET['APP_UID']) && !isset($_GET['APP_NUMBER']) && !isset($_GET['DEL
|
||||
if (!isset($_GET['APP_UID']) && isset($_GET['APP_NUMBER'])) {
|
||||
$oCase = new Cases();
|
||||
$appUid = $oCase->getApplicationUIDByNumber(htmlspecialchars($_GET['APP_NUMBER']));
|
||||
if (is_null( $appUid )) {
|
||||
if (is_null($appUid)) {
|
||||
throw new Exception(G::LoadTranslation('ID_CASE_DOES_NOT_EXISTS'));
|
||||
}
|
||||
} else {
|
||||
@@ -52,7 +52,7 @@ if (!isset($_GET['APP_UID']) && isset($_GET['APP_NUMBER'])) {
|
||||
if (!isset($_GET['DEL_INDEX'])) {
|
||||
$oCase = new Cases();
|
||||
$delIndex = $oCase->getCurrentDelegation($appUid, $_SESSION['USER_LOGGED']);
|
||||
if (is_null( $delIndex )) {
|
||||
if (is_null($delIndex)) {
|
||||
throw new Exception(G::LoadTranslation('ID_CASE_IS_CURRENTLY_WITH_ANOTHER_USER'));
|
||||
}
|
||||
$_GET['DEL_INDEX'] = $delIndex;
|
||||
@@ -65,7 +65,7 @@ $tasUid = (isset($_GET['TAS_UID'])) ? $tasUid = htmlspecialchars($_GET['TAS_UID'
|
||||
$oCase = new Cases();
|
||||
$conf = new Configurations();
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher = &headPublisher::getSingleton();
|
||||
|
||||
$urlToRedirectAfterPause = 'casesListExtJs';
|
||||
|
||||
@@ -75,34 +75,34 @@ if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
|
||||
$pmGoogle = new PmGoogleApi();
|
||||
if (array_key_exists('gmail', $_SESSION) && $_SESSION['gmail'] == 1 && $pmGoogle->getServiceGmailStatus()) {
|
||||
$_SESSION['gmail'] = 0;
|
||||
$urlToRedirectAfterPause = '/sys'. $_SESSION['WORKSPACE'] .'/en/neoclassic/cases/cases_Open?APP_UID='.$_SESSION['APPLICATION'].'&DEL_INDEX='.$_SESSION['INDEX'].'&action=sent';
|
||||
$urlToRedirectAfterPause = '/sys' . $_SESSION['WORKSPACE'] . '/en/neoclassic/cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=sent';
|
||||
}
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
|
||||
$oHeadPublisher->assign( 'urlToRedirectAfterPause', $urlToRedirectAfterPause );
|
||||
$oHeadPublisher->assign('urlToRedirectAfterPause', $urlToRedirectAfterPause);
|
||||
|
||||
|
||||
$oHeadPublisher->addExtJsScript( 'app/main', true );
|
||||
$oHeadPublisher->addExtJsScript( 'cases/open', true );
|
||||
$oHeadPublisher->assign( 'FORMATS', $conf->getFormats() );
|
||||
$oHeadPublisher->addExtJsScript('app/main', true);
|
||||
$oHeadPublisher->addExtJsScript('cases/open', true);
|
||||
$oHeadPublisher->assign('FORMATS', $conf->getFormats());
|
||||
$uri = '';
|
||||
foreach ($_GET as $k => $v) {
|
||||
$uri .= ($uri == '') ? "$k=$v" : "&$k=$v";
|
||||
}
|
||||
|
||||
if( isset($_GET['action']) && ($_GET['action'] == 'jump') ) {
|
||||
if (isset($_GET['action']) && ($_GET['action'] == 'jump')) {
|
||||
$oNewCase = new \ProcessMaker\BusinessModel\Cases();
|
||||
//We need to get the last index OPEN or CLOSED (by Paused cases)
|
||||
//Set true because we need to check if the case is paused
|
||||
$delIndex = $oNewCase->getOneLastThread($appUid, true);
|
||||
$case = $oCase->loadCase( $appUid, $delIndex, $_GET['action']);
|
||||
$case = $oCase->loadCase($appUid, $delIndex, $_GET['action']);
|
||||
} else {
|
||||
$case = $oCase->loadCase( $appUid, $delIndex );
|
||||
$case = $oCase->loadCase($appUid, $delIndex);
|
||||
}
|
||||
|
||||
if(isset($_GET['actionFromList']) && ($_GET['actionFromList'] === 'to_revise') ){
|
||||
if (isset($_GET['actionFromList']) && ($_GET['actionFromList'] === 'to_revise')) {
|
||||
$oSupervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
|
||||
$caseCanBeReview = $oSupervisor->reviewCaseStatusForSupervisor($appUid, $delIndex);
|
||||
//Check if the case has the correct status for update the information from supervisor/review
|
||||
@@ -112,9 +112,9 @@ if(isset($_GET['actionFromList']) && ($_GET['actionFromList'] === 'to_revise') )
|
||||
} else {
|
||||
//The supervisor can edit the information, the case are in TO_DO
|
||||
$script = 'cases_OpenToRevise?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex . '&TAS_UID=' . $tasUid;
|
||||
$oHeadPublisher->assign( 'treeToReviseTitle', G::loadtranslation( 'ID_STEP_LIST' ) );
|
||||
$oHeadPublisher->assign('treeToReviseTitle', G::loadtranslation('ID_STEP_LIST'));
|
||||
$casesPanelUrl = 'casesToReviseTreeContent?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex;
|
||||
$oHeadPublisher->assign( 'casesPanelUrl', $casesPanelUrl ); //translations
|
||||
$oHeadPublisher->assign('casesPanelUrl', $casesPanelUrl); //translations
|
||||
echo "<div id='toReviseTree'></div>";
|
||||
}
|
||||
} else {
|
||||
@@ -133,24 +133,24 @@ while ($ds->next()) {
|
||||
$bpmnProjects[] = $row['PRJ_UID'];
|
||||
}
|
||||
$oStep = new Step();
|
||||
$oStep = $oStep->loadByProcessTaskPosition( $case['PRO_UID'], $case['TAS_UID'], 1 );
|
||||
$oHeadPublisher->assign( 'uri', $script . $uri );
|
||||
$oHeadPublisher->assign( '_APP_NUM', '#: ' . $case['APP_NUMBER'] );
|
||||
$oHeadPublisher->assign( '_PROJECT_TYPE', in_array($case['PRO_UID'], $bpmnProjects) ? 'bpmn' : 'classic' );
|
||||
$oHeadPublisher->assign( '_PRO_UID', $case['PRO_UID']);
|
||||
$oHeadPublisher->assign( '_APP_UID', $appUid);
|
||||
$oHeadPublisher->assign( '_ENV_CURRENT_DATE', $conf->getSystemDate( date( 'Y-m-d' ) ) );
|
||||
$oHeadPublisher->assign( '_ENV_CURRENT_DATE_NO_FORMAT', date( 'Y-m-d-h-i-A' ) );
|
||||
$oHeadPublisher->assign( 'idfirstform', is_null( $oStep ) ? '' : $oStep->getStepUidObj() );
|
||||
$oHeadPublisher->assign( 'appStatus', $case['APP_STATUS'] );
|
||||
$oHeadPublisher->assign( 'tbarGmail', $tBarGmail);
|
||||
$oStep = $oStep->loadByProcessTaskPosition($case['PRO_UID'], $case['TAS_UID'], 1);
|
||||
$oHeadPublisher->assign('uri', $script . $uri);
|
||||
$oHeadPublisher->assign('_APP_NUM', '#: ' . $case['APP_NUMBER']);
|
||||
$oHeadPublisher->assign('_PROJECT_TYPE', in_array($case['PRO_UID'], $bpmnProjects) ? 'bpmn' : 'classic');
|
||||
$oHeadPublisher->assign('_PRO_UID', $case['PRO_UID']);
|
||||
$oHeadPublisher->assign('_APP_UID', $appUid);
|
||||
$oHeadPublisher->assign('_ENV_CURRENT_DATE', $conf->getSystemDate(date('Y-m-d')));
|
||||
$oHeadPublisher->assign('_ENV_CURRENT_DATE_NO_FORMAT', date('Y-m-d-h-i-A'));
|
||||
$oHeadPublisher->assign('idfirstform', is_null($oStep) ? '-1' : $oStep->getStepUidObj());
|
||||
$oHeadPublisher->assign('appStatus', $case['APP_STATUS']);
|
||||
$oHeadPublisher->assign('tbarGmail', $tBarGmail);
|
||||
|
||||
if(!isset($_SESSION['APPLICATION']) || !isset($_SESSION['TASK']) || !isset($_SESSION['INDEX'])) {
|
||||
if (!isset($_SESSION['APPLICATION']) || !isset($_SESSION['TASK']) || !isset($_SESSION['INDEX'])) {
|
||||
$_SESSION['PROCESS'] = $case['PRO_UID'];
|
||||
$_SESSION['APPLICATION'] = $case['APP_UID'];
|
||||
$_SESSION['TASK'] = $case['TAS_UID'];
|
||||
$_SESSION['INDEX'] = $case['DEL_INDEX'];
|
||||
}
|
||||
$_SESSION['actionCaseOptions'] = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : '';
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
G::RenderPage('publish', 'extJs');
|
||||
|
||||
|
||||
@@ -30,6 +30,9 @@ try {
|
||||
$filters['sort'] = G::toUpper($filters['sort']);
|
||||
$openApplicationUid = (isset($_REQUEST['openApplicationUid']) && $_REQUEST['openApplicationUid'] != '') ? $_REQUEST['openApplicationUid'] : null;
|
||||
|
||||
global $RBAC;
|
||||
$RBAC->allows(basename(__FILE__), $filters['action']);
|
||||
|
||||
//Define user when is reassign
|
||||
if ($filters['action'] == 'to_reassign') {
|
||||
if ($filters['user'] == '' ) {
|
||||
@@ -90,8 +93,11 @@ try {
|
||||
|
||||
$filters['limit'] = (int)$filters['limit'];
|
||||
$filters['limit'] = abs($filters['limit']);
|
||||
$conf = new Configurations();
|
||||
$formats = $conf->getFormats();
|
||||
$list->setUserDisplayFormat($formats['format']);
|
||||
|
||||
if ($filters['limit'] == 0) {
|
||||
$conf = new Configurations();
|
||||
$generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
|
||||
if (isset($generalConfCasesList['casesListRowNumber'])) {
|
||||
$filters['limit'] = (int)$generalConfCasesList['casesListRowNumber'];
|
||||
@@ -101,10 +107,11 @@ try {
|
||||
} else {
|
||||
$filters['limit'] = (int)$filters['limit'];
|
||||
}
|
||||
|
||||
|
||||
switch ($filters['sort']) {
|
||||
case 'APP_CURRENT_USER':
|
||||
$filters['sort'] = 'DEL_CURRENT_USR_LASTNAME';
|
||||
//This value is format according to the userDisplayFormat, for this reason we will sent the UID
|
||||
$filters['sort'] = 'USR_UID';
|
||||
break;
|
||||
case 'DEL_TASK_DUE_DATE':
|
||||
$filters['sort'] = 'DEL_DUE_DATE';
|
||||
@@ -113,7 +120,8 @@ try {
|
||||
$filters['sort'] = 'DEL_DELEGATE_DATE';
|
||||
break;
|
||||
case 'APP_DEL_PREVIOUS_USER':
|
||||
$filters['sort'] = 'DEL_DUE_DATE';
|
||||
//This value is format according to the userDisplayFormat, for this reason we will sent the UID
|
||||
$filters['sort'] = 'DEL_PREVIOUS_USR_UID';
|
||||
break;
|
||||
case 'DEL_CURRENT_TAS_TITLE':
|
||||
$filters['sort'] = 'APP_TAS_TITLE';
|
||||
|
||||
@@ -35,7 +35,7 @@ $_REQUEST['sSymbol']= isset($_REQUEST["sSymbol"])?$_REQUEST["sSymbol"]:'';
|
||||
|
||||
$_SERVER["QUERY_STRING"] = $filter->xssFilterHard($_SERVER["QUERY_STRING"]);
|
||||
|
||||
$html = '<title>Upload Variable</title>';
|
||||
$html = '<title>' . G::LoadTranslation('ID_SELECT_VARIABLE') . '</title>';
|
||||
$html .= '<form action="uploader.php?'.$_SERVER["QUERY_STRING"].'&q=upload" onLoad="onLoad()" method="post" enctype="multipart/form-data" onsubmit="" style="height:0px;">';
|
||||
$html .= '<div id="d_variables">';
|
||||
$html .= '<table width="90%" align="center">';
|
||||
|
||||
@@ -9,7 +9,7 @@ $oHeadPublisher = &headPublisher::getSingleton();
|
||||
|
||||
if (isset($licenseManager->date) && is_array($licenseManager->date)) {
|
||||
$conf = new Configurations();
|
||||
if ( defined('SYS_SYS') && $conf->exists("ENVIRONMENT_SETTINGS")) {
|
||||
if (!empty(config("system.workspace")) && $conf->exists("ENVIRONMENT_SETTINGS")) {
|
||||
$licenseManager->date['START'] = date("Y-m-d H:i:s", strtotime($licenseManager->date['HUMAN']['START']));
|
||||
$licenseManager->date['END'] = date("Y-m-d H:i:s", strtotime($licenseManager->date['HUMAN']['END']));
|
||||
$licenseManager->date['START'] = $conf->getSystemDate($licenseManager->date['START']);
|
||||
@@ -63,7 +63,7 @@ $oHeadPublisher->assign("supportStartDate", (isset($licenseManager->supportStart
|
||||
$oHeadPublisher->assign("supportEndDate", (isset($licenseManager->supportEndDate))? $licenseManager->supportEndDate : '');
|
||||
|
||||
$oHeadPublisher->assign("PROCESSMAKER_VERSION", System::getVersion());
|
||||
$oHeadPublisher->assign("PROCESSMAKER_URL", "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN );
|
||||
$oHeadPublisher->assign("PROCESSMAKER_URL", "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN );
|
||||
$oHeadPublisher->assign("SYS_SKIN", SYS_SKIN);
|
||||
$oHeadPublisher->assign("URL_PART_LOGIN", ((substr(SYS_SKIN, 0, 2) == "ux" && SYS_SKIN != "uxs")? "main/login" : "login/login"));
|
||||
$oHeadPublisher->assign("URL_PART_SETUP", EnterpriseUtils::getUrlPartSetup());
|
||||
|
||||
@@ -160,7 +160,7 @@ try {
|
||||
}
|
||||
|
||||
///////
|
||||
$workspace = SYS_SYS;
|
||||
$workspace = config("system.workspace");
|
||||
$dbAdapter = DB_ADAPTER;
|
||||
|
||||
$addon->setAddonState("download-start");
|
||||
|
||||
@@ -8,7 +8,7 @@ if (!defined("PATH_PM_ENTERPRISE")) {
|
||||
}
|
||||
|
||||
if (!defined("PATH_DATA_SITE")) {
|
||||
define("PATH_DATA_SITE", PATH_DATA . "sites/" . SYS_SYS . "/");
|
||||
define("PATH_DATA_SITE", PATH_DATA . "sites/" . config("system.workspace") . "/");
|
||||
}
|
||||
|
||||
set_include_path(PATH_PM_ENTERPRISE . PATH_SEPARATOR . get_include_path());
|
||||
@@ -78,12 +78,10 @@ class enterprisePlugin extends PMPlugin
|
||||
unset($_SESSION["__EE_SW_PMLICENSEMANAGER__"]);
|
||||
|
||||
///////
|
||||
$js = "window.open(\"/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/main?s=PLUGINS\", \"_top\", \"\");";
|
||||
$js = "window.open(\"/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/main?s=PLUGINS\", \"_top\", \"\");";
|
||||
|
||||
if (substr(SYS_SKIN, 0, 2) == "ux" && SYS_SKIN != "uxs") {
|
||||
//$js = "parent.window.location.href = \"/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/main_init?s=PLUGINS\";";
|
||||
//$js = "window.location.href = \"/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/pluginsImport\";";
|
||||
$js = "window.open(\"/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/main\", \"_top\", \"\");";
|
||||
$js = "window.open(\"/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/main\", \"_top\", \"\");";
|
||||
}
|
||||
|
||||
///////
|
||||
|
||||
@@ -63,7 +63,7 @@ function install($file)
|
||||
$context = stream_context_create($option);
|
||||
|
||||
///////
|
||||
$fileData = @fopen(EnterpriseUtils::getUrlServerName() . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/enterprise/services/processMakerUpgrade", "rb", false, $context);
|
||||
$fileData = @fopen(EnterpriseUtils::getUrlServerName() . "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/enterprise/services/processMakerUpgrade", "rb", false, $context);
|
||||
|
||||
if ($fileData === false) {
|
||||
throw (new Exception("Could not open services url."));
|
||||
|
||||
@@ -146,7 +146,7 @@ try {
|
||||
$errLabel = G::LoadTranslation('ID_ACCOUNT') . ' "' . $usr . '" ' . G::LoadTranslation('ID_ACCOUNT_DISABLED_CONTACT_ADMIN');
|
||||
}
|
||||
//Log failed authentications
|
||||
$message = "| Many failed authentication attempts for USER: " . $usr . " | IP: " . G::getIpAddress() . " | WS: " . SYS_SYS;
|
||||
$message = "| Many failed authentication attempts for USER: " . $usr . " | IP: " . G::getIpAddress() . " | WS: " . config("system.workspace");
|
||||
$message .= " | BROWSER: " . $_SERVER['HTTP_USER_AGENT'];
|
||||
|
||||
G::log($message, PATH_DATA, 'loginFailed.log');
|
||||
@@ -171,7 +171,7 @@ try {
|
||||
}
|
||||
|
||||
if (!isset( $_SESSION['WORKSPACE'] ) ) {
|
||||
$_SESSION['WORKSPACE'] = SYS_SYS;
|
||||
$_SESSION['WORKSPACE'] = config("system.workspace");
|
||||
}
|
||||
|
||||
//Execute the SSO Script from plugin
|
||||
@@ -246,7 +246,7 @@ try {
|
||||
$userTimeZone = $user->getUsrTimeZone();
|
||||
|
||||
if (trim($userTimeZone) == '') {
|
||||
$arraySystemConfiguration = System::getSystemConfiguration('', '', SYS_SYS);
|
||||
$arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace"));
|
||||
|
||||
$userTimeZone = $arraySystemConfiguration['time_zone'];
|
||||
}
|
||||
@@ -407,7 +407,7 @@ try {
|
||||
die;
|
||||
}
|
||||
|
||||
$configS = System::getSystemConfiguration('', '', SYS_SYS);
|
||||
$configS = System::getSystemConfiguration('', '', config("system.workspace"));
|
||||
$activeSession = isset($configS['session_block']) ? !(int)$configS['session_block']:true;
|
||||
if ($activeSession){
|
||||
setcookie("PM-TabPrimary", 101010010, time() + (24 * 60 * 60), '/');
|
||||
|
||||
@@ -20,7 +20,7 @@ try {
|
||||
}
|
||||
|
||||
header(
|
||||
'Location: /sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN .
|
||||
'Location: /sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN .
|
||||
'/login/login' . (($u != '')? '?u=' . $u : '')
|
||||
);
|
||||
|
||||
@@ -40,7 +40,7 @@ try {
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
$arraySystemConfiguration = System::getSystemConfiguration('', '', SYS_SYS);
|
||||
$arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace"));
|
||||
|
||||
//Set User Time Zone
|
||||
$user = UsersPeer::retrieveByPK($userUid);
|
||||
|
||||
@@ -188,9 +188,9 @@ session_start();
|
||||
session_regenerate_id();
|
||||
|
||||
if (PHP_VERSION < 5.2) {
|
||||
setcookie("workspaceSkin", SYS_SKIN, time() + (24 * 60 * 60), "/sys" . SYS_SYS, "; HttpOnly");
|
||||
setcookie("workspaceSkin", SYS_SKIN, time() + (24 * 60 * 60), "/sys" . config("system.workspace"), "; HttpOnly");
|
||||
} else {
|
||||
setcookie("workspaceSkin", SYS_SKIN, time() + (24 * 60 * 60), "/sys" . SYS_SYS, null, false, true);
|
||||
setcookie("workspaceSkin", SYS_SKIN, time() + (24 * 60 * 60), "/sys" . config("system.workspace"), null, false, true);
|
||||
}
|
||||
|
||||
if (strlen($msg) > 0) {
|
||||
@@ -361,7 +361,7 @@ $flagForgotPassword = isset($oConf->aConfig['login_enableForgotPassword'])
|
||||
|
||||
setcookie('PM-Warning', trim(G::LoadTranslation('ID_BLOCKER_MSG'), '*'), time() + (24 * 60 * 60), SYS_URI);
|
||||
|
||||
$configS = System::getSystemConfiguration('', '', SYS_SYS);
|
||||
$configS = System::getSystemConfiguration('', '', config("system.workspace"));
|
||||
$activeSession = isset($configS['session_block']) ? !(int)$configS['session_block'] : true;
|
||||
if ($activeSession) {
|
||||
setcookie("PM-TabPrimary", 101010010, time() + (24 * 60 * 60), '/');
|
||||
|
||||
@@ -9,11 +9,12 @@ $rbacUser = new RbacUsers();
|
||||
$user = new Users();
|
||||
$data['USR_USERNAME'] = strip_tags($data['USR_USERNAME']);
|
||||
$userData = $rbacUser->getByUsername($data['USR_USERNAME']);
|
||||
$userExists = $userData === false ? false : true;
|
||||
|
||||
if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'] && ($userData['USR_AUTH_TYPE'] === '' || $userData['USR_AUTH_TYPE'] == 'MYSQL') ) {
|
||||
if ($userExists === true && $userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'] && ($userData['USR_AUTH_TYPE'] === '' || $userData['USR_AUTH_TYPE'] == 'MYSQL')) {
|
||||
$aSetup = System::getEmailConfiguration();
|
||||
if (count($aSetup) == 0 || !isset($aSetup['MESS_ENGINE'])) {
|
||||
G::SendTemporalMessage ('ID_EMAIL_ENGINE_IS_NOT_ENABLED', "warning");
|
||||
G::SendTemporalMessage('ID_EMAIL_ENGINE_IS_NOT_ENABLED', "warning");
|
||||
G::header('location: forgotPassword');
|
||||
die;
|
||||
}
|
||||
@@ -28,17 +29,16 @@ if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'
|
||||
$aUserPropertyData['USR_LOGGED_NEXT_TIME'] = 1;
|
||||
$oUserProperty = $oUserProperty->update($aUserPropertyData);
|
||||
}
|
||||
/* **Save after sending the mail
|
||||
$rbacUser->update($aData);
|
||||
$user->update($aData);
|
||||
*/
|
||||
|
||||
if (!isset($sFrom)) {
|
||||
$sFrom = '';
|
||||
}
|
||||
$sFrom = G::buildFrom($aSetup, $sFrom);
|
||||
|
||||
$sSubject = G::LoadTranslation('ID_RESET_PASSWORD').' - ProcessMaker' ;
|
||||
$sSubject = G::LoadTranslation('ID_RESET_PASSWORD') . ' - ProcessMaker';
|
||||
$msg = '<h3>ProcessMaker Forgot password Service</h3>';
|
||||
$msg .='<p>'.G::LoadTranslation('ID_YOUR_USERMANE_IS').' : <strong>'.$userData['USR_USERNAME'].'</strong></p>';
|
||||
$msg .='<p>'.G::LoadTranslation('ID_YOUR_PASSWORD_IS').' : <strong>'.$newPass.'</strong></p>';
|
||||
$msg .= '<p>' . G::LoadTranslation('ID_YOUR_USERMANE_IS') . ' : <strong>' . $userData['USR_USERNAME'] . '</strong></p>';
|
||||
$msg .= '<p>' . G::LoadTranslation('ID_YOUR_PASSWORD_IS') . ' : <strong>' . $newPass . '</strong></p>';
|
||||
switch ($aSetup['MESS_ENGINE']) {
|
||||
case 'MAIL':
|
||||
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_1');
|
||||
@@ -53,10 +53,10 @@ if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'
|
||||
|
||||
$sBody = "
|
||||
<table style=\"background-color: white; font-family: Arial,Helvetica,sans-serif; color: black; font-size: 11px; text-align: left;\" cellpadding='10' cellspacing='0' width='100%'>
|
||||
<tbody><tr><td><img id='logo' src='http://".$_SERVER['SERVER_NAME']."/images/processmaker.logo.jpg' /></td></tr>
|
||||
<tbody><tr><td><img id='logo' src='http://" . $_SERVER['SERVER_NAME'] . "/images/processmaker.logo.jpg' /></td></tr>
|
||||
<tr><td style='font-size: 14px;'>$msg</td></tr>
|
||||
<tr><td style='vertical-align:middel;'>
|
||||
<br /><hr><b>This Business Process is powered by ProcessMaker ver. ".System::getVersion().".<b><br />
|
||||
<br /><hr><b>This Business Process is powered by ProcessMaker ver. " . System::getVersion() . ".<b><br />
|
||||
<a href='http://www.processmaker.com' style='color:#c40000;'>www.processmaker.com</a><br /></td>
|
||||
</tr></tbody></table>";
|
||||
|
||||
@@ -64,20 +64,20 @@ if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'
|
||||
|
||||
$oSpool->setConfig($aSetup);
|
||||
$oSpool->create(array(
|
||||
'msg_uid' => '',
|
||||
'app_uid' => '',
|
||||
'del_index' => 0,
|
||||
'app_msg_type' => 'TEST',
|
||||
'app_msg_subject' => $sSubject,
|
||||
'app_msg_from' => $sFrom,
|
||||
'app_msg_to' => $data['USR_EMAIL'],
|
||||
'app_msg_body' => $sBody,
|
||||
'app_msg_cc' => '',
|
||||
'app_msg_bcc' => '',
|
||||
'app_msg_attach' => '',
|
||||
'msg_uid' => '',
|
||||
'app_uid' => '',
|
||||
'del_index' => 0,
|
||||
'app_msg_type' => 'TEST',
|
||||
'app_msg_subject' => $sSubject,
|
||||
'app_msg_from' => $sFrom,
|
||||
'app_msg_to' => $data['USR_EMAIL'],
|
||||
'app_msg_body' => $sBody,
|
||||
'app_msg_cc' => '',
|
||||
'app_msg_bcc' => '',
|
||||
'app_msg_attach' => '',
|
||||
'app_msg_template' => '',
|
||||
'app_msg_status' => 'pending',
|
||||
'app_msg_attach'=>''
|
||||
'app_msg_status' => 'pending',
|
||||
'app_msg_attach' => ''
|
||||
));
|
||||
|
||||
try {
|
||||
@@ -94,12 +94,11 @@ if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'
|
||||
G::SendTemporalMessage($e->getMessage(), "warning", 'string');
|
||||
}
|
||||
} else {
|
||||
if ($userData['USR_AUTH_TYPE'] === '' || $userData['USR_AUTH_TYPE'] === 'MYSQL') {
|
||||
$msg = G::LoadTranslation('ID_USER') . ' ' . htmlentities($data['USR_USERNAME'], ENT_QUOTES, 'UTF-8') . ' '. G::LoadTranslation('ID_IS_NOT_REGISTERED');
|
||||
} else {
|
||||
$msg = G::LoadTranslation('ID_THE_USERNAME_EMAIL_IS_INCORRECT');
|
||||
if ($userData !== false && $userData['USR_AUTH_TYPE'] !== '' && $userData['USR_EMAIL'] === $data['USR_EMAIL']) {
|
||||
$msg = G::LoadTranslation('ID_USER_NOT_FUNCTIONALITY');
|
||||
}
|
||||
G::SendTemporalMessage ($msg, "warning", 'string');
|
||||
G::SendTemporalMessage($msg, "warning", 'string');
|
||||
G::header('location: forgotPassword');
|
||||
}
|
||||
|
||||
|
||||
@@ -1,30 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* emailList.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;
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
use ProcessMaker\BusinessModel\Process as BmProcess;
|
||||
|
||||
$resultRbac = $RBAC->requirePermissions('PM_SETUP_ADVANCE', 'PM_SETUP_LOGS');
|
||||
if (!$resultRbac) {
|
||||
@@ -53,7 +31,8 @@ $status = array(
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
$flagER = $pluginRegistry->isEnable('externalRegistration') ? 1 : 0;
|
||||
|
||||
$processes = getProcessArray($userUid);
|
||||
$process = new BmProcess();
|
||||
$processes = $process->getProcessList();
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
@@ -65,32 +44,5 @@ $oHeadPublisher->assign('statusValues', $status);
|
||||
$oHeadPublisher->assign('processValues', $processes);
|
||||
$oHeadPublisher->assign('flagER', $flagER);
|
||||
|
||||
function getProcessArray($userUid) {
|
||||
global $oAppCache;
|
||||
require_once("classes/model/AppCacheView.php");
|
||||
|
||||
$processes = array();
|
||||
$processes[] = array('', G::LoadTranslation('ID_ALL_PROCESS'));
|
||||
|
||||
$cProcess = new Criteria('workflow');
|
||||
$cProcess->clearSelectColumns();
|
||||
$cProcess->addSelectColumn(AppCacheViewPeer::PRO_UID);
|
||||
$cProcess->addSelectColumn(AppCacheViewPeer::APP_PRO_TITLE);
|
||||
$cProcess->setDistinct(AppCacheViewPeer::PRO_UID);
|
||||
|
||||
$cProcess->addAscendingOrderByColumn(AppCacheViewPeer::APP_PRO_TITLE);
|
||||
|
||||
$oDataset = AppCacheViewPeer::doSelectRS($cProcess);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$processes[] = array($aRow['PRO_UID'], $aRow['APP_PRO_TITLE']);
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
return $processes;
|
||||
}
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
|
||||
@@ -30,82 +30,14 @@ switch ($req) {
|
||||
$dateTo = isset($_POST["dateTo"]) ? substr($_POST["dateTo"], 0, 10) : "";
|
||||
$filterBy = (isset($_REQUEST['filterBy'])) ? $_REQUEST['filterBy'] : 'ALL';
|
||||
|
||||
$response = new stdclass();
|
||||
$response->status = 'OK';
|
||||
|
||||
$delimiter = DBAdapter::getStringDelimiter();
|
||||
|
||||
$criteria = new Criteria();
|
||||
$criteria->addJoin(AppMessagePeer::APP_UID, ApplicationPeer::APP_UID, Criteria::LEFT_JOIN);
|
||||
|
||||
if ($emailStatus != '') {
|
||||
$criteria->add(AppMessagePeer::APP_MSG_STATUS, $emailStatus);
|
||||
}
|
||||
if ($proUid != '') {
|
||||
$criteria->add(ApplicationPeer::PRO_UID, $proUid);
|
||||
}
|
||||
|
||||
//Review the External Registration
|
||||
$arrayType = [];
|
||||
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
$flagEr = $pluginRegistry->isEnable('externalRegistration') ? 1 : 0;
|
||||
|
||||
if ($flagEr == 0) {
|
||||
$arrayType[] = 'EXTERNAL_REGISTRATION';
|
||||
}
|
||||
|
||||
switch ($filterBy) {
|
||||
case 'CASES':
|
||||
$criteria->add(AppMessagePeer::APP_MSG_TYPE, ['TEST', 'EXTERNAL_REGISTRATION'], Criteria::NOT_IN);
|
||||
break;
|
||||
case 'TEST':
|
||||
$criteria->add(AppMessagePeer::APP_MSG_TYPE, 'TEST', Criteria::EQUAL);
|
||||
break;
|
||||
case 'EXTERNAL-REGISTRATION':
|
||||
$criteria->add(AppMessagePeer::APP_MSG_TYPE, 'EXTERNAL_REGISTRATION', Criteria::EQUAL);
|
||||
break;
|
||||
default:
|
||||
if (!empty($arrayType)) {
|
||||
$criteria->add(AppMessagePeer::APP_MSG_TYPE, $arrayType, Criteria::NOT_IN);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ($dateFrom != "") {
|
||||
if ($dateTo != "") {
|
||||
if ($dateFrom == $dateTo) {
|
||||
$dateSame = $dateFrom;
|
||||
$dateFrom = $dateSame . " 00:00:00";
|
||||
$dateTo = $dateSame . " 23:59:59";
|
||||
} else {
|
||||
$dateFrom = $dateFrom . " 00:00:00";
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
}
|
||||
|
||||
$criteria->add($criteria->getNewCriterion(AppMessagePeer::APP_MSG_DATE, $dateFrom, Criteria::GREATER_EQUAL)->addAnd($criteria->getNewCriterion(AppMessagePeer::APP_MSG_DATE, $dateTo, Criteria::LESS_EQUAL)));
|
||||
} else {
|
||||
$dateFrom = $dateFrom . " 00:00:00";
|
||||
$criteria->add(AppMessagePeer::APP_MSG_DATE, $dateFrom, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
} elseif ($dateTo != "") {
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
$criteria->add(AppMessagePeer::APP_MSG_DATE, $dateTo, Criteria::LESS_EQUAL);
|
||||
}
|
||||
|
||||
//Number records total
|
||||
$criteriaCount = clone $criteria;
|
||||
|
||||
$criteriaCount->clearSelectColumns();
|
||||
$criteriaCount->addSelectColumn('COUNT(' . AppMessagePeer::APP_MSG_UID . ') AS NUM_REC');
|
||||
|
||||
$rsCriteriaCount = AppMessagePeer::doSelectRS($criteriaCount);
|
||||
$rsCriteriaCount->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$resultCount = $rsCriteriaCount->next();
|
||||
$rowCount = $rsCriteriaCount->getRow();
|
||||
|
||||
$totalCount = (int)($rowCount['NUM_REC']);
|
||||
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_UID);
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_UID);
|
||||
@@ -113,7 +45,6 @@ switch ($req) {
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_TYPE);
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SUBJECT);
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_FROM);
|
||||
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_TO);
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_BODY);
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_STATUS);
|
||||
@@ -121,18 +52,24 @@ switch ($req) {
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SEND_DATE);
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SHOW_MESSAGE);
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_ERROR);
|
||||
|
||||
$criteria->addSelectColumn(ApplicationPeer::PRO_UID);
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_TITLE);
|
||||
$criteria->addSelectColumn(ApplicationPeer::APP_NUMBER);
|
||||
$criteria->addSelectColumn(ProcessPeer::PRO_TITLE);
|
||||
$criteria->addSelectColumn(TaskPeer::TAS_TITLE);
|
||||
$criteria->addJoin(AppMessagePeer::APP_UID, ApplicationPeer::APP_UID, Criteria::LEFT_JOIN);
|
||||
$criteria->addJoin(ApplicationPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
|
||||
$criteria->addJoin(AppMessagePeer::TAS_ID, TaskPeer::TAS_ID, Criteria::LEFT_JOIN);
|
||||
|
||||
if ($emailStatus != '') {
|
||||
//Status can be: All, Participated, Pending
|
||||
if (!empty($emailStatus)) {
|
||||
$criteria->add(AppMessagePeer::APP_MSG_STATUS, $emailStatus);
|
||||
}
|
||||
if ($proUid != '') {
|
||||
//Process uid
|
||||
if (!empty($proUid)) {
|
||||
$criteria->add(ApplicationPeer::PRO_UID, $proUid);
|
||||
}
|
||||
|
||||
//Filter by can be: All, Cases, Test
|
||||
switch ($filterBy) {
|
||||
case 'CASES':
|
||||
$criteria->add(AppMessagePeer::APP_MSG_TYPE, ['TEST', 'EXTERNAL_REGISTRATION'], Criteria::NOT_IN);
|
||||
@@ -149,29 +86,30 @@ switch ($req) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ($dateFrom != "") {
|
||||
if ($dateTo != "") {
|
||||
if ($dateFrom == $dateTo) {
|
||||
$dateSame = $dateFrom;
|
||||
$dateFrom = $dateSame . " 00:00:00";
|
||||
$dateTo = $dateSame . " 23:59:59";
|
||||
} else {
|
||||
$dateFrom = $dateFrom . " 00:00:00";
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
}
|
||||
|
||||
$criteria->add($criteria->getNewCriterion(AppMessagePeer::APP_MSG_DATE, $dateFrom, Criteria::GREATER_EQUAL)->addAnd($criteria->getNewCriterion(AppMessagePeer::APP_MSG_DATE, $dateTo, Criteria::LESS_EQUAL)));
|
||||
} else {
|
||||
$dateFrom = $dateFrom . " 00:00:00";
|
||||
//Date from and to
|
||||
if (!empty($dateFrom) && !empty($dateTo)) {
|
||||
$criteria->add($criteria->getNewCriterion(AppMessagePeer::APP_MSG_DATE, $dateFrom, Criteria::GREATER_EQUAL)->addAnd($criteria->getNewCriterion(AppMessagePeer::APP_MSG_DATE, $dateTo, Criteria::LESS_EQUAL)));
|
||||
} else {
|
||||
if (!empty($dateFrom)) {
|
||||
$criteria->add(AppMessagePeer::APP_MSG_DATE, $dateFrom, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
} elseif ($dateTo != "") {
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
$criteria->add(AppMessagePeer::APP_MSG_DATE, $dateTo, Criteria::LESS_EQUAL);
|
||||
if (!empty($dateTo)) {
|
||||
$dateTo = $dateTo . " 23:59:59";
|
||||
$criteria->add(AppMessagePeer::APP_MSG_DATE, $dateTo, Criteria::LESS_EQUAL);
|
||||
}
|
||||
}
|
||||
|
||||
if ($sort != '') {
|
||||
//Number records total
|
||||
$criteriaCount = clone $criteria;
|
||||
$criteriaCount->clearSelectColumns();
|
||||
$criteriaCount->addSelectColumn('COUNT(' . AppMessagePeer::APP_MSG_UID . ') AS NUM_REC');
|
||||
$rsCriteriaCount = AppMessagePeer::doSelectRS($criteriaCount);
|
||||
$rsCriteriaCount->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$resultCount = $rsCriteriaCount->next();
|
||||
$rowCount = $rsCriteriaCount->getRow();
|
||||
$totalCount = (int)($rowCount['NUM_REC']);
|
||||
|
||||
if (!empty($sort)) {
|
||||
if (!in_array($sort, AppMessagePeer::getFieldNames(BasePeer::TYPE_FIELDNAME))) {
|
||||
throw new Exception(G::LoadTranslation('ID_INVALID_VALUE_FOR', array('$sort')));
|
||||
}
|
||||
@@ -183,15 +121,11 @@ switch ($req) {
|
||||
} else {
|
||||
$oCriteria->addDescendingOrderByColumn(AppMessagePeer::APP_MSG_SEND_DATE);
|
||||
}
|
||||
if ($limit != '') {
|
||||
if (!empty($limit)) {
|
||||
$criteria->setLimit($limit);
|
||||
$criteria->setOffset($start);
|
||||
}
|
||||
|
||||
$criteria->addJoin(AppMessagePeer::APP_UID, ApplicationPeer::APP_UID);
|
||||
$criteria->addJoin(ApplicationPeer::PRO_UID, ProcessPeer::PRO_UID);
|
||||
|
||||
|
||||
$result = AppMessagePeer::doSelectRS($criteria);
|
||||
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$data = Array();
|
||||
@@ -209,48 +143,15 @@ switch ($req) {
|
||||
if ($row['DEL_INDEX'] != 0) {
|
||||
$index = $row['DEL_INDEX'];
|
||||
}
|
||||
|
||||
$criteria = new Criteria();
|
||||
|
||||
$criteria->addSelectColumn(AppCacheViewPeer::APP_TITLE);
|
||||
$criteria->addSelectColumn(AppCacheViewPeer::APP_TAS_TITLE);
|
||||
$criteria->add(AppCacheViewPeer::APP_UID, $row['APP_UID'], Criteria::EQUAL);
|
||||
$criteria->add(AppCacheViewPeer::DEL_INDEX, $index, Criteria::EQUAL);
|
||||
|
||||
$resultCacheView = AppCacheViewPeer::doSelectRS($criteria);
|
||||
$resultCacheView->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$row['APP_TITLE'] = '-';
|
||||
|
||||
while ($resultCacheView->next()) {
|
||||
$rowCacheView = $resultCacheView->getRow();
|
||||
$row['APP_TITLE'] = $rowCacheView['APP_TITLE'];
|
||||
$row['TAS_TITLE'] = $rowCacheView['APP_TAS_TITLE'];
|
||||
}
|
||||
|
||||
if ($row['DEL_INDEX'] == 0) {
|
||||
$row['TAS_TITLE'] = $tasTitleDefault;
|
||||
}
|
||||
break;
|
||||
case 'TEST':
|
||||
$row['PRO_UID'] = '';
|
||||
$row['APP_NUMBER'] = '';
|
||||
$row['PRO_TITLE'] = '';
|
||||
$row['APP_TITLE'] = '';
|
||||
$row['TAS_TITLE'] = '';
|
||||
break;
|
||||
case 'EXTERNAL-REGISTRATION':
|
||||
$row['PRO_UID'] = '';
|
||||
$row['APP_NUMBER'] = '';
|
||||
$row['PRO_TITLE'] = '';
|
||||
$row['APP_TITLE'] = '';
|
||||
$row['TAS_TITLE'] = '';
|
||||
break;
|
||||
}
|
||||
|
||||
$data[] = $row;
|
||||
}
|
||||
$response = array();
|
||||
$response = [];
|
||||
$response['totalCount'] = $totalCount;
|
||||
$response['data'] = $data;
|
||||
die(G::json_encode($response));
|
||||
|
||||
@@ -9,7 +9,7 @@ if (! empty($_GET['error'])) {
|
||||
|
||||
$http = G::is_https() ? 'https' : 'http';
|
||||
$host = $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '');
|
||||
$endpoint = sprintf('%s://%s/%s/oauth2/token', $http, $host, SYS_SYS);
|
||||
$endpoint = sprintf('%s://%s/%s/oauth2/token', $http, $host, config("system.workspace"));
|
||||
$code = empty($_GET['code']) ? 'NN' : $_GET['code'];
|
||||
|
||||
$clientId = 'x-pm-local-client';
|
||||
|
||||
@@ -19,7 +19,7 @@ class AdditionalTablesConsolidated extends AdditionalTables
|
||||
$sClassName = $this->getPHPName($sTableName);
|
||||
}
|
||||
|
||||
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
if (!file_exists($sPath)) {
|
||||
G::mk_dir($sPath);
|
||||
G::mk_dir($sPath . 'map');
|
||||
@@ -626,7 +626,7 @@ class ajax_con extends WebResource
|
||||
|
||||
$oAdditionalTables->createPropelClasses($tableName, $sClassName, $aFieldsClases, $sTasUid);
|
||||
} else {
|
||||
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
@unlink($sPath . $sClassName . '.php');
|
||||
@unlink($sPath . $sClassName . 'Peer.php');
|
||||
@unlink($sPath . PATH_SEP . 'map' . PATH_SEP . $sClassName . 'MapBuilder.php');
|
||||
|
||||
@@ -92,7 +92,7 @@ $oHeadPublisher->assign("arrayContextMenuOptionPlugin", $arrayContextMenuOptionP
|
||||
$oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState());
|
||||
|
||||
$designer = new Designer();
|
||||
$oHeadPublisher->assign('SYS_SYS', SYS_SYS);
|
||||
$oHeadPublisher->assign('SYS_SYS', config("system.workspace"));
|
||||
$oHeadPublisher->assign('SYS_LANG', SYS_LANG);
|
||||
$oHeadPublisher->assign('SYS_SKIN', SYS_SKIN);
|
||||
$oHeadPublisher->assign('HTTP_SERVER_HOSTNAME', System::getHttpServerHostnameRequestsFrontEnd());
|
||||
|
||||
@@ -33,8 +33,6 @@ $oProcess = new Process();
|
||||
$oProcess->dir = $dir;
|
||||
$oProcess->sort = $sort;
|
||||
|
||||
//$memcache = & PMmemcached::getSingleton( SYS_SYS );
|
||||
|
||||
$memkey = 'no memcache';
|
||||
$memcacheUsed = 'not used';
|
||||
$totalCount = 0;
|
||||
|
||||
@@ -189,13 +189,13 @@ try {
|
||||
|
||||
$filter = new InputFilter();
|
||||
$form = $_REQUEST;
|
||||
$filePath = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . $form['FILENAME'];
|
||||
$filePath = PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . $form['FILENAME'];
|
||||
if (file_exists($filePath)) {
|
||||
unlink($filter->validateInput($filePath, 'path'));
|
||||
$webEntry = new \ProcessMaker\BusinessModel\WebEntry();
|
||||
$webEntry->deleteClassic($form['PRO_UID'], $filePath);
|
||||
}
|
||||
$filePath = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . str_replace(".php", "Post", $form['FILENAME']) . ".php";
|
||||
$filePath = PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . str_replace(".php", "Post", $form['FILENAME']) . ".php";
|
||||
if (file_exists($filePath)) {
|
||||
unlink($filter->validateInput($filePath, 'path'));
|
||||
}
|
||||
@@ -900,8 +900,8 @@ try {
|
||||
$resultArray = array();
|
||||
$proUid = isset($_REQUEST['PRO_UID']) ? $_REQUEST['PRO_UID'] : '';
|
||||
$dynUid = isset($_REQUEST['DYN_UID']) ? $_REQUEST['DYN_UID'] : '';
|
||||
if (is_file(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml') && filesize(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml') > 0) {
|
||||
$dyn = new DynaformHandler(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml');
|
||||
if (is_file(PATH_DATA . '/sites/' . config("system.workspace") . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml') && filesize(PATH_DATA . '/sites/' . config("system.workspace") . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml') > 0) {
|
||||
$dyn = new DynaformHandler(PATH_DATA . '/sites/' . config("system.workspace") . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml');
|
||||
$dynaformFields[] = $dyn->getFields();
|
||||
}
|
||||
foreach ($dynaformFields as $aDynFormFields) {
|
||||
|
||||
@@ -6,7 +6,7 @@ if (!isset($_GET["file_hash"])) {
|
||||
}
|
||||
|
||||
$httpStream = new \ProcessMaker\Util\IO\HttpStream();
|
||||
$outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
|
||||
$outputDir = PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
|
||||
$fileName = urldecode(base64_decode($_GET["file_hash"]));
|
||||
$processFile = $outputDir . $fileName;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
use ProcessMaker\Util\Common;
|
||||
|
||||
$response = new StdClass();
|
||||
$outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
|
||||
$outputDir = PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
|
||||
|
||||
try {
|
||||
if(empty($_GET)){
|
||||
|
||||
@@ -29,4 +29,4 @@ $file .= $extension;
|
||||
|
||||
if (file_exists($directory . $file)) {
|
||||
G::streamFile($directory . $file, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm
|
||||
|
||||
if (!empty($arrayTrigger)) {
|
||||
|
||||
$cs = new CodeScanner(SYS_SYS);
|
||||
$cs = new CodeScanner(config("system.workspace"));
|
||||
|
||||
$strFoundDisabledCode = "";
|
||||
|
||||
|
||||
@@ -68,8 +68,8 @@ try {
|
||||
$pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentryPost.tpl';
|
||||
$template = new TemplatePower( $pluginTpl );
|
||||
$template->prepare();
|
||||
$template->assign( 'wsdlUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2' );
|
||||
$template->assign( 'wsUploadUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/upload' );
|
||||
$template->assign( 'wsdlUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2' );
|
||||
$template->assign( 'wsUploadUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/upload' );
|
||||
$template->assign( 'processUid', $sPRO_UID );
|
||||
$template->assign( 'dynaformUid', $sDYNAFORM );
|
||||
$template->assign( 'taskUid', $sTASKS );
|
||||
@@ -88,7 +88,7 @@ try {
|
||||
|
||||
$template->assign( 'dynaform', $dynTitle );
|
||||
$template->assign( 'timestamp', date( 'l jS \of F Y h:i:s A' ) );
|
||||
$template->assign( 'ws', SYS_SYS );
|
||||
$template->assign( 'ws', config("system.workspace") );
|
||||
$template->assign( 'version', System::getVersion() );
|
||||
|
||||
$fileName = $pathProcess . $dynTitle . 'Post.php';
|
||||
@@ -134,13 +134,13 @@ try {
|
||||
$aDataEvent['EVN_CONDITIONS'] = $sWS_USER;
|
||||
$output = $oEvent->update( $aDataEvent );
|
||||
//Show link
|
||||
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
|
||||
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
|
||||
print $link;
|
||||
//print "\n<a href='$link' target='_new' > $link </a>";
|
||||
|
||||
} else {
|
||||
$G_FORM = new Form( $sPRO_UID . '/' . $sDYNAFORM, PATH_DYNAFORM, SYS_LANG, false );
|
||||
$G_FORM->action = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/cases_StartExternal.php';
|
||||
$G_FORM->action = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/cases_StartExternal.php';
|
||||
|
||||
$scriptCode = '';
|
||||
$scriptCode = $G_FORM->render( PATH_CORE . 'templates/' . 'xmlform' . '.html', $scriptCode );
|
||||
@@ -158,7 +158,7 @@ try {
|
||||
$template->assign("URL_MABORAK_JS", G::browserCacheFilesUrl("/js/maborak/core/maborak.js"));
|
||||
$template->assign("URL_TRANSLATION_ENV_JS", G::browserCacheFilesUrl("/jscore/labels/" . SYS_LANG . ".js"));
|
||||
$template->assign("siteUrl", $http . $_SERVER["HTTP_HOST"]);
|
||||
$template->assign("sysSys", SYS_SYS);
|
||||
$template->assign("sysSys", config("system.workspace"));
|
||||
$template->assign("sysLang", SYS_LANG);
|
||||
$template->assign("sysSkin", SYS_SKIN);
|
||||
$template->assign("processUid", $sPRO_UID);
|
||||
|
||||
@@ -29,7 +29,7 @@ if (G::is_https()) {
|
||||
$http = 'http://';
|
||||
}
|
||||
|
||||
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
|
||||
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
|
||||
$client = new SoapClient( $endpoint, $streamContext );
|
||||
|
||||
$user = $sWS_USER;
|
||||
|
||||
@@ -14,7 +14,7 @@ if (G::is_https())
|
||||
else
|
||||
$http = 'http://';
|
||||
|
||||
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
|
||||
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
|
||||
@$client = new SoapClient( $endpoint );
|
||||
|
||||
$oTask = new Task();
|
||||
|
||||
@@ -29,11 +29,11 @@ if (isset($_GET['BROWSER_TIME_ZONE_OFFSET'])) {
|
||||
throw new Exception('The parameter DEL_INDEX is empty.');
|
||||
}
|
||||
|
||||
$_REQUEST['APP_UID'] = G::decrypt(urldecode(utf8_encode($_REQUEST['APP_UID'])), URL_KEY);
|
||||
$_REQUEST['DEL_INDEX'] = G::decrypt(urldecode(utf8_encode($_REQUEST['DEL_INDEX'])), URL_KEY);
|
||||
$_REQUEST['FIELD'] = G::decrypt(urldecode(utf8_encode($_REQUEST['FIELD'])), URL_KEY);
|
||||
$_REQUEST['VALUE'] = G::decrypt(urldecode(utf8_encode($_REQUEST['VALUE'])), URL_KEY);
|
||||
$_REQUEST['ABER'] = G::decrypt(urldecode(utf8_encode($_REQUEST['ABER'])), URL_KEY);
|
||||
$_REQUEST['APP_UID'] = G::decrypt(urldecode(utf8_encode($_REQUEST['APP_UID'])), URL_KEY, true);
|
||||
$_REQUEST['DEL_INDEX'] = G::decrypt(urldecode(utf8_encode($_REQUEST['DEL_INDEX'])), URL_KEY, true);
|
||||
$_REQUEST['FIELD'] = G::decrypt(urldecode(utf8_encode($_REQUEST['FIELD'])), URL_KEY, true);
|
||||
$_REQUEST['VALUE'] = G::decrypt(urldecode(utf8_encode($_REQUEST['VALUE'])), URL_KEY, true);
|
||||
$_REQUEST['ABER'] = G::decrypt(urldecode(utf8_encode($_REQUEST['ABER'])), URL_KEY, true);
|
||||
|
||||
$case = new Cases();
|
||||
$actionsByEmail = new \ProcessMaker\BusinessModel\ActionsByEmail();
|
||||
|
||||
@@ -60,363 +60,314 @@ class ldapadvancedClassCron
|
||||
$aDepartments = $plugin->getDepartments("");
|
||||
$aGroups = $plugin->getGroups();
|
||||
|
||||
//$arrayDepartmentUserAd = array(); //(D) Update Users
|
||||
//$arrayGroupUserAd = array(); //(G) Update Users
|
||||
|
||||
//echo "\n";
|
||||
|
||||
$plugin->frontEndShow("START");
|
||||
|
||||
$plugin->debugLog("START");
|
||||
|
||||
foreach ($arrayAuthenticationSource as $value) {
|
||||
$arrayAuthenticationSourceData = $value;
|
||||
try {
|
||||
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$arrayAuthenticationSourceData ---->\n" . print_r($arrayAuthenticationSourceData, true));
|
||||
|
||||
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$arrayAuthenticationSourceData ---->\n" . print_r($arrayAuthenticationSourceData, true));
|
||||
$plugin->sAuthSource = $arrayAuthenticationSourceData["AUTH_SOURCE_UID"];
|
||||
$plugin->ldapcnn = null;
|
||||
|
||||
$plugin->sAuthSource = $arrayAuthenticationSourceData["AUTH_SOURCE_UID"];
|
||||
$plugin->ldapcnn = null;
|
||||
$plugin->setArrayDepartmentUserSynchronizedChecked(array());
|
||||
$plugin->setArrayUserUpdateChecked(array());
|
||||
|
||||
$plugin->setArrayDepartmentUserSynchronizedChecked(array());
|
||||
$plugin->setArrayUserUpdateChecked(array());
|
||||
//Get all User (USR_UID, USR_USERNAME, USR_AUTH_USER_DN) registered in RBAC with this Authentication Source
|
||||
$plugin->setArrayAuthenticationSourceUsers($arrayAuthenticationSourceData["AUTH_SOURCE_UID"]); //INITIALIZE DATA
|
||||
|
||||
//Get all User (USR_UID, USR_USERNAME, USR_AUTH_USER_DN) registered in RBAC with this Authentication Source
|
||||
$plugin->setArrayAuthenticationSourceUsers($arrayAuthenticationSourceData["AUTH_SOURCE_UID"]); //INITIALIZE DATA
|
||||
$plugin->frontEndShow("TEXT", "Authentication Source: " . $arrayAuthenticationSourceData["AUTH_SOURCE_NAME"]);
|
||||
|
||||
$plugin->frontEndShow("TEXT", "Authentication Source: " . $arrayAuthenticationSourceData["AUTH_SOURCE_NAME"]);
|
||||
$plugin->log(null, "Executing cron for Authentication Source: " . $arrayAuthenticationSourceData["AUTH_SOURCE_NAME"]);
|
||||
|
||||
$plugin->log(null, "Executing cron for Authentication Source: " . $arrayAuthenticationSourceData["AUTH_SOURCE_NAME"]);
|
||||
//Get all departments from Ldap/ActiveDirectory and build a hierarchy using dn (ou->ou parent)
|
||||
$aLdapDepts = $plugin->searchDepartments();
|
||||
|
||||
//Get all departments from Ldap/ActiveDirectory and build a hierarchy using dn (ou->ou parent)
|
||||
$aLdapDepts = $plugin->searchDepartments();
|
||||
//Obtain all departments from PM with a valid department in LDAP/ActiveDirectory
|
||||
$aRegisteredDepts = $plugin->getRegisteredDepartments($aLdapDepts, $aDepartments);
|
||||
|
||||
//Obtain all departments from PM with a valid department in LDAP/ActiveDirectory
|
||||
$aRegisteredDepts = $plugin->getRegisteredDepartments($aLdapDepts, $aDepartments);
|
||||
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$aRegisteredDepts ---->\n" . print_r($aRegisteredDepts, true));
|
||||
|
||||
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$aRegisteredDepts ---->\n" . print_r($aRegisteredDepts, true));
|
||||
//Get all group from Ldap/ActiveDirectory
|
||||
$aLdapGroups = $plugin->searchGroups();
|
||||
|
||||
//Get all group from Ldap/ActiveDirectory
|
||||
$aLdapGroups = $plugin->searchGroups();
|
||||
//Obtain all groups from PM with a valid group in LDAP/ActiveDirectory
|
||||
$aRegisteredGroups = $plugin->getRegisteredGroups($aLdapGroups, $aGroups);
|
||||
|
||||
//Obtain all groups from PM with a valid group in LDAP/ActiveDirectory
|
||||
$aRegisteredGroups = $plugin->getRegisteredGroups($aLdapGroups, $aGroups);
|
||||
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$aRegisteredGroups ---->\n" . print_r($aRegisteredGroups, true));
|
||||
|
||||
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$aRegisteredGroups ---->\n" . print_r($aRegisteredGroups, true));
|
||||
//Get all users from Removed OU
|
||||
$this->usersRemovedOu = $plugin->getUsersFromRemovedOu($arrayAuthenticationSourceData);
|
||||
$plugin->deactiveArrayOfUsers($this->usersRemovedOu);
|
||||
|
||||
//Get all users from Removed OU
|
||||
$this->usersRemovedOu = $plugin->getUsersFromRemovedOu($arrayAuthenticationSourceData);
|
||||
$plugin->deactiveArrayOfUsers($this->usersRemovedOu);
|
||||
//Variables
|
||||
$this->deletedRemoved = count($this->usersRemovedOu);
|
||||
$this->deletedRemovedUsers = "";
|
||||
|
||||
//Variables
|
||||
$this->deletedRemoved = count($this->usersRemovedOu);
|
||||
$this->deletedRemovedUsers = "";
|
||||
$this->dAlready = 0;
|
||||
$this->dMoved = 0;
|
||||
$this->dImpossible = 0;
|
||||
$this->dCreated = 0;
|
||||
$this->dRemoved = 0;
|
||||
$this->dAlreadyUsers = "";
|
||||
$this->dMovedUsers = "";
|
||||
$this->dImpossibleUsers = "";
|
||||
$this->dCreatedUsers = "";
|
||||
$this->dRemovedUsers = "";
|
||||
|
||||
$this->dAlready = 0;
|
||||
$this->dMoved = 0;
|
||||
$this->dImpossible = 0;
|
||||
$this->dCreated = 0;
|
||||
$this->dRemoved = 0;
|
||||
$this->dAlreadyUsers = "";
|
||||
$this->dMovedUsers = "";
|
||||
$this->dImpossibleUsers = "";
|
||||
$this->dCreatedUsers = "";
|
||||
$this->dRemovedUsers = "";
|
||||
$this->gAlready = 0;
|
||||
$this->gMoved = 0;
|
||||
$this->gImpossible = 0;
|
||||
$this->gCreated = 0;
|
||||
$this->gRemoved = 0;
|
||||
$this->gAlreadyUsers = "";
|
||||
$this->gMovedUsers = "";
|
||||
$this->gImpossibleUsers = "";
|
||||
$this->gCreatedUsers = "";
|
||||
$this->gRemovedUsers = "";
|
||||
|
||||
$this->gAlready = 0;
|
||||
$this->gMoved = 0;
|
||||
$this->gImpossible = 0;
|
||||
$this->gCreated = 0;
|
||||
$this->gRemoved = 0;
|
||||
$this->gAlreadyUsers = "";
|
||||
$this->gMovedUsers = "";
|
||||
$this->gImpossibleUsers = "";
|
||||
$this->gCreatedUsers = "";
|
||||
$this->gRemovedUsers = "";
|
||||
//Department - Synchronize Users
|
||||
$numDepartments = count($aRegisteredDepts);
|
||||
$count = 0;
|
||||
|
||||
//Department - Synchronize Users
|
||||
$numDepartments = count($aRegisteredDepts);
|
||||
$count = 0;
|
||||
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$numDepartments ----> $numDepartments");
|
||||
|
||||
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$numDepartments ----> $numDepartments");
|
||||
|
||||
foreach ($aRegisteredDepts as $registeredDept) {
|
||||
$count++;
|
||||
|
||||
//(D) Update Users
|
||||
//if (!isset($arrayDepartmentUserAd[$registeredDept["DEP_UID"]])) {
|
||||
// $arrayDepartmentUserAd[$registeredDept["DEP_UID"]] = array(); //Current users in department based in Active Directory
|
||||
//}
|
||||
//
|
||||
//$arrayAux = $this->departmentSynchronizeUsers($plugin, $numDepartments, $count, $registeredDept);
|
||||
//$arrayAux = array_merge($arrayDepartmentUserAd[$registeredDept["DEP_UID"]], $arrayAux);
|
||||
//
|
||||
//$arrayDepartmentUserAd[$registeredDept["DEP_UID"]] = array_unique($arrayAux);
|
||||
|
||||
$arrayAux = $this->departmentSynchronizeUsers($plugin, $numDepartments, $count, $registeredDept);
|
||||
}
|
||||
|
||||
//Department - Print log
|
||||
$logResults = sprintf(
|
||||
"- Departments -> Existing users: %d, moved: %d, impossible: %d, created: %d, removed: %d",
|
||||
$this->dAlready,
|
||||
$this->dMoved,
|
||||
$this->dImpossible,
|
||||
$this->dCreated,
|
||||
$this->dRemoved
|
||||
);
|
||||
|
||||
$plugin->frontEndShow("TEXT", $logResults);
|
||||
|
||||
$plugin->log(null, $logResults);
|
||||
|
||||
//Group - Synchronize Users
|
||||
$numGroups = count($aRegisteredGroups);
|
||||
$count = 0;
|
||||
|
||||
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$numGroups ----> $numGroups");
|
||||
|
||||
foreach ($aRegisteredGroups as $registeredGroup) {
|
||||
$count++;
|
||||
|
||||
//(G) Update Users
|
||||
//if (!isset($arrayGroupUserAd[$registeredGroup["GRP_UID"]])) {
|
||||
// $arrayGroupUserAd[$registeredGroup["GRP_UID"]] = array(); //Current users in group based in Active Directory
|
||||
//}
|
||||
//
|
||||
//$arrayAux = $this->groupSynchronizeUsers($plugin, $numGroups, $count, $registeredGroup);
|
||||
//$arrayAux = array_merge($arrayGroupUserAd[$registeredGroup["GRP_UID"]], $arrayAux);
|
||||
//
|
||||
//$arrayGroupUserAd[$registeredGroup["GRP_UID"]] = array_unique($arrayAux);
|
||||
|
||||
$arrayAux = $this->groupSynchronizeUsers($plugin, $numGroups, $count, $registeredGroup);
|
||||
}
|
||||
|
||||
//Group - Print log
|
||||
$logResults = sprintf(
|
||||
"- Groups -> Existing users: %d, moved: %d, impossible: %d, created: %d, removed: %d",
|
||||
$this->gAlready,
|
||||
$this->gMoved,
|
||||
$this->gImpossible,
|
||||
$this->gCreated,
|
||||
$this->gRemoved
|
||||
);
|
||||
|
||||
$plugin->frontEndShow("TEXT", $logResults);
|
||||
|
||||
$plugin->log(null, $logResults);
|
||||
|
||||
//Manager
|
||||
$plugin->clearManager($this->managersToClear);
|
||||
|
||||
if (isset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"])) {
|
||||
if (is_array($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"])) {
|
||||
foreach ($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"] as $departmentUID) {
|
||||
// Delete manager assignments
|
||||
$criteriaSet = new Criteria("workflow");
|
||||
$criteriaSet->add(UsersPeer::USR_REPORTS_TO, "");
|
||||
$criteriaWhere = new Criteria("workflow");
|
||||
$criteriaWhere->add(UsersPeer::DEP_UID, $departmentUID);
|
||||
$criteriaWhere->add(UsersPeer::USR_REPORTS_TO, "", Criteria::NOT_EQUAL);
|
||||
$this->deletedManager = BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
|
||||
// Delete department assignments
|
||||
$criteriaSet = new Criteria("workflow");
|
||||
$criteriaSet->add(UsersPeer::DEP_UID, "");
|
||||
$criteriaWhere = new Criteria("workflow");
|
||||
$criteriaWhere->add(UsersPeer::DEP_UID, $departmentUID);
|
||||
$this->dMoved += UsersPeer::doCount($criteriaWhere);
|
||||
BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
|
||||
}
|
||||
foreach ($aRegisteredDepts as $registeredDept) {
|
||||
$count++;
|
||||
$arrayAux = $this->departmentSynchronizeUsers($plugin, $numDepartments, $count, $registeredDept);
|
||||
}
|
||||
|
||||
unset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"]);
|
||||
//Department - Print log
|
||||
$logResults = sprintf(
|
||||
"- Departments -> Existing users: %d, moved: %d, impossible: %d, created: %d, removed: %d",
|
||||
$this->dAlready,
|
||||
$this->dMoved,
|
||||
$this->dImpossible,
|
||||
$this->dCreated,
|
||||
$this->dRemoved
|
||||
);
|
||||
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac->authSourcesObj->update($arrayAuthenticationSourceData);
|
||||
}
|
||||
$plugin->frontEndShow("TEXT", $logResults);
|
||||
|
||||
if (isset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"])) {
|
||||
if (is_array($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"])) {
|
||||
foreach ($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"] as $groupUID) {
|
||||
// Delete manager assignments
|
||||
$groupsInstance = new Groups();
|
||||
$criteria = $groupsInstance->getUsersGroupCriteria($groupUID);
|
||||
$dataset = UsersPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$users = array();
|
||||
$plugin->log(null, $logResults);
|
||||
|
||||
while ($row = $dataset->getRow()) {
|
||||
$users[] = $row["USR_UID"];
|
||||
//Group - Synchronize Users
|
||||
$numGroups = count($aRegisteredGroups);
|
||||
$count = 0;
|
||||
|
||||
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$numGroups ----> $numGroups");
|
||||
|
||||
foreach ($aRegisteredGroups as $registeredGroup) {
|
||||
$count++;
|
||||
$arrayAux = $this->groupSynchronizeUsers($plugin, $numGroups, $count, $registeredGroup);
|
||||
}
|
||||
|
||||
//Group - Print log
|
||||
$logResults = sprintf(
|
||||
"- Groups -> Existing users: %d, moved: %d, impossible: %d, created: %d, removed: %d",
|
||||
$this->gAlready,
|
||||
$this->gMoved,
|
||||
$this->gImpossible,
|
||||
$this->gCreated,
|
||||
$this->gRemoved
|
||||
);
|
||||
|
||||
$plugin->frontEndShow("TEXT", $logResults);
|
||||
|
||||
$plugin->log(null, $logResults);
|
||||
|
||||
//Manager
|
||||
$plugin->clearManager($this->managersToClear);
|
||||
|
||||
if (isset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"])) {
|
||||
if (is_array($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"])) {
|
||||
foreach ($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"] as $departmentUID) {
|
||||
// Delete manager assignments
|
||||
$criteriaSet = new Criteria("workflow");
|
||||
$criteriaSet->add(UsersPeer::USR_REPORTS_TO, "");
|
||||
$criteriaWhere = new Criteria("workflow");
|
||||
$criteriaWhere->add(UsersPeer::DEP_UID, $departmentUID);
|
||||
$criteriaWhere->add(UsersPeer::USR_REPORTS_TO, "", Criteria::NOT_EQUAL);
|
||||
$this->deletedManager = BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
|
||||
// Delete department assignments
|
||||
$criteriaSet = new Criteria("workflow");
|
||||
$criteriaSet->add(UsersPeer::DEP_UID, "");
|
||||
$criteriaWhere = new Criteria("workflow");
|
||||
$criteriaWhere->add(UsersPeer::DEP_UID, $departmentUID);
|
||||
$this->dMoved += UsersPeer::doCount($criteriaWhere);
|
||||
BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
|
||||
}
|
||||
}
|
||||
|
||||
unset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"]);
|
||||
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac->authSourcesObj->update($arrayAuthenticationSourceData);
|
||||
}
|
||||
|
||||
if (isset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"])) {
|
||||
if (is_array($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"])) {
|
||||
foreach ($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"] as $groupUID) {
|
||||
// Delete manager assignments
|
||||
$groupsInstance = new Groups();
|
||||
$criteria = $groupsInstance->getUsersGroupCriteria($groupUID);
|
||||
$dataset = UsersPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
}
|
||||
$users = array();
|
||||
|
||||
$criteriaSet = new Criteria("workflow");
|
||||
$criteriaSet->add(UsersPeer::USR_REPORTS_TO, "");
|
||||
$criteriaWhere = new Criteria("workflow");
|
||||
$criteriaWhere->add(UsersPeer::USR_UID, $users, Criteria::IN);
|
||||
$criteriaWhere->add(UsersPeer::USR_REPORTS_TO, "", Criteria::NOT_EQUAL);
|
||||
$this->deletedManager = BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
|
||||
|
||||
// Delete group assignments
|
||||
$criteria = new Criteria("workflow");
|
||||
$criteria->add(GroupUserPeer::GRP_UID, $groupUID);
|
||||
$this->gMoved += GroupUserPeer::doCount($criteria);
|
||||
BasePeer::doDelete($criteria, Propel::getConnection("workflow"));
|
||||
}
|
||||
}
|
||||
|
||||
unset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"]);
|
||||
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac->authSourcesObj->update($arrayAuthenticationSourceData);
|
||||
}
|
||||
|
||||
// Delete the managers that not exists in PM
|
||||
$criteria = new Criteria("rbac");
|
||||
$criteria->addSelectColumn(RbacUsersPeer::USR_AUTH_USER_DN);
|
||||
$criteria->add(RbacUsersPeer::USR_AUTH_USER_DN, "", Criteria::NOT_EQUAL);
|
||||
$dataset = RbacUsersPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$existingUsers = array();
|
||||
|
||||
while ($row = $dataset->getRow()) {
|
||||
$existingUsers[] = $row["USR_AUTH_USER_DN"];
|
||||
$dataset->next();
|
||||
}
|
||||
|
||||
foreach ($this->managersHierarchy as $managerDN => $subordinates) {
|
||||
if (!in_array($managerDN, $existingUsers)) {
|
||||
unset($this->managersHierarchy[$managerDN]);
|
||||
}
|
||||
}
|
||||
|
||||
// Get the managers assigments counters
|
||||
$plugin->synchronizeManagers($this->managersHierarchy);
|
||||
|
||||
$deletedManagersAssignments = self::array_diff_assoc_recursive($this->oldManagersHierarchy, $this->managersHierarchy);
|
||||
$newManagersAssignments = self::array_diff_assoc_recursive($this->managersHierarchy, $this->oldManagersHierarchy);
|
||||
$deletedManagers = array();
|
||||
$newManagers = array();
|
||||
$movedManagers = array();
|
||||
|
||||
if (is_array($deletedManagersAssignments)) {
|
||||
foreach ($deletedManagersAssignments as $dn1 => $subordinates1) {
|
||||
foreach ($subordinates1 as $subordinate) {
|
||||
if (!in_array($subordinate, $deletedManagers)) {
|
||||
$deletedManagers[] = $subordinate;
|
||||
}
|
||||
|
||||
foreach ($newManagersAssignments as $dn2 => $subordinates2) {
|
||||
if (isset($subordinates2[$subordinate])) {
|
||||
$movedManagers[] = $subordinate;
|
||||
while ($row = $dataset->getRow()) {
|
||||
$users[] = $row["USR_UID"];
|
||||
$dataset->next();
|
||||
}
|
||||
|
||||
$criteriaSet = new Criteria("workflow");
|
||||
$criteriaSet->add(UsersPeer::USR_REPORTS_TO, "");
|
||||
$criteriaWhere = new Criteria("workflow");
|
||||
$criteriaWhere->add(UsersPeer::USR_UID, $users, Criteria::IN);
|
||||
$criteriaWhere->add(UsersPeer::USR_REPORTS_TO, "", Criteria::NOT_EQUAL);
|
||||
$this->deletedManager = BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
|
||||
|
||||
// Delete group assignments
|
||||
$criteria = new Criteria("workflow");
|
||||
$criteria->add(GroupUserPeer::GRP_UID, $groupUID);
|
||||
$this->gMoved += GroupUserPeer::doCount($criteria);
|
||||
BasePeer::doDelete($criteria, Propel::getConnection("workflow"));
|
||||
}
|
||||
}
|
||||
|
||||
unset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"]);
|
||||
|
||||
$rbac = &RBAC::getSingleton();
|
||||
$rbac->authSourcesObj->update($arrayAuthenticationSourceData);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_array($newManagersAssignments)) {
|
||||
foreach ($newManagersAssignments as $dn1 => $subordinates1) {
|
||||
foreach ($subordinates1 as $subordinate) {
|
||||
if (!in_array($subordinate, $newManagers)) {
|
||||
$newManagers[] = $subordinate;
|
||||
}
|
||||
// Delete the managers that not exists in PM
|
||||
$criteria = new Criteria("rbac");
|
||||
$criteria->addSelectColumn(RbacUsersPeer::USR_AUTH_USER_DN);
|
||||
$criteria->add(RbacUsersPeer::USR_AUTH_USER_DN, "", Criteria::NOT_EQUAL);
|
||||
$dataset = RbacUsersPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$existingUsers = array();
|
||||
|
||||
foreach ($deletedManagersAssignments as $dn2 => $subordinates2) {
|
||||
if (isset($subordinates2[$subordinate])) {
|
||||
if (!in_array($subordinate, $movedManagers)) {
|
||||
while ($row = $dataset->getRow()) {
|
||||
$existingUsers[] = $row["USR_AUTH_USER_DN"];
|
||||
$dataset->next();
|
||||
}
|
||||
|
||||
foreach ($this->managersHierarchy as $managerDN => $subordinates) {
|
||||
if (!in_array($managerDN, $existingUsers)) {
|
||||
unset($this->managersHierarchy[$managerDN]);
|
||||
}
|
||||
}
|
||||
|
||||
// Get the managers assigments counters
|
||||
$plugin->synchronizeManagers($this->managersHierarchy);
|
||||
|
||||
$deletedManagersAssignments = self::array_diff_assoc_recursive($this->oldManagersHierarchy, $this->managersHierarchy);
|
||||
$newManagersAssignments = self::array_diff_assoc_recursive($this->managersHierarchy, $this->oldManagersHierarchy);
|
||||
$deletedManagers = array();
|
||||
$newManagers = array();
|
||||
$movedManagers = array();
|
||||
|
||||
if (is_array($deletedManagersAssignments)) {
|
||||
foreach ($deletedManagersAssignments as $dn1 => $subordinates1) {
|
||||
foreach ($subordinates1 as $subordinate) {
|
||||
if (!in_array($subordinate, $deletedManagers)) {
|
||||
$deletedManagers[] = $subordinate;
|
||||
}
|
||||
|
||||
foreach ($newManagersAssignments as $dn2 => $subordinates2) {
|
||||
if (isset($subordinates2[$subordinate])) {
|
||||
$movedManagers[] = $subordinate;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (is_array($newManagersAssignments)) {
|
||||
foreach ($newManagersAssignments as $dn1 => $subordinates1) {
|
||||
foreach ($subordinates1 as $subordinate) {
|
||||
if (!in_array($subordinate, $newManagers)) {
|
||||
$newManagers[] = $subordinate;
|
||||
}
|
||||
|
||||
foreach ($deletedManagersAssignments as $dn2 => $subordinates2) {
|
||||
if (isset($subordinates2[$subordinate])) {
|
||||
if (!in_array($subordinate, $movedManagers)) {
|
||||
$movedManagers[] = $subordinate;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Print and log the users's information
|
||||
//Deleted/Removed Users
|
||||
$logResults = sprintf("- Deleted/Removed Users: %d", $this->deletedRemoved);
|
||||
|
||||
$plugin->frontEndShow("TEXT", $logResults);
|
||||
|
||||
$plugin->log(null, $logResults);
|
||||
|
||||
if ($this->deletedRemoved > 0) {
|
||||
$plugin->log(null, "Deleted/Removed Users: ");
|
||||
$plugin->log(null, $this->deletedRemovedUsers);
|
||||
}
|
||||
|
||||
if ($this->dAlready + $this->gAlready > 0) {
|
||||
$plugin->log(null, "Existing Users: ");
|
||||
$plugin->log(null, $this->dAlreadyUsers . " " . $this->gAlreadyUsers);
|
||||
}
|
||||
|
||||
if ($this->dMoved + $this->gMoved > 0) {
|
||||
$plugin->log(null, "Moved Users: ");
|
||||
$plugin->log(null, $this->dMovedUsers . " " . $this->gMovedUsers);
|
||||
}
|
||||
|
||||
if ($this->dImpossible + $this->gImpossible > 0) {
|
||||
$plugin->log(null, "Impossible Users: ");
|
||||
$plugin->log(null, $this->dImpossibleUsers . " " . $this->gImpossibleUsers);
|
||||
}
|
||||
|
||||
if ($this->dCreated + $this->gCreated > 0) {
|
||||
$plugin->log(null, "Created Users: ");
|
||||
$plugin->log(null, $this->dCreatedUsers . " " . $this->gCreatedUsers);
|
||||
}
|
||||
|
||||
if ($this->dRemoved + $this->gRemoved > 0) {
|
||||
$plugin->log(null, "Removed Users: ");
|
||||
$plugin->log(null, $this->dRemovedUsers . " " . $this->gRemovedUsers);
|
||||
}
|
||||
|
||||
//Print and log the managers assignments"s information
|
||||
$logResults = sprintf(
|
||||
"- Managers assignments: created %d, moved %d, removed %d",
|
||||
count($newManagers) - count($movedManagers),
|
||||
count($movedManagers),
|
||||
count($deletedManagers) - count($movedManagers) + $this->deletedManager
|
||||
);
|
||||
|
||||
$plugin->frontEndShow("TEXT", $logResults);
|
||||
|
||||
$plugin->log(null, $logResults);
|
||||
|
||||
//Update Users data based on the LDAP Server
|
||||
$plugin->usersUpdateData($arrayAuthenticationSourceData["AUTH_SOURCE_UID"]);
|
||||
} catch (Exception $e) {
|
||||
$context = Bootstrap::getDefaultContextLog();
|
||||
$context["action"] = "ldapSynchronize";
|
||||
$context["authSource"] = $arrayAuthenticationSourceData;
|
||||
Bootstrap::registerMonolog("ldapSynchronize", 400, $e->getMessage(), $context, $context["workspace"], "processmaker.log");
|
||||
}
|
||||
|
||||
//Print and log the users's information
|
||||
//Deleted/Removed Users
|
||||
$logResults = sprintf("- Deleted/Removed Users: %d", $this->deletedRemoved);
|
||||
|
||||
$plugin->frontEndShow("TEXT", $logResults);
|
||||
|
||||
$plugin->log(null, $logResults);
|
||||
|
||||
if ($this->deletedRemoved > 0) {
|
||||
$plugin->log(null, "Deleted/Removed Users: ");
|
||||
$plugin->log(null, $this->deletedRemovedUsers);
|
||||
}
|
||||
|
||||
if ($this->dAlready + $this->gAlready > 0) {
|
||||
$plugin->log(null, "Existing Users: ");
|
||||
$plugin->log(null, $this->dAlreadyUsers . " " . $this->gAlreadyUsers);
|
||||
}
|
||||
|
||||
if ($this->dMoved + $this->gMoved > 0) {
|
||||
$plugin->log(null, "Moved Users: ");
|
||||
$plugin->log(null, $this->dMovedUsers . " " . $this->gMovedUsers);
|
||||
}
|
||||
|
||||
if ($this->dImpossible + $this->gImpossible > 0) {
|
||||
$plugin->log(null, "Impossible Users: ");
|
||||
$plugin->log(null, $this->dImpossibleUsers . " " . $this->gImpossibleUsers);
|
||||
}
|
||||
|
||||
if ($this->dCreated + $this->gCreated > 0) {
|
||||
$plugin->log(null, "Created Users: ");
|
||||
$plugin->log(null, $this->dCreatedUsers . " " . $this->gCreatedUsers);
|
||||
}
|
||||
|
||||
if ($this->dRemoved + $this->gRemoved > 0) {
|
||||
$plugin->log(null, "Removed Users: ");
|
||||
$plugin->log(null, $this->dRemovedUsers . " " . $this->gRemovedUsers);
|
||||
}
|
||||
|
||||
//Print and log the managers assignments"s information
|
||||
$logResults = sprintf(
|
||||
"- Managers assignments: created %d, moved %d, removed %d",
|
||||
count($newManagers) - count($movedManagers),
|
||||
count($movedManagers),
|
||||
count($deletedManagers) - count($movedManagers) + $this->deletedManager
|
||||
);
|
||||
|
||||
$plugin->frontEndShow("TEXT", $logResults);
|
||||
|
||||
$plugin->log(null, $logResults);
|
||||
|
||||
//Update Users data based on the LDAP Server
|
||||
$plugin->usersUpdateData($arrayAuthenticationSourceData["AUTH_SOURCE_UID"]);
|
||||
}
|
||||
|
||||
$plugin->frontEndShow("END");
|
||||
|
||||
//(D) Update Users
|
||||
////Department //Upgrade users in departments
|
||||
//foreach ($arrayDepartmentUserAd as $departmentUid => $arrayUserAd) {
|
||||
// $plugin->setArrayDepartmentUsers($departmentUid); //INITIALIZE DATA
|
||||
//
|
||||
// $arrayAux = array_diff(array_keys($plugin->arrayDepartmentUsersByUid), $arrayUserAd);
|
||||
//
|
||||
// $this->departmentRemoveUsers($departmentUid, $arrayAux);
|
||||
//}
|
||||
|
||||
//(G) Update Users
|
||||
////Group //Upgrade users in groups
|
||||
//foreach ($arrayGroupUserAd as $groupUid => $arrayUserAd) {
|
||||
// $plugin->setArrayGroupUsers($groupUid); //INITIALIZE DATA
|
||||
//
|
||||
// $arrayAux = array_diff(array_keys($plugin->arrayGroupUsersByUid), $arrayUserAd);
|
||||
//
|
||||
// $this->groupRemoveUsers($groupUid, $arrayAux);
|
||||
//}
|
||||
|
||||
//// Developed by Gary and Ronald
|
||||
//$usersInfo = $plugin->ASUpdateInfo('');
|
||||
//if (isset($usersInfo) && $usersInfo > 0) {
|
||||
// $this->dMoved = $usersInfo;
|
||||
//}
|
||||
//// End Developed by Gary and Ronald
|
||||
|
||||
$plugin->debugLog("END");
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ function AuthenticationBasicHTTP ($realm)
|
||||
return false;
|
||||
}
|
||||
|
||||
$realm = 'ProcessMaker Filesystem for Workspace ' . SYS_SYS;
|
||||
$realm = 'ProcessMaker Filesystem for Workspace ' . config("system.workspace");
|
||||
|
||||
# Choice an authentification type Digest or Basic
|
||||
//AuthenticationDigestHTTP($realm, $users, $phpcgi);
|
||||
|
||||
@@ -6,7 +6,7 @@ $content = file_get_contents($filewsdl);
|
||||
$http = G::is_https() ? 'https' : 'http';
|
||||
$port = $_SERVER['SERVER_PORT'] === '80' ? '' : ':' . $_SERVER['SERVER_PORT'];
|
||||
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
|
||||
$endpoint = $http . '://' . $_SERVER['SERVER_NAME'] . $port . '/sys' . SYS_SYS . '/' . $lang . '/neoclassic/services/soap2';
|
||||
$endpoint = $http . '://' . $_SERVER['SERVER_NAME'] . $port . '/sys' . config("system.workspace") . '/' . $lang . '/neoclassic/services/soap2';
|
||||
|
||||
$content = str_replace("___SOAP_ADDRESS___", $endpoint, $content);
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ $response = array ();
|
||||
switch ($option) {
|
||||
case "LST":
|
||||
$pageSize = $_REQUEST["pageSize"];
|
||||
$workspace = SYS_SYS;
|
||||
$workspace = config("system.workspace");
|
||||
$action = $_REQUEST["action"];
|
||||
$description = $_REQUEST["description"];
|
||||
$dateFrom = $_REQUEST["dateFrom"];
|
||||
|
||||
@@ -116,7 +116,7 @@ $response = array ();
|
||||
switch ($option) {
|
||||
case "LST":
|
||||
$pageSize = $_REQUEST["pageSize"];
|
||||
$workspace = SYS_SYS;
|
||||
$workspace = config("system.workspace");
|
||||
$status = $_REQUEST["status"];
|
||||
$dateFrom = $_REQUEST["dateFrom"];
|
||||
$dateTo = $_REQUEST["dateTo"];
|
||||
|
||||
@@ -1,60 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* languages_Import.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.
|
||||
*/
|
||||
|
||||
require_once "classes/model/Language.php";
|
||||
|
||||
global $RBAC;
|
||||
$access = $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' );
|
||||
$access = $RBAC->userCanAccess('PM_SETUP_ADVANCE');
|
||||
|
||||
if ($access != 1) {
|
||||
switch ($access) {
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
break;
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
break;
|
||||
default:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
break;
|
||||
}
|
||||
G::header( 'location: ../login/login' );
|
||||
exit( 0 );
|
||||
G::header('location: ../login/login');
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$result = new stdClass();
|
||||
|
||||
try {
|
||||
//if the xmlform path is writeable
|
||||
if (! is_writable( PATH_XMLFORM ))
|
||||
throw new Exception( G::LoadTranslation( 'IMPORT_LANGUAGE_ERR_NO_WRITABLE' ) );
|
||||
if (!is_writable(PATH_XMLFORM)) {
|
||||
throw new Exception(G::LoadTranslation('IMPORT_LANGUAGE_ERR_NO_WRITABLE'));
|
||||
}
|
||||
|
||||
//if all xml files within the xmlform directory are writeable
|
||||
if (! G::is_rwritable( PATH_XMLFORM ))
|
||||
throw new Exception( G::LoadTranslation( 'IMPORT_LANGUAGE_ERR_NO_WRITABLE2' ) );
|
||||
//if all xml files within the xmlform directory are writeable
|
||||
if (!G::is_rwritable(PATH_XMLFORM)) {
|
||||
throw new Exception(G::LoadTranslation('IMPORT_LANGUAGE_ERR_NO_WRITABLE2'));
|
||||
}
|
||||
|
||||
$sMaxExecutionTime = ini_get( 'max_execution_time' );
|
||||
ini_set( 'max_execution_time', '0' );
|
||||
$sMaxExecutionTime = ini_get('max_execution_time');
|
||||
ini_set('max_execution_time', '0');
|
||||
|
||||
$filter = new InputFilter();
|
||||
|
||||
@@ -62,56 +43,51 @@ try {
|
||||
$languageFilename = $_FILES['form']['name']['LANGUAGE_FILENAME'];
|
||||
$languageFile = $filter->xssFilterHard($languageFile, 'path');
|
||||
$languageFilename = $filter->xssFilterHard($languageFilename, 'path');
|
||||
if (substr_compare( $languageFilename, ".gz", - 3, 3, true ) == 0) {
|
||||
$zp = gzopen( $languageFile, "r" );
|
||||
$languageFile = tempnam( __FILE__, '' );
|
||||
$handle = fopen( $languageFile, "w" );
|
||||
while (! gzeof( $zp )) {
|
||||
$data = gzread( $zp, 1024 );
|
||||
fwrite( $handle, $data );
|
||||
if (substr_compare($languageFilename, ".gz", - 3, 3, true) == 0) {
|
||||
$zp = gzopen($languageFile, "r");
|
||||
$languageFile = tempnam(__FILE__, '');
|
||||
$handle = fopen($languageFile, "w");
|
||||
while (!gzeof($zp)) {
|
||||
$data = gzread($zp, 1024);
|
||||
fwrite($handle, $data);
|
||||
}
|
||||
gzclose( $zp );
|
||||
fclose( $handle );
|
||||
gzclose($zp);
|
||||
fclose($handle);
|
||||
}
|
||||
|
||||
$language = new Language();
|
||||
$configuration = new Configurations();
|
||||
$importResults = $language->import( $languageFile );
|
||||
$importResults = $language->import($languageFile);
|
||||
|
||||
$renegerateContent = new WorkspaceTools( SYS_SYS );
|
||||
$messs = $renegerateContent->upgradeContent();
|
||||
|
||||
$result->msg = G::LoadTranslation( 'IMPORT_LANGUAGE_SUCCESS' ) . "\n";
|
||||
$result->success = true;
|
||||
$result->msg = G::LoadTranslation('IMPORT_LANGUAGE_SUCCESS') . "\n";
|
||||
$result->msg .= G::LoadTranslation("ID_FILE_NUM_RECORD") . $importResults->recordsCount . "\n";
|
||||
$result->msg .= G::LoadTranslation("ID_SUCCESS_RECORD") . $importResults->recordsCountSuccess . "\n";
|
||||
$result->msg .= G::LoadTranslation("ID_FAILED_RECORD") . ($importResults->recordsCount - $importResults->recordsCountSuccess) . "\n";
|
||||
|
||||
if ($importResults->errMsg != '') {
|
||||
$result->msg .= G::LoadTranslation("ID_ERROR_REGISTERED"). " \n" . $importResults->errMsg . "\n";
|
||||
$result->msg .= G::LoadTranslation("ID_ERROR_REGISTERED") . " \n" . $importResults->errMsg . "\n";
|
||||
}
|
||||
|
||||
//$result->msg = htmlentities($result->msg);
|
||||
$result->success = true;
|
||||
|
||||
//saving metadata
|
||||
$configuration->aConfig = Array ('headers' => $importResults->headers,'language' => $importResults->lang,'import-date' => date( 'Y-m-d H:i:s' ),'user' => '','version' => '1.0'
|
||||
);
|
||||
$configuration->saveConfig( 'LANGUAGE_META', $importResults->lang );
|
||||
$configuration = new Configurations();
|
||||
$configuration->aConfig = Array('headers' => $importResults->headers, 'language' => $importResults->lang, 'import-date' => date('Y-m-d H:i:s'), 'user' => '', 'version' => '1.0');
|
||||
$configuration->saveConfig('LANGUAGE_META', $importResults->lang);
|
||||
|
||||
$renegerateContent = new WorkspaceTools(config("system.workspace"));
|
||||
$messs = $renegerateContent->upgradeContent();
|
||||
|
||||
$dir = PATH_CORE . 'content' . PATH_SEP . 'translations' . PATH_SEP;
|
||||
if (! is_writable( $dir )) {
|
||||
throw new Exception( G::LoadTranslation( 'ID_TRANSLATIONS_FOLDER_PERMISSIONS' ) );
|
||||
if (!is_writable($dir)) {
|
||||
throw new Exception(G::LoadTranslation('ID_TRANSLATIONS_FOLDER_PERMISSIONS'));
|
||||
}
|
||||
G::uploadFile($languageFile, $dir, $languageFilename, 0777);
|
||||
|
||||
ini_set( 'max_execution_time', $sMaxExecutionTime );
|
||||
|
||||
ini_set('max_execution_time', $sMaxExecutionTime);
|
||||
} catch (Exception $oError) {
|
||||
$result->msg = $oError->getMessage();
|
||||
//print_r($oError->getTrace());
|
||||
$result->success = false;
|
||||
//G::SendTemporalMessage($oError->getMessage(), 'error', 'string');
|
||||
//G::header('location: languages_ImportForm');
|
||||
$result->msg = $oError->getMessage();
|
||||
}
|
||||
echo G::json_encode( $result );
|
||||
|
||||
ob_clean();
|
||||
echo G::json_encode($result);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ switch ($request) {
|
||||
print (G::json_encode( $result )) ;
|
||||
break;
|
||||
case 'saveSettings':
|
||||
$memcache = & PMmemcached::getSingleton( defined( 'SYS_SYS' ) ? SYS_SYS : '' );
|
||||
$memcache = & PMmemcached::getSingleton( !empty(config("system.workspace")) ? config("system.workspace") : '' );
|
||||
|
||||
$conf = new Configurations();
|
||||
$conf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
|
||||
|
||||
@@ -56,7 +56,7 @@ if ($handle = opendir(PATH_PLUGINS)) {
|
||||
) {
|
||||
//Check disabled code
|
||||
|
||||
$cs = new CodeScanner(SYS_SYS);
|
||||
$cs = new CodeScanner(config("system.workspace"));
|
||||
|
||||
$arrayFoundDisabledCode = array_merge(
|
||||
$cs->checkDisabledCode("FILE", PATH_PLUGINS . $pluginName . ".php"),
|
||||
|
||||
@@ -251,7 +251,7 @@ try {
|
||||
if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=")) {
|
||||
//Check disabled code
|
||||
|
||||
$cs = new CodeScanner(SYS_SYS);
|
||||
$cs = new CodeScanner(config("system.workspace"));
|
||||
|
||||
$arrayFoundDisabledCode = array_merge($cs->checkDisabledCode("FILE", $path . $pluginFile), $cs->checkDisabledCode("PATH", $path . $sClassName));
|
||||
|
||||
|
||||
@@ -24,5 +24,5 @@
|
||||
*/
|
||||
$RBAC->requirePermissions('PM_SETUP_ADVANCE');
|
||||
|
||||
$items = \PMPlugin::getListPluginsManager(SYS_SYS);
|
||||
$items = \PMPlugin::getListPluginsManager(config("system.workspace"));
|
||||
echo G::json_encode($items);
|
||||
|
||||
@@ -30,7 +30,7 @@ $RBAC->requirePermissions( 'PM_SETUP' );
|
||||
|
||||
$headPublisher = & headPublisher::getSingleton();
|
||||
$headPublisher->addExtJsScript( 'setup/pluginsMain', false );
|
||||
$headPublisher->assign( "PROCESSMAKER_URL", "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN );
|
||||
$headPublisher->assign( "PROCESSMAKER_URL", "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN );
|
||||
$headPublisher->assign( "SYS_SKIN", SYS_SKIN );
|
||||
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
|
||||
@@ -63,7 +63,7 @@ try { //ini_set('display_errors','1');
|
||||
$snameLogo = changeNamelogo( $snameLogo );
|
||||
|
||||
$oConf = new Configurations();
|
||||
$aConf = Array ('WORKSPACE_LOGO_NAME' => SYS_SYS,'DEFAULT_LOGO_NAME' => $snameLogo
|
||||
$aConf = Array ('WORKSPACE_LOGO_NAME' => config("system.workspace"),'DEFAULT_LOGO_NAME' => $snameLogo
|
||||
);
|
||||
|
||||
$oConf->aConfig = $aConf;
|
||||
|
||||
@@ -162,7 +162,7 @@ function newSkin ($baseSkin = 'classic')
|
||||
|
||||
$xmlConfiguration = file_get_contents( $configFileOriginal );
|
||||
|
||||
$workspace = ($_REQUEST['workspace'] == 'global') ? '' : SYS_SYS;
|
||||
$workspace = ($_REQUEST['workspace'] == 'global') ? '' : config("system.workspace");
|
||||
|
||||
$xmlConfigurationObj = G::xmlParser($xmlConfiguration);
|
||||
$skinInformationArray = $xmlConfigurationObj->result["skinConfiguration"]["__CONTENT__"]["information"]["__CONTENT__"];
|
||||
@@ -282,7 +282,7 @@ function importSkin ()
|
||||
$configFileFinal = PATH_CUSTOM_SKINS . $skinName . PATH_SEP . 'config.xml';
|
||||
$xmlConfiguration = file_get_contents( $configFileOriginal );
|
||||
|
||||
$workspace = ($_REQUEST['workspace'] == 'global') ? '' : SYS_SYS;
|
||||
$workspace = ($_REQUEST['workspace'] == 'global') ? '' : config("system.workspace");
|
||||
|
||||
$xmlConfigurationObj = G::xmlParser($xmlConfiguration);
|
||||
$skinInformationArray = $xmlConfigurationObj->result["skinConfiguration"]["__CONTENT__"]["information"]["__CONTENT__"];
|
||||
|
||||
@@ -44,7 +44,7 @@ $oHeadPublisher->addExtJsScript( 'setup/skinList', false ); //adding a javascrip
|
||||
$oHeadPublisher->addContent( 'setup/skinList' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'CONFIG', $Config );
|
||||
$oHeadPublisher->assign( 'SYS_SKIN', SYS_SKIN );
|
||||
$oHeadPublisher->assign( 'SYS_SYS', "sys".SYS_SYS );
|
||||
$oHeadPublisher->assign( 'SYS_SYS', "sys".config("system.workspace") );
|
||||
|
||||
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ switch ($_POST['action']) {
|
||||
|
||||
if (! isset( $_SESSION['END_POINT'] )) {
|
||||
$aFields['WS_HOST'] = $_SERVER['HTTP_HOST'];
|
||||
$aFields['WS_WORKSPACE'] = SYS_SYS;
|
||||
$aFields['WS_WORKSPACE'] = config("system.workspace");
|
||||
} else {
|
||||
if (strpos( $_SESSION['END_POINT'], 'https' ) !== false) {
|
||||
preg_match( '@^(?:https://)?([^/]+)@i', $_SESSION['END_POINT'], $coincidencias );
|
||||
@@ -94,15 +94,14 @@ switch ($_POST['action']) {
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
|
||||
if (! isset( $_SESSION['END_POINT'] )) {
|
||||
//$wsdl = 'http://'.$_SERVER['HTTP_HOST'].'/sys'.SYS_SYS. '/'. SYS_LANG .'/classic/services/wsdl';
|
||||
$wsdl = 'http://' . $_SERVER['HTTP_HOST'];
|
||||
$workspace = SYS_SYS;
|
||||
$workspace = config("system.workspace");
|
||||
} else {
|
||||
$wsdl = $_SESSION['END_POINT'];
|
||||
$workspace = $_SESSION['WS_WORKSPACE'];
|
||||
}
|
||||
|
||||
$defaultEndpoint = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/classic/services/wsdl2';
|
||||
$defaultEndpoint = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/classic/services/wsdl2';
|
||||
|
||||
$wsdl = isset( $_SESSION['END_POINT'] ) ? $_SESSION['END_POINT'] : $defaultEndpoint;
|
||||
|
||||
@@ -144,7 +143,7 @@ try {
|
||||
if (isset( $_POST["epr"] )) {
|
||||
$_SESSION['END_POINT'] = $_POST["epr"];
|
||||
}
|
||||
$defaultEndpoint = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/classic/services/wsdl2';
|
||||
$defaultEndpoint = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/classic/services/wsdl2';
|
||||
|
||||
$endpoint = isset( $_SESSION['END_POINT'] ) ? $_SESSION['END_POINT'] : $defaultEndpoint;
|
||||
|
||||
@@ -616,7 +615,7 @@ try {
|
||||
$caseNumber = $oCases->getAppNumber();
|
||||
|
||||
// generating the path for the template msj
|
||||
$templateFile = PATH_DB . SYS_SYS . PATH_SEP . 'mailTemplates' . PATH_SEP . $proUid . PATH_SEP . 'tempTemplate.hml';
|
||||
$templateFile = PATH_DB . config("system.workspace") . PATH_SEP . 'mailTemplates' . PATH_SEP . $proUid . PATH_SEP . 'tempTemplate.hml';
|
||||
// generating the file adding the msj variable
|
||||
$messageBody = "message for case: " . $caseNumber . "<br>" . $message;
|
||||
file_put_contents( $templateFile, $messageBody );
|
||||
@@ -1461,7 +1460,7 @@ try {
|
||||
|
||||
function sendFile ($FILENAME, $USR_UID, $APP_UID, $DEL_INDEX = 1, $DOC_UID = null, $title = null, $comment = null)
|
||||
{
|
||||
$defaultEndpoint = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/classic/services/upload';
|
||||
$defaultEndpoint = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/classic/services/upload';
|
||||
$upload = isset( $_SESSION['END_POINT'] ) ? $_SESSION['END_POINT'] : $defaultEndpoint;
|
||||
|
||||
$DOC_UID = ($DOC_UID != null) ? $DOC_UID : - 1;
|
||||
|
||||
@@ -29,7 +29,7 @@ $ses = new DBSession( $dbc );
|
||||
|
||||
if (! isset( $_SESSION['END_POINT'] )) {
|
||||
$aFields['WS_HOST'] = $_SERVER['HTTP_HOST'];
|
||||
$aFields['WS_WORKSPACE'] = SYS_SYS;
|
||||
$aFields['WS_WORKSPACE'] = config("system.workspace");
|
||||
} else {
|
||||
if (strpos( $_SESSION['END_POINT'], 'https' ) !== false) {
|
||||
preg_match( '@^(?:https://)?([^/]+)@i', $_SESSION['END_POINT'], $coincidencias );
|
||||
|
||||
@@ -1,41 +1,24 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* tools/ajaxListener.php Ajax Listener for Cases rpc requests
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com>
|
||||
* @date Jan 10th, 2010
|
||||
*/
|
||||
|
||||
$action = $_REQUEST['action'];
|
||||
unset($_REQUEST['action']);
|
||||
|
||||
global $RBAC;
|
||||
$RBAC->allows(basename(dirname(__FILE__)) . PATH_SEP . basename(__FILE__), $action);
|
||||
|
||||
$ajax = new Ajax();
|
||||
$ajax->$action($_REQUEST);
|
||||
|
||||
class Ajax
|
||||
{
|
||||
|
||||
/**
|
||||
* Get the list related to the translation
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getList($params)
|
||||
{
|
||||
$search = isset($params['search']) ? $params['search'] : null;
|
||||
@@ -46,6 +29,11 @@ class Ajax
|
||||
echo G::json_encode($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save translation
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
try {
|
||||
@@ -53,6 +41,7 @@ class Ajax
|
||||
$label = preg_replace("[\n|\r|\n\r]", ' ', $_POST['label']);
|
||||
|
||||
$res = Translation::addTranslation('LABEL', $id, 'en', $label);
|
||||
$result = new stdClass();
|
||||
if ($res['codError'] < 0) {
|
||||
$result->success = false;
|
||||
$result->msg = $res['message'];
|
||||
@@ -67,10 +56,16 @@ class Ajax
|
||||
print G::json_encode($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete translation
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$ids = explode(',', $_POST['IDS']);
|
||||
$category = 'LABEL';
|
||||
$result = new stdClass();
|
||||
|
||||
try {
|
||||
foreach ($ids as $id) {
|
||||
@@ -89,8 +84,14 @@ class Ajax
|
||||
print G::json_encode($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rebuild translation
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function rebuild()
|
||||
{
|
||||
$result = new stdClass();
|
||||
try {
|
||||
$t = new Translation();
|
||||
$result = Translation::generateFileTranslation('en');
|
||||
|
||||
@@ -65,8 +65,8 @@ if (! $sw_file_exists) {
|
||||
print G::json_encode( $res );
|
||||
} else {
|
||||
G::SendMessageText( $error_message, "ERROR" );
|
||||
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
|
||||
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
@@ -68,8 +68,8 @@ if (! $sw_file_exists) {
|
||||
print G::json_encode( $res );
|
||||
} else {
|
||||
G::SendMessageText( $error_message, "ERROR" );
|
||||
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
|
||||
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ if (isset( $sfunction ) && $sfunction == 'lookforNameTrigger') {
|
||||
) {
|
||||
//Check disabled code
|
||||
|
||||
$cs = new CodeScanner(SYS_SYS);
|
||||
$cs = new CodeScanner(config("system.workspace"));
|
||||
|
||||
$arrayFoundDisabledCode = $cs->checkDisabledCode("SOURCE", $value["TRI_WEBBOT"]);
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ if ($licensedFeatures->verifyfeature('w2LL3o4NFNiaDRXcFFCYVpJS3Jsall5dmh0ZWtBTkd
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
$arraySystemConfiguration = System::getSystemConfiguration('', '', SYS_SYS);
|
||||
$arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace"));
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'users/users', true ); //adding a javascript file .js
|
||||
|
||||
@@ -48,7 +48,7 @@ if ($licensedFeatures->verifyfeature('w2LL3o4NFNiaDRXcFFCYVpJS3Jsall5dmh0ZWtBTkd
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
$arraySystemConfiguration = System::getSystemConfiguration('', '', SYS_SYS);
|
||||
$arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace"));
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'users/users', true ); //adding a javascript file .js
|
||||
|
||||
@@ -38,7 +38,7 @@ if ($licensedFeatures->verifyfeature('w2LL3o4NFNiaDRXcFFCYVpJS3Jsall5dmh0ZWtBTkd
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
$arraySystemConfiguration = System::getSystemConfiguration('', '', SYS_SYS);
|
||||
$arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace"));
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'users/users', true ); //adding a javascript file .js
|
||||
|
||||
Reference in New Issue
Block a user