Merge pull request #160 from brayanpereyra/BUG-8445
BUG 8445 PHPCS SOLVED
This commit is contained in:
@@ -22,14 +22,21 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
G::LoadClass('case');
|
||||
$oCase = new Cases();
|
||||
|
||||
//if($RBAC->userCanAccess('PM_ALLCASES') < 0) {
|
||||
// $oCase->thisIsTheCurrentUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'SHOW_MESSAGE');
|
||||
// $oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'],
|
||||
// $_SESSION['INDEX'],
|
||||
// $_SESSION['USER_LOGGED'],
|
||||
// 'SHOW_MESSAGE');
|
||||
//}
|
||||
|
||||
if(($RBAC_Response = $RBAC->userCanAccess("PM_CASES")) != 1)
|
||||
if (($RBAC_Response = $RBAC->userCanAccess("PM_CASES")) != 1) {
|
||||
return $RBAC_Response;
|
||||
}
|
||||
|
||||
if (isset($_POST['showWindow'])) {
|
||||
if ($_POST['showWindow'] == 'steps') {
|
||||
$fn = 'showSteps();';
|
||||
@@ -46,6 +53,7 @@ if(isset($_POST['showWindow'])) {
|
||||
}
|
||||
$_SESSION['showCasesWindow'] = $fn;
|
||||
}
|
||||
|
||||
if (!isset($_POST['action'])) {
|
||||
$_POST['action'] = '';
|
||||
}
|
||||
@@ -91,6 +99,7 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
method: "POST",
|
||||
args : "action=load&data="+params
|
||||
});
|
||||
|
||||
// make the ajax call
|
||||
oRPC.make();
|
||||
var response = eval(\'(\' + oRPC.xmlhttp.responseText + \')\');
|
||||
@@ -180,10 +189,25 @@ 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);
|
||||
@@ -214,11 +238,31 @@ 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);
|
||||
@@ -226,11 +270,14 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
break;
|
||||
case 'showUsers':
|
||||
switch ($_POST['TAS_ASSIGN_TYPE']) {
|
||||
// switch verify $_POST['TAS_ASSIGN_TYPE']
|
||||
case 'BALANCED':
|
||||
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]">';
|
||||
@@ -295,9 +342,12 @@ 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;
|
||||
@@ -306,7 +356,6 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'cancelCase':
|
||||
$oCase = new Cases();
|
||||
$multiple = false;
|
||||
@@ -317,8 +366,9 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
|
||||
$appUids = explode(',', $APP_UID);
|
||||
$delIndexes = explode(',', $DEL_INDEX);
|
||||
if( count($appUids) > 1 && count($delIndexes) > 1 )
|
||||
if (count($appUids) > 1 && count($delIndexes) > 1) {
|
||||
$multiple = true;
|
||||
}
|
||||
} elseif (isset($_POST['sApplicationUID']) && isset($_POST['iIndex'])) {
|
||||
$APP_UID = $_POST['sApplicationUID'];
|
||||
$DEL_INDEX = $_POST['iIndex'];
|
||||
@@ -328,12 +378,13 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
}
|
||||
|
||||
if ($multiple) {
|
||||
foreach($appUids as $i=>$appUid)
|
||||
foreach ($appUids as $i => $appUid) {
|
||||
$oCase->cancelCase($appUid, $delIndexes[$i], $_SESSION['USER_LOGGED']);
|
||||
} else
|
||||
}
|
||||
} else {
|
||||
$oCase->cancelCase($APP_UID, $DEL_INDEX, $_SESSION['USER_LOGGED']);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'reactivateCase':
|
||||
$sApplicationUID = isset($_POST['sApplicationUID']) ? $_POST['sApplicationUID'] : $_SESSION['APPLICATION'];
|
||||
$iIndex = (isset($_POST['sApplicationUID'])) ? $_POST['iIndex'] : $_SESSION['INDEX'];
|
||||
@@ -344,13 +395,11 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
//echo '<input type=button onclick="close_pauseCase()" value="Cancel">';
|
||||
$aFields = Array();
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
$aFields['TIME_STAMP'] = G::getformatedDate(date('Y-m-d'), 'M d, yyyy', SYS_LANG);
|
||||
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_UnpauseDateInput', '', $aFields);
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
case 'pauseCase':
|
||||
$unpauseDate = $_POST['unpausedate'];
|
||||
$oCase = new Cases();
|
||||
@@ -367,7 +416,6 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
|
||||
$oCase->pauseCase($APP_UID, $DEL_INDEX, $_SESSION['USER_LOGGED'], $unpauseDate);
|
||||
break;
|
||||
|
||||
case 'unpauseCase':
|
||||
$sApplicationUID = (isset($_POST['sApplicationUID'])) ? $_POST['sApplicationUID'] : $_SESSION['APPLICATION'];
|
||||
$iIndex = (isset($_POST['sApplicationUID'])) ? $_POST['iIndex'] : $_SESSION['INDEX'];
|
||||
@@ -418,14 +466,16 @@ 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');
|
||||
@@ -434,7 +484,11 @@ 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':
|
||||
@@ -474,6 +528,7 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
$Fields['CREATOR'] = '***';
|
||||
}
|
||||
switch ($Fields['INP_DOC_FORM_NEEDED']) {
|
||||
// switch verify $Fields['INP_DOC_FORM_NEEDED']
|
||||
case 'REAL':
|
||||
$sXmlForm = 'cases/cases_ViewAnyInputDocument2';
|
||||
break;
|
||||
@@ -490,19 +545,22 @@ 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;
|
||||
|
||||
case 'uploadDocumentGrid_Ajax':
|
||||
G::LoadClass('case');
|
||||
G::LoadClass("BasePeer" );
|
||||
@@ -510,14 +568,15 @@ 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);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$rs = GulliverBasePeer::doSelectRs ($c);
|
||||
}
|
||||
|
||||
@@ -540,7 +599,6 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
|
||||
echo G::json_encode($r);
|
||||
break;
|
||||
|
||||
case 'generateDocumentGrid_Ajax':
|
||||
|
||||
G::LoadClass('case');
|
||||
@@ -550,14 +608,15 @@ 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);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$rs = GulliverBasePeer::doSelectRs ($c);
|
||||
}
|
||||
|
||||
@@ -580,15 +639,14 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
$conf = new Configurations();
|
||||
|
||||
try {
|
||||
$generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '' );
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$globaleneralConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '' );
|
||||
} catch (Exception $e) {
|
||||
$generalConfCasesList = array();
|
||||
}
|
||||
|
||||
$dateFormat = "";
|
||||
|
||||
if (isset($generalConfCasesList['casesListDateFormat'])&&!empty($generalConfCasesList['casesListDateFormat'])) {
|
||||
$varFlag = isset($generalConfCasesList['casesListDateFormat']);
|
||||
if ($varFlag &&!empty($generalConfCasesList['casesListDateFormat'])) {
|
||||
$dateFormat = $generalConfCasesList['casesListDateFormat'];
|
||||
}
|
||||
|
||||
@@ -599,9 +657,7 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
$r->dataFormat = $dateFormat;
|
||||
|
||||
echo G::json_encode($r);
|
||||
|
||||
break;
|
||||
|
||||
case 'showGeneratedDocument':
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
@@ -628,18 +684,21 @@ 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':
|
||||
$G_PUBLISH = new Publisher();
|
||||
$oCase = new Cases();
|
||||
@@ -648,12 +707,16 @@ 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;';
|
||||
if(isset($_POST['DYN_UID']))
|
||||
if (isset($_POST['DYN_UID'])) {
|
||||
$_SESSION['DYN_UID_PRINT'] = $_POST['DYN_UID'];
|
||||
else
|
||||
} else {
|
||||
$_SESSION['DYN_UID_PRINT'] = $_REQUEST['DYN_UID'];
|
||||
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');
|
||||
}
|
||||
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::RenderPage('publish', 'blank');
|
||||
break;
|
||||
case 'showDynaformHistory':
|
||||
@@ -664,10 +727,10 @@ 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':
|
||||
G::LoadClass('groups');
|
||||
G::LoadClass('tasks');
|
||||
@@ -698,42 +761,46 @@ 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':
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
$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':
|
||||
require_once 'classes/model/Configuration.php';
|
||||
@@ -752,7 +819,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', '', '', '', '');
|
||||
@@ -778,7 +846,6 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
list($hash, $pass) = explode(":", $passwdDec);
|
||||
$oSpool['MESS_PASSWORD'] = $pass;
|
||||
}
|
||||
|
||||
$oSpool->create(array(
|
||||
'msg_uid' => $data['MSG_UID'],
|
||||
'app_uid' => $data['APP_UID'],
|
||||
@@ -795,17 +862,13 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
'app_msg_status'=> 'pending'
|
||||
));
|
||||
$oSpool->sendMail();
|
||||
|
||||
break;
|
||||
|
||||
/* @Author Erik Amaru Ortiz <erik@colosa.com> */
|
||||
case 'showdebug':
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('view', 'cases/showDebugFrame');
|
||||
G::RenderPage('publish', 'raw');
|
||||
break;
|
||||
|
||||
/* @Author Erik Amaru Ortiz <erik@colosa.com> */
|
||||
case 'reassignByUserList':
|
||||
$APP_UIDS = explode(',', $_POST['APP_UIDS']);
|
||||
@@ -833,7 +896,9 @@ 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']; // . ' (' . $aCaseUserRecord['USR_USERNAME'] . ')';
|
||||
$aUsersInvolved[$aCaseUser['USR_UID']] = $aCaseUserRecord['USR_FIRSTNAME'] . ' ' .
|
||||
$aCaseUserRecord['USR_LASTNAME'];
|
||||
// . ' (' . $aCaseUserRecord['USR_USERNAME'] . ')';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -842,7 +907,9 @@ 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']; // . ' (' . $aCaseUserRecord['USR_USERNAME'] . ')';
|
||||
$aUsersInvolved[$aCaseUser['USR_UID']] = $aCaseUserRecord['USR_FIRSTNAME'] . ' ' .
|
||||
$aCaseUserRecord['USR_LASTNAME'];
|
||||
// . ' (' . $aCaseUserRecord['USR_USERNAME'] . ')';
|
||||
}
|
||||
}
|
||||
$oTmp = new stdClass();
|
||||
@@ -880,11 +947,10 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
$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->AddContent( 'propeltable', 'cases/paged-table-reassigByUser2',
|
||||
'cases/cases_ToReassignByUserList2', $oCriteria);
|
||||
G::RenderPage('publish', 'raw');
|
||||
|
||||
break;
|
||||
|
||||
/* @Author Erik Amaru Ortiz <erik@colosa.com> */
|
||||
case 'reassignByUser':
|
||||
G::LoadClass('case');
|
||||
@@ -911,7 +977,10 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
foreach ($aCases as $aCase) {
|
||||
$aCaseUpdated = $oCases->loadCaseInCurrentDelegation($aCase['APP_UID']);
|
||||
$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;
|
||||
@@ -928,9 +997,9 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
$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);
|
||||
@@ -939,25 +1008,35 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
$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;
|
||||
$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('xmlform', 'xmlform', 'cases/cases_AttachInputDocumentGeneral', '', $Fields, 'cases_SaveDocument?UID=' . $_POST['docID']);
|
||||
$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();
|
||||
@@ -973,7 +1052,6 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$response = array( "success" => true );
|
||||
|
||||
|
||||
$oCriteria->add(ApplicationPeer::APP_NUMBER, $_POST['appNumber']);
|
||||
$oDataset = ApplicationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
@@ -988,13 +1066,14 @@ switch(($_POST['action'])?$_POST['action']:$_REQUEST['action']) {
|
||||
|
||||
echo G::json_encode($response);
|
||||
break;
|
||||
|
||||
|
||||
|
||||
default:
|
||||
echo 'default';
|
||||
}
|
||||
function getCasesTypeIDs(){
|
||||
$aTypes = Array('to_do', 'draft', 'cancelled', 'sent', 'paused', 'completed','selfservice','to_revise','to_reassign');
|
||||
|
||||
function getCasesTypeIds()
|
||||
{
|
||||
$aTypes = Array('to_do', 'draft', 'cancelled', 'sent', 'paused', 'completed','selfservice',
|
||||
'to_revise','to_reassign');
|
||||
return $aTypesID;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user