Merge pull request #810 from norahmollo/master

CODE STYLE Formating workflow/engine/methods/cases
This commit is contained in:
ferOnti
2012-10-18 09:18:15 -07:00
73 changed files with 8610 additions and 8737 deletions

View File

@@ -167,3 +167,4 @@ catch ( Exception $e ){
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage ); $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage('publish'); G::RenderPage('publish');
} }

View File

@@ -12,138 +12,128 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
$actionAjax = isset($_REQUEST['actionAjax'])?$_REQUEST['actionAjax']: null; $actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
function casesShowOuputDocumentExist ($url)
function casesShowOuputDocumentExist($url){ {
$urlArray = explode( "?", $url );
$urlArray = explode("?",$url);
$urlParametroString = $urlArray[1]; $urlParametroString = $urlArray[1];
parse_str($urlParametroString, $_GET);
parse_str( $urlParametroString, $_GET );
require_once ("classes/model/AppDocumentPeer.php");
require_once ( "classes/model/AppDocumentPeer.php" );
$oAppDocument = new AppDocument(); $oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_GET['a'],(isset($_GET['v']) )? $_GET['v'] : NULL ); $oAppDocument->Fields = $oAppDocument->load( $_GET['a'], (isset( $_GET['v'] )) ? $_GET['v'] : NULL );
$sAppDocUid = $oAppDocument->getAppDocUid(); $sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() ); $info = pathinfo( $oAppDocument->getAppDocFilename() );
if (!isset($_GET['ext'])) { if (! isset( $_GET['ext'] )) {
$ext = $info['extension']; $ext = $info['extension'];
} } else {
else {
if ($_GET['ext'] != '') { if ($_GET['ext'] != '') {
$ext = $_GET['ext']; $ext = $_GET['ext'];
} } else {
else {
$ext = $info['extension']; $ext = $info['extension'];
} }
} }
$ver= (isset($_GET['v']) && $_GET['v']!='') ? '_'.$_GET['v'] : ''; $ver = (isset( $_GET['v'] ) && $_GET['v'] != '') ? '_' . $_GET['v'] : '';
if(!$ver) //This code is in the case the outputdocument won't be versioned if (! $ver) //This code is in the case the outputdocument won't be versioned
$ver='_1'; $ver = '_1';
$realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $sAppDocUid .$ver. '.' . $ext ; $realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $sAppDocUid . $ver . '.' . $ext;
$realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] .$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 ; $realPath2 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] . '.' . $ext;
$sw_file_exists=false; $sw_file_exists = false;
if(file_exists($realPath)){ if (file_exists( $realPath )) {
$sw_file_exists=true; $sw_file_exists = true;
}elseif(file_exists($realPath1)){ } elseif (file_exists( $realPath1 )) {
$sw_file_exists=true; $sw_file_exists = true;
$realPath=$realPath1; $realPath = $realPath1;
}elseif(file_exists($realPath2)){ } elseif (file_exists( $realPath2 )) {
$sw_file_exists=true; $sw_file_exists = true;
$realPath=$realPath2; $realPath = $realPath2;
} }
$swFileExist = 0; $swFileExist = 0;
if($sw_file_exists){ if ($sw_file_exists) {
$swFileExist = 1; $swFileExist = 1;
} }
return $swFileExist; 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(); if ($actionAjax == 'casesGenerateDocumentPage') {
$c = $oCase->getAllGeneratedDocumentsCriteria($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED']); global $G_PUBLISH;
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(); $oHeadPublisher = & headPublisher::getSingleton();
$totalCount++; G::loadClass( 'configuration' );
} $conf = new Configurations();
$oHeadPublisher->addExtJsScript( 'cases/casesGenerateDocumentPage', true ); //adding a javascript file .js
//!dateFormat $oHeadPublisher->addContent( 'cases/casesGenerateDocumentPage' ); //adding a html file .html.
G::LoadClass ( 'configuration' ); $oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
$conf = new Configurations(); G::RenderPage( 'publish', 'extJs' );
try { }
$generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '' ); if ($actionAjax == 'generateDocumentGrid_Ajax') {
} G::LoadClass( 'case' );
catch (Exception $e){ G::LoadClass( "BasePeer" );
$generalConfCasesList = array();
} global $G_PUBLISH;
$dateFormat = ""; $oCase = new Cases();
if (isset($generalConfCasesList['casesListDateFormat'])&&!empty($generalConfCasesList['casesListDateFormat'])) {
$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']; $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 );
}
$newDir = '/tmp/test/directory';
$r = G::verifyPath ( $newDir );
$r->data = $aProcesses;
$r->totalCount = $totalCount;
$r->dataFormat = $dateFormat;
echo G::json_encode($r);
}
?>

View File

@@ -12,78 +12,75 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
$actionAjax = isset($_REQUEST['actionAjax'])?$_REQUEST['actionAjax']: null; $actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
if ($actionAjax == "historyDynaformPage") {
global $G_PUBLISH;
$oHeadPublisher = & headPublisher::getSingleton();
G::loadClass( 'configuration' );
$conf = new Configurations();
$oHeadPublisher->addExtJsScript( 'cases/caseHistoryDynaformPage', true ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/caseHistoryDynaformPage' ); //adding a html file .html.
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
G::RenderPage( 'publish', 'extJs' );
}
if ($actionAjax == 'historyDynaformGrid_Ajax') {
G::LoadClass( 'case' );
G::LoadClass( "BasePeer" );
if($actionAjax=="historyDynaformPage"){ global $G_PUBLISH;
global $G_PUBLISH; $oCase = new Cases();
$oHeadPublisher =& headPublisher::getSingleton();
G::loadClass('configuration');
$conf = new Configurations;
$oHeadPublisher->addExtJsScript('cases/caseHistoryDynaformPage', true ); //adding a javascript file .js
$oHeadPublisher->addContent ('cases/caseHistoryDynaformPage'); //adding a html file .html.
$oHeadPublisher->assign('pageSize', $conf->getEnvSetting('casesListRowNumber'));
G::RenderPage('publish', 'extJs');
}
if($actionAjax=='historyDynaformGrid_Ajax'){
G::LoadClass('case');
G::LoadClass("BasePeer" );
global $G_PUBLISH; $aProcesses = Array ();
$oCase = new Cases(); $c = $oCase->getallDynaformsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED'] );
$aProcesses = Array(); if ($c->getDbName() == 'dbarray') {
$c = $oCase->getallDynaformsCriteria($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED']); $rs = ArrayBasePeer::doSelectRs( $c );
} else {
if ( $c->getDbName() == 'dbarray' ){ $rs = GulliverBasePeer::doSelectRs( $c );
$rs = ArrayBasePeer::doSelectRs ($c);
}
else{
$rs = GulliverBasePeer::doSelectRs ($c);
}
$rs->setFetchmode (ResultSet::FETCHMODE_ASSOC);
$rs->next();
for($j=0;$j< $rs->getRecordCount() ;$j++) {
$result = $rs->getRow();
//$result["ID_HISTORY"] = $result["PRO_UID"].'_'.$result["APP_UID"].'_'.$result["TAS_UID"];
$aProcesses[] = $result;
$rs->next();
}
$newDir = '/tmp/test/directory';
$r = G::verifyPath ( $newDir );
$r->data = $aProcesses;
$r->totalCount = 2;
echo G::json_encode($r);
} }
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs->next();
if($actionAjax=='showHistoryMessage'){ for ($j = 0; $j < $rs->getRecordCount(); $j ++) {
?> $result = $rs->getRow();
<link rel="stylesheet" type="text/css" href="/css/classic.css" /> //$result["ID_HISTORY"] = $result["PRO_UID"].'_'.$result["APP_UID"].'_'.$result["TAS_UID"];
<style type="text/css"> $aProcesses[] = $result;
html{ $rs->next();
color:black !important; }
}
body{ $newDir = '/tmp/test/directory';
color:black !important; $r = G::verifyPath( $newDir );
} $r->data = $aProcesses;
</style> $r->totalCount = 2;
<script language="Javascript">
echo G::json_encode( $r );
}
if ($actionAjax == 'showHistoryMessage') {
?>
<link rel="stylesheet" type="text/css" href="/css/classic.css" />
<style type="text/css">
html {
color: black !important;
}
body {
color: black !important;
}
</style>
<script language="Javascript">
//!Code that simulated reload library javascript maborak //!Code that simulated reload library javascript maborak
var leimnud = {}; var leimnud = {};
leimnud.exec = ""; leimnud.exec = "";
@@ -99,50 +96,50 @@
</script> </script>
<?php <?php
G::LoadClass('case'); G::LoadClass( 'case' );
$oCase = new Cases(); $oCase = new Cases();
$_POST["APP_UID"] = $_REQUEST["APP_UID"]; $_POST["APP_UID"] = $_REQUEST["APP_UID"];
$_POST['APP_MSG_UID'] = $_REQUEST["APP_MSG_UID"]; $_POST['APP_MSG_UID'] = $_REQUEST["APP_MSG_UID"];
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$oCase = new Cases(); $oCase = new Cases();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_MessagesView', '', $oCase->getHistoryMessagesTrackerView($_POST['APP_UID'], $_POST['APP_MSG_UID'])); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_MessagesView', '', $oCase->getHistoryMessagesTrackerView( $_POST['APP_UID'], $_POST['APP_MSG_UID'] ) );
?>
?> <script language="javascript">
<script language="javascript">
<?php <?php
global $G_FORM; global $G_FORM;
?> ?>
function loadForm_<?php echo $G_FORM->id;?>(parametro1){ function loadForm_<?php echo $G_FORM->id;?>(parametro1){
} }
</script> </script>
<?php <?php
G::RenderPage('publish', 'raw'); G::RenderPage( 'publish', 'raw' );
} }
if($actionAjax=='showDynaformListHistory'){ if ($actionAjax == 'showDynaformListHistory') {
//!dataIndex //!dataIndex
$_POST["APP_UID"] = $_REQUEST["APP_UID"]; $_POST["APP_UID"] = $_REQUEST["APP_UID"];
$_POST["DYN_UID"] = $_REQUEST["DYN_UID"]; $_POST["DYN_UID"] = $_REQUEST["DYN_UID"];
$_POST["PRO_UID"] = $_REQUEST["PRO_UID"]; $_POST["PRO_UID"] = $_REQUEST["PRO_UID"];
$_POST["TAS_UID"] = $_REQUEST["TAS_UID"]; $_POST["TAS_UID"] = $_REQUEST["TAS_UID"];
?> ?>
<link rel="stylesheet" type="text/css" href="/css/classic.css" /> <link rel="stylesheet" type="text/css" href="/css/classic.css" />
<style type="text/css"> <style type="text/css">
html{ html {
color:black !important; color: black !important;
} }
body{
color:black !important; body {
} color: black !important;
</style> }
<script language="Javascript"> </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]}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}function binl2hex(binarray){var hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef";var str="";for(var i=0;i<binarray.length*4;i++){str+=hex_tab.charAt((binarray[i>>2]>>((i%4)*8+4))&0xF)+hex_tab.charAt((binarray[i>>2]>>((i%4)*8))&0xF)}return str}return(raw?binl2str(core_md5(str2binl(s),s.length*chrsz)):binl2hex(core_md5(str2binl(s),s.length*chrsz)))}; 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}function binl2hex(binarray){var hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef";var str="";for(var i=0;i<binarray.length*4;i++){str+=hex_tab.charAt((binarray[i>>2]>>((i%4)*8+4))&0xF)+hex_tab.charAt((binarray[i>>2]>>((i%4)*8))&0xF)}return str}return(raw?binl2str(core_md5(str2binl(s),s.length*chrsz)):binl2hex(core_md5(str2binl(s),s.length*chrsz)))};
//!Code that simulated reload library javascript maborak //!Code that simulated reload library javascript maborak
@@ -209,26 +206,27 @@
</script> </script>
<?php <?php
require_once 'classes/model/AppHistory.php'; require_once 'classes/model/AppHistory.php';
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('view', 'cases/cases_DynaformHistory'); $G_PUBLISH->AddContent( 'view', 'cases/cases_DynaformHistory' );
G::RenderPage('publish', 'raw'); G::RenderPage( 'publish', 'raw' );
} }
if($actionAjax=='dynaformChangeLogViewHistory'){ if ($actionAjax == 'dynaformChangeLogViewHistory') {
?> ?>
<link rel="stylesheet" type="text/css" href="/css/classic.css" /> <link rel="stylesheet" type="text/css" href="/css/classic.css" />
<style type="text/css"> <style type="text/css">
html{ html {
color:black !important; color: black !important;
} }
body{
color:black !important; body {
} color: black !important;
</style> }
<script language="Javascript"> </style>
<script language="Javascript">
@@ -247,47 +245,46 @@
</script> </script>
<?php <?php
$_POST['DYN_UID']= $_REQUEST['DYN_UID']; $_POST['DYN_UID'] = $_REQUEST['DYN_UID'];
$_POST['HISTORY_ID']= $_REQUEST['HISTORY_ID']; $_POST['HISTORY_ID'] = $_REQUEST['HISTORY_ID'];
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$FieldsHistory = unserialize( $_SESSION['HISTORY_DATA'] );
$Fields['APP_DATA'] = $FieldsHistory[$_POST['HISTORY_ID']];
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;';
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view' );
global $G_PUBLISH; ?>
$G_PUBLISH = new Publisher(); <script language="javascript">
$FieldsHistory=unserialize($_SESSION['HISTORY_DATA']);
$Fields['APP_DATA'] = $FieldsHistory[$_POST['HISTORY_ID']];
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;';
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view');
?>
<script language="javascript">
<?php <?php
global $G_FORM; global $G_FORM;
?> ?>
function loadForm_<?php echo $G_FORM->id;?>(parametro1){ function loadForm_<?php echo $G_FORM->id;?>(parametro1){
} }
</script> </script>
<?php <?php
G::RenderPage('publish', 'raw'); G::RenderPage( 'publish', 'raw' );
} }
if($actionAjax== 'historyDynaformGridPreview'){ if ($actionAjax == 'historyDynaformGridPreview') {
?> ?>
<link rel="stylesheet" type="text/css" href="/css/classic.css" /> <link rel="stylesheet" type="text/css" href="/css/classic.css" />
<style type="text/css"> <style type="text/css">
html{ html {
color:black !important; color: black !important;
} }
body{
color:black !important; body {
} color: black !important;
</style> }
<script language="Javascript"> </style>
<script language="Javascript">
@@ -306,36 +303,36 @@
</script> </script>
<?php <?php
//!dataIndex //!dataIndex
$_POST["DYN_UID"] = $_REQUEST["DYN_UID"]; $_POST["DYN_UID"] = $_REQUEST["DYN_UID"];
G::LoadClass('case'); G::LoadClass( 'case' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$oCase = new Cases(); $oCase = new Cases();
$Fields = $oCase->loadCase($_SESSION['APPLICATION']); $Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = ''; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = ''; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#'; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;'; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['DYNUIDPRINT'] = $_POST['DYN_UID']; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['DYNUIDPRINT'] = $_POST['DYN_UID'];
$_SESSION['DYN_UID_PRINT'] = $_POST['DYN_UID']; $_SESSION['DYN_UID_PRINT'] = $_POST['DYN_UID'];
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view'); $G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view' );
?> ?>
<script language="javascript"> <script language="javascript">
function popUp(URL, width, height, left, top, resizable) { function popUp(URL, width, height, left, top, resizable) {
window.open(URL, '', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable='+resizable+',width='+width+',height='+height+',left = '+left+',top = '+top+''); window.open(URL, '', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable='+resizable+',width='+width+',height='+height+',left = '+left+',top = '+top+'');
} }
<?php <?php
global $G_FORM; global $G_FORM;
?> ?>
function loadForm_<?php echo $G_FORM->id;?>(parametro1) { function loadForm_<?php echo $G_FORM->id;?>(parametro1) {
} }
</script> </script>
<?php <?php
G::RenderPage('publish', 'raw'); G::RenderPage( 'publish', 'raw' );
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,31 +1,31 @@
<script> <script>
if (typeof window.parent != 'undefined') { if (typeof window.parent != 'undefined') {
<?php <?php
if (isset($_GET['ux'])) { if (isset( $_GET['ux'] )) {
switch ($_GET['ux']) { switch ($_GET['ux']) {
case 'SIMPLIFIED': case 'SIMPLIFIED':
case 'SWITCHABLE': case 'SWITCHABLE':
case 'SINGLE': case 'SINGLE':
$url = '../home'; $url = '../home';
break; break;
default: default:
$url = 'casesListExtJs'; $url = 'casesListExtJs';
} }
} } else {
else { $url = 'casesListExtJs';
$url = 'casesListExtJs'; }
}
if (isset( $_GET['ux'] )) {
if (isset($_GET['ux'])) { echo 'if (typeof window.parent.ux_env != \'undefined\') {';
echo 'if (typeof window.parent.ux_env != \'undefined\') {'; }
}
echo " window.parent.location.href = '$url';";
echo " window.parent.location.href = '$url';";
if (isset( $_GET['ux'] )) {
if (isset($_GET['ux'])) { echo '} else { window.parent.location.href = \'casesListExtJs\'; }';
echo '} else { window.parent.location.href = \'casesListExtJs\'; }'; }
}
?> ?>
} }
</script> </script>

View File

@@ -12,253 +12,256 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
require_once 'classes/model/Application.php'; require_once 'classes/model/Application.php';
require_once 'classes/model/Users.php'; require_once 'classes/model/Users.php';
require_once 'classes/model/AppThread.php'; require_once 'classes/model/AppThread.php';
require_once 'classes/model/AppDelay.php'; require_once 'classes/model/AppDelay.php';
require_once 'classes/model/Process.php'; require_once 'classes/model/Process.php';
require_once 'classes/model/Task.php'; require_once 'classes/model/Task.php';
require_once ( "classes/model/AppCacheView.php" );
require_once ( "classes/model/AppDelegation.php" );
require_once ( "classes/model/AdditionalTables.php" );
require_once ( "classes/model/AppDelay.php" );
G::LoadClass('case');
$actionAjax = isset($_REQUEST['actionAjax'])?$_REQUEST['actionAjax']: null; require_once ("classes/model/AppCacheView.php");
require_once ("classes/model/AppDelegation.php");
if ($actionAjax == "processListExtJs") { require_once ("classes/model/AdditionalTables.php");
$action = isset($_REQUEST['action']) ? $_REQUEST['action']: null; require_once ("classes/model/AppDelay.php");
$categoryUid = isset($_REQUEST['CATEGORY_UID']) ? $_REQUEST['CATEGORY_UID'] : null; G::LoadClass( 'case' );
$userUid = ( isset($_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '' ) ? $_SESSION['USER_LOGGED'] : null;
global $oAppCache; $actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
$oAppCache = new AppCacheView();
$processes = Array();
$processes[] = array ( '', G::LoadTranslation('ID_ALL_PROCESS') );
//get the list based in the action provided if ($actionAjax == "processListExtJs") {
switch ( $action ) { $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : null;
case 'draft': $categoryUid = isset( $_REQUEST['CATEGORY_UID'] ) ? $_REQUEST['CATEGORY_UID'] : null;
$cProcess = $oAppCache->getDraftListCriteria($userUid); //fast enough $userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
break;
case 'sent':
$cProcess = $oAppCache->getSentListProcessCriteria ($userUid); // fast enough
break;
case 'simple_search':
case 'search':
//in search action, the query to obtain all process is too slow, so we need to query directly to
//process and content tables, and for that reason we need the current language in AppCacheView.
G::loadClass('configuration');
$oConf = new Configurations;
$oConf->loadConfig($x, 'APP_CACHE_VIEW_ENGINE','','','','');
$appCacheViewEngine = $oConf->aConfig;
$lang = isset($appCacheViewEngine['LANG']) ? $appCacheViewEngine['LANG'] : 'en';
$cProcess = new Criteria('workflow'); global $oAppCache;
$cProcess->clearSelectColumns ( ); $oAppCache = new AppCacheView();
$cProcess->addSelectColumn ( ProcessPeer::PRO_UID ); $processes = Array ();
$cProcess->addSelectColumn ( ContentPeer::CON_VALUE ); $processes[] = array ('',G::LoadTranslation( 'ID_ALL_PROCESS' )
if ($categoryUid) { );
$cProcess->add (ProcessPeer::PRO_CATEGORY, $categoryUid);
}
$del = DBAdapter::getStringDelimiter();
$conds = array();
$conds[] = array(ProcessPeer::PRO_UID, ContentPeer::CON_ID );
$conds[] = array(ContentPeer::CON_CATEGORY, $del . 'PRO_TITLE' . $del);
$conds[] = array(ContentPeer::CON_LANG, $del . $lang . $del);
$cProcess->addJoinMC($conds, Criteria::LEFT_JOIN);
$cProcess->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
$oDataset = ProcessPeer::doSelectRS($cProcess);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) { //get the list based in the action provided
$processes[] = array ( $aRow['PRO_UID'], $aRow['CON_VALUE'] ); switch ($action) {
$oDataset->next(); case 'draft':
} $cProcess = $oAppCache->getDraftListCriteria( $userUid ); //fast enough
return print G::json_encode($processes); break;
break; case 'sent':
case 'unassigned': $cProcess = $oAppCache->getSentListProcessCriteria( $userUid ); // fast enough
$cProcess = $oAppCache->getUnassignedListCriteria($userUid); break;
break; case 'simple_search':
case 'paused': case 'search':
$cProcess = $oAppCache->getPausedListCriteria($userUid); //in search action, the query to obtain all process is too slow, so we need to query directly to
break; //process and content tables, and for that reason we need the current language in AppCacheView.
case 'to_revise': G::loadClass( 'configuration' );
$cProcess = $oAppCache->getToReviseListCriteria($userUid); $oConf = new Configurations();
break; $oConf->loadConfig( $x, 'APP_CACHE_VIEW_ENGINE', '', '', '', '' );
case 'to_reassign': $appCacheViewEngine = $oConf->aConfig;
$cProcess = $oAppCache->getToReassignListCriteria(); $lang = isset( $appCacheViewEngine['LANG'] ) ? $appCacheViewEngine['LANG'] : 'en';
$cProcess->addAscendingOrderByColumn(AppCacheViewPeer::APP_PRO_TITLE);
break;
case 'gral':
$cProcess = $oAppCache->getGeneralListCriteria();
$cProcess->addAscendingOrderByColumn(AppCacheViewPeer::APP_PRO_TITLE);
break;
case 'todo':
default:
$cProcess = $oAppCache->getToDoListCriteria($userUid); //fast enough
break;
}
//get the processes for this user in this action
$cProcess->clearSelectColumns();
$cProcess->addSelectColumn(AppCacheViewPeer::PRO_UID);
$cProcess->addSelectColumn(AppCacheViewPeer::APP_PRO_TITLE);
$cProcess->setDistinct(AppCacheViewPeer::PRO_UID);
if ($categoryUid) {
$cProcess->addAlias('CP', 'PROCESS');
$cProcess->add('CP.PRO_CATEGORY', $categoryUid, Criteria::EQUAL );
$cProcess->addJoin(AppCacheViewPeer::PRO_UID, 'CP.PRO_UID', Criteria::LEFT_JOIN);
$cProcess->addAsColumn('CATEGORY_UID', 'CP.PRO_CATEGORY');
}
$oDataset = AppCacheViewPeer::doSelectRS($cProcess);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) { $cProcess = new Criteria( 'workflow' );
$processes[] = array ( $aRow['PRO_UID'], $aRow['APP_PRO_TITLE'] ); $cProcess->clearSelectColumns();
$cProcess->addSelectColumn( ProcessPeer::PRO_UID );
$cProcess->addSelectColumn( ContentPeer::CON_VALUE );
if ($categoryUid) {
$cProcess->add( ProcessPeer::PRO_CATEGORY, $categoryUid );
}
$del = DBAdapter::getStringDelimiter();
$conds = array ();
$conds[] = array (ProcessPeer::PRO_UID,ContentPeer::CON_ID
);
$conds[] = array (ContentPeer::CON_CATEGORY,$del . 'PRO_TITLE' . $del
);
$conds[] = array (ContentPeer::CON_LANG,$del . $lang . $del
);
$cProcess->addJoinMC( $conds, Criteria::LEFT_JOIN );
$cProcess->add( ProcessPeer::PRO_STATUS, 'ACTIVE' );
$oDataset = ProcessPeer::doSelectRS( $cProcess );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next(); $oDataset->next();
}
return print G::json_encode($processes); while ($aRow = $oDataset->getRow()) {
$processes[] = array ($aRow['PRO_UID'],$aRow['CON_VALUE']
);
$oDataset->next();
}
return print G::json_encode( $processes );
break;
case 'unassigned':
$cProcess = $oAppCache->getUnassignedListCriteria( $userUid );
break;
case 'paused':
$cProcess = $oAppCache->getPausedListCriteria( $userUid );
break;
case 'to_revise':
$cProcess = $oAppCache->getToReviseListCriteria( $userUid );
break;
case 'to_reassign':
$cProcess = $oAppCache->getToReassignListCriteria();
$cProcess->addAscendingOrderByColumn( AppCacheViewPeer::APP_PRO_TITLE );
break;
case 'gral':
$cProcess = $oAppCache->getGeneralListCriteria();
$cProcess->addAscendingOrderByColumn( AppCacheViewPeer::APP_PRO_TITLE );
break;
case 'todo':
default:
$cProcess = $oAppCache->getToDoListCriteria( $userUid ); //fast enough
break;
} }
//get the processes for this user in this action
if ($actionAjax=="getUsersToReassign") { $cProcess->clearSelectColumns();
$_SESSION['TASK'] = $_REQUEST['TAS_UID']; $cProcess->addSelectColumn( AppCacheViewPeer::PRO_UID );
$case = new Cases(); $cProcess->addSelectColumn( AppCacheViewPeer::APP_PRO_TITLE );
$result->data = $case->getUsersToReassign($_SESSION['TASK'], $_SESSION['USER_LOGGED']); $cProcess->setDistinct( AppCacheViewPeer::PRO_UID );
print G::json_encode($result); if ($categoryUid) {
$cProcess->addAlias( 'CP', 'PROCESS' );
$cProcess->add( 'CP.PRO_CATEGORY', $categoryUid, Criteria::EQUAL );
$cProcess->addJoin( AppCacheViewPeer::PRO_UID, 'CP.PRO_UID', Criteria::LEFT_JOIN );
$cProcess->addAsColumn( 'CATEGORY_UID', 'CP.PRO_CATEGORY' );
} }
if ($actionAjax=='reassignCase') { $oDataset = AppCacheViewPeer::doSelectRS( $cProcess );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$APP_UID = $_REQUEST["APP_UID"]; $oDataset->next();
$DEL_INDEX = $_REQUEST["DEL_INDEX"];
$_SESSION['APPLICATION'] = $APP_UID; while ($aRow = $oDataset->getRow()) {
$_SESSION['INDEX'] = $DEL_INDEX; $processes[] = array ($aRow['PRO_UID'],$aRow['APP_PRO_TITLE']
);
$oDataset->next();
}
return print G::json_encode( $processes );
}
if ($actionAjax == "getUsersToReassign") {
$_SESSION['TASK'] = $_REQUEST['TAS_UID'];
$case = new Cases();
$result->data = $case->getUsersToReassign( $_SESSION['TASK'], $_SESSION['USER_LOGGED'] );
print G::json_encode( $result );
}
if ($actionAjax == 'reassignCase') {
$cases = new Cases(); $APP_UID = $_REQUEST["APP_UID"];
$user = new Users(); $DEL_INDEX = $_REQUEST["DEL_INDEX"];
$app = new Application();
$TO_USR_UID = $_POST['USR_UID'];
try{ $_SESSION['APPLICATION'] = $APP_UID;
$cases->reassignCase($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], $TO_USR_UID); $_SESSION['INDEX'] = $DEL_INDEX;
$caseData = $app->load($_SESSION['APPLICATION']);
$userData = $user->load($TO_USR_UID); $cases = new Cases();
$user = new Users();
$app = new Application();
$TO_USR_UID = $_POST['USR_UID'];
try {
$cases->reassignCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], $TO_USR_UID );
$caseData = $app->load( $_SESSION['APPLICATION'] );
$userData = $user->load( $TO_USR_UID );
//print_r($caseData); //print_r($caseData);
$data['APP_NUMBER'] = $caseData['APP_NUMBER']; $data['APP_NUMBER'] = $caseData['APP_NUMBER'];
$data['USER'] = $userData['USR_LASTNAME'].' '. $userData['USR_FIRSTNAME']; //TODO change with the farmated username from environment conf $data['USER'] = $userData['USR_LASTNAME'] . ' ' . $userData['USR_FIRSTNAME']; //TODO change with the farmated username from environment conf
$result->status = 0; $result->status = 0;
$result->msg = G::LoadTranslation('ID_REASSIGNMENT_SUCCESS', SYS_LANG, $data); $result->msg = G::LoadTranslation( 'ID_REASSIGNMENT_SUCCESS', SYS_LANG, $data );
} catch(Exception $e){ } catch (Exception $e) {
$result->status = 1; $result->status = 1;
$result->msg = $e->getMessage(); $result->msg = $e->getMessage();
}
print G::json_encode($result);
} }
print G::json_encode( $result );
if($actionAjax=='showHistoryMessage'){
?> }
<link rel="stylesheet" type="text/css" href="/css/classic.css" />
<style type="text/css"> if ($actionAjax == 'showHistoryMessage') {
html{ ?>
color:black !important; <link rel="stylesheet" type="text/css" href="/css/classic.css" />
} <style type="text/css">
body{ html {
color:black !important; color: black !important;
} }
</style>
<script language="Javascript"> body {
color: black !important;
}
</style>
<script language="Javascript">
//!Code that simulated reload library javascript maborak //!Code that simulated reload library javascript maborak
var leimnud = {}; var leimnud = {};
leimnud.exec = ""; leimnud.exec = "";
leimnud.fix = {}; leimnud.fix = {};
leimnud.fix.memoryLeak = ""; leimnud.fix.memoryLeak = "";
leimnud.browser = {}; leimnud.browser = {};
leimnud.browser.isIphone = ""; leimnud.browser.isIphone = "";
leimnud.iphone = {}; leimnud.iphone = {};
leimnud.iphone.make = function(){}; leimnud.iphone.make = function(){};
function ajax_function(ajax_server, funcion, parameters, method){ function ajax_function(ajax_server, funcion, parameters, method){
} }
//! //!
</script> </script>
<?php <?php
G::LoadClass('case');
$oCase = new Cases();
$_POST["APP_UID"] = $_REQUEST["APP_UID"]; G::LoadClass( 'case' );
$_POST['APP_MSG_UID'] = $_REQUEST["APP_MSG_UID"]; $oCase = new Cases();
$G_PUBLISH = new Publisher(); $_POST["APP_UID"] = $_REQUEST["APP_UID"];
$oCase = new Cases(); $_POST['APP_MSG_UID'] = $_REQUEST["APP_MSG_UID"];
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_MessagesView', '', $oCase->getHistoryMessagesTrackerView($_POST['APP_UID'], $_POST['APP_MSG_UID'])); $G_PUBLISH = new Publisher();
$oCase = new Cases();
?> $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_MessagesView', '', $oCase->getHistoryMessagesTrackerView( $_POST['APP_UID'], $_POST['APP_MSG_UID'] ) );
<script language="javascript">
?>
<script language="javascript">
<?php <?php
global $G_FORM; global $G_FORM;
?> ?>
function loadForm_<?php echo $G_FORM->id;?>(parametro1){ function loadForm_<?php echo $G_FORM->id;?>(parametro1){
} }
</script> </script>
<?php <?php
G::RenderPage('publish', 'raw'); G::RenderPage( 'publish', 'raw' );
} }
if($actionAjax=='showDynaformListHistory'){ if ($actionAjax == 'showDynaformListHistory') {
//!dataIndex //!dataIndex
$_POST["APP_UID"] = $_REQUEST["APP_UID"]; $_POST["APP_UID"] = $_REQUEST["APP_UID"];
$_POST["DYN_UID"] = $_REQUEST["DYN_UID"]; $_POST["DYN_UID"] = $_REQUEST["DYN_UID"];
$_POST["PRO_UID"] = $_REQUEST["PRO_UID"]; $_POST["PRO_UID"] = $_REQUEST["PRO_UID"];
$_POST["TAS_UID"] = $_REQUEST["TAS_UID"]; $_POST["TAS_UID"] = $_REQUEST["TAS_UID"];
?> ?>
<link rel="stylesheet" type="text/css" href="/css/classic.css" /> <link rel="stylesheet" type="text/css" href="/css/classic.css" />
<style type="text/css"> <style type="text/css">
html{ html {
color:black !important; color: black !important;
} }
body{
color:black !important; body {
} color: black !important;
</style> }
<script language="Javascript"> </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]}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}function binl2hex(binarray){var hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef";var str="";for(var i=0;i<binarray.length*4;i++){str+=hex_tab.charAt((binarray[i>>2]>>((i%4)*8+4))&0xF)+hex_tab.charAt((binarray[i>>2]>>((i%4)*8))&0xF)}return str}return(raw?binl2str(core_md5(str2binl(s),s.length*chrsz)):binl2hex(core_md5(str2binl(s),s.length*chrsz)))}; 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}function binl2hex(binarray){var hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef";var str="";for(var i=0;i<binarray.length*4;i++){str+=hex_tab.charAt((binarray[i>>2]>>((i%4)*8+4))&0xF)+hex_tab.charAt((binarray[i>>2]>>((i%4)*8))&0xF)}return str}return(raw?binl2str(core_md5(str2binl(s),s.length*chrsz)):binl2hex(core_md5(str2binl(s),s.length*chrsz)))};
//!Code that simulated reload library javascript maborak //!Code that simulated reload library javascript maborak
var leimnud = {}; var leimnud = {};
leimnud.exec = ""; leimnud.exec = "";
leimnud.fix = {}; leimnud.fix = {};
leimnud.fix.memoryLeak = ""; leimnud.fix.memoryLeak = "";
leimnud.browser = {}; leimnud.browser = {};
leimnud.browser.isIphone = ""; leimnud.browser.isIphone = "";
leimnud.iphone = {}; leimnud.iphone = {};
leimnud.iphone.make = function(){}; leimnud.iphone.make = function(){};
function ajax_function(ajax_server, funcion, parameters, method){ function ajax_function(ajax_server, funcion, parameters, method){
} }
function toggleTable(tablename){ function toggleTable(tablename){
//table= document.getElementByName(tablename); //table= document.getElementByName(tablename);
table= document.getElementById(tablename); table= document.getElementById(tablename);
@@ -268,172 +271,170 @@
table.style.display = ''; table.style.display = '';
} }
} }
function noesFuncion(idIframe) { function noesFuncion(idIframe) {
window.parent.tabIframeWidthFix2(idIframe); window.parent.tabIframeWidthFix2(idIframe);
} }
function onResizeIframe(idIframe){ function onResizeIframe(idIframe){
window.onresize = noesFuncion(idIframe); window.onresize = noesFuncion(idIframe);
} }
var showDynaformHistoryGlobal = {}; var showDynaformHistoryGlobal = {};
showDynaformHistoryGlobal.dynUID = ''; showDynaformHistoryGlobal.dynUID = '';
showDynaformHistoryGlobal.tablename = ''; showDynaformHistoryGlobal.tablename = '';
showDynaformHistoryGlobal.dynDate = ''; showDynaformHistoryGlobal.dynDate = '';
showDynaformHistoryGlobal.dynTitle = ''; showDynaformHistoryGlobal.dynTitle = '';
function showDynaformHistory(dynUID,tablename,dynDate,dynTitle){ function showDynaformHistory(dynUID,tablename,dynDate,dynTitle){
showDynaformHistoryGlobal.dynUID = dynUID; showDynaformHistoryGlobal.dynUID = dynUID;
showDynaformHistoryGlobal.tablename = tablename; showDynaformHistoryGlobal.tablename = tablename;
showDynaformHistoryGlobal.dynDate = dynDate; showDynaformHistoryGlobal.dynDate = dynDate;
showDynaformHistoryGlobal.dynTitle = dynTitle; showDynaformHistoryGlobal.dynTitle = dynTitle;
var dynUID = showDynaformHistoryGlobal.dynUID; var dynUID = showDynaformHistoryGlobal.dynUID;
var tablename = showDynaformHistoryGlobal.tablename; var tablename = showDynaformHistoryGlobal.tablename;
var dynDate = showDynaformHistoryGlobal.dynDate; var dynDate = showDynaformHistoryGlobal.dynDate;
var dynTitle = showDynaformHistoryGlobal.dynTitle; var dynTitle = showDynaformHistoryGlobal.dynTitle;
var idUnique = globalMd5Return(dynUID+tablename+dynDate+dynTitle); var idUnique = globalMd5Return(dynUID+tablename+dynDate+dynTitle);
var tabData = window.parent.Ext.util.JSON.encode(showDynaformHistoryGlobal); var tabData = window.parent.Ext.util.JSON.encode(showDynaformHistoryGlobal);
var tabName = 'dynaformChangeLogViewHistory'+idUnique; var tabName = 'dynaformChangeLogViewHistory'+idUnique;
var tabTitle = 'View('+dynTitle+' '+dynDate+')'; var tabTitle = 'View('+dynTitle+' '+dynDate+')';
window.parent.ActionTabFrameGlobal.tabData = tabData; window.parent.ActionTabFrameGlobal.tabData = tabData;
window.parent.ActionTabFrameGlobal.tabName = tabName; window.parent.ActionTabFrameGlobal.tabName = tabName;
window.parent.ActionTabFrameGlobal.tabTitle = tabTitle; window.parent.ActionTabFrameGlobal.tabTitle = tabTitle;
window.parent.Actions.tabFrame(tabName); window.parent.Actions.tabFrame(tabName);
} }
</script> </script>
<?php <?php
require_once 'classes/model/AppHistory.php'; require_once 'classes/model/AppHistory.php';
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('view', 'cases/cases_DynaformHistory'); $G_PUBLISH->AddContent( 'view', 'cases/cases_DynaformHistory' );
G::RenderPage('publish', 'raw'); G::RenderPage( 'publish', 'raw' );
} }
if($actionAjax=='dynaformChangeLogViewHistory'){ if ($actionAjax == 'dynaformChangeLogViewHistory') {
?> ?>
<link rel="stylesheet" type="text/css" href="/css/classic.css" /> <link rel="stylesheet" type="text/css" href="/css/classic.css" />
<style type="text/css"> <style type="text/css">
html{ html {
color:black !important; color: black !important;
} }
body{
color:black !important; body {
} color: black !important;
</style> }
<script language="Javascript"> </style>
<script language="Javascript">
//!Code that simulated reload library javascript maborak //!Code that simulated reload library javascript maborak
var leimnud = {}; var leimnud = {};
leimnud.exec = ""; leimnud.exec = "";
leimnud.fix = {}; leimnud.fix = {};
leimnud.fix.memoryLeak = ""; leimnud.fix.memoryLeak = "";
leimnud.browser = {}; leimnud.browser = {};
leimnud.browser.isIphone = ""; leimnud.browser.isIphone = "";
leimnud.iphone = {}; leimnud.iphone = {};
leimnud.iphone.make = function(){}; leimnud.iphone.make = function(){};
function ajax_function(ajax_server, funcion, parameters, method){ function ajax_function(ajax_server, funcion, parameters, method){
} }
//! //!
</script> </script>
<?php <?php
$_POST['DYN_UID']= $_REQUEST['DYN_UID']; $_POST['DYN_UID'] = $_REQUEST['DYN_UID'];
$_POST['HISTORY_ID']= $_REQUEST['HISTORY_ID']; $_POST['HISTORY_ID'] = $_REQUEST['HISTORY_ID'];
global $G_PUBLISH;
global $G_PUBLISH; $G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher(); $FieldsHistory = unserialize( $_SESSION['HISTORY_DATA'] );
$FieldsHistory=unserialize($_SESSION['HISTORY_DATA']); $Fields['APP_DATA'] = $FieldsHistory[$_POST['HISTORY_ID']];
$Fields['APP_DATA'] = $FieldsHistory[$_POST['HISTORY_ID']]; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = ''; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = ''; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#'; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;'; $G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view' );
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view');
?>
<script language="javascript">
?>
<script language="javascript">
<?php <?php
global $G_FORM; global $G_FORM;
?> ?>
function loadForm_<?php echo $G_FORM->id;?>(parametro1){ function loadForm_<?php echo $G_FORM->id;?>(parametro1){
} }
</script> </script>
<?php <?php
G::RenderPage('publish', 'raw'); G::RenderPage( 'publish', 'raw' );
} }
if($actionAjax== 'historyDynaformGridPreview'){ if ($actionAjax == 'historyDynaformGridPreview') {
?> ?>
<link rel="stylesheet" type="text/css" href="/css/classic.css" /> <link rel="stylesheet" type="text/css" href="/css/classic.css" />
<style type="text/css"> <style type="text/css">
html{ html {
color:black !important; color: black !important;
} }
body{
color:black !important; body {
} color: black !important;
</style> }
<script language="Javascript"> </style>
<script language="Javascript">
//!Code that simulated reload library javascript maborak
//!Code that simulated reload library javascript maborak var leimnud = {};
var leimnud = {};
leimnud.exec = ""; leimnud.exec = "";
leimnud.fix = {}; leimnud.fix = {};
leimnud.fix.memoryLeak = ""; leimnud.fix.memoryLeak = "";
leimnud.browser = {}; leimnud.browser = {};
leimnud.browser.isIphone = ""; leimnud.browser.isIphone = "";
leimnud.iphone = {}; leimnud.iphone = {};
leimnud.iphone.make = function(){}; leimnud.iphone.make = function(){};
function ajax_function(ajax_server, funcion, parameters, method){ function ajax_function(ajax_server, funcion, parameters, method){
} }
//! //!
</script> </script>
<?php <?php
//!dataIndex //!dataIndex
$_POST["DYN_UID"] = $_REQUEST["DYN_UID"]; $_POST["DYN_UID"] = $_REQUEST["DYN_UID"];
G::LoadClass('case'); G::LoadClass( 'case' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$oCase = new Cases(); $oCase = new Cases();
$Fields = $oCase->loadCase($_SESSION['APPLICATION']); $Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = ''; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = ''; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#'; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;'; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;';
$_SESSION['DYN_UID_PRINT'] = $_POST['DYN_UID']; $_SESSION['DYN_UID_PRINT'] = $_POST['DYN_UID'];
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view'); $G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view' );
?> ?>
<script language="javascript"> <script language="javascript">
<?php <?php
global $G_FORM; global $G_FORM;
?> ?>
function loadForm_<?php echo $G_FORM->id;?>(parametro1){ function loadForm_<?php echo $G_FORM->id;?>(parametro1){
} }
</script> </script>
<?php <?php
G::RenderPage('publish', 'raw'); G::RenderPage( 'publish', 'raw' );
}
}

View File

@@ -1,162 +1,147 @@
<?php <?php
$action = isset($_GET['action']) ? $_GET['action']: 'default'; $action = isset( $_GET['action'] ) ? $_GET['action'] : 'default';
G::LoadClass('case'); G::LoadClass( 'case' );
G::LoadClass('configuration'); G::LoadClass( 'configuration' );
$userId = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '00000000000000000000000000000000'; $userId = isset( $_SESSION['USER_LOGGED'] ) ? $_SESSION['USER_LOGGED'] : '00000000000000000000000000000000';
switch($action) { switch ($action) {
case 'getAllCounters': case 'getAllCounters':
getAllCounters(); getAllCounters();
break; break;
case 'getProcess' : case 'getProcess':
getProcess(); getProcess();
break; break;
default: //this is the starting call default: //this is the starting call
getLoadTreeMenuData(); getLoadTreeMenuData();
break; break;
} }
function getLoadTreeMenuData ()
function getLoadTreeMenuData () { {
header ("content-type: text/xml"); header( "content-type: text/xml" );
global $G_TMP_MENU; global $G_TMP_MENU;
$oMenu = new Menu(); $oMenu = new Menu();
$oMenu->load('cases'); $oMenu->load( 'cases' );
$oCases = new Cases(); $oCases = new Cases();
$aTypes = Array( $aTypes = Array ('to_do','draft','cancelled','sent','paused','completed','selfservice'
'to_do', //'to_revise',
'draft', //'to_reassign'
'cancelled', ;
'sent', $aTypesID = Array ('CASES_INBOX' => 'to_do','CASES_DRAFT' => 'draft','CASES_CANCELLED' => 'cancelled','CASES_SENT' => 'sent','CASES_PAUSED' => 'paused','CASES_COMPLETED' => 'completed','CASES_SELFSERVICE' => 'selfservice'
'paused', //'CASES_TO_REVISE'=>'to_revise',
'completed', //'CASES_TO_REASSIGN'=>'to_reassign'
'selfservice', ;
//'to_revise',
//'to_reassign' $list = array ();
); $list['count'] = ' ';
$aTypesID = Array(
'CASES_INBOX'=>'to_do', $empty = array ();
'CASES_DRAFT'=>'draft', foreach ($aTypes as $key => $val) {
'CASES_CANCELLED'=>'cancelled', $empty[$val] = $list;
'CASES_SENT'=>'sent', }
'CASES_PAUSED'=>'paused',
'CASES_COMPLETED'=>'completed',
'CASES_SELFSERVICE'=>'selfservice',
//'CASES_TO_REVISE'=>'to_revise',
//'CASES_TO_REASSIGN'=>'to_reassign'
);
$list = array();
$list['count'] = ' ';
$empty = array();
foreach ( $aTypes as $key => $val ) {
$empty[$val] = $list;
}
$aCount = $empty; //$oCases->getAllConditionCasesCount($aTypes, true); $aCount = $empty; //$oCases->getAllConditionCasesCount($aTypes, true);
$processNameMaxSize = 20; $processNameMaxSize = 20;
//now drawing the treeview using the menu options from menu/cases.php //now drawing the treeview using the menu options from menu/cases.php
$menuCases = array(); $menuCases = array ();
foreach( $oMenu->Options as $i => $option ) { foreach ($oMenu->Options as $i => $option) {
if( $oMenu->Types[$i] == 'blockHeader' ) { if ($oMenu->Types[$i] == 'blockHeader') {
$CurrentBlockID = $oMenu->Id[$i]; $CurrentBlockID = $oMenu->Id[$i];
$menuCases[$CurrentBlockID]['blockTitle'] = $oMenu->Labels[$i]; $menuCases[$CurrentBlockID]['blockTitle'] = $oMenu->Labels[$i];
if($oMenu->Options[$i]!=""){ if ($oMenu->Options[$i] != "") {
$menuCases[$CurrentBlockID]['link'] = $oMenu->Options[$i]; $menuCases[$CurrentBlockID]['link'] = $oMenu->Options[$i];
} }
}elseif( $oMenu->Types[$i] == 'blockNestedTree' ){ } elseif ($oMenu->Types[$i] == 'blockNestedTree') {
$CurrentBlockID = $oMenu->Id[$i]; $CurrentBlockID = $oMenu->Id[$i];
$menuCases[$CurrentBlockID]['blockTitle'] = $oMenu->Labels[$i]; $menuCases[$CurrentBlockID]['blockTitle'] = $oMenu->Labels[$i];
$menuCases[$CurrentBlockID]['blockType'] = $oMenu->Types[$i]; $menuCases[$CurrentBlockID]['blockType'] = $oMenu->Types[$i];
$menuCases[$CurrentBlockID]['loaderurl'] = $oMenu->Options[$i]; $menuCases[$CurrentBlockID]['loaderurl'] = $oMenu->Options[$i];
}elseif( $oMenu->Types[$i] == 'blockHeaderNoChild' ){ } elseif ($oMenu->Types[$i] == 'blockHeaderNoChild') {
$CurrentBlockID = $oMenu->Id[$i]; $CurrentBlockID = $oMenu->Id[$i];
$menuCases[$CurrentBlockID]['blockTitle'] = $oMenu->Labels[$i]; $menuCases[$CurrentBlockID]['blockTitle'] = $oMenu->Labels[$i];
$menuCases[$CurrentBlockID]['blockType'] = $oMenu->Types[$i]; $menuCases[$CurrentBlockID]['blockType'] = $oMenu->Types[$i];
$menuCases[$CurrentBlockID]['link'] = $oMenu->Options[$i]; $menuCases[$CurrentBlockID]['link'] = $oMenu->Options[$i];
}else { } else {
$menuCases[$CurrentBlockID]['blockItems'][$oMenu->Id[$i]] = Array ( $menuCases[$CurrentBlockID]['blockItems'][$oMenu->Id[$i]] = Array ('label' => $oMenu->Labels[$i],'link' => $oMenu->Options[$i],'icon' => (isset( $oMenu->Icons[$i] ) && $oMenu->Icons[$i] != '') ? $oMenu->Icons[$i] : 'kcmdf.png'
'label' => $oMenu->Labels[$i], );
'link' => $oMenu->Options[$i],
'icon' => (isset($oMenu->Icons[$i]) && $oMenu->Icons[$i] != '') ? $oMenu->Icons[$i] : 'kcmdf.png' if (isset( $aTypesID[$oMenu->Id[$i]] )) {
); $menuCases[$CurrentBlockID]['blockItems'][$oMenu->Id[$i]]['cases_count'] = $aCount[$aTypesID[$oMenu->Id[$i]]]['count'];
}
if( isset($aTypesID[$oMenu->Id[$i]]) ) { }
$menuCases[$CurrentBlockID]['blockItems'][$oMenu->Id[$i]]['cases_count'] = $aCount[$aTypesID[$oMenu->Id[$i]]]['count']; }
}
}
}
//now build the menu in xml format //now build the menu in xml format
$xml = '<menu_cases>'; $xml = '<menu_cases>';
$i = 0; $i = 0;
foreach( $menuCases as $menu => $aMenuBlock ) { foreach ($menuCases as $menu => $aMenuBlock) {
if( isset($aMenuBlock['blockItems']) && sizeof($aMenuBlock['blockItems']) > 0 ) { if (isset( $aMenuBlock['blockItems'] ) && sizeof( $aMenuBlock['blockItems'] ) > 0) {
$urlProperty=""; $urlProperty = "";
if((isset($aMenuBlock['link']))&&($aMenuBlock['link']!="")){ if ((isset( $aMenuBlock['link'] )) && ($aMenuBlock['link'] != "")) {
$urlProperty="url='".$aMenuBlock['link']."'"; $urlProperty = "url='" . $aMenuBlock['link'] . "'";
} }
$xml .= '<menu_block blockTitle="'.$aMenuBlock['blockTitle'].'" id="'.$menu.'" '.$urlProperty.'>'; $xml .= '<menu_block blockTitle="' . $aMenuBlock['blockTitle'] . '" id="' . $menu . '" ' . $urlProperty . '>';
foreach( $aMenuBlock['blockItems'] as $id => $aMenu ) { foreach ($aMenuBlock['blockItems'] as $id => $aMenu) {
$i++; $i ++;
if( isset($aMenu['cases_count']) && $aMenu['cases_count'] !== '') { if (isset( $aMenu['cases_count'] ) && $aMenu['cases_count'] !== '') {
$nofifier = "cases_count=\"{$aMenu['cases_count']}\" "; $nofifier = "cases_count=\"{$aMenu['cases_count']}\" ";
} } else {
else { $nofifier = '';
$nofifier = ''; }
} $xml .= '<option title="' . $aMenu['label'] . '" id="' . $id . '" ' . $nofifier . ' url="' . $aMenu['link'] . '">';
$xml .= '<option title="'.$aMenu['label'].'" id="'.$id.'" '.$nofifier.' url="'.$aMenu['link'].'">'; $xml .= '</option>';
$xml .= '</option>'; }
} $xml .= '</menu_block>';
$xml .= '</menu_block>'; } elseif (isset( $aMenuBlock['blockType'] ) && $aMenuBlock['blockType'] == "blockNestedTree") {
}elseif( isset($aMenuBlock['blockType']) && $aMenuBlock['blockType']=="blockNestedTree" ) { $xml .= '<menu_block blockTitle="' . $aMenuBlock['blockTitle'] . '" blockNestedTree = "' . $aMenuBlock['loaderurl'] . '" id="' . $menu . '" folderId="0">';
$xml .= '<menu_block blockTitle="'.$aMenuBlock['blockTitle'].'" blockNestedTree = "'.$aMenuBlock['loaderurl'].'" id="'.$menu.'" folderId="0">'; $xml .= '</menu_block>';
$xml .= '</menu_block>'; } elseif (isset( $aMenuBlock['blockType'] ) && $aMenuBlock['blockType'] == "blockHeaderNoChild") {
}elseif( isset($aMenuBlock['blockType']) && $aMenuBlock['blockType']=="blockHeaderNoChild" ) { $xml .= '<menu_block blockTitle="' . $aMenuBlock['blockTitle'] . '" blockHeaderNoChild="blockHeaderNoChild" url = "' . $aMenuBlock['link'] . '" id="' . $menu . '">';
$xml .= '<menu_block blockTitle="'.$aMenuBlock['blockTitle'].'" blockHeaderNoChild="blockHeaderNoChild" url = "'.$aMenuBlock['link'].'" id="'.$menu.'">'; //$xml .= '<option title="" id="" ></option>';
//$xml .= '<option title="" id="" ></option>'; $xml .= '</menu_block>';
$xml .= '</menu_block>'; }
} }
} $xml .= '</menu_cases>';
$xml .= '</menu_cases>';
print $xml;
print $xml; }
}
// get the process summary of specific case list type,
// get the process summary of specific case list type, function getProcess ()
function getProcess () { {
global $G_TMP_MENU; global $G_TMP_MENU;
global $userId; global $userId;
if ( !isset($_GET['item']) ) { if (! isset( $_GET['item'] )) {
die; die();
} }
$oMenu = new Menu(); $oMenu = new Menu();
$oMenu->load('cases'); $oMenu->load( 'cases' );
$type = $_GET['item']; $type = $_GET['item'];
$oCases = new AppCacheView(); $oCases = new AppCacheView();
$aTypesID = array(); $aTypesID = array ();
$aTypesID['CASES_INBOX'] = 'to_do'; $aTypesID['CASES_INBOX'] = 'to_do';
$aTypesID['CASES_DRAFT'] = 'draft'; $aTypesID['CASES_DRAFT'] = 'draft';
$aTypesID['CASES_CANCELLED'] = 'cancelled'; $aTypesID['CASES_CANCELLED'] = 'cancelled';
$aTypesID['CASES_SENT'] = 'sent'; $aTypesID['CASES_SENT'] = 'sent';
$aTypesID['CASES_PAUSED'] = 'paused'; $aTypesID['CASES_PAUSED'] = 'paused';
$aTypesID['CASES_COMPLETED'] = 'completed'; $aTypesID['CASES_COMPLETED'] = 'completed';
$aTypesID['CASES_SELFSERVICE'] = 'selfservice'; $aTypesID['CASES_SELFSERVICE'] = 'selfservice';
//$aTypesID['CASES_TO_REVISE'] = 'to_revise'; //$aTypesID['CASES_TO_REVISE'] = 'to_revise';
//$aTypesID['CASES_TO_REASSIGN'] = 'to_reassign'; //$aTypesID['CASES_TO_REASSIGN'] = 'to_reassign';
$aTypesID = Array('CASES_INBOX'=>'to_do', 'CASES_DRAFT'=>'draft', 'CASES_CANCELLED'=>'cancelled', 'CASES_SENT'=>'sent', 'CASES_PAUSED'=>'paused', 'CASES_COMPLETED'=>'completed','CASES_SELFSERVICE'=>'selfservice','CASES_TO_REVISE'=>'to_revise','CASES_TO_REASSIGN'=>'to_reassign'); $aTypesID = Array ('CASES_INBOX' => 'to_do','CASES_DRAFT' => 'draft','CASES_CANCELLED' => 'cancelled','CASES_SENT' => 'sent','CASES_PAUSED' => 'paused','CASES_COMPLETED' => 'completed','CASES_SELFSERVICE' => 'selfservice','CASES_TO_REVISE' => 'to_revise','CASES_TO_REASSIGN' => 'to_reassign'
);
$aCount = $oCases->getAllCounters(Array($aTypesID[$type]), $userId, true);
$aCount = $oCases->getAllCounters( Array ($aTypesID[$type]
$response = Array(); ), $userId, true );
//disabling the summary...
/* $response = Array ();
//disabling the summary...
/*
$i=0; $i=0;
foreach($aCount[$aTypesID[$type]]['sumary'] as $PRO_UID=>$process){ foreach($aCount[$aTypesID[$type]]['sumary'] as $PRO_UID=>$process){
//{"text":"state","id":"src\/state","cls":"folder", loaded:true}, //{"text":"state","id":"src\/state","cls":"folder", loaded:true},
@@ -167,7 +152,7 @@
$response[$i]->loaded = true; $response[$i]->loaded = true;
$i++; $i++;
} }
*/ */
//ordering //ordering
/*for($i=0; $i<=count($response)-1; $i++){ /*for($i=0; $i<=count($response)-1; $i++){
for($j=$i+1; $j<=count($response); $j++){ for($j=$i+1; $j<=count($response); $j++){
@@ -179,48 +164,50 @@
$response[$j] = $x; $response[$j] = $x;
} }
} }
}*/ }*/
echo G::json_encode($response); echo G::json_encode( $response );
} }
function getAllCounters() { function getAllCounters ()
$userUid = ( isset($_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '' ) ? $_SESSION['USER_LOGGED'] : null; {
$oAppCache = new AppCacheView(); $userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
$aTypes = Array(); $oAppCache = new AppCacheView();
$aTypes['to_do'] = 'CASES_INBOX'; $aTypes = Array ();
$aTypes['draft'] = 'CASES_DRAFT'; $aTypes['to_do'] = 'CASES_INBOX';
$aTypes['cancelled'] = 'CASES_CANCELLED'; $aTypes['draft'] = 'CASES_DRAFT';
$aTypes['sent'] = 'CASES_SENT'; $aTypes['cancelled'] = 'CASES_CANCELLED';
$aTypes['paused'] = 'CASES_PAUSED'; $aTypes['sent'] = 'CASES_SENT';
$aTypes['completed'] = 'CASES_COMPLETED'; $aTypes['paused'] = 'CASES_PAUSED';
$aTypes['selfservice'] = 'CASES_SELFSERVICE'; $aTypes['completed'] = 'CASES_COMPLETED';
$aTypes['selfservice'] = 'CASES_SELFSERVICE';
//$aTypes['to_revise'] = 'CASES_TO_REVISE'; //$aTypes['to_revise'] = 'CASES_TO_REVISE';
//$aTypes['to_reassign'] = 'CASES_TO_REASSIGN'; //$aTypes['to_reassign'] = 'CASES_TO_REASSIGN';
if ((($solrConf = System::solrEnv()) !== false)) {
G::LoadClass ( 'AppSolr' ); if ((($solrConf = System::solrEnv()) !== false)) {
$ApplicationSolrIndex = new AppSolr ($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']); G::LoadClass( 'AppSolr' );
$ApplicationSolrIndex = new AppSolr( $solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance'] );
$aCount = $ApplicationSolrIndex->getCasesCount ( $userUid );
$aCount = $ApplicationSolrIndex->getCasesCount( $userUid );
//get paused count
$aCountMissing = $oAppCache->getAllCounters( array('paused', 'completed', 'cancelled'), $userUid ); //get paused count
$aCountMissing = $oAppCache->getAllCounters( array ('paused','completed','cancelled'
$aCount = array_merge($aCount, $aCountMissing); ), $userUid );
}
else { $aCount = array_merge( $aCount, $aCountMissing );
} else {
$aCount = $oAppCache->getAllCounters( array_keys($aTypes), $userUid );
$aCount = $oAppCache->getAllCounters( array_keys( $aTypes ), $userUid );
}
}
$response = Array();
$i = 0; $response = Array ();
foreach ($aCount as $type=>$count) { $i = 0;
$response[$i]->item = $aTypes[$type]; foreach ($aCount as $type => $count) {
$response[$i]->count = $count; $response[$i]->item = $aTypes[$type];
$i++; $response[$i]->count = $count;
} $i ++;
echo G::json_encode($response); }
} echo G::json_encode( $response );
}

View File

@@ -1,4 +1,4 @@
<?php <?php
/** /**
* cases_SaveData.php * cases_SaveData.php
* *
@@ -12,73 +12,72 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
//validate the data post //validate the data post
//$oForm = new Form ( $_SESSION ['PROCESS'] . '/' . $_GET ['UID'], PATH_DYNAFORM ); //$oForm = new Form ( $_SESSION ['PROCESS'] . '/' . $_GET ['UID'], PATH_DYNAFORM );
//$oForm->validatePost (); //$oForm->validatePost ();
/* @author Alvaro Campos Sanchez */ /* @author Alvaro Campos Sanchez */
/* Includes */ /* Includes */
G::LoadClass ( 'case' ); G::LoadClass( 'case' );
//load the variables //load the variables
$oCase = new Cases ( ); $oCase = new Cases();
$oCase->thisIsTheCurrentUser ( $_SESSION ['APPLICATION'], $_SESSION ['INDEX'], $_SESSION ['USER_LOGGED'], 'REDIRECT', 'cases_List' ); $oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List' );
$Fields = $oCase->loadCase ( $_SESSION ['APPLICATION'] ); $Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$Fields ['APP_DATA'] = array_merge ( $Fields ['APP_DATA'], G::getSystemConstants () ); $Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], G::getSystemConstants() );
$Fields ['APP_DATA'] = array_merge ( $Fields ['APP_DATA'], ( array ) $_POST ['form'] ); $Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], (array) $_POST['form'] );
#here we must verify if is a debug session #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_session = $_SESSION['TRIGGER_DEBUG']['ISSET']; #here we must verify if is a debugg session
#trigger debug routines... #trigger debug routines...
//cleaning debug variables //cleaning debug variables
$_SESSION ['TRIGGER_DEBUG'] ['ERRORS'] = Array (); $_SESSION['TRIGGER_DEBUG']['ERRORS'] = Array ();
$_SESSION ['TRIGGER_DEBUG'] ['DATA'] = Array (); $_SESSION['TRIGGER_DEBUG']['DATA'] = Array ();
$_SESSION ['TRIGGER_DEBUG'] ['TRIGGERS_NAMES'] = Array (); $_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array ();
$_SESSION ['TRIGGER_DEBUG'] ['TRIGGERS_VALUES'] = Array (); $_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array ();
$triggers = $oCase->loadTriggers ( $_SESSION ['TASK'], 'DYNAFORM', $_GET ['UID'], 'AFTER' ); $triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'DYNAFORM', $_GET['UID'], 'AFTER' );
$_SESSION ['TRIGGER_DEBUG'] ['NUM_TRIGGERS'] = count ( $triggers ); $_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] = count( $triggers );
$_SESSION ['TRIGGER_DEBUG'] ['TIME'] = 'AFTER'; $_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER';
if ($_SESSION ['TRIGGER_DEBUG'] ['NUM_TRIGGERS'] != 0) { if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) {
$_SESSION ['TRIGGER_DEBUG'] ['TRIGGERS_NAMES'] = $oCase->getTriggerNames ( $triggers ); $_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers );
$_SESSION ['TRIGGER_DEBUG'] ['TRIGGERS_VALUES'] = $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
} }
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 //go to the next step
$aNextStep = $oCase->getNextStep ( $_SESSION ['PROCESS'], $_SESSION ['APPLICATION'], $_SESSION ['INDEX'], $_SESSION ['STEP_POSITION'] ); $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
if (isset ( $_GET ['_REFRESH_'] )) { if (isset( $_GET['_REFRESH_'] )) {
G::header ( 'location: ' . $_SERVER ['HTTP_REFERER'] ); G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die (); die();
} }
$_SESSION ['STEP_POSITION'] = $aNextStep ['POSITION']; $_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep ['PAGE']; $_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep['PAGE'];
if ($trigger_debug_session) { if ($trigger_debug_session) {
$_SESSION ['TRIGGER_DEBUG'] ['BREAKPAGE'] = $aNextStep ['PAGE']; $_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
$aNextStep ['PAGE'] = $aNextStep ['PAGE'] . '&breakpoint=triggerdebug'; $aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
} }
G::header ( 'location: ' . $aNextStep ['PAGE'] ); G::header( 'location: ' . $aNextStep['PAGE'] );

View File

@@ -1,44 +1,42 @@
<?php <?php
/** /**
* casesSchedulerLog_Ajax.php * casesSchedulerLog_Ajax.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
//if (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response; //if (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response;
G::LoadInclude('ajax'); G::LoadInclude( 'ajax' );
$_POST['action'] = get_ajax_value('action'); $_POST['action'] = get_ajax_value( 'action' );
switch ($_POST['action']) switch ($_POST['action']) {
{ case 'updatePageSize':
case 'updatePageSize': G::LoadClass( 'configuration' );
G::LoadClass('configuration'); $c = new Configurations();
$c = new Configurations(); $arr['pageSize'] = $_REQUEST['size'];
$arr['pageSize'] = $_REQUEST['size']; $arr['dateSave'] = date( 'Y-m-d H:i:s' );
$arr['dateSave'] = date('Y-m-d H:i:s'); $config = Array ();
$config = Array(); $config[] = $arr;
$config[] = $arr; $c->aConfig = $config;
$c->aConfig = $config; $c->saveConfig( 'casesSchedulerLogList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
$c->saveConfig('casesSchedulerLogList', 'pageSize','',$_SESSION['USER_LOGGED']); echo '{success: true}';
echo '{success: true}'; break;
break; break;
break; }
}
?>

View File

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

View File

@@ -1,349 +1,366 @@
<?php <?php
if (! isset( $_REQUEST['action'] )) {
if (! isset ( $_REQUEST ['action'] )) { $res['success'] = 'failure';
$res ['success'] = 'failure'; $res['message'] = 'You may request an action';
$res ['message'] = 'You may request an action'; print G::json_encode( $res );
print G::json_encode ( $res); die();
die (); }
} if (! function_exists( $_REQUEST['action'] )) {
if (! function_exists ( $_REQUEST ['action'] )) { $res['success'] = 'failure';
$res ['success'] = 'failure'; $res['message'] = 'The requested action does not exist';
$res ['message'] = 'The requested action does not exist'; print G::json_encode( $res );
print G::json_encode ( $res ); die();
die (); }
}
$functionName = $_REQUEST['action'];
$functionName = $_REQUEST ['action']; $functionParams = isset( $_REQUEST['params'] ) ? $_REQUEST['params'] : array ();
$functionParams = isset ( $_REQUEST ['params'] ) ? $_REQUEST ['params'] : array ();
$functionName( $functionParams );
$functionName ( $functionParams );
function getProcessList ()
function getProcessList() { {
G::LoadClass ( 'case' ); G::LoadClass( 'case' );
G::LoadClass ( 'process' ); G::LoadClass( 'process' );
G::LoadClass ( 'calendar' ); G::LoadClass( 'calendar' );
$calendar = new Calendar ( ); $calendar = new Calendar();
$oProcess = new Process ( ); $oProcess = new Process();
$oCase = new Cases ( ); $oCase = new Cases();
//Get ProcessStatistics Info //Get ProcessStatistics Info
$start = 0; $start = 0;
$limit = ''; $limit = '';
$proData = $oProcess->getAllProcesses($start, $limit, null, null, false, true); $proData = $oProcess->getAllProcesses( $start, $limit, null, null, false, true );
$bCanStart = $oCase->canStartCase ( $_SESSION ['USER_LOGGED'] ); $bCanStart = $oCase->canStartCase( $_SESSION['USER_LOGGED'] );
if ($bCanStart) { if ($bCanStart) {
$processListInitial = $oCase->getStartCasesPerType ( $_SESSION ['USER_LOGGED'], 'category' ); $processListInitial = $oCase->getStartCasesPerType( $_SESSION['USER_LOGGED'], 'category' );
$processList = array (); $processList = array ();
foreach ( $processListInitial as $key => $procInfo ) { foreach ($processListInitial as $key => $procInfo) {
if (isset ( $procInfo ['pro_uid'] )) { if (isset( $procInfo['pro_uid'] )) {
if (trim ( $procInfo ['cat'] ) == "") if (trim( $procInfo['cat'] ) == "")
$procInfo ['cat'] = "_OTHER_"; $procInfo['cat'] = "_OTHER_";
$processList [$procInfo ['catname']] [$procInfo ['value']] = $procInfo; $processList[$procInfo['catname']][$procInfo['value']] = $procInfo;
} }
} }
ksort ( $processList ); ksort( $processList );
foreach ( $processList as $key => $processInfo ) { foreach ($processList as $key => $processInfo) {
ksort ( $processList [$key] ); ksort( $processList[$key] );
} }
if (! isset ( $_REQUEST ['node'] )) { if (! isset( $_REQUEST['node'] )) {
$node = 'root'; $node = 'root';
} else { } else {
$node = $_REQUEST ['node']; $node = $_REQUEST['node'];
} }
foreach ($proData as $key => $proInfo) {
foreach($proData as $key => $proInfo){ $proData[$proInfo['PRO_UID']] = $proInfo;
$proData[$proInfo['PRO_UID']]=$proInfo; }
}
$processListTree = array ();
$processListTree = array (); if (1) {
if (1) { foreach ($processList as $key => $processInfo) {
foreach ( $processList as $key => $processInfo ) { $tempTree['text'] = $key;
$tempTree ['text'] = $key; $tempTree['id'] = $key;
$tempTree ['id'] = $key; $tempTree['cls'] = 'folder';
$tempTree ['cls'] = 'folder'; $tempTree['draggable'] = true;
$tempTree ['draggable'] = true; $tempTree['optionType'] = "category";
$tempTree ['optionType'] = "category"; //$tempTree['allowDrop']=false;
//$tempTree['allowDrop']=false; $tempTree['singleClickExpand'] = true;
$tempTree ['singleClickExpand'] = true; if ($key != "No Category") {
if ($key != "No Category") { $tempTree['expanded'] = true;
$tempTree ['expanded'] = true; } else {
} else { //$tempTree ['expanded'] = false;
//$tempTree ['expanded'] = false; $tempTree['expanded'] = true;
$tempTree ['expanded'] = true; }
} $tempTreeChildren = array ();
$tempTreeChildren=array(); foreach ($processList[$key] as $keyChild => $processInfoChild) {
foreach ( $processList [$key] as $keyChild => $processInfoChild ) { //print_r($processInfo);
//print_r($processInfo); $tempTreeChild['text'] = $keyChild; //ellipsis ( $keyChild, 50 );
$tempTreeChild ['text'] = $keyChild; //ellipsis ( $keyChild, 50 ); //$tempTree['text']=$key;
//$tempTree['text']=$key; $tempTreeChild['id'] = $keyChild;
$tempTreeChild ['id'] = $keyChild; $tempTreeChild['draggable'] = true;
$tempTreeChild ['draggable'] = true; $tempTreeChild['leaf'] = true;
$tempTreeChild ['leaf'] = true; $tempTreeChild['icon'] = '/images/icon.trigger.png';
$tempTreeChild ['icon'] = '/images/icon.trigger.png'; $tempTreeChild['allowChildren'] = false;
$tempTreeChild ['allowChildren'] = false; $tempTreeChild['optionType'] = "startProcess";
$tempTreeChild ['optionType'] = "startProcess"; $tempTreeChild['pro_uid'] = $processInfoChild['pro_uid'];
$tempTreeChild ['pro_uid'] = $processInfoChild ['pro_uid']; $tempTreeChild['tas_uid'] = $processInfoChild['uid'];
$tempTreeChild ['tas_uid'] = $processInfoChild ['uid']; $processInfoChild['myInbox'] = 0;
$processInfoChild ['myInbox']=0; $processInfoChild['totalInbox'] = 0;
$processInfoChild ['totalInbox']=0; if (isset( $proData[$processInfoChild['pro_uid']] )) {
if(isset($proData[ $processInfoChild ['pro_uid'] ])){ $tempTreeChild['otherAttributes'] = array_merge( $processInfoChild, $proData[$processInfoChild['pro_uid']], $calendar->getCalendarFor( $processInfoChild['uid'], $processInfoChild['uid'], $processInfoChild['uid'] ) );
$tempTreeChild ['otherAttributes'] = array_merge($processInfoChild,$proData[ $processInfoChild ['pro_uid'] ],$calendar->getCalendarFor ( $processInfoChild ['uid'], $processInfoChild ['uid'], $processInfoChild ['uid'] )); $tempTreeChild['otherAttributes']['PRO_TAS_TITLE'] = str_replace( ")", "", str_replace( "(", "", trim( str_replace( $tempTreeChild['otherAttributes']['PRO_TITLE'], "", $tempTreeChild['otherAttributes']["value"] ) ) ) );
$tempTreeChild ['otherAttributes']['PRO_TAS_TITLE']=str_replace(")","",str_replace("(","",trim(str_replace($tempTreeChild ['otherAttributes']['PRO_TITLE'],"",$tempTreeChild ['otherAttributes']["value"])))); $tempTreeChild['qtip'] = $tempTreeChild['otherAttributes']['PRO_DESCRIPTION'];
$tempTreeChild ['qtip']=$tempTreeChild ['otherAttributes']['PRO_DESCRIPTION'];
//$tempTree['cls']='file';
//$tempTree['cls']='file';
$tempTreeChildren [] = $tempTreeChild; $tempTreeChildren[] = $tempTreeChild;
} }
} }
$tempTree['children']=$tempTreeChildren; $tempTree['children'] = $tempTreeChildren;
$processListTree [] = $tempTree; $processListTree[] = $tempTree;
} }
} else { } else {
foreach ( $processList [$node] as $key => $processInfo ) { foreach ($processList[$node] as $key => $processInfo) {
//print_r($processInfo); //print_r($processInfo);
$tempTree ['text'] = $key; //ellipsis ( $key, 50 ); $tempTree['text'] = $key; //ellipsis ( $key, 50 );
//$tempTree['text']=$key; //$tempTree['text']=$key;
$tempTree ['id'] = $key; $tempTree['id'] = $key;
$tempTree ['draggable'] = true; $tempTree['draggable'] = true;
$tempTree ['leaf'] = true; $tempTree['leaf'] = true;
$tempTree ['icon'] = '/images/icon.trigger.png'; $tempTree['icon'] = '/images/icon.trigger.png';
$tempTree ['allowChildren'] = false; $tempTree['allowChildren'] = false;
$tempTree ['optionType'] = "startProcess"; $tempTree['optionType'] = "startProcess";
$tempTree ['pro_uid'] = $processInfo ['pro_uid']; $tempTree['pro_uid'] = $processInfo['pro_uid'];
$tempTree ['tas_uid'] = $processInfo ['uid']; $tempTree['tas_uid'] = $processInfo['uid'];
$processInfo ['myInbox']=0; $processInfo['myInbox'] = 0;
$processInfo ['totalInbox']=0; $processInfo['totalInbox'] = 0;
$tempTree ['otherAttributes'] = array_merge($processInfo,$proData[ $processInfo ['pro_uid'] ],$calendar->getCalendarFor ( $processInfo ['uid'], $processInfo ['uid'], $processInfo ['uid'] )); $tempTree['otherAttributes'] = array_merge( $processInfo, $proData[$processInfo['pro_uid']], $calendar->getCalendarFor( $processInfo['uid'], $processInfo['uid'], $processInfo['uid'] ) );
$tempTree ['otherAttributes']['PRO_TAS_TITLE']=str_replace(")","",str_replace("(","",trim(str_replace($tempTree ['otherAttributes']['PRO_TITLE'],"",$tempTree ['otherAttributes']["value"])))); $tempTree['otherAttributes']['PRO_TAS_TITLE'] = str_replace( ")", "", str_replace( "(", "", trim( str_replace( $tempTree['otherAttributes']['PRO_TITLE'], "", $tempTree['otherAttributes']["value"] ) ) ) );
$tempTree ['qtip']=$tempTree ['otherAttributes']['PRO_DESCRIPTION']; $tempTree['qtip'] = $tempTree['otherAttributes']['PRO_DESCRIPTION'];
//$tempTree['cls']='file'; //$tempTree['cls']='file';
$processListTree [] = $tempTree; $processListTree[] = $tempTree;
} }
} }
$processList = $processListTree; $processList = $processListTree;
} else { } else {
$processList ['success'] = 'failure'; $processList['success'] = 'failure';
$processList ['message'] = 'User can\'t start process'; $processList['message'] = 'User can\'t start process';
} }
print G::json_encode ( $processList ); print G::json_encode( $processList );
die (); die();
} }
function ellipsis($text, $numb) { function ellipsis ($text, $numb)
$text = html_entity_decode ( $text, ENT_QUOTES ); {
if (strlen ( $text ) > $numb) { $text = html_entity_decode( $text, ENT_QUOTES );
$text = substr ( $text, 0, $numb ); if (strlen( $text ) > $numb) {
$text = substr ( $text, 0, strrpos ( $text, " " ) ); $text = substr( $text, 0, $numb );
//This strips the full stop: $text = substr( $text, 0, strrpos( $text, " " ) );
if ((substr ( $text, - 1 )) == ".") { //This strips the full stop:
$text = substr ( $text, 0, (strrpos ( $text, "." )) ); if ((substr( $text, - 1 )) == ".") {
} $text = substr( $text, 0, (strrpos( $text, "." )) );
$etc = "..."; }
$text = $text . $etc; $etc = "...";
} $text = $text . $etc;
}
return $text;
} return $text;
}
function lookinginforContentProcess($sproUid){
require_once 'classes/model/Content.php'; function lookinginforContentProcess ($sproUid)
require_once 'classes/model/Task.php'; {
require_once 'classes/model/Content.php'; require_once 'classes/model/Content.php';
require_once 'classes/model/Task.php';
$oContent = new Content(); require_once 'classes/model/Content.php';
$oContent = new Content();
///we are looking for a pro title for this process $sproUid ///we are looking for a pro title for this process $sproUid
$oCriteria = new Criteria('workflow'); $oCriteria = new Criteria( 'workflow' );
$oCriteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE'); $oCriteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE' );
$oCriteria->add( ContentPeer::CON_LANG, 'en'); $oCriteria->add( ContentPeer::CON_LANG, 'en' );
$oCriteria->add( ContentPeer::CON_ID, $sproUid); $oCriteria->add( ContentPeer::CON_ID, $sproUid );
$oDataset = ContentPeer::doSelectRS($oCriteria); $oDataset = ContentPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next(); $oDataset->next();
$aRow = $oDataset->getRow(); $aRow = $oDataset->getRow();
if(!is_array($aRow)){ if (! is_array( $aRow )) {
$oC = new Criteria('workflow'); $oC = new Criteria( 'workflow' );
$oC->addSelectColumn(TaskPeer::TAS_UID); $oC->addSelectColumn( TaskPeer::TAS_UID );
$oC->add( TaskPeer::PRO_UID, $sproUid); $oC->add( TaskPeer::PRO_UID, $sproUid );
$oDataset1 = TaskPeer::doSelectRS($oC); $oDataset1 = TaskPeer::doSelectRS( $oC );
$oDataset1->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset1->setFetchmode( ResultSet::FETCHMODE_ASSOC );
while($oDataset1->next()){ while ($oDataset1->next()) {
$aRow1 = $oDataset1->getRow(); $aRow1 = $oDataset1->getRow();
$oCriteria1 = new Criteria('workflow'); $oCriteria1 = new Criteria( 'workflow' );
$oCriteria1->add( ContentPeer::CON_CATEGORY, 'TAS_TITLE'); $oCriteria1->add( ContentPeer::CON_CATEGORY, 'TAS_TITLE' );
$oCriteria1->add( ContentPeer::CON_LANG, SYS_LANG); $oCriteria1->add( ContentPeer::CON_LANG, SYS_LANG );
$oCriteria1->add( ContentPeer::CON_ID, $aRow1['TAS_UID']); $oCriteria1->add( ContentPeer::CON_ID, $aRow1['TAS_UID'] );
$oDataset2 = ContentPeer::doSelectRS($oCriteria1); $oDataset2 = ContentPeer::doSelectRS( $oCriteria1 );
$oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset2->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset2->next(); $oDataset2->next();
$aRow2 = $oDataset2->getRow(); $aRow2 = $oDataset2->getRow();
Content::insertContent( 'TAS_TITLE', '', $aRow2['CON_ID'], 'en', $aRow2['CON_VALUE'] ); Content::insertContent( 'TAS_TITLE', '', $aRow2['CON_ID'], 'en', $aRow2['CON_VALUE'] );
} }
$oC2 = new Criteria('workflow'); $oC2 = new Criteria( 'workflow' );
$oC2->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE'); $oC2->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE' );
$oC2->add( ContentPeer::CON_LANG, SYS_LANG); $oC2->add( ContentPeer::CON_LANG, SYS_LANG );
$oC2->add( ContentPeer::CON_ID, $sproUid); $oC2->add( ContentPeer::CON_ID, $sproUid );
$oDataset3 = ContentPeer::doSelectRS($oC2); $oDataset3 = ContentPeer::doSelectRS( $oC2 );
$oDataset3->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset3->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset3->next(); $oDataset3->next();
$aRow3 = $oDataset3->getRow(); $aRow3 = $oDataset3->getRow();
Content::insertContent( 'PRO_TITLE', '', $aRow3['CON_ID'], 'en', $aRow3['CON_VALUE'] ); Content::insertContent( 'PRO_TITLE', '', $aRow3['CON_ID'], 'en', $aRow3['CON_VALUE'] );
} }
return 1; return 1;
} }
function startCase ()
function startCase() { {
G::LoadClass ( 'case' ); G::LoadClass( 'case' );
/* GET , POST & $_SESSION Vars */ /* GET , POST & $_SESSION Vars */
/* unset any variable, because we are starting a new case */ /* unset any variable, because we are starting a new case */
if (isset ( $_SESSION ['APPLICATION'] )) unset ( $_SESSION ['APPLICATION'] ); if (isset( $_SESSION['APPLICATION'] ))
if (isset ( $_SESSION ['PROCESS'] )) unset ( $_SESSION ['PROCESS'] ); unset( $_SESSION['APPLICATION'] );
if (isset ( $_SESSION ['TASK'] )) unset ( $_SESSION ['TASK'] ); if (isset( $_SESSION['PROCESS'] ))
if (isset ( $_SESSION ['INDEX'] )) unset ( $_SESSION ['INDEX'] ); unset( $_SESSION['PROCESS'] );
if (isset ( $_SESSION ['STEP_POSITION'] )) unset ( $_SESSION ['STEP_POSITION'] ); if (isset( $_SESSION['TASK'] ))
unset( $_SESSION['TASK'] );
/* Process */ if (isset( $_SESSION['INDEX'] ))
try { unset( $_SESSION['INDEX'] );
$oCase = new Cases ( ); if (isset( $_SESSION['STEP_POSITION'] ))
unset( $_SESSION['STEP_POSITION'] );
lookinginforContentProcess($_POST['processId']);
/* Process */
$aData = $oCase->startCase ( $_REQUEST ['taskId'], $_SESSION ['USER_LOGGED'] ); try {
$oCase = new Cases();
$_SESSION ['APPLICATION'] = $aData ['APPLICATION'];
$_SESSION ['INDEX'] = $aData ['INDEX']; lookinginforContentProcess( $_POST['processId'] );
$_SESSION ['PROCESS'] = $aData ['PROCESS'];
$_SESSION ['TASK'] = $_REQUEST ['taskId']; $aData = $oCase->startCase( $_REQUEST['taskId'], $_SESSION['USER_LOGGED'] );
$_SESSION ['STEP_POSITION'] = 0;
$_SESSION['APPLICATION'] = $aData['APPLICATION'];
$_SESSION ['CASES_REFRESH'] = true; $_SESSION['INDEX'] = $aData['INDEX'];
$_SESSION['PROCESS'] = $aData['PROCESS'];
// Execute Events $_SESSION['TASK'] = $_REQUEST['taskId'];
require_once 'classes/model/Event.php'; $_SESSION['STEP_POSITION'] = 0;
$event = new Event();
$event->createAppEvents($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK']); $_SESSION['CASES_REFRESH'] = true;
$oCase = new Cases ( ); // Execute Events
$aNextStep = $oCase->getNextStep ( $_SESSION ['PROCESS'], $_SESSION ['APPLICATION'], $_SESSION ['INDEX'], $_SESSION ['STEP_POSITION'] ); require_once 'classes/model/Event.php';
$event = new Event();
$aNextStep['PAGE'] = 'open?APP_UID='.$aData ['APPLICATION'].'&DEL_INDEX='.$aData ['INDEX'].'&action=draft'; $event->createAppEvents( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK'] );
$_SESSION ['BREAKSTEP'] ['NEXT_STEP'] = $aNextStep; $oCase = new Cases();
$aData ['openCase'] = $aNextStep; $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
$aData ['status'] = 'success'; $aNextStep['PAGE'] = 'open?APP_UID=' . $aData['APPLICATION'] . '&DEL_INDEX=' . $aData['INDEX'] . '&action=draft';
print (G::json_encode ( $aData )) ;
} $_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep;
catch ( Exception $e ) { $aData['openCase'] = $aNextStep;
$aData ['status'] = 'failure';
$aData ['message'] = $e->getMessage (); $aData['status'] = 'success';
print_r ( G::json_encode ( $aData ) ); print (G::json_encode( $aData )) ;
} } catch (Exception $e) {
} $aData['status'] = 'failure';
$aData['message'] = $e->getMessage();
function getSimpleDashboardData() { print_r( G::json_encode( $aData ) );
G::LoadClass ( "BasePeer" ); }
require_once ("classes/model/AppCacheView.php"); }
require_once 'classes/model/Process.php';
$sUIDUserLogged = $_SESSION ['USER_LOGGED']; function getSimpleDashboardData ()
{
$Criteria = new Criteria ( 'workflow' ); G::LoadClass( "BasePeer" );
require_once ("classes/model/AppCacheView.php");
$Criteria->clearSelectColumns (); require_once 'classes/model/Process.php';
$sUIDUserLogged = $_SESSION['USER_LOGGED'];
$Criteria->addSelectColumn ( AppCacheViewPeer::PRO_UID );
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_UID ); $Criteria = new Criteria( 'workflow' );
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_NUMBER );
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_STATUS ); $Criteria->clearSelectColumns();
$Criteria->addSelectColumn ( AppCacheViewPeer::DEL_INDEX );
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_TITLE ); $Criteria->addSelectColumn( AppCacheViewPeer::PRO_UID );
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_PRO_TITLE ); $Criteria->addSelectColumn( AppCacheViewPeer::APP_UID );
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_TAS_TITLE ); $Criteria->addSelectColumn( AppCacheViewPeer::APP_NUMBER );
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_DEL_PREVIOUS_USER ); $Criteria->addSelectColumn( AppCacheViewPeer::APP_STATUS );
$Criteria->addSelectColumn ( AppCacheViewPeer::DEL_TASK_DUE_DATE ); $Criteria->addSelectColumn( AppCacheViewPeer::DEL_INDEX );
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_UPDATE_DATE ); $Criteria->addSelectColumn( AppCacheViewPeer::APP_TITLE );
$Criteria->addSelectColumn ( AppCacheViewPeer::DEL_PRIORITY ); $Criteria->addSelectColumn( AppCacheViewPeer::APP_PRO_TITLE );
$Criteria->addSelectColumn ( AppCacheViewPeer::DEL_DELAYED ); $Criteria->addSelectColumn( AppCacheViewPeer::APP_TAS_TITLE );
$Criteria->addSelectColumn ( AppCacheViewPeer::USR_UID ); $Criteria->addSelectColumn( AppCacheViewPeer::APP_DEL_PREVIOUS_USER );
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_THREAD_STATUS ); $Criteria->addSelectColumn( AppCacheViewPeer::DEL_TASK_DUE_DATE );
$Criteria->addSelectColumn( AppCacheViewPeer::APP_UPDATE_DATE );
$Criteria->add ( AppCacheViewPeer::APP_STATUS, array ("TO_DO", "DRAFT" ), CRITERIA::IN ); $Criteria->addSelectColumn( AppCacheViewPeer::DEL_PRIORITY );
$Criteria->add ( AppCacheViewPeer::USR_UID, array ($sUIDUserLogged, "" ), CRITERIA::IN ); $Criteria->addSelectColumn( AppCacheViewPeer::DEL_DELAYED );
$Criteria->addSelectColumn( AppCacheViewPeer::USR_UID );
$Criteria->add ( AppCacheViewPeer::DEL_FINISH_DATE, null, Criteria::ISNULL ); $Criteria->addSelectColumn( AppCacheViewPeer::APP_THREAD_STATUS );
//$Criteria->add ( AppCacheViewPeer::APP_THREAD_STATUS, 'OPEN' ); $Criteria->add( AppCacheViewPeer::APP_STATUS, array ("TO_DO","DRAFT"
), CRITERIA::IN );
$Criteria->add( AppCacheViewPeer::USR_UID, array ($sUIDUserLogged,""
$Criteria->add ( AppCacheViewPeer::DEL_THREAD_STATUS, 'OPEN' ); ), CRITERIA::IN );
//execute the query $Criteria->add( AppCacheViewPeer::DEL_FINISH_DATE, null, Criteria::ISNULL );
$oDataset = AppCacheViewPeer::doSelectRS ( $Criteria );
$oDataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC ); //$Criteria->add ( AppCacheViewPeer::APP_THREAD_STATUS, 'OPEN' );
$oDataset->next ();
$oProcess = new Process ( ); $Criteria->add( AppCacheViewPeer::DEL_THREAD_STATUS, 'OPEN' );
$rows = array (); //execute the query
$processNames = array (); $oDataset = AppCacheViewPeer::doSelectRS( $Criteria );
while ( $aRow = $oDataset->getRow () ) { $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
// G::pr($aRow); $oDataset->next();
if (! isset ( $processNames [$aRow ['PRO_UID']] )) {
$aProcess = $oProcess->load ( $aRow ['PRO_UID'] ); $oProcess = new Process();
$processNames [$aRow ['PRO_UID']] = $aProcess ['PRO_TITLE'];
} $rows = array ();
$processNames = array ();
if ($aRow ['USR_UID'] == "") while ($aRow = $oDataset->getRow()) {
$aRow ['APP_STATUS'] = "UNASSIGNED"; // G::pr($aRow);
if (((in_array ( $aRow ['APP_STATUS'], array ("TO_DO", "UNASSIGNED" ) )) && ($aRow ['APP_THREAD_STATUS'] == "OPEN")) || ($aRow ['APP_STATUS'] == "DRAFT")) { if (! isset( $processNames[$aRow['PRO_UID']] )) {
$rows [$processNames [$aRow ['PRO_UID']]] [$aRow ['APP_STATUS']] [$aRow ['DEL_DELAYED']] [] = $aRow ['APP_UID']; $aProcess = $oProcess->load( $aRow['PRO_UID'] );
if(!isset($rows [$processNames [$aRow ['PRO_UID']]] [$aRow ['APP_STATUS']]['count'])) $rows [$processNames [$aRow ['PRO_UID']]] [$aRow ['APP_STATUS']]['count']=0; $processNames[$aRow['PRO_UID']] = $aProcess['PRO_TITLE'];
$rows [$processNames [$aRow ['PRO_UID']]][$aRow ['APP_STATUS']]['count']++; }
}
if ($aRow['USR_UID'] == "")
$oDataset->next (); $aRow['APP_STATUS'] = "UNASSIGNED";
} if (((in_array( $aRow['APP_STATUS'], array ("TO_DO","UNASSIGNED"
//Generate different groups of data for graphs ) )) && ($aRow['APP_THREAD_STATUS'] == "OPEN")) || ($aRow['APP_STATUS'] == "DRAFT")) {
$rowsResponse=array(); $rows[$processNames[$aRow['PRO_UID']]][$aRow['APP_STATUS']][$aRow['DEL_DELAYED']][] = $aRow['APP_UID'];
$i=0; if (! isset( $rows[$processNames[$aRow['PRO_UID']]][$aRow['APP_STATUS']]['count'] ))
foreach($rows as $processID => $processInfo){ $rows[$processNames[$aRow['PRO_UID']]][$aRow['APP_STATUS']]['count'] = 0;
$i++; $rows[$processNames[$aRow['PRO_UID']]][$aRow['APP_STATUS']]['count'] ++;
if($i<=10){ }
$rowsResponse['caseStatusByProcess'][]=array('process'=>$processID,'inbox'=>isset($processInfo['TO_DO']['count'])?$processInfo['TO_DO']['count']:0,'draft'=>isset($processInfo['DRAFT']['count'])?$processInfo['DRAFT']['count']:0,'unassigned'=>isset($processInfo['UNASSIGNED']['count'])?$processInfo['UNASSIGNED']['count']:0);
$oDataset->next();
} }
} //Generate different groups of data for graphs
$rowsResponse['caseDelayed'][]=array('delayed'=>'On Time','total'=>100); $rowsResponse = array ();
$rowsResponse['caseDelayed'][]=array('delayed'=>'Delayed','total'=>50); $i = 0;
foreach ($rows as $processID => $processInfo) {
print_r ( G::json_encode ( $rowsResponse ) ); $i ++;
} if ($i <= 10) {
$rowsResponse['caseStatusByProcess'][] = array ('process' => $processID,'inbox' => isset( $processInfo['TO_DO']['count'] ) ? $processInfo['TO_DO']['count'] : 0,'draft' => isset( $processInfo['DRAFT']['count'] ) ? $processInfo['DRAFT']['count'] : 0,'unassigned' => isset( $processInfo['UNASSIGNED']['count'] ) ? $processInfo['UNASSIGNED']['count'] : 0
function getRegisteredDashboards() { );
$oPluginRegistry = & PMPluginRegistry::getSingleton ();
$dashBoardPages = $oPluginRegistry->getDashboardPages (); }
print_r ( G::json_encode ( $dashBoardPages ) ); }
} $rowsResponse['caseDelayed'][] = array ('delayed' => 'On Time','total' => 100
);
function getDefaultDashboard(){ $rowsResponse['caseDelayed'][] = array ('delayed' => 'Delayed','total' => 50
$defaultDashboard['defaultTab']="mainDashboard"; );
if(isset($_SESSION['__currentTabDashboard'])){
$defaultDashboard['defaultTab']=$_SESSION['__currentTabDashboard']; print_r( G::json_encode( $rowsResponse ) );
} }
print_r ( G::json_encode ( $defaultDashboard ) );
} function getRegisteredDashboards ()
{
$oPluginRegistry = & PMPluginRegistry::getSingleton();
$dashBoardPages = $oPluginRegistry->getDashboardPages();
print_r( G::json_encode( $dashBoardPages ) );
}
function getDefaultDashboard ()
{
$defaultDashboard['defaultTab'] = "mainDashboard";
if (isset( $_SESSION['__currentTabDashboard'] )) {
$defaultDashboard['defaultTab'] = $_SESSION['__currentTabDashboard'];
}
print_r( G::json_encode( $defaultDashboard ) );
}

View File

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

View File

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

View File

@@ -1,82 +1,74 @@
<?php <?php
/** /**
* cases_CatchExecute.php * cases_CatchExecute.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
/* Permissions */
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
/* Permissions */ case - 2:
switch ($RBAC->userCanAccess('PM_CASES')) G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
{ G::header( 'location: ../login/login' );
case -2: die();
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); break;
G::header('location: ../login/login'); case - 1:
die; G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
break; G::header( 'location: ../login/login' );
case -1: die();
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); break;
G::header('location: ../login/login'); }
die;
break; if (isset( $_POST['form']['BTN_CANCEL'] )) {
} header( "Location: ../cases/main" );
die();
}
if (isset($_POST['form']['BTN_CANCEL'])) {
header ( "Location: ../cases/main"); /* Includes */
die; G::LoadClass( 'case' );
}
$oCase = new Cases();
/* Includes */ $sAppUid = $_SESSION['APPLICATION'];
G::LoadClass('case'); $iDelIndex = $_SESSION['INDEX'];
$oCase = new Cases(); $oAppDelegation = new AppDelegation();
$sAppUid = $_SESSION['APPLICATION']; $aDelegation = $oAppDelegation->load( $sAppUid, $iDelIndex );
$iDelIndex = $_SESSION['INDEX'];
$oAppDelegation = new AppDelegation();
$aDelegation = $oAppDelegation->load($sAppUid, $iDelIndex);
//if there are no user in the delegation row, this case is still in selfservice //if there are no user in the delegation row, this case is still in selfservice
if ( $aDelegation['USR_UID'] == "" ) { if ($aDelegation['USR_UID'] == "") {
$oCase->setCatchUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'] ); $oCase->setCatchUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'] );
} else { } else {
G::SendMessageText(G::LoadTranslation('ID_CASE_ALREADY_DERIVATED'), 'error'); G::SendMessageText( G::LoadTranslation( 'ID_CASE_ALREADY_DERIVATED' ), 'error' );
} }
$validation = (SYS_SKIN != 'uxs')? 'true' : 'false'; $validation = (SYS_SKIN != 'uxs') ? 'true' : 'false';
die('<script type="text/javascript"> die( '<script type="text/javascript">
if ('.$validation.') { if (' . $validation . ') {
if (window.parent.frames.length != 0) { if (window.parent.frames.length != 0) {
parent.location = "open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . parent.location = "open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=unassigned";
'&action=unassigned";
} else { } else {
window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=unassigned";
$_SESSION['INDEX'] . '&action=unassigned";
} }
} else { } else {
window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=unassigned";
$_SESSION['INDEX'] . '&action=unassigned";
} }
</script>' </script>' );
);

View File

@@ -1,95 +1,91 @@
<?php <?php
/** /**
* cases_Resume.php * cases_Resume.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ /* Permissions */
/* Permissions */ switch ($RBAC->userCanAccess( 'PM_CASES' )) {
switch ($RBAC->userCanAccess('PM_CASES')) case - 2:
{ G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
case -2: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; case - 1:
break; G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
case -1: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; }
break;
} /* Includes */
G::LoadClass( 'case' );
/* Includes */
G::LoadClass('case'); $oCase = new Cases();
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
$oCase = new Cases();
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'] ); /* Render page */
require_once 'classes/model/Process.php';
require_once 'classes/model/Task.php';
/* Render page */
require_once 'classes/model/Process.php'; $objProc = new Process();
require_once 'classes/model/Task.php'; $aProc = $objProc->load( $Fields['PRO_UID'] );
$Fields['PRO_TITLE'] = $aProc['PRO_TITLE'];
$objProc = new Process();
$aProc = $objProc->load($Fields['PRO_UID' ] ); $objTask = new Task();
$Fields['PRO_TITLE'] = $aProc['PRO_TITLE']; $aTask = $objTask->load( $Fields['TAS_UID'] );
$Fields['TAS_TITLE'] = $aTask['TAS_TITLE'];
$objTask = new Task();
$aTask = $objTask->load($Fields['TAS_UID' ] ); $Fields['STATUS'] .= ' ( ' . G::LoadTranslation( 'ID_UNASSIGNED' ) . ' )';
$Fields['TAS_TITLE'] = $aTask['TAS_TITLE'];
$Fields['STATUS'] .= ' ( '. G::LoadTranslation('ID_UNASSIGNED') . ' )';
//now getting information about the PREVIOUS task. If is the first task then no preious, use 1 //now getting information about the PREVIOUS task. If is the first task then no preious, use 1
$oAppDel = new AppDelegation(); $oAppDel = new AppDelegation();
$oAppDel->Load($Fields['APP_UID'], ($Fields['DEL_PREVIOUS']==0 ? $Fields['DEL_PREVIOUS'] = 1 : $Fields['DEL_PREVIOUS']) ); $oAppDel->Load( $Fields['APP_UID'], ($Fields['DEL_PREVIOUS'] == 0 ? $Fields['DEL_PREVIOUS'] = 1 : $Fields['DEL_PREVIOUS']) );
$aAppDel = $oAppDel->toArray(BasePeer::TYPE_FIELDNAME); $aAppDel = $oAppDel->toArray( BasePeer::TYPE_FIELDNAME );
try { try {
$oCurUser = new Users(); $oCurUser = new Users();
$oCurUser->load($aAppDel['USR_UID']); $oCurUser->load( $aAppDel['USR_UID'] );
$Fields['PREVIOUS_USER'] = $oCurUser->getUsrFirstname() . ' ' . $oCurUser->getUsrLastname(); $Fields['PREVIOUS_USER'] = $oCurUser->getUsrFirstname() . ' ' . $oCurUser->getUsrLastname();
} } catch (Exception $oError) {
catch (Exception $oError) { $Fields['PREVIOUS_USER'] = '';
$Fields['PREVIOUS_USER'] = ''; }
}
$objTask = new Task();
$objTask = new Task(); $aTask = $objTask->load( $aAppDel['TAS_UID'] );
$aTask = $objTask->load($aAppDel['TAS_UID' ] ); $Fields['PREVIOUS_TASK'] = $aTask['TAS_TITLE'];
$Fields['PREVIOUS_TASK'] = $aTask['TAS_TITLE'];
//To enable information (dynaforms, steps) before claim a case //To enable information (dynaforms, steps) before claim a case
$_SESSION['bNoShowSteps'] = true; $_SESSION['bNoShowSteps'] = true;
$G_MAIN_MENU = 'processmaker'; $G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'caseOptions'; $G_SUB_MENU = 'caseOptions';
$G_ID_MENU_SELECTED = 'CASES'; $G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = '_'; $G_ID_SUB_MENU_SELECTED = '_';
$oHeadPublisher =& headPublisher::getSingleton(); $oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addScriptCode(" $oHeadPublisher->addScriptCode( "
if (typeof parent != 'undefined') { if (typeof parent != 'undefined') {
if (parent.showCaseNavigatorPanel) { if (parent.showCaseNavigatorPanel) {
parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}'); parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}');
} }
}"); }" );
$oHeadPublisher->addScriptCode(' $oHeadPublisher->addScriptCode( '
var Cse = {}; var Cse = {};
Cse.panels = {}; Cse.panels = {};
var leimnud = new maborak(); var leimnud = new maborak();
@@ -100,11 +96,11 @@ $oHeadPublisher->addScriptCode('
leimnud.Package.Load("cases_Step",{Type:"file",Absolute:true,Path:"/jscore/cases/core/cases_Step.js"}); leimnud.Package.Load("cases_Step",{Type:"file",Absolute:true,Path:"/jscore/cases/core/cases_Step.js"});
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"}); leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
leimnud.exec(leimnud.fix.memoryLeak); leimnud.exec(leimnud.fix.memoryLeak);
'); ' );
$oHeadPublisher =& headPublisher::getSingleton(); $oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addScriptFile('/jscore/cases/core/cases_Step.js'); $oHeadPublisher->addScriptFile( '/jscore/cases/core/cases_Step.js' );
$G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher; $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_CatchSelfService.xml', '', $Fields, 'cases_CatchExecute' );
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_CatchSelfService.xml', '', $Fields, 'cases_CatchExecute'); G::RenderPage( 'publish', 'blank' );
G::RenderPage( 'publish', 'blank');

View File

@@ -1,60 +1,57 @@
<?php <?php
/** /**
* cases_Delete.php * cases_Delete.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ /* Permissions */
/* Permissions */ switch ($RBAC->userCanAccess( 'PM_CASES' )) {
switch ($RBAC->userCanAccess('PM_CASES')) case - 2:
{ G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
case -2: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; case - 1:
break; G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
case -1: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; }
break;
/* Includes */
G::LoadClass( 'case' );
/* Process the info */
try {
$oCase = new Cases();
if (isset( $_POST['APP_UIDS'] )) {
$ids = explode( ',', $_POST['APP_UIDS'] );
foreach ($ids as $id)
$oCase->removeCase( $id );
if (count( $_POST['APP_UIDS'] ) > 1)
echo 'The Case was deleted successfully';
else
echo 'All Cases were deleted successfully';
}
} catch (Exception $e) {
echo $e->getMessage();
} }
/* Includes */
G::LoadClass('case');
/* Process the info */
try{
$oCase = new Cases();
if( isset($_POST['APP_UIDS']) ){
$ids = explode(',', $_POST['APP_UIDS']);
foreach($ids as $id)
$oCase->removeCase($id);
if( count($_POST['APP_UIDS']) > 1)
echo 'The Case was deleted successfully';
else
echo 'All Cases were deleted successfully';
}
} catch(Exception $e){
echo $e->getMessage();
}

View File

@@ -1,63 +1,59 @@
<?php <?php
/** /**
* cases_DeleteDocument.php * cases_DeleteDocument.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ /* Permissions */
/* Permissions */ switch ($RBAC->userCanAccess( 'PM_CASES' )) {
switch ($RBAC->userCanAccess('PM_CASES')) case - 2:
{ G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
case -2: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; case - 1:
break; G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
case -1: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; }
break;
} /* Includes */
require_once ("classes/model/AppDocumentPeer.php");
/* Includes */ G::LoadClass( 'case' );
require_once ( "classes/model/AppDocumentPeer.php" );
G::LoadClass('case');
/* GET , POST & $_SESSION Vars */ /* GET , POST & $_SESSION Vars */
/* Process the info */ /* Process the info */
$oAppDocument = new AppDocument(); $oAppDocument = new AppDocument();
$oAppDocument->remove($_GET['DOC']); $oAppDocument->remove( $_GET['DOC'] );
$oCase = new Cases(); $oCase = new Cases();
$oCase->thisIsTheCurrentUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List'); $oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List' );
if ($_GET['TYPE'] == 'INPUT') if ($_GET['TYPE'] == 'INPUT') {
{ $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1 );
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1); }
} if ($_GET['TYPE'] == 'OUTPUT') {
if ($_GET['TYPE'] == 'OUTPUT') $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
{ }
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']); $_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
}
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION']; /* Redirect */
G::header( 'location: ' . $aNextStep['PAGE'] );
/* Redirect */
G::header('location: ' . $aNextStep['PAGE']);
?>

View File

@@ -1,51 +1,50 @@
<?php <?php
/** /**
* cases_DeleteDocumentToRevise.php * cases_DeleteDocumentToRevise.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ /* Permissions */
/* Permissions */ switch ($RBAC->userCanAccess( 'PM_CASES' )) {
switch ($RBAC->userCanAccess('PM_CASES')) case - 2:
{ G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
case -2: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; case - 1:
break; G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
case -1: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; }
break;
} /* Includes */
require_once ("classes/model/AppDocumentPeer.php");
/* Includes */ G::LoadClass( 'case' );
require_once ( "classes/model/AppDocumentPeer.php" );
G::LoadClass('case');
/* GET , POST & $_SESSION Vars */ /* GET , POST & $_SESSION Vars */
/* Process the info */ /* Process the info */
$oAppDocument = new AppDocument(); $oAppDocument = new AppDocument();
$oAppDocument->remove($_GET['DOC']); $oAppDocument->remove( $_GET['DOC'] );
/* Redirect */ /* Redirect */
G::header('location: ' . $_SERVER['HTTP_REFERER']); G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );

View File

@@ -1,193 +1,185 @@
<?php <?php
/** /**
* cases_Derivate.php * cases_Derivate.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
/* Permissions */
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
/* Permissions */ case - 2:
switch ($RBAC->userCanAccess('PM_CASES')) G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
{ G::header( 'location: ../login/login' );
case -2: die();
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); break;
G::header('location: ../login/login'); case - 1:
die; G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
break; G::header( 'location: ../login/login' );
case -1: die();
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); break;
G::header('location: ../login/login'); }
die;
break; /* Includes */
} G::LoadClass( 'pmScript' );
G::LoadClass( 'case' );
/* Includes */ G::LoadClass( 'derivation' );
G::LoadClass('pmScript');
G::LoadClass('case'); require_once 'classes/model/Event.php';
G::LoadClass('derivation');
require_once 'classes/model/Event.php';
/* GET , POST & $_SESSION Vars */ /* GET , POST & $_SESSION Vars */
/* Process the info */ /* Process the info */
$sStatus = 'TO_DO'; $sStatus = 'TO_DO';
foreach ($_POST['form']['TASKS'] as $aValues){ foreach ($_POST['form']['TASKS'] as $aValues) {
} }
try { try {
//load data //load data
$oCase = new Cases (); $oCase = new Cases();
//warning: we are not using the result value of function thisIsTheCurrentUser, so I'm commenting to optimize speed. //warning: we are not using the result value of function thisIsTheCurrentUser, so I'm commenting to optimize speed.
//$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List'); //$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List');
$appFields = $oCase->loadCase( $_SESSION['APPLICATION'] ); $appFields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$appFields['APP_DATA'] = array_merge($appFields['APP_DATA'], G::getSystemConstants()); $appFields['APP_DATA'] = array_merge( $appFields['APP_DATA'], G::getSystemConstants() );
//cleaning debug variables //cleaning debug variables
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array(); $_SESSION['TRIGGER_DEBUG']['DATA'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array(); $_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array(); $_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array ();
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', -2, 'BEFORE'); $triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'BEFORE' );
//if there are some triggers to execute //if there are some triggers to execute
if( sizeof($triggers) > 0) { if (sizeof( $triggers ) > 0) {
//Execute triggers before derivation //Execute triggers before derivation
$appFields['APP_DATA'] = $oCase->ExecuteTriggers ( $_SESSION['TASK'], 'ASSIGN_TASK', -2, 'BEFORE', $appFields['APP_DATA'] ); $appFields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'BEFORE', $appFields['APP_DATA'] );
//save trigger variables for debugger //save trigger variables for debugger
$_SESSION['TRIGGER_DEBUG']['info'][0]['NUM_TRIGGERS'] = sizeof($triggers); $_SESSION['TRIGGER_DEBUG']['info'][0]['NUM_TRIGGERS'] = sizeof( $triggers );
$_SESSION['TRIGGER_DEBUG']['info'][0]['TIME'] = 'BEFORE'; $_SESSION['TRIGGER_DEBUG']['info'][0]['TIME'] = 'BEFORE';
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_NAMES'] = $oCase->getTriggerNames($triggers); $_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers );
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_VALUES'] = $triggers; $_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_VALUES'] = $triggers;
} }
$appFields['DEL_INDEX'] = $_SESSION['INDEX']; $appFields['DEL_INDEX'] = $_SESSION['INDEX'];
$appFields['TAS_UID'] = $_SESSION['TASK']; $appFields['TAS_UID'] = $_SESSION['TASK'];
$oCase->updateCase ( $_SESSION['APPLICATION'], $appFields); //Save data $oCase->updateCase( $_SESSION['APPLICATION'], $appFields ); //Save data
//derivate case
$oDerivation = new Derivation(); //derivate case
$aCurrentDerivation = array( $oDerivation = new Derivation();
'APP_UID' => $_SESSION['APPLICATION'], $aCurrentDerivation = array ('APP_UID' => $_SESSION['APPLICATION'],'DEL_INDEX' => $_SESSION['INDEX'],'APP_STATUS' => $sStatus,'TAS_UID' => $_SESSION['TASK'],'ROU_TYPE' => $_POST['form']['ROU_TYPE']
'DEL_INDEX' => $_SESSION['INDEX'], );
'APP_STATUS' => $sStatus,
'TAS_UID' => $_SESSION['TASK'], $oDerivation->derivate( $aCurrentDerivation, $_POST['form']['TASKS'] );
'ROU_TYPE' => $_POST['form']['ROU_TYPE']
); $appFields = $oCase->loadCase( $_SESSION['APPLICATION'] ); //refresh appFields, because in derivations should change some values
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'AFTER' ); //load the triggers after derivation
$oDerivation->derivate( $aCurrentDerivation, $_POST['form']['TASKS'] ); if (sizeof( $triggers ) > 0) {
$appFields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'AFTER', $appFields['APP_DATA'] ); //Execute triggers after derivation
$appFields = $oCase->loadCase( $_SESSION['APPLICATION'] ); //refresh appFields, because in derivations should change some values
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', -2, 'AFTER'); //load the triggers after derivation
if( sizeof($triggers) > 0 ) { $_SESSION['TRIGGER_DEBUG']['info'][1]['NUM_TRIGGERS'] = sizeof( $triggers );
$appFields['APP_DATA'] = $oCase->ExecuteTriggers ( $_SESSION['TASK'], 'ASSIGN_TASK', -2, 'AFTER', $appFields['APP_DATA'] ); //Execute triggers after derivation $_SESSION['TRIGGER_DEBUG']['info'][1]['TIME'] = 'AFTER';
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers );
$_SESSION['TRIGGER_DEBUG']['info'][1]['NUM_TRIGGERS'] = sizeof($triggers); $_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_VALUES'] = $triggers;
$_SESSION['TRIGGER_DEBUG']['info'][1]['TIME'] = 'AFTER'; }
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_NAMES'] = $oCase->getTriggerNames($triggers); $oCase->updateCase( $_SESSION['APPLICATION'], $appFields );
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_VALUES'] = $triggers;
} // Send notifications - Start
$oCase->updateCase ( $_SESSION['APPLICATION'], $appFields); $oUser = new Users();
$aUser = $oUser->load( $_SESSION['USER_LOGGED'] );
// Send notifications - Start if (trim( $aUser['USR_EMAIL'] ) == '') {
$oUser = new Users(); $aUser['USR_EMAIL'] = 'info@' . $_SERVER['HTTP_HOST'];
$aUser = $oUser->load($_SESSION['USER_LOGGED']); }
if (trim($aUser['USR_EMAIL'])=='') { $sFromName = '"' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . '" <' . $aUser['USR_EMAIL'] . '>';
$aUser['USR_EMAIL'] = 'info@'.$_SERVER['HTTP_HOST']; try {
} $oCase->sendNotifications( $_SESSION['TASK'], $_POST['form']['TASKS'], $appFields['APP_DATA'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $sFromName );
$sFromName = '"' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . '" <'.$aUser['USR_EMAIL'].'>'; } catch (Exception $e) {
try { G::SendTemporalMessage( G::loadTranslation( 'ID_NOTIFICATION_ERROR' ) . ' - ' . $e->getMessage(), 'warning', 'string', null, '100%' );
$oCase->sendNotifications($_SESSION['TASK'], $_POST['form']['TASKS'], $appFields['APP_DATA'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $sFromName); }
} catch(Exception $e){ // Send notifications - End
G::SendTemporalMessage(G::loadTranslation('ID_NOTIFICATION_ERROR').' - '. $e->getMessage(), 'warning', 'string', null, '100%');
}
// Send notifications - End // Events - Start
$oEvent = new Event();
// Events - Start
$oEvent = new Event(); $oEvent->closeAppEvents( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK'] );
$oCurrentAppDel = AppDelegationPeer::retrieveByPk( $_SESSION['APPLICATION'], $_SESSION['INDEX'] + 1 );
$oEvent->closeAppEvents($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK']); $multipleDelegation = false;
$oCurrentAppDel = AppDelegationPeer::retrieveByPk($_SESSION['APPLICATION'], $_SESSION['INDEX']+1 ); // check if there are multiple derivations
$multipleDelegation = false; if (count( $_POST['form']['TASKS'] ) > 1) {
// check if there are multiple derivations $multipleDelegation = true;
if( count($_POST['form']['TASKS'] ) >1 ) { }
$multipleDelegation = true; // If the case has been delegated
} if (isset( $oCurrentAppDel )) {
// If the case has been delegated // if there is just a single derivation the TASK_UID can be set by the delegation data
if ( isset($oCurrentAppDel) ) { if (! $multipleDelegation) {
// if there is just a single derivation the TASK_UID can be set by the delegation data $aCurrentAppDel = $oCurrentAppDel->toArray( BasePeer::TYPE_FIELDNAME );
if ( !$multipleDelegation ){ $oEvent->createAppEvents( $aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'], $aCurrentAppDel['DEL_INDEX'], $aCurrentAppDel['TAS_UID'] );
$aCurrentAppDel = $oCurrentAppDel->toArray( BasePeer::TYPE_FIELDNAME); } else {
$oEvent->createAppEvents($aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'], $aCurrentAppDel['DEL_INDEX'], $aCurrentAppDel['TAS_UID']); // else we need to check every task and create the events if it have any
} foreach ($_POST['form']['TASKS'] as $taskDelegated) {
else { $aCurrentAppDel = $oCurrentAppDel->toArray( BasePeer::TYPE_FIELDNAME );
// else we need to check every task and create the events if it have any $oEvent->createAppEvents( $aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'], $aCurrentAppDel['DEL_INDEX'], $taskDelegated['TAS_UID'] );
foreach ( $_POST['form']['TASKS'] as $taskDelegated ){ }
$aCurrentAppDel = $oCurrentAppDel->toArray( BasePeer::TYPE_FIELDNAME); }
$oEvent->createAppEvents($aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'], $aCurrentAppDel['DEL_INDEX'], $taskDelegated['TAS_UID']); }
} //Events - End
} $debuggerAvailable = true;
}
//Events - End if (isset( $_SESSION['user_experience'] )) {
$debuggerAvailable = true; $aNextStep['PAGE'] = 'casesListExtJsRedirector?ux=' . $_SESSION['user_experience'];
$debuggerAvailable = false;
if (isset($_SESSION['user_experience'])) { } else {
$aNextStep['PAGE'] = 'casesListExtJsRedirector?ux=' . $_SESSION['user_experience']; $aNextStep['PAGE'] = 'casesListExtJsRedirector';
$debuggerAvailable = false; }
}
else { if (isset( $_SESSION['PMDEBUGGER'] ) && $_SESSION['PMDEBUGGER'] && $debuggerAvailable) {
$aNextStep['PAGE'] = 'casesListExtJsRedirector'; $_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
} $loc = 'cases_Step?' . 'breakpoint=triggerdebug';
} else {
if (isset($_SESSION['PMDEBUGGER']) && $_SESSION['PMDEBUGGER'] && $debuggerAvailable) { $loc = $aNextStep['PAGE'];
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE']; }
$loc = 'cases_Step?' .'breakpoint=triggerdebug';
}
else {
$loc = $aNextStep['PAGE'];
}
//Triggers After //Triggers After
if (isset($_SESSION['TRIGGER_DEBUG']['ISSET'])) { if (isset( $_SESSION['TRIGGER_DEBUG']['ISSET'] )) {
if ($_SESSION['TRIGGER_DEBUG']['ISSET'] == 1 ) { if ($_SESSION['TRIGGER_DEBUG']['ISSET'] == 1) {
$oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html'); $oTemplatePower = new TemplatePower( PATH_TPL . 'cases/cases_Step.html' );
$oTemplatePower->prepare(); $oTemplatePower->prepare();
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower); $G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
$_POST['NextStep'] = $loc; $_POST['NextStep'] = $loc;
$G_PUBLISH->AddContent('view', 'cases/showDebugFrameLoader'); $G_PUBLISH->AddContent( 'view', 'cases/showDebugFrameLoader' );
$G_PUBLISH->AddContent('view', 'cases/showDebugFrameBreaker'); $G_PUBLISH->AddContent( 'view', 'cases/showDebugFrameBreaker' );
$_SESSION['TRIGGER_DEBUG']['ISSET'] == 0; $_SESSION['TRIGGER_DEBUG']['ISSET'] == 0;
G::RenderPage('publish', 'blank'); G::RenderPage( 'publish', 'blank' );
exit(); exit();
} else { } else {
unset($_SESSION['TRIGGER_DEBUG']); unset( $_SESSION['TRIGGER_DEBUG'] );
} }
} }
G::header("location: $loc"); G::header( "location: $loc" );
} } catch (Exception $e) {
catch ( Exception $e ) { $aMessage = array ();
$aMessage = array(); $aMessage['MESSAGE'] = $e->getMessage() . '<br>' . $e->getTraceAsString();
$aMessage['MESSAGE'] = $e->getMessage() . '<br>'.$e->getTraceAsString(); $G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher; $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage ); G::RenderPage( 'publish', 'blank' );
G::RenderPage( 'publish', 'blank'); }
}

View File

@@ -1,113 +1,111 @@
<?php <?php
/** /**
* cases_List.php * cases_List.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
/**
/** * Cases list (Refactored)
* Cases list (Refactored) * By Erik A.
* By Erik A. O. <erik@colosa.com, aortiz.erik@gmail.com> * O. <erik@colosa.com, aortiz.erik@gmail.com>
*/ */
/* Permissions */ /* Permissions */
if (($RBAC_Response = $RBAC->userCanAccess("PM_CASES"))!=1) return $RBAC_Response; if (($RBAC_Response = $RBAC->userCanAccess( "PM_CASES" )) != 1)
return $RBAC_Response;
/* Includes */
G::LoadClass('case'); /* Includes */
G::LoadClass('configuration'); G::LoadClass( 'case' );
G::LoadClass( 'configuration' );
// $_GET['l'] has the type of cases list like todo,pause,cancel, all // $_GET['l'] has the type of cases list like todo,pause,cancel, all
$conf = new Configurations();
if (!isset($_GET['l'])) { $conf = new Configurations();
$confCasesList = $conf->loadObject('ProcessMaker','cases_List','',$_SESSION['USER_LOGGED'],''); if (! isset( $_GET['l'] )) {
if (is_array($confCasesList)) { $confCasesList = $conf->loadObject( 'ProcessMaker', 'cases_List', '', $_SESSION['USER_LOGGED'], '' );
$sTypeList = $confCasesList['sTypeList']; if (is_array( $confCasesList )) {
} $sTypeList = $confCasesList['sTypeList'];
else { } else {
$sTypeList = 'to_do'; $sTypeList = 'to_do';
} }
} } else {
else { $sTypeList = $_GET['l'];
$sTypeList = $_GET['l']; $confCasesList = array ('sTypeList' => $sTypeList
$confCasesList=array('sTypeList'=>$sTypeList); );
$conf->saveObject($confCasesList,'ProcessMaker','cases_List','',$_SESSION['USER_LOGGED'],''); $conf->saveObject( $confCasesList, 'ProcessMaker', 'cases_List', '', $_SESSION['USER_LOGGED'], '' );
} }
$sUIDUserLogged = $_SESSION['USER_LOGGED']; $sUIDUserLogged = $_SESSION['USER_LOGGED'];
$_SESSION['CASES_MENU_OPTION'] = $sTypeList; $_SESSION['CASES_MENU_OPTION'] = $sTypeList;
$oCases = new Cases(); $oCases = new Cases();
/** here we verify if there is a any case with a unpause on this day*/ /**
if( $sTypeList === 'to_do' or $sTypeList === 'draft' or $sTypeList === 'paused') { * here we verify if there is a any case with a unpause on this day
$oCases->ThrowUnpauseDaemon(date('Y-m-d')); */
} if ($sTypeList === 'to_do' or $sTypeList === 'draft' or $sTypeList === 'paused') {
$oCases->ThrowUnpauseDaemon( date( 'Y-m-d' ) );
}
/* * /* *
* Prepare the addtional filters before to show * Prepare the addtional filters before to show
* By Erik * By Erik
*/ */
$aAdditionalFilter = Array(); $aAdditionalFilter = Array ();
if (isset( $_GET['PROCESS_UID'] ) and $_GET['PROCESS_UID'] != "0" && $_GET['PROCESS_UID'] != "") {
if( isset($_GET['PROCESS_UID']) and $_GET['PROCESS_UID'] != "0" && $_GET['PROCESS_UID'] != ""){ $PRO_UID = $_GET['PROCESS_UID'];
$PRO_UID = $_GET['PROCESS_UID']; $aAdditionalFilter['PRO_UID'] = $PRO_UID;
$aAdditionalFilter['PRO_UID'] = $PRO_UID; } else {
} else { $PRO_UID = "0";
$PRO_UID = "0"; }
} if (isset( $_GET['READ'] ) and $_GET['READ'] == "1") {
if( isset($_GET['READ']) and $_GET['READ'] == "1" ){ $aAdditionalFilter['READ'] = $_GET['READ'];
$aAdditionalFilter['READ'] = $_GET['READ']; }
} if (isset( $_GET['UNREAD'] ) and $_GET['UNREAD'] == "1") {
if( isset($_GET['UNREAD']) and $_GET['UNREAD'] == "1" ){ $aAdditionalFilter['UNREAD'] = $_GET['UNREAD'];
$aAdditionalFilter['UNREAD'] = $_GET['UNREAD']; }
}
if (isset( $_GET['APP_STATUS_FILTER'] ) and $_GET['APP_STATUS_FILTER'] != "ALL") {
if( isset($_GET['APP_STATUS_FILTER']) and $_GET['APP_STATUS_FILTER'] != "ALL" ){ $aAdditionalFilter['APP_STATUS_FILTER'] = $_GET['APP_STATUS_FILTER'];
$aAdditionalFilter['APP_STATUS_FILTER'] = $_GET['APP_STATUS_FILTER']; }
}
if (isset( $_GET['MINE'] ) and $_GET['MINE'] == "1") {
if( isset($_GET['MINE']) and $_GET['MINE'] == "1" ){ $aAdditionalFilter['MINE'] = $_GET['MINE'];
$aAdditionalFilter['MINE'] = $_GET['MINE']; }
}
switch ($sTypeList) {
case 'to_do':
if (defined( 'ENABLE_CASE_LIST_OPTIMIZATION' )) {
$aCriteria = $oCases->prepareCriteriaForToDo( $sUIDUserLogged );
switch ( $sTypeList ) { $xmlfile = 'cases/cases_ListTodoNew';
case 'to_do' : } else
if ( defined( 'ENABLE_CASE_LIST_OPTIMIZATION' ) ) { list ($aCriteria, $xmlfile) = $oCases->getConditionCasesList( $sTypeList, $sUIDUserLogged, true, $aAdditionalFilter );
$aCriteria = $oCases->prepareCriteriaForToDo($sUIDUserLogged); break;
$xmlfile = 'cases/cases_ListTodoNew'; default:
} list ($aCriteria, $xmlfile) = $oCases->getConditionCasesList( $sTypeList, $sUIDUserLogged, true, $aAdditionalFilter );
else }
list($aCriteria, $xmlfile) = $oCases->getConditionCasesList( $sTypeList, $sUIDUserLogged, true, $aAdditionalFilter);
break;
default :
list($aCriteria, $xmlfile) = $oCases->getConditionCasesList( $sTypeList, $sUIDUserLogged, true, $aAdditionalFilter);
}
/* /*
$rs = ApplicationPeer::doSelectRS($aCriteria); $rs = ApplicationPeer::doSelectRS($aCriteria);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC); $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
@@ -120,54 +118,50 @@ $rs = ApplicationPeer::doSelectRS($aCriteria);
g::pr($aRows1);die;*/ g::pr($aRows1);die;*/
/* GET , POST & $_SESSION Vars */ /* GET , POST & $_SESSION Vars */
if( !isset($_GET['PROCESS_UID']) ) { if (! isset( $_GET['PROCESS_UID'] )) {
$oCase = new Cases(); $oCase = new Cases();
$rs = ApplicationPeer::doSelectRS($aCriteria); $rs = ApplicationPeer::doSelectRS( $aCriteria );
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC); $rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$aProcess = Array(); $aProcess = Array ();
while($rs->next()) { while ($rs->next()) {
$aRow = $rs->getRow(); $aRow = $rs->getRow();
//g::pr($aRow); die; //g::pr($aRow); die;
if( !InAssocArray($aRow, 'PRO_UID', $aRow['PRO_UID']) ){ if (! InAssocArray( $aRow, 'PRO_UID', $aRow['PRO_UID'] )) {
array_push($aProcess, Array('PRO_UID'=>$aRow['PRO_UID'], 'PRO_TITLE'=>$aRow['APP_PRO_TITLE'])); array_push( $aProcess, Array ('PRO_UID' => $aRow['PRO_UID'],'PRO_TITLE' => $aRow['APP_PRO_TITLE'] ) );
} }
} }
$_DBArray['_PROCESSES'] = array_merge(Array(Array('PRO_UID'=>'char', 'PRO_TITLE'=>'char')), $aProcess); $_DBArray['_PROCESSES'] = array_merge( Array (Array ('PRO_UID' => 'char','PRO_TITLE' => 'char' ) ), $aProcess );
$_SESSION['_DBArray'] = $_DBArray; $_SESSION['_DBArray'] = $_DBArray;
} else { } else {
$_DBArray = $_SESSION['_DBArray']; $_DBArray = $_SESSION['_DBArray'];
} }
/* Render page */
/* Render page */ $G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher; $G_PUBLISH->ROWS_PER_PAGE = 12;
$G_PUBLISH->ROWS_PER_PAGE = 12;
if ($sTypeList == 'to_reassign') {
if ($sTypeList == 'to_reassign') { $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ReassignBy', '', array ('REASSIGN_BY' => 1 ) );
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ReassignBy', '', array('REASSIGN_BY' => 1)); }
}
$aData = Array ('PROCESS_FILTER' => $PRO_UID,'APP_STATUS_FILTER' => (isset( $_GET['APP_STATUS_FILTER'] ) ? $_GET['APP_STATUS_FILTER'] : '0')
$aData = Array( );
'PROCESS_FILTER'=>$PRO_UID,
'APP_STATUS_FILTER'=>(isset($_GET['APP_STATUS_FILTER'])?$_GET['APP_STATUS_FILTER']:'0') $G_PUBLISH->AddContent( 'propeltable', 'paged-table', $xmlfile, $aCriteria, $aData );
);
G::RenderPage( 'publish', 'blank' );
$G_PUBLISH->AddContent('propeltable', 'paged-table', $xmlfile, $aCriteria, $aData);
function InAssocArray ($a, $k, $v)
G::RenderPage('publish', 'blank'); {
foreach ($a as $item) {
if (isset( $item[$k] ) && $v == $item[$k])
return true;
function InAssocArray($a, $k, $v){ }
foreach($a as $item){ return false;
if( isset($item[$k]) && $v == $item[$k]) return true; }
}
return false;
}
?> ?>
<script> <script>
@@ -181,7 +175,5 @@ function InAssocArray($a, $k, $v){
parent.PANEL_EAST_OPEN = false; parent.PANEL_EAST_OPEN = false;
if(parent.refreshCountFolders) parent.refreshCountFolders(); if(parent.refreshCountFolders) parent.refreshCountFolders();
}catch(e){} }catch(e){}
</script>
</script>

View File

@@ -1,162 +1,162 @@
<?php <?php
/**
* cases_New.php /**
* * cases_New.php
* ProcessMaker Open Source Edition *
* Copyright (C) 2004 - 2008 Colosa Inc.23 * 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 * This program is free software: you can redistribute it and/or modify
* published by the Free Software Foundation, either version 3 of the * it under the terms of the GNU Affero General Public License as
* License, or (at your option) any later version. * 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 * This program is distributed in the hope that it will be useful,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * but WITHOUT ANY WARRANTY; without even the implied warranty of
* GNU Affero General Public License for more details. * 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/>. * 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. * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/ */
//we're looking for the type of view //we're looking for the type of view
function putTypeView(){ function putTypeView ()
require_once 'classes/model/Configuration.php'; {
$oConfiguration = new Configuration(); require_once 'classes/model/Configuration.php';
$oCriteria = new Criteria('workflow'); $oConfiguration = new Configuration();
$oCriteria->add(ConfigurationPeer::CFG_UID, 'StartNewCase'); $oCriteria = new Criteria( 'workflow' );
$oCriteria->add(ConfigurationPeer::USR_UID, $_SESSION['USER_LOGGED']); $oCriteria->add( ConfigurationPeer::CFG_UID, 'StartNewCase' );
$oCriteria->add( ConfigurationPeer::USR_UID, $_SESSION['USER_LOGGED'] );
if(ConfigurationPeer::doCount($oCriteria)) {
$conf = ConfigurationPeer::doSelect($oCriteria); if (ConfigurationPeer::doCount( $oCriteria )) {
return $conf[0]->getCfgValue(); $conf = ConfigurationPeer::doSelect( $oCriteria );
} else { return $conf[0]->getCfgValue();
return 'dropdown'; } else {
} return 'dropdown';
} }
}
$_GET['change']=(isset($_GET['change']))?$_GET['change']:putTypeView();
$_GET['change'] = (isset( $_GET['change'] )) ? $_GET['change'] : putTypeView();
/* Permissions */
switch ($RBAC->userCanAccess('PM_CASES')) /* Permissions */
{ switch ($RBAC->userCanAccess( 'PM_CASES' )) {
case -2: case - 2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
case -1: case - 1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
/* Includes */ /* Includes */
G::LoadClass('case'); G::LoadClass( 'case' );
/* GET , POST & $_SESSION Vars */ /* GET , POST & $_SESSION Vars */
/* Menues */ /* Menues */
$G_MAIN_MENU = 'processmaker'; $G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases'; $G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES'; $G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_DRAFT'; $G_ID_SUB_MENU_SELECTED = 'CASES_DRAFT';
/* Prepare page before to show */ /* Prepare page before to show */
$aFields = array(); $aFields = array ();
$oCase = new Cases(); $oCase = new Cases();
$bCanStart = $oCase->canStartCase( $_SESSION['USER_LOGGED'] ); $bCanStart = $oCase->canStartCase( $_SESSION['USER_LOGGED'] );
if ($bCanStart) if ($bCanStart) {
{ $aFields['LANG'] = SYS_LANG;
$aFields['LANG'] = SYS_LANG; $aFields['USER'] = $_SESSION['USER_LOGGED'];
$aFields['USER'] = $_SESSION['USER_LOGGED']; $sXmlForm = 'cases/cases_New.xml';
$sXmlForm = 'cases/cases_New.xml';
//$_DBArray['NewCase'] = $oCase->getStartCases( $_SESSION['USER_LOGGED'] ); //$_DBArray['NewCase'] = $oCase->getStartCases( $_SESSION['USER_LOGGED'] );
$_DBArray['NewCase'] = $oCase->getStartCasesPerType( $_SESSION['USER_LOGGED'], $_GET['change'] ); $_DBArray['NewCase'] = $oCase->getStartCasesPerType( $_SESSION['USER_LOGGED'], $_GET['change'] );
} } else {
else { $sXmlForm = 'cases/cases_CannotInitiateCase.xml';
$sXmlForm = 'cases/cases_CannotInitiateCase.xml'; }
}
if (isset( $_SESSION['G_MESSAGE'] ) && strlen( $_SESSION['G_MESSAGE'] ) > 0) {
if ( isset( $_SESSION['G_MESSAGE']) && strlen($_SESSION['G_MESSAGE']) > 0 ) { $aMessage = array ();
$aMessage = array(); $aMessage['MESSAGE'] = $_SESSION['G_MESSAGE'];
$aMessage['MESSAGE'] = $_SESSION['G_MESSAGE']; //$_SESSION['G_MESSAGE_TYPE'];
//$_SESSION['G_MESSAGE_TYPE']; unset( $_SESSION['G_MESSAGE'] );
unset($_SESSION['G_MESSAGE']); unset( $_SESSION['G_MESSAGE_TYPE'] );
unset($_SESSION['G_MESSAGE_TYPE']); }
}
//get the config parameter to show in dropdown or list
//get the config parameter to show in dropdown or list require_once 'classes/model/Configuration.php';
require_once 'classes/model/Configuration.php'; $oConfiguration = new Configuration();
$oConfiguration = new Configuration(); $oCriteria = new Criteria( 'workflow' );
$oCriteria = new Criteria('workflow'); $oCriteria->add( ConfigurationPeer::CFG_UID, 'StartNewCase' );
$oCriteria->add(ConfigurationPeer::CFG_UID, 'StartNewCase'); $oCriteria->add( ConfigurationPeer::USR_UID, $_SESSION['USER_LOGGED'] );
$oCriteria->add(ConfigurationPeer::USR_UID, $_SESSION['USER_LOGGED']);
if (ConfigurationPeer::doCount( $oCriteria ) == 0) {
if( ConfigurationPeer::doCount($oCriteria) == 0) { $aData['CFG_UID'] = 'StartNewCase';
$aData['CFG_UID'] = 'StartNewCase'; $aData['OBJ_UID'] = '';
$aData['OBJ_UID'] = ''; $aData['CFG_VALUE'] = 'dropdown';
$aData['CFG_VALUE'] = 'dropdown'; $aData['PRO_UID'] = '';
$aData['PRO_UID'] = ''; $aData['USR_UID'] = $_SESSION['USER_LOGGED'];
$aData['USR_UID'] = $_SESSION['USER_LOGGED']; $aData['APP_UID'] = '';
$aData['APP_UID'] = '';
$oConfig = new Configuration();
$oConfig = new Configuration(); $oConfig->create( $aData );
$oConfig->create($aData); $listType = 'dropdown';
$listType = 'dropdown'; } else {
} $oConfiguration = new Configuration();
else { $oCriteria = new Criteria( 'workflow' );
$oConfiguration = new Configuration(); $oCriteria->add( ConfigurationPeer::CFG_UID, 'StartNewCase' );
$oCriteria = new Criteria('workflow'); $oCriteria->add( ConfigurationPeer::USR_UID, $_SESSION['USER_LOGGED'] );
$oCriteria->add(ConfigurationPeer::CFG_UID, 'StartNewCase'); $conf = ConfigurationPeer::doSelect( $oCriteria );
$oCriteria->add(ConfigurationPeer::USR_UID, $_SESSION['USER_LOGGED']);
$conf = ConfigurationPeer::doSelect($oCriteria); $listType = $conf[0]->getCfgValue();
}
$listType = $conf[0]->getCfgValue(); if (isset( $_GET['change'] )) {
} $listType = $_GET['change'];
if ( isset($_GET['change'] ) ) { $aData['CFG_UID'] = 'StartNewCase';
$listType= $_GET['change']; $aData['OBJ_UID'] = '';
$aData['CFG_UID'] = 'StartNewCase'; $aData['CFG_VALUE'] = $listType;
$aData['OBJ_UID'] = ''; $aData['PRO_UID'] = '';
$aData['CFG_VALUE'] = $listType; $aData['USR_UID'] = $_SESSION['USER_LOGGED'];
$aData['PRO_UID'] = ''; $aData['APP_UID'] = '';
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
$aData['APP_UID'] = ''; $oConfig = new Configuration();
$oConfig->update( $aData );
$oConfig = new Configuration(); }
$oConfig->update($aData);
} /* Render page */
$G_PUBLISH = new Publisher();
/* Render page */ $aFields['CHANGE_LINK'] = G::LoadTranslation( 'ID_CHANGE_VIEW' );
$G_PUBLISH = new Publisher;
$aFields['CHANGE_LINK'] = G::LoadTranslation( 'ID_CHANGE_VIEW' ); if (isset( $aMessage )) {
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
if ( isset ( $aMessage ) ) { }
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage ); if ($listType == 'dropdown')
} $G_PUBLISH->AddContent( 'xmlform', 'xmlform', $sXmlForm, '', $aFields, 'cases_Save' );
if ( $listType == 'dropdown' )
$G_PUBLISH->AddContent('xmlform', 'xmlform', $sXmlForm, '', $aFields, 'cases_Save'); if ($listType == 'link') {
if ($bCanStart)
if ( $listType == 'link' ) { $sXmlForm = 'cases/cases_NewRadioGroup.xml';
if ($bCanStart) $sXmlForm = 'cases/cases_NewRadioGroup.xml'; $G_PUBLISH->AddContent( 'xmlform', 'xmlform', $sXmlForm, '', $aFields, 'cases_Save' );
$G_PUBLISH->AddContent('xmlform', 'xmlform', $sXmlForm, '', $aFields, 'cases_Save'); }
}
if ($listType == 'category') {
if ( $listType == 'category' ) { if ($bCanStart)
if ($bCanStart) $sXmlForm = 'cases/cases_NewCategory.xml'; $sXmlForm = 'cases/cases_NewCategory.xml';
$G_PUBLISH->AddContent('view', 'cases/cases_NewCategory'); $G_PUBLISH->AddContent( 'view', 'cases/cases_NewCategory' );
} }
G::RenderPage( 'publish', 'blank' ); G::RenderPage( 'publish', 'blank' );
?> ?>
<script> <script>
parent.outerLayout.hide('east'); parent.outerLayout.hide('east');
parent.PANEL_EAST_OPEN = false; parent.PANEL_EAST_OPEN = false;
</script> </script>

View File

@@ -1,32 +1,32 @@
<?php <?php
/** /**
* cases_NextStep.php * cases_NextStep.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ if (($RBAC_Response = $RBAC->userCanAccess( "PM_CASES" )) != 1)
if (($RBAC_Response=$RBAC->userCanAccess("PM_CASES"))!=1) return $RBAC_Response; return $RBAC_Response;
//go to the next step //go to the next step
G::LoadClass('case'); G::LoadClass( 'case' );
$oCase = new Cases(); $oCase = new Cases();
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']); $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION']; $_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
G::header('location: ' . $aNextStep['PAGE']); G::header( 'location: ' . $aNextStep['PAGE'] );
?>

View File

@@ -1,205 +1,203 @@
<?php <?php
/** /**
* cases_Open.php * cases_Open.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc. * Copyright (C) 2004 - 2008 Colosa Inc.
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
/* Permissions */
/* Permissions */ if ($RBAC->userCanAccess( 'PM_CASES' ) != 1) {
if( $RBAC->userCanAccess('PM_CASES') != 1 ) { switch ($RBAC->userCanAccess( 'PM_CASES' )) {
switch( $RBAC->userCanAccess('PM_CASES') ) { case - 2:
case - 2: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); break;
break; case - 1:
case - 1: default:
default: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); break;
break; }
} }
}
/* Includes */
/* Includes */ require_once 'classes/model/AppDelay.php';
require_once 'classes/model/AppDelay.php'; G::LoadClass( 'case' );
G::LoadClass('case');
$oCase = new Cases();
$oCase = new Cases();
//cleaning the case session data //cleaning the case session data
Cases::clearCaseSessionData(); Cases::clearCaseSessionData();
try { try {
//Loading data for a Jump request //Loading data for a Jump request
if( ! isset($_GET['APP_UID']) && isset($_GET['APP_NUMBER']) ) { if (! isset( $_GET['APP_UID'] ) && isset( $_GET['APP_NUMBER'] )) {
$_GET['APP_UID'] = $oCase->getApplicationUIDByNumber($_GET['APP_NUMBER']); $_GET['APP_UID'] = $oCase->getApplicationUIDByNumber( $_GET['APP_NUMBER'] );
$_GET['DEL_INDEX'] = $oCase->getCurrentDelegation($_GET['APP_UID'], $_SESSION['USER_LOGGED']); $_GET['DEL_INDEX'] = $oCase->getCurrentDelegation( $_GET['APP_UID'], $_SESSION['USER_LOGGED'] );
//if the application doesn't exist //if the application doesn't exist
if( is_null($_GET['APP_UID']) ) { if (is_null( $_GET['APP_UID'] )) {
G::SendMessageText(G::LoadTranslation('ID_CASE_DOES_NOT_EXISTS'), 'info'); G::SendMessageText( G::LoadTranslation( 'ID_CASE_DOES_NOT_EXISTS' ), 'info' );
G::header('location: casesListExtJs'); G::header( 'location: casesListExtJs' );
exit; exit();
} }
//if the application exists but the //if the application exists but the
if( is_null($_GET['DEL_INDEX']) ) { if (is_null( $_GET['DEL_INDEX'] )) {
G::SendMessageText(G::LoadTranslation('ID_CASE_IS_CURRENTLY_WITH_ANOTHER_USER'), 'info'); G::SendMessageText( G::LoadTranslation( 'ID_CASE_IS_CURRENTLY_WITH_ANOTHER_USER' ), 'info' );
G::header('location: casesListExtJs'); G::header( 'location: casesListExtJs' );
exit; exit();
} }
//wrong implemented, need refactored //wrong implemented, need refactored
//$participated = $oCase->userParticipatedInCase($_GET['APP_UID'], $_SESSION['USER_LOGGED']); ??????? //$participated = $oCase->userParticipatedInCase($_GET['APP_UID'], $_SESSION['USER_LOGGED']); ???????
} }
$sAppUid = $_GET['APP_UID']; $sAppUid = $_GET['APP_UID'];
$iDelIndex = $_GET['DEL_INDEX']; $iDelIndex = $_GET['DEL_INDEX'];
$_action = isset($_GET['action'])? $_GET['action']: ''; $_action = isset( $_GET['action'] ) ? $_GET['action'] : '';
//loading application data //loading application data
$aFields = $oCase->loadCase($sAppUid, $iDelIndex); $aFields = $oCase->loadCase( $sAppUid, $iDelIndex );
// g::pr($aFields); // g::pr($aFields);
// die; // die;
switch($aFields['APP_STATUS']){
case 'DRAFT': switch ($aFields['APP_STATUS']) {
case 'TO_DO': case 'DRAFT':
//check if the case is in pause, check a valid record in table APP_DELAY case 'TO_DO':
if( AppDelay::isPaused($sAppUid, $iDelIndex) ) { //check if the case is in pause, check a valid record in table APP_DELAY
//the case is paused show only the resume if (AppDelay::isPaused( $sAppUid, $iDelIndex )) {
$_SESSION['APPLICATION'] = $sAppUid; //the case is paused show only the resume
$_SESSION['INDEX'] = $iDelIndex; $_SESSION['APPLICATION'] = $sAppUid;
$_SESSION['PROCESS'] = $aFields['PRO_UID']; $_SESSION['INDEX'] = $iDelIndex;
$_SESSION['TASK'] = -1; $_SESSION['PROCESS'] = $aFields['PRO_UID'];
$_SESSION['STEP_POSITION'] = 0; $_SESSION['TASK'] = - 1;
$_SESSION['STEP_POSITION'] = 0;
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
exit; require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
} exit();
}
/**
* these routine is to verify if the case was acceded from advaced search list /**
*/ * these routine is to verify if the case was acceded from advaced search list
if( $_action == 'search' ) { */
//verify if the case is with teh current user if ($_action == 'search') {
$c = new Criteria('workflow'); //verify if the case is with teh current user
$c->add(AppDelegationPeer::APP_UID, $sAppUid); $c = new Criteria( 'workflow' );
$c->addDescendingOrderByColumn(AppDelegationPeer::DEL_INDEX); $c->add( AppDelegationPeer::APP_UID, $sAppUid );
$oDataset = AppDelegationPeer::doSelectRs($c); $c->addDescendingOrderByColumn( AppDelegationPeer::DEL_INDEX );
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset = AppDelegationPeer::doSelectRs( $c );
$oDataset->next(); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$aData = $oDataset->getRow(); $oDataset->next();
$aData = $oDataset->getRow();
if ( $aData['USR_UID'] != $_SESSION['USER_LOGGED'] && if ($aData['USR_UID'] != $_SESSION['USER_LOGGED'] && $aData['USR_UID'] != "") //distinct "" for selfservice
$aData['USR_UID'] != "" //distinct "" for selfservice {
) { //so we show just the resume
//so we show just the resume $_SESSION['alreadyDerivated'] = true;
$_SESSION['alreadyDerivated'] = true; //the case is paused show only the resume
//the case is paused show only the resume $_SESSION['APPLICATION'] = $sAppUid;
$_SESSION['APPLICATION'] = $sAppUid; $_SESSION['INDEX'] = $iDelIndex;
$_SESSION['INDEX'] = $iDelIndex; $_SESSION['PROCESS'] = $aFields['PRO_UID'];
$_SESSION['PROCESS'] = $aFields['PRO_UID']; $_SESSION['TASK'] = - 1;
$_SESSION['TASK'] = -1; $_SESSION['STEP_POSITION'] = 0;
$_SESSION['STEP_POSITION'] = 0;
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php'); exit();
exit; }
} }
}
//proceed and try to open the case
$oAppDelegation = new AppDelegation();
//proceed and try to open the case $aDelegation = $oAppDelegation->load( $sAppUid, $iDelIndex );
$oAppDelegation = new AppDelegation();
$aDelegation = $oAppDelegation->load($sAppUid, $iDelIndex); //if there are no user in the delegation row, this case is in selfservice
if ($aDelegation['USR_UID'] == "" /*&& $aDelegation['DEL_THREAD_STATUS'] == 'SELFSERVICE'*/ ) {
//if there are no user in the delegation row, this case is in selfservice
if( $aDelegation['USR_UID'] == "" /*&& $aDelegation['DEL_THREAD_STATUS'] == 'SELFSERVICE'*/ ) { $_SESSION['APPLICATION'] = $sAppUid;
$_SESSION['INDEX'] = $iDelIndex;
$_SESSION['APPLICATION'] = $sAppUid; $_SESSION['PROCESS'] = $aFields['PRO_UID'];
$_SESSION['INDEX'] = $iDelIndex; $_SESSION['TASK'] = - 1;
$_SESSION['PROCESS'] = $aFields['PRO_UID']; $_SESSION['STEP_POSITION'] = 0;
$_SESSION['TASK'] = -1; $_SESSION['CURRENT_TASK'] = $aFields['TAS_UID'];
$_SESSION['STEP_POSITION'] = 0;
$_SESSION['CURRENT_TASK'] = $aFields['TAS_UID']; //if the task is in the valid selfservice tasks for this user, then catch the case, else just view the resume
if ($oCase->isSelfService( $_SESSION['USER_LOGGED'], $aFields['TAS_UID'], $sAppUid )) {
//if the task is in the valid selfservice tasks for this user, then catch the case, else just view the resume require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_CatchSelfService.php');
if( $oCase->isSelfService($_SESSION['USER_LOGGED'], $aFields['TAS_UID'], $sAppUid) ) { } else {
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_CatchSelfService.php'); require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
} else { }
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
} exit();
}
exit;
} //if the current users is in the AppDelegation row, then open the case
if (($aDelegation['USR_UID'] == $_SESSION['USER_LOGGED']) && $_action != 'sent') {
//if the current users is in the AppDelegation row, then open the case $_SESSION['APPLICATION'] = $sAppUid;
if( ($aDelegation['USR_UID'] == $_SESSION['USER_LOGGED']) && $_action != 'sent' ) { $_SESSION['INDEX'] = $iDelIndex;
$_SESSION['APPLICATION'] = $sAppUid;
$_SESSION['INDEX'] = $iDelIndex; if (is_null( $aFields['DEL_INIT_DATE'] )) {
$oCase->setDelInitDate( $sAppUid, $iDelIndex );
if( is_null($aFields['DEL_INIT_DATE']) ) { $aFields = $oCase->loadCase( $sAppUid, $iDelIndex );
$oCase->setDelInitDate($sAppUid, $iDelIndex); }
$aFields = $oCase->loadCase($sAppUid, $iDelIndex);
} $_SESSION['PROCESS'] = $aFields['PRO_UID'];
$_SESSION['TASK'] = $aFields['TAS_UID'];
$_SESSION['PROCESS'] = $aFields['PRO_UID']; $_SESSION['STEP_POSITION'] = 0;
$_SESSION['TASK'] = $aFields['TAS_UID'];
$_SESSION['STEP_POSITION'] = 0; /* Redirect to next step */
unset( $_SESSION['bNoShowSteps'] );
/* Redirect to next step */ $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
unset($_SESSION['bNoShowSteps']); $sPage = $aNextStep['PAGE'];
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']); G::header( 'location: ' . $sPage );
$sPage = $aNextStep['PAGE'];
G::header('location: ' . $sPage); } else {
//when the case have another user or current user doesnt have rights to this selfservice,
//just view the case Resume
} else {
//when the case have another user or current user doesnt have rights to this selfservice,
//just view the case Resume $_SESSION['APPLICATION'] = $sAppUid;
$_SESSION['INDEX'] = $iDelIndex;
$_SESSION['APPLICATION'] = $sAppUid; $_SESSION['PROCESS'] = $aFields['PRO_UID'];
$_SESSION['INDEX'] = $iDelIndex; $_SESSION['TASK'] = - 1;
$_SESSION['PROCESS'] = $aFields['PRO_UID']; $Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
$_SESSION['TASK'] = -1; $_SESSION['CURRENT_TASK'] = $Fields['TAS_UID'];
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'] ); $_SESSION['STEP_POSITION'] = 0;
$_SESSION['CURRENT_TASK'] = $Fields['TAS_UID']; require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
$_SESSION['STEP_POSITION'] = 0; }
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php'); break;
}
break; default: //APP_STATUS <> DRAFT and TO_DO
$_SESSION['APPLICATION'] = $sAppUid;
default: //APP_STATUS <> DRAFT and TO_DO $_SESSION['INDEX'] = $iDelIndex != "" ? $iDelIndex : $oCase->getCurrentDelegationCase( $_GET['APP_UID'] );
$_SESSION['APPLICATION'] = $sAppUid; $_SESSION['PROCESS'] = $aFields['PRO_UID'];
$_SESSION['INDEX'] = $iDelIndex != "" ? $iDelIndex : $oCase->getCurrentDelegationCase($_GET['APP_UID']); $_SESSION['TASK'] = - 1;
$_SESSION['PROCESS'] = $aFields['PRO_UID']; $_SESSION['STEP_POSITION'] = 0;
$_SESSION['TASK'] = -1;
$_SESSION['STEP_POSITION'] = 0; require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
}
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php'); } catch (Exception $e) {
} $aMessage = array ();
} catch( Exception $e ) { $aMessage['MESSAGE'] = $e->getMessage();
$aMessage = array (); $G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $e->getMessage(); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
$G_PUBLISH = new Publisher(); G::RenderPage( 'publishBlank', 'blank' );
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
G::RenderPage('publishBlank', 'blank');
} }

View File

@@ -1,79 +1,75 @@
<?php <?php
/** /**
* cases_Open.php * cases_Open.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ /* Permissions */
/* Permissions */
if ($RBAC->userCanAccess( 'PM_SUPERVISOR' ) != 1)
if( $RBAC->userCanAccess('PM_SUPERVISOR') != 1 ) switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
switch ($RBAC->userCanAccess('PM_SUPERVISOR')) { case - 2:
case - 2: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; default:
default: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; }
}
/* Includes */
/* Includes */ G::LoadClass( 'case' );
G::LoadClass('case');
/* GET , POST & $_SESSION Vars */
/* GET , POST & $_SESSION Vars */ if (isset( $_SESSION['APPLICATION'] )) {
if (isset($_SESSION['APPLICATION'])) { unset( $_SESSION['APPLICATION'] );
unset($_SESSION['APPLICATION']); }
} if (isset( $_SESSION['PROCESS'] )) {
if (isset($_SESSION['PROCESS'])) { unset( $_SESSION['PROCESS'] );
unset($_SESSION['PROCESS']); }
} if (isset( $_SESSION['INDEX'] )) {
if (isset($_SESSION['INDEX'])) { unset( $_SESSION['INDEX'] );
unset($_SESSION['INDEX']); }
} if (isset( $_SESSION['STEP_POSITION'] )) {
if (isset($_SESSION['STEP_POSITION'])) { unset( $_SESSION['STEP_POSITION'] );
unset($_SESSION['STEP_POSITION']); }
}
/* Process the info */
/* Process the info */ $oCase = new Cases();
$oCase = new Cases(); $sAppUid = $_GET['APP_UID'];
$sAppUid = $_GET['APP_UID']; $iDelIndex = $_GET['DEL_INDEX'];
$iDelIndex = $_GET['DEL_INDEX'];
$_SESSION['APPLICATION'] = $_GET['APP_UID'];
$_SESSION['INDEX'] = $_GET['DEL_INDEX'];
$_SESSION['APPLICATION'] = $_GET['APP_UID'];
$_SESSION['INDEX'] = $_GET['DEL_INDEX']; $aFields = $oCase->loadCase( $sAppUid, $iDelIndex );
$aFields = $oCase->loadCase($sAppUid, $iDelIndex); $_SESSION['PROCESS'] = $aFields['PRO_UID'];
$_SESSION['TASK'] = $aFields['TAS_UID'];
$_SESSION['PROCESS'] = $aFields['PRO_UID']; $_SESSION['STEP_POSITION'] = 0;
$_SESSION['TASK'] = $aFields['TAS_UID'];
$_SESSION['STEP_POSITION'] = 0; /* Redirect to next step */
$aNextStep = $oCase->getNextSupervisorStep( $_SESSION['PROCESS'], 0 );
/* Redirect to next step */ $sPage = "cases_StepToRevise?type=DYNAFORM&PRO_UID=" . $aFields['PRO_UID'] . "&DYN_UID=" . $aNextStep['UID'] . "&APP_UID=$sAppUid&DEL_INDEX=$iDelIndex&position=1"; //$aNextStep['PAGE'];
$aNextStep = $oCase->getNextSupervisorStep($_SESSION['PROCESS'],0); G::header( 'location: ' . $sPage );
$sPage = "cases_StepToRevise?type=DYNAFORM&PRO_UID=".$aFields['PRO_UID']."&DYN_UID=".$aNextStep['UID']."&APP_UID=$sAppUid&DEL_INDEX=$iDelIndex&position=1";//$aNextStep['PAGE'];
G::header('location: ' . $sPage);
?>

View File

@@ -1,104 +1,96 @@
<?php <?php
/** /**
* Cases_PrintPreview.php * Cases_PrintPreview.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ try {
try {
require_once 'classes/model/Dynaform.php';
require_once 'classes/model/Dynaform.php'; require_once 'classes/model/Process.php';
require_once 'classes/model/Process.php';
$currentDynUid = '';
$currentDynUid = ''; if (isset( $_GET['DYNUIDPRINT'] ) && $_GET['DYNUIDPRINT'] != '') {
if (isset($_GET['DYNUIDPRINT']) && $_GET['DYNUIDPRINT'] != '') { $currentDynUid = $_GET['DYNUIDPRINT'];
$currentDynUid = $_GET['DYNUIDPRINT']; } elseif (isset( $_SESSION['DYN_UID_PRINT'] )) {
} elseif (isset($_SESSION['DYN_UID_PRINT'])) { $currentDynUid = $_SESSION['DYN_UID_PRINT'];
$currentDynUid = $_SESSION['DYN_UID_PRINT']; } elseif (isset( $_SESSION['CURRENT_DYN_UID'] )) {
} elseif (isset($_SESSION['CURRENT_DYN_UID'])) { $currentDynUid = $_SESSION['CURRENT_DYN_UID'];
$currentDynUid = $_SESSION['CURRENT_DYN_UID']; }
}
$oDynaform = new Dynaform();
$oDynaform = new Dynaform(); $aDyn = $oDynaform->load( $currentDynUid );
$aDyn = $oDynaform->load($currentDynUid);
G::LoadClass( 'case' );
G::LoadClass('case'); $oCase = new Cases();
$oCase = new Cases();
if (isset( $_SESSION['APPLICATION'] )) {
if (isset($_SESSION['APPLICATION'])) { $Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$Fields = $oCase->loadCase($_SESSION['APPLICATION']); $Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], G::getSystemConstants() );
$Fields['APP_DATA'] = array_merge($Fields['APP_DATA'], G::getSystemConstants()); } else {
} else { $Fields['APP_DATA'] = Array ();
$Fields['APP_DATA'] = Array(); }
}
$G_MAIN_MENU = 'processmaker';
$G_MAIN_MENU = 'processmaker'; $G_ID_MENU_SELECTED = 'USERS';
$G_ID_MENU_SELECTED = 'USERS'; $G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher;
$idProcess = (isset( $Fields['APP_DATA']['PROCESS'] )) ? $Fields['APP_DATA']['PROCESS'] : $_SESSION['PROCESS'];
$idProcess = (isset($Fields['APP_DATA']['PROCESS'])) ? $Fields['APP_DATA']['PROCESS'] : $_SESSION['PROCESS']; $oProcess = new Process();
$oProcess = new Process(); $aProcessFieds = $oProcess->load( $idProcess );
$aProcessFieds = $oProcess->load($idProcess); $sProcess = $oProcess->getProTitle();
$sProcess = $oProcess->getProTitle();
$noShowTitle = 0;
$noShowTitle = 0; if (isset( $aProcessFieds['PRO_SHOW_MESSAGE'] )) {
if (isset($aProcessFieds['PRO_SHOW_MESSAGE'])) { $noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE'];
$noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE']; }
}
//Add content content step - Start //Add content content step - Start
if (isset($_SESSION['APPLICATION'])) { if (isset( $_SESSION['APPLICATION'] )) {
$array['CASE'] = G::LoadTranslation('ID_CASE'); $array['CASE'] = G::LoadTranslation( 'ID_CASE' );
$array['USER'] = G::LoadTranslation('ID_USER'); $array['USER'] = G::LoadTranslation( 'ID_USER' );
$array['WORKSPACE'] = G::LoadTranslation('ID_WORKSPACE'); $array['WORKSPACE'] = G::LoadTranslation( 'ID_WORKSPACE' );
$array['APP_NUMBER'] = $Fields['APP_NUMBER']; $array['APP_NUMBER'] = $Fields['APP_NUMBER'];
$array['APP_TITLE'] = $Fields['TITLE']; $array['APP_TITLE'] = $Fields['TITLE'];
$array['USR_USERNAME'] = $Fields['APP_DATA']['USR_USERNAME']; $array['USR_USERNAME'] = $Fields['APP_DATA']['USR_USERNAME'];
$array['USER_ENV'] = $Fields['APP_DATA']['SYS_SYS']; $array['USER_ENV'] = $Fields['APP_DATA']['SYS_SYS'];
$array['DATEPRINT'] = date('Y-m-d H:m:s'); $array['DATEPRINT'] = date( 'Y-m-d H:m:s' );
} }
$array['APP_PROCESS'] = $sProcess; $array['APP_PROCESS'] = $sProcess;
if (isset($Fields['TITLE']) && strlen($Fields['TITLE']) > 0) { if (isset( $Fields['TITLE'] ) && strlen( $Fields['TITLE'] ) > 0) {
$array['TITLE'] = G::LoadTranslation('ID_TITLE'); $array['TITLE'] = G::LoadTranslation( 'ID_TITLE' );
} else { } else {
$array['TITLE'] = ''; $array['TITLE'] = '';
} }
$array['PROCESS'] = G::LoadTranslation('ID_PROCESS'); $array['PROCESS'] = G::LoadTranslation( 'ID_PROCESS' );
$array['DATELABEL'] = G::LoadTranslation('DATE_LABEL'); $array['DATELABEL'] = G::LoadTranslation( 'DATE_LABEL' );
$aDyn['DYN_UID'] = $currentDynUid; $aDyn['DYN_UID'] = $currentDynUid;
if ($noShowTitle == 0) { if ($noShowTitle == 0) {
$G_PUBLISH->AddContent('smarty', 'cases/cases_PrintViewTitle', '', '', $array); $G_PUBLISH->AddContent( 'smarty', 'cases/cases_PrintViewTitle', '', '', $array );
} }
$G_PUBLISH->AddContent('dynaform', $G_PUBLISH->AddContent( 'dynaform', 'xmlform', $aDyn['PRO_UID'] . '/' . $aDyn['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view' );
'xmlform', G::RenderPage( 'publish', 'blank' );
$aDyn['PRO_UID'] . '/' . $aDyn['DYN_UID'], } catch (Exception $oException) {
'', die( $oException->getMessage() );
$Fields['APP_DATA'], }
'',
'',
'view');
G::RenderPage('publish', 'blank');
} catch (Exception $oException) {
die($oException->getMessage());
}
?> ?>
<script> <script>
@@ -129,5 +121,5 @@ try {
window.print(); window.print();
} catch(e){} } catch(e){}
</script> </script>

View File

@@ -1,121 +1,120 @@
<?php <?php
/** /**
* cases_Reassign.php * cases_Reassign.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ try {
try { global $RBAC;
global $RBAC; switch ($RBAC->userCanAccess( 'PM_REASSIGNCASE' )) {
switch ($RBAC->userCanAccess('PM_REASSIGNCASE')) { case - 2:
case -2: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; case - 1:
case -1: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; }
}
G::LoadSystem( 'templatePower' );
G::LoadSystem('templatePower'); $tpl = new TemplatePower( PATH_TPL . "cases/cases_Reassign.html" );
$tpl = new TemplatePower(PATH_TPL ."cases/cases_Reassign.html"); $tpl->prepare();
$tpl->prepare();
require_once 'classes/model/AppDelegation.php';
require_once 'classes/model/AppDelegation.php'; $oCriteria = new Criteria( 'workflow' );
$oCriteria = new Criteria('workflow'); $oCriteria->add( AppDelegationPeer::APP_UID, $_GET['APP_UID'] );
$oCriteria->add(AppDelegationPeer::APP_UID, $_GET['APP_UID']); $oCriteria->add( AppDelegationPeer::DEL_INDEX, $_GET['DEL_INDEX'] );
$oCriteria->add(AppDelegationPeer::DEL_INDEX, $_GET['DEL_INDEX']); $oCriteria->add( AppDelegationPeer::DEL_FINISH_DATE, null );
$oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null); $oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
$oDataset = AppDelegationPeer::doSelectRS($oCriteria); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next();
$oDataset->next(); $c = 0;
$c=0; G::LoadClass( 'tasks' );
G::LoadClass('tasks'); $oTasks = new Tasks();
$oTasks=new Tasks(); G::LoadClass( 'groups' );
G::LoadClass('groups'); $oGroups = new Groups();
$oGroups = new Groups(); require_once 'classes/model/Users.php';
require_once 'classes/model/Users.php'; $oUser = new Users();
$oUser = new Users(); $name = '';
$name = ''; while ($aRow = $oDataset->getRow()) {
while ($aRow = $oDataset->getRow()) { $c ++;
$c++;
$aUsr = array ();
$aUsr=array(); $aUsrUid = array ();
$aUsrUid=array(); $aAux1 = $oTasks->getGroupsOfTask( $aRow['TAS_UID'], 1 );
$aAux1 = $oTasks->getGroupsOfTask($aRow['TAS_UID'], 1); foreach ($aAux1 as $value1) {
foreach ($aAux1 as $value1) { $aAux2 = $oGroups->getUsersOfGroup( $value1['GRP_UID'] );
$aAux2 = $oGroups->getUsersOfGroup($value1['GRP_UID']); foreach ($aAux2 as $value2) {
foreach ($aAux2 as $value2) { if ($aRow['USR_UID'] != $value2['USR_UID']) {
if($aRow['USR_UID']!=$value2['USR_UID']) { if (! in_array( $value2['USR_UID'], $aUsrUid )) { //var_dump($aRow['USR_UID'], $value2['USR_UID']);echo '<br /><br />';
if(!in_array($value2['USR_UID'], $aUsrUid)) {//var_dump($aRow['USR_UID'], $value2['USR_UID']);echo '<br /><br />'; $aAux = $oUser->load( $value2['USR_UID'] );
$aAux = $oUser->load($value2['USR_UID']); $aUsr[$aAux['USR_FIRSTNAME'] . ' ' . $aAux['USR_LASTNAME']] = $aAux;
$aUsr[$aAux['USR_FIRSTNAME'] . ' ' . $aAux['USR_LASTNAME']] = $aAux; $aUsrUid[] = $value2['USR_UID'];
$aUsrUid[]=$value2['USR_UID']; }
} }
} }
} }
}
$aUsers = $oTasks->getUsersOfTask( $aRow['TAS_UID'], 1 );
$aUsers=$oTasks->getUsersOfTask($aRow['TAS_UID'], 1); foreach ($aUsers as $key => $value) {
foreach($aUsers as $key => $value) if ($aRow['USR_UID'] != $value['USR_UID']) {
{ if (! in_array( $value['USR_UID'], $aUsrUid ))
if($aRow['USR_UID']!=$value['USR_UID']) $aUsr[$value['USR_FIRSTNAME'] . ' ' . $value['USR_LASTNAME']] = $value;
{ if(!in_array($value['USR_UID'], $aUsrUid)) }
$aUsr[$value['USR_FIRSTNAME'] . ' ' . $value['USR_LASTNAME']]=$value; }
} ksort( $aUsr );
} //$users='';
ksort($aUsr); //$users='<select name="USERS"><option value="">Seleccione</option>';
//$users=''; foreach ($aUsr as $key => $value) {
//$users='<select name="USERS"><option value="">Seleccione</option>'; $tpl->newBlock( "users" );
foreach($aUsr as $key => $value) $name = $value['USR_FIRSTNAME'] . ' ' . $value['USR_LASTNAME'] . ' (' . $value['USR_USERNAME'] . ')';
{ $tpl->newBlock( "users" ); //$users=$users."<option value='".$value['USR_UID']."'>". $name ."</option>";
$name=$value['USR_FIRSTNAME'].' '.$value['USR_LASTNAME'].' ('.$value['USR_USERNAME'].')'; $tpl->assign( "USR_UID", $value['USR_UID'] );
//$users=$users."<option value='".$value['USR_UID']."'>". $name ."</option>"; $tpl->assign( "USERS", $name );
$tpl->assign( "USR_UID", $value['USR_UID'] ); }
$tpl->assign( "USERS", $name ); //$users=$users.' </select>';
}
//$users=$users.' </select>';
//$tpl->assign( "USERS", $users );
//$tpl->assign( "USERS", $users );
$oDataset->next(); $oDataset->next();
} }
$tpl->gotoBlock('_ROOT'); $tpl->gotoBlock( '_ROOT' );
$tpl->assign( "US", $name ); $tpl->assign( "US", $name );
$tpl->assign( "ID_NO_REASSIGN", '-'); $tpl->assign( "ID_NO_REASSIGN", '-' );
$tpl->assign( "APP_UID", $_GET['APP_UID']); $tpl->assign( "APP_UID", $_GET['APP_UID'] );
$tpl->assign( "DEL_INDEX", $_GET['DEL_INDEX']); $tpl->assign( "DEL_INDEX", $_GET['DEL_INDEX'] );
$G_MAIN_MENU = 'processmaker'; $G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases'; $G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES'; $G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN'; $G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN';
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('template', '', '', '', $tpl); $G_PUBLISH->AddContent( 'template', '', '', '', $tpl );
G::RenderPage('publish', 'blank'); G::RenderPage( 'publish', 'blank' );
} } catch (Exception $oException) {
catch (Exception $oException) { die( $oException->getMessage() );
die($oException->getMessage()); }
}
?>

View File

@@ -1,166 +1,150 @@
<?php <?php
/** /**
* cases_ReassignByUser.php * cases_ReassignByUser.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
/**
/** * Reassign ByUser routines
* Reassign ByUser routines * Author Erik Amaru Ortiz <erik@colosa.com>
* Author Erik Amaru Ortiz <erik@colosa.com> */
*/
try {
try { global $RBAC;
global $RBAC; switch ($RBAC->userCanAccess( 'PM_REASSIGNCASE' )) {
switch ($RBAC->userCanAccess('PM_REASSIGNCASE')) { case - 2:
case -2: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; case - 1:
case -1: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; }
}
if (! isset( $_GET['REASSIGN_USER'] )) {
if (!isset($_GET['REASSIGN_USER'])) { $_GET['REASSIGN_USER'] = '';
$_GET['REASSIGN_USER'] = ''; }
} $_GET['REASSIGN_BY'] = 2;
$_GET['REASSIGN_BY'] = 2; $G_MAIN_MENU = 'processmaker';
$G_MAIN_MENU = 'processmaker'; $G_SUB_MENU = 'cases';
$G_SUB_MENU = 'cases'; $G_ID_MENU_SELECTED = 'CASES';
$G_ID_MENU_SELECTED = 'CASES'; $G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN'; //////////////////
////////////////// ///SELECT USR_UID, CONCAT(USR_FIRSTNAME, ' ', USR_LASTNAME, ' (', USR_USERNAME, ')') AS USER_FULLNAME FROM USERS WHERE USR_STATUS <> 'CLOSED'//////
///SELECT USR_UID, CONCAT(USR_FIRSTNAME, ' ', USR_LASTNAME, ' (', USR_USERNAME, ')') AS USER_FULLNAME FROM USERS WHERE USR_STATUS <> 'CLOSED'////// require_once 'classes/model/Users.php';
require_once 'classes/model/Users.php'; $oCriteria = new Criteria();
$oCriteria=new Criteria(); $oCriteria->addSelectColumn( UsersPeer::USR_UID );
$oCriteria->addSelectColumn(UsersPeer::USR_UID); $oCriteria->addSelectColumn( UsersPeer::USR_USERNAME );
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME); $oCriteria->addSelectColumn( UsersPeer::USR_FIRSTNAME );
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME); $oCriteria->addSelectColumn( UsersPeer::USR_LASTNAME );
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME); $oCriteria->addSelectColumn( UsersPeer::USR_EMAIL );
$oCriteria->addSelectColumn(UsersPeer::USR_EMAIL); $oCriteria->add( UsersPeer::USR_STATUS, '', Criteria::NOT_EQUAL );
$oCriteria->add(UsersPeer::USR_STATUS,'', Criteria::NOT_EQUAL); $oDataset = UsersPeer::doSelectRS( $oCriteria );
$oDataset=UsersPeer::doSelectRS($oCriteria); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); ///////////////////////
/////////////////////// G::loadClass( 'configuration' );
G::loadClass('configuration'); $oConf = new Configurations();
$oConf = new Configurations; $oConf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS','');
$defaultOption = isset( $oConf->aConfig['format'] ) ? $oConf->aConfig['format'] : '';
$defaultOption = isset($oConf->aConfig['format'])? $oConf->aConfig['format']: ''; $aUserInfo = array ();
$aUserInfo = array(); $aUserInfo[] = array ('USR_UID' => 'char','USER_FULLNAME' => 'char'
$aUserInfo[] = array('USR_UID' => 'char','USER_FULLNAME' => 'char'); );
while( $oDataset->next()){ while ($oDataset->next()) {
$aRow1 = $oDataset->getRow(); $aRow1 = $oDataset->getRow();
$infoUser = G::getFormatUserList($defaultOption,$aRow1); $infoUser = G::getFormatUserList( $defaultOption, $aRow1 );
$aUserInfo[]=array( $aUserInfo[] = array ('USR_UID' => $aRow1['USR_UID'],'USER_FULLNAME' => $infoUser
'USR_UID' => $aRow1['USR_UID'], );
'USER_FULLNAME' => $infoUser }
); global $_DBArray;
} $_DBArray['aUserInfo'] = $aUserInfo;
global $_DBArray; $_SESSION['_DBArray'] = $_DBArray;
$_DBArray['aUserInfo'] = $aUserInfo; //////////////////
$_SESSION['_DBArray'] = $_DBArray; $G_PUBLISH = new Publisher();
////////////////// $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ReassignBy', '', $_GET );
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ReassignBy', '', $_GET); $sUserToReassign = trim( $_GET['REASSIGN_USER'] );
$sUserToReassign = trim($_GET['REASSIGN_USER']); if ($_GET['REASSIGN_USER'] != '') {
if ($_GET['REASSIGN_USER'] != '') { G::LoadClass( 'tasks' );
G::LoadClass( 'groups' );
G::LoadClass('tasks'); $oTasks = new Tasks();
G::LoadClass('groups'); $oGroups = new Groups();
$oTasks = new Tasks(); $oUser = new Users();
$oGroups = new Groups(); G::LoadClass( 'case' );
$oUser = new Users(); $oCases = new Cases();
G::LoadClass('case');
$oCases = new Cases(); list ($oCriteriaToDo, $sXMLFile) = $oCases->getConditionCasesList( 'to_do', $sUserToReassign );
list ($oCriteriaDraft, $sXMLFile) = $oCases->getConditionCasesList( 'draft', $sUserToReassign );
list($oCriteriaToDo,$sXMLFile) = $oCases->getConditionCasesList('to_do', $sUserToReassign);
list($oCriteriaDraft,$sXMLFile) = $oCases->getConditionCasesList('draft', $sUserToReassign); $aCasesList = Array ();
$aCasesList = Array(); $oDataset = ApplicationPeer::doSelectRS( $oCriteriaToDo );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset = ApplicationPeer::doSelectRS($oCriteriaToDo);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); while ($oDataset->next()) {
array_push( $aCasesList, $oDataset->getRow() );
while ( $oDataset->next() ) { }
array_push($aCasesList, $oDataset->getRow());
} $oDataset = ApplicationPeer::doSelectRS( $oCriteriaDraft );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset = ApplicationPeer::doSelectRS($oCriteriaDraft);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); while ($oDataset->next()) {
array_push( $aCasesList, $oDataset->getRow() );
while ( $oDataset->next() ) { }
array_push($aCasesList, $oDataset->getRow());
} $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"
);
$filedNames = Array (
"APP_UID", $aCasesList = array_merge( Array ($filedNames
"APP_NUMBER", ), $aCasesList );
"APP_UPDATE_DATE",
"DEL_PRIORITY", // G::pr($aCasesList); die;
"DEL_INDEX",
"TAS_UID",
"DEL_INIT_DATE", require_once ('classes/class.xmlfield_InputPM.php');
"DEL_FINISH_DATE",
"USR_UID", global $_DBArray;
"APP_STATUS", $_DBArray['reassign_byuser'] = $aCasesList;
"DEL_TASK_DUE_DATE", $_SESSION['_DBArray'] = $_DBArray;
"APP_CURRENT_USER", G::LoadClass( 'ArrayPeer' );
"APP_TITLE", $oCriteria = new Criteria( 'dbarray' );
"APP_PRO_TITLE", $oCriteria->setDBArrayTable( 'reassign_byuser' );
"APP_TAS_TITLE",
"APP_DEL_PREVIOUS_USER", $oHeadPublisher = & headPublisher::getSingleton();
); $oHeadPublisher->addScriptFile( '/jscore/cases/reassignByUser.js' );
$G_PUBLISH->ROWS_PER_PAGE = 12;
$aCasesList = array_merge(Array($filedNames), $aCasesList); $G_PUBLISH->AddContent( 'propeltable', 'cases/paged-table-reassigByUser', 'cases/cases_ToReassignByUserList', $oCriteria, Array ('FROM_USR_UID' => $sUserToReassign
) );
// G::pr($aCasesList); die;
}
require_once ( 'classes/class.xmlfield_InputPM.php' ); G::RenderPage( 'publish', 'blank' );
} catch (Exception $oException) {
global $_DBArray; die( $oException->getMessage() );
$_DBArray['reassign_byuser'] = $aCasesList; }
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass('ArrayPeer');
$oCriteria = new Criteria('dbarray');
$oCriteria->setDBArrayTable('reassign_byuser');
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptFile ( '/jscore/cases/reassignByUser.js' );
$G_PUBLISH->ROWS_PER_PAGE = 12;
$G_PUBLISH->AddContent('propeltable', 'cases/paged-table-reassigByUser', 'cases/cases_ToReassignByUserList', $oCriteria, Array('FROM_USR_UID'=>$sUserToReassign));
}
G::RenderPage('publish', 'blank');
}
catch (Exception $oException) {
die($oException->getMessage());
}
?> ?>
<div id="publisherContent[10]" style="display:none"></div> <div id="publisherContent[10]" style="display: none"></div>

View File

@@ -1,79 +1,75 @@
<?php <?php
/** /**
*cases_Reassign_save.php * cases_Reassign_save.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ try {
try { global $RBAC;
global $RBAC; switch ($RBAC->userCanAccess( 'PM_REASSIGNCASE' )) {
switch ($RBAC->userCanAccess('PM_REASSIGNCASE')) { case - 2:
case -2: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; case - 1:
case -1: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; }
} //print_r($_POST); die;
//print_r($_POST); die; G::LoadClass( 'case' );
G::LoadClass('case'); $oCase = new Cases();
$oCase = new Cases();
if ($_POST['USERS'] != '') {
if ($_POST['USERS'] != '') { $oCase->reassignCase( $_POST['APP_UID'], $_POST['DEL_INDEX'], $_SESSION['USER_LOGGED'], $_POST['USERS'] );
$oCase->reassignCase($_POST['APP_UID'], $_POST['DEL_INDEX'], $_SESSION['USER_LOGGED'], $_POST['USERS']);
}
}
require_once 'classes/model/Users.php';
require_once 'classes/model/Users.php'; $oUser = new Users();
$oUser = new Users(); $aUser = $oUser->load( $_POST['USERS'] );
$aUser = $oUser->load($_POST['USERS']);
$Fields = array ();
$Fields=array();
$Fields['USERS'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' (' . $aUser['USR_USERNAME'] . ')';
$Fields['USERS'] = $aUser['USR_FIRSTNAME'].' '.$aUser['USR_LASTNAME'].' ('.$aUser['USR_USERNAME'].')';
G::LoadClass( 'case' );
$oCases = new Cases();
$aCases = $oCases->loadCase( $_POST['APP_UID'], $_POST['DEL_INDEX'] );
G::LoadClass('case');
$oCases=new Cases(); $Fields['APP_NUMBER'] = $aCases['APP_NUMBER'];
$aCases=$oCases->loadCase($_POST['APP_UID'], $_POST['DEL_INDEX'] );
$G_MAIN_MENU = 'processmaker';
$Fields['APP_NUMBER']=$aCases['APP_NUMBER']; $G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_MAIN_MENU = 'processmaker'; $G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN';
$G_SUB_MENU = 'cases'; $G_PUBLISH = new Publisher();
$G_ID_MENU_SELECTED = 'CASES'; $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_Reassign.xml', '', $Fields, '' );
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN'; G::RenderPage( 'publish', 'blank' );
$G_PUBLISH = new Publisher; //G::SendMessageText(G::LoadTranslation('ID_FINISHED'), 'info');
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_Reassign.xml', '', $Fields, ''); //G::header('Location: cases_List');
G::RenderPage( 'publish', 'blank' );
//G::SendMessageText(G::LoadTranslation('ID_FINISHED'), 'info');
//G::header('Location: cases_List'); } catch (Exception $oException) {
die( $oException->getMessage() );
} }
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -1,10 +1,10 @@
<?php <?php
/** /**
* cases_Redirect.php * cases_Redirect.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
@@ -12,15 +12,14 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
/* /*
* Created on 19-03-2009 * Created on 19-03-2009
@@ -29,13 +28,12 @@
*/ */
require_once 'classes/model/AppDocument.php'; require_once 'classes/model/AppDocument.php';
$oAppDocument = new AppDocument(); $oAppDocument = new AppDocument();
$aFields = $oAppDocument->load($_GET['a']); $aFields = $oAppDocument->load( $_GET['a'] );
require_once 'classes/model/OutputDocument.php'; require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new OutputDocument(); $oOutputDocument = new OutputDocument();
$aOD = $oOutputDocument->load($aFields['DOC_UID']); $aOD = $oOutputDocument->load( $aFields['DOC_UID'] );
$a = $_GET['a']; $a = $_GET['a'];
$ext = strtolower($aOD['OUT_DOC_GENERATE']); $ext = strtolower( $aOD['OUT_DOC_GENERATE'] );
G::header( 'location: cases_ShowOutputDocument?a=' . $a . '&ext=' . $ext );
G::header('location: cases_ShowOutputDocument?a='.$a.'&ext='.$ext );
?>

View File

@@ -1,97 +1,95 @@
<?php <?php
/** /**
* cases_Resume.php * cases_Resume.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ /* Permissions */
/* Permissions */ switch ($RBAC->userCanAccess( 'PM_CASES' )) {
switch ($RBAC->userCanAccess('PM_CASES')) case - 2:
{ G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
case -2: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; case - 1:
break; G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
case -1: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; }
break;
} /* Includes */
G::LoadClass( 'case' );
/* GET , POST & $_SESSION Vars */
/* Includes */ /* Menues */
G::LoadClass('case'); $_SESSION['bNoShowSteps'] = true;
$G_MAIN_MENU = 'processmaker';
/* GET , POST & $_SESSION Vars */ $G_SUB_MENU = 'caseOptions';
$G_ID_MENU_SELECTED = 'CASES';
/* Menues */ $G_ID_SUB_MENU_SELECTED = '_';
$_SESSION['bNoShowSteps'] = true;
$G_MAIN_MENU = 'processmaker'; /* Prepare page before to show */
$G_SUB_MENU = 'caseOptions'; $oCase = new Cases();
$G_ID_MENU_SELECTED = 'CASES'; $Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
$G_ID_SUB_MENU_SELECTED = '_'; $participated = $oCase->userParticipatedInCase( $_GET['APP_UID'], $_SESSION['USER_LOGGED'] );
/* Prepare page before to show */ if ($RBAC->userCanAccess( 'PM_ALLCASES' ) < 0 && $participated == 0) {
$oCase = new Cases();
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
$participated = $oCase->userParticipatedInCase($_GET['APP_UID'], $_SESSION['USER_LOGGED']);
if ($RBAC->userCanAccess('PM_ALLCASES') < 0 && $participated == 0) {
/*if (strtoupper($Fields['APP_STATUS']) != 'COMPLETED') { /*if (strtoupper($Fields['APP_STATUS']) != 'COMPLETED') {
$oCase->thisIsTheCurrentUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'SHOW_MESSAGE'); $oCase->thisIsTheCurrentUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'SHOW_MESSAGE');
}*/ }*/
$aMessage['MESSAGE'] = G::LoadTranslation('ID_NO_PERMISSION_NO_PARTICIPATED'); $aMessage['MESSAGE'] = G::LoadTranslation( 'ID_NO_PERMISSION_NO_PARTICIPATED' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage('publishBlank', 'blank'); G::RenderPage( 'publishBlank', 'blank' );
die; die();
} }
if (isset($aRow['APP_TYPE'])) { if (isset( $aRow['APP_TYPE'] )) {
switch ($aRow['APP_TYPE']) { switch ($aRow['APP_TYPE']) {
case 'PAUSE': case 'PAUSE':
$Fields['STATUS'] = ucfirst(strtolower(G::LoadTranslation('ID_PAUSED'))); $Fields['STATUS'] = ucfirst( strtolower( G::LoadTranslation( 'ID_PAUSED' ) ) );
break; break;
case 'CANCEL': case 'CANCEL':
$Fields['STATUS'] = ucfirst(strtolower(G::LoadTranslation('ID_CANCELLED'))); $Fields['STATUS'] = ucfirst( strtolower( G::LoadTranslation( 'ID_CANCELLED' ) ) );
break; break;
} }
//$Fields['STATUS'] = $aRow['APP_TYPE']; //$Fields['STATUS'] = $aRow['APP_TYPE'];
} }
$actions = 'false'; $actions = 'false';
if( $_GET['action'] == 'paused') if ($_GET['action'] == 'paused')
$actions = 'true'; $actions = 'true';
/* Render page */ /* Render page */
$oHeadPublisher =& headPublisher::getSingleton(); $oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addScriptCode(" $oHeadPublisher->addScriptCode( "
if (typeof parent != 'undefined') { if (typeof parent != 'undefined') {
if (parent.showCaseNavigatorPanel) { if (parent.showCaseNavigatorPanel) {
parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}'); parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}');
} }
}"); }" );
$oHeadPublisher->addScriptCode(' $oHeadPublisher->addScriptCode( '
var Cse = {}; var Cse = {};
Cse.panels = {}; Cse.panels = {};
var leimnud = new maborak(); var leimnud = new maborak();
@@ -102,20 +100,21 @@
leimnud.Package.Load("cases_Step",{Type:"file",Absolute:true,Path:"/jscore/cases/core/cases_Step.js"}); leimnud.Package.Load("cases_Step",{Type:"file",Absolute:true,Path:"/jscore/cases/core/cases_Step.js"});
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"}); leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
leimnud.exec(leimnud.fix.memoryLeak); leimnud.exec(leimnud.fix.memoryLeak);
'); ' );
require_once 'classes/model/Process.php'; require_once 'classes/model/Process.php';
$objProc = new Process(); $objProc = new Process();
$aProc = $objProc->load($Fields['PRO_UID' ] ); $aProc = $objProc->load( $Fields['PRO_UID'] );
$Fields['PRO_TITLE'] = $aProc['PRO_TITLE']; $Fields['PRO_TITLE'] = $aProc['PRO_TITLE'];
$objTask = new Task(); $objTask = new Task();
$aTask = $objTask->load($Fields['TAS_UID' ] ); $aTask = $objTask->load( $Fields['TAS_UID'] );
$Fields['TAS_TITLE'] = $aTask['TAS_TITLE']; $Fields['TAS_TITLE'] = $aTask['TAS_TITLE'];
$oHeadPublisher =& headPublisher::getSingleton(); $oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addScriptFile('/jscore/cases/core/cases_Step.js'); $oHeadPublisher->addScriptFile( '/jscore/cases/core/cases_Step.js' );
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_Resume.xml', '', $Fields, ''); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_Resume.xml', '', $Fields, '' );
G::RenderPage( 'publish', 'blank'); G::RenderPage( 'publish', 'blank' );

View File

@@ -1,76 +1,78 @@
<?php <?php
/** /**
* cases_Save.php * cases_Save.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ /* Permissions */
/* Permissions */ switch ($RBAC->userCanAccess( 'PM_CASES' )) {
switch ($RBAC->userCanAccess('PM_CASES')) case - 2:
{ G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
case -2: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die;
break; case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
/* Includes */
G::LoadClass( 'case' );
/* GET , POST & $_SESSION Vars */
case -1: /* unset any variable, because we are starting a new case */
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); if (isset( $_SESSION['APPLICATION'] ))
G::header('location: ../login/login'); unset( $_SESSION['APPLICATION'] );
die; if (isset( $_SESSION['PROCESS'] ))
break; unset( $_SESSION['PROCESS'] );
} if (isset( $_SESSION['TASK'] ))
unset( $_SESSION['TASK'] );
/* Includes */ if (isset( $_SESSION['INDEX'] ))
G::LoadClass('case'); unset( $_SESSION['INDEX'] );
if (isset( $_SESSION['STEP_POSITION'] ))
/* GET , POST & $_SESSION Vars */ unset( $_SESSION['STEP_POSITION'] );
/* unset any variable, because we are starting a new case */ /* Process */
if (isset($_SESSION['APPLICATION'])) unset($_SESSION['APPLICATION']); try {
if (isset($_SESSION['PROCESS'])) unset($_SESSION['PROCESS']); $oCase = new Cases();
if (isset($_SESSION['TASK'])) unset($_SESSION['TASK']); $aData = $oCase->startCase( $_POST['form']['TAS_UID'], $_SESSION['USER_LOGGED'] );
if (isset($_SESSION['INDEX'])) unset($_SESSION['INDEX']); $_SESSION['APPLICATION'] = $aData['APPLICATION'];
if (isset($_SESSION['STEP_POSITION'])) unset($_SESSION['STEP_POSITION']); $_SESSION['INDEX'] = $aData['INDEX'];
$_SESSION['PROCESS'] = $aData['PROCESS'];
/* Process */ $_SESSION['TASK'] = $_POST['form']['TAS_UID'];
try { $_SESSION['STEP_POSITION'] = 0;
$oCase = new Cases();
$aData = $oCase->startCase( $_POST['form']['TAS_UID'], $_SESSION['USER_LOGGED'] ); $_SESSION['CASES_REFRESH'] = true;
$_SESSION['APPLICATION'] = $aData['APPLICATION'];
$_SESSION['INDEX'] = $aData['INDEX']; $oCase = new Cases();
$_SESSION['PROCESS'] = $aData['PROCESS']; $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
$_SESSION['TASK'] = $_POST['form']['TAS_UID']; $_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep;
$_SESSION['STEP_POSITION'] = 0;
G::header( 'location: ' . $aNextStep['PAGE'] );
$_SESSION['CASES_REFRESH'] = true; } catch (Exception $e) {
$_SESSION['G_MESSAGE'] = $e->getMessage();
$oCase = new Cases(); $_SESSION['G_MESSAGE_TYPE'] = 'error';
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']); G::header( 'location: cases_New' );
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep; }
G::header('location: ' . $aNextStep['PAGE']);
}
catch ( Exception $e ) {
$_SESSION['G_MESSAGE'] = $e->getMessage();
$_SESSION['G_MESSAGE_TYPE'] = 'error';
G::header('location: cases_New' );
}
?>

View File

@@ -12,337 +12,309 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
//validate the data post //validate the data post
try { try {
if ($_GET['APP_UID'] !== $_SESSION ['APPLICATION']) { if ($_GET['APP_UID'] !== $_SESSION['APPLICATION']) {
throw new Exception(G::LoadTranslation('ID_INVALID_APPLICATION_ID_MSG', array('<a href=\''.$_SERVER['HTTP_REFERER'].'\'>{1}</a>', G::LoadTranslation('ID_REOPEN')))); throw new Exception( G::LoadTranslation( 'ID_INVALID_APPLICATION_ID_MSG', array ('<a href=\'' . $_SERVER['HTTP_REFERER'] . '\'>{1}</a>',G::LoadTranslation( 'ID_REOPEN' )
} ) ) );
}
$oForm = new Form($_SESSION["PROCESS"] . "/" . $_GET["UID"], PATH_DYNAFORM); $oForm = new Form( $_SESSION["PROCESS"] . "/" . $_GET["UID"], PATH_DYNAFORM );
$oForm->validatePost(); $oForm->validatePost();
//Includes //Includes
G::LoadClass("case"); G::LoadClass( "case" );
//Load the variables //Load the variables
$oCase = new Cases(); $oCase = new Cases();
$oCase->thisIsTheCurrentUser($_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "cases_List"); $oCase->thisIsTheCurrentUser( $_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "cases_List" );
$Fields = $oCase->loadCase($_SESSION["APPLICATION"]); $Fields = $oCase->loadCase( $_SESSION["APPLICATION"] );
$Fields["APP_DATA"] = array_merge($Fields["APP_DATA"], G::getSystemConstants()); $Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], G::getSystemConstants() );
$Fields["APP_DATA"] = array_merge($Fields["APP_DATA"], $_POST["form"]); $Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], $_POST["form"] );
#here we must verify if is a debug session #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_session = $_SESSION['TRIGGER_DEBUG']['ISSET']; #here we must verify if is a debugg session
#trigger debug routines...
#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' );
//cleaning debug variables $_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] = count( $triggers );
$_SESSION ['TRIGGER_DEBUG'] ['ERRORS'] = Array (); $_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER';
$_SESSION ['TRIGGER_DEBUG'] ['DATA'] = Array (); if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) {
$_SESSION ['TRIGGER_DEBUG'] ['TRIGGERS_NAMES'] = Array (); $_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers );
$_SESSION ['TRIGGER_DEBUG'] ['TRIGGERS_VALUES'] = Array (); $_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = $triggers;
}
$triggers = $oCase->loadTriggers ( $_SESSION ['TASK'], 'DYNAFORM', $_GET ['UID'], 'AFTER' ); 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
}
$_SESSION ['TRIGGER_DEBUG'] ['NUM_TRIGGERS'] = count ( $triggers ); //save data in PM Tables if necessary
$_SESSION ['TRIGGER_DEBUG'] ['TIME'] = 'AFTER'; $newValues = array ();
if ($_SESSION ['TRIGGER_DEBUG'] ['NUM_TRIGGERS'] != 0) { foreach ($_POST['form'] as $sField => $sAux) {
$_SESSION ['TRIGGER_DEBUG'] ['TRIGGERS_NAMES'] = $oCase->getTriggerNames ( $triggers ); if (isset( $oForm->fields[$sField]->pmconnection ) && isset( $oForm->fields[$sField]->pmfield )) {
$_SESSION ['TRIGGER_DEBUG'] ['TRIGGERS_VALUES'] = $triggers; if (($oForm->fields[$sField]->pmconnection != '') && ($oForm->fields[$sField]->pmfield != '')) {
} if (isset( $oForm->fields[$oForm->fields[$sField]->pmconnection] )) {
require_once PATH_CORE . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'AdditionalTables.php';
if ($_SESSION ['TRIGGER_DEBUG'] ['NUM_TRIGGERS'] != 0) { $oAdditionalTables = new AdditionalTables();
//Execute after triggers - Start try {
$Fields ['APP_DATA'] = $oCase->ExecuteTriggers ( $_SESSION ['TASK'], 'DYNAFORM', $_GET ['UID'], 'AFTER', $Fields ['APP_DATA'] ); $aData = $oAdditionalTables->load( $oForm->fields[$oForm->fields[$sField]->pmconnection]->pmtable, true );
//Execute after triggers - End } catch (Exception $oError) {
} $aData = array ('FIELDS' => array ()
);
//save data in PM Tables if necessary }
$newValues = array (); $aKeys = array ();
foreach ( $_POST ['form'] as $sField => $sAux ) { $aAux = explode( '|', $oForm->fields[$oForm->fields[$sField]->pmconnection]->keys );
if (isset ( $oForm->fields [$sField]->pmconnection ) && isset ( $oForm->fields [$sField]->pmfield )) { $i = 0;
if (($oForm->fields [$sField]->pmconnection != '') && ($oForm->fields [$sField]->pmfield != '')) { $aValues = array ();
if (isset ( $oForm->fields [$oForm->fields [$sField]->pmconnection] )) { foreach ($aData['FIELDS'] as $aField) {
require_once PATH_CORE . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'AdditionalTables.php'; if ($aField['FLD_KEY'] == '1') {
$oAdditionalTables = new AdditionalTables ( ); $aKeys[$aField['FLD_NAME']] = (isset( $aAux[$i] ) ? G::replaceDataField( $aAux[$i], $Fields['APP_DATA'] ) : '');
try { $i ++;
$aData = $oAdditionalTables->load ( $oForm->fields [$oForm->fields [$sField]->pmconnection]->pmtable, true ); }
} catch ( Exception $oError ) { if ($aField['FLD_NAME'] == $oForm->fields[$sField]->pmfield) {
$aData = array ('FIELDS' => array () ); $aValues[$aField['FLD_NAME']] = $Fields['APP_DATA'][$sField];
} } else {
$aKeys = array (); $aValues[$aField['FLD_NAME']] = '';
$aAux = explode ( '|', $oForm->fields [$oForm->fields [$sField]->pmconnection]->keys ); }
$i = 0; }
$aValues = array (); try {
foreach ( $aData ['FIELDS'] as $aField ) { $aRow = $oAdditionalTables->getDataTable( $oForm->fields[$oForm->fields[$sField]->pmconnection]->pmtable, $aKeys );
if ($aField ['FLD_KEY'] == '1') { } catch (Exception $oError) {
$aKeys [$aField ['FLD_NAME']] = (isset ( $aAux [$i] ) ? G::replaceDataField ( $aAux [$i], $Fields ['APP_DATA'] ) : ''); $aRow = false;
$i ++; }
} if ($aRow) {
if ($aField ['FLD_NAME'] == $oForm->fields [$sField]->pmfield) { foreach ($aValues as $sKey => $sValue) {
$aValues [$aField ['FLD_NAME']] = $Fields ['APP_DATA'] [$sField]; if ($sKey != $oForm->fields[$sField]->pmfield) {
} else { $aValues[$sKey] = $aRow[$sKey];
$aValues [$aField ['FLD_NAME']] = ''; }
} }
} try {
try { $oAdditionalTables->updateDataInTable( $oForm->fields[$oForm->fields[$sField]->pmconnection]->pmtable, $aValues );
$aRow = $oAdditionalTables->getDataTable ( $oForm->fields [$oForm->fields [$sField]->pmconnection]->pmtable, $aKeys ); } catch (Exception $oError) {
} catch ( Exception $oError ) { //Nothing
$aRow = false; }
} } else {
if ($aRow) { try {
foreach ( $aValues as $sKey => $sValue ) { // assembling the field list in order to save the data ina new record of a pm table
if ($sKey != $oForm->fields [$sField]->pmfield) { if (empty( $newValues )) {
$aValues [$sKey] = $aRow [$sKey]; $newValues = $aValues;
} } else {
} foreach ($aValues as $aValueKey => $aValueCont) {
try { if (trim( $newValues[$aValueKey] ) == '') {
$oAdditionalTables->updateDataInTable ( $oForm->fields [$oForm->fields [$sField]->pmconnection]->pmtable, $aValues ); $newValues[$aValueKey] = $aValueCont;
} catch ( Exception $oError ) { }
//Nothing }
} }
} //$oAdditionalTables->saveDataInTable ( $oForm->fields [$oForm->fields [$sField]->pmconnection]->pmtable, $aValues );
else { } catch (Exception $oError) {
try { //Nothing
// assembling the field list in order to save the data ina new record of a pm table }
if (empty($newValues)){ }
$newValues = $aValues;
}
else {
foreach ($aValues as $aValueKey=>$aValueCont) {
if (trim($newValues[$aValueKey])==''){
$newValues[$aValueKey] = $aValueCont;
}
} }
}
//$oAdditionalTables->saveDataInTable ( $oForm->fields [$oForm->fields [$sField]->pmconnection]->pmtable, $aValues );
} catch ( Exception $oError ) {
//Nothing
} }
}
} }
}
} }
}
//save data //save data
$aData = array (); $aData = array ();
$aData ['APP_NUMBER'] = $Fields ['APP_NUMBER']; $aData['APP_NUMBER'] = $Fields['APP_NUMBER'];
$aData ['APP_PROC_STATUS'] = $Fields ['APP_PROC_STATUS']; $aData['APP_PROC_STATUS'] = $Fields['APP_PROC_STATUS'];
$aData ['APP_DATA'] = $Fields ['APP_DATA']; $aData['APP_DATA'] = $Fields['APP_DATA'];
$aData ['DEL_INDEX'] = $_SESSION ['INDEX']; $aData['DEL_INDEX'] = $_SESSION['INDEX'];
$aData ['TAS_UID'] = $_SESSION ['TASK']; $aData['TAS_UID'] = $_SESSION['TASK'];
$aData ['CURRENT_DYNAFORM'] = $_GET ['UID']; $aData['CURRENT_DYNAFORM'] = $_GET['UID'];
$aData ['USER_UID'] = $_SESSION ['USER_LOGGED']; $aData['USER_UID'] = $_SESSION['USER_LOGGED'];
$aData ['APP_STATUS'] = $Fields ['APP_STATUS']; $aData['APP_STATUS'] = $Fields['APP_STATUS'];
$aData ['PRO_UID'] = $_SESSION ['PROCESS']; $aData['PRO_UID'] = $_SESSION['PROCESS'];
$oCase->updateCase ( $_SESSION ['APPLICATION'], $aData ); $oCase->updateCase( $_SESSION['APPLICATION'], $aData );
// saving the data ina pm table in case that is a new record // saving the data ina pm table in case that is a new record
if (!empty($newValues)) { if (! empty( $newValues )) {
$id = key($newValues); $id = key( $newValues );
if (! $oAdditionalTables->updateDataInTable( $oForm->fields [$oForm->fields[$id]->pmconnection]->pmtable, $newValues) ) {//<--This is to know if it is a new registry on the PM Table if (! $oAdditionalTables->updateDataInTable( $oForm->fields[$oForm->fields[$id]->pmconnection]->pmtable, $newValues )) { //<--This is to know if it is a new registry on the PM Table
$oAdditionalTables->saveDataInTable( $oForm->fields [$oForm->fields[$id]->pmconnection]->pmtable, $newValues); $oAdditionalTables->saveDataInTable( $oForm->fields[$oForm->fields[$id]->pmconnection]->pmtable, $newValues );
}
} }
}
//Save files //Save files
require_once ("classes/model/AppDocument.php"); require_once ("classes/model/AppDocument.php");
if (isset($_FILES["form"]["name"]) && count($_FILES["form"]["name"]) > 0) { if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
$arrayField = array(); $arrayField = array ();
$arrayFileName = array(); $arrayFileName = array ();
$arrayFileTmpName = array(); $arrayFileTmpName = array ();
$arrayFileError = array(); $arrayFileError = array ();
$i = 0; $i = 0;
foreach ($_FILES["form"]["name"] as $fieldIndex => $fieldValue) { foreach ($_FILES["form"]["name"] as $fieldIndex => $fieldValue) {
if (is_array($fieldValue)) { if (is_array( $fieldValue )) {
foreach ($fieldValue as $index => $value) { foreach ($fieldValue as $index => $value) {
if (is_array($value)) { if (is_array( $value )) {
foreach ($value as $grdFieldIndex => $grdFieldValue) { foreach ($value as $grdFieldIndex => $grdFieldValue) {
$arrayField[$i]["grdName"] = $fieldIndex; $arrayField[$i]["grdName"] = $fieldIndex;
$arrayField[$i]["grdFieldName"] = $grdFieldIndex; $arrayField[$i]["grdFieldName"] = $grdFieldIndex;
$arrayField[$i]["index"] = $index; $arrayField[$i]["index"] = $index;
$arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex][$index][$grdFieldIndex]; $arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex][$index][$grdFieldIndex];
$arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex][$index][$grdFieldIndex]; $arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex][$index][$grdFieldIndex];
$arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex][$index][$grdFieldIndex]; $arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex][$index][$grdFieldIndex];
$i = $i + 1; $i = $i + 1;
} }
} }
} }
} else { } else {
$arrayField[$i] = $fieldIndex; $arrayField[$i] = $fieldIndex;
$arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex]; $arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex];
$arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex]; $arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex];
$arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex]; $arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex];
$i = $i + 1; $i = $i + 1;
} }
} }
if (count($arrayField) > 0) { if (count( $arrayField ) > 0) {
for ($i = 0; $i <= count($arrayField) - 1; $i++) { for ($i = 0; $i <= count( $arrayField ) - 1; $i ++) {
if ($arrayFileError[$i] == 0) { if ($arrayFileError[$i] == 0) {
$indocUid = null; $indocUid = null;
$fieldName = null; $fieldName = null;
if (is_array($arrayField[$i])) { if (is_array( $arrayField[$i] )) {
if (isset($_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]]) && if (isset( $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]] ) && ! empty( $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]] )) {
!empty($_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]]) $indocUid = $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]];
) { }
$indocUid = $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]];
}
$fieldName = $arrayField[$i]["grdName"] . "_" . $arrayField[$i]["index"] . "_" . $arrayField[$i]["grdFieldName"]; $fieldName = $arrayField[$i]["grdName"] . "_" . $arrayField[$i]["index"] . "_" . $arrayField[$i]["grdFieldName"];
} else { } else {
if (isset($_POST["INPUTS"][$arrayField[$i]]) && if (isset( $_POST["INPUTS"][$arrayField[$i]] ) && ! empty( $_POST["INPUTS"][$arrayField[$i]] )) {
!empty($_POST["INPUTS"][$arrayField[$i]]) $indocUid = $_POST["INPUTS"][$arrayField[$i]];
) { }
$indocUid = $_POST["INPUTS"][$arrayField[$i]];
}
$fieldName = $arrayField[$i]; $fieldName = $arrayField[$i];
} }
if ($indocUid != null) { if ($indocUid != null) {
require_once ("classes/model/AppFolder.php"); require_once ("classes/model/AppFolder.php");
require_once ("classes/model/InputDocument.php"); require_once ("classes/model/InputDocument.php");
$oInputDocument = new InputDocument(); $oInputDocument = new InputDocument();
$aID = $oInputDocument->load($indocUid); $aID = $oInputDocument->load( $indocUid );
//Get the Custom Folder ID (create if necessary) //Get the Custom Folder ID (create if necessary)
$oFolder = new AppFolder(); $oFolder = new AppFolder();
$aFields = array ( $aFields = array ("APP_UID" => $_SESSION["APPLICATION"],"DEL_INDEX" => $_SESSION["INDEX"],"USR_UID" => $_SESSION["USER_LOGGED"],"DOC_UID" => $indocUid,"APP_DOC_TYPE" => "INPUT","APP_DOC_CREATE_DATE" => date( "Y-m-d H:i:s" ),"APP_DOC_COMMENT" => "","APP_DOC_TITLE" => "","APP_DOC_FILENAME" => $arrayFileName[$i],"FOLDER_UID" => $oFolder->createFromPath( $aID["INP_DOC_DESTINATION_PATH"] ),"APP_DOC_TAGS" => $oFolder->parseTags( $aID["INP_DOC_TAGS"] ),"APP_DOC_FIELDNAME" => $fieldName
"APP_UID" => $_SESSION["APPLICATION"], );
"DEL_INDEX" => $_SESSION["INDEX"], } else {
"USR_UID" => $_SESSION["USER_LOGGED"], $aFields = array ("APP_UID" => $_SESSION["APPLICATION"],"DEL_INDEX" => $_SESSION["INDEX"],"USR_UID" => $_SESSION["USER_LOGGED"],"DOC_UID" => - 1,"APP_DOC_TYPE" => "ATTACHED","APP_DOC_CREATE_DATE" => date( "Y-m-d H:i:s" ),"APP_DOC_COMMENT" => "","APP_DOC_TITLE" => "","APP_DOC_FILENAME" => $arrayFileName[$i],"APP_DOC_FIELDNAME" => $fieldName
"DOC_UID" => $indocUid, );
"APP_DOC_TYPE" => "INPUT", }
"APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"),
"APP_DOC_COMMENT" => "",
"APP_DOC_TITLE" => "",
"APP_DOC_FILENAME" => $arrayFileName[$i],
"FOLDER_UID" => $oFolder->createFromPath($aID["INP_DOC_DESTINATION_PATH"]),
"APP_DOC_TAGS" => $oFolder->parseTags($aID["INP_DOC_TAGS"]),
"APP_DOC_FIELDNAME" => $fieldName
);
} else {
$aFields = array (
"APP_UID" => $_SESSION["APPLICATION"],
"DEL_INDEX" => $_SESSION["INDEX"],
"USR_UID" => $_SESSION["USER_LOGGED"],
"DOC_UID" => -1,
"APP_DOC_TYPE" => "ATTACHED",
"APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"),
"APP_DOC_COMMENT" => "",
"APP_DOC_TITLE" => "",
"APP_DOC_FILENAME" => $arrayFileName[$i],
"APP_DOC_FIELDNAME" => $fieldName
);
}
$oAppDocument = new AppDocument(); $oAppDocument = new AppDocument();
$oAppDocument->create($aFields); $oAppDocument->create( $aFields );
$iDocVersion = $oAppDocument->getDocVersion(); $iDocVersion = $oAppDocument->getDocVersion();
$sAppDocUid = $oAppDocument->getAppDocUid(); $sAppDocUid = $oAppDocument->getAppDocUid();
$aInfo = pathinfo($oAppDocument->getAppDocFilename()); $aInfo = pathinfo( $oAppDocument->getAppDocFilename() );
$sExtension = ((isset($aInfo["extension"]))? $aInfo["extension"] : ""); $sExtension = ((isset( $aInfo["extension"] )) ? $aInfo["extension"] : "");
$sPathName = PATH_DOCUMENT . $_SESSION ["APPLICATION"] . PATH_SEP; $sPathName = PATH_DOCUMENT . $_SESSION["APPLICATION"] . PATH_SEP;
$sFileName = $sAppDocUid . "_" . $iDocVersion . "." . $sExtension; $sFileName = $sAppDocUid . "_" . $iDocVersion . "." . $sExtension;
G::uploadFile($arrayFileTmpName[$i], $sPathName, $sFileName); G::uploadFile( $arrayFileTmpName[$i], $sPathName, $sFileName );
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document //Plugin Hook PM_UPLOAD_DOCUMENT for upload document
$oPluginRegistry = &PMPluginRegistry::getSingleton(); $oPluginRegistry = &PMPluginRegistry::getSingleton();
if ($oPluginRegistry->existsTrigger(PM_UPLOAD_DOCUMENT) && class_exists("uploadDocumentData")) { if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT ) && class_exists( "uploadDocumentData" )) {
$triggerDetail = $oPluginRegistry->getTriggerInfo(PM_UPLOAD_DOCUMENT); $triggerDetail = $oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT );
$documentData = new uploadDocumentData($_SESSION["APPLICATION"], $_SESSION["USER_LOGGED"], $sPathName . $sFileName, $aFields["APP_DOC_FILENAME"], $sAppDocUid, $iDocVersion); $documentData = new uploadDocumentData( $_SESSION["APPLICATION"], $_SESSION["USER_LOGGED"], $sPathName . $sFileName, $aFields["APP_DOC_FILENAME"], $sAppDocUid, $iDocVersion );
$uploadReturn = $oPluginRegistry->executeTriggers(PM_UPLOAD_DOCUMENT, $documentData); $uploadReturn = $oPluginRegistry->executeTriggers( PM_UPLOAD_DOCUMENT, $documentData );
if ($uploadReturn) { if ($uploadReturn) {
$aFields["APP_DOC_PLUGIN"] = $triggerDetail->sNamespace; $aFields["APP_DOC_PLUGIN"] = $triggerDetail->sNamespace;
if (!isset($aFields["APP_DOC_UID"])) { if (! isset( $aFields["APP_DOC_UID"] )) {
$aFields["APP_DOC_UID"] = $sAppDocUid; $aFields["APP_DOC_UID"] = $sAppDocUid;
} }
if (!isset($aFields["DOC_VERSION"])) { if (! isset( $aFields["DOC_VERSION"] )) {
$aFields["DOC_VERSION"] = $iDocVersion; $aFields["DOC_VERSION"] = $iDocVersion;
} }
$oAppDocument->update($aFields); $oAppDocument->update( $aFields );
unlink($sPathName . $sFileName); unlink( $sPathName . $sFileName );
} }
} }
} }
} }
} }
} }
//Go to the next step //Go to the next step
$aNextStep = $oCase->getNextStep ( $_SESSION ['PROCESS'], $_SESSION ['APPLICATION'], $_SESSION ['INDEX'], $_SESSION ['STEP_POSITION'] ); $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
if (isset ( $_GET ['_REFRESH_'] )) { if (isset( $_GET['_REFRESH_'] )) {
G::header ( 'location: ' . $_SERVER ['HTTP_REFERER'] ); G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die (); die();
} }
$_SESSION ['STEP_POSITION'] = $aNextStep ['POSITION']; $_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep ['PAGE']; $_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep['PAGE'];
$debuggerAvailable = true; $debuggerAvailable = true;
if (isset($_SESSION['current_ux']) && $_SESSION['current_ux'] == 'SIMPLIFIED') { if (isset( $_SESSION['current_ux'] ) && $_SESSION['current_ux'] == 'SIMPLIFIED') {
$debuggerAvailable = false; $debuggerAvailable = false;
} }
if ($trigger_debug_session && $debuggerAvailable) { if ($trigger_debug_session && $debuggerAvailable) {
$_SESSION ['TRIGGER_DEBUG'] ['BREAKPAGE'] = $aNextStep ['PAGE']; $_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
$aNextStep ['PAGE'] = $aNextStep ['PAGE'] . '&breakpoint=triggerdebug'; $aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
} }
$oForm->validatePost (); $oForm->validatePost();
$oJSON = new Services_JSON ( ); $oJSON = new Services_JSON();
$_POST ['__notValidateThisFields__'] = (isset($_POST ['__notValidateThisFields__']) && $_POST ['__notValidateThisFields__']!='')?$_POST ['__notValidateThisFields__']:$_POST ['DynaformRequiredFields']; $_POST['__notValidateThisFields__'] = (isset( $_POST['__notValidateThisFields__'] ) && $_POST['__notValidateThisFields__'] != '') ? $_POST['__notValidateThisFields__'] : $_POST['DynaformRequiredFields'];
if ($missing_req_values = $oForm->validateRequiredFields ( $_POST ['form'], $oJSON->decode ( stripslashes ( $_POST ['__notValidateThisFields__'] ) ) )) { if ($missing_req_values = $oForm->validateRequiredFields( $_POST['form'], $oJSON->decode( stripslashes( $_POST['__notValidateThisFields__'] ) ) )) {
$_POST ['next_step'] = $aNextStep; $_POST['next_step'] = $aNextStep;
$_POST ['previous_step'] = $oCase->getPreviousStep ( $_SESSION ['PROCESS'], $_SESSION ['APPLICATION'], $_SESSION ['INDEX'], $_SESSION ['STEP_POSITION'] ); $_POST['previous_step'] = $oCase->getPreviousStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
$_POST ['req_val'] = $missing_req_values; $_POST['req_val'] = $missing_req_values;
$G_PUBLISH = new Publisher ( ); $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent ( 'view', 'cases/missRequiredFields' ); $G_PUBLISH->AddContent( 'view', 'cases/missRequiredFields' );
G::RenderPage ( 'publish', 'blank' ); G::RenderPage( 'publish', 'blank' );
exit ( 0 ); exit( 0 );
} }
G::header ( 'location: ' . $aNextStep ['PAGE'] ); G::header( 'location: ' . $aNextStep['PAGE'] );
} catch (Exception $e) {
$G_PUBLISH = new Publisher();
$aMessage = array ();
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
die();
} }
catch (Exception $e) {
$G_PUBLISH = new Publisher;
$aMessage = array();
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
die;
}

View File

@@ -1,57 +1,55 @@
<?php <?php
/** /**
* cases_SaveData.php * cases_SaveData.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ //validate the data post
//validate the data post $oForm = new Form( $_SESSION['PROCESS'] . '/' . $_GET['UID'], PATH_DYNAFORM );
$oForm = new Form($_SESSION['PROCESS']. '/' . $_GET['UID'], PATH_DYNAFORM); $oForm->validatePost();
$oForm->validatePost();
/* Includes */
G::LoadClass( 'case' );
//load the variables
$oCase = new Cases();
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], $_POST['form'] );
//save data
$aData = array ();
$aData['APP_NUMBER'] = $Fields['APP_NUMBER'];
$aData['APP_PROC_STATUS'] = $Fields['APP_PROC_STATUS'];
$aData['APP_DATA'] = $Fields['APP_DATA'];
$aData['DEL_INDEX'] = $_SESSION['INDEX'];
$aData['TAS_UID'] = $_SESSION['TASK'];
$aData['CURRENT_DYNAFORM'] = $_GET['UID'];
$aData['PRO_UID'] = $Fields['PRO_UID'];
$aData['USER_UID'] = $_SESSION['USER_LOGGED'];
$aData['APP_STATUS'] = $Fields['APP_STATUS'];
//$aData = $oCase->loadCase( $_SESSION['APPLICATION'] );
$oCase->updateCase( $_SESSION['APPLICATION'], $aData );
//go to the next step
$aNextStep = $oCase->getNextSupervisorStep( $_SESSION['PROCESS'], $_SESSION['STEP_POSITION'] );
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
G::header( 'location: cases_StepToRevise?DYN_UID=' . $aNextStep['UID'] . '&APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] );
/* Includes */
G::LoadClass('case');
//load the variables
$oCase = new Cases();
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], $_POST['form']);
//save data
$aData = array();
$aData['APP_NUMBER'] = $Fields['APP_NUMBER'];
$aData['APP_PROC_STATUS'] = $Fields['APP_PROC_STATUS'];
$aData['APP_DATA'] = $Fields['APP_DATA'];
$aData['DEL_INDEX'] = $_SESSION['INDEX'];
$aData['TAS_UID'] = $_SESSION['TASK'];
$aData['CURRENT_DYNAFORM'] = $_GET['UID'];
$aData['PRO_UID'] = $Fields['PRO_UID'];
$aData['USER_UID'] = $_SESSION['USER_LOGGED'];
$aData['APP_STATUS'] = $Fields['APP_STATUS'];
//$aData = $oCase->loadCase( $_SESSION['APPLICATION'] );
$oCase->updateCase( $_SESSION['APPLICATION'], $aData );
//go to the next step
$aNextStep = $oCase->getNextSupervisorStep($_SESSION['PROCESS'], $_SESSION['STEP_POSITION']);
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
G::header('location: cases_StepToRevise?DYN_UID='.$aNextStep['UID'].'&APP_UID='.$_SESSION['APPLICATION'].'&DEL_INDEX='.$_SESSION['INDEX']);

View File

@@ -1,297 +1,251 @@
<?php <?php
/** /**
* cases_SaveDocument.php * cases_SaveDocument.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ //try {
//try {
//First review if there is no error with the uploaded document //First review if there is no error with the uploaded document
if ((isset($_FILES['form']))&&($_FILES['form']['error']['APP_DOC_FILENAME'] != 0)) { if ((isset( $_FILES['form'] )) && ($_FILES['form']['error']['APP_DOC_FILENAME'] != 0)) {
$code=$_FILES['form']['error']['APP_DOC_FILENAME']; $code = $_FILES['form']['error']['APP_DOC_FILENAME'];
switch ($code) { switch ($code) {
case UPLOAD_ERR_INI_SIZE: case UPLOAD_ERR_INI_SIZE:
$message = G::LoadTranslation('ID_UPLOAD_ERR_INI_SIZE'); $message = G::LoadTranslation( 'ID_UPLOAD_ERR_INI_SIZE' );
break; break;
case UPLOAD_ERR_FORM_SIZE: case UPLOAD_ERR_FORM_SIZE:
$message = G::LoadTranslation('ID_UPLOAD_ERR_FORM_SIZE'); $message = G::LoadTranslation( 'ID_UPLOAD_ERR_FORM_SIZE' );
break; break;
case UPLOAD_ERR_PARTIAL: case UPLOAD_ERR_PARTIAL:
$message = G::LoadTranslation('ID_UPLOAD_ERR_PARTIAL'); $message = G::LoadTranslation( 'ID_UPLOAD_ERR_PARTIAL' );
break; break;
case UPLOAD_ERR_NO_FILE: case UPLOAD_ERR_NO_FILE:
$message = G::LoadTranslation('ID_UPLOAD_ERR_NO_FILE'); $message = G::LoadTranslation( 'ID_UPLOAD_ERR_NO_FILE' );
break; break;
case UPLOAD_ERR_NO_TMP_DIR: case UPLOAD_ERR_NO_TMP_DIR:
$message = G::LoadTranslation('ID_UPLOAD_ERR_NO_TMP_DIR'); $message = G::LoadTranslation( 'ID_UPLOAD_ERR_NO_TMP_DIR' );
break; break;
case UPLOAD_ERR_CANT_WRITE: case UPLOAD_ERR_CANT_WRITE:
$message = G::LoadTranslation('ID_UPLOAD_ERR_CANT_WRITE'); $message = G::LoadTranslation( 'ID_UPLOAD_ERR_CANT_WRITE' );
break; break;
case UPLOAD_ERR_EXTENSION: case UPLOAD_ERR_EXTENSION:
$message = G::LoadTranslation('ID_UPLOAD_ERR_EXTENSION'); $message = G::LoadTranslation( 'ID_UPLOAD_ERR_EXTENSION' );
break; break;
default: default:
$message = G::LoadTranslation('ID_UPLOAD_ERR_UNKNOWN'); $message = G::LoadTranslation( 'ID_UPLOAD_ERR_UNKNOWN' );
break; break;
} }
G::SendMessageText($message, "ERROR"); G::SendMessageText( $message, "ERROR" );
$backUrlObj=explode("sys".SYS_SYS,$_SERVER['HTTP_REFERER']); $backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
G::header("location: "."/sys".SYS_SYS.$backUrlObj[1]); G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
die; die();
} }
$docUid = $_POST['form']['DOC_UID'];
$docUid=$_POST['form']['DOC_UID']; $appDocUid = $_POST['form']['APP_DOC_UID'];
$appDocUid=$_POST['form']['APP_DOC_UID']; $docVersion = $_POST['form']['docVersion'];
$docVersion=$_POST['form']['docVersion']; $actionType = $_POST['form']['actionType'];
$actionType=$_POST['form']['actionType'];
//load the variables
G::LoadClass( 'case' );
//load the variables $oCase = new Cases();
G::LoadClass('case'); $oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List' );
$oCase = new Cases(); $Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$oCase->thisIsTheCurrentUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List'); $Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], G::getSystemConstants() );
$Fields = $oCase->loadCase($_SESSION['APPLICATION']);
$Fields['APP_DATA'] = array_merge($Fields['APP_DATA'], G::getSystemConstants()); #trigger debug routines...
#trigger debug routines...
//cleaning debug variables
//cleaning debug variables $_SESSION['TRIGGER_DEBUG']['ERRORS'] = Array ();
$_SESSION['TRIGGER_DEBUG']['ERRORS'] = Array(); $_SESSION['TRIGGER_DEBUG']['DATA'] = Array ();
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array(); $_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array(); $_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array ();
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array();
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'INPUT_DOCUMENT', $_GET['UID'], 'AFTER' );
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'INPUT_DOCUMENT', $_GET['UID'], 'AFTER');
$_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] = count( $triggers );
$_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] = count($triggers); $_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER';
$_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER'; if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) {
if($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0){ $_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers );
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = $oCase->getTriggerNames($triggers); $_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = $triggers;
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = $triggers; }
}
if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) {
if( $_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0 ) { //Execute after triggers - Start
//Execute after triggers - Start $Fields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'INPUT_DOCUMENT', $_GET['UID'], 'AFTER', $Fields['APP_DATA'] );
$Fields['APP_DATA'] = $oCase->ExecuteTriggers ( $_SESSION['TASK'], 'INPUT_DOCUMENT', $_GET['UID'], 'AFTER', $Fields['APP_DATA'] );
//Execute after triggers - End //Execute after triggers - End
} }
//save data
//save data $aData = array ();
$aData = array(); $aData['APP_NUMBER'] = $Fields['APP_NUMBER'];
$aData['APP_NUMBER'] = $Fields['APP_NUMBER']; $aData['APP_PROC_STATUS'] = $Fields['APP_PROC_STATUS'];
$aData['APP_PROC_STATUS'] = $Fields['APP_PROC_STATUS']; $aData['APP_DATA'] = $Fields['APP_DATA'];
$aData['APP_DATA'] = $Fields['APP_DATA']; $aData['DEL_INDEX'] = $_SESSION['INDEX'];
$aData['DEL_INDEX'] = $_SESSION['INDEX']; $aData['TAS_UID'] = $_SESSION['TASK'];
$aData['TAS_UID'] = $_SESSION['TASK']; //$aData = $oCase->loadCase($_SESSION['APPLICATION']);
//$aData = $oCase->loadCase($_SESSION['APPLICATION']); $oCase->updateCase( $_SESSION['APPLICATION'], $aData );
$oCase->updateCase( $_SESSION['APPLICATION'], $aData );
//save info
//save info
require_once ( "classes/model/AppDocument.php" ); require_once ("classes/model/AppDocument.php");
require_once ('classes/model/AppFolder.php'); require_once ('classes/model/AppFolder.php');
require_once ('classes/model/InputDocument.php'); require_once ('classes/model/InputDocument.php');
$oInputDocument = new InputDocument(); $oInputDocument = new InputDocument();
$aID = $oInputDocument->load($_GET['UID']); $aID = $oInputDocument->load( $_GET['UID'] );
$oAppDocument = new AppDocument();
$oAppDocument = new AppDocument();
//Get the Custom Folder ID (create if necessary)
$oFolder = new AppFolder();
//Get the Custom Folder ID (create if necessary) $folderId = $oFolder->createFromPath( $aID['INP_DOC_DESTINATION_PATH'] );
$oFolder=new AppFolder();
$folderId=$oFolder->createFromPath($aID['INP_DOC_DESTINATION_PATH']); //Tags
$fileTags = $oFolder->parseTags( $aID['INP_DOC_TAGS'] );
//Tags
$fileTags=$oFolder->parseTags($aID['INP_DOC_TAGS']); switch ($actionType) {
case "R": //replace
switch($actionType){ $aFields = array ('APP_DOC_UID' => $appDocUid,'APP_UID' => $_SESSION['APPLICATION'],'DOC_VERSION' => $docVersion,'DEL_INDEX' => $_SESSION['INDEX'],'USR_UID' => $_SESSION['USER_LOGGED'],'DOC_UID' => $docUid,'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],'APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_COMMENT' => isset( $_POST['form']['APP_DOC_COMMENT'] ) ? $_POST['form']['APP_DOC_COMMENT'] : '','APP_DOC_TITLE' => '','APP_DOC_FILENAME' => isset( $_FILES['form']['name']['APP_DOC_FILENAME'] ) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '','FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags
case "R": //replace );
$aFields = array('APP_DOC_UID' => $appDocUid,
'APP_UID' => $_SESSION['APPLICATION'], $oAppDocument->update( $aFields );
'DOC_VERSION' => $docVersion, break;
'DEL_INDEX' => $_SESSION['INDEX'], case "NV": //New Version
'USR_UID' => $_SESSION['USER_LOGGED'],
'DOC_UID' => $docUid,
'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'], $aFields = array ('APP_DOC_UID' => $appDocUid,'APP_UID' => $_SESSION['APPLICATION'],'DEL_INDEX' => $_SESSION['INDEX'],'USR_UID' => $_SESSION['USER_LOGGED'],'DOC_UID' => $docUid,'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],'APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_COMMENT' => isset( $_POST['form']['APP_DOC_COMMENT'] ) ? $_POST['form']['APP_DOC_COMMENT'] : '','APP_DOC_TITLE' => '','APP_DOC_FILENAME' => isset( $_FILES['form']['name']['APP_DOC_FILENAME'] ) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '','FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags
'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), );
'APP_DOC_COMMENT' => isset($_POST['form']['APP_DOC_COMMENT']) ? $_POST['form']['APP_DOC_COMMENT'] : '',
'APP_DOC_TITLE' => '', $oAppDocument->create( $aFields );
'APP_DOC_FILENAME' => isset($_FILES['form']['name']['APP_DOC_FILENAME']) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '', break;
'FOLDER_UID' => $folderId, default: //New
'APP_DOC_TAGS' => $fileTags); $aFields = array ('APP_UID' => $_SESSION['APPLICATION'],'DEL_INDEX' => $_SESSION['INDEX'],'USR_UID' => $_SESSION['USER_LOGGED'],'DOC_UID' => $docUid,'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],'APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_COMMENT' => isset( $_POST['form']['APP_DOC_COMMENT'] ) ? $_POST['form']['APP_DOC_COMMENT'] : '','APP_DOC_TITLE' => '','APP_DOC_FILENAME' => isset( $_FILES['form']['name']['APP_DOC_FILENAME'] ) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '','FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags
);
$oAppDocument->update($aFields); $oAppDocument->create( $aFields );
break; break;
case "NV": //New Version }
$sAppDocUid = $oAppDocument->getAppDocUid();
$aFields = array('APP_DOC_UID' => $appDocUid, $iDocVersion = $oAppDocument->getDocVersion();
'APP_UID' => $_SESSION['APPLICATION'], $info = pathinfo( $oAppDocument->getAppDocFilename() );
'DEL_INDEX' => $_SESSION['INDEX'], $ext = (isset( $info['extension'] ) ? $info['extension'] : '');
'USR_UID' => $_SESSION['USER_LOGGED'],
'DOC_UID' => $docUid, //save the file
'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'], if (! empty( $_FILES['form'] )) {
'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), if ($_FILES['form']['error']['APP_DOC_FILENAME'] == 0) {
'APP_DOC_COMMENT' => isset($_POST['form']['APP_DOC_COMMENT']) ? $_POST['form']['APP_DOC_COMMENT'] : '', $sPathName = PATH_DOCUMENT . $_SESSION['APPLICATION'] . PATH_SEP;
'APP_DOC_TITLE' => '', $sFileName = $sAppDocUid . "_" . $iDocVersion . '.' . $ext;
'APP_DOC_FILENAME' => isset($_FILES['form']['name']['APP_DOC_FILENAME']) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '', G::uploadFile( $_FILES['form']['tmp_name']['APP_DOC_FILENAME'], $sPathName, $sFileName );
'FOLDER_UID' => $folderId,
'APP_DOC_TAGS' => $fileTags);
$oAppDocument->create($aFields);
break;
default: //New
$aFields = array(
'APP_UID' => $_SESSION['APPLICATION'],
'DEL_INDEX' => $_SESSION['INDEX'],
'USR_UID' => $_SESSION['USER_LOGGED'],
'DOC_UID' => $docUid,
'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],
'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'),
'APP_DOC_COMMENT' => isset($_POST['form']['APP_DOC_COMMENT']) ? $_POST['form']['APP_DOC_COMMENT'] : '',
'APP_DOC_TITLE' => '',
'APP_DOC_FILENAME' => isset($_FILES['form']['name']['APP_DOC_FILENAME']) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '',
'FOLDER_UID' => $folderId,
'APP_DOC_TAGS' => $fileTags);
$oAppDocument->create($aFields);
break;
}
$sAppDocUid = $oAppDocument->getAppDocUid();
$iDocVersion = $oAppDocument->getDocVersion();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
$ext = (isset($info['extension']) ? $info['extension'] : '');
//save the file
if (!empty($_FILES['form'])) {
if ($_FILES['form']['error']['APP_DOC_FILENAME'] == 0) {
$sPathName = PATH_DOCUMENT . $_SESSION['APPLICATION'] . PATH_SEP;
$sFileName = $sAppDocUid . "_".$iDocVersion. '.' . $ext;
G::uploadFile($_FILES['form']['tmp_name']['APP_DOC_FILENAME'], $sPathName, $sFileName );
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document //Plugin Hook PM_UPLOAD_DOCUMENT for upload document
$oPluginRegistry =& PMPluginRegistry::getSingleton(); $oPluginRegistry = & PMPluginRegistry::getSingleton();
if ( $oPluginRegistry->existsTrigger ( PM_UPLOAD_DOCUMENT ) && class_exists ('uploadDocumentData' ) ) { if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT ) && class_exists( 'uploadDocumentData' )) {
$triggerDetail=$oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT ); $triggerDetail = $oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT );
$oData['APP_UID'] = $_SESSION['APPLICATION']; $oData['APP_UID'] = $_SESSION['APPLICATION'];
$documentData = new uploadDocumentData ( $documentData = new uploadDocumentData( $_SESSION['APPLICATION'], $_SESSION['USER_LOGGED'], $sPathName . $sFileName, $aFields['APP_DOC_FILENAME'], $sAppDocUid, $iDocVersion );
$_SESSION['APPLICATION'],
$_SESSION['USER_LOGGED'], $uploadReturn = $oPluginRegistry->executeTriggers( PM_UPLOAD_DOCUMENT, $documentData );
$sPathName . $sFileName, if ($uploadReturn) {
$aFields['APP_DOC_FILENAME'], $aFields['APP_DOC_PLUGIN'] = $triggerDetail->sNamespace;
$sAppDocUid, if (! isset( $aFields['APP_DOC_UID'] )) {
$iDocVersion $aFields['APP_DOC_UID'] = $sAppDocUid;
); }
if (! isset( $aFields['DOC_VERSION'] )) {
$uploadReturn=$oPluginRegistry->executeTriggers ( PM_UPLOAD_DOCUMENT , $documentData ); $aFields['DOC_VERSION'] = $iDocVersion;
if($uploadReturn){ }
$aFields['APP_DOC_PLUGIN']=$triggerDetail->sNamespace; //$oAppDocument1 = new AppDocument();
if(!isset($aFields['APP_DOC_UID'])){ //G::pr($aFields);die;
$aFields['APP_DOC_UID']=$sAppDocUid; $oAppDocument->update( $aFields );
} unlink( $sPathName . $sFileName );
if(!isset($aFields['DOC_VERSION'])){ }
$aFields['DOC_VERSION']=$iDocVersion; }
} //end plugin
//$oAppDocument1 = new AppDocument(); }
//G::pr($aFields);die; }
$oAppDocument->update($aFields);
unlink ( $sPathName . $sFileName ); //go to the next step
} //if (!isset($_POST['form']['MORE'])) {
} if (false) {
//end plugin $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
} $_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
}
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
//go to the next step $_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
//if (!isset($_POST['form']['MORE'])) { G::header( 'location: ' . $aNextStep['PAGE'] . '&breakpoint=triggerdebug' );
if (false) { die();
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']); }
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
G::header( 'location: ' . $aNextStep['PAGE'] );
if($_SESSION['TRIGGER_DEBUG']['ISSET']){ die();
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE']; } else {
G::header('location: ' . $aNextStep['PAGE'].'&breakpoint=triggerdebug'); if (isset( $_SERVER['HTTP_REFERER'] )) {
die; if ($_SERVER['HTTP_REFERER'] != '') {
}
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
G::header('location: ' . $aNextStep['PAGE']); $_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $_SERVER['HTTP_REFERER'];
die; G::header( 'location: ' . $_SERVER['HTTP_REFERER'] . '&breakpoint=triggerdebug' );
} die();
else { }
if (isset($_SERVER['HTTP_REFERER'])) {
if ($_SERVER['HTTP_REFERER'] != '') { G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die();
if($_SESSION['TRIGGER_DEBUG']['ISSET']){ } else {
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $_SERVER['HTTP_REFERER']; $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1 );
G::header('location: ' . $_SERVER['HTTP_REFERER'].'&breakpoint=triggerdebug'); $_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
die;
} if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
G::header('location: ' . $_SERVER['HTTP_REFERER']); G::header( 'location: ' . $aNextStep['PAGE'] . '&breakpoint=triggerdebug' );
die; die();
} }
else {
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1); G::header( 'location: ' . $aNextStep['PAGE'] );
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION']; die();
}
if($_SESSION['TRIGGER_DEBUG']['ISSET']){ } else {
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE']; $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1 );
G::header('location: ' . $aNextStep['PAGE'].'&breakpoint=triggerdebug'); $_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
die;
} if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
G::header('location: ' . $aNextStep['PAGE']); G::header( 'location: ' . $aNextStep['PAGE'] . '&breakpoint=triggerdebug' );
die; die();
} }
}
else { G::header( 'location: ' . $aNextStep['PAGE'] );
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1); die();
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION']; }
}
if($_SESSION['TRIGGER_DEBUG']['ISSET']){ $_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep;
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
G::header('location: ' . $aNextStep['PAGE'].'&breakpoint=triggerdebug');
die;
}
G::header('location: ' . $aNextStep['PAGE']);
die;
}
}
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep;
/* /*
} catch ( Exception $e ) { } catch ( Exception $e ) {
$aMessage['MESSAGE'] = $e->getMessage(); $aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage ); $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish' ); G::RenderPage( 'publish' );
}*/ }*/

View File

@@ -1,71 +1,77 @@
<?php <?php
if (! isset ( $_REQUEST ['action'] )) { if (! isset( $_REQUEST['action'] )) {
$return ['success'] = 'failure'; $return['success'] = 'failure';
$return ['message'] = 'You may request an action'; $return['message'] = 'You may request an action';
print G::json_encode ( $return ); print G::json_encode( $return );
die (); die();
} }
if (! function_exists ( $_REQUEST ['action'] )) { if (! function_exists( $_REQUEST['action'] )) {
$return ['success'] = 'failure'; $return['success'] = 'failure';
$return ['message'] = 'The requested action doesn\'t exists'; $return['message'] = 'The requested action doesn\'t exists';
print G::json_encode ( $return ); print G::json_encode( $return );
die (); die();
} }
$functionName = $_REQUEST ['action']; $functionName = $_REQUEST['action'];
//var_dump($functionName); //var_dump($functionName);
$functionParams = isset($_REQUEST ['params'] ) ? $_REQUEST ['params'] : array (); $functionParams = isset( $_REQUEST['params'] ) ? $_REQUEST['params'] : array ();
$functionName( $functionParams );
$functionName ( $functionParams );
function searchSavedJob ($schUid)
function searchSavedJob($schUid){ {
} }
function pluginsList(){ function pluginsList ()
$oPluginRegistry =& PMPluginRegistry::getSingleton(); {
$activePluginsForCaseScheduler=$oPluginRegistry->getCaseSchedulerPlugins(); $oPluginRegistry = & PMPluginRegistry::getSingleton();
$selectedPlugin=""; $activePluginsForCaseScheduler = $oPluginRegistry->getCaseSchedulerPlugins();
if((isset($_REQUEST['plg_uid']))&&($_REQUEST['plg_uid']!="")) $selectedPlugin=$_REQUEST['plg_uid']; $selectedPlugin = "";
if(!empty($activePluginsForCaseScheduler)){ if ((isset( $_REQUEST['plg_uid'] )) && ($_REQUEST['plg_uid'] != ""))
echo '<select style="width: 300px;" name="form[CASE_SH_PLUGIN_UID]" id="form[CASE_SH_PLUGIN_UID]" class="module_app_input___gray" required="1" onChange="showPluginSelection(this.options[this.selectedIndex].value,getField(\'PRO_UID\').value)">'; $selectedPlugin = $_REQUEST['plg_uid'];
echo "<option value=\"\">- Select -</option>"; if (! empty( $activePluginsForCaseScheduler )) {
foreach($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail){ echo '<select style="width: 300px;" name="form[CASE_SH_PLUGIN_UID]" id="form[CASE_SH_PLUGIN_UID]" class="module_app_input___gray" required="1" onChange="showPluginSelection(this.options[this.selectedIndex].value,getField(\'PRO_UID\').value)">';
$sActionId=$caseSchedulerPluginDetail->sActionId; echo "<option value=\"\">- Select -</option>";
$sNamespace=$caseSchedulerPluginDetail->sNamespace; foreach ($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail) {
$optionId=$sNamespace."--".$sActionId; $sActionId = $caseSchedulerPluginDetail->sActionId;
$selectedOption=""; $sNamespace = $caseSchedulerPluginDetail->sNamespace;
if($selectedPlugin==$optionId) $selectedOption="selected"; $optionId = $sNamespace . "--" . $sActionId;
echo "<option value=\"$optionId\" $selectedOption>".$sActionId."</option>"; $selectedOption = "";
} if ($selectedPlugin == $optionId)
echo '</select>'; $selectedOption = "selected";
//G::pr($activePlugnsForCaseScheduler); echo "<option value=\"$optionId\" $selectedOption>" . $sActionId . "</option>";
} }
} echo '</select>';
function pluginCaseSchedulerForm(){ //G::pr($activePlugnsForCaseScheduler);
if(!isset($_REQUEST ['selectedOption'])) die; }
$G_PUBLISH = new Publisher; }
$params=explode("--",$_REQUEST ['selectedOption']);
$oPluginRegistry =& PMPluginRegistry::getSingleton(); function pluginCaseSchedulerForm ()
$activePluginsForCaseScheduler=$oPluginRegistry->getCaseSchedulerPlugins(); {
if (! isset( $_REQUEST['selectedOption'] ))
foreach($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail){ die();
if(($caseSchedulerPluginDetail->sNamespace==$params[0])&&($caseSchedulerPluginDetail->sActionId==$params[1])){ $G_PUBLISH = new Publisher();
$caseSchedulerSelected=$caseSchedulerPluginDetail; $params = explode( "--", $_REQUEST['selectedOption'] );
} $oPluginRegistry = & PMPluginRegistry::getSingleton();
} $activePluginsForCaseScheduler = $oPluginRegistry->getCaseSchedulerPlugins();
if((isset($caseSchedulerSelected))&&(is_object($caseSchedulerSelected))){
//Render the form foreach ($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail) {
if((isset($_REQUEST['sch_uid']))&&($_REQUEST['sch_uid']!="")){ if (($caseSchedulerPluginDetail->sNamespace == $params[0]) && ($caseSchedulerPluginDetail->sActionId == $params[1])) {
//$oData=$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionGetFields, array("SCH_UID"=>$_REQUEST['sch_uid']) ); $caseSchedulerSelected = $caseSchedulerPluginDetail;
$oData=array("SCH_UID"=>$_REQUEST['sch_uid'],"PRO_UID"=>$_REQUEST['pro_uid']); }
}else{ }
$oData=array("PRO_UID"=>$_REQUEST['pro_uid']); if ((isset( $caseSchedulerSelected )) && (is_object( $caseSchedulerSelected ))) {
} //Render the form
if ((isset( $_REQUEST['sch_uid'] )) && ($_REQUEST['sch_uid'] != "")) {
$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionForm, $oData ); //$oData=$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionGetFields, array("SCH_UID"=>$_REQUEST['sch_uid']) );
} $oData = array ("SCH_UID" => $_REQUEST['sch_uid'],"PRO_UID" => $_REQUEST['pro_uid']
);
} } else {
?> $oData = array ("PRO_UID" => $_REQUEST['pro_uid']
);
}
$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionForm, $oData );
}
}

View File

@@ -1,38 +1,33 @@
<?php
<?php
//$oUserId = '2963666854afbb1cea372c4011254883'; //$oUserId = '2963666854afbb1cea372c4011254883';
$oUserId = $_POST['USR_UID']; $oUserId = $_POST['USR_UID'];
$process = isset($_POST['PRO_UID'])?$_POST['PRO_UID']:$_SESSION['PROCESS']; $process = isset( $_POST['PRO_UID'] ) ? $_POST['PRO_UID'] : $_SESSION['PROCESS'];
//echo '<select style="width: 300px;" readOnly name="form[PRO_UID]" id="form[PRO_UID]" class="module_app_input___gray" required="1" onChange="loadTasksDropdown(this.value,\''.$oUserId.'\');">'; //echo '<select style="width: 300px;" readOnly name="form[PRO_UID]" id="form[PRO_UID]" class="module_app_input___gray" required="1" onChange="loadTasksDropdown(this.value,\''.$oUserId.'\');">';
require_once ("classes/model/TaskPeer.php");
require_once ("classes/model/TaskPeer.php"); require_once ("classes/model/ProcessPeer.php");
require_once ("classes/model/ProcessPeer.php"); require_once ("classes/model/TaskUserPeer.php");
require_once ("classes/model/TaskUserPeer.php"); G::LoadClass( 'Content' );
G::LoadClass ( 'Content' );
$oCriteria = new Criteria( 'workflow' );
$oCriteria = new Criteria('workflow'); $oCriteria->addSelectColumn( ProcessPeer::PRO_UID );
$oCriteria->addSelectColumn(ProcessPeer::PRO_UID); $oCriteria->setDistinct();
$oCriteria->setDistinct(); $oCriteria->addSelectColumn( ContentPeer::CON_VALUE );
$oCriteria->addSelectColumn(ContentPeer::CON_VALUE); $oCriteria->addJoin( ProcessPeer::PRO_UID, TaskPeer::PRO_UID, Criteria::LEFT_JOIN );
$oCriteria->addJoin(ProcessPeer::PRO_UID, TaskPeer::PRO_UID, Criteria::LEFT_JOIN); $oCriteria->addJoin( ProcessPeer::PRO_UID, ContentPeer::CON_ID, Criteria::LEFT_JOIN );
$oCriteria->addJoin(ProcessPeer::PRO_UID, ContentPeer::CON_ID, Criteria::LEFT_JOIN); $oCriteria->addJoin( TaskPeer::TAS_UID, TaskUserPeer::TAS_UID, Criteria::LEFT_JOIN );
$oCriteria->addJoin(TaskPeer::TAS_UID, TaskUserPeer::TAS_UID, Criteria::LEFT_JOIN); $oCriteria->add( TaskUserPeer::USR_UID, $oUserId );
$oCriteria->add(TaskUserPeer::USR_UID, $oUserId); $oCriteria->add( TaskPeer::TAS_START, 'true' );
$oCriteria->add(TaskPeer::TAS_START, 'true'); $oCriteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE' );
$oCriteria->add(ContentPeer::CON_CATEGORY, 'PRO_TITLE'); $oCriteria->add( ContentPeer::CON_LANG, SYS_LANG );
$oCriteria->add(ContentPeer::CON_LANG, SYS_LANG); $oCriteria->addAnd( ProcessPeer::PRO_UID, $process );
$oCriteria->addAnd(ProcessPeer::PRO_UID, $process);
$resultSet = TaskUserPeer::doSelectRS( $oCriteria );
$resultSet = TaskUserPeer::doSelectRS($oCriteria); while ($resultSet->next()) {
while ($resultSet->next()){ $row = $resultSet->getRow();
$row = $resultSet->getRow();
echo $row[1];
echo $row[1]; echo "<input name=\"form[PRO_UID]\" id=\"form[PRO_UID]\" type=\"hidden\" value=\"" . $row[0] . "\"></input>";
echo "<input name=\"form[PRO_UID]\" id=\"form[PRO_UID]\" type=\"hidden\" value=\"".$row[0]."\"></input>";
//var_dump($row); //var_dump($row);
} }
//echo "</select>";
//echo "</select>";
?>

View File

@@ -1,25 +1,23 @@
<select style="width: 300px;" name="form[TAS_UID]" id="form[TAS_UID]" class="module_app_input___gray" required="1"> <select style="width: 300px;" name="form[TAS_UID]" id="form[TAS_UID]"
class="module_app_input___gray" required="1">
<?php <?php
//$oUserId = '2963666854afbb1cea372c4011254883'; //$oUserId = '2963666854afbb1cea372c4011254883';
//$oProcessId = '9977730834afd2a0deecaf3040551794'; //$oProcessId = '9977730834afd2a0deecaf3040551794';
$oUserId = $_POST['USR_UID']; $oUserId = $_POST['USR_UID'];
$oProcessId = $_POST['PRO_UID']; $oProcessId = $_POST['PRO_UID'];
G::LoadClass( 'case' );
G::LoadClass('case');
$oCase = new Cases(); $oCase = new Cases();
$startTasks = $oCase->getStartCases( $oUserId ); $startTasks = $oCase->getStartCases( $oUserId );
foreach ($startTasks as $task) {
foreach($startTasks as $task){ if ((isset( $task['pro_uid'] )) && ($task['pro_uid'] == $oProcessId)) {
if((isset($task['pro_uid']))&&($task['pro_uid'] == $oProcessId)){ $taskValue = explode( '(', $task['value'] );
$taskValue = explode('(',$task['value']); $tasksLastIndex = count( $taskValue ) - 1;
$tasksLastIndex = count($taskValue)-1; $taskValue = explode( ')', $taskValue[$tasksLastIndex] );
$taskValue = explode(')',$taskValue[$tasksLastIndex]); echo "<option value=\"" . $task['uid'] . "\">" . $taskValue[0] . "</option>";
}
echo "<option value=\"".$task['uid']."\">".$taskValue[0]."</option>";
}
} }
//print_r($startTasks); //print_r($startTasks);
// echo "<option value=\"".$value."\">".$label."</option>"; // echo "<option value=\"".$value."\">".$label."</option>";
?> ?>
</select> </select>

View File

@@ -1,71 +1,70 @@
<?php <?php
/** /**
* cases_SchedulerValidateUser.php * cases_SchedulerValidateUser.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2010 Colosa Inc.23 * Copyright (C) 2004 - 2010 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
/**
* process_SchedulerValidate_User
/** * validates if the username and password are valid data and if the user assigned
* process_SchedulerValidate_User * to the process and task has the rights and persmissions required to create a cron task
* validates if the username and password are valid data and if the user assigned */
* to the process and task has the rights and persmissions required to create a cron task
*/ $sWS_USER = trim( $_REQUEST['USERNAME'] );
$sWS_PASS = trim( $_REQUEST['PASSWORD'] );
$sWS_USER = trim($_REQUEST['USERNAME']); if (G::is_https()) {
$sWS_PASS = trim($_REQUEST['PASSWORD']); $http = 'https://';
} else {
if (G::is_https ()) $http = 'http://';
$http = 'https://'; }
else
$http = 'http://'; $endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
@$client = new SoapClient( $endpoint );
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
@$client = new SoapClient ( $endpoint ); $user = $sWS_USER;
$pass = $sWS_PASS;
$user = $sWS_USER;
$pass = $sWS_PASS; $params = array ('userid' => $user,'password' => $pass);
$result = $client->__SoapCall( 'login', array ($params) );
$params = array('userid' => $user, 'password' => $pass);
$result = $client->__SoapCall('login', array($params)); if ($result->status_code == 0) {
if (! class_exists( 'Users' )) {
if ($result->status_code == 0) { require ("classes/model/UsersPeer.php");
if (!class_exists('Users')) { }
require ("classes/model/UsersPeer.php"); $oCriteria = new Criteria( 'workflow' );
} $oCriteria->addSelectColumn( 'USR_UID' );
$oCriteria = new Criteria('workflow'); $oCriteria->add( UsersPeer::USR_USERNAME, $sWS_USER );
$oCriteria->addSelectColumn('USR_UID'); $resultSet = UsersPeer::doSelectRS( $oCriteria );
$oCriteria->add(UsersPeer::USR_USERNAME, $sWS_USER); $resultSet->next();
$resultSet = UsersPeer::doSelectRS($oCriteria); $user_id = $resultSet->getRow();
$resultSet->next(); $result->message = $user_id[0];
$user_id = $resultSet->getRow();
$result->message = $user_id[0]; G::LoadClass( 'case' );
$caseInstance = new Cases();
G::LoadClass('case'); if (! $caseInstance->canStartCase( $result->message, $_REQUEST['PRO_UID'] )) {
$caseInstance = new Cases(); $result->status_code = - 1000;
if (!$caseInstance->canStartCase($result->message, $_REQUEST['PRO_UID'])) { $result->message = G::LoadTranslation( 'ID_USER_CASES_NOT_START' );
$result->status_code = -1000; }
$result->message = G::LoadTranslation('ID_USER_CASES_NOT_START'); }
}
} die( G::json_encode( $result ) );
die(G::json_encode($result));

View File

@@ -1,28 +1,27 @@
<?php <?php
/** /**
* cases_Scheduler_ChangeStatus.php * cases_Scheduler_ChangeStatus.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ global $RBAC;
global $RBAC;
/* /*
switch ($RBAC->userCanAccess('PM_FACTORY')) switch ($RBAC->userCanAccess('PM_FACTORY'))
{ {
@@ -37,20 +36,19 @@ switch ($RBAC->userCanAccess('PM_FACTORY'))
die; die;
break; break;
} }
*/ */
/* /*
G::LoadClass('cases_Scheduler'); G::LoadClass('cases_Scheduler');
$oCases_Scheduler= new Cases_Scheduler(); $oCases_Scheduler= new Cases_Scheduler();
$oCases_Scheduler->changeStatus ( $_GET['SCH_UID'] ); $oCases_Scheduler->changeStatus ( $_GET['SCH_UID'] );
G::header('location: ' . $_SERVER['HTTP_REFERER']); G::header('location: ' . $_SERVER['HTTP_REFERER']);
*/ */
require_once 'classes/model/CaseScheduler.php'; require_once 'classes/model/CaseScheduler.php';
// G::LoadClass('CaseScheduler'); // G::LoadClass('CaseScheduler');
$oCaseScheduler= new CaseScheduler(); $oCaseScheduler = new CaseScheduler();
$oCaseScheduler->changeStatus ( $_GET['SCH_UID'] ); $oCaseScheduler->changeStatus( $_GET['SCH_UID'] );
G::header('location: ' . $_SERVER['HTTP_REFERER']); G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );

View File

@@ -1,10 +1,10 @@
<?php <?php
/** /**
* cases_Scheduler_Delete.php * cases_Scheduler_Delete.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
@@ -14,13 +14,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* *
*/ */
/* Permissions */ /* Permissions */
@@ -39,15 +39,13 @@ switch ($RBAC->userCanAccess('PM_CASES'))
break; break;
} }
*/ */
// print_r($_GET); print_r($_POST); die;
// print_r($_GET); print_r($_POST); die; require_once 'classes/model/CaseScheduler.php';
$oCaseScheduler = new CaseScheduler();
if ( !isset($_GET['SCH_UID'] ) ) {
require_once 'classes/model/CaseScheduler.php'; return;
$oCaseScheduler = new CaseScheduler(); }
if ( !isset($_GET['SCH_UID'] ) ) return; $oCaseScheduler->remove($_GET['SCH_UID']);
$oCaseScheduler->remove($_GET['SCH_UID']);
/* Redirect */ /* Redirect */
?>

View File

@@ -1,31 +1,30 @@
<?php <?php
/** /**
* cases_SchedulerNew.php * cases_SchedulerNew.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2010 Colosa Inc.23 * Copyright (C) 2004 - 2010 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ try {
try { global $RBAC;
global $RBAC;
/*
/*
switch ($RBAC->userCanAccess('PM_FACTORY')) switch ($RBAC->userCanAccess('PM_FACTORY'))
{ {
case -2: case -2:
@@ -39,100 +38,98 @@ try {
die; die;
break; break;
} }
*/ */
require_once 'classes/model/CaseScheduler.php'; require_once 'classes/model/CaseScheduler.php';
require_once 'classes/model/Process.php'; require_once 'classes/model/Process.php';
require_once 'classes/model/Task.php'; require_once 'classes/model/Task.php';
// $G_MAIN_MENU = 'processmaker'; // $G_MAIN_MENU = 'processmaker';
// $G_ID_MENU_SELECTED = 'CASES'; // $G_ID_MENU_SELECTED = 'CASES';
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
G::LoadClass('case'); G::LoadClass( 'case' );
/* Prepare page before to show */ /* Prepare page before to show */
$oCaseScheduler = new CaseScheduler();
$oCaseScheduler = new CaseScheduler(); $aFields = $oCaseScheduler->load( $_GET['SCH_UID'] );
$aFields = $oCaseScheduler->load($_GET['SCH_UID']);
$aFields['UID_SCHEDULER'] = "scheduler";
$aFields['UID_SCHEDULER'] ="scheduler" ; // load according the scheduler option selected daily/weekly/monthly/one time
$nOpt = $aFields['SCH_OPTION'];
// load according the scheduler option selected daily/weekly/monthly/one time switch ($nOpt) {
$nOpt = $aFields['SCH_OPTION']; case 1:
switch($nOpt){ $aStartDay = explode( '|', $aFields['SCH_DAYS_PERFORM_TASK'] );
case 1 : $aStartDay = explode('|', $aFields['SCH_DAYS_PERFORM_TASK']); if ($aStartDay[0] != 3) {
if($aStartDay[0] != 3) { $aFields['SCH_DAYS_PERFORM_TASK'] = $aStartDay[0];
$aFields['SCH_DAYS_PERFORM_TASK'] = $aStartDay[0]; } else {
} else { $aFields['SCH_DAYS_PERFORM_TASK'] = $aStartDay[0];
$aFields['SCH_DAYS_PERFORM_TASK'] = $aStartDay[0]; $aFields['SCH_DAYS_PERFORM_TASK_OPT_3'] = $aStartDay[1];
$aFields['SCH_DAYS_PERFORM_TASK_OPT_3'] = $aStartDay[1]; }
}
break;
break; case 2:
case 2 : $aFields['SCH_WEEK_DAYS_2'] = $aFields['SCH_WEEK_DAYS'];
$aFields['SCH_WEEK_DAYS_2'] = $aFields['SCH_WEEK_DAYS']; break;
break; case 3: // $nStartDay = $aFields['SCH_START_DAY'];
case 3 : // $nStartDay = $aFields['SCH_START_DAY']; $aStartDay = explode( '|', $aFields['SCH_START_DAY'] );
$aStartDay = explode('|', $aFields['SCH_START_DAY']); if ($aStartDay[0] == 1) {
if($aStartDay[0] == 1){ $aFields['SCH_START_DAY_OPT_1'] = $aStartDay[1];
$aFields['SCH_START_DAY_OPT_1'] = $aStartDay[1]; } else {
} else { $aFields['SCH_START_DAY_OPT_2_WEEKS'] = $aStartDay[1];
$aFields['SCH_START_DAY_OPT_2_WEEKS'] = $aStartDay[1]; $aFields['SCH_START_DAY_OPT_2_DAYS_WEEK'] = $aStartDay[2];
$aFields['SCH_START_DAY_OPT_2_DAYS_WEEK'] = $aStartDay[2]; }
} $aFields['SCH_START_DAY'] = $aStartDay[0];
$aFields['SCH_START_DAY'] = $aStartDay[0]; $aFields['SCH_MONTHS_2'] = $aFields['SCH_MONTHS'];
$aFields['SCH_MONTHS_2'] = $aFields['SCH_MONTHS']; $aFields['SCH_MONTHS_3'] = $aFields['SCH_MONTHS'];
$aFields['SCH_MONTHS_3'] = $aFields['SCH_MONTHS']; break;
break; case 4:
case 4 :
break;
break; }
}
$aFields['SCH_START_TIME'] = date( 'H:i', strtotime( $aFields['SCH_START_TIME'] ) );
$aFields['SCH_START_TIME'] = date('H:i' , strtotime($aFields['SCH_START_TIME'])); $aFields['PREV_SCH_START_TIME'] = $aFields['SCH_START_TIME'];
$aFields['PREV_SCH_START_TIME'] = $aFields['SCH_START_TIME'];
$aFields['SCH_START_DATE'] = date( 'Y-m-d', strtotime( $aFields['SCH_START_DATE'] ) );
$aFields['SCH_START_DATE'] = date('Y-m-d', strtotime($aFields['SCH_START_DATE'])); $aFields['PREV_SCH_START_DATE'] = $aFields['SCH_START_DATE'];
$aFields['PREV_SCH_START_DATE'] = $aFields['SCH_START_DATE'];
if (! empty( $aFields['SCH_END_DATE'] )) {
if(!empty($aFields['SCH_END_DATE'])){ $aFields['SCH_END_DATE'] = date( 'Y-m-d', strtotime( $aFields['SCH_END_DATE'] ) );
$aFields['SCH_END_DATE'] = date('Y-m-d', strtotime($aFields['SCH_END_DATE'])); $aFields['PREV_SCH_END_DATE'] = date( 'Y-m-d', strtotime( $aFields['SCH_END_DATE'] ) );
$aFields['PREV_SCH_END_DATE'] = date('Y-m-d', strtotime($aFields['SCH_END_DATE'])); }
} if ($aFields['SCH_REPEAT_STOP_IF_RUNNING'] == 0 || $aFields['SCH_REPEAT_STOP_IF_RUNNING'] == null) {
if($aFields['SCH_REPEAT_STOP_IF_RUNNING']==0 || $aFields['SCH_REPEAT_STOP_IF_RUNNING']==null){ $aFields['SCH_REPEAT_STOP_IF_RUNNING'] = null;
$aFields['SCH_REPEAT_STOP_IF_RUNNING']=null; } else {
}else { $aFields['SCH_REPEAT_STOP_IF_RUNNING'] = 'On';
$aFields['SCH_REPEAT_STOP_IF_RUNNING']='On'; }
}
$aFields['SCH_USER_NAME'] = $aFields['SCH_DEL_USER_NAME'];
$aFields['SCH_USER_NAME'] = $aFields['SCH_DEL_USER_NAME']; $aFields['SCH_USER_PASSWORD'] = 'DefaultPM';
$aFields['SCH_USER_PASSWORD'] = 'DefaultPM'; $aFields['SCH_USER_UID'] = $aFields['SCH_DEL_USER_UID'];
$aFields['SCH_USER_UID'] = $aFields['SCH_DEL_USER_UID']; $aFields['SCH_START_DATE'] = date( "Y-m-d", strtotime( $aFields['SCH_START_DATE'] ) );
$aFields['SCH_START_DATE'] = date ("Y-m-d",strtotime($aFields['SCH_START_DATE']));
// validating if any of the advanced fields is non empty
// validating if any of the advanced fields is non empty // var_dump($aFields['SCH_END_DATE']);
// var_dump($aFields['SCH_END_DATE']); // var_dump($aFields['SCH_REPEAT_EVERY']);
// var_dump($aFields['SCH_REPEAT_EVERY']); // die();
// die(); if ($aFields['SCH_END_DATE'] != NULL || trim( $aFields['SCH_REPEAT_EVERY'] ) != '') {
if ($aFields['SCH_END_DATE']!=NULL||trim($aFields['SCH_REPEAT_EVERY'])!=''){ $aFields['SCH_ADVANCED'] = 'true';
$aFields['SCH_ADVANCED'] = 'true'; } else {
} else { $aFields['SCH_ADVANCED'] = 'false';
$aFields['SCH_ADVANCED'] = 'false'; }
}
$aFields['PRO_UID_TMP'] = isset( $_GET['PRO_UID'] ) ? $_GET['PRO_UID'] : $_SESSION['PROCESS'];
$aFields['PRO_UID_TMP'] = isset($_GET['PRO_UID'])?$_GET['PRO_UID']:$_SESSION['PROCESS']; $aFields['PHP_START_DATE'] = date( 'Y-m-d' );
$aFields['PHP_START_DATE'] = date('Y-m-d'); $aFields['PHP_END_DATE'] = date( 'Y-m-d', mktime( 0, 0, 0, date( 'm' ), date( 'd' ), date( 'Y' ) + 5 ) );
$aFields['PHP_END_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 5));
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_Scheduler_Edit.xml', '', $aFields, 'cases_Scheduler_Update' );
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_Scheduler_Edit.xml', '', $aFields, 'cases_Scheduler_Update');
G::RenderPage( 'publishBlank', 'blank' );
G::RenderPage('publishBlank','blank');
} catch (Exception $oException) {
} catch (Exception $oException) { die( $oException->getMessage() );
die($oException->getMessage()); }
}
?>

View File

@@ -1,30 +1,31 @@
<?php <?php
/** /**
* cases_Scheduler_List.php * cases_Scheduler_List.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2010 Colosa Inc.23 * Copyright (C) 2004 - 2010 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1) {
if (($RBAC_Response=$RBAC->userCanAccess("PM_LOGIN"))!=1) return $RBAC_Response; return $RBAC_Response;
global $RBAC; }
global $RBAC;
/*switch ($RBAC->userCanAccess('PM_USERS')) /*switch ($RBAC->userCanAccess('PM_USERS'))
{ {
case -2: case -2:
@@ -37,140 +38,57 @@ global $RBAC;
G::header('location: ../login/login'); G::header('location: ../login/login');
die; die;
break; break;
}*/ }*/
$G_MAIN_MENU = 'processmaker';
$G_MAIN_MENU = 'processmaker'; $G_SUB_MENU = 'cases';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_MENU_SELECTED = 'CASES'; $G_ID_SUB_MENU_SELECTED = 'CASES_SCHEDULER';
$G_ID_SUB_MENU_SELECTED = 'CASES_SCHEDULER'; require_once 'classes/model/CaseScheduler.php';
require_once 'classes/model/CaseScheduler.php'; $process = isset( $_GET['PRO_UID'] ) ? $_GET['PRO_UID'] : $_SESSION['PROCESS'];
$process = isset($_GET['PRO_UID'])?$_GET['PRO_UID']:$_SESSION['PROCESS']; $sDelimiter = DBAdapter::getStringDelimiter();
$sDelimiter = DBAdapter::getStringDelimiter();
$oCaseScheduler = new CaseScheduler();
$oCaseScheduler = new CaseScheduler(); $aRows = $oCaseScheduler->getAllByProcess( $process );
$aRows = $oCaseScheduler->getAllByProcess($process);
//$oCaseScheduler->caseSchedulerCron();
//$oCaseScheduler->caseSchedulerCron();
// g::pr($aRows); die;
$fieldNames = Array(
'SCH_UID' => 'char',
'SCH_NAME' => 'char',
'PRO_UID' => 'char',
'TAS_UID' => 'char',
'SCH_TIME_NEXT_RUN' => 'char',
'SCH_LAST_RUN_TIME' => 'char',
'SCH_STATE' => 'char',
'SCH_LAST_STATE' => 'char',
'USR_UID' => 'char',
'SCH_OPTION' => 'char',
'SCH_START_TIME' => 'char',
'SCH_START_DATE' => 'char',
'SCH_DAYS_PERFORM_TASK' => 'char',
'SCH_EVERY_DAYS' => 'char',
'SCH_WEEK_DAYS' => 'char',
'SCH_START_DAY' => 'char',
'SCH_MONTHS' => 'char',
'SCH_END_DATE' => 'char',
'SCH_REPEAT_EVERY' => 'char',
'SCH_REPEAT_UNTIL' => 'char',
'SCH_REPEAT_STOP_IF_RUNNING' => 'char',
'PRO_PARENT' => 'char',
'PRO_TIME' => 'char',
'PRO_TIMEUNIT' => 'char',
'PRO_STATUS' => 'char',
'PRO_TYPE_DAY' => 'char',
'PRO_TYPE' => 'char',
'PRO_ASSIGNMENT' => 'char',
'PRO_SHOW_MAP' => 'char',
'PRO_SHOW_MESSAGE' => 'char',
'PRO_SUBPROCESS' => 'char',
'PRO_TRI_DELETED' => 'char',
'PRO_TRI_CANCELED' => 'char',
'PRO_TRI_PAUSED' => 'char',
'PRO_TRI_REASSIGNED' => 'char',
'PRO_SHOW_DELEGATE' => 'char',
'PRO_SHOW_DYNAFORM' => 'char',
'PRO_CATEGORY' => 'char',
'PRO_SUB_CATEGORY' => 'char',
'PRO_INDUSTRY' => 'char',
'PRO_UPDATE_DATE' => 'char',
'PRO_CREATE_DATE' => 'char',
'PRO_CREATE_USER' => 'char',
'PRO_HEIGHT' => 'char',
'PRO_WIDTH' => 'char',
'PRO_TITLE_X' => 'char',
'PRO_TITLE_Y' => 'char',
'PRO_DEBUG' => 'char',
'PRO_TITLE' => 'char',
'PRO_DESCRIPTION' => 'char',
'TAS_TYPE' => 'char',
'TAS_DURATION' => 'char',
'TAS_DELAY_TYPE' => 'char',
'TAS_TEMPORIZER' => 'char',
'TAS_TYPE_DAY' => 'char',
'TAS_TIMEUNIT' => 'char',
'TAS_ALERT' => 'char',
'TAS_PRIORITY_VARIABLE' => 'char',
'TAS_ASSIGN_TYPE' => 'char',
'TAS_ASSIGN_VARIABLE' => 'char',
'TAS_ASSIGN_LOCATION' => 'char',
'TAS_ASSIGN_LOCATION_ADHOC' => 'char',
'TAS_TRANSFER_FLY' => 'char',
'TAS_LAST_ASSIGNED' => 'char',
'TAS_USER' => 'char',
'TAS_CAN_UPLOAD' => 'char',
'TAS_VIEW_UPLOAD' => 'char',
'TAS_VIEW_ADDITIONAL_DOCUMENTATION' => 'char',
'TAS_CAN_CANCEL' => 'char',
'TAS_OWNER_APP' => 'char',
'STG_UID' => 'char',
'TAS_CAN_PAUSE' => 'char',
'TAS_CAN_SEND_MESSAGE' => 'char',
'TAS_CAN_DELETE_DOCS' => 'char',
'TAS_SELF_SERVICE' => 'char',
'TAS_START' => 'char',
'TAS_TO_LAST_USER' => 'char',
'TAS_SEND_LAST_EMAIL' => 'char',
'TAS_DERIVATION' => 'char',
'TAS_POSX' => 'char',
'TAS_POSY' => 'char',
'TAS_COLOR' => 'char',
'TAS_TITLE' => 'char',
'TAS_DESCRIPTION' => 'char',
'TAS_DEF_TITLE' => 'char',
'TAS_DEF_DESCRIPTION' => 'char',
'TAS_DEF_PROC_CODE' => 'char',
'TAS_DEF_MESSAGE' => 'char'
);
$aRows = array_merge(Array($fieldNames), $aRows);
//krumo ($aRows);
for($j=0;$j<count($aRows);$j++){
if ($aRows[$j]['SCH_STATE'] == 'PROCESSED'){
$aRows[$j]['SCH_TIME_NEXT_RUN'] = '';
}
}
// g::pr($aRows); die; // g::pr($aRows); die;
global $_DBArray;
$_DBArray['cases_scheduler'] = $aRows; $fieldNames = Array ('SCH_UID' => 'char','SCH_NAME' => 'char','PRO_UID' => 'char','TAS_UID' => 'char','SCH_TIME_NEXT_RUN' => 'char','SCH_LAST_RUN_TIME' => 'char','SCH_STATE' => 'char','SCH_LAST_STATE' => 'char','USR_UID' => 'char','SCH_OPTION' => 'char','SCH_START_TIME' => 'char','SCH_START_DATE' => 'char','SCH_DAYS_PERFORM_TASK' => 'char','SCH_EVERY_DAYS' => 'char','SCH_WEEK_DAYS' => 'char','SCH_START_DAY' => 'char','SCH_MONTHS' => 'char','SCH_END_DATE' => 'char','SCH_REPEAT_EVERY' => 'char','SCH_REPEAT_UNTIL' => 'char','SCH_REPEAT_STOP_IF_RUNNING' => 'char','PRO_PARENT' => 'char','PRO_TIME' => 'char','PRO_TIMEUNIT' => 'char','PRO_STATUS' => 'char','PRO_TYPE_DAY' => 'char','PRO_TYPE' => 'char','PRO_ASSIGNMENT' => 'char','PRO_SHOW_MAP' => 'char','PRO_SHOW_MESSAGE' => 'char',
$_SESSION['_DBArray'] = $_DBArray; 'PRO_SUBPROCESS' => 'char','PRO_TRI_DELETED' => 'char','PRO_TRI_CANCELED' => 'char','PRO_TRI_PAUSED' => 'char','PRO_TRI_REASSIGNED' => 'char','PRO_SHOW_DELEGATE' => 'char','PRO_SHOW_DYNAFORM' => 'char','PRO_CATEGORY' => 'char','PRO_SUB_CATEGORY' => 'char','PRO_INDUSTRY' => 'char','PRO_UPDATE_DATE' => 'char','PRO_CREATE_DATE' => 'char','PRO_CREATE_USER' => 'char','PRO_HEIGHT' => 'char','PRO_WIDTH' => 'char','PRO_TITLE_X' => 'char','PRO_TITLE_Y' => 'char','PRO_DEBUG' => 'char','PRO_TITLE' => 'char','PRO_DESCRIPTION' => 'char','TAS_TYPE' => 'char','TAS_DURATION' => 'char','TAS_DELAY_TYPE' => 'char','TAS_TEMPORIZER' => 'char','TAS_TYPE_DAY' => 'char','TAS_TIMEUNIT' => 'char','TAS_ALERT' => 'char','TAS_PRIORITY_VARIABLE' => 'char','TAS_ASSIGN_TYPE' => 'char',
G::LoadClass('ArrayPeer'); 'TAS_ASSIGN_VARIABLE' => 'char','TAS_ASSIGN_LOCATION' => 'char','TAS_ASSIGN_LOCATION_ADHOC' => 'char','TAS_TRANSFER_FLY' => 'char','TAS_LAST_ASSIGNED' => 'char','TAS_USER' => 'char','TAS_CAN_UPLOAD' => 'char','TAS_VIEW_UPLOAD' => 'char','TAS_VIEW_ADDITIONAL_DOCUMENTATION' => 'char','TAS_CAN_CANCEL' => 'char','TAS_OWNER_APP' => 'char','STG_UID' => 'char','TAS_CAN_PAUSE' => 'char','TAS_CAN_SEND_MESSAGE' => 'char','TAS_CAN_DELETE_DOCS' => 'char','TAS_SELF_SERVICE' => 'char','TAS_START' => 'char','TAS_TO_LAST_USER' => 'char','TAS_SEND_LAST_EMAIL' => 'char','TAS_DERIVATION' => 'char','TAS_POSX' => 'char','TAS_POSY' => 'char','TAS_COLOR' => 'char','TAS_TITLE' => 'char','TAS_DESCRIPTION' => 'char','TAS_DEF_TITLE' => 'char','TAS_DEF_DESCRIPTION' => 'char',
$oCriteria = new Criteria('dbarray'); 'TAS_DEF_PROC_CODE' => 'char','TAS_DEF_MESSAGE' => 'char'
$oCriteria->setDBArrayTable('cases_scheduler'); );
$aRows = array_merge( Array ($fieldNames
), $aRows );
//krumo ($aRows);
for ($j = 0; $j < count( $aRows ); $j ++) {
if ($aRows[$j]['SCH_STATE'] == 'PROCESSED') {
$aRows[$j]['SCH_TIME_NEXT_RUN'] = '';
}
}
// g::pr($aRows); die;
global $_DBArray;
$_DBArray['cases_scheduler'] = $aRows;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass( 'ArrayPeer' );
$oCriteria = new Criteria( 'dbarray' );
$oCriteria->setDBArrayTable( 'cases_scheduler' );
//krumo ($oCriteria); //krumo ($oCriteria);
//var_dump ($oCriteria); //var_dump ($oCriteria);
//$oCriteria->add('PRO_UID', $_SESSION['PROCESS']); //$oCriteria->add('PRO_UID', $_SESSION['PROCESS']);
//krumo($_SESSION); //krumo($_SESSION);
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$G_PUBLISH->ROWS_PER_PAGE = 10; $G_PUBLISH->ROWS_PER_PAGE = 10;
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'cases/cases_Scheduler_List', $oCriteria, array('CONFIRM' => G::LoadTranslation('ID_MSG_CONFIRM_DELETE_CASE_SCHEDULER'))); $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_Scheduler_List', $oCriteria, array ('CONFIRM' => G::LoadTranslation( 'ID_MSG_CONFIRM_DELETE_CASE_SCHEDULER' )
$G_PUBLISH->oPropelTable->rowsPerPage = 10; ) );
G::RenderPage('publishBlank', 'blank'); $G_PUBLISH->oPropelTable->rowsPerPage = 10;
G::RenderPage( 'publishBlank', 'blank' );

View File

@@ -1,44 +1,43 @@
<?php <?php
/** /**
* cases_Scheduler_Log.php * cases_Scheduler_Log.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2010 Colosa Inc.23 * Copyright (C) 2004 - 2010 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1)
if (($RBAC_Response=$RBAC->userCanAccess("PM_LOGIN"))!=1) return $RBAC_Response; return $RBAC_Response;
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
G::LoadClass('configuration'); G::LoadClass( 'configuration' );
$c = new Configurations(); $c = new Configurations();
$configPage = $c->getConfiguration('casesSchedulerLogList', 'pageSize','',$_SESSION['USER_LOGGED']); $configPage = $c->getConfiguration( 'casesSchedulerLogList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20; $Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
$oHeadPublisher =& headPublisher::getSingleton(); $oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript('cases/casesSchedulerLog', false); //adding a javascript file .js $oHeadPublisher->addExtJsScript( 'cases/casesSchedulerLog', false ); //adding a javascript file .js
$oHeadPublisher->addContent('cases/casesSchedulerLog'); //adding a html file .html. $oHeadPublisher->addContent( 'cases/casesSchedulerLog' ); //adding a html file .html.
$oHeadPublisher->assign('CONFIG', $Config);
$oHeadPublisher->assign( 'CONFIG', $Config );
G::RenderPage('publish', 'extJs'); G::RenderPage( 'publish', 'extJs' );
?>

View File

@@ -1,31 +1,30 @@
<?php <?php
/** /**
* cases_Scheduler_Log_Detail.php * cases_Scheduler_Log_Detail.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2010 Colosa Inc.23 * Copyright (C) 2004 - 2010 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ try {
try { global $RBAC;
global $RBAC;
/*
/*
switch ($RBAC->userCanAccess('PM_FACTORY')) switch ($RBAC->userCanAccess('PM_FACTORY'))
{ {
case -2: case -2:
@@ -39,9 +38,9 @@ try {
die; die;
break; break;
} }
*/ */
/* /*
$aFields['MESSAGE0'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_USER_REGISTERED')) . '!'; $aFields['MESSAGE0'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_USER_REGISTERED')) . '!';
$aFields['MESSAGE1'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_ERROR_USR_USERNAME')); $aFields['MESSAGE1'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_ERROR_USR_USERNAME'));
$aFields['MESSAGE2'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_ERROR_DUE_DATE')); $aFields['MESSAGE2'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_ERROR_DUE_DATE'));
@@ -54,39 +53,35 @@ try {
$aFields['END_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 5)); $aFields['END_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 5));
$aFields['USR_DUE_DATE']= date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 1)); $aFields['USR_DUE_DATE']= date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 1));
*/ */
if (!class_exists('LogCasesSchedulerPeer')){ if (! class_exists( 'LogCasesSchedulerPeer' )) {
require_once('classes/model/LogCasesScheduler.php'); require_once ('classes/model/LogCasesScheduler.php');
} }
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$oCriteria = new Criteria( 'workflow' );
$oCriteria = new Criteria ('workflow'); // var_dump(htmlspecialchars($_GET['WS_ROUTE']));
// var_dump(htmlspecialchars($_GET['WS_ROUTE'])); // var_dump(htmlentities($_GET['WS_ROUTE']));
// var_dump(htmlentities($_GET['WS_ROUTE']));
$oCriteria->add(LogCasesSchedulerPeer::LOG_CASE_UID,$_REQUEST['LOG_CASE_UID']); $oCriteria->add( LogCasesSchedulerPeer::LOG_CASE_UID, $_REQUEST['LOG_CASE_UID'] );
$result = LogCasesSchedulerPeer::doSelectRS( $oCriteria );
$result = LogCasesSchedulerPeer::doSelectRS($oCriteria); $result->next();
$result->next(); $row = $result->getRow();
$row = $result->getRow(); $aFields['PRO_UID'] = $row[1];
$aFields['PRO_UID'] = $row[1]; $aFields['TAS_UID'] = $row[2];
$aFields['TAS_UID'] = $row[2]; $aFields['SCH_UID'] = $row[7];
$aFields['SCH_UID'] = $row[7]; $aFields['USR_NAME'] = $row[3];
$aFields['USR_NAME'] = $row[3]; $aFields['EXEC_DATE'] = $row[4];
$aFields['EXEC_DATE'] = $row[4]; $aFields['EXEC_HOUR'] = $row[5];
$aFields['EXEC_HOUR'] = $row[5]; $aFields['RESULT'] = $row[6];
$aFields['RESULT'] = $row[6]; $aFields['WS_CREATE_CASE_STATUS'] = $row[8];
$aFields['WS_CREATE_CASE_STATUS'] = $row[8]; $aFields['WS_ROUTE_CASE_STATUS'] = htmlentities( $row[9] );
$aFields['WS_ROUTE_CASE_STATUS'] = htmlentities($row[9]); //var_dump($aFields);
//var_dump($aFields); //$aFields = $_GET;
//$aFields = $_GET; $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_Scheduler_Log_Detail.xml', '', $aFields, '' );
G::RenderPage( 'publishBlank', 'blank' );
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_Scheduler_Log_Detail.xml', '', $aFields, ''); } catch (Exception $oException) {
G::RenderPage('publishBlank', 'blank'); die( $oException->getMessage() );
}
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -1,31 +1,30 @@
<?php <?php
/** /**
* cases_SchedulerNew.php * cases_SchedulerNew.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2010 Colosa Inc.23 * Copyright (C) 2004 - 2010 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ try {
try { global $RBAC;
global $RBAC;
/*
/*
switch ($RBAC->userCanAccess('PM_FACTORY')) switch ($RBAC->userCanAccess('PM_FACTORY'))
{ {
case -2: case -2:
@@ -39,9 +38,9 @@ try {
die; die;
break; break;
} }
*/ */
/* /*
$aFields['MESSAGE0'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_USER_REGISTERED')) . '!'; $aFields['MESSAGE0'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_USER_REGISTERED')) . '!';
$aFields['MESSAGE1'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_ERROR_USR_USERNAME')); $aFields['MESSAGE1'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_ERROR_USR_USERNAME'));
$aFields['MESSAGE2'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_ERROR_DUE_DATE')); $aFields['MESSAGE2'] = str_replace("\r\n","<br>",G::LoadTranslation('ID_MSG_ERROR_DUE_DATE'));
@@ -55,47 +54,43 @@ try {
$aFields['USR_DUE_DATE']= date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 1)); $aFields['USR_DUE_DATE']= date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 1));
*/ */
require_once 'classes/model/CaseScheduler.php'; require_once 'classes/model/CaseScheduler.php';
require_once 'classes/model/Process.php'; require_once 'classes/model/Process.php';
require_once 'classes/model/Task.php'; require_once 'classes/model/Task.php';
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_SCHEDULER';
$G_PUBLISH = new Publisher();
G::LoadClass( 'case' );
$aFields['PHP_START_DATE'] = date( 'Y-m-d' );
$aFields['PRO_UID'] = isset( $_GET['PRO_UID'] ) ? $_GET['PRO_UID'] : $_SESSION['PROCESS'];
$aFields['PHP_CURRENT_DATE'] = $aFields['PHP_START_DATE'];
$aFields['PHP_END_DATE'] = date( 'Y-m-d', mktime( 0, 0, 0, date( 'm' ), date( 'd' ), date( 'Y' ) + 5 ) );
/* Prepare page before to show */
$G_MAIN_MENU = 'processmaker'; /*-- Base
$G_SUB_MENU = 'cases'; $aFields = array();
$oCase = new Cases();
$_DBArray['NewCase'] = $oCase->getStartCases( $_SESSION['USER_LOGGED'] );
*/
$G_ID_MENU_SELECTED = 'CASES'; $oCaseScheduler = new CaseScheduler();
$G_ID_SUB_MENU_SELECTED = 'CASES_SCHEDULER'; //$_DBArray['NewProcess'] = $oCaseScheduler->getProcessDescription();
//$_DBArray['NewTask'] = $oCaseScheduler->getTaskDescription();
$G_PUBLISH = new Publisher; // var_dump($oCaseScheduler->getAllProcess()); die;
G::LoadClass('case'); $aFields['UID_SCHEDULER'] = "scheduler";
$aFields['PHP_START_DATE'] = date('Y-m-d');
$aFields['PRO_UID'] = isset($_GET['PRO_UID'])?$_GET['PRO_UID']:$_SESSION['PROCESS']; $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_Scheduler_New.xml', '', $aFields, 'cases_Scheduler_Save' );
$aFields['PHP_CURRENT_DATE'] = $aFields['PHP_START_DATE']; G::RenderPage( 'publishBlank', 'blank' );
$aFields['PHP_END_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 5));
} catch (Exception $oException) {
/* Prepare page before to show */ die( $oException->getMessage() );
}
/*-- Base
$aFields = array();
$oCase = new Cases();
$_DBArray['NewCase'] = $oCase->getStartCases( $_SESSION['USER_LOGGED'] );
*/
$oCaseScheduler = new CaseScheduler();
//$_DBArray['NewProcess'] = $oCaseScheduler->getProcessDescription();
//$_DBArray['NewTask'] = $oCaseScheduler->getTaskDescription();
// var_dump($oCaseScheduler->getAllProcess()); die;
$aFields['UID_SCHEDULER'] ="scheduler" ;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_Scheduler_New.xml', '', $aFields, 'cases_Scheduler_Save');
G::RenderPage('publishBlank', 'blank');
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -1,29 +1,28 @@
<?php <?php
/** /**
* cases_Scheduler_Save.php * cases_Scheduler_Save.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2010 Colosa Inc.23 * Copyright (C) 2004 - 2010 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ try {
try { /*
/*
global $RBAC; global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY')) switch ($RBAC->userCanAccess('PM_FACTORY'))
{ {
@@ -38,238 +37,233 @@ try {
die; die;
break; break;
} }
*/ */
require_once 'classes/model/CaseScheduler.php';
require_once 'classes/model/CaseScheduler.php'; $oCaseScheduler = new CaseScheduler();
$oCaseScheduler = new CaseScheduler();
if (empty( $_POST )) {
if (empty($_POST)) { die( 'The information sended is empty!' );
die('The information sended is empty!'); }
}
$aData['SCH_UID'] = G::generateUniqueID();
$aData['SCH_UID'] = G::generateUniqueID(); $aData['SCH_NAME'] = $_POST['form']['SCH_NAME'];
$aData['SCH_NAME'] = $_POST['form']['SCH_NAME']; $aData['SCH_DEL_USER_NAME'] = $_POST['form']['SCH_USER_NAME'];
$aData['SCH_DEL_USER_NAME'] = $_POST['form']['SCH_USER_NAME']; $aData['SCH_DEL_USER_PASS'] = md5( $_POST['form']['SCH_USER_PASSWORD'] );
$aData['SCH_DEL_USER_PASS'] = md5($_POST['form']['SCH_USER_PASSWORD']); $aData['SCH_DEL_USER_UID'] = $_POST['form']['SCH_USER_UID'];
$aData['SCH_DEL_USER_UID'] = $_POST['form']['SCH_USER_UID']; $aData['PRO_UID'] = $_POST['form']['PRO_UID'];
$aData['PRO_UID'] = $_POST['form']['PRO_UID']; $aData['TAS_UID'] = $_POST['form']['TAS_UID'];
$aData['TAS_UID'] = $_POST['form']['TAS_UID'];
$aData['SCH_STATE'] = 'ACTIVE';
$aData['SCH_STATE'] = 'ACTIVE'; $aData['SCH_LAST_STATE'] = 'CREATED'; // 'ACTIVE';
$aData['SCH_LAST_STATE'] = 'CREATED'; // 'ACTIVE'; $aData['USR_UID'] = $_SESSION['USER_LOGGED'];
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
$sOption = $_POST['form']['SCH_OPTION'];
$sOption = $_POST['form']['SCH_OPTION']; $aData['SCH_OPTION'] = $sOption;
$aData['SCH_OPTION'] = $sOption;
if ($_POST['form']['SCH_START_DATE'] != '') {
$sDateTmp = $_POST['form']['SCH_START_DATE'];
} else {
if ($_POST['form']['SCH_START_DATE']!=''){ $sDateTmp = date( 'Y-m-d' );
$sDateTmp = $_POST['form']['SCH_START_DATE']; }
} else { $sTimeTmp = $_POST['form']['SCH_START_TIME'];
$sDateTmp = date('Y-m-d'); $aData['SCH_START_TIME'] = date( 'Y-m-d', strtotime( $sDateTmp ) ) . ' ' . date( 'H:i:s', strtotime( $sTimeTmp ) );
} $aData['SCH_START_DATE'] = date( 'Y-m-d', strtotime( $sDateTmp ) ) . ' ' . date( 'H:i:s', strtotime( $sTimeTmp ) );
$sTimeTmp = $_POST['form']['SCH_START_TIME'];
$aData['SCH_START_TIME'] = date('Y-m-d', strtotime($sDateTmp)) . ' ' . date('H:i:s', strtotime($sTimeTmp));
$aData['SCH_START_DATE'] = date('Y-m-d', strtotime($sDateTmp)) . ' ' . date('H:i:s', strtotime($sTimeTmp));
$nActualTime = $_POST['form']['SCH_START_TIME']; // time(); $nActualTime = $_POST['form']['SCH_START_TIME']; // time();
// $nActualDate = date("Y-m-d H:i:s", $nActualTime); // $nActualDate = date("Y-m-d H:i:s", $nActualTime);
$sValue = '';
$sDaysPerformTask = ''; $sValue = '';
$sWeeks = ''; $sDaysPerformTask = '';
$sMonths = ''; $sWeeks = '';
$sMonths = ''; $sMonths = '';
$sStartDay = ''; $sMonths = '';
$nSW = 0; $sStartDay = '';
$aData['SCH_START_DAY'] = ''; $nSW = 0;
$aData['SCH_REPEAT_EVERY'] = ''; $aData['SCH_START_DAY'] = '';
$aData['SCH_REPEAT_UNTIL'] = ''; $aData['SCH_REPEAT_EVERY'] = '';
$aData['SCH_DAYS_PERFORM_TASK'] = ''; $aData['SCH_REPEAT_UNTIL'] = '';
switch($sOption){ $aData['SCH_DAYS_PERFORM_TASK'] = '';
case '1' : // Option 1 switch ($sOption) {
$sValue = $_POST['form']['SCH_DAYS_PERFORM_TASK']; case '1': // Option 1
switch($sValue){ $sValue = $_POST['form']['SCH_DAYS_PERFORM_TASK'];
case '1' : $aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|1'; switch ($sValue) {
break; case '1':
case '2' : $aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|1';
$aData['SCH_OPTION'] = '2'; break;
$aData['SCH_EVERY_DAYS'] = '1'; case '2':
$aData['SCH_WEEK_DAYS'] = '1|2|3|4|5|'; $aData['SCH_OPTION'] = '2';
break; $aData['SCH_EVERY_DAYS'] = '1';
case '3' : // Every [n] Days $aData['SCH_WEEK_DAYS'] = '1|2|3|4|5|';
$sDaysPerformTask = $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3']; break;
$aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|' . $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3']; case '3': // Every [n] Days
break; $sDaysPerformTask = $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3'];
} $aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|' . $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3'];
break; break;
}
case '2' : // If the option is zero, set by default 1 break;
if(empty($_POST['form']['SCH_EVERY_DAYS']))
$nEveryDays = 1; case '2': // If the option is zero, set by default 1
else if (empty( $_POST['form']['SCH_EVERY_DAYS'] ))
$nEveryDays = $_POST['form']['SCH_EVERY_DAYS']; $nEveryDays = 1;
$aData['SCH_EVERY_DAYS'] = $nEveryDays; else
$sWeeks = ''; $nEveryDays = $_POST['form']['SCH_EVERY_DAYS'];
if(!empty($_POST['form']['SCH_WEEK_DAYS'])){ $aData['SCH_EVERY_DAYS'] = $nEveryDays;
$aWeekDays = $_POST['form']['SCH_WEEK_DAYS']; $sWeeks = '';
foreach($aWeekDays as $value) { if (! empty( $_POST['form']['SCH_WEEK_DAYS'] )) {
$sWeeks = $sWeeks . $value . '|'; $aWeekDays = $_POST['form']['SCH_WEEK_DAYS'];
} foreach ($aWeekDays as $value) {
} $sWeeks = $sWeeks . $value . '|';
if(!empty($_POST['form']['SCH_WEEK_DAYS_2'])){ }
$aWeekDays2 = $_POST['form']['SCH_WEEK_DAYS_2']; }
foreach($aWeekDays2 as $value) { if (! empty( $_POST['form']['SCH_WEEK_DAYS_2'] )) {
$sWeeks = $sWeeks . $value . '|'; $aWeekDays2 = $_POST['form']['SCH_WEEK_DAYS_2'];
} foreach ($aWeekDays2 as $value) {
} $sWeeks = $sWeeks . $value . '|';
$sStartTime = $_POST['form']['SCH_START_TIME']; }
$aData['SCH_WEEK_DAYS'] = $sWeeks; }
$sStartTime = $_POST['form']['SCH_START_TIME'];
break; $aData['SCH_WEEK_DAYS'] = $sWeeks;
case '3' :
$nStartDay = $_POST['form']['SCH_START_DAY']; break;
if($nStartDay == 1){ case '3':
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_1']; $nStartDay = $_POST['form']['SCH_START_DAY'];
} else { if ($nStartDay == 1) {
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_2_WEEKS'] . '|' . $_POST['form']['SCH_START_DAY_OPT_2_DAYS_WEEK']; $aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_1'];
} } else {
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_2_WEEKS'] . '|' . $_POST['form']['SCH_START_DAY_OPT_2_DAYS_WEEK'];
$sMonths = ''; }
if(!empty($_POST['form']['SCH_MONTHS'])){
$aMonths = $_POST['form']['SCH_MONTHS']; $sMonths = '';
foreach($aMonths as $value) { if (! empty( $_POST['form']['SCH_MONTHS'] )) {
$sMonths = $sMonths . $value . '|' ; $aMonths = $_POST['form']['SCH_MONTHS'];
} foreach ($aMonths as $value) {
} $sMonths = $sMonths . $value . '|';
if(!empty($_POST['form']['SCH_MONTHS_2'])){ }
$aMonths2 = $_POST['form']['SCH_MONTHS_2']; }
foreach($aMonths2 as $value) { if (! empty( $_POST['form']['SCH_MONTHS_2'] )) {
$sMonths = $sMonths . $value . '|' ; $aMonths2 = $_POST['form']['SCH_MONTHS_2'];
} foreach ($aMonths2 as $value) {
} $sMonths = $sMonths . $value . '|';
if(!empty($_POST['form']['SCH_MONTHS_3'])){ }
$aMonths3 = $_POST['form']['SCH_MONTHS_3']; }
foreach($aMonths3 as $value) { if (! empty( $_POST['form']['SCH_MONTHS_3'] )) {
$sMonths = $sMonths . $value . '|' ; $aMonths3 = $_POST['form']['SCH_MONTHS_3'];
} foreach ($aMonths3 as $value) {
} $sMonths = $sMonths . $value . '|';
$aData['SCH_MONTHS'] = $sMonths; }
$sStartDay = $aData['SCH_START_DAY']; }
$sValue = $nStartDay; $aData['SCH_MONTHS'] = $sMonths;
break; $sStartDay = $aData['SCH_START_DAY'];
$sValue = $nStartDay;
break;
}
echo "<br>sOption: ".$sOption; }
if(($sOption!='1') && ($sOption!='4') && ($sOption!='5') ) { echo "<br>sOption: " . $sOption;
if ($sStartDay==''){ if (($sOption != '1') && ($sOption != '4') && ($sOption != '5')) {
$sStartDay = date('Y-m-d'); if ($sStartDay == '') {
} $sStartDay = date( 'Y-m-d' );
// echo $sOption."*". $sValue."*". $nActualTime."*". $sDaysPerformTask."*". $sWeeks."*". $sStartDay ."*". $sMonths."<br>"; }
$dCurrentDay = date("d"); // echo $sOption."*". $sValue."*". $nActualTime."*". $sDaysPerformTask."*". $sWeeks."*". $sStartDay ."*". $sMonths."<br>";
$dCurrentMonth = date("m"); $dCurrentDay = date( "d" );
$aStartDay = explode( "|" , $aData['SCH_START_DAY'] ); $dCurrentMonth = date( "m" );
if($sOption=='3'&&$aStartDay[0]=='1'){ $aStartDay = explode( "|", $aData['SCH_START_DAY'] );
$monthsArray = explode("|",$sMonths); if ($sOption == '3' && $aStartDay[0] == '1') {
foreach ($monthsArray as $row){ $monthsArray = explode( "|", $sMonths );
if ( $dCurrentMonth == $row && $dCurrentDay<$aStartDay[1] ){ foreach ($monthsArray as $row) {
$startTime = $_POST['form']['SCH_START_TIME'].":00"; if ($dCurrentMonth == $row && $dCurrentDay < $aStartDay[1]) {
$aData['SCH_TIME_NEXT_RUN'] = date('Y') . '-' . $row . '-' . $aStartDay[1] . ' ' . $startTime; $startTime = $_POST['form']['SCH_START_TIME'] . ":00";
break; $aData['SCH_TIME_NEXT_RUN'] = date( 'Y' ) . '-' . $row . '-' . $aStartDay[1] . ' ' . $startTime;
} else { break;
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun($sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp); } else {
} $aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun( $sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp );
} }
} else { }
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun($sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp); } else {
} $aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun( $sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp );
// print_r ($aData['SCH_TIME_NEXT_RUN']); }
// die; // print_r ($aData['SCH_TIME_NEXT_RUN']);
} else { // die;
if ($sOption=='4'){ } else {
$aData['SCH_END_DATE'] = $aData['SCH_START_TIME']; if ($sOption == '4') {
} $aData['SCH_END_DATE'] = $aData['SCH_START_TIME'];
$aData['SCH_TIME_NEXT_RUN'] = $aData['SCH_START_TIME']; }
if ($sOption == 5) { $aData['SCH_TIME_NEXT_RUN'] = $aData['SCH_START_TIME'];
$aData['SCH_START_TIME'] = time(); if ($sOption == 5) {
$aData['SCH_START_DATE'] = $aData['SCH_START_TIME']; $aData['SCH_START_TIME'] = time();
$nextRun = $_POST['form']['SCH_REPEAT_EVERY']*60*60; $aData['SCH_START_DATE'] = $aData['SCH_START_TIME'];
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY']; $nextRun = $_POST['form']['SCH_REPEAT_EVERY'] * 60 * 60;
$date = $aData['SCH_START_TIME']; $aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
$date += $nextRun; $date = $aData['SCH_START_TIME'];
$date = date("Y-m-d H:i", $date ); $date += $nextRun;
$aData['SCH_TIME_NEXT_RUN'] = $date; $date = date( "Y-m-d H:i", $date );
} $aData['SCH_TIME_NEXT_RUN'] = $date;
} }
if(trim($_POST['form']['SCH_END_DATE'])!=''){ }
$aData['SCH_END_DATE'] = $_POST['form']['SCH_END_DATE']; if (trim( $_POST['form']['SCH_END_DATE'] ) != '') {
} $aData['SCH_END_DATE'] = $_POST['form']['SCH_END_DATE'];
}
if(!empty($_POST['form']['SCH_REPEAT_TASK_CHK'])){
$nOptEvery = $_POST['form']['SCH_REPEAT_EVERY_OPT']; if (! empty( $_POST['form']['SCH_REPEAT_TASK_CHK'] )) {
if($nOptEvery ==2) $nOptEvery = $_POST['form']['SCH_REPEAT_EVERY_OPT'];
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'] * 60; if ($nOptEvery == 2)
else $aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'] * 60;
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY']; else
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
} }
if((isset($_POST['form']['CASE_SH_PLUGIN_UID']))&&($_POST['form']['CASE_SH_PLUGIN_UID']!="")){ if ((isset( $_POST['form']['CASE_SH_PLUGIN_UID'] )) && ($_POST['form']['CASE_SH_PLUGIN_UID'] != "")) {
$aData['CASE_SH_PLUGIN_UID'] = $_POST['form']['CASE_SH_PLUGIN_UID']; $aData['CASE_SH_PLUGIN_UID'] = $_POST['form']['CASE_SH_PLUGIN_UID'];
} }
//$aData['SCH_END_DATE'] = "2020-12-30"; //$aData['SCH_END_DATE'] = "2020-12-30";
$oCaseScheduler->create($aData); $oCaseScheduler->create( $aData );
$sch_uid = $oCaseScheduler->getSchUid(); $sch_uid = $oCaseScheduler->getSchUid();
if((isset($_POST['form']['CASE_SH_PLUGIN_UID']))&&($_POST['form']['CASE_SH_PLUGIN_UID']!="")){ if ((isset( $_POST['form']['CASE_SH_PLUGIN_UID'] )) && ($_POST['form']['CASE_SH_PLUGIN_UID'] != "")) {
$params=explode("--",$_REQUEST ['form']['CASE_SH_PLUGIN_UID']); $params = explode( "--", $_REQUEST['form']['CASE_SH_PLUGIN_UID'] );
$oPluginRegistry =& PMPluginRegistry::getSingleton(); $oPluginRegistry = & PMPluginRegistry::getSingleton();
$activePluginsForCaseScheduler=$oPluginRegistry->getCaseSchedulerPlugins(); $activePluginsForCaseScheduler = $oPluginRegistry->getCaseSchedulerPlugins();
foreach($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail){ foreach ($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail) {
if(($caseSchedulerPluginDetail->sNamespace==$params[0])&&($caseSchedulerPluginDetail->sActionId==$params[1])){ if (($caseSchedulerPluginDetail->sNamespace == $params[0]) && ($caseSchedulerPluginDetail->sActionId == $params[1])) {
$caseSchedulerSelected=$caseSchedulerPluginDetail; $caseSchedulerSelected = $caseSchedulerPluginDetail;
} }
} }
if((isset($caseSchedulerSelected))&&(is_object($caseSchedulerSelected))){ if ((isset( $caseSchedulerSelected )) && (is_object( $caseSchedulerSelected ))) {
//Save the form //Save the form
$oData=$_POST['pluginFields']; $oData = $_POST['pluginFields'];
$oData['SCH_UID'] =$aData['SCH_UID']; $oData['SCH_UID'] = $aData['SCH_UID'];
$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionSave, $oData ); $oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionSave, $oData );
} }
} }
// //Added by Qennix // //Added by Qennix
// //Update Start Time Event in BPMN // //Update Start Time Event in BPMN
// //
// echo $_POST['form']['TAS_UID']."<<----"; // echo $_POST['form']['TAS_UID']."<<----";
// if (isset($_POST['form']['TAS_UID'])){ // if (isset($_POST['form']['TAS_UID'])){
// require_once 'classes/model/Event.php'; // require_once 'classes/model/Event.php';
// require_once 'classes/model/Task.php'; // require_once 'classes/model/Task.php';
// echo $_POST['form']['TAS_UID']."<<----"; // echo $_POST['form']['TAS_UID']."<<----";
// //
// $oTask = new Task(); // $oTask = new Task();
// $oTask->load($_POST['form']['TAS_UID']); // $oTask->load($_POST['form']['TAS_UID']);
// $evn_uid = $oTask->getStartingEvent(); // $evn_uid = $oTask->getStartingEvent();
// $event = new Event(); // $event = new Event();
// $editEvent = array(); // $editEvent = array();
// $editEvent['EVN_UID'] = $evn_uid; // $editEvent['EVN_UID'] = $evn_uid;
// $editEvent['EVN_ACTION'] = $sch_uid; // $editEvent['EVN_ACTION'] = $sch_uid;
// $event->update($editEvent); // $event->update($editEvent);
// //End Adding // //End Adding
// } // }
G::header('location: cases_Scheduler_List?PRO_UID='.$_POST['form']['PRO_UID']);
G::header( 'location: cases_Scheduler_List?PRO_UID=' . $_POST['form']['PRO_UID'] );
} } catch (Exception $oException) {
catch (Exception $oException) { die( $oException->getMessage() );
die($oException->getMessage()); }
}
?>

View File

@@ -1,29 +1,28 @@
<?php <?php
/** /**
* cases_Scheduler_Save.php * cases_Scheduler_Save.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2010 Colosa Inc.23 * Copyright (C) 2004 - 2010 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ try {
try { /*
/*
global $RBAC; global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY')) switch ($RBAC->userCanAccess('PM_FACTORY'))
{ {
@@ -38,247 +37,245 @@ try {
die; die;
break; break;
} }
*/ */
require_once 'classes/model/CaseScheduler.php'; require_once 'classes/model/CaseScheduler.php';
if (empty( $_POST )) {
if (empty($_POST)) { die( 'The information sended is empty!' );
die('The information sended is empty!'); }
} $aData['SCH_UID'] = $_POST['form']['SCH_UID'];
$aData['SCH_UID'] = $_POST['form']['SCH_UID']; $aData['SCH_NAME'] = $_POST['form']['SCH_NAME'];
$aData['SCH_NAME'] = $_POST['form']['SCH_NAME']; $aData['PRO_UID'] = $_POST['form']['PRO_UID'];
$aData['PRO_UID'] = $_POST['form']['PRO_UID']; $aData['TAS_UID'] = $_POST['form']['TAS_UID'];
$aData['TAS_UID'] = $_POST['form']['TAS_UID'];
$oCaseScheduler = new CaseScheduler();
$oCaseScheduler = new CaseScheduler(); $oCaseScheduler->Load( $aData['SCH_UID'] );
$oCaseScheduler->Load($aData['SCH_UID']);
$aData['SCH_DEL_USER_NAME'] = $_POST['form']['SCH_USER_NAME'];
$aData['SCH_DEL_USER_NAME'] = $_POST['form']['SCH_USER_NAME']; if ($_POST['form']['SCH_USER_PASSWORD'] != 'DefaultPM') {
if ($_POST['form']['SCH_USER_PASSWORD'] != 'DefaultPM'){ $aData['SCH_DEL_USER_PASS'] = md5( $_POST['form']['SCH_USER_PASSWORD'] );
$aData['SCH_DEL_USER_PASS'] = md5($_POST['form']['SCH_USER_PASSWORD']); }
} $aData['SCH_DEL_USER_UID'] = $_POST['form']['SCH_USER_UID'];
$aData['SCH_DEL_USER_UID'] = $_POST['form']['SCH_USER_UID'];
// $aData['SCH_TIME_NEXT_RUN'] = time();
// $aData['SCH_TIME_NEXT_RUN'] = time(); //$aData['SCH_LAST_RUN_TIME'] = time();
//$aData['SCH_LAST_RUN_TIME'] = time(); // $aData['SCH_STATE'] = 'ACTIVE';
// $aData['SCH_STATE'] = 'ACTIVE'; // $aData['SCH_LAST_STATE'] = 'ACTIVE';
// $aData['SCH_LAST_STATE'] = 'ACTIVE'; $aData['USR_UID'] = $_SESSION['USER_LOGGED'];
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
$sOption = $_POST['form']['SCH_OPTION'];
$sOption = $_POST['form']['SCH_OPTION']; $aData['SCH_OPTION'] = $sOption;
$aData['SCH_OPTION'] = $sOption;
$sDateTmp = $_POST['form']['SCH_START_DATE'];
$sDateTmp = $_POST['form']['SCH_START_DATE']; $sTimeTmp = $_POST['form']['SCH_START_TIME'];
$sTimeTmp = $_POST['form']['SCH_START_TIME']; $aData['SCH_START_TIME'] = date( 'Y-m-d', strtotime( $sDateTmp ) ) . ' ' . date( 'H:i:s', strtotime( $sTimeTmp ) );
$aData['SCH_START_TIME'] = date('Y-m-d', strtotime($sDateTmp)) . ' ' . date('H:i:s', strtotime($sTimeTmp)); $aData['SCH_START_DATE'] = date( 'Y-m-d', strtotime( $sDateTmp ) ) . ' ' . date( 'H:i:s', strtotime( $sTimeTmp ) );
$aData['SCH_START_DATE'] = date('Y-m-d', strtotime($sDateTmp)) . ' ' . date('H:i:s', strtotime($sTimeTmp)); $previousStartTime = date( 'Y-m-d', strtotime( $_POST['form']['PREV_SCH_START_DATE'] ) ) . ' ' . date( 'H:i:s', strtotime( $_POST['form']['PREV_SCH_START_TIME'] ) );
$previousStartTime = date('Y-m-d', strtotime($_POST['form']['PREV_SCH_START_DATE'])) . ' ' . date('H:i:s', strtotime($_POST['form']['PREV_SCH_START_TIME'])); $previousStartDate = date( 'Y-m-d', strtotime( $_POST['form']['PREV_SCH_START_DATE'] ) ) . ' ' . date( 'H:i:s', strtotime( $_POST['form']['PREV_SCH_START_TIME'] ) );
$previousStartDate = date('Y-m-d', strtotime($_POST['form']['PREV_SCH_START_DATE'])) . ' ' . date('H:i:s', strtotime($_POST['form']['PREV_SCH_START_TIME']));
$sValue = '';
$sValue = ''; $sDaysPerformTask = '';
$sDaysPerformTask = ''; $sWeeks = '';
$sWeeks = ''; $sMonths = '';
$sMonths = ''; $sMonths = '';
$sMonths = ''; $sStartDay = '';
$sStartDay = ''; $nSW = 0;
$nSW = 0;
switch ($sOption) {
switch($sOption){ case '1': // Option 1
case '1' : // Option 1 $sValue = $_POST['form']['SCH_DAYS_PERFORM_TASK'];
$sValue = $_POST['form']['SCH_DAYS_PERFORM_TASK']; switch ($sValue) {
switch($sValue){ case '1':
case '1' : $aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|1'; $aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|1';
break; break;
case '2' : case '2':
$aData['SCH_OPTION'] = '2'; $aData['SCH_OPTION'] = '2';
$aData['SCH_EVERY_DAYS'] = '1'; $aData['SCH_EVERY_DAYS'] = '1';
$aData['SCH_WEEK_DAYS'] = '1|2|3|4|5|'; $aData['SCH_WEEK_DAYS'] = '1|2|3|4|5|';
break; break;
case '3' : // Every [n] Days case '3': // Every [n] Days
$sDaysPerformTask = $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3']; $sDaysPerformTask = $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3'];
$aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|' . $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3']; $aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|' . $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3'];
break; break;
} }
break; break;
case '2' : // If the option is zero, set by default 1 case '2': // If the option is zero, set by default 1
if(empty($_POST['form']['SCH_EVERY_DAYS'])) if (empty( $_POST['form']['SCH_EVERY_DAYS'] ))
$nEveryDays = 1; $nEveryDays = 1;
else else
$nEveryDays = $_POST['form']['SCH_EVERY_DAYS']; $nEveryDays = $_POST['form']['SCH_EVERY_DAYS'];
$aData['SCH_EVERY_DAYS'] = $nEveryDays; $aData['SCH_EVERY_DAYS'] = $nEveryDays;
$sWeeks = ''; $sWeeks = '';
if(!empty($_POST['form']['SCH_WEEK_DAYS'])){ if (! empty( $_POST['form']['SCH_WEEK_DAYS'] )) {
$aWeekDays = $_POST['form']['SCH_WEEK_DAYS']; $aWeekDays = $_POST['form']['SCH_WEEK_DAYS'];
foreach($aWeekDays as $value) { foreach ($aWeekDays as $value) {
$sWeeks = $sWeeks . $value . '|'; $sWeeks = $sWeeks . $value . '|';
} }
} }
if(!empty($_POST['form']['SCH_WEEK_DAYS_2'])){ if (! empty( $_POST['form']['SCH_WEEK_DAYS_2'] )) {
$aWeekDays2 = $_POST['form']['SCH_WEEK_DAYS_2']; $aWeekDays2 = $_POST['form']['SCH_WEEK_DAYS_2'];
foreach($aWeekDays2 as $value) { foreach ($aWeekDays2 as $value) {
$sWeeks = $sWeeks . $value . '|'; $sWeeks = $sWeeks . $value . '|';
} }
} }
$sStartTime = $_POST['form']['SCH_START_TIME']; $sStartTime = $_POST['form']['SCH_START_TIME'];
$aData['SCH_WEEK_DAYS'] = $sWeeks; $aData['SCH_WEEK_DAYS'] = $sWeeks;
break; break;
case '3' : case '3':
$nStartDay = $_POST['form']['SCH_START_DAY']; $nStartDay = $_POST['form']['SCH_START_DAY'];
if($nStartDay == 1){ if ($nStartDay == 1) {
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_1']; $aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_1'];
} else { } else {
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_2_WEEKS'] . '|' . $_POST['form']['SCH_START_DAY_OPT_2_DAYS_WEEK']; $aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_2_WEEKS'] . '|' . $_POST['form']['SCH_START_DAY_OPT_2_DAYS_WEEK'];
} }
$sMonths = ''; $sMonths = '';
if(!empty($_POST['form']['SCH_MONTHS'])){ if (! empty( $_POST['form']['SCH_MONTHS'] )) {
$aMonths = $_POST['form']['SCH_MONTHS']; $aMonths = $_POST['form']['SCH_MONTHS'];
foreach($aMonths as $value) { foreach ($aMonths as $value) {
$sMonths = $sMonths . $value . '|' ; $sMonths = $sMonths . $value . '|';
} }
} }
if(!empty($_POST['form']['SCH_MONTHS_2'])){ if (! empty( $_POST['form']['SCH_MONTHS_2'] )) {
$aMonths2 = $_POST['form']['SCH_MONTHS_2']; $aMonths2 = $_POST['form']['SCH_MONTHS_2'];
foreach($aMonths2 as $value) { foreach ($aMonths2 as $value) {
$sMonths = $sMonths . $value . '|' ; $sMonths = $sMonths . $value . '|';
} }
} }
if(!empty($_POST['form']['SCH_MONTHS_3'])){ if (! empty( $_POST['form']['SCH_MONTHS_3'] )) {
$aMonths3 = $_POST['form']['SCH_MONTHS_3']; $aMonths3 = $_POST['form']['SCH_MONTHS_3'];
foreach($aMonths3 as $value) { foreach ($aMonths3 as $value) {
$sMonths = $sMonths . $value . '|' ; $sMonths = $sMonths . $value . '|';
} }
} }
$aData['SCH_MONTHS'] = $sMonths; $aData['SCH_MONTHS'] = $sMonths;
$sStartDay = $aData['SCH_START_DAY']; $sStartDay = $aData['SCH_START_DAY'];
$sValue = $nStartDay; $sValue = $nStartDay;
break; break;
} }
if(trim($_POST['form']['SCH_END_DATE'])!=''){ if (trim( $_POST['form']['SCH_END_DATE'] ) != '') {
$aData['SCH_END_DATE'] = $_POST['form']['SCH_END_DATE']; $aData['SCH_END_DATE'] = $_POST['form']['SCH_END_DATE'];
} }
// if the start date has changed then recalculate the next run time // if the start date has changed then recalculate the next run time
if ($_POST['form']['SCH_START_DATE']==$_POST['form']['PREV_SCH_START_DATE']) { if ($_POST['form']['SCH_START_DATE'] == $_POST['form']['PREV_SCH_START_DATE']) {
$recalculateDate = false; $recalculateDate = false;
} else { } else {
$recalculateDate = true; $recalculateDate = true;
} }
if (date('H:i:s', strtotime($_POST['form']['SCH_START_TIME']))==date('H:i:s', strtotime($_POST['form']['PREV_SCH_START_TIME']))){ if (date( 'H:i:s', strtotime( $_POST['form']['SCH_START_TIME'] ) ) == date( 'H:i:s', strtotime( $_POST['form']['PREV_SCH_START_TIME'] ) )) {
$recalculateTime = false; $recalculateTime = false;
} else { } else {
$recalculateTime = true; $recalculateTime = true;
} }
// if the start date has changed then recalculate the next run time // if the start date has changed then recalculate the next run time
// var_dump($recalculateTime);
// die(); // var_dump($recalculateTime);
$nActualTime = $_POST['form']['SCH_START_TIME']; // die();
if(($sOption!='1') && ($sOption!='4') && ($sOption!='5')) { $nActualTime = $_POST['form']['SCH_START_TIME'];
if ($sStartDay==''){ if (($sOption != '1') && ($sOption != '4') && ($sOption != '5')) {
$sStartDay = date('Y-m-d'); if ($sStartDay == '') {
} $sStartDay = date( 'Y-m-d' );
// echo $sOption."*". $sValue."*". $nActualTime."*". $sDaysPerformTask."*". $sWeeks."*". $sStartDay ."*". $sMonths."<br>"; }
$dCurrentDay = date("d"); // echo $sOption."*". $sValue."*". $nActualTime."*". $sDaysPerformTask."*". $sWeeks."*". $sStartDay ."*". $sMonths."<br>";
$dCurrentMonth = date("m"); $dCurrentDay = date( "d" );
$aStartDay = explode( "|" , $aData['SCH_START_DAY'] ); $dCurrentMonth = date( "m" );
if($sOption=='3'&&$aStartDay[0]=='1'){ $aStartDay = explode( "|", $aData['SCH_START_DAY'] );
$monthsArray = explode("|",$sMonths); if ($sOption == '3' && $aStartDay[0] == '1') {
foreach ($monthsArray as $row){ $monthsArray = explode( "|", $sMonths );
if ( $dCurrentMonth == $row && $dCurrentDay<$aStartDay[1] ){ foreach ($monthsArray as $row) {
$startTime = $_POST['form']['SCH_START_TIME'].":00"; if ($dCurrentMonth == $row && $dCurrentDay < $aStartDay[1]) {
if ($recalculateDate) { $startTime = $_POST['form']['SCH_START_TIME'] . ":00";
$aData['SCH_TIME_NEXT_RUN'] = date('Y') . '-' . $row . '-' . $aStartDay[1] . ' ' . $startTime; if ($recalculateDate) {
} else if ($recalculateTime){ $aData['SCH_TIME_NEXT_RUN'] = date( 'Y' ) . '-' . $row . '-' . $aStartDay[1] . ' ' . $startTime;
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun("Y-m-d"). " " . $_POST['form']['SCH_START_TIME'] . ":00"; } else if ($recalculateTime) {
} $aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun( "Y-m-d" ) . " " . $_POST['form']['SCH_START_TIME'] . ":00";
break; }
} else { break;
if ($recalculateDate) { } else {
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun($sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp); if ($recalculateDate) {
} else if ($recalculateTime){ $aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun( $sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp );
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun("Y-m-d"). " " . $_POST['form']['SCH_START_TIME'] . ":00"; } else if ($recalculateTime) {
} $aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun( "Y-m-d" ) . " " . $_POST['form']['SCH_START_TIME'] . ":00";
} }
} }
} else { }
if ($recalculateDate) { } else {
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun($sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp); if ($recalculateDate) {
} else if ($recalculateTime){ $aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun( $sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp );
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun("Y-m-d"). " " . $_POST['form']['SCH_START_TIME'] . ":00"; } else if ($recalculateTime) {
} $aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun( "Y-m-d" ) . " " . $_POST['form']['SCH_START_TIME'] . ":00";
} }
// print_r ($aData['SCH_TIME_NEXT_RUN']); }
// die; // print_r ($aData['SCH_TIME_NEXT_RUN']);
} else { // die;
if ($sOption=='4'){ } else {
$aData['SCH_END_DATE'] = $aData['SCH_START_TIME']; if ($sOption == '4') {
} $aData['SCH_END_DATE'] = $aData['SCH_START_TIME'];
if ($recalculateDate) { }
$aData['SCH_TIME_NEXT_RUN'] = $aData['SCH_START_TIME']; if ($recalculateDate) {
} else if ($recalculateTime){ $aData['SCH_TIME_NEXT_RUN'] = $aData['SCH_START_TIME'];
} else if ($recalculateTime) {
// $Fields = $oCaseScheduler->Load($aData['SCH_UID']);
// $Fields['SCH_LAST_STATE'] = $aRow['SCH_STATE']; // $Fields = $oCaseScheduler->Load($aData['SCH_UID']);
// $Fields['SCH_STATE'] = 'PROCESSED'; // $Fields['SCH_LAST_STATE'] = $aRow['SCH_STATE'];
// $this->Update($Fields); // $Fields['SCH_STATE'] = 'PROCESSED';
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun("Y-m-d"). " " . $_POST['form']['SCH_START_TIME'] . ":00"; // $this->Update($Fields);
} $aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun( "Y-m-d" ) . " " . $_POST['form']['SCH_START_TIME'] . ":00";
// var_dump($recalculateTime); }
// var_dump($aData['SCH_TIME_NEXT_RUN']); // var_dump($recalculateTime);
// die; // var_dump($aData['SCH_TIME_NEXT_RUN']);
if ($sOption=='5') { // die;
$date = $oCaseScheduler->getSchLastRunTime(); if ($sOption == '5') {
if ($date == null) { $date = $oCaseScheduler->getSchLastRunTime();
$date = $oCaseScheduler->getSchStartTime(); if ($date == null) {
} $date = $oCaseScheduler->getSchStartTime();
$date = strtotime($date); }
$nextRun = $_POST['form']['SCH_REPEAT_EVERY']*60*60; $date = strtotime( $date );
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY']; $nextRun = $_POST['form']['SCH_REPEAT_EVERY'] * 60 * 60;
$date += $nextRun; $aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
$date = date("Y-m-d H:i", $date ); $date += $nextRun;
$aData['SCH_TIME_NEXT_RUN'] = $date; $date = date( "Y-m-d H:i", $date );
} $aData['SCH_TIME_NEXT_RUN'] = $date;
} }
}
if(!empty($_POST['form']['SCH_REPEAT_TASK_CHK'])){
$nOptEvery = $_POST['form']['SCH_REPEAT_EVERY_OPT']; if (! empty( $_POST['form']['SCH_REPEAT_TASK_CHK'] )) {
if($nOptEvery ==2) $nOptEvery = $_POST['form']['SCH_REPEAT_EVERY_OPT'];
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'] * 60; if ($nOptEvery == 2)
else $aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'] * 60;
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY']; else
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
} }
// var_dump ($aData['SCH_TIME_NEXT_RUN']); // var_dump ($aData['SCH_TIME_NEXT_RUN']);
// die; // die;
$oCaseScheduler ->Update($aData); $oCaseScheduler->Update( $aData );
if((isset($_POST['form']['CASE_SH_PLUGIN_UID']))&&($_POST['form']['CASE_SH_PLUGIN_UID']!="")){ if ((isset( $_POST['form']['CASE_SH_PLUGIN_UID'] )) && ($_POST['form']['CASE_SH_PLUGIN_UID'] != "")) {
$params=explode("--",$_REQUEST ['form']['CASE_SH_PLUGIN_UID']); $params = explode( "--", $_REQUEST['form']['CASE_SH_PLUGIN_UID'] );
$oPluginRegistry =& PMPluginRegistry::getSingleton(); $oPluginRegistry = & PMPluginRegistry::getSingleton();
$activePluginsForCaseScheduler=$oPluginRegistry->getCaseSchedulerPlugins(); $activePluginsForCaseScheduler = $oPluginRegistry->getCaseSchedulerPlugins();
foreach($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail){ foreach ($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail) {
if(($caseSchedulerPluginDetail->sNamespace==$params[0])&&($caseSchedulerPluginDetail->sActionId==$params[1])){ if (($caseSchedulerPluginDetail->sNamespace == $params[0]) && ($caseSchedulerPluginDetail->sActionId == $params[1])) {
$caseSchedulerSelected=$caseSchedulerPluginDetail; $caseSchedulerSelected = $caseSchedulerPluginDetail;
} }
} }
if((isset($caseSchedulerSelected))&&(is_object($caseSchedulerSelected))){ if ((isset( $caseSchedulerSelected )) && (is_object( $caseSchedulerSelected ))) {
//Save the form //Save the form
$oData=$_POST['pluginFields']; $oData = $_POST['pluginFields'];
$oData['SCH_UID'] =$aData['SCH_UID']; $oData['SCH_UID'] = $aData['SCH_UID'];
$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionSave, $oData ); $oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionSave, $oData );
} }
} }
G::header('location: cases_Scheduler_List?PRO_UID='.$_POST['form']['PRO_UID']); G::header( 'location: cases_Scheduler_List?PRO_UID=' . $_POST['form']['PRO_UID'] );
} catch (Exception $oException) {
} die( $oException->getMessage() );
catch (Exception $oException) { }
die($oException->getMessage());
}
?>

View File

@@ -1,97 +1,89 @@
<?php <?php
/** /**
* cases_ShowDocument.php * cases_ShowDocument.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
/* /*
* Created on 13-02-2008 * Created on 13-02-2008
* *
* @author David Callizaya <davidsantos@colosa.com> * @author David Callizaya <davidsantos@colosa.com>
*/ */
require_once ( "classes/model/AppDocumentPeer.php" ); require_once ("classes/model/AppDocumentPeer.php");
$oAppDocument = new AppDocument(); $oAppDocument = new AppDocument();
if(!isset($_GET['v'])){//Load last version of the document if (! isset( $_GET['v'] )) {
$docVersion=$oAppDocument->getLastAppDocVersion($_GET['a']); //Load last version of the document
}else{ $docVersion = $oAppDocument->getLastAppDocVersion( $_GET['a'] );
$docVersion=$_GET['v']; } else {
} $docVersion = $_GET['v'];
$oAppDocument->Fields = $oAppDocument->load($_GET['a'],$docVersion); }
$sAppDocUid = $oAppDocument->getAppDocUid(); $oAppDocument->Fields = $oAppDocument->load( $_GET['a'], $docVersion );
$iDocVersion = $oAppDocument->getDocVersion();
$info = pathinfo( $oAppDocument->getAppDocFilename() ); $sAppDocUid = $oAppDocument->getAppDocUid();
$ext = $info['extension']; $iDocVersion = $oAppDocument->getDocVersion();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
if (isset($_GET['b'])) { $ext = $info['extension'];
if ($_GET['b'] == '0') {
$bDownload = false; if (isset( $_GET['b'] )) {
} if ($_GET['b'] == '0') {
else { $bDownload = false;
$bDownload = true; } else {
} $bDownload = true;
} }
else { } else {
$bDownload = true; $bDownload = true;
} }
$realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/' . $sAppDocUid . '_' . $iDocVersion . '.' . $ext;
$realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/' . $sAppDocUid .'_'.$iDocVersion . '.' . $ext ; $realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/' . $sAppDocUid . '.' . $ext;
$realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/' . $sAppDocUid . '.' . $ext ; $sw_file_exists = false;
$sw_file_exists=false; if (file_exists( $realPath )) {
if(file_exists($realPath)){ $sw_file_exists = true;
$sw_file_exists=true; } elseif (file_exists( $realPath1 )) {
}elseif(file_exists($realPath1)){ $sw_file_exists = true;
$sw_file_exists=true; $realPath = $realPath1;
$realPath=$realPath1; }
}
if (! $sw_file_exists) {
if(!$sw_file_exists){ $error_message = "'" . $oAppDocument->Fields['APP_DOC_FILENAME'] . "' " . G::LoadTranslation( 'ID_ERROR_STREAMING_FILE' );
$error_message="'".$oAppDocument->Fields['APP_DOC_FILENAME']. "' ".G::LoadTranslation('ID_ERROR_STREAMING_FILE'); if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
if((isset($_POST['request']))&&($_POST['request']==true)){ $res['success'] = 'failure';
$res ['success'] = 'failure'; $res['message'] = $error_message;
$res ['message'] = $error_message; print G::json_encode( $res );
print G::json_encode ( $res ); } else {
}else{ G::SendMessageText( $error_message, "ERROR" );
G::SendMessageText($error_message, "ERROR"); $backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
$backUrlObj=explode("sys".SYS_SYS,$_SERVER['HTTP_REFERER']); G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
G::header("location: "."/sys".SYS_SYS.$backUrlObj[1]); die();
die; }
}
} else {
}else{ if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
if((isset($_POST['request']))&&($_POST['request']==true)){ $res['success'] = 'success';
$res ['success'] = 'success'; $res['message'] = $oAppDocument->Fields['APP_DOC_FILENAME'];
$res ['message'] = $oAppDocument->Fields['APP_DOC_FILENAME']; print G::json_encode( $res );
print G::json_encode ( $res ); } else {
}else{ G::streamFile( $realPath, $bDownload, $oAppDocument->Fields['APP_DOC_FILENAME'] );
G::streamFile ( $realPath, $bDownload, $oAppDocument->Fields['APP_DOC_FILENAME'] ); }
} }
}
?>

View File

@@ -1,90 +1,87 @@
<?php <?php
/** /**
* cases_ShowOutputDocument.php * cases_ShowOutputDocument.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
/* /*
* Created on 13-02-2008 * Created on 13-02-2008
* *
* @author David Callizaya <davidsantos@colosa.com> * @author David Callizaya <davidsantos@colosa.com>
*/ */
require_once ( "classes/model/AppDocumentPeer.php" ); require_once ("classes/model/AppDocumentPeer.php");
$oAppDocument = new AppDocument(); $oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_GET['a'],(isset($_GET['v']) )? $_GET['v'] : NULL ); $oAppDocument->Fields = $oAppDocument->load( $_GET['a'], (isset( $_GET['v'] )) ? $_GET['v'] : NULL );
$sAppDocUid = $oAppDocument->getAppDocUid(); $sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() ); $info = pathinfo( $oAppDocument->getAppDocFilename() );
if (!isset($_GET['ext'])) { if (! isset( $_GET['ext'] )) {
$ext = $info['extension']; $ext = $info['extension'];
} } else {
else { if ($_GET['ext'] != '') {
if ($_GET['ext'] != '') { $ext = $_GET['ext'];
$ext = $_GET['ext']; } else {
} $ext = $info['extension'];
else { }
$ext = $info['extension']; }
} $ver = (isset( $_GET['v'] ) && $_GET['v'] != '') ? '_' . $_GET['v'] : '';
}
$ver= (isset($_GET['v']) && $_GET['v']!='') ? '_'.$_GET['v'] : ''; if (! $ver) //This code is in the case the outputdocument won't be versioned
$ver = '_1';
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;
$realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $sAppDocUid .$ver. '.' . $ext ; $realPath2 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] . '.' . $ext;
$realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] .$ver. '.' . $ext ; $sw_file_exists = false;
$realPath2 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename']. '.' . $ext ; if (file_exists( $realPath )) {
$sw_file_exists=false; $sw_file_exists = true;
if(file_exists($realPath)){ } elseif (file_exists( $realPath1 )) {
$sw_file_exists=true; $sw_file_exists = true;
}elseif(file_exists($realPath1)){ $realPath = $realPath1;
$sw_file_exists=true; } elseif (file_exists( $realPath2 )) {
$realPath=$realPath1; $sw_file_exists = true;
}elseif(file_exists($realPath2)){ $realPath = $realPath2;
$sw_file_exists=true; }
$realPath=$realPath2; if (! $sw_file_exists) {
} $error_message = "'" . $info['basename'] . $ver . '.' . $ext . "' " . G::LoadTranslation( 'ID_ERROR_STREAMING_FILE' );
if(!$sw_file_exists){ if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
$error_message="'".$info['basename'] .$ver. '.' . $ext."' ".G::LoadTranslation('ID_ERROR_STREAMING_FILE'); $res['success'] = 'failure';
if((isset($_POST['request']))&&($_POST['request']==true)){ $res['message'] = $error_message;
$res ['success'] = 'failure'; print G::json_encode( $res );
$res ['message'] = $error_message; } else {
print G::json_encode ( $res ); G::SendMessageText( $error_message, "ERROR" );
}else{ $backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
G::SendMessageText($error_message, "ERROR"); G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
$backUrlObj=explode("sys".SYS_SYS,$_SERVER['HTTP_REFERER']); die();
G::header("location: "."/sys".SYS_SYS.$backUrlObj[1]); }
die;
} } else {
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
}else{ $res['success'] = 'success';
if((isset($_POST['request']))&&($_POST['request']==true)){ $res['message'] = $info['basename'] . $ver . '.' . $ext;
$res ['success'] = 'success'; print G::json_encode( $res );
$res ['message'] = $info['basename'] .$ver. '.' . $ext; } else {
print G::json_encode ( $res ); G::streamFile( $realPath, true, $info['basename'] . $ver . '.' . $ext );
}else{ }
G::streamFile ( $realPath, true ,$info['basename'] .$ver. '.' . $ext ); }
} //G::streamFile ( $realPath, true);
}
//G::streamFile ( $realPath, true);
?>

View File

@@ -1,66 +1,62 @@
<?php <?php
/** /**
* cases_ShowOutputDocument.php * cases_ShowOutputDocument.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
/* /*
* Created on 13-02-2008 * Created on 13-02-2008
* *
* @author David Callizaya <davidsantos@colosa.com> * @author David Callizaya <davidsantos@colosa.com>
*/ */
switch ($RBAC->userCanAccess('PM_SUPERVISOR')) { switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
case - 2: case - 2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
case - 1: case - 1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
require_once ( "classes/model/AppDocumentPeer.php" ); require_once ("classes/model/AppDocumentPeer.php");
$oAppDocument = new AppDocument(); $oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_GET['a']); $oAppDocument->Fields = $oAppDocument->load( $_GET['a'] );
$sAppDocUid = $oAppDocument->getAppDocUid(); $sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() ); $info = pathinfo( $oAppDocument->getAppDocFilename() );
if (!isset($_GET['ext'])) { if (! isset( $_GET['ext'] )) {
$ext = $info['extension']; $ext = $info['extension'];
} } else {
else { if ($_GET['ext'] != '') {
if ($_GET['ext'] != '') { $ext = $_GET['ext'];
$ext = $_GET['ext']; } else {
} $ext = $info['extension'];
else { }
$ext = $info['extension']; }
}
} $realPath = PATH_DOCUMENT . $_SESSION['APPLICATION'] . '/outdocs/' . $info['basename'] . '.' . $ext;
G::streamFile( $realPath, true );
$realPath = PATH_DOCUMENT . $_SESSION['APPLICATION'] . '/outdocs/' . $info['basename'] . '.' . $ext ;
G::streamFile ( $realPath, true );
?>

File diff suppressed because it is too large Load Diff

View File

@@ -1,77 +1,76 @@
<?php <?php
/** /**
* cases_Step.php * cases_Step.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
// die("first"); // die("first");
/* Permissions */ /* Permissions */
switch ($RBAC->userCanAccess('PM_SUPERVISOR')) { switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
case - 2: case - 2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
case - 1: case - 1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
if ((int)$_SESSION['INDEX'] < 1) { if ((int) $_SESSION['INDEX'] < 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header('location: ' . $_SERVER['HTTP_REFERER']); G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die; die();
} }
/* Includes */ /* Includes */
G::LoadClass('case'); G::LoadClass( 'case' );
G::LoadClass('derivation'); G::LoadClass( 'derivation' );
/* GET , POST & $_SESSION Vars */ /* GET , POST & $_SESSION Vars */
//$_SESSION['STEP_POSITION'] = (int)$_GET['POSITION']; //$_SESSION['STEP_POSITION'] = (int)$_GET['POSITION'];
/* Menues */
$G_MAIN_MENU = 'processmaker'; /* Menues */
$G_SUB_MENU = 'cases'; $G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'CASES'; $G_SUB_MENU = 'cases';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE'; $G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
/* Prepare page before to show */ /* Prepare page before to show */
$oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html'); $oTemplatePower = new TemplatePower( PATH_TPL . 'cases/cases_Step.html' );
$oTemplatePower->prepare(); $oTemplatePower->prepare();
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$oCase = new Cases(); $oCase = new Cases();
$Fields = $oCase->loadCase($_SESSION['APPLICATION']); $Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$oHeadPublisher =& headPublisher::getSingleton(); $oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addScriptCode(" $oHeadPublisher->addScriptCode( "
if (typeof parent != 'undefined') { if (typeof parent != 'undefined') {
if (parent.showCaseNavigatorPanel) { if (parent.showCaseNavigatorPanel) {
parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}'); parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}');
} }
}"); }" );
// DEPRECATED this script call is marked for removal since almost all the interface is extJS based // DEPRECATED this script call is marked for removal since almost all the interface is extJS based
$oHeadPublisher->addScriptCode(' $oHeadPublisher->addScriptCode( '
var Cse = {}; var Cse = {};
Cse.panels = {}; Cse.panels = {};
var leimnud = new maborak(); var leimnud = new maborak();
@@ -83,52 +82,51 @@ $oHeadPublisher->addScriptCode('
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"}); leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
leimnud.exec(leimnud.fix.memoryLeak); leimnud.exec(leimnud.fix.memoryLeak);
leimnud.event.add(window,"load",function(){ leimnud.event.add(window,"load",function(){
'.(isset($_SESSION['showCasesWindow'])?'try{'.$_SESSION['showCasesWindow'].'}catch(e){}':'').' ' . (isset( $_SESSION['showCasesWindow'] ) ? 'try{' . $_SESSION['showCasesWindow'] . '}catch(e){}' : '') . '
}); });
'); ' );
// DEPRECATED this script call is marked for removal // DEPRECATED this script call is marked for removal
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower); $G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
if (!isset($_GET['type'])) { if (! isset( $_GET['type'] )) {
$_GET['type'] = 'DYNAFORM'; $_GET['type'] = 'DYNAFORM';
} }
if (!isset($_GET['position'])) { if (! isset( $_GET['position'] )) {
$_GET['position'] = 1; $_GET['position'] = 1;
} }
$_SESSION['STEP_POSITION'] = (int)$_GET['position']; $_SESSION['STEP_POSITION'] = (int) $_GET['position'];
//Obtain previous and next step - Start //Obtain previous and next step - Start
if (isset($_GET['type'])) { if (isset( $_GET['type'] )) {
$sType = $_GET['type']; $sType = $_GET['type'];
} else { } else {
$sType = ''; $sType = '';
} }
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = ''; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = ''; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
/**
/** Added By erik * Added By erik
* date: 16-05-08 * date: 16-05-08
* Description: this was added for the additional database connections */ * Description: this was added for the additional database connections
G::LoadClass('dbConnections'); */
$oDbConnections = new dbConnections($_SESSION['PROCESS']); G::LoadClass( 'dbConnections' );
$oDbConnections->loadAdditionalConnections(); $oDbConnections = new dbConnections( $_SESSION['PROCESS'] );
$oDbConnections->loadAdditionalConnections();
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
if ($_GET['DYN_UID'] != '') { if ($_GET['DYN_UID'] != '') {
$_SESSION['CURRENT_DYN_UID'] = $_GET['DYN_UID']; $_SESSION['CURRENT_DYN_UID'] = $_GET['DYN_UID'];
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_GET['DYN_UID'], '', $G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_GET['DYN_UID'], '', $Fields['APP_DATA'], 'cases_SaveDataSupervisor?UID=' . $_GET['DYN_UID'] );
$Fields['APP_DATA'], 'cases_SaveDataSupervisor?UID='.$_GET['DYN_UID']); }
}
G::RenderPage( 'publish', 'blank' );
G::RenderPage('publish', 'blank');
if (! isset( $_GET['ex'] )) {
if (!isset($_GET['ex'])) { $_GET['ex'] = $_GET['position'];
$_GET['ex']=$_GET['position']; }
}
?> ?>
<script> <script>
@@ -149,4 +147,5 @@ function setSelect()
return 0; return 0;
} }
} }
</script> </script>

View File

@@ -1,68 +1,67 @@
<?php <?php
/** /**
* cases_Step.php * cases_Step.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
//die("second"); //die("second");
/* Permissions */ /* Permissions */
switch ($RBAC->userCanAccess('PM_SUPERVISOR')) { switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
case - 2: case - 2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
case - 1: case - 1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
if ((int)$_SESSION['INDEX'] < 1) { if ((int) $_SESSION['INDEX'] < 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header('location: ' . $_SERVER['HTTP_REFERER']); G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die; die();
} }
/* Includes */ /* Includes */
G::LoadClass('case'); G::LoadClass( 'case' );
G::LoadClass('derivation'); G::LoadClass( 'derivation' );
/* GET , POST & $_SESSION Vars */ /* GET , POST & $_SESSION Vars */
//$_SESSION['STEP_POSITION'] = (int)$_GET['POSITION']; //$_SESSION['STEP_POSITION'] = (int)$_GET['POSITION'];
/* Menues */
$G_MAIN_MENU = 'processmaker'; /* Menues */
$G_SUB_MENU = 'cases'; $G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'CASES'; $G_SUB_MENU = 'cases';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE'; $G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
/* Prepare page before to show */ /* Prepare page before to show */
$oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html'); $oTemplatePower = new TemplatePower( PATH_TPL . 'cases/cases_Step.html' );
$oTemplatePower->prepare(); $oTemplatePower->prepare();
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$oHeadPublisher =& headPublisher::getSingleton(); $oHeadPublisher = & headPublisher::getSingleton();
// Check if these code needs to be removed since the interface ar now moving to ExtJS // Check if these code needs to be removed since the interface ar now moving to ExtJS
$oHeadPublisher->addScriptCode(' $oHeadPublisher->addScriptCode( '
var Cse = {}; var Cse = {};
Cse.panels = {}; Cse.panels = {};
var leimnud = new maborak(); var leimnud = new maborak();
@@ -74,64 +73,62 @@ $oHeadPublisher->addScriptCode('
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"}); leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
leimnud.exec(leimnud.fix.memoryLeak); leimnud.exec(leimnud.fix.memoryLeak);
leimnud.event.add(window,"load",function(){ leimnud.event.add(window,"load",function(){
'.(isset($_SESSION['showCasesWindow'])?'try{'.$_SESSION['showCasesWindow'].'}catch(e){}':'').' ' . (isset( $_SESSION['showCasesWindow'] ) ? 'try{' . $_SESSION['showCasesWindow'] . '}catch(e){}' : '') . '
}); });
'); ' );
// Check if these code needs to be removed since the interface ar now moving to ExtJS // Check if these code needs to be removed since the interface ar now moving to ExtJS
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower); $G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
if (!isset($_GET['position'])) { if (! isset( $_GET['position'] )) {
$_GET['position'] = 1; $_GET['position'] = 1;
} }
$_SESSION['STEP_POSITION'] = (int)$_GET['position']; $_SESSION['STEP_POSITION'] = (int) $_GET['position'];
$oCase = new Cases(); $oCase = new Cases();
$Fields = $oCase->loadCase($_SESSION['APPLICATION']); $Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
if (!isset($_GET['ex'])) { if (! isset( $_GET['ex'] )) {
$_GET['ex']=0; $_GET['ex'] = 0;
} }
if (!isset($_GET['INP_DOC_UID'])) { if (! isset( $_GET['INP_DOC_UID'] )) {
G::LoadClass('case'); G::LoadClass( 'case' );
$oCase = new Cases(); $oCase = new Cases();
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'cases/cases_InputdocsListToRevise', $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_InputdocsListToRevise', $oCase->getInputDocumentsCriteriaToRevise( $_SESSION['APPLICATION'] ), '' );
$oCase->getInputDocumentsCriteriaToRevise($_SESSION['APPLICATION']), ''); } else {
} else { $oInputDocument = new InputDocument();
$oInputDocument = new InputDocument(); $Fields = $oInputDocument->load( $_GET['INP_DOC_UID'] );
$Fields = $oInputDocument->load($_GET['INP_DOC_UID']); switch ($Fields['INP_DOC_FORM_NEEDED']) {
switch ($Fields['INP_DOC_FORM_NEEDED']) { case 'REAL':
case 'REAL': $Fields['TYPE_LABEL'] = G::LoadTranslation( 'ID_NEW' );
$Fields['TYPE_LABEL'] = G::LoadTranslation('ID_NEW'); $sXmlForm = 'cases/cases_AttachInputDocument2';
$sXmlForm = 'cases/cases_AttachInputDocument2'; break;
break; case 'VIRTUAL':
case 'VIRTUAL': $Fields['TYPE_LABEL'] = G::LoadTranslation( 'ID_ATTACH' );
$Fields['TYPE_LABEL'] = G::LoadTranslation('ID_ATTACH'); $sXmlForm = 'cases/cases_AttachInputDocument1';
$sXmlForm = 'cases/cases_AttachInputDocument1'; break;
break; case 'VREAL':
case 'VREAL': $Fields['TYPE_LABEL'] = G::LoadTranslation( 'ID_ATTACH' );
$Fields['TYPE_LABEL'] = G::LoadTranslation('ID_ATTACH'); $sXmlForm = 'cases/cases_AttachInputDocument3';
$sXmlForm = 'cases/cases_AttachInputDocument3'; break;
break; }
} $Fields['MESSAGE1'] = G::LoadTranslation( 'ID_PLEASE_ENTER_COMMENTS' );
$Fields['MESSAGE1'] = G::LoadTranslation('ID_PLEASE_ENTER_COMMENTS'); $Fields['MESSAGE2'] = G::LoadTranslation( 'ID_PLEASE_SELECT_FILE' );
$Fields['MESSAGE2'] = G::LoadTranslation('ID_PLEASE_SELECT_FILE'); $docName = $Fields['INP_DOC_TITLE'];
$docName = $Fields['INP_DOC_TITLE']; $oHeadPublisher->addScriptCode( 'var documentName=\'Reviewing Input Document<br>' . $docName . '\';' );
$oHeadPublisher->addScriptCode('var documentName=\'Reviewing Input Document<br>'.$docName.'\';');
// $G_PUBLISH->AddContent('xmlform', 'xmlform', $sXmlForm, '', $Fields, 'cases_SupervisorSaveDocument?UID=' . // $G_PUBLISH->AddContent('xmlform', 'xmlform', $sXmlForm, '', $Fields, 'cases_SupervisorSaveDocument?UID=' .
//$_GET['INP_DOC_UID'] . '&APP_UID=' . $_GET['APP_UID'] . '&position=' . $_GET['position']); //$_GET['INP_DOC_UID'] . '&APP_UID=' . $_GET['APP_UID'] . '&position=' . $_GET['position']);
$G_PUBLISH->AddContent('propeltable', 'cases/paged-table-inputDocumentsToRevise', 'cases/cases_ToReviseInputdocsList', $G_PUBLISH->AddContent( 'propeltable', 'cases/paged-table-inputDocumentsToRevise', 'cases/cases_ToReviseInputdocsList', $oCase->getInputDocumentsCriteria( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_GET['INP_DOC_UID'] ), array_merge( array ('DOC_UID' => $_GET['INP_DOC_UID']
$oCase->getInputDocumentsCriteria($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_GET['INP_DOC_UID']), ), $Fields ) );
array_merge(array('DOC_UID'=>$_GET['INP_DOC_UID']),$Fields));
//$aFields //$aFields
// $G_PUBLISH->AddContent('propeltable', 'cases/paged-table-inputDocuments', 'cases/cases_InputdocsList', // $G_PUBLISH->AddContent('propeltable', 'cases/paged-table-inputDocuments', 'cases/cases_InputdocsList',
//$oCase->getInputDocumentsCriteria($_SESSION['APPLICATION']));//$aFields //$oCase->getInputDocumentsCriteria($_SESSION['APPLICATION']));//$aFields
} }
G::RenderPage('publish', 'blank'); G::RenderPage( 'publish', 'blank' );
?> ?>
<script> <script>
@@ -152,4 +149,5 @@ function setSelect()
return 0; return 0;
} }
} }
</script> </script>

View File

@@ -1,59 +1,57 @@
<?php <?php
/** /**
* cases_StepToReviseOutputs.php * cases_StepToReviseOutputs.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
/* Permissions */
/* Permissions */ switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
switch ($RBAC->userCanAccess('PM_SUPERVISOR')) { case - 2:
case - 2: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; case - 1:
case - 1: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; }
}
/* Includes */
/* Includes */ G::LoadClass( 'case' );
G::LoadClass('case');
/* Menues */
/* Menues */ $G_MAIN_MENU = 'processmaker';
$G_MAIN_MENU = 'processmaker'; $G_SUB_MENU = 'cases';
$G_SUB_MENU = 'cases'; $G_ID_MENU_SELECTED = 'CASES';
$G_ID_MENU_SELECTED = 'CASES'; $G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
/* Prepare page before to show */
$oTemplatePower = new TemplatePower( PATH_TPL . 'cases/cases_Step.html' );
/* Prepare page before to show */ $oTemplatePower->prepare();
$oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html'); $G_PUBLISH = new Publisher();
$oTemplatePower->prepare(); $oHeadPublisher = & headPublisher::getSingleton();
$G_PUBLISH = new Publisher;
$oHeadPublisher =& headPublisher::getSingleton();
// check if the code for the addScriptCode is necessary since the interface is now based in ExtJs // check if the code for the addScriptCode is necessary since the interface is now based in ExtJs
$oHeadPublisher->addScriptCode(' $oHeadPublisher->addScriptCode( '
var Cse = {}; var Cse = {};
Cse.panels = {}; Cse.panels = {};
var leimnud = new maborak(); var leimnud = new maborak();
@@ -65,17 +63,16 @@ leimnud.Package.Load("cases_Step",{Type:"file",Absolute:true,Path:"/jscore/cases
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"}); leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
leimnud.exec(leimnud.fix.memoryLeak); leimnud.exec(leimnud.fix.memoryLeak);
leimnud.event.add(window,"load",function(){ leimnud.event.add(window,"load",function(){
'.(isset($_SESSION['showCasesWindow'])?'try{'.$_SESSION['showCasesWindow'].'}catch(e){}':'').'}); ' . (isset( $_SESSION['showCasesWindow'] ) ? 'try{' . $_SESSION['showCasesWindow'] . '}catch(e){}' : '') . '});
'); ' );
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower); $G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
$oCase = new Cases(); $oCase = new Cases();
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'cases/cases_OutputdocsListToRevise', $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_OutputdocsListToRevise', $oCase->getOutputDocumentsCriteriaToRevise( $_SESSION['APPLICATION'] ), '' );
$oCase->getOutputDocumentsCriteriaToRevise($_SESSION['APPLICATION']), ''); G::RenderPage( 'publish', 'blank' );
G::RenderPage('publish', 'blank');
if (! isset( $_GET['ex'] )) {
if (!isset($_GET['ex'])) { $_GET['ex'] = 0;
$_GET['ex']=0; }
}
?> ?>
@@ -97,4 +94,5 @@ function setSelect()
return 0; return 0;
} }
} }
</script> </script>

View File

@@ -1,86 +1,72 @@
<?php <?php
/** /**
* cases_SupervisorSaveDocument.php * cases_SupervisorSaveDocument.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
try {
try {
//save info //save info
G::LoadClass('case'); G::LoadClass( 'case' );
$oAppDocument = new AppDocument(); $oAppDocument = new AppDocument();
$aFields = array('APP_UID' => $_GET['APP_UID'], $aFields = array ('APP_UID' => $_GET['APP_UID'],'DEL_INDEX' => 100000,'USR_UID' => $_SESSION['USER_LOGGED'],'DOC_UID' => $_GET['UID'],'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],'APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_COMMENT' => isset( $_POST['form']['APP_DOC_COMMENT'] ) ? $_POST['form']['APP_DOC_COMMENT'] : '','APP_DOC_TITLE' => '','APP_DOC_FILENAME' => isset( $_FILES['form']['name']['APP_DOC_FILENAME'] ) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : ''
'DEL_INDEX' => 100000, );
'USR_UID' => $_SESSION['USER_LOGGED'], $oAppDocument->create( $aFields );
'DOC_UID' => $_GET['UID'], $sAppDocUid = $oAppDocument->getAppDocUid();
'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'], $info = pathinfo( $oAppDocument->getAppDocFilename() );
'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'), $ext = (isset( $info['extension'] ) ? $info['extension'] : '');
'APP_DOC_COMMENT' => isset($_POST['form']['APP_DOC_COMMENT']) ? $_POST['form']['APP_DOC_COMMENT'] : '',
'APP_DOC_TITLE' => '',
'APP_DOC_FILENAME' => isset($_FILES['form']['name']['APP_DOC_FILENAME']) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '');
$oAppDocument->create($aFields);
$sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
$ext = (isset($info['extension']) ? $info['extension'] : '');
//save the file //save the file
if (!empty($_FILES['form'])) { if (! empty( $_FILES['form'] )) {
if ($_FILES['form']['error']['APP_DOC_FILENAME'] == 0) { if ($_FILES['form']['error']['APP_DOC_FILENAME'] == 0) {
$sPathName = PATH_DOCUMENT . $_GET['APP_UID'] . PATH_SEP; $sPathName = PATH_DOCUMENT . $_GET['APP_UID'] . PATH_SEP;
$sFileName = $sAppDocUid . '.' . $ext; $sFileName = $sAppDocUid . '.' . $ext;
G::uploadFile($_FILES['form']['tmp_name']['APP_DOC_FILENAME'], $sPathName, $sFileName ); G::uploadFile( $_FILES['form']['tmp_name']['APP_DOC_FILENAME'], $sPathName, $sFileName );
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document //Plugin Hook PM_UPLOAD_DOCUMENT for upload document
$oPluginRegistry =& PMPluginRegistry::getSingleton(); $oPluginRegistry = & PMPluginRegistry::getSingleton();
if ( $oPluginRegistry->existsTrigger ( PM_UPLOAD_DOCUMENT ) && class_exists ('uploadDocumentData' ) ) { if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT ) && class_exists( 'uploadDocumentData' )) {
$oData['APP_UID'] = $_GET['APP_UID']; $oData['APP_UID'] = $_GET['APP_UID'];
$documentData = new uploadDocumentData ( $documentData = new uploadDocumentData( $_GET['APP_UID'], $_SESSION['USER_LOGGED'], $sPathName . $sFileName, $aFields['APP_DOC_FILENAME'], $sAppDocUid );
$_GET['APP_UID'], $oPluginRegistry->executeTriggers( PM_UPLOAD_DOCUMENT, $documentData );
$_SESSION['USER_LOGGED'], unlink( $sPathName . $sFileName );
$sPathName . $sFileName, }
$aFields['APP_DOC_FILENAME'], //end plugin
$sAppDocUid }
); }
$oPluginRegistry->executeTriggers ( PM_UPLOAD_DOCUMENT , $documentData ); //go to the next step
unlink ( $sPathName . $sFileName ); if (! isset( $_POST['form']['MORE'] )) {
} $oCase = new Cases();
//end plugin $aFields = $oCase->loadCase( $_GET['APP_UID'] );
} $aNextStep = $oCase->getNextSupervisorStep( $aFields['PRO_UID'], $_GET['position'], 'INPUT_DOCUMENT' );
} G::header( 'location: ' . 'cases_StepToReviseInputs?type=INPUT_DOCUMENT&INP_DOC_UID=' . $aNextStep['UID'] . '&position=' . $aNextStep['POSITION'] . '&APP_UID=' . $_GET['APP_UID'] . '&DEL_INDEX=' );
//go to the next step die();
if (!isset($_POST['form']['MORE'])) { } else {
$oCase = new Cases(); G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
$aFields = $oCase->loadCase($_GET['APP_UID']); die();
$aNextStep = $oCase->getNextSupervisorStep($aFields['PRO_UID'], $_GET['position'], 'INPUT_DOCUMENT'); }
G::header('location: ' . 'cases_StepToReviseInputs?type=INPUT_DOCUMENT&INP_DOC_UID='.$aNextStep['UID'].'&position='.$aNextStep['POSITION'].'&APP_UID='.$_GET['APP_UID'].'&DEL_INDEX='); } catch (Exception $e) {
die; /* Render Error page */
} $aMessage['MESSAGE'] = $e->getMessage();
else { $G_PUBLISH = new Publisher();
G::header('location: ' . $_SERVER['HTTP_REFERER']); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
die; G::RenderPage( 'publish' );
} }
} catch ( Exception $e ) {
/* Render Error page */
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish' );
}

View File

@@ -1,82 +1,79 @@
<?php <?php
/** /**
* cases_Step.php * cases_Step.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
/* Permissions */
/* Permissions */ switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
switch ($RBAC->userCanAccess('PM_SUPERVISOR')) { case - 2:
case - 2: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; case - 1:
case - 1: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; }
}
if ((int) $_SESSION['INDEX'] < 1) {
if ((int)$_SESSION['INDEX'] < 1) { G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
G::header('location: ' . $_SERVER['HTTP_REFERER']); die();
die; }
} /* Includes */
/* Includes */ G::LoadClass( 'case' );
G::LoadClass('case'); G::LoadClass( 'derivation' );
G::LoadClass('derivation');
/* GET , POST & $_SESSION Vars */
/* GET , POST & $_SESSION Vars */
//$_SESSION['STEP_POSITION'] = (int)$_GET['POSITION']; //$_SESSION['STEP_POSITION'] = (int)$_GET['POSITION'];
/* Menues */
$G_MAIN_MENU = 'processmaker'; /* Menues */
$G_SUB_MENU = 'cases'; $G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'CASES'; $G_SUB_MENU = 'cases';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE'; $G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
$oCase = new Cases();
$Fields = $oCase->loadCase($_SESSION['APPLICATION']); $oCase = new Cases();
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
require_once 'classes/model/AppDocument.php';
require_once 'classes/model/Users.php'; require_once 'classes/model/AppDocument.php';
require_once 'classes/model/Users.php';
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_GET['DOC']); $oAppDocument = new AppDocument();
$oo = $oAppDocument->load($_GET['DOC']); $oAppDocument->Fields = $oAppDocument->load( $_GET['DOC'] );
$oo = $oAppDocument->load( $_GET['DOC'] );
$oUser = new Users();
$aUser = $oUser->load($oAppDocument->Fields['USR_UID']); $oUser = new Users();
$Fields['CREATOR'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME']; $aUser = $oUser->load( $oAppDocument->Fields['USR_UID'] );
$Fields['CREATOR'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
$oAppDocument->Fields['VIEW'] = G::LoadTranslation('ID_OPEN');
$oAppDocument->Fields['FILE'] = 'cases_ShowDocument?a=' . $_GET['DOC'] . '&r=' . rand(); $oAppDocument->Fields['VIEW'] = G::LoadTranslation( 'ID_OPEN' );
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ViewInputDocumentToRevise', '', G::array_merges($Fields, $oAppDocument->Fields), ''); $oAppDocument->Fields['FILE'] = 'cases_ShowDocument?a=' . $_GET['DOC'] . '&r=' . rand();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ViewInputDocumentToRevise', '', G::array_merges( $Fields, $oAppDocument->Fields ), '' );
G::RenderPage( 'publish' );
G::RenderPage( 'publish' );
?>

View File

@@ -1,59 +1,57 @@
<?php <?php
/** /**
* cases_ToReviseOutputDocView.php * cases_ToReviseOutputDocView.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
/* Permissions */
/* Permissions */ switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
switch ($RBAC->userCanAccess('PM_SUPERVISOR')) { case - 2:
case - 2: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; case - 1:
case - 1: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; }
}
/* Includes */
/* Includes */ G::LoadClass( 'case' );
G::LoadClass('case');
/* Menues */
/* Menues */ $G_MAIN_MENU = 'processmaker';
$G_MAIN_MENU = 'processmaker'; $G_SUB_MENU = 'cases';
$G_SUB_MENU = 'cases'; $G_ID_MENU_SELECTED = 'CASES';
$G_ID_MENU_SELECTED = 'CASES'; $G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
/* Prepare page before to show */
$oTemplatePower = new TemplatePower( PATH_TPL . 'cases/cases_Step.html' );
/* Prepare page before to show */ $oTemplatePower->prepare();
$oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html'); $G_PUBLISH = new Publisher();
$oTemplatePower->prepare();
$G_PUBLISH = new Publisher; $oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addScriptCode( '
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptCode('
var Cse = {}; var Cse = {};
Cse.panels = {}; Cse.panels = {};
var leimnud = new maborak(); var leimnud = new maborak();
@@ -65,37 +63,38 @@ leimnud.Package.Load("cases_Step",{Type:"file",Absolute:true,Path:"/jscore/cases
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"}); leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
leimnud.exec(leimnud.fix.memoryLeak); leimnud.exec(leimnud.fix.memoryLeak);
leimnud.event.add(window,"load",function(){ leimnud.event.add(window,"load",function(){
'.(isset($_SESSION['showCasesWindow'])?'try{'.$_SESSION['showCasesWindow'].'}catch(e){}':'').'}); ' . (isset( $_SESSION['showCasesWindow'] ) ? 'try{' . $_SESSION['showCasesWindow'] . '}catch(e){}' : '') . '});
'); ' );
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower); $G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
// //
require_once 'classes/model/OutputDocument.php'; require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new OutputDocument(); $oOutputDocument = new OutputDocument();
$aOD = $oOutputDocument->load($_GET['UID']); $aOD = $oOutputDocument->load( $_GET['UID'] );
require_once 'classes/model/AppDocument.php'; require_once 'classes/model/AppDocument.php';
$oAppDocument = new AppDocument(); $oAppDocument = new AppDocument();
$aFields = $oAppDocument->load($_GET['DOC']); $aFields = $oAppDocument->load( $_GET['DOC'] );
$aFields['VIEW'] = G::LoadTranslation('ID_OPEN'); $aFields['VIEW'] = G::LoadTranslation( 'ID_OPEN' );
switch ($aOD ['OUT_DOC_GENERATE']) { switch ($aOD['OUT_DOC_GENERATE']) {
case 'DOC': case 'DOC':
$aFields['FILE1'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand(); $aFields['FILE1'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand();
break; break;
case 'PDF': case 'PDF':
$aFields['FILE2'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand(); $aFields['FILE2'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand();
break; break;
case 'BOTH': case 'BOTH':
$aFields['FILE1'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand(); $aFields['FILE1'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand();
$aFields['FILE2'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand(); $aFields['FILE2'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand();
break; break;
} }
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ViewOutputDocumentToRevise', '', G::array_merges($aOD, $aFields), ''); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ViewOutputDocumentToRevise', '', G::array_merges( $aOD, $aFields ), '' );
// //
G::RenderPage('publish', 'blank'); G::RenderPage( 'publish', 'blank' );
if(!isset($_GET['ex'])) $_GET['ex']=0; if (! isset( $_GET['ex'] ))
$_GET['ex'] = 0;
?> ?>
<script type="text/javascript"> <script type="text/javascript">
/*------------------------------ To Revise Routines ---------------------------*/ /*------------------------------ To Revise Routines ---------------------------*/
@@ -116,4 +115,5 @@ function setSelect()
return 0; return 0;
} }
} }
</script> </script>

View File

@@ -1,75 +1,74 @@
<?php <?php
/** /**
* cases_UsersReassign.php * cases_UsersReassign.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
try {
try { global $RBAC;
global $RBAC; switch ($RBAC->userCanAccess( 'PM_REASSIGNCASE' )) {
switch ($RBAC->userCanAccess('PM_REASSIGNCASE')) { case - 2:
case -2: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; case - 1:
case -1: G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::header( 'location: ../login/login' );
G::header('location: ../login/login'); die();
die; break;
break; }
} G::LoadClass( 'case' );
G::LoadClass('case'); $oCase = new Cases();
$oCase = new Cases(); $aCases = array ();
$aCases = array(); $aUsers = array ();
$aUsers = array(); if (isset( $_POST['USERS'] ) && is_array( $_POST['USERS'] )) {
if (isset($_POST['USERS']) && is_array($_POST['USERS'])) { foreach ($_POST['USERS'] as $sKey => $sUser) {
foreach ($_POST['USERS'] as $sKey => $sUser) { if ($sUser != '') {
if ($sUser != '') { $oCase->reassignCase( $_POST['APPLICATIONS'][$sKey], $_POST['INDEXES'][$sKey], $_POST['USR_UID'], $sUser );
$oCase->reassignCase($_POST['APPLICATIONS'][$sKey], $_POST['INDEXES'][$sKey], $_POST['USR_UID'], $sUser); $aCases[] = $_POST['APPLICATIONS'][$sKey];
$aCases[] = $_POST['APPLICATIONS'][$sKey]; $aUsers[] = $sUser;
$aUsers[] = $sUser; }
} }
} }
} G::LoadClass( 'case' );
G::LoadClass('case'); $oCase = new Cases();
$oCase = new Cases(); require_once 'classes/model/Users.php';
require_once 'classes/model/Users.php'; $oUser = new Users();
$oUser = new Users(); $sText = '';
$sText = ''; foreach ($aCases as $sKey => $sCase) {
foreach ($aCases as $sKey => $sCase) { $aCase = $oCase->loadCase( $sCase );
$aCase = $oCase->loadCase($sCase); $aUser = $oUser->load( $aUsers[$sKey] );
$aUser = $oUser->load($aUsers[$sKey]); $sText .= '(' . $aCase['APP_NUMBER'] . ') ' . $aCase['TITLE'] . ' => ' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' (' . $aUser['USR_USERNAME'] . ')' . '<br />';
$sText .= '(' . $aCase['APP_NUMBER'] . ') ' . $aCase['TITLE'] . ' => ' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' (' . $aUser['USR_USERNAME'] . ')' . '<br />'; }
} $G_MAIN_MENU = 'processmaker';
$G_MAIN_MENU = 'processmaker'; $G_SUB_MENU = 'cases';
$G_SUB_MENU = 'cases'; $G_ID_MENU_SELECTED = 'CASES';
$G_ID_MENU_SELECTED = 'CASES'; $G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN'; $G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher; $aMessage['MESSAGE'] = $sText;
$aMessage['MESSAGE'] = $sText; $aMessage['URL'] = 'cases_ReassignByUser?REASSIGN_USER=' . $_POST['USR_UID'];
$aMessage['URL'] = 'cases_ReassignByUser?REASSIGN_USER=' . $_POST['USR_UID']; $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ReassignShowInfo', '', $aMessage );
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ReassignShowInfo', '', $aMessage); G::RenderPage( 'publish' );
G::RenderPage('publish'); } catch (Exception $oException) {
} die( $oException->getMessage() );
catch (Exception $oException) { }
die($oException->getMessage());
}

View File

@@ -1,110 +1,100 @@
<?php <?php
/** /**
* To change this template, choose Tools | Templates * To change this template, choose Tools | Templates
* and open the template in the editor. * and open the template in the editor.
*/ */
require_once ( "classes/model/AdditionalTables.php" ); require_once ("classes/model/AdditionalTables.php");
require_once ( "classes/model/Fields.php" ); require_once ("classes/model/Fields.php");
// passing the parameters // passing the parameters
$pmTableName = (isset($_POST['tableName'])) ? $_POST['tableName'] : 'contenders'; $pmTableName = (isset( $_POST['tableName'] )) ? $_POST['tableName'] : 'contenders';
$pmTableFields = (isset($_POST['tableFields'])) ? G::json_decode($_POST['tableFields']) : array(); $pmTableFields = (isset( $_POST['tableFields'] )) ? G::json_decode( $_POST['tableFields'] ) : array ();
// default parameters // default parameters
//$pmTableName = 'Sender'; //$pmTableName = 'Sender';
$pmTableFields = array(array('FLD_NAME'=>'APP_UID'),array('FLD_NAME'=>'CON_NAME'),array('FLD_NAME'=>'CON_ADDR'),array('FLD_NAME'=>'_cedula')); $pmTableFields = array (array ('FLD_NAME' => 'APP_UID'
),array ('FLD_NAME' => 'CON_NAME'
),array ('FLD_NAME' => 'CON_ADDR'
),array ('FLD_NAME' => '_cedula'
)
);
// setting the data to assemble the table // setting the data to assemble the table
$aData = array(); $aData = array ();
$aData['ADD_TAB_NAME'] = $pmTableName; $aData['ADD_TAB_NAME'] = $pmTableName;
// creating the objects to create the table and records // creating the objects to create the table and records
$oFields = new Fields(); $oFields = new Fields();
$oAdditionalTables = new AdditionalTables(); $oAdditionalTables = new AdditionalTables();
$sAddTabUid = $oAdditionalTables->create($aData, $pmTableFields); $sAddTabUid = $oAdditionalTables->create( $aData, $pmTableFields );
foreach ($pmTableFields as $iRow => $aRow) { foreach ($pmTableFields as $iRow => $aRow) {
$pmTableFields[$iRow]['FLD_NAME'] = strtoupper($aRow['FLD_NAME']); $pmTableFields[$iRow]['FLD_NAME'] = strtoupper( $aRow['FLD_NAME'] );
$pmTableFields[$iRow]['FLD_DESCRIPTION'] = isset($aRow['FLD_DESCRIPTION']) ? $aRow['FLD_DESCRIPTION'] : $aRow['FLD_NAME']; $pmTableFields[$iRow]['FLD_DESCRIPTION'] = isset( $aRow['FLD_DESCRIPTION'] ) ? $aRow['FLD_DESCRIPTION'] : $aRow['FLD_NAME'];
$pmTableFields[$iRow]['FLD_TYPE'] = isset($aRow['FLD_TYPE']) ? $aRow['FLD_TYPE'] : 'VARCHAR'; $pmTableFields[$iRow]['FLD_TYPE'] = isset( $aRow['FLD_TYPE'] ) ? $aRow['FLD_TYPE'] : 'VARCHAR';
$pmTableFields[$iRow]['FLD_SIZE'] = isset($aRow['FLD_SIZE']) ? $aRow['FLD_SIZE'] : '32'; $pmTableFields[$iRow]['FLD_SIZE'] = isset( $aRow['FLD_SIZE'] ) ? $aRow['FLD_SIZE'] : '32';
$pmTableFields[$iRow]['FLD_NULL'] = isset($aRow['FLD_NULL']) ? $aRow['FLD_NULL'] : 'off'; $pmTableFields[$iRow]['FLD_NULL'] = isset( $aRow['FLD_NULL'] ) ? $aRow['FLD_NULL'] : 'off';
$pmTableFields[$iRow]['FLD_AUTO_INCREMENT'] = isset($aRow['FLD_AUTO_INCREMENT']) ? $aRow['FLD_AUTO_INCREMENT'] : 'off'; $pmTableFields[$iRow]['FLD_AUTO_INCREMENT'] = isset( $aRow['FLD_AUTO_INCREMENT'] ) ? $aRow['FLD_AUTO_INCREMENT'] : 'off';
$pmTableFields[$iRow]['FLD_KEY'] = isset($aRow['FLD_KEY']) ? $aRow['FLD_KEY'] : 'off'; $pmTableFields[$iRow]['FLD_KEY'] = isset( $aRow['FLD_KEY'] ) ? $aRow['FLD_KEY'] : 'off';
$pmTableFields[$iRow]['FLD_FOREIGN_KEY'] = isset($aRow['FLD_FOREIGN_KEY']) ? $aRow['FLD_FOREIGN_KEY'] : 'off'; $pmTableFields[$iRow]['FLD_FOREIGN_KEY'] = isset( $aRow['FLD_FOREIGN_KEY'] ) ? $aRow['FLD_FOREIGN_KEY'] : 'off';
$pmTableFields[$iRow]['FLD_FOREIGN_KEY_TABLE'] = isset($aRow['FLD_FOREIGN_KEY_TABLE']) ? $aRow['FLD_FOREIGN_KEY_TABLE'] : ''; $pmTableFields[$iRow]['FLD_FOREIGN_KEY_TABLE'] = isset( $aRow['FLD_FOREIGN_KEY_TABLE'] ) ? $aRow['FLD_FOREIGN_KEY_TABLE'] : '';
} }
foreach ($pmTableFields as $iRow => $aRow) { foreach ($pmTableFields as $iRow => $aRow) {
$oFields->create(array('FLD_INDEX' => $iRow+1, $oFields->create( array ('FLD_INDEX' => $iRow + 1,'ADD_TAB_UID' => $sAddTabUid,'FLD_NAME' => $aRow['FLD_NAME'],'FLD_DESCRIPTION' => isset( $aRow['FLD_DESCRIPTION'] ) ? $aRow['FLD_DESCRIPTION'] : '','FLD_TYPE' => isset( $aRow['FLD_TYPE'] ) ? $aRow['FLD_TYPE'] : 'VARCHAR','FLD_SIZE' => isset( $aRow['FLD_SIZE'] ) ? $aRow['FLD_SIZE'] : '32','FLD_NULL' => ($aRow['FLD_NULL'] == 'on' ? 1 : 0),'FLD_AUTO_INCREMENT' => ($aRow['FLD_AUTO_INCREMENT'] == 'on' ? 1 : 0),'FLD_KEY' => ($aRow['FLD_KEY'] == 'on' ? 1 : 0),'FLD_FOREIGN_KEY' => ($aRow['FLD_FOREIGN_KEY'] == 'on' ? 1 : 0),'FLD_FOREIGN_KEY_TABLE' => isset( $aRow['FLD_FOREIGN_KEY_TABLE'] ) ? $aRow['FLD_FOREIGN_KEY_TABLE'] : ''
'ADD_TAB_UID' => $sAddTabUid, ) );
'FLD_NAME' => $aRow['FLD_NAME'],
'FLD_DESCRIPTION' => isset($aRow['FLD_DESCRIPTION']) ? $aRow['FLD_DESCRIPTION'] : '', $aFields[] = array ('sType' => isset( $aRow['FLD_TYPE'] ) ? $aRow['FLD_TYPE'] : 'VARCHAR','iSize' => isset( $aRow['FLD_SIZE'] ) ? $aRow['FLD_SIZE'] : '32','sFieldName' => $aRow['FLD_NAME'],'bNull' => ($aRow['FLD_NULL'] == 'on' ? 1 : 0),'bAI' => ($aRow['FLD_AUTO_INCREMENT'] == 'on' ? 1 : 0),'bPrimaryKey' => ($aRow['FLD_KEY'] == 'on' ? 1 : 0)
'FLD_TYPE' => isset($aRow['FLD_TYPE']) ? $aRow['FLD_TYPE'] : 'VARCHAR', );
'FLD_SIZE' => isset($aRow['FLD_SIZE']) ? $aRow['FLD_SIZE'] : '32', }
'FLD_NULL' => ($aRow['FLD_NULL'] == 'on' ? 1 : 0),
'FLD_AUTO_INCREMENT' => ($aRow['FLD_AUTO_INCREMENT'] == 'on' ? 1 : 0), $oAdditionalTables->createTable( strtoupper( $pmTableName ), 'wf', $aFields );
'FLD_KEY' => ($aRow['FLD_KEY'] == 'on' ? 1 : 0), $oAdditionalTables->createPropelClasses( strtoupper( $pmTableName ), $pmTableName, $pmTableFields, $sAddTabUid );
'FLD_FOREIGN_KEY' => ($aRow['FLD_FOREIGN_KEY'] == 'on' ? 1 : 0),
'FLD_FOREIGN_KEY_TABLE' => isset($aRow['FLD_FOREIGN_KEY_TABLE']) ? $aRow['FLD_FOREIGN_KEY_TABLE'] : '')); require_once ("classes/model/Application.php");
require_once ("classes/model/AdditionalTables.php");
$aFields[] = array('sType' => isset($aRow['FLD_TYPE']) ? $aRow['FLD_TYPE'] : 'VARCHAR', require_once ("classes/model/Fields.php");
'iSize' => isset($aRow['FLD_SIZE']) ? $aRow['FLD_SIZE'] : '32',
'sFieldName' => $aRow['FLD_NAME'], $Criteria = new Criteria( 'workflow' );
'bNull' => ($aRow['FLD_NULL'] == 'on' ? 1 : 0), $Criteria->addSelectColumn( ApplicationPeer::APP_UID );
'bAI' => ($aRow['FLD_AUTO_INCREMENT'] == 'on' ? 1 : 0), $Criteria->addSelectColumn( ApplicationPeer::APP_DATA );
'bPrimaryKey' => ($aRow['FLD_KEY'] == 'on' ? 1 : 0));
}
$oAdditionalTables->createTable(strtoupper($pmTableName), 'wf', $aFields);
$oAdditionalTables->createPropelClasses(strtoupper($pmTableName), $pmTableName, $pmTableFields, $sAddTabUid);
require_once ( "classes/model/Application.php" );
require_once ( "classes/model/AdditionalTables.php" );
require_once ( "classes/model/Fields.php" );
$Criteria = new Criteria('workflow');
$Criteria->addSelectColumn (ApplicationPeer::APP_UID);
$Criteria->addSelectColumn (ApplicationPeer::APP_DATA);
// $Criteria->add (AppCacheViewPeer::DEL_THREAD_STATUS, 'OPEN'); // $Criteria->add (AppCacheViewPeer::DEL_THREAD_STATUS, 'OPEN');
$oDataset = ApplicationPeer::doSelectRS($Criteria); $oDataset = ApplicationPeer::doSelectRS( $Criteria );
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next(); $oDataset->next();
$aProcesses = array(); $aProcesses = array ();
$i = 0; $i = 0;
while ($aRow = $oDataset->getRow()) { while ($aRow = $oDataset->getRow()) {
$appuid = $aRow['APP_UID']; $appuid = $aRow['APP_UID'];
$data = unserialize ( $aRow['APP_DATA'] ); $data = unserialize( $aRow['APP_DATA'] );
$cedula = '234'. rand (1000,999999); $cedula = '234' . rand( 1000, 999999 );
$nombre = 'nombre '. rand (1000,999999); $nombre = 'nombre ' . rand( 1000, 999999 );
$direccion = 'direccion '. rand (1000,999999); $direccion = 'direccion ' . rand( 1000, 999999 );
if ( isset ( $data['_cedula'] ) ) { if (isset( $data['_cedula'] )) {
$cedula = $data['_cedula']; $cedula = $data['_cedula'];
$nombre = isset($data['_nombre']) ? $data['_nombre'] : ''; $nombre = isset( $data['_nombre'] ) ? $data['_nombre'] : '';
$direccion = isset($data['_direccion']) ? $data['_direccion'] : ''; $direccion = isset( $data['_direccion'] ) ? $data['_direccion'] : '';
print "$i $appuid $cedula <br>"; print "$i $appuid $cedula <br>";
} }
// print_r ( $aRow); // print_r ( $aRow);
$sql = "insert CONTENDERS VALUES ( '$appuid', '$nombre', '$direccion', '$cedula' )"; $sql = "insert CONTENDERS VALUES ( '$appuid', '$nombre', '$direccion', '$cedula' )";
$con = Propel::getConnection('workflow'); $con = Propel::getConnection( 'workflow' );
$stmt = $con->createStatement(); $stmt = $con->createStatement();
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC); $rs = $stmt->executeQuery( $sql, ResultSet::FETCHMODE_ASSOC );
$i++; $i ++;
// if ( $i == 100 ) die; // if ( $i == 100 ) die;
/* if ( strpos ( $aRow['APP_DATA'], 'cedula' ) !== false ) { /* if ( strpos ( $aRow['APP_DATA'], 'cedula' ) !== false ) {
print_r ( $aRow ); print_r ( $aRow );
print "<hr>"; print "<hr>";
$i++; $i++;
if ( $i == 10 ) die; if ( $i == 10 ) die;
} }
*/ */
$oDataset->next(); $oDataset->next();
} }
print "--$i--"; print "--$i--";
?>

View File

@@ -1,29 +1,29 @@
<?php <?php
switch ($RBAC->userCanAccess('PM_SUPERVISOR')) { switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
case - 2: case - 2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
case - 1: case - 1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header('location: ../login/login'); G::header( 'location: ../login/login' );
die; die();
break; break;
} }
if (($RBAC_Response = $RBAC->userCanAccess("PM_USERS")) != 1) if (($RBAC_Response = $RBAC->userCanAccess( "PM_USERS" )) != 1)
return $RBAC_Response; return $RBAC_Response;
$G_MAIN_MENU = 'processmaker';
$G_MAIN_MENU = 'processmaker'; $G_SUB_MENU = 'cases';
$G_SUB_MENU = 'cases'; $G_ID_MENU_SELECTED = 'CASES';
$G_ID_MENU_SELECTED = 'CASES'; $G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
$G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher; $G_PUBLISH->AddContent( 'view', 'cases/cases_toRevise' );
$G_PUBLISH->AddContent('view', 'cases/cases_toRevise'); $G_PUBLISH->AddContent( 'smarty', 'cases/cases_toReviseIn', '', '', array () );
$G_PUBLISH->AddContent('smarty', 'cases/cases_toReviseIn', '', '', array());
G::RenderPage( "publish-treeview" );
G::RenderPage("publish-treeview");

View File

@@ -1,89 +1,86 @@
<?php <?php
/** /**
* data_casesSchedulerLog.php * data_casesSchedulerLog.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
require_once 'classes/model/LogCasesSchedulerPeer.php';
require_once 'classes/model/LogCasesSchedulerPeer.php'; require_once 'classes/model/LogCasesScheduler.php';
require_once 'classes/model/LogCasesScheduler.php'; G::LoadClass( 'configuration' );
G::LoadClass('configuration');
$co = new Configurations();
$co = new Configurations(); $config = $co->getConfiguration( 'casesSchedulerLogList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
$config = $co->getConfiguration('casesSchedulerLogList', 'pageSize','',$_SESSION['USER_LOGGED']); $limit_size = isset( $config['pageSize'] ) ? $config['pageSize'] : 20;
$limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
$start = isset( $_REQUEST['start'] ) ? $_REQUEST['start'] : 0;
$start = isset($_REQUEST['start'])? $_REQUEST['start'] : 0; $limit = isset( $_REQUEST['limit'] ) ? $_REQUEST['limit'] : $limit_size;
$limit = isset($_REQUEST['limit'])? $_REQUEST['limit'] : $limit_size; $filter = (isset( $_POST['textFilter'] )) ? $_POST['textFilter'] : '';
$filter = (isset($_POST['textFilter'])) ? $_POST['textFilter'] : '';
$oCriteria = new Criteria( 'workflow' );
$oCriteria = new Criteria('workflow'); $oCriteria->clearSelectColumns();
$oCriteria->clearSelectColumns(); $oCriteria->addSelectColumn( LogCasesSchedulerPeer::LOG_CASE_UID );
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::LOG_CASE_UID); $oCriteria->addSelectColumn( LogCasesSchedulerPeer::PRO_UID );
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::PRO_UID); $oCriteria->addSelectColumn( LogCasesSchedulerPeer::TAS_UID );
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::TAS_UID); $oCriteria->addSelectColumn( LogCasesSchedulerPeer::USR_NAME );
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::USR_NAME); $oCriteria->addSelectColumn( LogCasesSchedulerPeer::EXEC_DATE );
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::EXEC_DATE); $oCriteria->addSelectColumn( LogCasesSchedulerPeer::EXEC_HOUR );
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::EXEC_HOUR); $oCriteria->addSelectColumn( LogCasesSchedulerPeer::RESULT );
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::RESULT); $oCriteria->addSelectColumn( LogCasesSchedulerPeer::SCH_UID );
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::SCH_UID); $oCriteria->addSelectColumn( LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS );
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS); $oCriteria->addSelectColumn( LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS );
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS);
if ($filter != '') {
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 ) );
$c_or = $oCriteria->getNewCriterion(LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS, '%'.$filter.'%', Criteria::LIKE)->addOr( $oCriteria->add( $c_or );
$oCriteria->getNewCriterion(LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS,'%'.$filter.'%', Criteria::LIKE)); }
$oCriteria->add($c_or);
} $oDataset = LogCasesSchedulerPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset = LogCasesSchedulerPeer::doSelectRS ( $oCriteria );
$oDataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC ); $addTables = Array ();
while ($oDataset->next()) {
$addTables = Array(); $addTables[] = $oDataset->getRow();
while( $oDataset->next() ) { }
$addTables[] = $oDataset->getRow(); $results = count( $addTables );
}
$results = count($addTables); $oCriteria->setOffset( $start );
$oCriteria->setLimit( $limit );
$oCriteria->setOffset($start);
$oCriteria->setLimit($limit); $oCriteria->addDescendingOrderByColumn( LogCasesSchedulerPeer::EXEC_DATE );
$oCriteria->addDescendingOrderByColumn( LogCasesSchedulerPeer::EXEC_HOUR );
$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 );
//$oDataset = LogCasesSchedulerPeer::doSelectRS ( $oCriteria ); //$oDataset = LogCasesSchedulerPeer::doSelectRS ( $oCriteria );
//$oDataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC ); //$oDataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
$addTables = Array();
while( $oDataset->next() ) { $addTables = Array ();
$addTables[] = $oDataset->getRow(); while ($oDataset->next()) {
} $addTables[] = $oDataset->getRow();
}
//$oLogCasesScheduler = new LogCasesScheduler(); //$oLogCasesScheduler = new LogCasesScheduler();
//$arrData = $oLogCasesScheduler->getAll(); //$arrData = $oLogCasesScheduler->getAll();
echo '{results: ' . $results . ', rows: ' . G::json_encode( $addTables ) . '}';
echo '{results: '.$results.', rows: '.G::json_encode($addTables).'}';

View File

@@ -1,72 +1,73 @@
<?php <?php
if( isset($_SESSION['TRIGGER_DEBUG']['info']) ) { if (isset( $_SESSION['TRIGGER_DEBUG']['info'] )) {
$aTriggers = $_SESSION['TRIGGER_DEBUG']['info']; $aTriggers = $_SESSION['TRIGGER_DEBUG']['info'];
} else { } else {
$aTriggers[0] = $_SESSION['TRIGGER_DEBUG']; $aTriggers[0] = $_SESSION['TRIGGER_DEBUG'];
} }
//print_r($aTriggers);die; //print_r($aTriggers);die;
$triggersList = Array(); $triggersList = Array ();
$i = 0; $i = 0;
foreach($aTriggers as $aTrigger) { foreach ($aTriggers as $aTrigger) {
if($aTrigger['NUM_TRIGGERS'] != 0) { if ($aTrigger['NUM_TRIGGERS'] != 0) {
foreach($aTrigger['TRIGGERS_NAMES'] as $index=>$name) { foreach ($aTrigger['TRIGGERS_NAMES'] as $index => $name) {
$triggersList[$i]['name'] = $name; $triggersList[$i]['name'] = $name;
$triggersList[$i]['execution_time'] = strtolower($aTrigger['TIME']); $triggersList[$i]['execution_time'] = strtolower( $aTrigger['TIME'] );
//$t_code = $aTrigger['TRIGGERS_VALUES'][$index]['TRI_WEBBOT']; //$t_code = $aTrigger['TRIGGERS_VALUES'][$index]['TRI_WEBBOT'];
//$t_code = str_replace('"', '\'',$t_code); //$t_code = str_replace('"', '\'',$t_code);
//$t_code = addslashes($t_code); //$t_code = addslashes($t_code);
//$t_code = Only1br($t_code); //$t_code = Only1br($t_code);
//highlighting the trigger code using the geshi third party library
G::LoadThirdParty('geshi', 'geshi'); //highlighting the trigger code using the geshi third party library
$geshi = new GeSHi($aTrigger['TRIGGERS_VALUES'][$index]['TRI_WEBBOT'], 'php'); G::LoadThirdParty( 'geshi', 'geshi' );
$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 2); $geshi = new GeSHi( $aTrigger['TRIGGERS_VALUES'][$index]['TRI_WEBBOT'], 'php' );
$geshi->set_line_style('background: #f0f0f0;'); $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++; $triggersList[$i]['code'] = $geshi->parse_code(); //$aTrigger['TRIGGERS_VALUES'][$index]['TRI_WEBBOT'];
} $i ++;
} else { }
} else {
}
} }
}
//print_r($_SESSION['TRIGGER_DEBUG']['ERRORS']); die; //print_r($_SESSION['TRIGGER_DEBUG']['ERRORS']); die;
$DEBUG_ERRORS = array_unique($_SESSION['TRIGGER_DEBUG']['ERRORS']); $DEBUG_ERRORS = array_unique( $_SESSION['TRIGGER_DEBUG']['ERRORS'] );
foreach($DEBUG_ERRORS as $error){ foreach ($DEBUG_ERRORS as $error) {
if(isset($error['ERROR']) and $error['ERROR'] != ''){ if (isset( $error['ERROR'] ) and $error['ERROR'] != '') {
$triggersList[$i]['name'] = 'Error'; $triggersList[$i]['name'] = 'Error';
$triggersList[$i]['execution_time'] = 'error'; $triggersList[$i]['execution_time'] = 'error';
$triggersList[$i]['code'] = $error['ERROR']; $triggersList[$i]['code'] = $error['ERROR'];
$i++; $i ++;
} }
if(isset($error['FATAL']) and $error['FATAL'] != ''){ if (isset( $error['FATAL'] ) and $error['FATAL'] != '') {
$error['FATAL'] = str_replace("<br />", "\n", $error['FATAL']); $error['FATAL'] = str_replace( "<br />", "\n", $error['FATAL'] );
$tmp = explode("\n", $error['FATAL']); $tmp = explode( "\n", $error['FATAL'] );
$triggersList[$i]['name'] = isset($tmp[0])? $tmp[0]: 'Fatal Error in trigger'; $triggersList[$i]['name'] = isset( $tmp[0] ) ? $tmp[0] : 'Fatal Error in trigger';
$triggersList[$i]['execution_time'] = 'Fatal error'; $triggersList[$i]['execution_time'] = 'Fatal error';
$triggersList[$i]['code'] = $error['FATAL']; $triggersList[$i]['code'] = $error['FATAL'];
$i++; $i ++;
} }
} }
/*echo '{total:5, data:[ /*echo '{total:5, data:[
{name:"trigger1", execution_time:"after"}, {name:"trigger1", execution_time:"after"},
{name:"trigger2", execution_time:"before"}, {name:"trigger2", execution_time:"before"},
{name:"trigger13", 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,98 +1,104 @@
<?php <?php
$request = isset($_POST['request']) ? $_POST['request'] : ''; $request = isset( $_POST['request'] ) ? $_POST['request'] : '';
switch ($request) { switch ($request) {
case 'getRows': case 'getRows':
$fieldname = $_POST['fieldname']; $fieldname = $_POST['fieldname'];
G::LoadClass('case'); G::LoadClass( 'case' );
$oApp = new Cases(); $oApp = new Cases();
$aFields = $oApp->loadCase($_SESSION['APPLICATION']); $aFields = $oApp->loadCase( $_SESSION['APPLICATION'] );
$aVars = Array(); $aVars = Array ();
for ($i = 0; $i < count($_SESSION['TRIGGER_DEBUG']['DATA']); $i++) { for ($i = 0; $i < count( $_SESSION['TRIGGER_DEBUG']['DATA'] ); $i ++) {
$aVars[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value']; $aVars[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value'];
} }
$aVars = array_merge($aFields['APP_DATA'], $aVars); $aVars = array_merge( $aFields['APP_DATA'], $aVars );
$field = $aVars[$fieldname]; $field = $aVars[$fieldname];
$response->headers = Array(); $response->headers = Array ();
$response->columns = Array(); $response->columns = Array ();
$response->rows = Array(); $response->rows = Array ();
$sw = true; $sw = true;
$j = 0; $j = 0;
if (is_array($field)) { if (is_array( $field )) {
foreach ($field as $row) { foreach ($field as $row) {
if ($sw) { if ($sw) {
foreach ($row as $key => $value) { foreach ($row as $key => $value) {
$response->headers[] = Array('name' => $key); $response->headers[] = Array ('name' => $key
$response->columns[] = Array('header' => $key, 'width' => 100, 'dataIndex' => $key); );
} $response->columns[] = Array ('header' => $key,'width' => 100,'dataIndex' => $key
$sw = false; );
} }
$sw = false;
}
$tmp = Array();
foreach ($row as $key => $value) { $tmp = Array ();
$tmp[] = $value; foreach ($row as $key => $value) {
} $tmp[] = $value;
$response->rows[$j++] = $tmp; }
} $response->rows[$j ++] = $tmp;
} else { }
if (is_object($field)) { } else {
$response->headers = Array(Array('name' => 'name'), Array('name' => 'value')); if (is_object( $field )) {
$response->columns = Array(Array('header' => 'Property', 'width' => 100, 'dataIndex' => 'name'), $response->headers = Array (Array ('name' => 'name'
Array('header' => 'Value', 'width' => 100, 'dataIndex' => 'value')); ),Array ('name' => 'value'
)
foreach ($field as $key => $value) { );
$response->rows[] = Array($key, $value); $response->columns = Array (Array ('header' => 'Property','width' => 100,'dataIndex' => 'name'
} ),Array ('header' => 'Value','width' => 100,'dataIndex' => 'value'
} )
} );
echo G::json_encode($response); foreach ($field as $key => $value) {
break; $response->rows[] = Array ($key,$value
default: );
G::LoadClass('case'); }
$oApp = new Cases(); }
$aFields = $oApp->loadCase($_SESSION['APPLICATION']); }
$aVars = Array(); echo G::json_encode( $response );
for ($i = 0; $i < count($_SESSION['TRIGGER_DEBUG']['DATA']); $i++) { break;
$aVars[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value']; default:
} G::LoadClass( 'case' );
$oApp = new Cases();
$aVars = array_merge($aFields['APP_DATA'], $aVars); $aFields = $oApp->loadCase( $_SESSION['APPLICATION'] );
$aVars = Array ();
if (isset($_POST['filter']) && $_POST['filter'] == 'dyn') { for ($i = 0; $i < count( $_SESSION['TRIGGER_DEBUG']['DATA'] ); $i ++) {
$sysVars = array_keys(G::getSystemConstants()); $aVars[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value'];
$varNames = array_keys($aVars); }
foreach ($varNames as $var) {
if (in_array($var, $sysVars)) { $aVars = array_merge( $aFields['APP_DATA'], $aVars );
unset($aVars[$var]);
} if (isset( $_POST['filter'] ) && $_POST['filter'] == 'dyn') {
} $sysVars = array_keys( G::getSystemConstants() );
} $varNames = array_keys( $aVars );
if (isset($_POST['filter']) && $_POST['filter'] == 'sys') { foreach ($varNames as $var) {
$aVars = G::getSystemConstants(); if (in_array( $var, $sysVars )) {
} unset( $aVars[$var] );
}
ksort($aVars); }
$return_object->totalCount = 1; }
if (isset( $_POST['filter'] ) && $_POST['filter'] == 'sys') {
foreach ($aVars as $i => $var) { $aVars = G::getSystemConstants();
if (is_array($var) || is_object($var)) { }
$aVars[$i] = print_r($var, true);
} ksort( $aVars );
} $return_object->totalCount = 1;
$return_object->data[0] = $aVars; foreach ($aVars as $i => $var) {
if (is_array( $var ) || is_object( $var )) {
echo G::json_encode($return_object); $aVars[$i] = print_r( $var, true );
break; }
} }
$return_object->data[0] = $aVars;
echo G::json_encode( $return_object );
break;
}

View File

@@ -1,29 +1,27 @@
<?php <?php
/** /**
* index.php * index.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ //$newFile = str_replace ( 'index.php', 'cases_List.php' , __FILE__ ) ;
//$newFile = str_replace ( 'index.php', 'cases_List.php' , __FILE__ ) ; $newFile = str_replace( 'index.php', 'main.php', __FILE__ );
$newFile = str_replace ( 'index.php', 'main.php' , __FILE__ ) ; return $newFile;
return $newFile;

View File

@@ -1,36 +1,35 @@
<?php <?php
/** /**
* main.php Cases List main processor * main.php Cases List main processor
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
$RBAC->requirePermissions( 'PM_CASES' );
$RBAC->requirePermissions('PM_CASES');
$G_MAIN_MENU = 'processmaker';
$G_MAIN_MENU = 'processmaker'; $G_ID_MENU_SELECTED = 'CASES';
$G_ID_MENU_SELECTED = 'CASES';
$_POST['qs'] = isset( $_SERVER['QUERY_STRING'] ) && $_SERVER['QUERY_STRING'] != '' ? '?' . $_SERVER['QUERY_STRING'] : '';
$_POST['qs'] = isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '' ? '?' . $_SERVER['QUERY_STRING'] : '';
$G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher; $G_PUBLISH->AddContent( 'view', 'cases/cases_Load' );
$G_PUBLISH->AddContent('view', 'cases/cases_Load'); G::RenderPage( 'publish' );
G::RenderPage('publish');

View File

@@ -12,85 +12,81 @@
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/ */
G::LoadClass("configuration"); G::LoadClass( "configuration" );
$conf = new Configurations(); $conf = new Configurations();
$oHeadPublisher = &headPublisher::getSingleton(); $oHeadPublisher = &headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript("cases/main", false); //Adding a javascript file .js $oHeadPublisher->addExtJsScript( "cases/main", false ); //Adding a javascript file .js
$oHeadPublisher->addContent("cases/main"); //Adding a html file .html. $oHeadPublisher->addContent( "cases/main" ); //Adding a html file .html.
$keyMem = "USER_PREFERENCES" . $_SESSION["USER_LOGGED"]; $keyMem = "USER_PREFERENCES" . $_SESSION["USER_LOGGED"];
$memcache = &PMmemcached::getSingleton(SYS_SYS); $memcache = &PMmemcached::getSingleton( SYS_SYS );
if (($arrayConfig = $memcache->get($keyMem)) === false) { if (($arrayConfig = $memcache->get( $keyMem )) === false) {
$conf->loadConfig($x, "USER_PREFERENCES", "", "", $_SESSION["USER_LOGGED"], ""); $conf->loadConfig( $x, "USER_PREFERENCES", "", "", $_SESSION["USER_LOGGED"], "" );
$arrayConfig = $conf->aConfig; $arrayConfig = $conf->aConfig;
$memcache->set($keyMem, $arrayConfig, PMmemcached::ONE_HOUR); $memcache->set( $keyMem, $arrayConfig, PMmemcached::ONE_HOUR );
} }
$confDefaultOption = ""; $confDefaultOption = "";
if (isset($arrayConfig["DEFAULT_CASES_MENU"])) { //this user has a configuration record if (isset( $arrayConfig["DEFAULT_CASES_MENU"] )) { //this user has a configuration record
$confDefaultOption = $arrayConfig["DEFAULT_CASES_MENU"]; $confDefaultOption = $arrayConfig["DEFAULT_CASES_MENU"];
global $G_TMP_MENU; global $G_TMP_MENU;
$oMenu = new Menu(); $oMenu = new Menu();
$oMenu->load("cases"); $oMenu->load( "cases" );
$defaultOption = ""; $defaultOption = "";
foreach ($oMenu->Id as $i => $id) { foreach ($oMenu->Id as $i => $id) {
if ($id == $confDefaultOption) { if ($id == $confDefaultOption) {
$defaultOption = $oMenu->Options[$i]; $defaultOption = $oMenu->Options[$i];
break; break;
} }
} }
$defaultOption = ($defaultOption != "")? $defaultOption : "casesListExtJs"; $defaultOption = ($defaultOption != "") ? $defaultOption : "casesListExtJs";
} else { } else {
$defaultOption = "casesListExtJs"; $defaultOption = "casesListExtJs";
$confDefaultOption = "CASES_INBOX"; $confDefaultOption = "CASES_INBOX";
} }
if (isset($_GET["id"]) && isset($_GET["id"])) { if (isset( $_GET["id"] ) && isset( $_GET["id"] )) {
$defaultOption = "../cases/open?APP_UID=" . $_GET["id"] . "&DEL_INDEX=" . $_GET["i"]; $defaultOption = "../cases/open?APP_UID=" . $_GET["id"] . "&DEL_INDEX=" . $_GET["i"];
if (isset($_GET["a"])) { if (isset( $_GET["a"] )) {
$defaultOption .= "&action=" . $_GET["a"]; $defaultOption .= "&action=" . $_GET["a"];
} }
} }
$oServerConf =& serverConf::getSingleton(); $oServerConf = & serverConf::getSingleton();
if ($oServerConf->isRtl(SYS_LANG)) { if ($oServerConf->isRtl( SYS_LANG )) {
$regionTreePanel = 'east'; $regionTreePanel = 'east';
$regionDebug = 'west'; $regionDebug = 'west';
} else { } else {
$regionTreePanel = 'west'; $regionTreePanel = 'west';
$regionDebug = 'east'; $regionDebug = 'east';
} }
$oHeadPublisher->assign('regionTreePanel', $regionTreePanel); $oHeadPublisher->assign( 'regionTreePanel', $regionTreePanel );
$oHeadPublisher->assign('regionDebug', $regionDebug); $oHeadPublisher->assign( 'regionDebug', $regionDebug );
$oHeadPublisher->assign("defaultOption", $defaultOption); //User menu permissions $oHeadPublisher->assign( "defaultOption", $defaultOption ); //User menu permissions
$oHeadPublisher->assign("_nodeId", isset($confDefaultOption)? $confDefaultOption : "PM_USERS"); //User menu permissions $oHeadPublisher->assign( "_nodeId", isset( $confDefaultOption ) ? $confDefaultOption : "PM_USERS" ); //User menu permissions
$oHeadPublisher->assign("FORMATS", $conf->getFormats()); $oHeadPublisher->assign( "FORMATS", $conf->getFormats() );
$_SESSION["current_ux"] = "NORMAL"; $_SESSION["current_ux"] = "NORMAL";
G::RenderPage("publish", "extJs"); G::RenderPage( "publish", "extJs" );

View File

@@ -1,93 +1,88 @@
<?php <?php
/** /**
* open.php Open Case main processor * open.php Open Case main processor
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/
/**
/** *
* @author Erik Amaru Ortiz <erik@colosa.com> * @author Erik Amaru Ortiz <erik@colosa.com>
* @date Jan 3th, 2010 * @date Jan 3th, 2010
*/ */
if (!isset($_GET['APP_UID']) || !isset($_GET['DEL_INDEX'])) { if (! isset( $_GET['APP_UID'] ) || ! isset( $_GET['DEL_INDEX'] )) {
if (isset($_GET['APP_NUMBER'])) { if (isset( $_GET['APP_NUMBER'] )) {
G::LoadClass('case'); G::LoadClass( 'case' );
$oCase = new Cases(); $oCase = new Cases();
$_GET['APP_UID'] = $oCase->getApplicationUIDByNumber($_GET['APP_NUMBER']); $_GET['APP_UID'] = $oCase->getApplicationUIDByNumber( $_GET['APP_NUMBER'] );
$_GET['DEL_INDEX'] = $oCase->getCurrentDelegation($_GET['APP_UID'], $_SESSION['USER_LOGGED']); $_GET['DEL_INDEX'] = $oCase->getCurrentDelegation( $_GET['APP_UID'], $_SESSION['USER_LOGGED'] );
if( is_null($_GET['APP_UID']) ) { if (is_null( $_GET['APP_UID'] )) {
throw new Exception(G::LoadTranslation('ID_CASE_DOES_NOT_EXISTS')); throw new Exception( G::LoadTranslation( 'ID_CASE_DOES_NOT_EXISTS' ) );
} }
if( is_null($_GET['DEL_INDEX']) ) { if (is_null( $_GET['DEL_INDEX'] )) {
throw new Exception(G::LoadTranslation('ID_CASE_IS_CURRENTLY_WITH_ANOTHER_USER')); throw new Exception( G::LoadTranslation( 'ID_CASE_IS_CURRENTLY_WITH_ANOTHER_USER' ) );
} }
} } else {
else { throw new Exception( "Application ID or Delegation Index is missing!. The System can't open the case." );
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" );
require_once ("classes/model/Step.php"); G::LoadClass( "case" );
G::LoadClass("configuration"); $oCase = new Cases();
G::LoadClass("case"); $conf = new Configurations();
$oCase = new Cases();
$conf = new Configurations; $oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher =& headPublisher::getSingleton(); $oHeadPublisher->addExtJsScript( 'app/main', true );
$oHeadPublisher->addExtJsScript( 'cases/open', true );
$oHeadPublisher->addExtJsScript('app/main', true); $oHeadPublisher->assign( 'FORMATS', $conf->getFormats() );
$oHeadPublisher->addExtJsScript('cases/open', true); $uri = '';
$oHeadPublisher->assign('FORMATS',$conf->getFormats()); foreach ($_GET as $k => $v) {
$uri = ''; $uri .= ($uri == '') ? "$k=$v" : "&$k=$v";
foreach($_GET as $k=>$v) { }
$uri .= ($uri == '')? "$k=$v": "&$k=$v";
} $case = $oCase->loadCase( $_GET['APP_UID'], $_GET['DEL_INDEX'] );
$case = $oCase->loadCase($_GET['APP_UID'], $_GET['DEL_INDEX']); if (! isset( $_GET['to_revise'] )) {
$script = 'cases_Open?';
if (!isset($_GET['to_revise'])){ } else {
$script = 'cases_Open?'; $script = 'cases_OpenToRevise?';
} $delIndex = $_GET['DEL_INDEX'];
else { $appUid = $_GET['APP_UID'];
$script = 'cases_OpenToRevise?'; $oHeadPublisher->assign( 'treeToReviseTitle', G::loadtranslation( 'ID_STEP_LIST' ) );
$delIndex = $_GET['DEL_INDEX']; $casesPanelUrl = 'casesToReviseTreeContent?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex;
$appUid = $_GET['APP_UID']; $oHeadPublisher->assign( 'casesPanelUrl', $casesPanelUrl ); //translations
$oHeadPublisher->assign('treeToReviseTitle', G::loadtranslation('ID_STEP_LIST')); echo "<div id='toReviseTree'></div>";
$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 );
$oStep = new Step; $oHeadPublisher->assign( 'uri', $script . $uri );
$oStep = $oStep->loadByProcessTaskPosition($case['PRO_UID'], $case['TAS_UID'], 1); $oHeadPublisher->assign( '_APP_NUM', '#: ' . $case['APP_NUMBER'] );
$oHeadPublisher->assign( '_ENV_CURRENT_DATE', $conf->getSystemDate( date( 'Y-m-d' ) ) );
$oHeadPublisher->assign('uri', $script . $uri); $oHeadPublisher->assign( '_ENV_CURRENT_DATE_NO_FORMAT', date( 'Y-m-d' ) );
$oHeadPublisher->assign('_APP_NUM', '#: ' . $case['APP_NUMBER']); $oHeadPublisher->assign( 'idfirstform', is_null( $oStep ) ? '' : $oStep->getStepUidObj() );
$oHeadPublisher->assign('_ENV_CURRENT_DATE', $conf->getSystemDate(date('Y-m-d')));
$oHeadPublisher->assign('_ENV_CURRENT_DATE_NO_FORMAT', date('Y-m-d')); G::RenderPage( 'publish', 'extJs' );
$oHeadPublisher->assign('idfirstform', is_null($oStep)?'':$oStep->getStepUidObj());
G::RenderPage('publish', 'extJs');

View File

@@ -1,91 +1,47 @@
<?php <?php
//Getting the extJs parameters //Getting the extJs parameters
$callback = isset($_POST["callback"])? $_POST["callback"] : "stcCallback1001"; $callback = isset( $_POST["callback"] ) ? $_POST["callback"] : "stcCallback1001";
$dir = isset($_POST["dir"])? $_POST["dir"] : "DESC"; $dir = isset( $_POST["dir"] ) ? $_POST["dir"] : "DESC";
$sort = isset($_POST["sort"])? $_POST["sort"] : ""; $sort = isset( $_POST["sort"] ) ? $_POST["sort"] : "";
$start = isset($_POST["start"])? $_POST["start"] : "0"; $start = isset( $_POST["start"] ) ? $_POST["start"] : "0";
$limit = isset($_POST["limit"])? $_POST["limit"] : "25"; $limit = isset( $_POST["limit"] ) ? $_POST["limit"] : "25";
$filter = isset($_POST ["filter"])? $_POST["filter"] : ""; $filter = isset( $_POST["filter"] ) ? $_POST["filter"] : "";
$process = isset($_POST["process"])? $_POST["process"] : ""; $process = isset( $_POST["process"] ) ? $_POST["process"] : "";
$category = isset($_POST["category"])? $_POST["category"] : ""; $category = isset( $_POST["category"] ) ? $_POST["category"] : "";
$status = isset($_POST["status"])? strtoupper($_POST["status"]) : ""; $status = isset( $_POST["status"] ) ? strtoupper( $_POST["status"] ) : "";
$user = isset($_POST["user"])? $_POST["user"] : ""; $user = isset( $_POST["user"] ) ? $_POST["user"] : "";
$search = isset($_POST["search"])? $_POST["search"] : ""; $search = isset( $_POST["search"] ) ? $_POST["search"] : "";
$action = isset($_GET["action"])? $_GET["action"] : (isset($_POST["action"])? $_POST["action"] : "todo"); $action = isset( $_GET["action"] ) ? $_GET["action"] : (isset( $_POST["action"] ) ? $_POST["action"] : "todo");
$type = isset($_GET["type"])? $_GET["type"] : (isset($_POST["type"])? $_POST["type"] : "extjs"); $type = isset( $_GET["type"] ) ? $_GET["type"] : (isset( $_POST["type"] ) ? $_POST["type"] : "extjs");
$dateFrom = isset($_POST["dateFrom"])? substr($_POST["dateFrom"], 0, 10) : ""; $dateFrom = isset( $_POST["dateFrom"] ) ? substr( $_POST["dateFrom"], 0, 10 ) : "";
$dateTo = isset($_POST["dateTo"])? substr($_POST["dateTo"], 0, 10) : ""; $dateTo = isset( $_POST["dateTo"] ) ? substr( $_POST["dateTo"], 0, 10 ) : "";
try { try {
$result = ""; $result = "";
$userUid = (isset($_SESSION["USER_LOGGED"]) && $_SESSION["USER_LOGGED"] != "")? $_SESSION["USER_LOGGED"] : null; $userUid = (isset( $_SESSION["USER_LOGGED"] ) && $_SESSION["USER_LOGGED"] != "") ? $_SESSION["USER_LOGGED"] : null;
$user = ($user == "CURRENT_USER")? $userUid : $user; $user = ($user == "CURRENT_USER") ? $userUid : $user;
if (( if (($action == "todo" || $action == "draft" || $action == "sent" || $action == "selfservice" || $action == "unassigned" || $action == "search") && (($solrConf = System::solrEnv()) !== false)) {
$action == "todo" || $action == "draft" || $action == "sent" || $action == "selfservice" || G::LoadClass( "AppSolr" );
$action == "unassigned" || $action == "search"
) $ApplicationSolrIndex = new AppSolr( $solrConf["solr_enabled"], $solrConf["solr_host"], $solrConf["solr_instance"] );
&&
(($solrConf = System::solrEnv()) !== false) $data = $ApplicationSolrIndex->getAppGridData( $userUid, $start, $limit, $action, $filter, $search, $process, $user, $status, $type, $dateFrom, $dateTo, $callback, $dir, $sort );
) {
G::LoadClass("AppSolr"); $result = G::json_encode( $data );
} else {
$ApplicationSolrIndex = new AppSolr( G::LoadClass( "applications" );
$solrConf["solr_enabled"],
$solrConf["solr_host"], $apps = new Applications();
$solrConf["solr_instance"] $data = $apps->getAll( $userUid, $start, $limit, $action, $filter, $search, $process, $user, $status, $type, $dateFrom, $dateTo, $callback, $dir, $sort, $category );
);
$result = G::json_encode( $data );
$data = $ApplicationSolrIndex->getAppGridData( }
$userUid,
$start, echo $result;
$limit, } catch (Exception $e) {
$action, $msg = array ("error" => $e->getMessage() );
$filter, echo G::json_encode( $msg );
$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,67 +1,70 @@
<?php <?php
$callback = isset($_POST['callback']) ? $_POST['callback'] : 'stcCallback1001'; $callback = isset( $_POST['callback'] ) ? $_POST['callback'] : 'stcCallback1001';
$dir = isset($_POST['dir']) ? $_POST['dir'] : 'DESC'; $dir = isset( $_POST['dir'] ) ? $_POST['dir'] : 'DESC';
$sort = isset($_POST['sort']) ? $_POST['sort'] : ''; $sort = isset( $_POST['sort'] ) ? $_POST['sort'] : '';
$query = isset($_POST['query']) ? $_POST['query'] : ''; $query = isset( $_POST['query'] ) ? $_POST['query'] : '';
//$action = isset($_GET['action']) ? $_GET['action'] : 'read'; //$action = isset($_GET['action']) ? $_GET['action'] : 'read';
$option = ''; $option = '';
if ( isset($_GET['t'] ) ) $option = $_GET['t']; if (isset( $_GET['t'] ))
try { $option = $_GET['t'];
try {
G::LoadClass("BasePeer" );
require_once ( "classes/model/Process.php" ); G::LoadClass( "BasePeer" );
require_once ( "classes/model/AppCacheView.php" ); require_once ("classes/model/Process.php");
require_once ("classes/model/AppCacheView.php");
$sUIDUserLogged = $_SESSION['USER_LOGGED'];
$sUIDUserLogged = $_SESSION['USER_LOGGED'];
$Criteria = new Criteria('workflow');
$Criteria = new Criteria( 'workflow' );
$Criteria->clearSelectColumns ( );
$Criteria->setDistinct(); $Criteria->clearSelectColumns();
$Criteria->addSelectColumn ( AppCacheViewPeer::PRO_UID ); $Criteria->setDistinct();
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_PRO_TITLE ); $Criteria->addSelectColumn( AppCacheViewPeer::PRO_UID );
$Criteria->addSelectColumn( AppCacheViewPeer::APP_PRO_TITLE );
if ( $query != '' ) {
$Criteria->add (AppCacheViewPeer::APP_PRO_TITLE, $query . '%', Criteria::LIKE); 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); $Criteria->add( AppCacheViewPeer::APP_STATUS, "TO_DO", CRITERIA::EQUAL );
$Criteria->add( AppCacheViewPeer::USR_UID, $sUIDUserLogged );
//$totalCount = AppCacheViewPeer::doCount( $Criteria ); //$totalCount = AppCacheViewPeer::doCount( $Criteria );
if ( isset($limit) ) $Criteria->setLimit( $limit );
if ( isset($start) ) $Criteria->setOffset( $start ); if (isset( $limit ))
$Criteria->setLimit( $limit );
if ( $sort != '' ) { if (isset( $start ))
if ( $dir == 'DESC' ) $Criteria->setOffset( $start );
$Criteria->addDescendingOrderByColumn( $sort );
else if ($sort != '') {
$Criteria->addAscendingOrderByColumn( $sort ); if ($dir == 'DESC')
} $Criteria->addDescendingOrderByColumn( $sort );
$oDataset = AppCacheViewPeer::doSelectRS($Criteria); else
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $Criteria->addAscendingOrderByColumn( $sort );
$oDataset->next(); }
$oDataset = AppCacheViewPeer::doSelectRS( $Criteria );
$result = array(); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rows = array(); $oDataset->next();
$index = isset($start) ? $start : 0;
while($aRow = $oDataset->getRow()){ $result = array ();
$aRow['index'] = ++$index; $rows = array ();
$rows[] = $aRow; $index = isset( $start ) ? $start : 0;
while ($aRow = $oDataset->getRow()) {
$oDataset->next(); $aRow['index'] = ++ $index;
} $rows[] = $aRow;
$result['totalCount'] = count($rows);
$result['data'] = $rows; $oDataset->next();
}
print G::json_encode( $result ) ; $result['totalCount'] = count( $rows );
$result['data'] = $rows;
}
catch ( Exception $e ) { print G::json_encode( $result );
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage(); } catch (Exception $e) {
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage ); $G_PUBLISH = new Publisher();
G::RenderPage( 'publish', 'blank' ); $aMessage['MESSAGE'] = $e->getMessage();
} $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', 'blank' );
}

View File

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

View File

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

View File

@@ -1,97 +1,95 @@
<?php <?php
/** /**
* proxySaveReassignCasesList.php * proxySaveReassignCasesList.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * 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/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* */
*/ $aData = G::json_decode( $_POST['data'] );
$aData = G::json_decode($_POST['data']); $appSelectedUids = array ();
$appSelectedUids = array (); $items = explode( ",", $_POST['APP_UIDS'] );
$items = explode(",",$_POST['APP_UIDS']); foreach ($items as $item) {
foreach ($items as $item) { $dataUids = explode( "|", $item );
$dataUids = explode("|",$item); $appSelectedUids[] = $dataUids[0];
$appSelectedUids[] = $dataUids[0]; }
}
// var_dump($aData); // var_dump($aData);
//var_dump($appSelectedUids); //var_dump($appSelectedUids);
$casesReassignedCount = 0; $casesReassignedCount = 0;
$serverResponse = array(); $serverResponse = array ();
G::LoadClass ('case'); G::LoadClass( 'case' );
$oCases = new Cases(); $oCases = new Cases();
require_once ('classes/model/Task.php'); require_once ('classes/model/Task.php');
require_once ('classes/model/AppCacheView.php'); require_once ('classes/model/AppCacheView.php');
$oAppCacheView = new AppCacheView(); $oAppCacheView = new AppCacheView();
$oCasesReassignList = $oAppCacheView->getToReassignListCriteria(); $oCasesReassignList = $oAppCacheView->getToReassignListCriteria();
if (isset($_POST['selected'])&&$_POST['selected']=='true'){ if (isset( $_POST['selected'] ) && $_POST['selected'] == 'true') {
$oCasesReassignList->add(AppCacheViewPeer::APP_UID,$appSelectedUids,Criteria::IN); $oCasesReassignList->add( AppCacheViewPeer::APP_UID, $appSelectedUids, Criteria::IN );
} }
// if there are no records to save return -1 // if there are no records to save return -1
if (empty($aData)){ if (empty( $aData )) {
$serverResponse['TOTAL']=-1; $serverResponse['TOTAL'] = - 1;
echo G::json_encode($serverResponse); echo G::json_encode( $serverResponse );
die(); die();
} }
// $params = array (); // $params = array ();
// $sql = BasePeer::createSelectSql($oCasesReassignList, $params); // $sql = BasePeer::createSelectSql($oCasesReassignList, $params);
// var_dump($sql); // var_dump($sql);
if ( is_array($aData) ) { if (is_array( $aData )) {
$currentCasesReassigned=0; $currentCasesReassigned = 0;
foreach ($aData as $data){ foreach ($aData as $data) {
$oTmpReassignCriteria = $oCasesReassignList; $oTmpReassignCriteria = $oCasesReassignList;
$oTmpReassignCriteria->add(AppCacheViewPeer::TAS_UID,$data->TAS_UID); $oTmpReassignCriteria->add( AppCacheViewPeer::TAS_UID, $data->TAS_UID );
$rs = AppCacheViewPeer::doSelectRS($oTmpReassignCriteria); $rs = AppCacheViewPeer::doSelectRS( $oTmpReassignCriteria );
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC); $rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs->next(); $rs->next();
$row = $rs->getRow(); $row = $rs->getRow();
$aCase = $oCases->loadCaseInCurrentDelegation($data->APP_UID); $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); $oCases->reassignCase( $aCase['APP_UID'], $aCase['DEL_INDEX'], ($aCase['USR_UID'] != '' ? $aCase['USR_UID'] : $_SESSION['USER_LOGGED']), $data->APP_REASSIGN_USER_UID );
$currentCasesReassigned++; $currentCasesReassigned ++;
$casesReassignedCount++; $casesReassignedCount ++;
$serverResponse[] = array ('APP_REASSIGN_USER' => $data->APP_REASSIGN_USER, $serverResponse[] = array ('APP_REASSIGN_USER' => $data->APP_REASSIGN_USER,'APP_TITLE' => $data->APP_TITLE,'TAS_TITLE' => $data->APP_TAS_TITLE,'REASSIGNED_CASES' => $currentCasesReassigned
'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 );
else { $rs = AppCacheViewPeer::doSelectRS( $oTmpReassignCriteria );
$oTmpReassignCriteria = $oCasesReassignList; $rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oTmpReassignCriteria->add(AppCacheViewPeer::TAS_UID,$aData->TAS_UID); $rs->next();
$rs = AppCacheViewPeer::doSelectRS($oTmpReassignCriteria); $row = $rs->getRow();
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC); $currentCasesReassigned = 0;
$rs->next(); while (is_array( $row )) {
$row = $rs->getRow(); $APP_UID = $row['APP_UID'];
$currentCasesReassigned=0; $aCase = $oCases->loadCaseInCurrentDelegation( $APP_UID );
while (is_array($row)) { $oCases->reassignCase( $aCase['APP_UID'], $aCase['DEL_INDEX'], ($aCase['USR_UID'] != '' ? $aCase['USR_UID'] : $_SESSION['USER_LOGGED']), $aData->APP_REASSIGN_USER_UID );
$APP_UID = $row['APP_UID']; $currentCasesReassigned ++;
$aCase = $oCases->loadCaseInCurrentDelegation($APP_UID); $casesReassignedCount ++;
$oCases->reassignCase($aCase['APP_UID'], $aCase['DEL_INDEX'], ($aCase['USR_UID'] != '' ? $aCase['USR_UID'] : $_SESSION['USER_LOGGED']), $aData->APP_REASSIGN_USER_UID); // var_dump($aCase);
$currentCasesReassigned++; // echo ("<br>");
$casesReassignedCount++; $rs->next();
// var_dump($aCase); $row = $rs->getRow();
// echo ("<br>"); }
$rs->next(); $serverResponse[] = array ('TAS_TITLE' => $aData->APP_TAS_TITLE,'REASSIGNED_CASES' => $currentCasesReassigned
$row = $rs->getRow(); );
} }
$serverResponse[] = array ('TAS_TITLE'=>$aData->APP_TAS_TITLE,'REASSIGNED_CASES'=>$currentCasesReassigned);
} $serverResponse['TOTAL'] = $casesReassignedCount;
echo G::json_encode( $serverResponse );
$serverResponse['TOTAL'] = $casesReassignedCount;
echo G::json_encode($serverResponse);

View File

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