CODE STYLE changes

files modified:   workflow/engine/methods/cases/casesDemo.php
                  workflow/engine/methods/cases/casesGenerateDocumentPage_Ajax.php
                  workflow/engine/methods/cases/casesHistoryDynaformPage_Ajax.php
                  workflow/engine/methods/cases/casesList_Ajax.php
                  workflow/engine/methods/cases/casesSaveDataView.php
                  workflow/engine/methods/cases/casesSchedulerLog_Ajax.php
                  workflow/engine/methods/cases/casesStartPage.php
                  workflow/engine/methods/cases/casesStartPage_Ajax.php
                  workflow/engine/methods/cases/casesToRevisePanelExtJs.php
                  workflow/engine/methods/cases/casesToReviseTreeContent.php
                  workflow/engine/methods/cases/cases_ShowDocument.php
                  workflow/engine/methods/cases/cases_ShowToReviseOutputDocument.php
                  workflow/engine/methods/cases/cases_StepToReviseOutputs.php
                  workflow/engine/methods/cases/data_casesSchedulerLog.php
                  workflow/engine/methods/cases/debug_triggers.php
                  workflow/engine/methods/cases/debug_vars.php
                  workflow/engine/methods/cases/index.php
                  workflow/engine/methods/cases/main.php
                  workflow/engine/methods/cases/main_init.php
                  workflow/engine/methods/cases/open.php
                  workflow/engine/methods/cases/proxyCasesList.php
                  workflow/engine/methods/cases/proxyProcessList.php
                  workflow/engine/methods/cases/proxyReassignCasesList.php
                  workflow/engine/methods/cases/proxyReassignUsersList.php
                  workflow/engine/methods/cases/proxySaveReassignCasesList.php
                  workflow/engine/methods/cases/summary.php
This commit is contained in:
Ralph Asendeteufrer
2012-10-22 12:15:52 -04:00
parent b51c9f6de4
commit 7eecd6ea31
26 changed files with 2541 additions and 2333 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,137 +1,139 @@
<?php
/**
* casesGenerateDocumentPage_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;
function casesShowOuputDocumentExist ($url)
{
$urlArray = explode( "?", $url );
$urlParametroString = $urlArray[1];
parse_str( $urlParametroString, $_GET );
require_once ("classes/model/AppDocumentPeer.php");
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'], (isset( $_GET['v'] )) ? $_GET['v'] : NULL );
$sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
if (! isset( $_GET['ext'] )) {
$ext = $info['extension'];
} else {
if ($_GET['ext'] != '') {
$ext = $_GET['ext'];
} else {
$ext = $info['extension'];
}
}
$ver = (isset( $_GET['v'] ) && $_GET['v'] != '') ? '_' . $_GET['v'] : '';
if (! $ver) //This code is in the case the outputdocument won't be versioned
$ver = '_1';
$realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $sAppDocUid . $ver . '.' . $ext;
$realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] . $ver . '.' . $ext;
$realPath2 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] . '.' . $ext;
$sw_file_exists = false;
if (file_exists( $realPath )) {
$sw_file_exists = true;
} elseif (file_exists( $realPath1 )) {
$sw_file_exists = true;
$realPath = $realPath1;
} elseif (file_exists( $realPath2 )) {
$sw_file_exists = true;
$realPath = $realPath2;
}
$swFileExist = 0;
if ($sw_file_exists) {
$swFileExist = 1;
}
return $swFileExist;
}
if ($actionAjax == 'casesGenerateDocumentPage') {
global $G_PUBLISH;
$oHeadPublisher = & headPublisher::getSingleton();
G::loadClass( 'configuration' );
$conf = new Configurations();
$oHeadPublisher->addExtJsScript( 'cases/casesGenerateDocumentPage', true ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesGenerateDocumentPage' ); //adding a html file .html.
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
G::RenderPage( 'publish', 'extJs' );
}
if ($actionAjax == 'generateDocumentGrid_Ajax') {
G::LoadClass( 'case' );
G::LoadClass( "BasePeer" );
global $G_PUBLISH;
$oCase = new Cases();
$aProcesses = Array ();
$G_PUBLISH = new Publisher();
$c = $oCase->getAllGeneratedDocumentsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED'] );
if ($c->getDbName() == 'dbarray') {
$rs = ArrayBasePeer::doSelectRs( $c );
} else {
$rs = GulliverBasePeer::doSelectRs( $c );
}
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs->next();
$totalCount = 0;
for ($j = 0; $j < $rs->getRecordCount(); $j ++) {
$result = $rs->getRow();
$result["FILEDOCEXIST"] = casesShowOuputDocumentExist( $result["FILEDOC"] );
$result["FILEPDFEXIST"] = casesShowOuputDocumentExist( $result["FILEPDF"] );
$aProcesses[] = $result;
$rs->next();
$totalCount ++;
}
//!dateFormat
G::LoadClass( 'configuration' );
$conf = new Configurations();
try {
$generalConfCasesList = $conf->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
} catch (Exception $e) {
$generalConfCasesList = array ();
}
$dateFormat = "";
if (isset( $generalConfCasesList['casesListDateFormat'] ) && ! empty( $generalConfCasesList['casesListDateFormat'] )) {
$dateFormat = $generalConfCasesList['casesListDateFormat'];
}
$newDir = '/tmp/test/directory';
$r = G::verifyPath( $newDir );
$r->data = $aProcesses;
$r->totalCount = $totalCount;
$r->dataFormat = $dateFormat;
echo G::json_encode( $r );
}
<?php
/**
* casesGenerateDocumentPage_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;
function casesShowOuputDocumentExist ($url)
{
$urlArray = explode( "?", $url );
$urlParametroString = $urlArray[1];
parse_str( $urlParametroString, $_GET );
require_once ("classes/model/AppDocumentPeer.php");
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'], (isset( $_GET['v'] )) ? $_GET['v'] : null );
$sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
if (! isset( $_GET['ext'] )) {
$ext = $info['extension'];
} else {
if ($_GET['ext'] != '') {
$ext = $_GET['ext'];
} else {
$ext = $info['extension'];
}
}
$ver = (isset( $_GET['v'] ) && $_GET['v'] != '') ? '_' . $_GET['v'] : '';
if (! $ver) {
//This code is in the case the outputdocument won't be versioned
$ver = '_1';
}
$realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $sAppDocUid . $ver . '.' . $ext;
$realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] . $ver . '.' . $ext;
$realPath2 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] . '.' . $ext;
$sw_file_exists = false;
if (file_exists( $realPath )) {
$sw_file_exists = true;
} elseif (file_exists( $realPath1 )) {
$sw_file_exists = true;
$realPath = $realPath1;
} elseif (file_exists( $realPath2 )) {
$sw_file_exists = true;
$realPath = $realPath2;
}
$swFileExist = 0;
if ($sw_file_exists) {
$swFileExist = 1;
}
return $swFileExist;
}
if ($actionAjax == 'casesGenerateDocumentPage') {
global $G_PUBLISH;
$oHeadPublisher = & headPublisher::getSingleton();
G::loadClass( 'configuration' );
$conf = new Configurations();
$oHeadPublisher->addExtJsScript( 'cases/casesGenerateDocumentPage', true ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesGenerateDocumentPage' ); //adding a html file .html.
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
G::RenderPage( 'publish', 'extJs' );
}
if ($actionAjax == 'generateDocumentGrid_Ajax') {
G::LoadClass( 'case' );
G::LoadClass( "BasePeer" );
global $G_PUBLISH;
$oCase = new Cases();
$aProcesses = Array ();
$G_PUBLISH = new Publisher();
$c = $oCase->getAllGeneratedDocumentsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED'] );
if ($c->getDbName() == 'dbarray') {
$rs = ArrayBasePeer::doSelectRs( $c );
} else {
$rs = GulliverBasePeer::doSelectRs( $c );
}
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs->next();
$totalCount = 0;
for ($j = 0; $j < $rs->getRecordCount(); $j ++) {
$result = $rs->getRow();
$result["FILEDOCEXIST"] = casesShowOuputDocumentExist( $result["FILEDOC"] );
$result["FILEPDFEXIST"] = casesShowOuputDocumentExist( $result["FILEPDF"] );
$aProcesses[] = $result;
$rs->next();
$totalCount ++;
}
//!dateFormat
G::LoadClass( 'configuration' );
$conf = new Configurations();
try {
$generalConfCasesList = $conf->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
} catch (Exception $e) {
$generalConfCasesList = array ();
}
$dateFormat = "";
if (isset( $generalConfCasesList['casesListDateFormat'] ) && ! empty( $generalConfCasesList['casesListDateFormat'] )) {
$dateFormat = $generalConfCasesList['casesListDateFormat'];
}
$newDir = '/tmp/test/directory';
$r = G::verifyPath( $newDir );
$r->data = $aProcesses;
$r->totalCount = $totalCount;
$r->dataFormat = $dateFormat;
echo G::json_encode( $r );
}

File diff suppressed because one or more lines are too long

View File

@@ -243,24 +243,114 @@ if ($actionAjax == 'showDynaformListHistory') {
}
</style>
<script language="Javascript">
globalMd5Return=function(s,raw,hexcase,chrsz){
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);return(msw<<16)|(lsw&0xFFFF)}
function bit_rol(num,cnt){return(num<<cnt)|(num>>>(32-cnt))}function md5_cmn(q,a,b,x,s,t){
return safe_add(bit_rol(safe_add(safe_add(a,q),safe_add(x,t)),s),b)}function md5_ff(a,b,c,d,x,s,t){
return md5_cmn((b&c)|((~b)&d),a,b,x,s,t)}
function md5_gg(a,b,c,d,x,s,t){
return md5_cmn((b&d)|(c&(~d)),a,b,x,s,t)}
function md5_hh(a,b,c,d,x,s,t){
return md5_cmn(b^c^d,a,b,x,s,t)}
function md5_ii(a,b,c,d,x,s,t){
return md5_cmn(c^(b|(~d)),a,b,x,s,t)}
function core_md5(x,len){x[len>>5]|=0x80<<((len)%32);x[(((len+64)>>>9)<<4)+14]=len;var a=1732584193;var b=-271733879;var c=-1732584194;var d=271733878;for(var i=0;i<x.length;i+=16){
var olda=a;var oldb=b;var oldc=c;var oldd=d;a=md5_ff(a,b,c,d,x[i+0],7,-680876936);d=md5_ff(d,a,b,c,x[i+1],12,-389564586);c=md5_ff(c,d,a,b,x[i+2],17,606105819);b=md5_ff(b,c,d,a,x[i+3],22,-1044525330);a=md5_ff(a,b,c,d,x[i+4],7,-176418897);d=md5_ff(d,a,b,c,x[i+5],12,1200080426);c=md5_ff(c,d,a,b,x[i+6],17,-1473231341);b=md5_ff(b,c,d,a,x[i+7],22,-45705983);a=md5_ff(a,b,c,d,x[i+8],7,1770035416);d=md5_ff(d,a,b,c,x[i+9],12,-1958414417);c=md5_ff(c,d,a,b,x[i+10],17,-42063);b=md5_ff(b,c,d,a,x[i+11],22,-1990404162);a=md5_ff(a,b,c,d,x[i+12],7,1804603682);d=md5_ff(d,a,b,c,x[i+13],12,-40341101);c=md5_ff(c,d,a,b,x[i+14],17,-1502002290);b=md5_ff(b,c,d,a,x[i+15],22,1236535329);a=md5_gg(a,b,c,d,x[i+1],5,-165796510);d=md5_gg(d,a,b,c,x[i+6],9,-1069501632);c=md5_gg(c,d,a,b,x[i+11],14,643717713);b=md5_gg(b,c,d,a,x[i+0],20,-373897302);a=md5_gg(a,b,c,d,x[i+5],5,-701558691);d=md5_gg(d,a,b,c,x[i+10],9,38016083);c=md5_gg(c,d,a,b,x[i+15],14,-660478335);b=md5_gg(b,c,d,a,x[i+4],20,-405537848);a=md5_gg(a,b,c,d,x[i+9],5,568446438);d=md5_gg(d,a,b,c,x[i+14],9,-1019803690);c=md5_gg(c,d,a,b,x[i+3],14,-187363961);b=md5_gg(b,c,d,a,x[i+8],20,1163531501);a=md5_gg(a,b,c,d,x[i+13],5,-1444681467);d=md5_gg(d,a,b,c,x[i+2],9,-51403784);c=md5_gg(c,d,a,b,x[i+7],14,1735328473);b=md5_gg(b,c,d,a,x[i+12],20,-1926607734);a=md5_hh(a,b,c,d,x[i+5],4,-378558);d=md5_hh(d,a,b,c,x[i+8],11,-2022574463);c=md5_hh(c,d,a,b,x[i+11],16,1839030562);b=md5_hh(b,c,d,a,x[i+14],23,-35309556);a=md5_hh(a,b,c,d,x[i+1],4,-1530992060);d=md5_hh(d,a,b,c,x[i+4],11,1272893353);c=md5_hh(c,d,a,b,x[i+7],16,-155497632);b=md5_hh(b,c,d,a,x[i+10],23,-1094730640);a=md5_hh(a,b,c,d,x[i+13],4,681279174);d=md5_hh(d,a,b,c,x[i+0],11,-358537222);c=md5_hh(c,d,a,b,x[i+3],16,-722521979);b=md5_hh(b,c,d,a,x[i+6],23,76029189);a=md5_hh(a,b,c,d,x[i+9],4,-640364487);d=md5_hh(d,a,b,c,x[i+12],11,-421815835);c=md5_hh(c,d,a,b,x[i+15],16,530742520);b=md5_hh(b,c,d,a,x[i+2],23,-995338651);
a=md5_ii(a,b,c,d,x[i+0],6,-198630844);d=md5_ii(d,a,b,c,x[i+7],10,1126891415);c=md5_ii(c,d,a,b,x[i+14],15,-1416354905);
b=md5_ii(b,c,d,a,x[i+5],21,-57434055);a=md5_ii(a,b,c,d,x[i+12],6,1700485571);d=md5_ii(d,a,b,c,x[i+3],10,-1894986606);c=md5_ii(c,d,a,b,x[i+10],15,-1051523);b=md5_ii(b,c,d,a,x[i+1],21,-2054922799);a=md5_ii(a,b,c,d,x[i+8],6,1873313359);
d=md5_ii(d,a,b,c,x[i+15],10,-30611744);c=md5_ii(c,d,a,b,x[i+6],15,-1560198380);b=md5_ii(b,c,d,a,x[i+13],21,1309151649);a=md5_ii(a,b,c,d,x[i+4],6,-145523070);d=md5_ii(d,a,b,c,x[i+11],10,-1120210379);c=md5_ii(c,d,a,b,x[i+2],15,718787259);b=md5_ii(b,c,d,a,x[i+9],21,-343485551);a=safe_add(a,olda);b=safe_add(b,oldb);c=safe_add(c,oldc);d=safe_add(d,oldd)}
return[a,b,c,d]}
globalMd5Return=function(s,raw,hexcase,chrsz) {
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);
return(msw<<16)|(lsw&0xFFFF)
}
function bit_rol(num,cnt) {
return(num<<cnt)|(num>>>(32-cnt))
}
function md5_cmn(q,a,b,x,s,t) {
return safe_add(bit_rol(safe_add(safe_add(a,q),safe_add(x,t)),s),b)
}
function md5_ff(a,b,c,d,x,s,t) {
return md5_cmn((b&c)|((~b)&d),a,b,x,s,t)
}
function md5_gg(a,b,c,d,x,s,t) {
return md5_cmn((b&d)|(c&(~d)),a,b,x,s,t)
}
function md5_hh(a,b,c,d,x,s,t) {
return md5_cmn(b^c^d,a,b,x,s,t)
}
function md5_ii(a,b,c,d,x,s,t) {
return md5_cmn(c^(b|(~d)),a,b,x,s,t)
}
function core_md5(x,len) {
x[len>>5]|=0x80<<((len)%32);
x[(((len+64)>>>9)<<4)+14]=len;
var a=1732584193;
var b=-271733879;
var c=-1732584194;
var d=271733878;
for(var i=0;i<x.length;i+=16) {
var olda=a;
var oldb=b;
var oldc=c;
var oldd=d;
a=md5_ff(a,b,c,d,x[i+0],7,-680876936);
d=md5_ff(d,a,b,c,x[i+1],12,-389564586);
c=md5_ff(c,d,a,b,x[i+2],17,606105819);
b=md5_ff(b,c,d,a,x[i+3],22,-1044525330);
a=md5_ff(a,b,c,d,x[i+4],7,-176418897);
d=md5_ff(d,a,b,c,x[i+5],12,1200080426);
c=md5_ff(c,d,a,b,x[i+6],17,-1473231341);
b=md5_ff(b,c,d,a,x[i+7],22,-45705983);
a=md5_ff(a,b,c,d,x[i+8],7,1770035416);
d=md5_ff(d,a,b,c,x[i+9],12,-1958414417);
c=md5_ff(c,d,a,b,x[i+10],17,-42063);
b=md5_ff(b,c,d,a,x[i+11],22,-1990404162);
a=md5_ff(a,b,c,d,x[i+12],7,1804603682);
d=md5_ff(d,a,b,c,x[i+13],12,-40341101);
c=md5_ff(c,d,a,b,x[i+14],17,-1502002290);
b=md5_ff(b,c,d,a,x[i+15],22,1236535329);
a=md5_gg(a,b,c,d,x[i+1],5,-165796510);
d=md5_gg(d,a,b,c,x[i+6],9,-1069501632);
c=md5_gg(c,d,a,b,x[i+11],14,643717713);
b=md5_gg(b,c,d,a,x[i+0],20,-373897302);
a=md5_gg(a,b,c,d,x[i+5],5,-701558691);
d=md5_gg(d,a,b,c,x[i+10],9,38016083);
c=md5_gg(c,d,a,b,x[i+15],14,-660478335);
b=md5_gg(b,c,d,a,x[i+4],20,-405537848);
a=md5_gg(a,b,c,d,x[i+9],5,568446438);
d=md5_gg(d,a,b,c,x[i+14],9,-1019803690);
c=md5_gg(c,d,a,b,x[i+3],14,-187363961);
b=md5_gg(b,c,d,a,x[i+8],20,1163531501);
a=md5_gg(a,b,c,d,x[i+13],5,-1444681467);
d=md5_gg(d,a,b,c,x[i+2],9,-51403784);
c=md5_gg(c,d,a,b,x[i+7],14,1735328473);
b=md5_gg(b,c,d,a,x[i+12],20,-1926607734);
a=md5_hh(a,b,c,d,x[i+5],4,-378558);
d=md5_hh(d,a,b,c,x[i+8],11,-2022574463);
c=md5_hh(c,d,a,b,x[i+11],16,1839030562);
b=md5_hh(b,c,d,a,x[i+14],23,-35309556);
a=md5_hh(a,b,c,d,x[i+1],4,-1530992060);
d=md5_hh(d,a,b,c,x[i+4],11,1272893353);
c=md5_hh(c,d,a,b,x[i+7],16,-155497632);
b=md5_hh(b,c,d,a,x[i+10],23,-1094730640);
a=md5_hh(a,b,c,d,x[i+13],4,681279174);
d=md5_hh(d,a,b,c,x[i+0],11,-358537222);
c=md5_hh(c,d,a,b,x[i+3],16,-722521979);
b=md5_hh(b,c,d,a,x[i+6],23,76029189);
a=md5_hh(a,b,c,d,x[i+9],4,-640364487);
d=md5_hh(d,a,b,c,x[i+12],11,-421815835);
c=md5_hh(c,d,a,b,x[i+15],16,530742520);
b=md5_hh(b,c,d,a,x[i+2],23,-995338651);
a=md5_ii(a,b,c,d,x[i+0],6,-198630844);
d=md5_ii(d,a,b,c,x[i+7],10,1126891415);
c=md5_ii(c,d,a,b,x[i+14],15,-1416354905);
b=md5_ii(b,c,d,a,x[i+5],21,-57434055);
a=md5_ii(a,b,c,d,x[i+12],6,1700485571);
d=md5_ii(d,a,b,c,x[i+3],10,-1894986606);
c=md5_ii(c,d,a,b,x[i+10],15,-1051523);
b=md5_ii(b,c,d,a,x[i+1],21,-2054922799);
a=md5_ii(a,b,c,d,x[i+8],6,1873313359);
d=md5_ii(d,a,b,c,x[i+15],10,-30611744);
c=md5_ii(c,d,a,b,x[i+6],15,-1560198380);
b=md5_ii(b,c,d,a,x[i+13],21,1309151649);
a=md5_ii(a,b,c,d,x[i+4],6,-145523070);
d=md5_ii(d,a,b,c,x[i+11],10,-1120210379);
c=md5_ii(c,d,a,b,x[i+2],15,718787259);
b=md5_ii(b,c,d,a,x[i+9],21,-343485551);
a=safe_add(a,olda);b=safe_add(b,oldb);
c=safe_add(c,oldc);d=safe_add(d,oldd)
}
return[a,b,c,d]
}
function str2binl(str){var bin=[];var mask=(1<<chrsz)-1;for(var i=0;i<str.length*chrsz;i+=chrsz){bin[i>>5]|=(str.charCodeAt(i/chrsz)&mask)<<(i%32)}
return bin}
function binl2str(bin){var str="";var mask=(1<<chrsz)-1;for(var i=0;i<bin.length*32;i+=chrsz){str+=String.fromCharCode((bin[i>>5]>>>(i%32))&mask)}return str}
@@ -304,7 +394,7 @@ if ($actionAjax == 'showDynaformListHistory') {
var showDynaformHistoryGlobal = {};
showDynaformHistoryGlobal.dynUID = '';
showDynaformHistoryGlobal.tablename = '';
showDynaformHistoryGlobal.dynDate = '';
showDynaformHistoryGlobal.dynDate = '';casesList_Ajax.php
showDynaformHistoryGlobal.dynTitle = '';
function showDynaformHistory(dynUID,tablename,dynDate,dynTitle){
showDynaformHistoryGlobal.dynUID = dynUID;

View File

@@ -1,78 +1,78 @@
<?php
/**
* cases_SaveData.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.
*/
//validate the data post
//$oForm = new Form ( $_SESSION ['PROCESS'] . '/' . $_GET ['UID'], PATH_DYNAFORM );
//$oForm->validatePost ();
/* @author Alvaro Campos Sanchez */
/* Includes */
G::LoadClass( 'case' );
//load the variables
$oCase = new Cases();
$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List' );
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], G::getSystemConstants() );
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], (array) $_POST['form'] );
#here we must verify if is a debug session
$trigger_debug_session = $_SESSION['TRIGGER_DEBUG']['ISSET']; #here we must verify if is a debugg session
#trigger debug routines...
//cleaning debug variables
$_SESSION['TRIGGER_DEBUG']['ERRORS'] = Array ();
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array ();
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'DYNAFORM', $_GET['UID'], 'AFTER' );
$_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] = count( $triggers );
$_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER';
if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) {
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers );
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = $triggers;
}
if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) {
//Execute after triggers - Start
$Fields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'DYNAFORM', $_GET['UID'], 'AFTER', $Fields['APP_DATA'] );
//Execute after triggers - End
}
//go to the next step
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
if (isset( $_GET['_REFRESH_'] )) {
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die();
}
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep['PAGE'];
if ($trigger_debug_session) {
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
$aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
}
G::header( 'location: ' . $aNextStep['PAGE'] );
<?php
/**
* cases_SaveData.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.
*/
//validate the data post
//$oForm = new Form ( $_SESSION ['PROCESS'] . '/' . $_GET ['UID'], PATH_DYNAFORM );
//$oForm->validatePost ();
/* @author Alvaro Campos Sanchez */
/* Includes */
G::LoadClass( 'case' );
//load the variables
$oCase = new Cases();
$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List' );
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], G::getSystemConstants() );
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], (array) $_POST['form'] );
#here we must verify if is a debug session
$trigger_debug_session = $_SESSION['TRIGGER_DEBUG']['ISSET']; #here we must verify if is a debugg session
#trigger debug routines...
//cleaning debug variables
$_SESSION['TRIGGER_DEBUG']['ERRORS'] = Array ();
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array ();
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'DYNAFORM', $_GET['UID'], 'AFTER' );
$_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] = count( $triggers );
$_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER';
if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) {
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers );
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = $triggers;
}
if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) {
//Execute after triggers - Start
$Fields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'DYNAFORM', $_GET['UID'], 'AFTER', $Fields['APP_DATA'] );
//Execute after triggers - End
}
//go to the next step
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
if (isset( $_GET['_REFRESH_'] )) {
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die();
}
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep['PAGE'];
if ($trigger_debug_session) {
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
$aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
}
G::header( 'location: ' . $aNextStep['PAGE'] );

View File

@@ -1,43 +1,43 @@
<?php
/**
* casesSchedulerLog_Ajax.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.
*/
<?php
/**
* casesSchedulerLog_Ajax.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.
*/
//if (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response;
G::LoadInclude( 'ajax' );
$_POST['action'] = get_ajax_value( 'action' );
switch ($_POST['action']) {
case 'updatePageSize':
G::LoadClass( 'configuration' );
$c = new Configurations();
$arr['pageSize'] = $_REQUEST['size'];
$arr['dateSave'] = date( 'Y-m-d H:i:s' );
$config = Array ();
$config[] = $arr;
$c->aConfig = $config;
$c->saveConfig( 'casesSchedulerLogList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
echo '{success: true}';
break;
break;
}
G::LoadInclude( 'ajax' );
$_POST['action'] = get_ajax_value( 'action' );
switch ($_POST['action']) {
case 'updatePageSize':
G::LoadClass( 'configuration' );
$c = new Configurations();
$arr['pageSize'] = $_REQUEST['size'];
$arr['dateSave'] = date( 'Y-m-d H:i:s' );
$config = Array ();
$config[] = $arr;
$c->aConfig = $config;
$c->saveConfig( 'casesSchedulerLogList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
echo '{success: true}';
break;
break;
}

View File

@@ -1,45 +1,45 @@
<?php
unset( $_SESSION['__currentTabDashboard'] );
if (isset( $_GET['action'] )) {
$_SESSION['__currentTabDashboard'] = $_GET['action'];
}
$page = "";
if (isset( $_GET['action'] )) {
$page = $_GET['action'];
}
$oHeadPublisher = & headPublisher::getSingleton();
global $RBAC;
switch ($page) {
case "startCase":
<?php
unset( $_SESSION['__currentTabDashboard'] );
if (isset( $_GET['action'] )) {
$_SESSION['__currentTabDashboard'] = $_GET['action'];
}
$page = "";
if (isset( $_GET['action'] )) {
$page = $_GET['action'];
}
$oHeadPublisher = & headPublisher::getSingleton();
global $RBAC;
switch ($page) {
case "startCase":
$oHeadPublisher->addExtJsScript( 'cases/casesStartCase', true ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesStartCase' ); //adding a html file .html.
G::LoadClass( 'configuration' );
$c = new Configurations();
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
break;
case "documents":
G::LoadClass( 'configuration' );
$c = new Configurations();
$configPage = $c->getConfiguration( 'documentsModule', 'pageSize', '', $_SESSION['USER_LOGGED'] );
$configEnv = $c->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
$oHeadPublisher->assign( 'CONFIG', $Config );
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
$oHeadPublisher->assign( 'permitodelete', $RBAC->userCanAccess( 'PM_FOLDER_DELETE' ) );
$oHeadPublisher->assign( 'permitoaddfile', $RBAC->userCanAccess( 'PM_FOLDERS_ADD_FILE' ) );
$oHeadPublisher->assign( 'permitoaddfolder', $RBAC->userCanAccess( 'PM_FOLDERS_ADD_FOLDER' ) );
G::LoadClass( 'configuration' );
$c = new Configurations();
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
break;
case "documents":
G::LoadClass( 'configuration' );
$c = new Configurations();
$configPage = $c->getConfiguration( 'documentsModule', 'pageSize', '', $_SESSION['USER_LOGGED'] );
$configEnv = $c->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
$oHeadPublisher->assign( 'CONFIG', $Config );
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
$oHeadPublisher->assign( 'permitodelete', $RBAC->userCanAccess( 'PM_FOLDER_DELETE' ) );
$oHeadPublisher->assign( 'permitoaddfile', $RBAC->userCanAccess( 'PM_FOLDERS_ADD_FILE' ) );
$oHeadPublisher->assign( 'permitoaddfolder', $RBAC->userCanAccess( 'PM_FOLDERS_ADD_FOLDER' ) );
$oHeadPublisher->addExtJsScript( 'cases/casesDocuments', false ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesDocuments' ); //adding a html file .html.
break;
default:
break;
default:
$oHeadPublisher->addExtJsScript( 'cases/casesStartPage', false ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesStartPage' ); //adding a html file .html.
break;
}
G::RenderPage( 'publish', 'extJs' );
break;
}
G::RenderPage( 'publish', 'extJs' );

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,15 @@
<?php
<?php
// $oHeadPublisher =& headPublisher::getSingleton();
// $TRANSLATIONS = array_merge($TRANSLATIONS, $TRANSLATIONS2);
// $TRANSLATIONS = array_merge($TRANSLATIONS, $TRANSLATIONS2);
$delIndex = $_GET['DEL_INDEX'];
$appUid = $_GET['APP_UID'];
$delIndex = $_GET['DEL_INDEX'];
$appUid = $_GET['APP_UID'];
// $oHeadPublisher->assign( 'TRANSLATIONS', $TRANSLATIONS); //translations
$casesPanelUrl = 'casesToReviseTreeContent?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex;
$casesPanelUrl = 'casesToReviseTreeContent?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex;
$oHeadPublisher->assign( 'casesPanelUrl', $casesPanelUrl ); //translations
$oHeadPublisher->assign( 'treeTitle', G::loadtranslation( 'ID_STEP_LIST' ) ); //translations
$oHeadPublisher->addExtJsScript( 'cases/casesToRevisePanel', false ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesToRevisePanel' ); //adding a html file .html.
G::RenderPage( 'publish', 'extJs' );
G::RenderPage( 'publish', 'extJs' );

View File

@@ -1,96 +1,96 @@
<?php
class TreeNode
{
public $text = "";
public $id = "";
public $iconCls = "";
public $leaf = true;
public $draggable = false;
public $href = "#";
public $hrefTarget = "";
function __construct ($id, $text, $iconCls, $leaf, $draggable, $href, $hrefTarget)
{
$this->id = $id;
$this->text = $text;
$this->iconCls = $iconCls;
$this->leaf = $leaf;
$this->draggable = $draggable;
$this->href = $href;
$this->hrefTarget = $hrefTarget;
}
function toJson ()
{
return G::json_encode( $this );
}
}
class ExtJsTreeNode extends TreeNode
{
public $children = array ();
function add ($object)
{
$this->children[] = $object;
}
function toJson ()
{
return G::json_encode( $this );
}
}
G::LoadClass( 'case' );
$o = new Cases();
$PRO_UID = $_SESSION['PROCESS'];
$treeArray = array ();
<?php
class TreeNode
{
public $text = "";
public $id = "";
public $iconCls = "";
public $leaf = true;
public $draggable = false;
public $href = "#";
public $hrefTarget = "";
public function __construct ($id, $text, $iconCls, $leaf, $draggable, $href, $hrefTarget)
{
$this->id = $id;
$this->text = $text;
$this->iconCls = $iconCls;
$this->leaf = $leaf;
$this->draggable = $draggable;
$this->href = $href;
$this->hrefTarget = $hrefTarget;
}
public function toJson ()
{
return G::json_encode( $this );
}
}
class ExtJsTreeNode extends TreeNode
{
public $children = array ();
public function add ($object)
{
$this->children[] = $object;
}
public function toJson ()
{
return G::json_encode( $this );
}
}
G::LoadClass( 'case' );
$o = new Cases();
$PRO_UID = $_SESSION['PROCESS'];
$treeArray = array ();
//if (isset($_GET['action'])&&$_GET['action']=='test'){
echo "[";
echo "[";
// dynaforms assemble
$extTreeDynaforms = new ExtJsTreeNode( "node-dynaforms", G::loadtranslation( 'ID_DYNAFORMS' ), "", false, false, "", "" );
$i = 0;
$APP_UID = $_GET['APP_UID'];
$DEL_INDEX = $_GET['DEL_INDEX'];
$steps = $o->getAllDynaformsStepsToRevise( $_GET['APP_UID'] );
$steps->next();
while ($step = $steps->getRow()) {
require_once 'classes/model/Dynaform.php';
$od = new Dynaform();
$dynaformF = $od->Load( $step['STEP_UID_OBJ'] );
$n = $step['STEP_POSITION'];
$TITLE = " - " . $dynaformF['DYN_TITLE'];
$DYN_UID = $dynaformF['DYN_UID'];
$href = "cases_StepToRevise?type=DYNAFORM&ex=$i&PRO_UID=$PRO_UID&DYN_UID=$DYN_UID&APP_UID=$APP_UID&position=" . $step['STEP_POSITION'] . "&DEL_INDEX=$DEL_INDEX";
$extTreeDynaforms->add( new TreeNode( $DYN_UID, $TITLE, "datasource", true, false, $href, "openCaseFrame" ) );
$i ++;
$steps->next();
}
echo $extTreeDynaforms->toJson();
$extTreeDynaforms = new ExtJsTreeNode( "node-dynaforms", G::loadtranslation( 'ID_DYNAFORMS' ), "", false, false, "", "" );
$i = 0;
$APP_UID = $_GET['APP_UID'];
$DEL_INDEX = $_GET['DEL_INDEX'];
$steps = $o->getAllDynaformsStepsToRevise( $_GET['APP_UID'] );
$steps->next();
while ($step = $steps->getRow()) {
require_once 'classes/model/Dynaform.php';
$od = new Dynaform();
$dynaformF = $od->Load( $step['STEP_UID_OBJ'] );
$n = $step['STEP_POSITION'];
$TITLE = " - " . $dynaformF['DYN_TITLE'];
$DYN_UID = $dynaformF['DYN_UID'];
$href = "cases_StepToRevise?type=DYNAFORM&ex=$i&PRO_UID=$PRO_UID&DYN_UID=$DYN_UID&APP_UID=$APP_UID&position=" . $step['STEP_POSITION'] . "&DEL_INDEX=$DEL_INDEX";
$extTreeDynaforms->add( new TreeNode( $DYN_UID, $TITLE, "datasource", true, false, $href, "openCaseFrame" ) );
$i ++;
$steps->next();
}
echo $extTreeDynaforms->toJson();
// end the dynaforms tree menu
echo ",";
echo ",";
// assembling the input documents tree menu
$extTreeInputDocs = new ExtJsTreeNode( "node-input-documents", G::loadtranslation( 'ID_REQUEST_DOCUMENTS' ), "", false, false, "", "" );
$i = 0;
$APP_UID = $_GET['APP_UID'];
$DEL_INDEX = $_GET['DEL_INDEX'];
$steps = $o->getAllInputsStepsToRevise( $_GET['APP_UID'] );
$steps->next();
while ($step = $steps->getRow()) {
require_once 'classes/model/InputDocument.php';
$od = new InputDocument();
$IDF = $od->Load( $step['STEP_UID_OBJ'] );
$n = $step['STEP_POSITION'];
$TITLE = " - " . $IDF['INP_DOC_TITLE'];
$INP_DOC_UID = $IDF['INP_DOC_UID'];
$href = "cases_StepToReviseInputs?type=INPUT_DOCUMENT&ex=$i&PRO_UID=$PRO_UID&INP_DOC_UID=$INP_DOC_UID&APP_UID=$APP_UID&position=" . $step['STEP_POSITION'] . "&DEL_INDEX=$DEL_INDEX";
$extTreeInputDocs->add( new TreeNode( $INP_DOC_UID, $TITLE, "datasource", true, false, $href, "openCaseFrame" ) );
$i ++;
$steps->next();
}
echo $extTreeInputDocs->toJson();
echo "]";
$extTreeInputDocs = new ExtJsTreeNode( "node-input-documents", G::loadtranslation( 'ID_REQUEST_DOCUMENTS' ), "", false, false, "", "" );
$i = 0;
$APP_UID = $_GET['APP_UID'];
$DEL_INDEX = $_GET['DEL_INDEX'];
$steps = $o->getAllInputsStepsToRevise( $_GET['APP_UID'] );
$steps->next();
while ($step = $steps->getRow()) {
require_once 'classes/model/InputDocument.php';
$od = new InputDocument();
$IDF = $od->Load( $step['STEP_UID_OBJ'] );
$n = $step['STEP_POSITION'];
$TITLE = " - " . $IDF['INP_DOC_TITLE'];
$INP_DOC_UID = $IDF['INP_DOC_UID'];
$href = "cases_StepToReviseInputs?type=INPUT_DOCUMENT&ex=$i&PRO_UID=$PRO_UID&INP_DOC_UID=$INP_DOC_UID&APP_UID=$APP_UID&position=" . $step['STEP_POSITION'] . "&DEL_INDEX=$DEL_INDEX";
$extTreeInputDocs->add( new TreeNode( $INP_DOC_UID, $TITLE, "datasource", true, false, $href, "openCaseFrame" ) );
$i ++;
$steps->next();
}
echo $extTreeInputDocs->toJson();
echo "]";

View File

@@ -1,89 +1,89 @@
<?php
/**
* cases_ShowDocument.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.
*/
<?php
/**
* cases_ShowDocument.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.
*/
/*
* Created on 13-02-2008
*
* @author David Callizaya <davidsantos@colosa.com>
*/
require_once ("classes/model/AppDocumentPeer.php");
$oAppDocument = new AppDocument();
if (! isset( $_GET['v'] )) {
*/
require_once ("classes/model/AppDocumentPeer.php");
$oAppDocument = new AppDocument();
if (! isset( $_GET['v'] )) {
//Load last version of the document
$docVersion = $oAppDocument->getLastAppDocVersion( $_GET['a'] );
} else {
$docVersion = $_GET['v'];
}
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'], $docVersion );
$sAppDocUid = $oAppDocument->getAppDocUid();
$iDocVersion = $oAppDocument->getDocVersion();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
$ext = $info['extension'];
if (isset( $_GET['b'] )) {
if ($_GET['b'] == '0') {
$bDownload = false;
} else {
$bDownload = true;
}
} else {
$bDownload = true;
}
$realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/' . $sAppDocUid . '_' . $iDocVersion . '.' . $ext;
$realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/' . $sAppDocUid . '.' . $ext;
$sw_file_exists = false;
if (file_exists( $realPath )) {
$sw_file_exists = true;
} elseif (file_exists( $realPath1 )) {
$sw_file_exists = true;
$realPath = $realPath1;
}
if (! $sw_file_exists) {
$error_message = "'" . $oAppDocument->Fields['APP_DOC_FILENAME'] . "' " . G::LoadTranslation( 'ID_ERROR_STREAMING_FILE' );
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
$res['success'] = 'failure';
$res['message'] = $error_message;
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] );
die();
}
} else {
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
$res['success'] = 'success';
$res['message'] = $oAppDocument->Fields['APP_DOC_FILENAME'];
print G::json_encode( $res );
} else {
G::streamFile( $realPath, $bDownload, $oAppDocument->Fields['APP_DOC_FILENAME'] );
}
}
$docVersion = $oAppDocument->getLastAppDocVersion( $_GET['a'] );
} else {
$docVersion = $_GET['v'];
}
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'], $docVersion );
$sAppDocUid = $oAppDocument->getAppDocUid();
$iDocVersion = $oAppDocument->getDocVersion();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
$ext = $info['extension'];
if (isset( $_GET['b'] )) {
if ($_GET['b'] == '0') {
$bDownload = false;
} else {
$bDownload = true;
}
} else {
$bDownload = true;
}
$realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/' . $sAppDocUid . '_' . $iDocVersion . '.' . $ext;
$realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/' . $sAppDocUid . '.' . $ext;
$sw_file_exists = false;
if (file_exists( $realPath )) {
$sw_file_exists = true;
} elseif (file_exists( $realPath1 )) {
$sw_file_exists = true;
$realPath = $realPath1;
}
if (! $sw_file_exists) {
$error_message = "'" . $oAppDocument->Fields['APP_DOC_FILENAME'] . "' " . G::LoadTranslation( 'ID_ERROR_STREAMING_FILE' );
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
$res['success'] = 'failure';
$res['message'] = $error_message;
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] );
die();
}
} else {
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
$res['success'] = 'success';
$res['message'] = $oAppDocument->Fields['APP_DOC_FILENAME'];
print G::json_encode( $res );
} else {
G::streamFile( $realPath, $bDownload, $oAppDocument->Fields['APP_DOC_FILENAME'] );
}
}

View File

@@ -1,62 +1,62 @@
<?php
/**
* cases_ShowOutputDocument.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.
*/
<?php
/**
* cases_ShowOutputDocument.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.
*/
/*
* Created on 13-02-2008
*
* @author David Callizaya <davidsantos@colosa.com>
*/
switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
require_once ("classes/model/AppDocumentPeer.php");
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'] );
$sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
if (! isset( $_GET['ext'] )) {
$ext = $info['extension'];
} else {
if ($_GET['ext'] != '') {
$ext = $_GET['ext'];
} else {
$ext = $info['extension'];
}
}
$realPath = PATH_DOCUMENT . $_SESSION['APPLICATION'] . '/outdocs/' . $info['basename'] . '.' . $ext;
G::streamFile( $realPath, true );
*/
switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
require_once ("classes/model/AppDocumentPeer.php");
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'] );
$sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
if (! isset( $_GET['ext'] )) {
$ext = $info['extension'];
} else {
if ($_GET['ext'] != '') {
$ext = $_GET['ext'];
} else {
$ext = $info['extension'];
}
}
$realPath = PATH_DOCUMENT . $_SESSION['APPLICATION'] . '/outdocs/' . $info['basename'] . '.' . $ext;
G::streamFile( $realPath, true );

View File

@@ -96,3 +96,5 @@ function setSelect()
}
</script>
<?php

View File

@@ -1,81 +1,81 @@
<?php
/**
* data_casesSchedulerLog.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/LogCasesSchedulerPeer.php';
require_once 'classes/model/LogCasesScheduler.php';
G::LoadClass( 'configuration' );
$co = new Configurations();
$config = $co->getConfiguration( 'casesSchedulerLogList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
$limit_size = isset( $config['pageSize'] ) ? $config['pageSize'] : 20;
$start = isset( $_REQUEST['start'] ) ? $_REQUEST['start'] : 0;
$limit = isset( $_REQUEST['limit'] ) ? $_REQUEST['limit'] : $limit_size;
$filter = (isset( $_POST['textFilter'] )) ? $_POST['textFilter'] : '';
$oCriteria = new Criteria( 'workflow' );
$oCriteria->clearSelectColumns();
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::LOG_CASE_UID );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::PRO_UID );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::TAS_UID );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::USR_NAME );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::EXEC_DATE );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::EXEC_HOUR );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::RESULT );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::SCH_UID );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS );
if ($filter != '') {
$c_or = $oCriteria->getNewCriterion( LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS, '%' . $filter . '%', Criteria::LIKE ) );
$oCriteria->add( $c_or );
}
$oDataset = LogCasesSchedulerPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$addTables = Array ();
while ($oDataset->next()) {
$addTables[] = $oDataset->getRow();
}
$results = count( $addTables );
$oCriteria->setOffset( $start );
$oCriteria->setLimit( $limit );
$oCriteria->addDescendingOrderByColumn( LogCasesSchedulerPeer::EXEC_DATE );
$oCriteria->addDescendingOrderByColumn( LogCasesSchedulerPeer::EXEC_HOUR );
$oDataset = LogCasesSchedulerPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
<?php
/**
* data_casesSchedulerLog.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/LogCasesSchedulerPeer.php';
require_once 'classes/model/LogCasesScheduler.php';
G::LoadClass( 'configuration' );
$co = new Configurations();
$config = $co->getConfiguration( 'casesSchedulerLogList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
$limit_size = isset( $config['pageSize'] ) ? $config['pageSize'] : 20;
$start = isset( $_REQUEST['start'] ) ? $_REQUEST['start'] : 0;
$limit = isset( $_REQUEST['limit'] ) ? $_REQUEST['limit'] : $limit_size;
$filter = (isset( $_POST['textFilter'] )) ? $_POST['textFilter'] : '';
$oCriteria = new Criteria( 'workflow' );
$oCriteria->clearSelectColumns();
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::LOG_CASE_UID );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::PRO_UID );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::TAS_UID );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::USR_NAME );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::EXEC_DATE );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::EXEC_HOUR );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::RESULT );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::SCH_UID );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS );
if ($filter != '') {
$c_or = $oCriteria->getNewCriterion( LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS, '%' . $filter . '%', Criteria::LIKE ) );
$oCriteria->add( $c_or );
}
$oDataset = LogCasesSchedulerPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$addTables = Array ();
while ($oDataset->next()) {
$addTables[] = $oDataset->getRow();
}
$results = count( $addTables );
$oCriteria->setOffset( $start );
$oCriteria->setLimit( $limit );
$oCriteria->addDescendingOrderByColumn( LogCasesSchedulerPeer::EXEC_DATE );
$oCriteria->addDescendingOrderByColumn( LogCasesSchedulerPeer::EXEC_HOUR );
$oDataset = LogCasesSchedulerPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
//$oDataset = LogCasesSchedulerPeer::doSelectRS ( $oCriteria );
//$oDataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
$addTables = Array ();
while ($oDataset->next()) {
$addTables[] = $oDataset->getRow();
}
$addTables = Array ();
while ($oDataset->next()) {
$addTables[] = $oDataset->getRow();
}
//$oLogCasesScheduler = new LogCasesScheduler();
//$arrData = $oLogCasesScheduler->getAll();
echo '{results: ' . $results . ', rows: ' . G::json_encode( $addTables ) . '}';
echo '{results: ' . $results . ', rows: ' . G::json_encode( $addTables ) . '}';

View File

@@ -1,68 +1,68 @@
<?php
if (isset( $_SESSION['TRIGGER_DEBUG']['info'] )) {
$aTriggers = $_SESSION['TRIGGER_DEBUG']['info'];
} else {
$aTriggers[0] = $_SESSION['TRIGGER_DEBUG'];
}
<?php
if (isset( $_SESSION['TRIGGER_DEBUG']['info'] )) {
$aTriggers = $_SESSION['TRIGGER_DEBUG']['info'];
} else {
$aTriggers[0] = $_SESSION['TRIGGER_DEBUG'];
}
//print_r($aTriggers);die;
$triggersList = Array ();
$i = 0;
foreach ($aTriggers as $aTrigger) {
if ($aTrigger['NUM_TRIGGERS'] != 0) {
foreach ($aTrigger['TRIGGERS_NAMES'] as $index => $name) {
$triggersList[$i]['name'] = $name;
$triggersList[$i]['execution_time'] = strtolower( $aTrigger['TIME'] );
$triggersList = Array ();
$i = 0;
foreach ($aTriggers as $aTrigger) {
if ($aTrigger['NUM_TRIGGERS'] != 0) {
foreach ($aTrigger['TRIGGERS_NAMES'] as $index => $name) {
$triggersList[$i]['name'] = $name;
$triggersList[$i]['execution_time'] = strtolower( $aTrigger['TIME'] );
//$t_code = $aTrigger['TRIGGERS_VALUES'][$index]['TRI_WEBBOT'];
//$t_code = str_replace('"', '\'',$t_code);
//$t_code = addslashes($t_code);
//$t_code = Only1br($t_code);
//highlighting the trigger code using the geshi third party library
G::LoadThirdParty( 'geshi', 'geshi' );
$geshi = new GeSHi( $aTrigger['TRIGGERS_VALUES'][$index]['TRI_WEBBOT'], 'php' );
$geshi->enable_line_numbers( GESHI_FANCY_LINE_NUMBERS, 2 );
$geshi->set_line_style( 'background: #f0f0f0;' );
G::LoadThirdParty( 'geshi', 'geshi' );
$geshi = new GeSHi( $aTrigger['TRIGGERS_VALUES'][$index]['TRI_WEBBOT'], 'php' );
$geshi->enable_line_numbers( GESHI_FANCY_LINE_NUMBERS, 2 );
$geshi->set_line_style( 'background: #f0f0f0;' );
$triggersList[$i]['code'] = $geshi->parse_code(); //$aTrigger['TRIGGERS_VALUES'][$index]['TRI_WEBBOT'];
$i ++;
}
} else {
}
}
$i ++;
}
} else {
}
}
//print_r($_SESSION['TRIGGER_DEBUG']['ERRORS']); die;
$DEBUG_ERRORS = array_unique( $_SESSION['TRIGGER_DEBUG']['ERRORS'] );
foreach ($DEBUG_ERRORS as $error) {
if (isset( $error['ERROR'] ) and $error['ERROR'] != '') {
$triggersList[$i]['name'] = 'Error';
$triggersList[$i]['execution_time'] = 'error';
$triggersList[$i]['code'] = $error['ERROR'];
$i ++;
}
if (isset( $error['FATAL'] ) and $error['FATAL'] != '') {
$error['FATAL'] = str_replace( "<br />", "\n", $error['FATAL'] );
$tmp = explode( "\n", $error['FATAL'] );
$triggersList[$i]['name'] = isset( $tmp[0] ) ? $tmp[0] : 'Fatal Error in trigger';
$triggersList[$i]['execution_time'] = 'Fatal error';
$triggersList[$i]['code'] = $error['FATAL'];
$i ++;
}
}
$DEBUG_ERRORS = array_unique( $_SESSION['TRIGGER_DEBUG']['ERRORS'] );
foreach ($DEBUG_ERRORS as $error) {
if (isset( $error['ERROR'] ) and $error['ERROR'] != '') {
$triggersList[$i]['name'] = 'Error';
$triggersList[$i]['execution_time'] = 'error';
$triggersList[$i]['code'] = $error['ERROR'];
$i ++;
}
if (isset( $error['FATAL'] ) and $error['FATAL'] != '') {
$error['FATAL'] = str_replace( "<br />", "\n", $error['FATAL'] );
$tmp = explode( "\n", $error['FATAL'] );
$triggersList[$i]['name'] = isset( $tmp[0] ) ? $tmp[0] : 'Fatal Error in trigger';
$triggersList[$i]['execution_time'] = 'Fatal error';
$triggersList[$i]['code'] = $error['FATAL'];
$i ++;
}
}
/*echo '{total:5, data:[
{name:"trigger1", execution_time:"after"},
{name:"trigger2", execution_time:"before"},
{name:"trigger13", execution_time:"before"},
]}';
*/
$triggersRet->total = count( $triggersList );
$triggersRet->data = $triggersList;
echo G::json_encode( $triggersRet );
*/
$triggersRet->total = count( $triggersList );
$triggersRet->data = $triggersList;
echo G::json_encode( $triggersRet );

View File

@@ -1,99 +1,96 @@
<?php
$request = isset( $_POST['request'] ) ? $_POST['request'] : '';
switch ($request) {
case 'getRows':
$fieldname = $_POST['fieldname'];
G::LoadClass( 'case' );
$oApp = new Cases();
$aFields = $oApp->loadCase( $_SESSION['APPLICATION'] );
$aVars = Array ();
for ($i = 0; $i < count( $_SESSION['TRIGGER_DEBUG']['DATA'] ); $i ++) {
$aVars[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value'];
}
$aVars = array_merge( $aFields['APP_DATA'], $aVars );
$field = $aVars[$fieldname];
$response->headers = Array ();
$response->columns = Array ();
$response->rows = Array ();
$sw = true;
$j = 0;
if (is_array( $field )) {
foreach ($field as $row) {
if ($sw) {
foreach ($row as $key => $value) {
$response->headers[] = Array ('name' => $key
);
$response->columns[] = Array ('header' => $key,'width' => 100,'dataIndex' => $key
);
}
$sw = false;
}
$tmp = Array ();
foreach ($row as $key => $value) {
$tmp[] = $value;
}
$response->rows[$j ++] = $tmp;
}
} else {
if (is_object( $field )) {
$response->headers = Array (Array ('name' => 'name'
),Array ('name' => 'value'
)
);
$response->columns = Array (Array ('header' => 'Property','width' => 100,'dataIndex' => 'name'
),Array ('header' => 'Value','width' => 100,'dataIndex' => 'value'
)
);
foreach ($field as $key => $value) {
$response->rows[] = Array ($key,$value
);
}
}
}
echo G::json_encode( $response );
break;
default:
G::LoadClass( 'case' );
$oApp = new Cases();
$aFields = $oApp->loadCase( $_SESSION['APPLICATION'] );
$aVars = Array ();
for ($i = 0; $i < count( $_SESSION['TRIGGER_DEBUG']['DATA'] ); $i ++) {
$aVars[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value'];
}
$aVars = array_merge( $aFields['APP_DATA'], $aVars );
if (isset( $_POST['filter'] ) && $_POST['filter'] == 'dyn') {
$sysVars = array_keys( G::getSystemConstants() );
$varNames = array_keys( $aVars );
foreach ($varNames as $var) {
if (in_array( $var, $sysVars )) {
unset( $aVars[$var] );
}
}
}
if (isset( $_POST['filter'] ) && $_POST['filter'] == 'sys') {
$aVars = G::getSystemConstants();
}
ksort( $aVars );
$return_object->totalCount = 1;
foreach ($aVars as $i => $var) {
if (is_array( $var ) || is_object( $var )) {
$aVars[$i] = print_r( $var, true );
}
}
$return_object->data[0] = $aVars;
echo G::json_encode( $return_object );
break;
}
<?php
$request = isset( $_POST['request'] ) ? $_POST['request'] : '';
switch ($request) {
case 'getRows':
$fieldname = $_POST['fieldname'];
G::LoadClass( 'case' );
$oApp = new Cases();
$aFields = $oApp->loadCase( $_SESSION['APPLICATION'] );
$aVars = Array ();
for ($i = 0; $i < count( $_SESSION['TRIGGER_DEBUG']['DATA'] ); $i ++) {
$aVars[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value'];
}
$aVars = array_merge( $aFields['APP_DATA'], $aVars );
$field = $aVars[$fieldname];
$response->headers = Array ();
$response->columns = Array ();
$response->rows = Array ();
$sw = true;
$j = 0;
if (is_array( $field )) {
foreach ($field as $row) {
if ($sw) {
foreach ($row as $key => $value) {
$response->headers[] = Array ('name' => $key);
$response->columns[] = Array ('header' => $key,'width' => 100,'dataIndex' => $key);
}
$sw = false;
}
$tmp = Array ();
foreach ($row as $key => $value) {
$tmp[] = $value;
}
$response->rows[$j ++] = $tmp;
}
} else {
if (is_object( $field )) {
$response->headers = Array (Array ('name' => 'name'
),Array ('name' => 'value'
)
);
$response->columns = Array (Array ('header' => 'Property','width' => 100,'dataIndex' => 'name'
),Array ('header' => 'Value','width' => 100,'dataIndex' => 'value'
)
);
foreach ($field as $key => $value) {
$response->rows[] = Array ($key,$value);
}
}
}
echo G::json_encode( $response );
break;
default:
G::LoadClass( 'case' );
$oApp = new Cases();
$aFields = $oApp->loadCase( $_SESSION['APPLICATION'] );
$aVars = Array ();
for ($i = 0; $i < count( $_SESSION['TRIGGER_DEBUG']['DATA'] ); $i ++) {
$aVars[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value'];
}
$aVars = array_merge( $aFields['APP_DATA'], $aVars );
if (isset( $_POST['filter'] ) && $_POST['filter'] == 'dyn') {
$sysVars = array_keys( G::getSystemConstants() );
$varNames = array_keys( $aVars );
foreach ($varNames as $var) {
if (in_array( $var, $sysVars )) {
unset( $aVars[$var] );
}
}
}
if (isset( $_POST['filter'] ) && $_POST['filter'] == 'sys') {
$aVars = G::getSystemConstants();
}
ksort( $aVars );
$return_object->totalCount = 1;
foreach ($aVars as $i => $var) {
if (is_array( $var ) || is_object( $var )) {
$aVars[$i] = print_r( $var, true );
}
}
$return_object->data[0] = $aVars;
echo G::json_encode( $return_object );
break;
}

View File

@@ -1,28 +1,28 @@
<?php
/**
* index.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.
*
*/
<?php
/**
* index.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.
*
*/
//$newFile = str_replace ( 'index.php', 'cases_List.php' , __FILE__ ) ;
$newFile = str_replace( 'index.php', 'main.php', __FILE__ );
return $newFile;
$newFile = str_replace( 'index.php', 'main.php', __FILE__ );
return $newFile;

View File

@@ -1,35 +1,35 @@
<?php
/**
* main.php Cases List main processor
*
* 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.
*/
$RBAC->requirePermissions( 'PM_CASES' );
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'CASES';
$_POST['qs'] = isset( $_SERVER['QUERY_STRING'] ) && $_SERVER['QUERY_STRING'] != '' ? '?' . $_SERVER['QUERY_STRING'] : '';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'cases/cases_Load' );
G::RenderPage( 'publish' );
<?php
/**
* main.php Cases List main processor
*
* 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.
*/
$RBAC->requirePermissions( 'PM_CASES' );
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'CASES';
$_POST['qs'] = isset( $_SERVER['QUERY_STRING'] ) && $_SERVER['QUERY_STRING'] != '' ? '?' . $_SERVER['QUERY_STRING'] : '';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'cases/cases_Load' );
G::RenderPage( 'publish' );

View File

@@ -1,92 +1,92 @@
<?php
/**
* main.php Cases List main processor
*
* 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.
*/
G::LoadClass( "configuration" );
$conf = new Configurations();
$oHeadPublisher = &headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript( "cases/main", false ); //Adding a javascript file .js
$oHeadPublisher->addContent( "cases/main" ); //Adding a html file .html.
$keyMem = "USER_PREFERENCES" . $_SESSION["USER_LOGGED"];
$memcache = &PMmemcached::getSingleton( SYS_SYS );
if (($arrayConfig = $memcache->get( $keyMem )) === false) {
$conf->loadConfig( $x, "USER_PREFERENCES", "", "", $_SESSION["USER_LOGGED"], "" );
$arrayConfig = $conf->aConfig;
$memcache->set( $keyMem, $arrayConfig, PMmemcached::ONE_HOUR );
}
$confDefaultOption = "";
if (isset( $arrayConfig["DEFAULT_CASES_MENU"] )) { //this user has a configuration record
$confDefaultOption = $arrayConfig["DEFAULT_CASES_MENU"];
global $G_TMP_MENU;
$oMenu = new Menu();
$oMenu->load( "cases" );
$defaultOption = "";
foreach ($oMenu->Id as $i => $id) {
if ($id == $confDefaultOption) {
$defaultOption = $oMenu->Options[$i];
break;
}
}
$defaultOption = ($defaultOption != "") ? $defaultOption : "casesListExtJs";
} else {
$defaultOption = "casesListExtJs";
$confDefaultOption = "CASES_INBOX";
}
if (isset( $_GET["id"] ) && isset( $_GET["id"] )) {
$defaultOption = "../cases/open?APP_UID=" . $_GET["id"] . "&DEL_INDEX=" . $_GET["i"];
if (isset( $_GET["a"] )) {
$defaultOption .= "&action=" . $_GET["a"];
}
}
$oServerConf = & serverConf::getSingleton();
if ($oServerConf->isRtl( SYS_LANG )) {
$regionTreePanel = 'east';
$regionDebug = 'west';
} else {
$regionTreePanel = 'west';
$regionDebug = 'east';
}
$oHeadPublisher->assign( 'regionTreePanel', $regionTreePanel );
$oHeadPublisher->assign( 'regionDebug', $regionDebug );
$oHeadPublisher->assign( "defaultOption", $defaultOption ); //User menu permissions
$oHeadPublisher->assign( "_nodeId", isset( $confDefaultOption ) ? $confDefaultOption : "PM_USERS" ); //User menu permissions
$oHeadPublisher->assign( "FORMATS", $conf->getFormats() );
$_SESSION["current_ux"] = "NORMAL";
G::RenderPage( "publish", "extJs" );
<?php
/**
* main.php Cases List main processor
*
* 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.
*/
G::LoadClass( "configuration" );
$conf = new Configurations();
$oHeadPublisher = &headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript( "cases/main", false ); //Adding a javascript file .js
$oHeadPublisher->addContent( "cases/main" ); //Adding a html file .html.
$keyMem = "USER_PREFERENCES" . $_SESSION["USER_LOGGED"];
$memcache = &PMmemcached::getSingleton( SYS_SYS );
if (($arrayConfig = $memcache->get( $keyMem )) === false) {
$conf->loadConfig( $x, "USER_PREFERENCES", "", "", $_SESSION["USER_LOGGED"], "" );
$arrayConfig = $conf->aConfig;
$memcache->set( $keyMem, $arrayConfig, PMmemcached::ONE_HOUR );
}
$confDefaultOption = "";
if (isset( $arrayConfig["DEFAULT_CASES_MENU"] )) {
//this user has a configuration record
$confDefaultOption = $arrayConfig["DEFAULT_CASES_MENU"];
global $G_TMP_MENU;
$oMenu = new Menu();
$oMenu->load( "cases" );
$defaultOption = "";
foreach ($oMenu->Id as $i => $id) {
if ($id == $confDefaultOption) {
$defaultOption = $oMenu->Options[$i];
break;
}
}
$defaultOption = ($defaultOption != "") ? $defaultOption : "casesListExtJs";
} else {
$defaultOption = "casesListExtJs";
$confDefaultOption = "CASES_INBOX";
}
if (isset( $_GET["id"] ) && isset( $_GET["id"] )) {
$defaultOption = "../cases/open?APP_UID=" . $_GET["id"] . "&DEL_INDEX=" . $_GET["i"];
if (isset( $_GET["a"] )) {
$defaultOption .= "&action=" . $_GET["a"];
}
}
$oServerConf = & serverConf::getSingleton();
if ($oServerConf->isRtl( SYS_LANG )) {
$regionTreePanel = 'east';
$regionDebug = 'west';
} else {
$regionTreePanel = 'west';
$regionDebug = 'east';
}
$oHeadPublisher->assign( 'regionTreePanel', $regionTreePanel );
$oHeadPublisher->assign( 'regionDebug', $regionDebug );
$oHeadPublisher->assign( "defaultOption", $defaultOption ); //User menu permissions
$oHeadPublisher->assign( "_nodeId", isset( $confDefaultOption ) ? $confDefaultOption : "PM_USERS" ); //User menu permissions
$oHeadPublisher->assign( "FORMATS", $conf->getFormats() );
$_SESSION["current_ux"] = "NORMAL";
G::RenderPage( "publish", "extJs" );

View File

@@ -1,87 +1,87 @@
<?php
/**
* open.php Open Case main processor
*
* 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 3th, 2010
*/
if (! isset( $_GET['APP_UID'] ) || ! isset( $_GET['DEL_INDEX'] )) {
if (isset( $_GET['APP_NUMBER'] )) {
G::LoadClass( 'case' );
$oCase = new Cases();
$_GET['APP_UID'] = $oCase->getApplicationUIDByNumber( $_GET['APP_NUMBER'] );
$_GET['DEL_INDEX'] = $oCase->getCurrentDelegation( $_GET['APP_UID'], $_SESSION['USER_LOGGED'] );
if (is_null( $_GET['APP_UID'] )) {
throw new Exception( G::LoadTranslation( 'ID_CASE_DOES_NOT_EXISTS' ) );
}
if (is_null( $_GET['DEL_INDEX'] )) {
throw new Exception( G::LoadTranslation( 'ID_CASE_IS_CURRENTLY_WITH_ANOTHER_USER' ) );
}
} else {
throw new Exception( "Application ID or Delegation Index is missing!. The System can't open the case." );
}
}
require_once ("classes/model/Step.php");
G::LoadClass( "configuration" );
G::LoadClass( "case" );
$oCase = new Cases();
$conf = new Configurations();
$oHeadPublisher = & headPublisher::getSingleton();
$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";
}
$case = $oCase->loadCase( $_GET['APP_UID'], $_GET['DEL_INDEX'] );
if (! isset( $_GET['to_revise'] )) {
$script = 'cases_Open?';
} else {
$script = 'cases_OpenToRevise?';
$delIndex = $_GET['DEL_INDEX'];
$appUid = $_GET['APP_UID'];
$oHeadPublisher->assign( 'treeToReviseTitle', G::loadtranslation( 'ID_STEP_LIST' ) );
$casesPanelUrl = 'casesToReviseTreeContent?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex;
<?php
/**
* open.php Open Case main processor
*
* 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 3th, 2010
*/
if (! isset( $_GET['APP_UID'] ) || ! isset( $_GET['DEL_INDEX'] )) {
if (isset( $_GET['APP_NUMBER'] )) {
G::LoadClass( 'case' );
$oCase = new Cases();
$_GET['APP_UID'] = $oCase->getApplicationUIDByNumber( $_GET['APP_NUMBER'] );
$_GET['DEL_INDEX'] = $oCase->getCurrentDelegation( $_GET['APP_UID'], $_SESSION['USER_LOGGED'] );
if (is_null( $_GET['APP_UID'] )) {
throw new Exception( G::LoadTranslation( 'ID_CASE_DOES_NOT_EXISTS' ) );
}
if (is_null( $_GET['DEL_INDEX'] )) {
throw new Exception( G::LoadTranslation( 'ID_CASE_IS_CURRENTLY_WITH_ANOTHER_USER' ) );
}
} else {
throw new Exception( "Application ID or Delegation Index is missing!. The System can't open the case." );
}
}
require_once ("classes/model/Step.php");
G::LoadClass( "configuration" );
G::LoadClass( "case" );
$oCase = new Cases();
$conf = new Configurations();
$oHeadPublisher = & headPublisher::getSingleton();
$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";
}
$case = $oCase->loadCase( $_GET['APP_UID'], $_GET['DEL_INDEX'] );
if (! isset( $_GET['to_revise'] )) {
$script = 'cases_Open?';
} else {
$script = 'cases_OpenToRevise?';
$delIndex = $_GET['DEL_INDEX'];
$appUid = $_GET['APP_UID'];
$oHeadPublisher->assign( 'treeToReviseTitle', G::loadtranslation( 'ID_STEP_LIST' ) );
$casesPanelUrl = 'casesToReviseTreeContent?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex;
$oHeadPublisher->assign( 'casesPanelUrl', $casesPanelUrl ); //translations
echo "<div id='toReviseTree'></div>";
}
$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( '_ENV_CURRENT_DATE', $conf->getSystemDate( date( 'Y-m-d' ) ) );
$oHeadPublisher->assign( '_ENV_CURRENT_DATE_NO_FORMAT', date( 'Y-m-d' ) );
$oHeadPublisher->assign( 'idfirstform', is_null( $oStep ) ? '' : $oStep->getStepUidObj() );
G::RenderPage( 'publish', 'extJs' );
echo "<div id='toReviseTree'></div>";
}
$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( '_ENV_CURRENT_DATE', $conf->getSystemDate( date( 'Y-m-d' ) ) );
$oHeadPublisher->assign( '_ENV_CURRENT_DATE_NO_FORMAT', date( 'Y-m-d' ) );
$oHeadPublisher->assign( 'idfirstform', is_null( $oStep ) ? '' : $oStep->getStepUidObj() );
G::RenderPage( 'publish', 'extJs' );

View File

@@ -1,46 +1,46 @@
<?php
<?php
//Getting the extJs parameters
$callback = isset( $_POST["callback"] ) ? $_POST["callback"] : "stcCallback1001";
$dir = isset( $_POST["dir"] ) ? $_POST["dir"] : "DESC";
$sort = isset( $_POST["sort"] ) ? $_POST["sort"] : "";
$start = isset( $_POST["start"] ) ? $_POST["start"] : "0";
$limit = isset( $_POST["limit"] ) ? $_POST["limit"] : "25";
$filter = isset( $_POST["filter"] ) ? $_POST["filter"] : "";
$process = isset( $_POST["process"] ) ? $_POST["process"] : "";
$category = isset( $_POST["category"] ) ? $_POST["category"] : "";
$status = isset( $_POST["status"] ) ? strtoupper( $_POST["status"] ) : "";
$user = isset( $_POST["user"] ) ? $_POST["user"] : "";
$search = isset( $_POST["search"] ) ? $_POST["search"] : "";
$action = isset( $_GET["action"] ) ? $_GET["action"] : (isset( $_POST["action"] ) ? $_POST["action"] : "todo");
$type = isset( $_GET["type"] ) ? $_GET["type"] : (isset( $_POST["type"] ) ? $_POST["type"] : "extjs");
$dateFrom = isset( $_POST["dateFrom"] ) ? substr( $_POST["dateFrom"], 0, 10 ) : "";
$dateTo = isset( $_POST["dateTo"] ) ? substr( $_POST["dateTo"], 0, 10 ) : "";
try {
$result = "";
$userUid = (isset( $_SESSION["USER_LOGGED"] ) && $_SESSION["USER_LOGGED"] != "") ? $_SESSION["USER_LOGGED"] : null;
$user = ($user == "CURRENT_USER") ? $userUid : $user;
if (($action == "todo" || $action == "draft" || $action == "sent" || $action == "selfservice" || $action == "unassigned" || $action == "search") && (($solrConf = System::solrEnv()) !== false)) {
G::LoadClass( "AppSolr" );
$ApplicationSolrIndex = new AppSolr( $solrConf["solr_enabled"], $solrConf["solr_host"], $solrConf["solr_instance"] );
$data = $ApplicationSolrIndex->getAppGridData( $userUid, $start, $limit, $action, $filter, $search, $process, $user, $status, $type, $dateFrom, $dateTo, $callback, $dir, $sort );
$result = G::json_encode( $data );
} else {
G::LoadClass( "applications" );
$apps = new Applications();
$data = $apps->getAll( $userUid, $start, $limit, $action, $filter, $search, $process, $user, $status, $type, $dateFrom, $dateTo, $callback, $dir, $sort, $category );
$result = G::json_encode( $data );
}
echo $result;
} catch (Exception $e) {
$msg = array ("error" => $e->getMessage() );
echo G::json_encode( $msg );
}
$callback = isset( $_POST["callback"] ) ? $_POST["callback"] : "stcCallback1001";
$dir = isset( $_POST["dir"] ) ? $_POST["dir"] : "DESC";
$sort = isset( $_POST["sort"] ) ? $_POST["sort"] : "";
$start = isset( $_POST["start"] ) ? $_POST["start"] : "0";
$limit = isset( $_POST["limit"] ) ? $_POST["limit"] : "25";
$filter = isset( $_POST["filter"] ) ? $_POST["filter"] : "";
$process = isset( $_POST["process"] ) ? $_POST["process"] : "";
$category = isset( $_POST["category"] ) ? $_POST["category"] : "";
$status = isset( $_POST["status"] ) ? strtoupper( $_POST["status"] ) : "";
$user = isset( $_POST["user"] ) ? $_POST["user"] : "";
$search = isset( $_POST["search"] ) ? $_POST["search"] : "";
$action = isset( $_GET["action"] ) ? $_GET["action"] : (isset( $_POST["action"] ) ? $_POST["action"] : "todo");
$type = isset( $_GET["type"] ) ? $_GET["type"] : (isset( $_POST["type"] ) ? $_POST["type"] : "extjs");
$dateFrom = isset( $_POST["dateFrom"] ) ? substr( $_POST["dateFrom"], 0, 10 ) : "";
$dateTo = isset( $_POST["dateTo"] ) ? substr( $_POST["dateTo"], 0, 10 ) : "";
try {
$result = "";
$userUid = (isset( $_SESSION["USER_LOGGED"] ) && $_SESSION["USER_LOGGED"] != "") ? $_SESSION["USER_LOGGED"] : null;
$user = ($user == "CURRENT_USER") ? $userUid : $user;
if (($action == "todo" || $action == "draft" || $action == "sent" || $action == "selfservice" || $action == "unassigned" || $action == "search") && (($solrConf = System::solrEnv()) !== false)) {
G::LoadClass( "AppSolr" );
$ApplicationSolrIndex = new AppSolr( $solrConf["solr_enabled"], $solrConf["solr_host"], $solrConf["solr_instance"] );
$data = $ApplicationSolrIndex->getAppGridData( $userUid, $start, $limit, $action, $filter, $search, $process, $user, $status, $type, $dateFrom, $dateTo, $callback, $dir, $sort );
$result = G::json_encode( $data );
} else {
G::LoadClass( "applications" );
$apps = new Applications();
$data = $apps->getAll( $userUid, $start, $limit, $action, $filter, $search, $process, $user, $status, $type, $dateFrom, $dateTo, $callback, $dir, $sort, $category );
$result = G::json_encode( $data );
}
echo $result;
} catch (Exception $e) {
$msg = array ("error" => $e->getMessage() );
echo G::json_encode( $msg );
}

View File

@@ -1,69 +1,72 @@
<?php
$callback = isset( $_POST['callback'] ) ? $_POST['callback'] : 'stcCallback1001';
$dir = isset( $_POST['dir'] ) ? $_POST['dir'] : 'DESC';
$sort = isset( $_POST['sort'] ) ? $_POST['sort'] : '';
$query = isset( $_POST['query'] ) ? $_POST['query'] : '';
<?php
$callback = isset( $_POST['callback'] ) ? $_POST['callback'] : 'stcCallback1001';
$dir = isset( $_POST['dir'] ) ? $_POST['dir'] : 'DESC';
$sort = isset( $_POST['sort'] ) ? $_POST['sort'] : '';
$query = isset( $_POST['query'] ) ? $_POST['query'] : '';
//$action = isset($_GET['action']) ? $_GET['action'] : 'read';
$option = '';
if (isset( $_GET['t'] ))
$option = $_GET['t'];
try {
G::LoadClass( "BasePeer" );
require_once ("classes/model/Process.php");
require_once ("classes/model/AppCacheView.php");
$sUIDUserLogged = $_SESSION['USER_LOGGED'];
$Criteria = new Criteria( 'workflow' );
$Criteria->clearSelectColumns();
$Criteria->setDistinct();
$Criteria->addSelectColumn( AppCacheViewPeer::PRO_UID );
$Criteria->addSelectColumn( AppCacheViewPeer::APP_PRO_TITLE );
if ($query != '') {
$Criteria->add( AppCacheViewPeer::APP_PRO_TITLE, $query . '%', Criteria::LIKE );
}
$Criteria->add( AppCacheViewPeer::APP_STATUS, "TO_DO", CRITERIA::EQUAL );
$Criteria->add( AppCacheViewPeer::USR_UID, $sUIDUserLogged );
$option = '';
if (isset( $_GET['t'] ))
$option = $_GET['t'];
try {
G::LoadClass( "BasePeer" );
require_once ("classes/model/Process.php");
require_once ("classes/model/AppCacheView.php");
$sUIDUserLogged = $_SESSION['USER_LOGGED'];
$Criteria = new Criteria( 'workflow' );
$Criteria->clearSelectColumns();
$Criteria->setDistinct();
$Criteria->addSelectColumn( AppCacheViewPeer::PRO_UID );
$Criteria->addSelectColumn( AppCacheViewPeer::APP_PRO_TITLE );
if ($query != '') {
$Criteria->add( AppCacheViewPeer::APP_PRO_TITLE, $query . '%', Criteria::LIKE );
}
$Criteria->add( AppCacheViewPeer::APP_STATUS, "TO_DO", CRITERIA::EQUAL );
$Criteria->add( AppCacheViewPeer::USR_UID, $sUIDUserLogged );
//$totalCount = AppCacheViewPeer::doCount( $Criteria );
if (isset( $limit ))
$Criteria->setLimit( $limit );
if (isset( $start ))
$Criteria->setOffset( $start );
if ($sort != '') {
if ($dir == 'DESC')
$Criteria->addDescendingOrderByColumn( $sort );
else
$Criteria->addAscendingOrderByColumn( $sort );
}
$oDataset = AppCacheViewPeer::doSelectRS( $Criteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$result = array ();
$rows = array ();
$index = isset( $start ) ? $start : 0;
while ($aRow = $oDataset->getRow()) {
$aRow['index'] = ++ $index;
$rows[] = $aRow;
$oDataset->next();
}
$result['totalCount'] = count( $rows );
$result['data'] = $rows;
print G::json_encode( $result );
} catch (Exception $e) {
$G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
}
if (isset( $limit )) {
$Criteria->setLimit( $limit );
}
if (isset( $start )) {
$Criteria->setOffset( $start );
}
if ($sort != '') {
if ($dir == 'DESC') {
$Criteria->addDescendingOrderByColumn( $sort );
} else {
$Criteria->addAscendingOrderByColumn( $sort );
}
}
$oDataset = AppCacheViewPeer::doSelectRS( $Criteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next();
$result = array ();
$rows = array ();
$index = isset( $start ) ? $start : 0;
while ($aRow = $oDataset->getRow()) {
$aRow['index'] = ++ $index;
$rows[] = $aRow;
$oDataset->next();
}
$result['totalCount'] = count( $rows );
$result['data'] = $rows;
print G::json_encode( $result );
} catch (Exception $e) {
$G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
}

View File

@@ -1,97 +1,97 @@
<?php
$callback = isset( $_POST['callback'] ) ? $_POST['callback'] : 'stcCallback1001';
$dir = isset( $_POST['dir'] ) ? $_POST['dir'] : 'DESC';
$sort = isset( $_POST['sort'] ) ? $_POST['sort'] : '';
$start = isset( $_POST['start'] ) ? $_POST['start'] : '0';
$limit = isset( $_POST['limit'] ) ? $_POST['limit'] : '25';
$filter = isset( $_POST['filter'] ) ? $_POST['filter'] : '';
$search = isset( $_POST['search'] ) ? $_POST['search'] : '';
$process = isset( $_POST['process'] ) ? $_POST['process'] : '';
$user = isset( $_POST['user'] ) ? $_POST['user'] : '';
$status = isset( $_POST['status'] ) ? strtoupper( $_POST['status'] ) : '';
$action = isset( $_GET['action'] ) ? $_GET['action'] : (isset( $_POST['action'] ) ? $_POST['action'] : 'todo');
$type = isset( $_GET['type'] ) ? $_GET['type'] : (isset( $_POST['type'] ) ? $_POST['type'] : 'extjs');
$user = isset( $_POST['user'] ) ? $_POST['user'] : '';
$sentUids = explode( ',', $_POST['APP_UIDS'] );
$allUidsRecords = array ();
$allTasUids = array ();
<?php
$callback = isset( $_POST['callback'] ) ? $_POST['callback'] : 'stcCallback1001';
$dir = isset( $_POST['dir'] ) ? $_POST['dir'] : 'DESC';
$sort = isset( $_POST['sort'] ) ? $_POST['sort'] : '';
$start = isset( $_POST['start'] ) ? $_POST['start'] : '0';
$limit = isset( $_POST['limit'] ) ? $_POST['limit'] : '25';
$filter = isset( $_POST['filter'] ) ? $_POST['filter'] : '';
$search = isset( $_POST['search'] ) ? $_POST['search'] : '';
$process = isset( $_POST['process'] ) ? $_POST['process'] : '';
$user = isset( $_POST['user'] ) ? $_POST['user'] : '';
$status = isset( $_POST['status'] ) ? strtoupper( $_POST['status'] ) : '';
$action = isset( $_GET['action'] ) ? $_GET['action'] : (isset( $_POST['action'] ) ? $_POST['action'] : 'todo');
$type = isset( $_GET['type'] ) ? $_GET['type'] : (isset( $_POST['type'] ) ? $_POST['type'] : 'extjs');
$user = isset( $_POST['user'] ) ? $_POST['user'] : '';
$sentUids = explode( ',', $_POST['APP_UIDS'] );
$allUidsRecords = array ();
$allTasUids = array ();
// getting all App Uids and task Uids
foreach ($sentUids as $sentUid) {
$aItem = explode( '|', $sentUid );
$allUidsRecords[] = array ('APP_UID' => $aItem[0],'TAS_UID' => $aItem[1],'DEL_INDEX' => $aItem[2]);
}
$sReassignFromUser = isset( $_POST['user'] ) ? $_POST['user'] : '';
$sProcessUid = isset( $_POST['process'] ) ? $_POST['process'] : '';
G::LoadClass( 'tasks' );
G::LoadClass( 'groups' );
G::LoadClass( 'case' );
G::LoadClass( 'users' );
require_once ("classes/model/AppCacheView.php");
$oTasks = new Tasks();
$oGroups = new Groups();
$oUser = new Users();
$oCases = new Cases();
$aCasesList = Array ();
$vard = 0;
foreach ($allUidsRecords as $aRecord) {
$vard = $vard + 1;
$APP_UID = $aRecord['APP_UID'];
$delIndex = $aRecord['DEL_INDEX'];
$aCase = $oCases->loadCaseByDelegation( $APP_UID, $delIndex );
$aUsersInvolved = Array ();
$aCaseGroups = $oTasks->getGroupsOfTask( $aCase['TAS_UID'], 1 );
foreach ($aCaseGroups as $aCaseGroup) {
$aCaseUsers = $oGroups->getUsersOfGroup( $aCaseGroup['GRP_UID'] );
foreach ($aCaseUsers as $aCaseUser) {
if ($aCaseUser['USR_UID'] != $sReassignFromUser) {
$aCaseUserRecord = $oUser->load( $aCaseUser['USR_UID'] );
$aUsersInvolved[] = array ('userUid' => $aCaseUser['USR_UID'],'userFullname' => $aCaseUserRecord['USR_FIRSTNAME'] . ' ' . $aCaseUserRecord['USR_LASTNAME']);
foreach ($sentUids as $sentUid) {
$aItem = explode( '|', $sentUid );
$allUidsRecords[] = array ('APP_UID' => $aItem[0],'TAS_UID' => $aItem[1],'DEL_INDEX' => $aItem[2]);
}
$sReassignFromUser = isset( $_POST['user'] ) ? $_POST['user'] : '';
$sProcessUid = isset( $_POST['process'] ) ? $_POST['process'] : '';
G::LoadClass( 'tasks' );
G::LoadClass( 'groups' );
G::LoadClass( 'case' );
G::LoadClass( 'users' );
require_once ("classes/model/AppCacheView.php");
$oTasks = new Tasks();
$oGroups = new Groups();
$oUser = new Users();
$oCases = new Cases();
$aCasesList = Array ();
$vard = 0;
foreach ($allUidsRecords as $aRecord) {
$vard = $vard + 1;
$APP_UID = $aRecord['APP_UID'];
$delIndex = $aRecord['DEL_INDEX'];
$aCase = $oCases->loadCaseByDelegation( $APP_UID, $delIndex );
$aUsersInvolved = Array ();
$aCaseGroups = $oTasks->getGroupsOfTask( $aCase['TAS_UID'], 1 );
foreach ($aCaseGroups as $aCaseGroup) {
$aCaseUsers = $oGroups->getUsersOfGroup( $aCaseGroup['GRP_UID'] );
foreach ($aCaseUsers as $aCaseUser) {
if ($aCaseUser['USR_UID'] != $sReassignFromUser) {
$aCaseUserRecord = $oUser->load( $aCaseUser['USR_UID'] );
$aUsersInvolved[] = array ('userUid' => $aCaseUser['USR_UID'],'userFullname' => $aCaseUserRecord['USR_FIRSTNAME'] . ' ' . $aCaseUserRecord['USR_LASTNAME']);
// . ' (' . $aCaseUserRecord['USR_USERNAME']
}
}
}
$aCaseUsers = $oTasks->getUsersOfTask( $aCase['TAS_UID'], 1 );
foreach ($aCaseUsers as $aCaseUser) {
if ($aCaseUser['USR_UID'] != $sReassignFromUser) {
$aCaseUserRecord = $oUser->load( $aCaseUser['USR_UID'] );
$aUsersInvolved[] = array ('userUid' => $aCaseUser['USR_UID'],'userFullname' => $aCaseUserRecord['USR_FIRSTNAME'] . ' ' . $aCaseUserRecord['USR_LASTNAME']
);
}
}
$oTmp = $aUsersInvolved;
$aCase['USERS'] = $oTmp;
array_push( $aCasesList, $aCase );
}
$filedNames = Array ("APP_UID","APP_NUMBER","APP_UPDATE_DATE","DEL_PRIORITY","DEL_INDEX","TAS_UID","DEL_INIT_DATE","DEL_FINISH_DATE","USR_UID","APP_STATUS","DEL_TASK_DUE_DATE","APP_CURRENT_USER","APP_TITLE","APP_PRO_TITLE","APP_TAS_TITLE","APP_DEL_PREVIOUS_USER","USERS"
);
$aCasesList = array_merge( Array ($filedNames
), $aCasesList );
$rows = array ();
$i = $start;
for ($j = 0; $j < $limit; $j ++) {
$i ++;
if (isset( $aCasesList[$i] )) {
$rows[] = $aCasesList[$i];
}
}
$totalCount = count( $aCasesList ) - 1;
$result = array ();
$result['totalCount'] = $totalCount;
$index = $start;
$result['data'] = $rows;
}
}
}
$aCaseUsers = $oTasks->getUsersOfTask( $aCase['TAS_UID'], 1 );
foreach ($aCaseUsers as $aCaseUser) {
if ($aCaseUser['USR_UID'] != $sReassignFromUser) {
$aCaseUserRecord = $oUser->load( $aCaseUser['USR_UID'] );
$aUsersInvolved[] = array ('userUid' => $aCaseUser['USR_UID'],'userFullname' => $aCaseUserRecord['USR_FIRSTNAME'] . ' ' . $aCaseUserRecord['USR_LASTNAME']
);
}
}
$oTmp = $aUsersInvolved;
$aCase['USERS'] = $oTmp;
array_push( $aCasesList, $aCase );
}
$filedNames = Array ("APP_UID","APP_NUMBER","APP_UPDATE_DATE","DEL_PRIORITY","DEL_INDEX","TAS_UID","DEL_INIT_DATE","DEL_FINISH_DATE","USR_UID","APP_STATUS","DEL_TASK_DUE_DATE","APP_CURRENT_USER","APP_TITLE","APP_PRO_TITLE","APP_TAS_TITLE","APP_DEL_PREVIOUS_USER","USERS"
);
$aCasesList = array_merge( Array ($filedNames
), $aCasesList );
$rows = array ();
$i = $start;
for ($j = 0; $j < $limit; $j ++) {
$i ++;
if (isset( $aCasesList[$i] )) {
$rows[] = $aCasesList[$i];
}
}
$totalCount = count( $aCasesList ) - 1;
$result = array ();
$result['totalCount'] = $totalCount;
$index = $start;
$result['data'] = $rows;
//print the result in json format
print G::json_encode( $result );
print G::json_encode( $result );

View File

@@ -1,108 +1,109 @@
<?php
G::LoadClass( 'configuration' );
$callback = isset( $_POST['callback'] ) ? $_POST['callback'] : 'stcCallback1001';
$query = isset( $_POST['query'] ) ? $_POST['query'] : '';
$dir = isset( $_POST['dir'] ) ? $_POST['dir'] : 'DESC';
$sort = isset( $_POST['sort'] ) ? $_POST['sort'] : '';
$start = isset( $_POST['start'] ) ? $_POST['start'] : '0';
$limit = isset( $_POST['limit'] ) ? $_POST['limit'] : '25';
$filter = isset( $_POST['filter'] ) ? $_POST['filter'] : '';
$search = isset( $_POST['search'] ) ? $_POST['search'] : '';
$process = isset( $_POST['process'] ) ? $_POST['process'] : '';
$user = isset( $_POST['user'] ) ? $_POST['user'] : '';
$status = isset( $_POST['status'] ) ? strtoupper( $_POST['status'] ) : '';
$action = isset( $_GET['action'] ) ? $_GET['action'] : (isset( $_POST['action'] ) ? $_POST['action'] : 'todo');
$type = isset( $_GET['type'] ) ? $_GET['type'] : (isset( $_POST['type'] ) ? $_POST['type'] : 'extjs');
function array_sort ($array, $on, $order = SORT_ASC, $query = '')
{
$new_array = array ();
$sortable_array = array ();
if (count( $array ) > 0) {
foreach ($array as $k => $v) {
if (is_array( $v )) {
foreach ($v as $k2 => $v2) {
if ($k2 == $on) {
$sortable_array[$k] = $v2;
}
}
} else {
$sortable_array[$k] = $v;
}
}
switch ($order) {
case SORT_ASC:
asort( $sortable_array );
break;
case SORT_DESC:
arsort( $sortable_array );
break;
}
foreach ($sortable_array as $k => $v) {
if ($query == '') {
$new_array[] = $array[$k];
} else {
if (preg_match( "/" . $query . "/i", $array[$k]['userFullname'] )) {
$new_array[] = $array[$k];
}
}
}
}
return $new_array;
}
<?php
G::LoadClass( 'configuration' );
$callback = isset( $_POST['callback'] ) ? $_POST['callback'] : 'stcCallback1001';
$query = isset( $_POST['query'] ) ? $_POST['query'] : '';
$dir = isset( $_POST['dir'] ) ? $_POST['dir'] : 'DESC';
$sort = isset( $_POST['sort'] ) ? $_POST['sort'] : '';
$start = isset( $_POST['start'] ) ? $_POST['start'] : '0';
$limit = isset( $_POST['limit'] ) ? $_POST['limit'] : '25';
$filter = isset( $_POST['filter'] ) ? $_POST['filter'] : '';
$search = isset( $_POST['search'] ) ? $_POST['search'] : '';
$process = isset( $_POST['process'] ) ? $_POST['process'] : '';
$user = isset( $_POST['user'] ) ? $_POST['user'] : '';
$status = isset( $_POST['status'] ) ? strtoupper( $_POST['status'] ) : '';
$action = isset( $_GET['action'] ) ? $_GET['action'] : (isset( $_POST['action'] ) ? $_POST['action'] : 'todo');
$type = isset( $_GET['type'] ) ? $_GET['type'] : (isset( $_POST['type'] ) ? $_POST['type'] : 'extjs');
function array_sort ($array, $on, $order = SORT_ASC, $query = '')
{
$new_array = array ();
$sortable_array = array ();
if (count( $array ) > 0) {
foreach ($array as $k => $v) {
if (is_array( $v )) {
foreach ($v as $k2 => $v2) {
if ($k2 == $on) {
$sortable_array[$k] = $v2;
}
}
} else {
$sortable_array[$k] = $v;
}
}
switch ($order) {
case SORT_ASC:
asort( $sortable_array );
break;
case SORT_DESC:
arsort( $sortable_array );
break;
}
foreach ($sortable_array as $k => $v) {
if ($query == '') {
$new_array[] = $array[$k];
} else {
if (preg_match( "/" . $query . "/i", $array[$k]['userFullname'] )) {
$new_array[] = $array[$k];
}
}
}
}
return $new_array;
}
// $APP_UIDS = explode(',', $_POST['APP_UID']);
$appUid = isset( $_POST['application'] ) ? $_POST['application'] : '';
$appUid = isset( $_POST['application'] ) ? $_POST['application'] : '';
// $processUid = isset($_POST['process']) ? $_POST['process'] : '';
$TaskUid = isset( $_POST['task'] ) ? $_POST['task'] : '';
$sReassignFromUser = isset( $_POST['currentUser'] ) ? $_POST['currentUser'] : '';
G::LoadClass( 'tasks' );
G::LoadClass( 'groups' );
G::LoadClass( 'case' );
G::LoadClass( 'users' );
$oTasks = new Tasks();
$oGroups = new Groups();
$oUser = new Users();
$oCases = new Cases();
$aCasesList = Array ();
$aUsersInvolved = Array ();
$aCaseGroups = $oTasks->getGroupsOfTask( $TaskUid, 1 );
$oConf = new Configurations();
$ConfEnv = $oConf->getFormats();
foreach ($aCaseGroups as $aCaseGroup) {
$aCaseUsers = $oGroups->getUsersOfGroup( $aCaseGroup['GRP_UID'] );
foreach ($aCaseUsers as $aCaseUser) {
if ($aCaseUser['USR_UID'] != $sReassignFromUser) {
$aCaseUserRecord = $oUser->load( $aCaseUser['USR_UID'] );
$sCaseUser = G::getFormatUserList( $ConfEnv['format'], $aCaseUserRecord );
$TaskUid = isset( $_POST['task'] ) ? $_POST['task'] : '';
$sReassignFromUser = isset( $_POST['currentUser'] ) ? $_POST['currentUser'] : '';
G::LoadClass( 'tasks' );
G::LoadClass( 'groups' );
G::LoadClass( 'case' );
G::LoadClass( 'users' );
$oTasks = new Tasks();
$oGroups = new Groups();
$oUser = new Users();
$oCases = new Cases();
$aCasesList = Array ();
$aUsersInvolved = Array ();
$aCaseGroups = $oTasks->getGroupsOfTask( $TaskUid, 1 );
$oConf = new Configurations();
$ConfEnv = $oConf->getFormats();
foreach ($aCaseGroups as $aCaseGroup) {
$aCaseUsers = $oGroups->getUsersOfGroup( $aCaseGroup['GRP_UID'] );
foreach ($aCaseUsers as $aCaseUser) {
if ($aCaseUser['USR_UID'] != $sReassignFromUser) {
$aCaseUserRecord = $oUser->load( $aCaseUser['USR_UID'] );
$sCaseUser = G::getFormatUserList( $ConfEnv['format'], $aCaseUserRecord );
// $aUsersInvolved[] = array ( 'userUid' => $aCaseUser['USR_UID'] , 'userFullname' => $aCaseUserRecord['USR_FIRSTNAME'] . ' ' . $aCaseUserRecord['USR_LASTNAME']); // . ' (' . $aCaseUserRecord['USR_USERNAME'] . ')';
$aUsersInvolved[] = array ('userUid' => $aCaseUser['USR_UID'],'userFullname' => $sCaseUser
$aUsersInvolved[] = array ('userUid' => $aCaseUser['USR_UID'],'userFullname' => $sCaseUser
); // . ' (' . $aCaseUserRecord['USR_USERNAME'] . ')';
}
}
}
$aCaseUsers = $oTasks->getUsersOfTask( $TaskUid, 1 );
foreach ($aCaseUsers as $aCaseUser) {
if ($aCaseUser['USR_UID'] != $sReassignFromUser) {
$aCaseUserRecord = $oUser->load( $aCaseUser['USR_UID'] );
$sCaseUser = G::getFormatUserList( $ConfEnv['format'], $aCaseUserRecord );
}
}
}
$aCaseUsers = $oTasks->getUsersOfTask( $TaskUid, 1 );
foreach ($aCaseUsers as $aCaseUser) {
if ($aCaseUser['USR_UID'] != $sReassignFromUser) {
$aCaseUserRecord = $oUser->load( $aCaseUser['USR_UID'] );
$sCaseUser = G::getFormatUserList( $ConfEnv['format'], $aCaseUserRecord );
// $aUsersInvolved[] = array ( 'userUid' => $aCaseUser['USR_UID'] , 'userFullname' => $aCaseUserRecord['USR_FIRSTNAME'] . ' ' . $aCaseUserRecord['USR_LASTNAME']); // . ' (' . $aCaseUserRecord['USR_USERNAME'] . ')';
$aUsersInvolved[] = array ('userUid' => $aCaseUser['USR_UID'],'userFullname' => $sCaseUser
$aUsersInvolved[] = array ('userUid' => $aCaseUser['USR_UID'],'userFullname' => $sCaseUser
); // . ' (' . $aCaseUserRecord['USR_USERNAME'] . ')';
}
}
}
}
// $oTmp = new stdClass();
// $oTmp->items = $aUsersInvolved;
$result = array ();
$aUsersInvolved = array_sort( $aUsersInvolved, 'userFullname', SORT_ASC, $query );
$result['data'] = $aUsersInvolved;
$result = array ();
$aUsersInvolved = array_sort( $aUsersInvolved, 'userFullname', SORT_ASC, $query );
$result['data'] = $aUsersInvolved;
print G::json_encode( $result );

View File

@@ -1,92 +1,92 @@
<?php
/**
* proxySaveReassignCasesList.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.
*/
$aData = G::json_decode( $_POST['data'] );
$appSelectedUids = array ();
$items = explode( ",", $_POST['APP_UIDS'] );
foreach ($items as $item) {
$dataUids = explode( "|", $item );
$appSelectedUids[] = $dataUids[0];
}
<?php
/**
* proxySaveReassignCasesList.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.
*/
$aData = G::json_decode( $_POST['data'] );
$appSelectedUids = array ();
$items = explode( ",", $_POST['APP_UIDS'] );
foreach ($items as $item) {
$dataUids = explode( "|", $item );
$appSelectedUids[] = $dataUids[0];
}
// var_dump($aData);
//var_dump($appSelectedUids);
$casesReassignedCount = 0;
$serverResponse = array ();
G::LoadClass( 'case' );
$oCases = new Cases();
require_once ('classes/model/Task.php');
require_once ('classes/model/AppCacheView.php');
$oAppCacheView = new AppCacheView();
$oCasesReassignList = $oAppCacheView->getToReassignListCriteria();
if (isset( $_POST['selected'] ) && $_POST['selected'] == 'true') {
$oCasesReassignList->add( AppCacheViewPeer::APP_UID, $appSelectedUids, Criteria::IN );
}
$casesReassignedCount = 0;
$serverResponse = array ();
G::LoadClass( 'case' );
$oCases = new Cases();
require_once ('classes/model/Task.php');
require_once ('classes/model/AppCacheView.php');
$oAppCacheView = new AppCacheView();
$oCasesReassignList = $oAppCacheView->getToReassignListCriteria();
if (isset( $_POST['selected'] ) && $_POST['selected'] == 'true') {
$oCasesReassignList->add( AppCacheViewPeer::APP_UID, $appSelectedUids, Criteria::IN );
}
// if there are no records to save return -1
if (empty( $aData )) {
$serverResponse['TOTAL'] = - 1;
echo G::json_encode( $serverResponse );
die();
}
if (empty( $aData )) {
$serverResponse['TOTAL'] = - 1;
echo G::json_encode( $serverResponse );
die();
}
// $params = array ();
// $sql = BasePeer::createSelectSql($oCasesReassignList, $params);
// var_dump($sql);
if (is_array( $aData )) {
$currentCasesReassigned = 0;
foreach ($aData as $data) {
$oTmpReassignCriteria = $oCasesReassignList;
$oTmpReassignCriteria->add( AppCacheViewPeer::TAS_UID, $data->TAS_UID );
$rs = AppCacheViewPeer::doSelectRS( $oTmpReassignCriteria );
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs->next();
$row = $rs->getRow();
$aCase = $oCases->loadCaseInCurrentDelegation( $data->APP_UID );
$oCases->reassignCase( $aCase['APP_UID'], $aCase['DEL_INDEX'], ($aCase['USR_UID'] != '' ? $aCase['USR_UID'] : $_SESSION['USER_LOGGED']), $data->APP_REASSIGN_USER_UID );
$currentCasesReassigned ++;
$casesReassignedCount ++;
$serverResponse[] = array ('APP_REASSIGN_USER' => $data->APP_REASSIGN_USER,'APP_TITLE' => $data->APP_TITLE,'TAS_TITLE' => $data->APP_TAS_TITLE,'REASSIGNED_CASES' => $currentCasesReassigned
);
}
} else {
$oTmpReassignCriteria = $oCasesReassignList;
$oTmpReassignCriteria->add( AppCacheViewPeer::TAS_UID, $aData->TAS_UID );
$rs = AppCacheViewPeer::doSelectRS( $oTmpReassignCriteria );
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs->next();
$row = $rs->getRow();
$currentCasesReassigned = 0;
while (is_array( $row )) {
$APP_UID = $row['APP_UID'];
$aCase = $oCases->loadCaseInCurrentDelegation( $APP_UID );
$oCases->reassignCase( $aCase['APP_UID'], $aCase['DEL_INDEX'], ($aCase['USR_UID'] != '' ? $aCase['USR_UID'] : $_SESSION['USER_LOGGED']), $aData->APP_REASSIGN_USER_UID );
$currentCasesReassigned ++;
$casesReassignedCount ++;
if (is_array( $aData )) {
$currentCasesReassigned = 0;
foreach ($aData as $data) {
$oTmpReassignCriteria = $oCasesReassignList;
$oTmpReassignCriteria->add( AppCacheViewPeer::TAS_UID, $data->TAS_UID );
$rs = AppCacheViewPeer::doSelectRS( $oTmpReassignCriteria );
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs->next();
$row = $rs->getRow();
$aCase = $oCases->loadCaseInCurrentDelegation( $data->APP_UID );
$oCases->reassignCase( $aCase['APP_UID'], $aCase['DEL_INDEX'], ($aCase['USR_UID'] != '' ? $aCase['USR_UID'] : $_SESSION['USER_LOGGED']), $data->APP_REASSIGN_USER_UID );
$currentCasesReassigned ++;
$casesReassignedCount ++;
$serverResponse[] = array ('APP_REASSIGN_USER' => $data->APP_REASSIGN_USER,'APP_TITLE' => $data->APP_TITLE,'TAS_TITLE' => $data->APP_TAS_TITLE,'REASSIGNED_CASES' => $currentCasesReassigned
);
}
} else {
$oTmpReassignCriteria = $oCasesReassignList;
$oTmpReassignCriteria->add( AppCacheViewPeer::TAS_UID, $aData->TAS_UID );
$rs = AppCacheViewPeer::doSelectRS( $oTmpReassignCriteria );
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs->next();
$row = $rs->getRow();
$currentCasesReassigned = 0;
while (is_array( $row )) {
$APP_UID = $row['APP_UID'];
$aCase = $oCases->loadCaseInCurrentDelegation( $APP_UID );
$oCases->reassignCase( $aCase['APP_UID'], $aCase['DEL_INDEX'], ($aCase['USR_UID'] != '' ? $aCase['USR_UID'] : $_SESSION['USER_LOGGED']), $aData->APP_REASSIGN_USER_UID );
$currentCasesReassigned ++;
$casesReassignedCount ++;
// var_dump($aCase);
// echo ("<br>");
$rs->next();
$row = $rs->getRow();
}
$serverResponse[] = array ('TAS_TITLE' => $aData->APP_TAS_TITLE,'REASSIGNED_CASES' => $currentCasesReassigned);
}
$serverResponse['TOTAL'] = $casesReassignedCount;
echo G::json_encode( $serverResponse );
$rs->next();
$row = $rs->getRow();
}
$serverResponse[] = array ('TAS_TITLE' => $aData->APP_TAS_TITLE,'REASSIGNED_CASES' => $currentCasesReassigned);
}
$serverResponse['TOTAL'] = $casesReassignedCount;
echo G::json_encode( $serverResponse );

View File

@@ -1,76 +1,76 @@
<?php
/**
* summary.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
case - 2:
throw new Exception( G::LoadTranslation( 'ID_USER_HAVENT_RIGHTS_SYSTEM' ) );
break;
case - 1:
throw new Exception( G::LoadTranslation( 'ID_USER_HAVENT_RIGHTS_PAGE' ) );
break;
}
if (! isset( $_REQUEST['APP_UID'] ) || ! isset( $_REQUEST['DEL_INDEX'] ) || ! isset( $_REQUEST['DYN_UID'] )) {
throw new Exception( G::LoadTranslation( 'ID_REQUIRED_FIELDS_ERROR' ) . ' (APP_UID, DEL_INDEX, DYN_UID)' );
}
if ($_REQUEST['APP_UID'] == '' || $_REQUEST['DEL_INDEX'] == '' || $_REQUEST['DYN_UID'] == '') {
throw new Exception( G::LoadTranslation( 'ID_REQUIRED_FIELDS_ERROR' ) . ' (APP_UID, DEL_INDEX, DYN_UID)' );
}
G::LoadClass( 'case' );
$case = new Cases();
if ($RBAC->userCanAccess( 'PM_ALLCASES' ) < 0 && $case->userParticipatedInCase( $_REQUEST['APP_UID'], $_SESSION['USER_LOGGED'] ) == 0) {
throw new Exception( G::LoadTranslation( 'ID_NO_PERMISSION_NO_PARTICIPATED' ) );
}
$applicationFields = $case->loadCase( $_REQUEST['APP_UID'], $_REQUEST['DEL_INDEX'] );
if (file_exists( PATH_DYNAFORM . $applicationFields['PRO_UID'] . PATH_SEP . $_REQUEST['DYN_UID'] . '.xml' )) {
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP'] = '#';
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = '#';
G::LoadClass( 'dbConnections' );
$_SESSION['PROCESS'] = $applicationFields['PRO_UID'];
$dbConnections = new dbConnections( $_SESSION['PROCESS'] );
$dbConnections->loadAdditionalConnections();
$_SESSION['CURRENT_DYN_UID'] = $_REQUEST['DYN_UID'];
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $applicationFields['PRO_UID'] . '/' . $_REQUEST['DYN_UID'], '', $applicationFields['APP_DATA'], '', '', 'view' );
G::RenderPage( 'publish', 'blank' );
} else {
throw new Exception( G::LoadTranslation( 'INVALID_FILE' ) . ': ' . $_REQUEST['DYN_UID'] );
}
} catch (Exception $error) {
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => $error->getMessage()) );
G::RenderPage( 'publish', 'blank' );
die();
}
<?php
/**
* summary.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
try {
global $RBAC;
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
case - 2:
throw new Exception( G::LoadTranslation( 'ID_USER_HAVENT_RIGHTS_SYSTEM' ) );
break;
case - 1:
throw new Exception( G::LoadTranslation( 'ID_USER_HAVENT_RIGHTS_PAGE' ) );
break;
}
if (! isset( $_REQUEST['APP_UID'] ) || ! isset( $_REQUEST['DEL_INDEX'] ) || ! isset( $_REQUEST['DYN_UID'] )) {
throw new Exception( G::LoadTranslation( 'ID_REQUIRED_FIELDS_ERROR' ) . ' (APP_UID, DEL_INDEX, DYN_UID)' );
}
if ($_REQUEST['APP_UID'] == '' || $_REQUEST['DEL_INDEX'] == '' || $_REQUEST['DYN_UID'] == '') {
throw new Exception( G::LoadTranslation( 'ID_REQUIRED_FIELDS_ERROR' ) . ' (APP_UID, DEL_INDEX, DYN_UID)' );
}
G::LoadClass( 'case' );
$case = new Cases();
if ($RBAC->userCanAccess( 'PM_ALLCASES' ) < 0 && $case->userParticipatedInCase( $_REQUEST['APP_UID'], $_SESSION['USER_LOGGED'] ) == 0) {
throw new Exception( G::LoadTranslation( 'ID_NO_PERMISSION_NO_PARTICIPATED' ) );
}
$applicationFields = $case->loadCase( $_REQUEST['APP_UID'], $_REQUEST['DEL_INDEX'] );
if (file_exists( PATH_DYNAFORM . $applicationFields['PRO_UID'] . PATH_SEP . $_REQUEST['DYN_UID'] . '.xml' )) {
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP'] = '#';
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
$applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = '#';
G::LoadClass( 'dbConnections' );
$_SESSION['PROCESS'] = $applicationFields['PRO_UID'];
$dbConnections = new dbConnections( $_SESSION['PROCESS'] );
$dbConnections->loadAdditionalConnections();
$_SESSION['CURRENT_DYN_UID'] = $_REQUEST['DYN_UID'];
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $applicationFields['PRO_UID'] . '/' . $_REQUEST['DYN_UID'], '', $applicationFields['APP_DATA'], '', '', 'view' );
G::RenderPage( 'publish', 'blank' );
} else {
throw new Exception( G::LoadTranslation( 'INVALID_FILE' ) . ': ' . $_REQUEST['DYN_UID'] );
}
} catch (Exception $error) {
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', array ('MESSAGE' => $error->getMessage()) );
G::RenderPage( 'publish', 'blank' );
die();
}