CODE STYLE Formating workflow/engine/methods/cases

Change format files in workflow/engine/methods/cases
This commit is contained in:
norahmollo
2012-10-18 15:08:40 +00:00
parent 23d74542be
commit c1de21c87f
6 changed files with 1848 additions and 2007 deletions

View File

@@ -20,10 +20,10 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/**
*
* @author Erik Amaru Ortiz <erik@colosa.com>
* @date Jan 3th, 2010
*/
@@ -43,6 +43,7 @@ $ajax->$action($_REQUEST);
class Ajax
{
function getCaseMenu ($params)
{
@@ -52,16 +53,13 @@ class Ajax
global $sStatus;
$sStatus = $params['app_status'];
$oCase = new Cases();
$conf = new Configurations;
$conf = new Configurations();
$oMenu = new Menu();
$oMenu->load( 'caseOptions' );
$menuOptions = Array ();
foreach ($oMenu->Options as $i => $action) {
$option = Array(
'id' => $oMenu->Id[$i],
'label' => $oMenu->Labels[$i],
'action' => $action
$option = Array ('id' => $oMenu->Id[$i],'label' => $oMenu->Labels[$i],'action' => $action
);
switch ($option['id']) {
@@ -81,7 +79,6 @@ class Ajax
echo G::json_encode( $menuOptions );
}
function steps ()
{
G::LoadClass( 'applications' );
@@ -128,14 +125,22 @@ class Ajax
function getInformationOptions ()
{
$options = Array ();
$options[] = Array('text' => G::LoadTranslation('ID_PROCESS_MAP'), 'fn'=>'processMap');
$options[] = Array('text' => G::LoadTranslation('ID_PROCESS_INFORMATION'), 'fn'=>'processInformation');
$options[] = Array('text' => G::LoadTranslation('ID_TASK_INFORMATION'), 'fn'=>'taskInformation');
$options[] = Array('text' => G::LoadTranslation('ID_CASE_HISTORY'), 'fn'=>'caseHistory');
$options[] = Array('text' => G::LoadTranslation('ID_HISTORY_MESSAGE_CASE'), 'fn'=>'messageHistory');
$options[] = Array('text' => G::LoadTranslation('ID_DYNAFORMS'), 'fn'=>'dynaformHistory');
$options[] = Array('text' => G::LoadTranslation('ID_UPLOADED_DOCUMENTS'), 'fn'=>'uploadedDocuments');
$options[] = Array('text' => G::LoadTranslation('ID_GENERATED_DOCUMENTS'), 'fn'=>'generatedDocuments');
$options[] = Array ('text' => G::LoadTranslation( 'ID_PROCESS_MAP' ),'fn' => 'processMap'
);
$options[] = Array ('text' => G::LoadTranslation( 'ID_PROCESS_INFORMATION' ),'fn' => 'processInformation'
);
$options[] = Array ('text' => G::LoadTranslation( 'ID_TASK_INFORMATION' ),'fn' => 'taskInformation'
);
$options[] = Array ('text' => G::LoadTranslation( 'ID_CASE_HISTORY' ),'fn' => 'caseHistory'
);
$options[] = Array ('text' => G::LoadTranslation( 'ID_HISTORY_MESSAGE_CASE' ),'fn' => 'messageHistory'
);
$options[] = Array ('text' => G::LoadTranslation( 'ID_DYNAFORMS' ),'fn' => 'dynaformHistory'
);
$options[] = Array ('text' => G::LoadTranslation( 'ID_UPLOADED_DOCUMENTS' ),'fn' => 'uploadedDocuments'
);
$options[] = Array ('text' => G::LoadTranslation( 'ID_GENERATED_DOCUMENTS' ),'fn' => 'generatedDocuments'
);
return $options;
}
@@ -158,42 +163,50 @@ class Ajax
$options = Array ();
switch($aFields['APP_STATUS'])
{
switch ($aFields['APP_STATUS']) {
case 'DRAFT':
if (! AppDelay::isPaused( $_SESSION['APPLICATION'], $_SESSION['INDEX'] )) {
$options[] = Array('text'=>G::LoadTranslation('ID_PAUSED_CASE'), 'fn'=>'setUnpauseCaseDate');
$options[] = Array ('text' => G::LoadTranslation( 'ID_PAUSED_CASE' ),'fn' => 'setUnpauseCaseDate'
);
} else {
$options[] = Array('text'=>G::LoadTranslation('ID_UNPAUSE'), 'fn'=>'unpauseCase');
$options[] = Array ('text' => G::LoadTranslation( 'ID_UNPAUSE' ),'fn' => 'unpauseCase'
);
}
$options[] = Array('text'=>G::LoadTranslation('ID_DELETE'), 'fn'=>'deleteCase');
$options[] = Array ('text' => G::LoadTranslation( 'ID_DELETE' ),'fn' => 'deleteCase'
);
if ($RBAC->userCanAccess( 'PM_REASSIGNCASE' ) == 1) {
$options[] = Array('text'=>G::LoadTranslation('ID_REASSIGN'), 'fn'=>'getUsersToReassign');
$options[] = Array ('text' => G::LoadTranslation( 'ID_REASSIGN' ),'fn' => 'getUsersToReassign'
);
}
break;
case 'TO_DO':
if (! AppDelay::isPaused( $_SESSION['APPLICATION'], $_SESSION['INDEX'] )) {
$options[] = Array('text'=>G::LoadTranslation('ID_PAUSED_CASE'), 'fn'=>'setUnpauseCaseDate');
$options[] = Array ('text' => G::LoadTranslation( 'ID_PAUSED_CASE' ),'fn' => 'setUnpauseCaseDate'
);
if ($cant == 1) {
if ($RBAC->userCanAccess( 'PM_CANCELCASE' ) == 1)
$options[] = Array('text'=>G::LoadTranslation('ID_CANCEL'), 'fn'=>'cancelCase');
$options[] = Array ('text' => G::LoadTranslation( 'ID_CANCEL' ),'fn' => 'cancelCase'
);
else
$options[] = Array('text'=>G::LoadTranslation('ID_CANCEL'), 'fn'=>'cancelCase', 'hide'=>'hiden');
$options[] = Array ('text' => G::LoadTranslation( 'ID_CANCEL' ),'fn' => 'cancelCase','hide' => 'hiden'
);
}
}
else {
$options[] = Array('text'=>G::LoadTranslation('ID_UNPAUSE'), 'fn'=>'unpauseCase');
} else {
$options[] = Array ('text' => G::LoadTranslation( 'ID_UNPAUSE' ),'fn' => 'unpauseCase'
);
}
if ($RBAC->userCanAccess( 'PM_REASSIGNCASE' ) == 1) {
$options[] = Array('text'=>G::LoadTranslation('ID_REASSIGN'), 'fn'=>'getUsersToReassign');
$options[] = Array ('text' => G::LoadTranslation( 'ID_REASSIGN' ),'fn' => 'getUsersToReassign'
);
}
break;
case 'CANCELLED':
$options[] = Array('text'=>G::LoadTranslation('ID_REACTIVATE'), 'fn'=>'reactivateCase');
$options[] = Array ('text' => G::LoadTranslation( 'ID_REACTIVATE' ),'fn' => 'reactivateCase'
);
break;
}
@@ -201,7 +214,8 @@ class Ajax
$oTask = new Task();
$aTask = $oTask->load( $_SESSION['TASK'] );
if ($aTask['TAS_TYPE'] == 'ADHOC') {
$options[] = Array('text'=>G::LoadTranslation('ID_ADHOC_ASSIGNMENT'), 'fn'=>'adhocAssignmentUsers');
$options[] = Array ('text' => G::LoadTranslation( 'ID_ADHOC_ASSIGNMENT' ),'fn' => 'adhocAssignmentUsers'
);
}
}
return $options;
@@ -223,7 +237,6 @@ class Ajax
$G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
$oHeadPublisher = & headPublisher::getSingleton();
//$oHeadPublisher->addScriptfile('/jscore/processmap/core/processmap.js');
$oHeadPublisher->addScriptCode( '
var maximunX = ' . processMap::getMaximunTaskX( $_SESSION['PROCESS'] ) . ';
@@ -306,7 +319,6 @@ class Ajax
oRPC.make();
}' );
G::RenderPage( 'publish', 'blank' );
}
@@ -338,84 +350,91 @@ class Ajax
print (G::json_encode( $taskData )) ;
}
function caseHistory() {
function caseHistory ()
{
global $G_PUBLISH;
G::loadClass( 'configuration' );
$oHeadPublisher = & headPublisher::getSingleton();
$conf = new Configurations;
$conf = new Configurations();
$oHeadPublisher->addExtJsScript( 'cases/caseHistory', true ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/caseHistory' ); //adding a html file .html.
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
G::RenderPage( 'publish', 'extJs' );
}
function messageHistory() {
function messageHistory ()
{
global $G_PUBLISH;
G::loadClass( 'configuration' );
$oHeadPublisher = & headPublisher::getSingleton();
$conf = new Configurations;
$conf = new Configurations();
$oHeadPublisher->addExtJsScript( 'cases/caseMessageHistory', true ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/caseMessageHistory' ); //adding a html file .html.
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
G::RenderPage( 'publish', 'extJs' );
}
function dynaformHistory() {
function dynaformHistory ()
{
global $G_PUBLISH;
G::loadClass( 'configuration' );
$oHeadPublisher = & headPublisher::getSingleton();
$conf = new Configurations;
$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' );
}
function uploadedDocuments() {
function uploadedDocuments ()
{
global $G_PUBLISH;
G::loadClass( 'configuration' );
$oHeadPublisher = & headPublisher::getSingleton();
$conf = new Configurations;
$conf = new Configurations();
$oHeadPublisher->addExtJsScript( 'cases/casesUploadedDocumentsPage', true ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesUploadedDocumentsPage' ); //adding a html file .html.
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
G::RenderPage( 'publish', 'extJs' );
}
function uploadedDocumentsSummary() {
function uploadedDocumentsSummary ()
{
global $G_PUBLISH;
G::loadClass( 'configuration' );
$oHeadPublisher = & headPublisher::getSingleton();
$conf = new Configurations;
$conf = new Configurations();
$oHeadPublisher->addExtJsScript( 'cases/casesUploadedDocumentsPage', true ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesUploadedDocumentsPage' ); //adding a html file .html.
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
G::RenderPage( 'publish', 'extJs' );
}
function generatedDocuments() {
function generatedDocuments ()
{
global $G_PUBLISH;
G::loadClass( 'configuration' );
$oHeadPublisher = & headPublisher::getSingleton();
$conf = new Configurations;
$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' );
}
function generatedDocumentsSummary() {
function generatedDocumentsSummary ()
{
global $G_PUBLISH;
G::loadClass( 'configuration' );
$oHeadPublisher = & headPublisher::getSingleton();
$conf = new Configurations;
$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' ) );
@@ -452,6 +471,7 @@ class Ajax
}
// End save
if ($multiple) {
foreach ($appUids as $i => $appUid)
$oCase->cancelCase( $appUid, $delIndexes[$i], $_SESSION['USER_LOGGED'] );
@@ -492,7 +512,6 @@ class Ajax
print G::json_encode( $result );
}
function pauseCase ()
{
try {
@@ -518,6 +537,7 @@ class Ajax
}
// End save
$oCase->pauseCase( $APP_UID, $DEL_INDEX, $_SESSION['USER_LOGGED'], $unpauseDate );
$app = new Application();
$caseData = $app->load( $APP_UID );
@@ -555,7 +575,8 @@ class Ajax
print G::json_encode( $result );
}
function deleteCase() {
function deleteCase ()
{
try {
$applicationUID = (isset( $_POST['APP_UID'] )) ? $_POST['APP_UID'] : $_SESSION['APPLICATION'];
$app = new Application();
@@ -567,8 +588,7 @@ class Ajax
$result->success = true;
$result->msg = G::LoadTranslation( 'ID_CASE_DELETED_SUCCESSFULLY', SYS_LANG, $data );
}
catch (Exception $e) {
} catch (Exception $e) {
$result->success = false;
$result->msg = $e->getMessage();
}
@@ -597,7 +617,8 @@ class Ajax
print G::json_encode( $result );
}
function changeLogTab(){
function changeLogTab ()
{
try {
global $G_PUBLISH;
require_once 'classes/model/AppHistory.php';
@@ -606,6 +627,7 @@ class Ajax
$idHistory = $_REQUEST["idHistory"];
//!dataInput
//!dataSytem
$idHistoryArray = explode( "_", $idHistory );
$_REQUEST["PRO_UID"] = $idHistoryArray[0];
@@ -613,7 +635,6 @@ class Ajax
$_REQUEST["TAS_UID"] = $idHistoryArray[2];
$_REQUEST["DYN_UID"] = "";
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'cases/cases_DynaformHistory' );
?>
@@ -622,6 +643,7 @@ class Ajax
html {
color: black !important;
}
body {
color: black !important;
}
@@ -741,8 +763,7 @@ class Ajax
$result->success = true;
$result->msg = G::LoadTranslation( 'ID_CASE_REACTIVATED_SUCCESSFULLY', SYS_LANG, "success" );
}
catch(Exception $e){
} catch (Exception $e) {
$result->success = false;
$result->msg = $e->getMessage();
}
@@ -825,3 +846,4 @@ class Ajax
<?php
}
}

View File

@@ -20,14 +20,10 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
$actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
if ($actionAjax == 'historyGridList_JXP') {
G::LoadClass( 'case' );
@@ -39,7 +35,6 @@
$result = new stdClass();
$aProcesses = Array ();
$rs = GulliverBasePeer::doSelectRs( $c );
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs->next();
@@ -63,6 +58,7 @@
$idHistory = $_REQUEST["idHistory"];
//!dataInput
//!dataSytem
$idHistoryArray = explode( "*", $idHistory );
$_REQUEST["PRO_UID"] = $idHistoryArray[0];
@@ -70,14 +66,13 @@
$_REQUEST["TAS_UID"] = $idHistoryArray[2];
$_REQUEST["DYN_UID"] = "";
?>
<table bgcolor="white" height=100% width=100%>
<tr>
<td height=99%>
<div style="width:100%; overflow-y: scroll; overflow-x: hidden; max-height: 310px;_height:310px;height:310px; visibility: inherit;" >
<div
style="width: 100%; overflow-y: scroll; overflow-x: hidden; max-height: 310px; _height: 310px; height: 310px; visibility: inherit;">
<?php
require_once 'classes/model/AppHistory.php';
@@ -98,42 +93,25 @@
<tr>
<td height=30 valign=top>
<table align=center cellspacing="0" class="x-btn x-btn-noicon" id="ext-comp-1043" style="width: 75px;margin-top:0px;">
<table align=center cellspacing="0" class="x-btn x-btn-noicon"
id="ext-comp-1043" style="width: 75px; margin-top: 0px;">
<tbody class="x-btn-small x-btn-icon-small-left">
<tr>
<td class="x-btn-tl">
<i>&nbsp;</i>
</td>
<td class="x-btn-tc">
</td>
<td class="x-btn-tr">
<i>&nbsp;</i>
</td>
<td class="x-btn-tl"><i>&nbsp;</i></td>
<td class="x-btn-tc"></td>
<td class="x-btn-tr"><i>&nbsp;</i></td>
</tr>
<tr>
<td class="x-btn-ml">
<i>&nbsp;</i>
</td>
<td class="x-btn-mc">
<em unselectable="on" class="">
<button type="button" id="ext-gen105" class=" x-btn-text">
OK
</button>
</em>
</td>
<td class="x-btn-mr">
<i>&nbsp;</i>
</td>
<td class="x-btn-ml"><i>&nbsp;</i></td>
<td class="x-btn-mc"><em unselectable="on" class="">
<button type="button" id="ext-gen105" class=" x-btn-text">OK</button>
</em></td>
<td class="x-btn-mr"><i>&nbsp;</i></td>
</tr>
<tr>
<td class="x-btn-bl">
<i>&nbsp;</i>
</td>
<td class="x-btn-bc">
</td>
<td class="x-btn-br">
<i>&nbsp;</i>
</td>
<td class="x-btn-bl"><i>&nbsp;</i></td>
<td class="x-btn-bc"></td>
<td class="x-btn-br"><i>&nbsp;</i></td>
</tr>
</tbody>
</table>
@@ -142,8 +120,6 @@
</table>
<?php
}
if ($actionAjax == "showDynaformHistoryGetNomDynaform_JXP") {
@@ -164,16 +140,14 @@
$c->add( $c0 );
$contentObjeto = ContentPeer::doSelectOne( $c );
if (is_object( $contentObjeto )) {
$dynTitle = $contentObjeto->getConValue();
}
$md5Hash = md5( $idDin . $dynDate );
//assign task
$result = new stdClass;
$result = new stdClass();
$result->dynTitle = $dynTitle;
$result->md5Hash = $md5Hash;

View File

@@ -20,14 +20,10 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
$actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
if ($actionAjax == 'messageHistoryGridList_JXP') {
G::LoadClass( 'case' );
@@ -48,14 +44,11 @@
$totalCount ++;
}
$newDir = '/tmp/test/directory';
$r = G::verifyPath( $newDir );
$r->data = $aProcesses;
$r->totalCount = $totalCount;
echo G::json_encode( $r );
}
if ($actionAjax == 'showHistoryMessage') {
@@ -66,6 +59,7 @@
html {
color: black !important;
}
body {
color: black !important;
}
@@ -97,7 +91,6 @@
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_MessagesView', '', $oCase->getHistoryMessagesTrackerView( $_POST['APP_UID'], $_POST['APP_MSG_UID'] ) );
?>
<script language="javascript">
<?php
@@ -119,11 +112,9 @@
$_POST['APP_UID'] = $_REQUEST['APP_UID'];
$_POST['APP_MSG_UID'] = $_REQUEST['APP_MSG_UID'];
G::LoadClass( 'case' );
$oCase = new Cases();
require_once 'classes/model/Configuration.php';
G::LoadClass( 'spool' );
@@ -131,6 +122,7 @@
$data = $oCase->getHistoryMessagesTrackerView( $_POST['APP_UID'], $_POST['APP_MSG_UID'] );
//print_r($data);
$oConfiguration = new Configuration();
$sDelimiter = DBAdapter::getStringDelimiter();
$oCriteria = new Criteria( 'workflow' );
@@ -140,7 +132,8 @@
$oCriteria->add( ConfigurationPeer::USR_UID, '' );
$oCriteria->add( ConfigurationPeer::APP_UID, '' );
if (ConfigurationPeer::doCount( $oCriteria ) == 0) {
$oConfiguration->create(array('CFG_UID'=>'Emails', 'OBJ_UID'=>'', 'CFG_VALUE'=>'', 'PRO_UID'=>'', 'USR_UID'=>'', 'APP_UID'=>''));
$oConfiguration->create( array ('CFG_UID' => 'Emails','OBJ_UID' => '','CFG_VALUE' => '','PRO_UID' => '','USR_UID' => '','APP_UID' => ''
) );
$aConfiguration = array ();
} else {
$aConfiguration = $oConfiguration->load( 'Emails', '', '', '', '' );
@@ -163,36 +156,15 @@
}
$aConfiguration['MESS_PASSWORD'] = $passwd;
$oSpool = new spoolRun();
$oSpool->setConfig(array(
'MESS_ENGINE' => $aConfiguration['MESS_ENGINE'],
'MESS_SERVER' => $aConfiguration['MESS_SERVER'],
'MESS_PORT' => $aConfiguration['MESS_PORT'],
'MESS_ACCOUNT' => $aConfiguration['MESS_ACCOUNT'],
'MESS_PASSWORD' => $passwd,
'SMTPAuth' => $aConfiguration['MESS_RAUTH']
$oSpool->setConfig( array ('MESS_ENGINE' => $aConfiguration['MESS_ENGINE'],'MESS_SERVER' => $aConfiguration['MESS_SERVER'],'MESS_PORT' => $aConfiguration['MESS_PORT'],'MESS_ACCOUNT' => $aConfiguration['MESS_ACCOUNT'],'MESS_PASSWORD' => $passwd,'SMTPAuth' => $aConfiguration['MESS_RAUTH']
) );
$oSpool->create(array(
'msg_uid' => $data['MSG_UID'],
'app_uid' => $data['APP_UID'],
'del_index' => $data['DEL_INDEX'],
'app_msg_type' => $data['APP_MSG_TYPE'],
'app_msg_subject'=> $data['APP_MSG_SUBJECT'],
'app_msg_from' => $data['APP_MSG_FROM'],
'app_msg_to' => $data['APP_MSG_TO'],
'app_msg_body' => $data['APP_MSG_BODY'],
'app_msg_cc' => $data['APP_MSG_CC'],
'app_msg_bcc' => $data['APP_MSG_BCC'],
'app_msg_attach'=> $data['APP_MSG_ATTACH'],
'app_msg_template'=>$data['APP_MSG_TEMPLATE'],
'app_msg_status'=> 'pending'
$oSpool->create( array ('msg_uid' => $data['MSG_UID'],'app_uid' => $data['APP_UID'],'del_index' => $data['DEL_INDEX'],'app_msg_type' => $data['APP_MSG_TYPE'],'app_msg_subject' => $data['APP_MSG_SUBJECT'],'app_msg_from' => $data['APP_MSG_FROM'],'app_msg_to' => $data['APP_MSG_TO'],'app_msg_body' => $data['APP_MSG_BODY'],'app_msg_cc' => $data['APP_MSG_CC'],'app_msg_bcc' => $data['APP_MSG_BCC'],'app_msg_attach' => $data['APP_MSG_ATTACH'],'app_msg_template' => $data['APP_MSG_TEMPLATE'],'app_msg_status' => 'pending'
) );
$oSpool->sendMail();
}
catch(Exception $e){
} catch (Exception $e) {
$errorMessage = $e->getMessage();
}
@@ -201,5 +173,3 @@
}

View File

@@ -18,8 +18,10 @@ $functionParams = isset($_REQUEST ['params']) ? $_REQUEST ['params'] : array();
$functionName( $functionParams );
function getExtJSParams() {
$validParams = array('callback' => '', 'dir' => 'DESC', 'sort' => '', 'start' => 0, 'limit' => 25, 'filter' => '', 'search' => '', 'action' => '', 'xaction' => '', 'data' => '', 'status' => '', 'query' => '', 'fields' => "");
function getExtJSParams ()
{
$validParams = array ('callback' => '','dir' => 'DESC','sort' => '','start' => 0,'limit' => 25,'filter' => '','search' => '','action' => '','xaction' => '','data' => '','status' => '','query' => '','fields' => ""
);
$result = array ();
foreach ($validParams as $paramName => $paramDefault) {
$result[$paramName] = isset( $_REQUEST[$paramName] ) ? $_REQUEST[$paramName] : isset( $_REQUEST[$paramName] ) ? $_REQUEST[$paramName] : $paramDefault;
@@ -27,7 +29,8 @@ function getExtJSParams() {
return $result;
}
function sendJsonResultGeneric($response, $callback) {
function sendJsonResultGeneric ($response, $callback)
{
header( "Content-Type: application/json" );
$finalResponse = G::json_encode( $response );
if ($callback != '') {
@@ -37,7 +40,8 @@ function sendJsonResultGeneric($response, $callback) {
}
}
function getNotesList() {
function getNotesList ()
{
extract( getExtJSParams() );
require_once ("classes/model/AppNotes.php");
if ((isset( $_REQUEST['appUid'] )) && (trim( $_REQUEST['appUid'] ) != "")) {
@@ -51,7 +55,8 @@ function getNotesList() {
sendJsonResultGeneric( $response['array'], $callback );
}
function postNote() {
function postNote ()
{
extract( getExtJSParams() );
if ((isset( $_REQUEST['appUid'] )) && (trim( $_REQUEST['appUid'] ) != "")) {
$appUid = $_REQUEST['appUid'];
@@ -69,4 +74,3 @@ function postNote() {
sendJsonResultGeneric( $response, $callback );
}
?>

View File

@@ -20,7 +20,6 @@
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
G::LoadClass( 'case' );
@@ -33,6 +32,7 @@ $oCase = new Cases();
// 'SHOW_MESSAGE');
//}
if (($RBAC_Response = $RBAC->userCanAccess( "PM_CASES" )) != 1) {
return $RBAC_Response;
}
@@ -191,25 +191,10 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
$oDataset->next();
$aDelegation = $oDataset->getRow();
$iDiff = strtotime( $aDelegation['DEL_FINISH_DATE'] ) - strtotime( $aDelegation['DEL_INIT_DATE'] );
$aFields['INIT_DATE'] = ($aDelegation['DEL_INIT_DATE'] != null ?
$aDelegation['DEL_INIT_DATE'] :
G::LoadTranslation('ID_CASE_NOT_YET_STARTED'));
$aFields['DUE_DATE'] = ($aDelegation['DEL_TASK_DUE_DATE'] != null ?
$aDelegation['DEL_TASK_DUE_DATE'] :
G::LoadTranslation('ID_NOT_FINISHED'));
$aFields['FINISH'] = ($aDelegation['DEL_FINISH_DATE'] != null ?
$aDelegation['DEL_FINISH_DATE'] :
G::LoadTranslation('ID_NOT_FINISHED'));
$aFields['DURATION'] = ($aDelegation['DEL_FINISH_DATE'] != null ?
(int) ($iDiff / 3600) . ' ' . ((int) ($iDiff / 3600) == 1 ?
G::LoadTranslation('ID_HOUR') :
G::LoadTranslation('ID_HOURS')) . ' ' . (int) (($iDiff % 3600) / 60) . ' ' .
((int) (($iDiff % 3600) / 60) == 1 ?
G::LoadTranslation('ID_MINUTE') : G::LoadTranslation('ID_MINUTES')) .
' ' . (int) (($iDiff % 3600) % 60) . ' ' .
((int) (($iDiff % 3600) % 60) == 1 ?
G::LoadTranslation('ID_SECOND') : G::LoadTranslation('ID_SECONDS')) :
G::LoadTranslation('ID_NOT_FINISHED'));
$aFields['INIT_DATE'] = ($aDelegation['DEL_INIT_DATE'] != null ? $aDelegation['DEL_INIT_DATE'] : G::LoadTranslation( 'ID_CASE_NOT_YET_STARTED' ));
$aFields['DUE_DATE'] = ($aDelegation['DEL_TASK_DUE_DATE'] != null ? $aDelegation['DEL_TASK_DUE_DATE'] : G::LoadTranslation( 'ID_NOT_FINISHED' ));
$aFields['FINISH'] = ($aDelegation['DEL_FINISH_DATE'] != null ? $aDelegation['DEL_FINISH_DATE'] : G::LoadTranslation( 'ID_NOT_FINISHED' ));
$aFields['DURATION'] = ($aDelegation['DEL_FINISH_DATE'] != null ? (int) ($iDiff / 3600) . ' ' . ((int) ($iDiff / 3600) == 1 ? G::LoadTranslation( 'ID_HOUR' ) : G::LoadTranslation( 'ID_HOURS' )) . ' ' . (int) (($iDiff % 3600) / 60) . ' ' . ((int) (($iDiff % 3600) / 60) == 1 ? G::LoadTranslation( 'ID_MINUTE' ) : G::LoadTranslation( 'ID_MINUTES' )) . ' ' . (int) (($iDiff % 3600) % 60) . ' ' . ((int) (($iDiff % 3600) % 60) == 1 ? G::LoadTranslation( 'ID_SECOND' ) : G::LoadTranslation( 'ID_SECONDS' )) : G::LoadTranslation( 'ID_NOT_FINISHED' ));
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_TaskInformation', '', $aFields );
@@ -240,31 +225,11 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
$iDiff = strtotime( $aRow['DEL_FINISH_DATE'] ) - strtotime( $aRow['DEL_INIT_DATE'] );
$aFields = array ();
$aFields['TASK'] = $sTitle;
$aFields['USER'] = ($aRow['USR_UID'] != null ?
$aRow['USR_FIRSTNAME'] . ' ' . $aRow['USR_LASTNAME'] :
G::LoadTranslation('ID_NONE'));
$aFields['INIT_DATE'] = ($aRow['DEL_INIT_DATE'] != null ?
$aRow['DEL_INIT_DATE'] :
G::LoadTranslation('ID_CASE_NOT_YET_STARTED'));
$aFields['DUE_DATE'] = ($aRow['DEL_TASK_DUE_DATE'] != null ?
$aRow['DEL_TASK_DUE_DATE'] :
G::LoadTranslation('ID_CASE_NOT_YET_STARTED'));
$aFields['FINISH'] = ($aRow['DEL_FINISH_DATE'] != null ?
$aRow['DEL_FINISH_DATE'] :
G::LoadTranslation('ID_NOT_FINISHED'));
$aFields['DURATION'] = ($aRow['DEL_FINISH_DATE'] != null ?
(int) ($iDiff / 3600) . ' ' . ((int) ($iDiff / 3600) == 1 ?
G::LoadTranslation('ID_HOUR') :
G::LoadTranslation('ID_HOURS')) . ' ' .
(int) (($iDiff % 3600) / 60) . ' ' .
((int) (($iDiff % 3600) / 60) == 1 ?
G::LoadTranslation('ID_MINUTE') :
G::LoadTranslation('ID_MINUTES')) . ' ' .
(int) (($iDiff % 3600) % 60) . ' ' .
((int) (($iDiff % 3600) % 60) == 1 ?
G::LoadTranslation('ID_SECOND') :
G::LoadTranslation('ID_SECONDS')) :
G::LoadTranslation('ID_NOT_FINISHED'));
$aFields['USER'] = ($aRow['USR_UID'] != null ? $aRow['USR_FIRSTNAME'] . ' ' . $aRow['USR_LASTNAME'] : G::LoadTranslation( 'ID_NONE' ));
$aFields['INIT_DATE'] = ($aRow['DEL_INIT_DATE'] != null ? $aRow['DEL_INIT_DATE'] : G::LoadTranslation( 'ID_CASE_NOT_YET_STARTED' ));
$aFields['DUE_DATE'] = ($aRow['DEL_TASK_DUE_DATE'] != null ? $aRow['DEL_TASK_DUE_DATE'] : G::LoadTranslation( 'ID_CASE_NOT_YET_STARTED' ));
$aFields['FINISH'] = ($aRow['DEL_FINISH_DATE'] != null ? $aRow['DEL_FINISH_DATE'] : G::LoadTranslation( 'ID_NOT_FINISHED' ));
$aFields['DURATION'] = ($aRow['DEL_FINISH_DATE'] != null ? (int) ($iDiff / 3600) . ' ' . ((int) ($iDiff / 3600) == 1 ? G::LoadTranslation( 'ID_HOUR' ) : G::LoadTranslation( 'ID_HOURS' )) . ' ' . (int) (($iDiff % 3600) / 60) . ' ' . ((int) (($iDiff % 3600) / 60) == 1 ? G::LoadTranslation( 'ID_MINUTE' ) : G::LoadTranslation( 'ID_MINUTES' )) . ' ' . (int) (($iDiff % 3600) % 60) . ' ' . ((int) (($iDiff % 3600) % 60) == 1 ? G::LoadTranslation( 'ID_SECOND' ) : G::LoadTranslation( 'ID_SECONDS' )) : G::LoadTranslation( 'ID_NOT_FINISHED' ));
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_TaskDetails', '', $aFields );
@@ -277,9 +242,7 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
G::LoadClass( 'user' );
$oUser = new User( new DBConnection() );
$oUser->load( $_POST['USR_UID'] );
echo $oUser->Fields['USR_FIRSTNAME'] . ' ' . $oUser->Fields['USR_LASTNAME'] .
'<input type="hidden" name="form[TASKS][1][USR_UID]" id="form[TASKS][1][USR_UID]" value="' .
$_POST['USR_UID'] . '">';
echo $oUser->Fields['USR_FIRSTNAME'] . ' ' . $oUser->Fields['USR_LASTNAME'] . '<input type="hidden" name="form[TASKS][1][USR_UID]" id="form[TASKS][1][USR_UID]" value="' . $_POST['USR_UID'] . '">';
break;
case 'MANUAL':
$sAux = '<select name="form[TASKS][1][USR_UID]" id="form[TASKS][1][USR_UID]">';
@@ -308,8 +271,7 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
$sConcat = $oDataBase->concatString( "U.USR_LASTNAME", "' '", "U.USR_FIRSTNAME" );
}
$sSQL = " SELECT
TU.USR_UID AS USR_UID, " .
$sConcat . " AS USR_FULLNAME
TU.USR_UID AS USR_UID, " . $sConcat . " AS USR_FULLNAME
FROM
TASK_USER AS TU
LEFT JOIN
@@ -344,12 +306,9 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
G::LoadClass( 'user' );
$oUser = new User( new DBConnection() );
$oUser->load( $sUser );
echo $oUser->Fields['USR_FIRSTNAME'] . ' ' . $oUser->Fields['USR_LASTNAME'] .
'<input type="hidden" name="form[TASKS][1][USR_UID]" id="form[TASKS][1][USR_UID]" value="' .
$sUser . '">';
echo $oUser->Fields['USR_FIRSTNAME'] . ' ' . $oUser->Fields['USR_LASTNAME'] . '<input type="hidden" name="form[TASKS][1][USR_UID]" id="form[TASKS][1][USR_UID]" value="' . $sUser . '">';
} else {
echo '<strong>Error: </strong>' . $_POST['TAS_ASSIGN_VARIABLE'] . ' ' .
G::LoadTranslation('ID_EMPTY');
echo '<strong>Error: </strong>' . $_POST['TAS_ASSIGN_VARIABLE'] . ' ' . G::LoadTranslation( 'ID_EMPTY' );
echo '<input type="hidden" name="_ERROR_" id="_ERROR_" value="">';
}
break;
@@ -412,6 +371,7 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
}
// End save
$unpauseDate = $_POST['unpausedate'];
$oCase = new Cases();
if (isset( $_POST['APP_UID'] ) && isset( $_POST['DEL_INDEX'] )) {
@@ -477,16 +437,14 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
break;
case 'reassignCase':
$cases = new Cases();
$cases->reassignCase($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'],
$_POST['USR_UID'], $_POST['THETYPE']);
$cases->reassignCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], $_POST['USR_UID'], $_POST['THETYPE'] );
break;
case 'toRevisePanel':
$_GET['APP_UID'] = $_POST['APP_UID'];
$_GET['DEL_INDEX'] = $_POST['DEL_INDEX'];
$G_PUBLISH = new Publisher();
echo "<iframe scrolling='no' style='border:none;height=300px;width:240px;'" .
" src='casesToRevisePanelExtJs?APP_UID={$_GET['APP_UID']}&DEL_INDEX={$_GET['DEL_INDEX']}'></iframe>";
echo "<iframe scrolling='no' style='border:none;height=300px;width:240px;'" . " src='casesToRevisePanelExtJs?APP_UID={$_GET['APP_UID']}&DEL_INDEX={$_GET['DEL_INDEX']}'></iframe>";
// $G_PUBLISH->AddContent( 'smarty', 'cases/cases_toRevise' );
// $G_PUBLISH->AddContent('smarty', 'cases/cases_toReviseIn', '', '', array());
G::RenderPage( 'publish', 'raw' );
@@ -495,11 +453,7 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
$oCase = new Cases();
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'cases/cases_AllInputdocsList',
$oCase->getAllUploadedDocumentsCriteria($_SESSION['PROCESS'],
$_SESSION['APPLICATION'],
$_SESSION['TASK'],
$_SESSION['USER_LOGGED']));
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_AllInputdocsList', $oCase->getAllUploadedDocumentsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED'] ) );
G::RenderPage( 'publish', 'raw' );
break;
case 'showUploadedDocument':
@@ -556,19 +510,14 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
//$oAppDocument->Fields['VIEW'] = G::LoadTranslation('ID_OPEN');
$oAppDocument->Fields['FILE'] = 'cases_ShowDocument?a=' . $_POST['APP_DOC_UID'] . '&r=' . rand();
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $sXmlForm, '',
G::array_merges($Fields, $oAppDocument->Fields), '');
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $sXmlForm, '', G::array_merges( $Fields, $oAppDocument->Fields ), '' );
G::RenderPage( 'publish', 'raw' );
break;
case 'showGeneratedDocuments':
global $G_PUBLISH;
$oCase = new Cases();
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_AllOutputdocsList',
$oCase->getAllGeneratedDocumentsCriteria( $_SESSION['PROCESS'],
$_SESSION['APPLICATION'],
$_SESSION['TASK'],
$_SESSION['USER_LOGGED']));
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_AllOutputdocsList', $oCase->getAllGeneratedDocumentsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED'] ) );
G::RenderPage( 'publish', 'raw' );
break;
@@ -580,10 +529,7 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
$oCase = new Cases();
$aProcesses = Array ();
$G_PUBLISH = new Publisher();
$c = $oCase->getAllUploadedDocumentsCriteria( $_SESSION['PROCESS'],
$_SESSION['APPLICATION'],
$_SESSION['TASK'],
$_SESSION['USER_LOGGED']);
$c = $oCase->getAllUploadedDocumentsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED'] );
if ($c->getDbName() == 'dbarray') {
$rs = ArrayBasePeer::doSelectRs( $c );
@@ -620,10 +566,7 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
$oCase = new Cases();
$aProcesses = Array ();
$G_PUBLISH = new Publisher();
$c = $oCase->getAllGeneratedDocumentsCriteria( $_SESSION['PROCESS'],
$_SESSION['APPLICATION'],
$_SESSION['TASK'],
$_SESSION['USER_LOGGED']);
$c = $oCase->getAllGeneratedDocumentsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED'] );
if ($c->getDbName() == 'dbarray') {
$rs = ArrayBasePeer::doSelectRs( $c );
@@ -697,19 +640,14 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
$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();
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ViewAnyOutputDocument', '',
G::array_merges($aOD, $aFields), '');
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ViewAnyOutputDocument', '', G::array_merges( $aOD, $aFields ), '' );
G::RenderPage( 'publish', 'raw' );
break;
case 'showDynaformList':
$oCase = new Cases();
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_AllDynaformsList',
$oCase->getallDynaformsCriteria( $_SESSION['PROCESS'],
$_SESSION['APPLICATION'],
$_SESSION['TASK'],
$_SESSION['USER_LOGGED']));
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_AllDynaformsList', $oCase->getallDynaformsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED'] ) );
G::RenderPage( 'publish', 'raw' );
break;
case 'showDynaform':
@@ -728,8 +666,7 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
if (! isset( $_SESSION['CURRENT_DYN_UID'] )) {
$_SESSION['CURRENT_DYN_UID'] = $_POST['DYN_UID'] ? $_POST['DYN_UID'] : $_REQUEST['DYN_UID'];
}
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_REQUEST['DYN_UID'], '',
$Fields['APP_DATA'], '', '', 'view');
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_REQUEST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view' );
G::RenderPage( 'publish', 'blank' );
break;
case 'showDynaformHistory':
@@ -740,8 +677,7 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
$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');
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view' );
G::RenderPage( 'publish', 'raw' );
break;
case 'adhocAssignmentUsers':
@@ -774,24 +710,22 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'processes/processes_viewreassignCase',
$oCriteria, array('THETYPE'=>'ADHOC'));
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'processes/processes_viewreassignCase', $oCriteria, array ('THETYPE' => 'ADHOC'
) );
G::RenderPage( 'publish', 'raw' );
break;
case 'showHistoryMessages':
$oCase = new Cases();
global $G_PUBLISH;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_Messages',
$oCase->getHistoryMessagesTracker($_SESSION['APPLICATION']));
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_Messages', $oCase->getHistoryMessagesTracker( $_SESSION['APPLICATION'] ) );
G::RenderPage( 'publish', 'raw' );
break;
case 'showHistoryMessage':
$G_PUBLISH = new Publisher();
$oCase = new Cases();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_MessagesView', '',
$oCase->getHistoryMessagesTrackerView($_POST['APP_UID'], $_POST['APP_MSG_UID']));
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_MessagesView', '', $oCase->getHistoryMessagesTrackerView( $_POST['APP_UID'], $_POST['APP_MSG_UID'] ) );
G::RenderPage( 'publish', 'raw' );
break;
case 'deleteUploadedDocument':
@@ -799,20 +733,14 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
$oAppDocument = new AppDocument();
$oAppDocument->remove( $_POST['DOC'] );
$oCase = new Cases();
$oCase->getAllUploadedDocumentsCriteria( $_SESSION['PROCESS'],
$_SESSION['APPLICATION'],
$_SESSION['TASK'],
$_SESSION['USER_LOGGED']);
$oCase->getAllUploadedDocumentsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED'] );
break;
case 'deleteGeneratedDocument':
require_once 'classes/model/AppDocument.php';
$oAppDocument = new AppDocument();
$oAppDocument->remove( $_POST['DOC'] );
$oCase = new Cases();
$oCase->getAllGeneratedDocumentsCriteria( $_SESSION['PROCESS'],
$_SESSION['APPLICATION'],
$_SESSION['TASK'],
$_SESSION['USER_LOGGED']);
$oCase->getAllGeneratedDocumentsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED'] );
break;
/* @Author Erik Amaru Ortiz <erik@colosa.com> */
case 'resendMessage':
@@ -823,6 +751,7 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
$data = $oCase->getHistoryMessagesTrackerView( $_POST['APP_UID'], $_POST['APP_MSG_UID'] );
//print_r($data);
$oConfiguration = new Configuration();
$sDelimiter = DBAdapter::getStringDelimiter();
$oCriteria = new Criteria( 'workflow' );
@@ -832,8 +761,8 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
$oCriteria->add( ConfigurationPeer::USR_UID, '' );
$oCriteria->add( ConfigurationPeer::APP_UID, '' );
if (ConfigurationPeer::doCount( $oCriteria ) == 0) {
$oConfiguration->create( array( 'CFG_UID'=>'Emails', 'OBJ_UID'=>'', 'CFG_VALUE'=>'',
'PRO_UID'=>'', 'USR_UID'=>'', 'APP_UID'=>''));
$oConfiguration->create( array ('CFG_UID' => 'Emails','OBJ_UID' => '','CFG_VALUE' => '','PRO_UID' => '','USR_UID' => '','APP_UID' => ''
) );
$aConfiguration = array ();
} else {
$aConfiguration = $oConfiguration->load( 'Emails', '', '', '', '' );
@@ -845,13 +774,7 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
}
$oSpool = new spoolRun();
$oSpool->setConfig(array(
'MESS_ENGINE' => $aConfiguration['MESS_ENGINE'],
'MESS_SERVER' => $aConfiguration['MESS_SERVER'],
'MESS_PORT' => $aConfiguration['MESS_PORT'],
'MESS_ACCOUNT' => $aConfiguration['MESS_ACCOUNT'],
'MESS_PASSWORD' => $aConfiguration['MESS_PASSWORD'],
'SMTPAuth' => $aConfiguration['MESS_RAUTH']
$oSpool->setConfig( array ('MESS_ENGINE' => $aConfiguration['MESS_ENGINE'],'MESS_SERVER' => $aConfiguration['MESS_SERVER'],'MESS_PORT' => $aConfiguration['MESS_PORT'],'MESS_ACCOUNT' => $aConfiguration['MESS_ACCOUNT'],'MESS_PASSWORD' => $aConfiguration['MESS_PASSWORD'],'SMTPAuth' => $aConfiguration['MESS_RAUTH']
) );
$passwd = $oSpool->config['MESS_PASSWORD'];
$passwdDec = G::decrypt( $passwd, 'EMAILENCRYPT' );
@@ -865,20 +788,7 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
}
}
$oSpool->config['MESS_PASSWORD'] = $passwd;
$oSpool->create(array(
'msg_uid' => $data['MSG_UID'],
'app_uid' => $data['APP_UID'],
'del_index' => $data['DEL_INDEX'],
'app_msg_type' => $data['APP_MSG_TYPE'],
'app_msg_subject'=> $data['APP_MSG_SUBJECT'],
'app_msg_from' => $data['APP_MSG_FROM'],
'app_msg_to' => $data['APP_MSG_TO'],
'app_msg_body' => $data['APP_MSG_BODY'],
'app_msg_cc' => $data['APP_MSG_CC'],
'app_msg_bcc' => $data['APP_MSG_BCC'],
'app_msg_attach'=> $data['APP_MSG_ATTACH'],
'app_msg_template'=>$data['APP_MSG_TEMPLATE'],
'app_msg_status'=> 'pending'
$oSpool->create( array ('msg_uid' => $data['MSG_UID'],'app_uid' => $data['APP_UID'],'del_index' => $data['DEL_INDEX'],'app_msg_type' => $data['APP_MSG_TYPE'],'app_msg_subject' => $data['APP_MSG_SUBJECT'],'app_msg_from' => $data['APP_MSG_FROM'],'app_msg_to' => $data['APP_MSG_TO'],'app_msg_body' => $data['APP_MSG_BODY'],'app_msg_cc' => $data['APP_MSG_CC'],'app_msg_bcc' => $data['APP_MSG_BCC'],'app_msg_attach' => $data['APP_MSG_ATTACH'],'app_msg_template' => $data['APP_MSG_TEMPLATE'],'app_msg_status' => 'pending'
) );
$oSpool->sendMail();
break;
@@ -915,8 +825,7 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
foreach ($aCaseUsers as $aCaseUser) {
if ($aCaseUser['USR_UID'] != $sReassignFromUser) {
$aCaseUserRecord = $oUser->load( $aCaseUser['USR_UID'] );
$aUsersInvolved[$aCaseUser['USR_UID']] = $aCaseUserRecord['USR_FIRSTNAME'] . ' ' .
$aCaseUserRecord['USR_LASTNAME'];
$aUsersInvolved[$aCaseUser['USR_UID']] = $aCaseUserRecord['USR_FIRSTNAME'] . ' ' . $aCaseUserRecord['USR_LASTNAME'];
// . ' (' . $aCaseUserRecord['USR_USERNAME'] . ')';
}
}
@@ -926,8 +835,7 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
foreach ($aCaseUsers as $aCaseUser) {
if ($aCaseUser['USR_UID'] != $sReassignFromUser) {
$aCaseUserRecord = $oUser->load( $aCaseUser['USR_UID'] );
$aUsersInvolved[$aCaseUser['USR_UID']] = $aCaseUserRecord['USR_FIRSTNAME'] . ' ' .
$aCaseUserRecord['USR_LASTNAME'];
$aUsersInvolved[$aCaseUser['USR_UID']] = $aCaseUserRecord['USR_FIRSTNAME'] . ' ' . $aCaseUserRecord['USR_LASTNAME'];
// . ' (' . $aCaseUserRecord['USR_USERNAME'] . ')';
}
}
@@ -938,36 +846,19 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
array_push( $aCasesList, $aCase );
}
$filedNames = Array (
"APP_UID",
"APP_NUMBER",
"APP_UPDATE_DATE",
"DEL_PRIORITY",
"DEL_INDEX",
"TAS_UID",
"DEL_INIT_DATE",
"DEL_FINISH_DATE",
"USR_UID",
"APP_STATUS",
"DEL_TASK_DUE_DATE",
"APP_CURRENT_USER",
"APP_TITLE",
"APP_PRO_TITLE",
"APP_TAS_TITLE",
"APP_DEL_PREVIOUS_USER",
"USERS"
$filedNames = Array ("APP_UID","APP_NUMBER","APP_UPDATE_DATE","DEL_PRIORITY","DEL_INDEX","TAS_UID","DEL_INIT_DATE","DEL_FINISH_DATE","USR_UID","APP_STATUS","DEL_TASK_DUE_DATE","APP_CURRENT_USER","APP_TITLE","APP_PRO_TITLE","APP_TAS_TITLE","APP_DEL_PREVIOUS_USER","USERS"
);
$aCasesList = array_merge(Array($filedNames), $aCasesList);
$aCasesList = array_merge( Array ($filedNames
), $aCasesList );
global $_DBArray;
$_DBArray['reassign_byuser'] = $aCasesList;
G::LoadClass( 'ArrayPeer' );
$oCriteria = new Criteria( 'dbarray' );
$oCriteria->setDBArrayTable( 'reassign_byuser' );
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent( 'propeltable', 'cases/paged-table-reassigByUser2',
'cases/cases_ToReassignByUserList2', $oCriteria);
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'propeltable', 'cases/paged-table-reassigByUser2', 'cases/cases_ToReassignByUserList2', $oCriteria );
G::RenderPage( 'publish', 'raw' );
break;
/* @Author Erik Amaru Ortiz <erik@colosa.com> */
@@ -990,19 +881,17 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
}
//G::pr($aCases);
require_once 'classes/model/Users.php';
$oUser = new Users();
$sText = '';
foreach ($aCases as $aCase) {
$aCaseUpdated = $oCases->loadCaseInCurrentDelegation( $aCase['APP_UID'], true );
$aUser = $oUser->load( $aCaseUpdated['USR_UID'] );
$sText .= $aCaseUpdated['APP_PRO_TITLE'] .' - '. ' Case: ' . $aCaseUpdated['APP_NUMBER'] . '# (' .
$aCaseUpdated['APP_TAS_TITLE'] . ') <b> => Reassigned to => </b> <font color="blue">' .
$aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' [' . $aUser['USR_USERNAME'] .
']' . '</font><br />';
$sText .= $aCaseUpdated['APP_PRO_TITLE'] . ' - ' . ' Case: ' . $aCaseUpdated['APP_NUMBER'] . '# (' . $aCaseUpdated['APP_TAS_TITLE'] . ') <b> => Reassigned to => </b> <font color="blue">' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' [' . $aUser['USR_USERNAME'] . ']' . '</font><br />';
}
$G_PUBLISH = new Publisher;
$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 );
@@ -1011,51 +900,38 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
break;
case "uploadInputDocument":
//krumo($_POST);
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$Fields['DOC_UID'] = $_POST['docID'];
$Fields['APP_DOC_UID'] = $_POST['appDocId'];
$Fields['actionType'] = $_POST['actionType'];
$Fields['docVersion'] = $_POST['docVersion'];
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '',
$Fields, 'cases_SaveDocument?UID=' . $_POST['docID']);
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '', $Fields, 'cases_SaveDocument?UID=' . $_POST['docID'] );
G::RenderPage( 'publish', 'raw' );
break;
case "uploadToReviseInputDocument":
//krumo($_POST);
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$Fields['DOC_UID'] = $_POST['docID'];
$Fields['APP_DOC_UID'] = $_POST['appDocId'];
$Fields['actionType'] = $_POST['actionType'];
$Fields['docVersion'] = $_POST['docVersion'];
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '',
$Fields, 'cases_SupervisorSaveDocument?UID=' . $_POST['docID'] .
'&APP_UID=' . $_POST['appDocId']);
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '', $Fields, 'cases_SupervisorSaveDocument?UID=' . $_POST['docID'] . '&APP_UID=' . $_POST['appDocId'] );
G::RenderPage( 'publish', 'raw' );
break;
case "inputDocumentVersionHistory":
//krumo($_POST);
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
$Fields['DOC_UID'] = $_POST['docID'];
$Fields['APP_DOC_UID'] = $_POST['appDocId'];
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_InputdocsListHistory',
$oCase->getInputDocumentsCriteria( $_SESSION['APPLICATION'],
$_SESSION['INDEX'],
$_POST['docID'],
$_POST['appDocId']),
array());//$aFields
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_InputdocsListHistory', $oCase->getInputDocumentsCriteria( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_POST['docID'], $_POST['appDocId'] ), array () ); //$aFields
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral',
// '', $Fields, 'cases_SaveDocument?UID=' . $_POST['docID']);
G::RenderPage( 'publish', 'raw' );
break;
case "getCountCasesFolder":
$json = new Services_JSON();
$aTypes = Array('to_do', 'draft', 'cancelled', 'sent', 'paused', 'completed','selfservice',
'to_revise','to_reassign');
$aTypesID = Array('to_do'=>'CASES_INBOX', 'draft'=>'CASES_DRAFT', 'cancelled'=>'CASES_CANCELLED',
'sent'=>'CASES_SENT', 'paused'=>'CASES_PAUSED', 'completed'=>'CASES_COMPLETED',
'selfservice'=>'CASES_SELFSERVICE','to_revise'=>'CASES_TO_REVISE',
'to_reassign'=>'CASES_TO_REASSIGN');
$aTypes = Array ('to_do','draft','cancelled','sent','paused','completed','selfservice','to_revise','to_reassign');
$aTypesID = Array ('to_do' => 'CASES_INBOX','draft' => 'CASES_DRAFT','cancelled' => 'CASES_CANCELLED','sent' => 'CASES_SENT','paused' => 'CASES_PAUSED','completed' => 'CASES_COMPLETED','selfservice' => 'CASES_SELFSERVICE','to_revise' => 'CASES_TO_REVISE','to_reassign' => 'CASES_TO_REASSIGN');
if (! isset( $_POST['A'] )) {
$oCases = new Cases();
@@ -1091,8 +967,7 @@ switch (($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
function getCasesTypeIds ()
{
$aTypes = Array('to_do', 'draft', 'cancelled', 'sent', 'paused', 'completed','selfservice',
'to_revise','to_reassign');
$aTypes = Array ('to_do','draft','cancelled','sent','paused','completed','selfservice','to_revise','to_reassign');
return $aTypesID;
}

View File

@@ -27,7 +27,7 @@
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_ADVANCEDSEARCH';
$G_PUBLISH = new Publisher;
$G_PUBLISH = new Publisher();
global $RBAC;
$permisse = $RBAC->userCanAccess( 'PM_ALLCASES' );
@@ -45,18 +45,15 @@
$oDataset->next();
$aSupervisor = array ();
while ($aRow = $oDataset->getRow())
{
while ($aRow = $oDataset->getRow()) {
$aSupervisor[] = $aRow['PRO_UID'];
$oDataset->next();
}
G::LoadClass( 'case' );
$oCases = new Cases();
if (isset($_POST['form']))
{
if (isset( $_POST['form'] )) {
$fields['CASE_NUMBER'] = $_POST['form']['CASE_NUMBER'];
$fields['PROCESS'] = $_POST['form']['PROCESS'];
$fields['TASKS'] = $_POST['form']['TASKS'];
@@ -68,9 +65,7 @@
$Criteria = $oCases->getAdvancedSearch( $fields['CASE_NUMBER'], $fields['PROCESS'], $fields['TASKS'], $fields['CURRENT_USER'], $fields['SENT_BY'], $fields['LAST_MODIFICATION_F'], $fields['LAST_MODIFICATION_T'], $fields['APP_STATUS'], $permisse, $userlogged, $aSupervisor );
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_advancedSearchFilter', '', $fields );
}
else
{
} else {
//list($Criteria,$xmlform) = $oCases->getConditionCasesList('gral');
$Criteria = $oCases->getAdvancedSearch( '', '', '', '', '', '', '', '', $permisse, $userlogged, $aSupervisor );
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_advancedSearchFilter' );
@@ -83,3 +78,4 @@
parent.outerLayout.hide('east');
parent.PANEL_EAST_OPEN = false;
</script>