COD STYLE changes

files  modified:   workflow/engine/methods/cases/casesListExtJs.php
       modified:   workflow/engine/methods/cases/casesListExtJsRedirector.php
       modified:   workflow/engine/methods/cases/casesList_Ajax.php
       modified:   workflow/engine/methods/cases/casesMenuLoader.php
       modified:   workflow/engine/methods/cases/cases_Step.php
       modified:   workflow/engine/methods/cases/cases_StepToRevise.php
       modified:   workflow/engine/methods/cases/cases_StepToReviseInputs.php
       modified:   workflow/engine/methods/cases/cases_StepToReviseOutputs.php
       modified:   workflow/engine/methods/cases/cases_SupervisorSaveDocument.php
       modified:   workflow/engine/methods/cases/cases_ToReviseInputDocView.php
       modified:   workflow/engine/methods/cases/cases_ToReviseOutputDocView.php
       modified:   workflow/engine/methods/cases/cases_UsersReassign.php
       modified:   workflow/engine/methods/cases/cases_toRevise.php
This commit is contained in:
Ralph Asendeteufrer
2012-10-19 17:17:53 -04:00
parent 8f152c9daa
commit b51c9f6de4
13 changed files with 3128 additions and 3088 deletions

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -1,436 +1,450 @@
<?php
/**
* casesList_Ajax.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
require_once 'classes/model/Application.php';
require_once 'classes/model/Users.php';
require_once 'classes/model/AppThread.php';
require_once 'classes/model/AppDelay.php';
require_once 'classes/model/Process.php';
require_once 'classes/model/Task.php';
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;
if ($actionAjax == "processListExtJs") {
$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : null;
$categoryUid = isset( $_REQUEST['CATEGORY_UID'] ) ? $_REQUEST['CATEGORY_UID'] : null;
$userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
global $oAppCache;
$oAppCache = new AppCacheView();
$processes = Array ();
$processes[] = array ('',G::LoadTranslation( 'ID_ALL_PROCESS' )
);
//get the list based in the action provided
switch ($action) {
case 'draft':
$cProcess = $oAppCache->getDraftListCriteria( $userUid ); //fast enough
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' );
$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();
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
$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()) {
$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') {
$APP_UID = $_REQUEST["APP_UID"];
$DEL_INDEX = $_REQUEST["DEL_INDEX"];
$_SESSION['APPLICATION'] = $APP_UID;
$_SESSION['INDEX'] = $DEL_INDEX;
$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);
$data['APP_NUMBER'] = $caseData['APP_NUMBER'];
$data['USER'] = $userData['USR_LASTNAME'] . ' ' . $userData['USR_FIRSTNAME']; //TODO change with the farmated username from environment conf
$result->status = 0;
$result->msg = G::LoadTranslation( 'ID_REASSIGNMENT_SUCCESS', SYS_LANG, $data );
} catch (Exception $e) {
$result->status = 1;
$result->msg = $e->getMessage();
}
print G::json_encode( $result );
}
if ($actionAjax == 'showHistoryMessage') {
?>
<link rel="stylesheet" type="text/css" href="/css/classic.css" />
<style type="text/css">
html {
color: black !important;
}
body {
color: black !important;
}
</style>
<script language="Javascript">
//!Code that simulated reload library javascript maborak
var leimnud = {};
leimnud.exec = "";
leimnud.fix = {};
leimnud.fix.memoryLeak = "";
leimnud.browser = {};
leimnud.browser.isIphone = "";
leimnud.iphone = {};
leimnud.iphone.make = function(){};
function ajax_function(ajax_server, funcion, parameters, method){
}
//!
</script>
<?php
G::LoadClass( 'case' );
$oCase = new Cases();
$_POST["APP_UID"] = $_REQUEST["APP_UID"];
$_POST['APP_MSG_UID'] = $_REQUEST["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">
<?php
global $G_FORM;
?>
function loadForm_<?php echo $G_FORM->id;?>(parametro1){
}
</script>
<?php
G::RenderPage( 'publish', 'raw' );
}
if ($actionAjax == 'showDynaformListHistory') {
//!dataIndex
$_POST["APP_UID"] = $_REQUEST["APP_UID"];
$_POST["DYN_UID"] = $_REQUEST["DYN_UID"];
$_POST["PRO_UID"] = $_REQUEST["PRO_UID"];
$_POST["TAS_UID"] = $_REQUEST["TAS_UID"];
?>
<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">
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
var leimnud = {};
leimnud.exec = "";
leimnud.fix = {};
leimnud.fix.memoryLeak = "";
leimnud.browser = {};
leimnud.browser.isIphone = "";
leimnud.iphone = {};
leimnud.iphone.make = function(){};
function ajax_function(ajax_server, funcion, parameters, method){
}
function toggleTable(tablename){
//table= document.getElementByName(tablename);
table= document.getElementById(tablename);
if(table.style.display == ''){
table.style.display = 'none';
}else{
table.style.display = '';
}
}
function noesFuncion(idIframe) {
window.parent.tabIframeWidthFix2(idIframe);
}
function onResizeIframe(idIframe){
window.onresize = noesFuncion(idIframe);
}
var showDynaformHistoryGlobal = {};
showDynaformHistoryGlobal.dynUID = '';
showDynaformHistoryGlobal.tablename = '';
showDynaformHistoryGlobal.dynDate = '';
showDynaformHistoryGlobal.dynTitle = '';
function showDynaformHistory(dynUID,tablename,dynDate,dynTitle){
showDynaformHistoryGlobal.dynUID = dynUID;
showDynaformHistoryGlobal.tablename = tablename;
showDynaformHistoryGlobal.dynDate = dynDate;
showDynaformHistoryGlobal.dynTitle = dynTitle;
var dynUID = showDynaformHistoryGlobal.dynUID;
var tablename = showDynaformHistoryGlobal.tablename;
var dynDate = showDynaformHistoryGlobal.dynDate;
var dynTitle = showDynaformHistoryGlobal.dynTitle;
var idUnique = globalMd5Return(dynUID+tablename+dynDate+dynTitle);
var tabData = window.parent.Ext.util.JSON.encode(showDynaformHistoryGlobal);
var tabName = 'dynaformChangeLogViewHistory'+idUnique;
var tabTitle = 'View('+dynTitle+' '+dynDate+')';
window.parent.ActionTabFrameGlobal.tabData = tabData;
window.parent.ActionTabFrameGlobal.tabName = tabName;
window.parent.ActionTabFrameGlobal.tabTitle = tabTitle;
window.parent.Actions.tabFrame(tabName);
}
</script>
<?php
require_once 'classes/model/AppHistory.php';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'cases/cases_DynaformHistory' );
G::RenderPage( 'publish', 'raw' );
}
if ($actionAjax == 'dynaformChangeLogViewHistory') {
?>
<link rel="stylesheet" type="text/css" href="/css/classic.css" />
<style type="text/css">
html {
color: black !important;
}
body {
color: black !important;
}
</style>
<script language="Javascript">
//!Code that simulated reload library javascript maborak
var leimnud = {};
leimnud.exec = "";
leimnud.fix = {};
leimnud.fix.memoryLeak = "";
leimnud.browser = {};
leimnud.browser.isIphone = "";
leimnud.iphone = {};
leimnud.iphone.make = function(){};
function ajax_function(ajax_server, funcion, parameters, method){
}
//!
</script>
<?php
$_POST['DYN_UID'] = $_REQUEST['DYN_UID'];
$_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' );
?>
<script language="javascript">
<?php
global $G_FORM;
?>
function loadForm_<?php echo $G_FORM->id;?>(parametro1){
}
</script>
<?php
G::RenderPage( 'publish', 'raw' );
}
if ($actionAjax == 'historyDynaformGridPreview') {
?>
<link rel="stylesheet" type="text/css" href="/css/classic.css" />
<style type="text/css">
html {
color: black !important;
}
body {
color: black !important;
}
</style>
<script language="Javascript">
//!Code that simulated reload library javascript maborak
var leimnud = {};
leimnud.exec = "";
leimnud.fix = {};
leimnud.fix.memoryLeak = "";
leimnud.browser = {};
leimnud.browser.isIphone = "";
leimnud.iphone = {};
leimnud.iphone.make = function(){};
function ajax_function(ajax_server, funcion, parameters, method){
}
//!
</script>
<?php
//!dataIndex
$_POST["DYN_UID"] = $_REQUEST["DYN_UID"];
G::LoadClass( 'case' );
$G_PUBLISH = new Publisher();
$oCase = new Cases();
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$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;';
$_SESSION['DYN_UID_PRINT'] = $_POST['DYN_UID'];
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view' );
?>
<script language="javascript">
<?php
global $G_FORM;
?>
function loadForm_<?php echo $G_FORM->id;?>(parametro1){
}
</script>
<?php
G::RenderPage( 'publish', 'raw' );
}
<?php
/**
* casesList_Ajax.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
require_once 'classes/model/Application.php';
require_once 'classes/model/Users.php';
require_once 'classes/model/AppThread.php';
require_once 'classes/model/AppDelay.php';
require_once 'classes/model/Process.php';
require_once 'classes/model/Task.php';
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;
if ($actionAjax == "processListExtJs") {
$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : null;
$categoryUid = isset( $_REQUEST['CATEGORY_UID'] ) ? $_REQUEST['CATEGORY_UID'] : null;
$userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
global $oAppCache;
$oAppCache = new AppCacheView();
$processes = Array ();
$processes[] = array ('',G::LoadTranslation( 'ID_ALL_PROCESS' )
);
//get the list based in the action provided
switch ($action) {
case 'draft':
$cProcess = $oAppCache->getDraftListCriteria( $userUid ); //fast enough
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' );
$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();
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
$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()) {
$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') {
$APP_UID = $_REQUEST["APP_UID"];
$DEL_INDEX = $_REQUEST["DEL_INDEX"];
$_SESSION['APPLICATION'] = $APP_UID;
$_SESSION['INDEX'] = $DEL_INDEX;
$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);
$data['APP_NUMBER'] = $caseData['APP_NUMBER'];
$data['USER'] = $userData['USR_LASTNAME'] . ' ' . $userData['USR_FIRSTNAME']; //TODO change with the farmated username from environment conf
$result->status = 0;
$result->msg = G::LoadTranslation( 'ID_REASSIGNMENT_SUCCESS', SYS_LANG, $data );
} catch (Exception $e) {
$result->status = 1;
$result->msg = $e->getMessage();
}
print G::json_encode( $result );
}
if ($actionAjax == 'showHistoryMessage') {
?>
<link rel="stylesheet" type="text/css" href="/css/classic.css" />
<style type="text/css">
html {
color: black !important;
}
body {
color: black !important;
}
</style>
<script language="Javascript">
//!Code that simulated reload library javascript maborak
var leimnud = {};
leimnud.exec = "";
leimnud.fix = {};
leimnud.fix.memoryLeak = "";
leimnud.browser = {};
leimnud.browser.isIphone = "";
leimnud.iphone = {};
leimnud.iphone.make = function(){};
function ajax_function(ajax_server, funcion, parameters, method){
}
//!
</script>
<?php
G::LoadClass( 'case' );
$oCase = new Cases();
$_POST["APP_UID"] = $_REQUEST["APP_UID"];
$_POST['APP_MSG_UID'] = $_REQUEST["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">
<?php
global $G_FORM;
?>
function loadForm_<?php echo $G_FORM->id;?>(parametro1){
}
</script>
<?php
G::RenderPage( 'publish', 'raw' );
}
if ($actionAjax == 'showDynaformListHistory') {
//!dataIndex
$_POST["APP_UID"] = $_REQUEST["APP_UID"];
$_POST["DYN_UID"] = $_REQUEST["DYN_UID"];
$_POST["PRO_UID"] = $_REQUEST["PRO_UID"];
$_POST["TAS_UID"] = $_REQUEST["TAS_UID"];
?>
<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">
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
var leimnud = {};
leimnud.exec = "";
leimnud.fix = {};
leimnud.fix.memoryLeak = "";
leimnud.browser = {};
leimnud.browser.isIphone = "";
leimnud.iphone = {};
leimnud.iphone.make = function(){};
function ajax_function(ajax_server, funcion, parameters, method){
}
function toggleTable(tablename){
//table= document.getElementByName(tablename);
table= document.getElementById(tablename);
if(table.style.display == ''){
table.style.display = 'none';
}else{
table.style.display = '';
}
}
function noesFuncion(idIframe) {
window.parent.tabIframeWidthFix2(idIframe);
}
function onResizeIframe(idIframe){
window.onresize = noesFuncion(idIframe);
}
var showDynaformHistoryGlobal = {};
showDynaformHistoryGlobal.dynUID = '';
showDynaformHistoryGlobal.tablename = '';
showDynaformHistoryGlobal.dynDate = '';
showDynaformHistoryGlobal.dynTitle = '';
function showDynaformHistory(dynUID,tablename,dynDate,dynTitle){
showDynaformHistoryGlobal.dynUID = dynUID;
showDynaformHistoryGlobal.tablename = tablename;
showDynaformHistoryGlobal.dynDate = dynDate;
showDynaformHistoryGlobal.dynTitle = dynTitle;
var dynUID = showDynaformHistoryGlobal.dynUID;
var tablename = showDynaformHistoryGlobal.tablename;
var dynDate = showDynaformHistoryGlobal.dynDate;
var dynTitle = showDynaformHistoryGlobal.dynTitle;
var idUnique = globalMd5Return(dynUID+tablename+dynDate+dynTitle);
var tabData = window.parent.Ext.util.JSON.encode(showDynaformHistoryGlobal);
var tabName = 'dynaformChangeLogViewHistory'+idUnique;
var tabTitle = 'View('+dynTitle+' '+dynDate+')';
window.parent.ActionTabFrameGlobal.tabData = tabData;
window.parent.ActionTabFrameGlobal.tabName = tabName;
window.parent.ActionTabFrameGlobal.tabTitle = tabTitle;
window.parent.Actions.tabFrame(tabName);
}
</script>
<?php
require_once 'classes/model/AppHistory.php';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'cases/cases_DynaformHistory' );
G::RenderPage( 'publish', 'raw' );
}
if ($actionAjax == 'dynaformChangeLogViewHistory') {
?>
<link rel="stylesheet" type="text/css" href="/css/classic.css" />
<style type="text/css">
html {
color: black !important;
}
body {
color: black !important;
}
</style>
<script language="Javascript">
//!Code that simulated reload library javascript maborak
var leimnud = {};
leimnud.exec = "";
leimnud.fix = {};
leimnud.fix.memoryLeak = "";
leimnud.browser = {};
leimnud.browser.isIphone = "";
leimnud.iphone = {};
leimnud.iphone.make = function(){};
function ajax_function(ajax_server, funcion, parameters, method){
}
//!
</script>
<?php
$_POST['DYN_UID'] = $_REQUEST['DYN_UID'];
$_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' );
?>
<script language="javascript">
<?php
global $G_FORM;
?>
function loadForm_<?php echo $G_FORM->id;?>(parametro1){
}
</script>
<?php
G::RenderPage( 'publish', 'raw' );
}
if ($actionAjax == 'historyDynaformGridPreview') {
?>
<link rel="stylesheet" type="text/css" href="/css/classic.css" />
<style type="text/css">
html {
color: black !important;
}
body {
color: black !important;
}
</style>
<script language="Javascript">
//!Code that simulated reload library javascript maborak
var leimnud = {};
leimnud.exec = "";
leimnud.fix = {};
leimnud.fix.memoryLeak = "";
leimnud.browser = {};
leimnud.browser.isIphone = "";
leimnud.iphone = {};
leimnud.iphone.make = function(){};
function ajax_function(ajax_server, funcion, parameters, method){
}
//!
</script>
<?php
//!dataIndex
$_POST["DYN_UID"] = $_REQUEST["DYN_UID"];
G::LoadClass( 'case' );
$G_PUBLISH = new Publisher();
$oCase = new Cases();
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$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;';
$_SESSION['DYN_UID_PRINT'] = $_POST['DYN_UID'];
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view' );
?>
<script language="javascript">
<?php
global $G_FORM;
?>
function loadForm_<?php echo $G_FORM->id;?>(parametro1){
}
</script>
<?php
G::RenderPage( 'publish', 'raw' );
}

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

@@ -1,72 +1,72 @@
<?php
/**
* cases_SupervisorSaveDocument.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
try {
<?php
/**
* cases_SupervisorSaveDocument.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
try {
//save info
G::LoadClass( 'case' );
$oAppDocument = new AppDocument();
$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'] : ''
);
$oAppDocument->create( $aFields );
$sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
$ext = (isset( $info['extension'] ) ? $info['extension'] : '');
G::LoadClass( 'case' );
$oAppDocument = new AppDocument();
$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'] : ''
);
$oAppDocument->create( $aFields );
$sAppDocUid = $oAppDocument->getAppDocUid();
$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 . $_GET['APP_UID'] . PATH_SEP;
$sFileName = $sAppDocUid . '.' . $ext;
G::uploadFile( $_FILES['form']['tmp_name']['APP_DOC_FILENAME'], $sPathName, $sFileName );
if (! empty( $_FILES['form'] )) {
if ($_FILES['form']['error']['APP_DOC_FILENAME'] == 0) {
$sPathName = PATH_DOCUMENT . $_GET['APP_UID'] . PATH_SEP;
$sFileName = $sAppDocUid . '.' . $ext;
G::uploadFile( $_FILES['form']['tmp_name']['APP_DOC_FILENAME'], $sPathName, $sFileName );
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
$oPluginRegistry = & PMPluginRegistry::getSingleton();
if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT ) && class_exists( 'uploadDocumentData' )) {
$oData['APP_UID'] = $_GET['APP_UID'];
$documentData = new uploadDocumentData( $_GET['APP_UID'], $_SESSION['USER_LOGGED'], $sPathName . $sFileName, $aFields['APP_DOC_FILENAME'], $sAppDocUid );
$oPluginRegistry->executeTriggers( PM_UPLOAD_DOCUMENT, $documentData );
unlink( $sPathName . $sFileName );
}
$oPluginRegistry = & PMPluginRegistry::getSingleton();
if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT ) && class_exists( 'uploadDocumentData' )) {
$oData['APP_UID'] = $_GET['APP_UID'];
$documentData = new uploadDocumentData( $_GET['APP_UID'], $_SESSION['USER_LOGGED'], $sPathName . $sFileName, $aFields['APP_DOC_FILENAME'], $sAppDocUid );
$oPluginRegistry->executeTriggers( PM_UPLOAD_DOCUMENT, $documentData );
unlink( $sPathName . $sFileName );
}
//end plugin
}
}
}
}
//go to the next step
if (! isset( $_POST['form']['MORE'] )) {
$oCase = new Cases();
$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=' );
die();
} else {
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die();
}
} 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' );
}
if (! isset( $_POST['form']['MORE'] )) {
$oCase = new Cases();
$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=' );
die();
} else {
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die();
}
} 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,79 +1,79 @@
<?php
/**
* cases_Step.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/* Permissions */
switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
if ((int) $_SESSION['INDEX'] < 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die();
}
/* Includes */
G::LoadClass( 'case' );
G::LoadClass( 'derivation' );
/* GET , POST & $_SESSION Vars */
<?php
/**
* cases_Step.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/* Permissions */
switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
case - 2:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
case - 1:
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ../login/login' );
die();
break;
}
if ((int) $_SESSION['INDEX'] < 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die();
}
/* Includes */
G::LoadClass( 'case' );
G::LoadClass( 'derivation' );
/* GET , POST & $_SESSION Vars */
//$_SESSION['STEP_POSITION'] = (int)$_GET['POSITION'];
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
$oCase = new Cases();
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
require_once 'classes/model/AppDocument.php';
require_once 'classes/model/Users.php';
$G_PUBLISH = new Publisher();
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load( $_GET['DOC'] );
$oo = $oAppDocument->load( $_GET['DOC'] );
$oUser = new Users();
$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();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ViewInputDocumentToRevise', '', G::array_merges( $Fields, $oAppDocument->Fields ), '' );
G::RenderPage( 'publish' );
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
$oCase = new Cases();
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
require_once 'classes/model/AppDocument.php';
require_once 'classes/model/Users.php';
$G_PUBLISH = new Publisher();
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load( $_GET['DOC'] );
$oo = $oAppDocument->load( $_GET['DOC'] );
$oUser = new Users();
$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();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ViewInputDocumentToRevise', '', G::array_merges( $Fields, $oAppDocument->Fields ), '' );
G::RenderPage( 'publish' );

View File

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

View File

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

View File

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