code style
This commit is contained in:
@@ -1,146 +1,117 @@
|
|||||||
<?php
|
<?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;
|
switch ($actionAjax) {
|
||||||
$criteria = Cases::getTransferHistoryCriteria($_SESSION['APPLICATION']);
|
case 'historyGridList_JXP':
|
||||||
|
global $G_PUBLISH;
|
||||||
|
$criteria = Cases::getTransferHistoryCriteria($_SESSION['APPLICATION']);
|
||||||
|
|
||||||
$rs = GulliverBasePeer::doSelectRs($criteria);
|
$dataSet = GulliverBasePeer::doSelectRs($criteria);
|
||||||
$totalCount = $rs->getRecordCount();
|
$totalCount = $dataSet->getRecordCount();
|
||||||
|
|
||||||
$start = $_REQUEST["start"];
|
$start = $_REQUEST['start'];
|
||||||
$limit = $_REQUEST["limit"];
|
$limit = $_REQUEST['limit'];
|
||||||
|
|
||||||
$criteria->setLimit($limit);
|
$criteria->setLimit($limit);
|
||||||
$criteria->setOffset($start);
|
$criteria->setOffset($start);
|
||||||
|
|
||||||
$rs = GulliverBasePeer::doSelectRs($criteria);
|
$dataSet = GulliverBasePeer::doSelectRs($criteria);
|
||||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$dataSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
$result = new stdClass();
|
$result = new stdClass();
|
||||||
$aProcesses = Array();
|
$process = [];
|
||||||
while ($rs->next()) {
|
while ($dataSet->next()) {
|
||||||
$result = $rs->getRow();
|
$result = $dataSet->getRow();
|
||||||
$result["ID_HISTORY"] = $result["PRO_UID"] . '_' . $result["APP_UID"] . '_' . $result["TAS_UID"];
|
$result['ID_HISTORY'] = $result['PRO_UID'] . '_' . $result['APP_UID'] . '_' . $result['TAS_UID'];
|
||||||
$aProcesses[] = $result;
|
$process[] = $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = new stdclass();
|
$response = new stdclass();
|
||||||
$r->data = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($aProcesses);
|
$response->data = DateTime::convertUtcToTimeZone($process);
|
||||||
$r->totalCount = $totalCount;
|
$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;
|
||||||
|
default:
|
||||||
|
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
|
<?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;
|
use ProcessMaker\Core\System;
|
||||||
|
|
||||||
@@ -28,183 +6,190 @@ $filter = new InputFilter();
|
|||||||
$_POST = $filter->xssFilterHard($_POST);
|
$_POST = $filter->xssFilterHard($_POST);
|
||||||
$_REQUEST = $filter->xssFilterHard($_REQUEST);
|
$_REQUEST = $filter->xssFilterHard($_REQUEST);
|
||||||
|
|
||||||
$arrayToTranslation = array(
|
$arrayToTranslation = [
|
||||||
"TRIGGER" => G::LoadTranslation("ID_TRIGGER_DB"),
|
'TRIGGER' => G::LoadTranslation('ID_TRIGGER_DB'),
|
||||||
"DERIVATION" => G::LoadTranslation("ID_DERIVATION_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') {
|
switch ($actionAjax) {
|
||||||
|
case 'messageHistoryGridList_JXP':
|
||||||
if (!isset($_REQUEST['start']) || $_REQUEST['start'] =='') {
|
if (!isset($_REQUEST['start']) || $_REQUEST['start'] == '') {
|
||||||
$_REQUEST['start'] = 0;
|
$_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"];
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (count($respView["MSGS_HISTORY"]) > 0) {
|
if (!isset($_REQUEST['limit']) || $_REQUEST['limit'] == '') {
|
||||||
$respMess = $respView["MSGS_HISTORY"]["PERMISSION"];
|
$_REQUEST['limit'] = 20;
|
||||||
if (isset($respView["MSGS_HISTORY"]["DEL_INDEX"])) {
|
|
||||||
$delIndex = $respView["MSGS_HISTORY"]["DEL_INDEX"];
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (count($respResend["MSGS_HISTORY"]) > 0) {
|
$dir = isset($_POST['dir']) ? $_POST['dir'] : 'ASC';
|
||||||
$respMess = $respResend["MSGS_HISTORY"]["PERMISSION"];
|
$sort = isset($_POST['sort']) ? $_POST['sort'] : '';
|
||||||
if (isset($respResend["MSGS_HISTORY"]["DEL_INDEX"])) {
|
|
||||||
$delIndex = $respResend["MSGS_HISTORY"]["DEL_INDEX"];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$totalCount = 0;
|
global $G_PUBLISH;
|
||||||
foreach ($appMessageArray as $index => $value) {
|
$case = new Cases();
|
||||||
if (($appMessageArray[$index]['APP_MSG_SHOW_MESSAGE'] == 1 && $respMess != 'BLOCK' ) &&
|
$case->dir = $dir;
|
||||||
($appMessageArray[$index]['DEL_INDEX'] == 0 || in_array($appMessageArray[$index]['DEL_INDEX'], $delIndex ))) {
|
$case->sort = $sort;
|
||||||
|
|
||||||
$appMessageArray[$index]['ID_MESSAGE'] = $appMessageArray[$index]['APP_UID'] . '_' . $appMessageArray[$index]['APP_MSG_UID'];
|
$appMessageArray = $case->getHistoryMessagesTrackerExt($_SESSION['APPLICATION'], true, $_REQUEST['start'], $_REQUEST['limit']);
|
||||||
if ($respMess == 'BLOCK' || $respMess == '') {
|
$appMessageCountArray = $case->getHistoryMessagesTrackerExt($_SESSION['APPLICATION'], true);
|
||||||
$appMessageArray[$index]['APP_MSG_BODY'] = "";
|
$result = new stdClass();
|
||||||
|
$aProcesses = array();
|
||||||
|
|
||||||
|
|
||||||
|
$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'];
|
||||||
}
|
}
|
||||||
$aProcesses[] = array_merge($appMessageArray[$index], array('MSGS_HISTORY' => $respMess));
|
|
||||||
$totalCount ++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$aProcesses = array_splice($aProcesses, $_REQUEST['start'], $_REQUEST['limit']);
|
|
||||||
|
|
||||||
$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) {
|
if (count($respView['MSGS_HISTORY']) > 0) {
|
||||||
$r->data[$key]["APP_MSG_TYPE"] = array_key_exists($r->data[$key]["APP_MSG_TYPE"], $arrayToTranslation) ?
|
$respMess = $respView['MSGS_HISTORY']['PERMISSION'];
|
||||||
$arrayToTranslation[$r->data[$key]["APP_MSG_TYPE"]] :
|
if (isset($respView['MSGS_HISTORY']['DEL_INDEX'])) {
|
||||||
$r->data[$key]["APP_MSG_TYPE"];
|
$delIndex = $respView['MSGS_HISTORY']['DEL_INDEX'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
echo G::json_encode( $r );
|
if (count($respResend['MSGS_HISTORY']) > 0) {
|
||||||
}
|
$respMess = $respResend['MSGS_HISTORY']['PERMISSION'];
|
||||||
if ($actionAjax == 'showHistoryMessage') {
|
if (isset($respResend['MSGS_HISTORY']['DEL_INDEX'])) {
|
||||||
|
$delIndex = $respResend['MSGS_HISTORY']['DEL_INDEX'];
|
||||||
?>
|
}
|
||||||
<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
|
|
||||||
|
|
||||||
$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'] = '';
|
||||||
|
}
|
||||||
|
$aProcesses[] = array_merge($appMessageArray[$index], ['MSGS_HISTORY' => $respMess]);
|
||||||
|
$totalCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$_POST["APP_UID"] = $_REQUEST["APP_UID"];
|
$aProcesses = array_splice($aProcesses, $_REQUEST['start'], $_REQUEST['limit']);
|
||||||
$_POST['APP_MSG_UID'] = $_REQUEST["APP_MSG_UID"];
|
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher();
|
$response = new stdclass();
|
||||||
$oCase = new Cases();
|
$response->data = $aProcesses;
|
||||||
|
$response->totalCount = $totalCount;
|
||||||
|
|
||||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_MessagesView', '', $oCase->getHistoryMessagesTrackerView( $_POST['APP_UID'], $_POST['APP_MSG_UID'] ) );
|
if (!empty($aProcesses)) {
|
||||||
|
if (!isset($response->data[0])) {
|
||||||
|
$response->data[0] = array('APP_MSG_TYPE' => '');
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
foreach ($response->data as $key => $value) {
|
||||||
<script language="javascript">
|
$response->data[$key]['APP_MSG_TYPE'] = array_key_exists($response->data[$key]['APP_MSG_TYPE'], $arrayToTranslation) ?
|
||||||
<?php
|
$arrayToTranslation[$response->data[$key]['APP_MSG_TYPE']] :
|
||||||
global $G_FORM;
|
$response->data[$key]['APP_MSG_TYPE'];
|
||||||
?>
|
}
|
||||||
function loadForm_<?php echo $G_FORM->id;?>(parametro1){
|
}
|
||||||
}
|
|
||||||
|
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>
|
</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_UID'] = $_REQUEST['APP_UID'];
|
||||||
$_POST['APP_MSG_UID'] = $_REQUEST['APP_MSG_UID'];
|
$_POST['APP_MSG_UID'] = $_REQUEST['APP_MSG_UID'];
|
||||||
|
|
||||||
|
$G_PUBLISH = new Publisher();
|
||||||
|
$case = new Cases();
|
||||||
|
|
||||||
$oCase = new Cases();
|
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_MessagesView', '', $case->getHistoryMessagesTrackerView($_POST['APP_UID'], $_POST['APP_MSG_UID']));
|
||||||
$data = $oCase->getHistoryMessagesTrackerView( $_POST['APP_UID'], $_POST['APP_MSG_UID'] );
|
?>
|
||||||
|
<script language="javascript">
|
||||||
|
<?php
|
||||||
|
global $G_FORM; ?>
|
||||||
|
function loadForm_ <?php echo $G_FORM->id; ?>(parametro1) {
|
||||||
|
}
|
||||||
|
</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);
|
$spool = new SpoolRun();
|
||||||
$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();
|
|
||||||
|
|
||||||
} catch (Exception $e) {
|
$spool->setConfig(System::getEmailConfiguration());
|
||||||
|
$spool->create([
|
||||||
$errorMessage = $e->getMessage();
|
'msg_uid' => $data['MSG_UID'],
|
||||||
}
|
'app_uid' => $data['APP_UID'],
|
||||||
|
'del_index' => $data['DEL_INDEX'],
|
||||||
echo $errorMessage;
|
'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;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user