Merge pull request #835 from ralpheav/master

Code Style change  workflow/engine/methods/cases/
This commit is contained in:
ferOnti
2012-10-19 08:44:28 -07:00
5 changed files with 1145 additions and 1171 deletions

View File

@@ -44,7 +44,7 @@ $ajax->$action( $_REQUEST );
class Ajax class Ajax
{ {
function getCaseMenu ($params) public function getCaseMenu ($params)
{ {
G::LoadClass( "configuration" ); G::LoadClass( "configuration" );
@@ -59,8 +59,7 @@ class Ajax
$menuOptions = Array (); $menuOptions = Array ();
foreach ($oMenu->Options as $i => $action) { 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']) { switch ($option['id']) {
case 'STEPS': case 'STEPS':
@@ -79,7 +78,7 @@ class Ajax
echo G::json_encode( $menuOptions ); echo G::json_encode( $menuOptions );
} }
function steps () public function steps ()
{ {
G::LoadClass( 'applications' ); G::LoadClass( 'applications' );
$applications = new Applications(); $applications = new Applications();
@@ -122,30 +121,22 @@ class Ajax
echo G::json_encode( $list ); echo G::json_encode( $list );
} }
function getInformationOptions () public function getInformationOptions ()
{ {
$options = Array (); $options = Array ();
$options[] = Array ('text' => G::LoadTranslation( 'ID_PROCESS_MAP' ),'fn' => 'processMap' $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_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_TASK_INFORMATION' ),'fn' => 'taskInformation' $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_CASE_HISTORY' ),'fn' => 'caseHistory' $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_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; return $options;
} }
function getActionOptions () public function getActionOptions ()
{ {
$APP_UID = $_SESSION['APPLICATION']; $APP_UID = $_SESSION['APPLICATION'];
@@ -166,47 +157,36 @@ class Ajax
switch ($aFields['APP_STATUS']) { switch ($aFields['APP_STATUS']) {
case 'DRAFT': case 'DRAFT':
if (! AppDelay::isPaused( $_SESSION['APPLICATION'], $_SESSION['INDEX'] )) { 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 { } 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) { 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; break;
case 'TO_DO': case 'TO_DO':
if (! AppDelay::isPaused( $_SESSION['APPLICATION'], $_SESSION['INDEX'] )) { 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 ($cant == 1) {
if ($RBAC->userCanAccess( 'PM_CANCELCASE' ) == 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 {
else $options[] = Array ('text' => G::LoadTranslation( 'ID_CANCEL' ),'fn' => 'cancelCase','hide' => 'hiden');
$options[] = Array ('text' => G::LoadTranslation( 'ID_CANCEL' ),'fn' => 'cancelCase','hide' => 'hiden' }
);
} }
} else { } else {
$options[] = Array ('text' => G::LoadTranslation( 'ID_UNPAUSE' ),'fn' => 'unpauseCase' $options[] = Array ('text' => G::LoadTranslation( 'ID_UNPAUSE' ),'fn' => 'unpauseCase');
);
} }
if ($RBAC->userCanAccess( 'PM_REASSIGNCASE' ) == 1) { 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; break;
case 'CANCELLED': case 'CANCELLED':
$options[] = Array ('text' => G::LoadTranslation( 'ID_REACTIVATE' ),'fn' => 'reactivateCase' $options[] = Array ('text' => G::LoadTranslation( 'ID_REACTIVATE' ),'fn' => 'reactivateCase');
);
break; break;
} }
@@ -214,14 +194,13 @@ class Ajax
$oTask = new Task(); $oTask = new Task();
$aTask = $oTask->load( $_SESSION['TASK'] ); $aTask = $oTask->load( $_SESSION['TASK'] );
if ($aTask['TAS_TYPE'] == 'ADHOC') { 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; return $options;
} }
function processMap () public function processMap ()
{ {
global $G_PUBLISH; global $G_PUBLISH;
global $G_CONTENT; global $G_CONTENT;
@@ -322,7 +301,7 @@ class Ajax
G::RenderPage( 'publish', 'blank' ); G::RenderPage( 'publish', 'blank' );
} }
function getProcessInformation () public function getProcessInformation ()
{ {
$process = new Process(); $process = new Process();
$processData = $process->load( $_SESSION['PROCESS'] ); $processData = $process->load( $_SESSION['PROCESS'] );
@@ -340,17 +319,18 @@ class Ajax
print (G::json_encode( $processData )) ; print (G::json_encode( $processData )) ;
} }
function getTaskInformation () public function getTaskInformation ()
{ {
$task = new Task(); $task = new Task();
if ($_SESSION['TASK'] == '-1') if ($_SESSION['TASK'] == '-1') {
$_SESSION['TASK'] = $_SESSION['CURRENT_TASK']; $_SESSION['TASK'] = $_SESSION['CURRENT_TASK'];
}
$taskData = $task->getDelegatedTaskData( $_SESSION['TASK'], $_SESSION['APPLICATION'], $_SESSION['INDEX'] ); $taskData = $task->getDelegatedTaskData( $_SESSION['TASK'], $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
print (G::json_encode( $taskData )) ; print (G::json_encode( $taskData )) ;
} }
function caseHistory () public function caseHistory ()
{ {
global $G_PUBLISH; global $G_PUBLISH;
G::loadClass( 'configuration' ); G::loadClass( 'configuration' );
@@ -363,7 +343,7 @@ class Ajax
G::RenderPage( 'publish', 'extJs' ); G::RenderPage( 'publish', 'extJs' );
} }
function messageHistory () public function messageHistory ()
{ {
global $G_PUBLISH; global $G_PUBLISH;
G::loadClass( 'configuration' ); G::loadClass( 'configuration' );
@@ -376,7 +356,7 @@ class Ajax
G::RenderPage( 'publish', 'extJs' ); G::RenderPage( 'publish', 'extJs' );
} }
function dynaformHistory () public function dynaformHistory ()
{ {
global $G_PUBLISH; global $G_PUBLISH;
G::loadClass( 'configuration' ); G::loadClass( 'configuration' );
@@ -389,7 +369,7 @@ class Ajax
G::RenderPage( 'publish', 'extJs' ); G::RenderPage( 'publish', 'extJs' );
} }
function uploadedDocuments () public function uploadedDocuments ()
{ {
global $G_PUBLISH; global $G_PUBLISH;
G::loadClass( 'configuration' ); G::loadClass( 'configuration' );
@@ -402,7 +382,7 @@ class Ajax
G::RenderPage( 'publish', 'extJs' ); G::RenderPage( 'publish', 'extJs' );
} }
function uploadedDocumentsSummary () public function uploadedDocumentsSummary ()
{ {
global $G_PUBLISH; global $G_PUBLISH;
G::loadClass( 'configuration' ); G::loadClass( 'configuration' );
@@ -415,7 +395,7 @@ class Ajax
G::RenderPage( 'publish', 'extJs' ); G::RenderPage( 'publish', 'extJs' );
} }
function generatedDocuments () public function generatedDocuments ()
{ {
global $G_PUBLISH; global $G_PUBLISH;
G::loadClass( 'configuration' ); G::loadClass( 'configuration' );
@@ -428,7 +408,7 @@ class Ajax
G::RenderPage( 'publish', 'extJs' ); G::RenderPage( 'publish', 'extJs' );
} }
function generatedDocumentsSummary () public function generatedDocumentsSummary ()
{ {
global $G_PUBLISH; global $G_PUBLISH;
G::loadClass( 'configuration' ); G::loadClass( 'configuration' );
@@ -441,7 +421,7 @@ class Ajax
G::RenderPage( 'publish', 'extJs' ); G::RenderPage( 'publish', 'extJs' );
} }
function cancelCase () public function cancelCase ()
{ {
$oCase = new Cases(); $oCase = new Cases();
$multiple = false; $multiple = false;
@@ -452,8 +432,9 @@ class Ajax
$appUids = explode( ',', $APP_UID ); $appUids = explode( ',', $APP_UID );
$delIndexes = explode( ',', $DEL_INDEX ); $delIndexes = explode( ',', $DEL_INDEX );
if (count( $appUids ) > 1 && count( $delIndexes ) > 1) if (count( $appUids ) > 1 && count( $delIndexes ) > 1) {
$multiple = true; $multiple = true;
}
} elseif (isset( $_POST['sApplicationUID'] ) && isset( $_POST['iIndex'] )) { } elseif (isset( $_POST['sApplicationUID'] ) && isset( $_POST['iIndex'] )) {
$APP_UID = $_POST['sApplicationUID']; $APP_UID = $_POST['sApplicationUID'];
$DEL_INDEX = $_POST['iIndex']; $DEL_INDEX = $_POST['iIndex'];
@@ -473,13 +454,15 @@ class Ajax
if ($multiple) { if ($multiple) {
foreach ($appUids as $i => $appUid) foreach ($appUids as $i => $appUid) {
$oCase->cancelCase( $appUid, $delIndexes[$i], $_SESSION['USER_LOGGED'] ); $oCase->cancelCase( $appUid, $delIndexes[$i], $_SESSION['USER_LOGGED'] );
} else }
} else {
$oCase->cancelCase( $APP_UID, $DEL_INDEX, $_SESSION['USER_LOGGED'] ); $oCase->cancelCase( $APP_UID, $DEL_INDEX, $_SESSION['USER_LOGGED'] );
} }
}
function getUsersToReassign () public function getUsersToReassign ()
{ {
$case = new Cases(); $case = new Cases();
$result->data = $case->getUsersToReassign( $_SESSION['TASK'], $_SESSION['USER_LOGGED'] ); $result->data = $case->getUsersToReassign( $_SESSION['TASK'], $_SESSION['USER_LOGGED'] );
@@ -488,7 +471,7 @@ class Ajax
} }
function reassignCase () public function reassignCase ()
{ {
$cases = new Cases(); $cases = new Cases();
$user = new Users(); $user = new Users();
@@ -512,7 +495,7 @@ class Ajax
print G::json_encode( $result ); print G::json_encode( $result );
} }
function pauseCase () public function pauseCase ()
{ {
try { try {
$unpauseDate = $_REQUEST['unpauseDate']; $unpauseDate = $_REQUEST['unpauseDate'];
@@ -553,7 +536,7 @@ class Ajax
echo G::json_encode( $result ); echo G::json_encode( $result );
} }
function unpauseCase () public function unpauseCase ()
{ {
try { try {
$applicationUID = (isset( $_POST['APP_UID'] )) ? $_POST['APP_UID'] : $_SESSION['APPLICATION']; $applicationUID = (isset( $_POST['APP_UID'] )) ? $_POST['APP_UID'] : $_SESSION['APPLICATION'];
@@ -575,7 +558,7 @@ class Ajax
print G::json_encode( $result ); print G::json_encode( $result );
} }
function deleteCase () public function deleteCase ()
{ {
try { try {
$applicationUID = (isset( $_POST['APP_UID'] )) ? $_POST['APP_UID'] : $_SESSION['APPLICATION']; $applicationUID = (isset( $_POST['APP_UID'] )) ? $_POST['APP_UID'] : $_SESSION['APPLICATION'];
@@ -595,7 +578,7 @@ class Ajax
print G::json_encode( $result ); print G::json_encode( $result );
} }
function reactivateCase () public function reactivateCase ()
{ {
try { try {
$applicationUID = (isset( $_POST['APP_UID'] )) ? $_POST['APP_UID'] : $_SESSION['APPLICATION']; $applicationUID = (isset( $_POST['APP_UID'] )) ? $_POST['APP_UID'] : $_SESSION['APPLICATION'];
@@ -617,7 +600,7 @@ class Ajax
print G::json_encode( $result ); print G::json_encode( $result );
} }
function changeLogTab () public function changeLogTab ()
{ {
try { try {
global $G_PUBLISH; global $G_PUBLISH;
@@ -656,13 +639,15 @@ body {
var return_xml=false; var return_xml=false;
var http_request = false; var http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,... if (window.XMLHttpRequest) {
// Mozilla, Safari,...
http_request = new XMLHttpRequest(); http_request = new XMLHttpRequest();
if (http_request.overrideMimeType){ if (http_request.overrideMimeType){
http_request.overrideMimeType('text/xml'); http_request.overrideMimeType('text/xml');
} }
} }
else if (window.ActiveXObject) {// IE elseif (window.ActiveXObject) {
// IE
try { try {
http_request = new ActiveXObject("Msxml2.XMLHTTP"); http_request = new ActiveXObject("Msxml2.XMLHTTP");
} }
@@ -753,8 +738,7 @@ body {
showDynaformHistoryGlobal.idHistory = idHistory; showDynaformHistoryGlobal.idHistory = idHistory;
showDynaformHistoryGlobal.dynDate = dynDate; showDynaformHistoryGlobal.dynDate = dynDate;
var url = "caseHistory_Ajax.php?actionAjax=showDynaformHistoryGetNomDynaform_JXP&idDin="+idDin+"&dynDate="+dynDate; var url = "caseHistory_Ajax.php?actionAjax=showDynaformHistoryGetNomDynaform_JXP&idDin="+idDin+"&dynDate="+dynDate;ajaxPostRequest(url, 'showDynaformHistoryGetNomDynaform_RSP');
ajaxPostRequest(url, 'showDynaformHistoryGetNomDynaform_RSP');
} }
</script> </script>
<?php <?php
@@ -769,10 +753,9 @@ body {
} }
} }
function dynaformViewFromHistory () public function dynaformViewFromHistory ()
{ {
?> ?>
<link rel="stylesheet" type="text/css" href="/css/classic.css" /> <link rel="stylesheet" type="text/css" href="/css/classic.css" />
<script type="text/javascript"> <script type="text/javascript">
@@ -813,8 +796,7 @@ body {
global $G_FORM; global $G_FORM;
?> ?>
function loadForm_<?php echo $G_FORM->id; ?>(parametro1) function loadForm_<?php echo $G_FORM->id; ?>(parametro1) {
{
} }
</script> </script>
@@ -838,8 +820,7 @@ body {
global $G_FORM; global $G_FORM;
?> ?>
function loadForm_<?php echo $G_FORM->id; ?>(parametro1) function loadForm_<?php echo $G_FORM->id; ?>(parametro1) {
{
} }
</script> </script>

View File

@@ -73,21 +73,13 @@ if ($actionAjax == 'historyGridListChangeLogPanelBody_JXP') {
<td height=99%> <td height=99%>
<div <div
style="width: 100%; overflow-y: scroll; overflow-x: hidden; max-height: 310px; _height: 310px; height: 310px; visibility: inherit;"> style="width: 100%; overflow-y: scroll; overflow-x: hidden; max-height: 310px; _height: 310px; height: 310px; visibility: inherit;">
<?php <?php
require_once 'classes/model/AppHistory.php'; require_once 'classes/model/AppHistory.php';
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'cases/cases_DynaformHistory' ); $G_PUBLISH->AddContent( 'view', 'cases/cases_DynaformHistory' );
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
?> ?>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@@ -20,8 +20,7 @@ $functionName( $functionParams );
function getExtJSParams () function getExtJSParams ()
{ {
$validParams = array ('callback' => '','dir' => 'DESC','sort' => '','start' => 0,'limit' => 25,'filter' => '','search' => '','action' => '','xaction' => '','data' => '','status' => '','query' => '','fields' => "" $validParams = array ('callback' => '','dir' => 'DESC','sort' => '','start' => 0,'limit' => 25,'filter' => '','search' => '','action' => '','xaction' => '','data' => '','status' => '','query' => '','fields' => "");
);
$result = array (); $result = array ();
foreach ($validParams as $paramName => $paramDefault) { foreach ($validParams as $paramName => $paramDefault) {
$result[$paramName] = isset( $_REQUEST[$paramName] ) ? $_REQUEST[$paramName] : isset( $_REQUEST[$paramName] ) ? $_REQUEST[$paramName] : $paramDefault; $result[$paramName] = isset( $_REQUEST[$paramName] ) ? $_REQUEST[$paramName] : isset( $_REQUEST[$paramName] ) ? $_REQUEST[$paramName] : $paramDefault;
@@ -52,6 +51,7 @@ function getNotesList ()
$usrUid = (isset( $_SESSION['USER_LOGGED'] )) ? $_SESSION['USER_LOGGED'] : ""; $usrUid = (isset( $_SESSION['USER_LOGGED'] )) ? $_SESSION['USER_LOGGED'] : "";
$appNotes = new AppNotes(); $appNotes = new AppNotes();
$response = $appNotes->getNotesList( $appUid, '', $start, $limit ); $response = $appNotes->getNotesList( $appUid, '', $start, $limit );
sendJsonResultGeneric( $response['array'], $callback ); sendJsonResultGeneric( $response['array'], $callback );
} }

View File

@@ -78,4 +78,5 @@ G::RenderPage( 'publish', 'blank' );
parent.outerLayout.hide('east'); parent.outerLayout.hide('east');
parent.PANEL_EAST_OPEN = false; parent.PANEL_EAST_OPEN = false;
</script> </script>
<?php