formating class case, lines 5000-5799 are cleaned
This commit is contained in:
@@ -4957,7 +4957,6 @@ public function verifyCaseTracker($case, $pin)
|
||||
* @param string $sDocUID
|
||||
* @return object
|
||||
*/
|
||||
|
||||
public function getAllGeneratedDocumentsCriteriaTracker($sProcessUID, $sApplicationUID, $sDocUID)
|
||||
{
|
||||
$oAppDocument = new AppDocument();
|
||||
@@ -4992,7 +4991,14 @@ public function verifyCaseTracker($case, $pin)
|
||||
$aTask = array('TAS_TITLE' => '(TASK DELETED)');
|
||||
}
|
||||
$aAux = $oAppDocument->load($aRow['APP_DOC_UID'], $aRow['DOC_VERSION']);
|
||||
$aFields = array('APP_DOC_UID' => $aAux['APP_DOC_UID'], 'DOC_UID' => $aAux['DOC_UID'], 'APP_DOC_COMMENT' => $aAux['APP_DOC_COMMENT'], 'APP_DOC_FILENAME' => $aAux['APP_DOC_FILENAME'], 'APP_DOC_INDEX' => $aAux['APP_DOC_INDEX'], 'ORIGIN' => $aTask['TAS_TITLE']);
|
||||
$aFields = array(
|
||||
'APP_DOC_UID' => $aAux['APP_DOC_UID'],
|
||||
'DOC_UID' => $aAux['DOC_UID'],
|
||||
'APP_DOC_COMMENT' => $aAux['APP_DOC_COMMENT'],
|
||||
'APP_DOC_FILENAME' => $aAux['APP_DOC_FILENAME'],
|
||||
'APP_DOC_INDEX' => $aAux['APP_DOC_INDEX'],
|
||||
'ORIGIN' => $aTask['TAS_TITLE']
|
||||
);
|
||||
if ($aFields['APP_DOC_FILENAME'] != '') {
|
||||
$aFields['TITLE'] = $aFields['APP_DOC_FILENAME'];
|
||||
} else {
|
||||
@@ -5003,6 +5009,7 @@ public function verifyCaseTracker($case, $pin)
|
||||
$aOutputDocuments[] = $aFields;
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
global $_DBArray;
|
||||
$_DBArray['outputDocuments'] = $aOutputDocuments;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
@@ -5021,7 +5028,6 @@ public function verifyCaseTracker($case, $pin)
|
||||
* @param string sApplicationUID
|
||||
* @return object
|
||||
*/
|
||||
|
||||
public function getHistoryMessagesTracker($sApplicationUID)
|
||||
{
|
||||
$oAppDocument = new AppDocument();
|
||||
@@ -5033,7 +5039,8 @@ public function verifyCaseTracker($case, $pin)
|
||||
$oDataset->next();
|
||||
|
||||
$aMessages = array();
|
||||
$aMessages[] = array('APP_MSG_UID' => 'char',
|
||||
$aMessages[] = array(
|
||||
'APP_MSG_UID' => 'char',
|
||||
'APP_UID' => 'char',
|
||||
'DEL_INDEX' => 'char',
|
||||
'APP_MSG_TYPE' => 'char',
|
||||
@@ -5049,7 +5056,8 @@ public function verifyCaseTracker($case, $pin)
|
||||
'APP_MSG_ATTACH' => 'char'
|
||||
);
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aMessages[] = array('APP_MSG_UID' => $aRow['APP_MSG_UID'],
|
||||
$aMessages[] = array(
|
||||
'APP_MSG_UID' => $aRow['APP_MSG_UID'],
|
||||
'APP_UID' => $aRow['APP_UID'],
|
||||
'DEL_INDEX' => $aRow['DEL_INDEX'],
|
||||
'APP_MSG_TYPE' => $aRow['APP_MSG_TYPE'],
|
||||
@@ -5084,7 +5092,6 @@ public function verifyCaseTracker($case, $pin)
|
||||
* @param string Msg_UID
|
||||
* @return array
|
||||
*/
|
||||
|
||||
public function getHistoryMessagesTrackerExt($sApplicationUID)
|
||||
{
|
||||
G::LoadClass('ArrayPeer');
|
||||
@@ -5097,7 +5104,6 @@ public function verifyCaseTracker($case, $pin)
|
||||
$oDataset = AppMessagePeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
|
||||
$aMessages = array();
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
@@ -5137,7 +5143,6 @@ public function verifyCaseTracker($case, $pin)
|
||||
* @param string Msg_UID
|
||||
* @return array
|
||||
*/
|
||||
|
||||
public function getHistoryMessagesTrackerView($sApplicationUID, $Msg_UID)
|
||||
{
|
||||
$oAppDocument = new AppDocument();
|
||||
@@ -5148,9 +5153,7 @@ public function verifyCaseTracker($case, $pin)
|
||||
$oDataset = AppMessagePeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
|
||||
$aRow = $oDataset->getRow();
|
||||
|
||||
return $aRow;
|
||||
}
|
||||
|
||||
@@ -5162,7 +5165,6 @@ public function verifyCaseTracker($case, $pin)
|
||||
* @param object OBJ_TYPE
|
||||
* @return array
|
||||
*/
|
||||
|
||||
public function getAllObjectsFromProcess($PRO_UID, $OBJ_TYPE = '%')
|
||||
{
|
||||
$RESULT = Array();
|
||||
@@ -5207,10 +5209,14 @@ public function verifyCaseTracker($case, $pin)
|
||||
* @param array $aNewData
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function executeTriggersAfterExternal($sProcess, $sTask, $sApplication, $iIndex, $iStepPosition, $aNewData = array())
|
||||
{
|
||||
|
||||
public function executeTriggersAfterExternal(
|
||||
$sProcess,
|
||||
$sTask,
|
||||
$sApplication,
|
||||
$iIndex,
|
||||
$iStepPosition,
|
||||
$aNewData = array()
|
||||
) {
|
||||
//load the variables
|
||||
$Fields = $this->loadCase($sApplication);
|
||||
$Fields['APP_DATA'] = array_merge($Fields['APP_DATA'], G::getSystemConstants());
|
||||
@@ -5218,7 +5224,9 @@ public function verifyCaseTracker($case, $pin)
|
||||
//execute triggers
|
||||
$oCase = new Cases();
|
||||
$aNextStep = $this->getNextStep($sProcess, $sApplication, $iIndex, $iStepPosition - 1);
|
||||
$Fields['APP_DATA'] = $this->ExecuteTriggers($sTask, 'EXTERNAL', $aNextStep['UID'], 'AFTER', $Fields['APP_DATA']);
|
||||
$Fields['APP_DATA'] = $this->ExecuteTriggers(
|
||||
$sTask, 'EXTERNAL', $aNextStep['UID'], 'AFTER', $Fields['APP_DATA']
|
||||
);
|
||||
//save data
|
||||
$aData = array();
|
||||
$aData['APP_NUMBER'] = $Fields['APP_NUMBER'];
|
||||
@@ -5227,7 +5235,6 @@ public function verifyCaseTracker($case, $pin)
|
||||
$aData['DEL_INDEX'] = $iIndex;
|
||||
$aData['TAS_UID'] = $sTask;
|
||||
$this->updateCase($sApplication, $aData);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5241,7 +5248,6 @@ public function verifyCaseTracker($case, $pin)
|
||||
* @param string $sURL
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function thisIsTheCurrentUser($sApplicationUID, $iIndex, $sUserUID, $sAction = '', $sURL = '')
|
||||
{
|
||||
$c = new Criteria('workflow');
|
||||
@@ -5265,11 +5271,14 @@ public function thisIsTheCurrentUser($sApplicationUID, $iIndex, $sUserUID, $sAct
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aData = $oDataset->getRow();
|
||||
G::SendMessageText(G::LoadTranslation('ID_CASE_IS_CURRENTLY_WITH_ANOTHER_USER') . ': ' . $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')', 'error');
|
||||
G::SendMessageText(
|
||||
G::LoadTranslation('ID_CASE_IS_CURRENTLY_WITH_ANOTHER_USER') . ': ' .
|
||||
$aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] .
|
||||
' (' . $aData['USR_USERNAME'] . ')', 'error'
|
||||
);
|
||||
G::header('Location: ' . $sURL);
|
||||
die;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$c->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
|
||||
if (!(boolean) AppDelegationPeer::doCount($c)) {
|
||||
G::SendMessageText(G::LoadTranslation('ID_CASE_ALREADY_DERIVATED'), 'error');
|
||||
@@ -5291,7 +5300,11 @@ public function thisIsTheCurrentUser($sApplicationUID, $iIndex, $sUserUID, $sAct
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aData = $oDataset->getRow();
|
||||
die('<strong>' . G::LoadTranslation('ID_CASE_ALREADY_DERIVATED') . ': ' . $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')</strong>');
|
||||
die('<strong>' .
|
||||
G::LoadTranslation('ID_CASE_ALREADY_DERIVATED') . ': ' .
|
||||
$aData['USR_FIRSTNAME'] . ' ' .
|
||||
$aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')</strong>'
|
||||
);
|
||||
} else {
|
||||
$c->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
|
||||
if (!(boolean) AppDelegationPeer::doCount($c)) {
|
||||
@@ -5338,8 +5351,19 @@ public function getCriteriaUsersCases($status, $USR_UID)
|
||||
* @return object
|
||||
*/
|
||||
|
||||
public function getAdvancedSearch($sCase, $sProcess, $sTask, $sCurrentUser, $sSentby, $sLastModFrom, $sLastModTo, $sStatus, $permisse, $userlogged, $aSupervisor)
|
||||
{
|
||||
public function getAdvancedSearch (
|
||||
$sCase,
|
||||
$sProcess,
|
||||
$sTask,
|
||||
$sCurrentUser,
|
||||
$sSentby,
|
||||
$sLastModFrom,
|
||||
$sLastModTo,
|
||||
$sStatus,
|
||||
$permisse,
|
||||
$userlogged,
|
||||
$aSupervisor
|
||||
) {
|
||||
$sTypeList = '';
|
||||
$sUIDUserLogged = '';
|
||||
|
||||
@@ -5350,7 +5374,10 @@ public function getAdvancedSearch($sCase, $sProcess, $sTask, $sCurrentUser, $sSe
|
||||
$c->addSelectColumn(ApplicationPeer::APP_UPDATE_DATE);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_PRIORITY);
|
||||
//$c->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE);
|
||||
$c->addAsColumn('DEL_TASK_DUE_DATE', " IF (" . AppDelegationPeer::DEL_TASK_DUE_DATE . " <= NOW(), CONCAT('<span style=\'color:red\';>', " . AppDelegationPeer::DEL_TASK_DUE_DATE . ", '</span>'), " . AppDelegationPeer::DEL_TASK_DUE_DATE . ") ");
|
||||
$c->addAsColumn(
|
||||
'DEL_TASK_DUE_DATE',
|
||||
" IF (" . AppDelegationPeer::DEL_TASK_DUE_DATE . " <= NOW(), CONCAT('<span style=\'color:red\';>', " .
|
||||
AppDelegationPeer::DEL_TASK_DUE_DATE . ", '</span>'), " . AppDelegationPeer::DEL_TASK_DUE_DATE . ") ");
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$c->addSelectColumn(AppDelegationPeer::TAS_UID);
|
||||
$c->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE);
|
||||
@@ -5362,7 +5389,10 @@ public function getAdvancedSearch($sCase, $sProcess, $sTask, $sCurrentUser, $sSe
|
||||
$c->addAsColumn('APP_PRO_TITLE', 'PRO_TITLE.CON_VALUE');
|
||||
$c->addAsColumn('APP_TAS_TITLE', 'TAS_TITLE.CON_VALUE');
|
||||
//$c->addAsColumn('APP_DEL_PREVIOUS_USER', 'APP_LAST_USER.USR_USERNAME');
|
||||
$c->addAsColumn('APP_DEL_PREVIOUS_USER', "CONCAT(APP_LAST_USER.USR_LASTNAME, ' ', APP_LAST_USER.USR_FIRSTNAME)");
|
||||
$c->addAsColumn(
|
||||
'APP_DEL_PREVIOUS_USER',
|
||||
"CONCAT(APP_LAST_USER.USR_LASTNAME, ' ', APP_LAST_USER.USR_FIRSTNAME)"
|
||||
);
|
||||
|
||||
$c->addAlias("APP_TITLE", 'CONTENT');
|
||||
$c->addAlias("PRO_TITLE", 'CONTENT');
|
||||
@@ -5407,34 +5437,46 @@ public function getAdvancedSearch($sCase, $sProcess, $sTask, $sCurrentUser, $sSe
|
||||
|
||||
$c->add(TaskPeer::TAS_TYPE, 'SUBPROCESS', Criteria::NOT_EQUAL);
|
||||
|
||||
$c->add($c->getNewCriterion(AppThreadPeer::APP_THREAD_STATUS, 'OPEN')->addOr($c->getNewCriterion(ApplicationPeer::APP_STATUS, 'COMPLETED')->addAnd($c->getNewCriterion(AppDelegationPeer::DEL_PREVIOUS,
|
||||
0))));
|
||||
$c->add(
|
||||
$c->getNewCriterion(AppThreadPeer::APP_THREAD_STATUS, 'OPEN')->
|
||||
addOr($c->getNewCriterion(ApplicationPeer::APP_STATUS, 'COMPLETED')->
|
||||
addAnd($c->getNewCriterion(AppDelegationPeer::DEL_PREVIOUS,0)))
|
||||
);
|
||||
|
||||
if ($sCase != '')
|
||||
if ($sCase != '') {
|
||||
$c->add(ApplicationPeer::APP_NUMBER, $sCase);
|
||||
|
||||
if ($sProcess != '')
|
||||
}
|
||||
if ($sProcess != '') {
|
||||
$c->add(ApplicationPeer::PRO_UID, $sProcess);
|
||||
|
||||
if ($sTask != '' && $sTask != "0" && $sTask != 0)
|
||||
}
|
||||
if ($sTask != '' && $sTask != "0" && $sTask != 0) {
|
||||
$c->add(AppDelegationPeer::TAS_UID, $sTask);
|
||||
|
||||
if ($sCurrentUser != '')
|
||||
}
|
||||
if ($sCurrentUser != '') {
|
||||
$c->add(ApplicationPeer::APP_CUR_USER, $sCurrentUser);
|
||||
|
||||
if ($sSentby != '')
|
||||
}
|
||||
if ($sSentby != '') {
|
||||
$c->add('APP_PREV_DEL.USR_UID', $sSentby);
|
||||
|
||||
if ($sLastModFrom != '0000-00-00' && $sLastModTo != '0000-00-00' && $sLastModFrom != '' && $sLastModTo != '')
|
||||
$c->add($c->getNewCriterion(ApplicationPeer::APP_UPDATE_DATE, $sLastModFrom . ' 00:00:00', Criteria::GREATER_EQUAL)->addAnd($c->getNewCriterion(ApplicationPeer::APP_UPDATE_DATE, $sLastModTo . ' 23:59:59', Criteria::LESS_EQUAL)));
|
||||
|
||||
}
|
||||
if ($sLastModFrom != '0000-00-00' && $sLastModTo != '0000-00-00' && $sLastModFrom != '' && $sLastModTo != '') {
|
||||
$c->add(
|
||||
$c->getNewCriterion(ApplicationPeer::APP_UPDATE_DATE, $sLastModFrom . ' 00:00:00',
|
||||
Criteria::GREATER_EQUAL)->
|
||||
addAnd($c->getNewCriterion(ApplicationPeer::APP_UPDATE_DATE, $sLastModTo . ' 23:59:59',
|
||||
Criteria::LESS_EQUAL))
|
||||
);
|
||||
}
|
||||
if ($sStatus != '') {
|
||||
if ($sStatus != 'gral')
|
||||
if ($sStatus != 'gral') {
|
||||
$c->add(ApplicationPeer::APP_STATUS, $sStatus);
|
||||
}
|
||||
}
|
||||
|
||||
if ($permisse != 0) {
|
||||
$c->add($c->getNewCriterion(AppDelegationPeer::USR_UID, $userlogged)->addOr($c->getNewCriterion(AppDelegationPeer::PRO_UID, $aSupervisor, Criteria::IN)));
|
||||
$c->add(
|
||||
$c->getNewCriterion(AppDelegationPeer::USR_UID, $userlogged)->
|
||||
addOr($c->getNewCriterion(AppDelegationPeer::PRO_UID, $aSupervisor, Criteria::IN))
|
||||
);
|
||||
}
|
||||
|
||||
$c->addDescendingOrderByColumn(ApplicationPeer::APP_NUMBER);
|
||||
@@ -5450,12 +5492,11 @@ public function getAdvancedSearch($sCase, $sProcess, $sTask, $sCurrentUser, $sSe
|
||||
* @param string $type
|
||||
* @return int
|
||||
*/
|
||||
public function getConditionCasesCount($type, $sumary=NULL)
|
||||
public function getConditionCasesCount($type, $sumary = null)
|
||||
{
|
||||
$result = 0;
|
||||
return $result;
|
||||
|
||||
|
||||
$nCount = 0;
|
||||
|
||||
list($aCriteria, $xmlfile) = $this->getConditionCasesList($type, $_SESSION['USER_LOGGED'], false);
|
||||
@@ -5476,9 +5517,9 @@ public function getConditionCasesCount($type, $sumary=NULL)
|
||||
}
|
||||
return Array('count' => $nCount, 'sumary' => $sumary);
|
||||
} else {
|
||||
while ($rs->next())
|
||||
while ($rs->next()) {
|
||||
$nCount++;
|
||||
|
||||
}
|
||||
return $nCount;
|
||||
}
|
||||
}
|
||||
@@ -5491,7 +5532,7 @@ public function getConditionCasesCount($type, $sumary=NULL)
|
||||
* @param string $type
|
||||
* @return array
|
||||
*/
|
||||
public function getAllConditionCasesCount($types, $sumary=NULL)
|
||||
public function getAllConditionCasesCount($types, $sumary = null)
|
||||
{
|
||||
$aResult = Array();
|
||||
foreach ($types as $type) {
|
||||
|
||||
Reference in New Issue
Block a user