Merged in release/3.2 (pull request #5477)
Release/3.2 Approved-by: Paula Quispe
This commit is contained in:
@@ -2396,7 +2396,7 @@ class Cases
|
||||
if ($rsCriteria->next()) {
|
||||
$record = $rsCriteria->getRow();
|
||||
|
||||
$arrayData = ['APP_STATUS' => $record['APP_STATUS'], 'DEL_INDEX' => []];
|
||||
$arrayData = ['APP_STATUS' => $record['APP_STATUS'], 'DEL_INDEX' => [], 'PRO_UID' => $record['PRO_UID']];
|
||||
$arrayData['DEL_INDEX'][] = $record['DEL_INDEX'];
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
@@ -2437,6 +2437,7 @@ class Cases
|
||||
$criteria->setDistinct();
|
||||
$criteria->addSelectColumn($delimiter . 'PAUSED' . $delimiter . ' AS APP_STATUS');
|
||||
$criteria->addSelectColumn(\AppDelayPeer::APP_DEL_INDEX . " AS DEL_INDEX");
|
||||
$criteria->addSelectColumn(\AppDelayPeer::PRO_UID);
|
||||
|
||||
$criteria->add(\AppDelayPeer::APP_UID, $applicationUid, \Criteria::EQUAL);
|
||||
$criteria->add(\AppDelayPeer::APP_TYPE, "PAUSE", \Criteria::EQUAL);
|
||||
@@ -2478,6 +2479,7 @@ class Cases
|
||||
$criteria->clearSelectColumns();
|
||||
$criteria->addSelectColumn($delimiter . 'UNASSIGNED' . $delimiter . ' AS APP_STATUS');
|
||||
$criteria->addSelectColumn(\AppCacheViewPeer::DEL_INDEX);
|
||||
$criteria->addSelectColumn(\AppCacheViewPeer::PRO_UID);
|
||||
|
||||
$criteria->add(\AppCacheViewPeer::APP_UID, $applicationUid, \Criteria::EQUAL);
|
||||
|
||||
@@ -2499,6 +2501,7 @@ class Cases
|
||||
|
||||
$criteria->setDistinct();
|
||||
$criteria->addSelectColumn(\ApplicationPeer::APP_STATUS);
|
||||
$criteria->addSelectColumn(\ApplicationPeer::PRO_UID);
|
||||
$criteria->addSelectColumn(\AppDelegationPeer::DEL_INDEX);
|
||||
|
||||
$arrayCondition = array();
|
||||
@@ -2539,6 +2542,7 @@ class Cases
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(\ApplicationPeer::APP_STATUS);
|
||||
$criteria->addSelectColumn(\ApplicationPeer::PRO_UID);
|
||||
$criteria->addSelectColumn(\AppDelegationPeer::DEL_INDEX);
|
||||
|
||||
$arrayCondition = array();
|
||||
@@ -2578,6 +2582,7 @@ class Cases
|
||||
$criteria2->addSelectColumn($delimiter . 'PARTICIPATED' . $delimiter . ' AS APP_STATUS');
|
||||
$criteria2->addSelectColumn(\AppDelegationPeer::DEL_INDEX);
|
||||
$criteria2->addSelectColumn(\ApplicationPeer::APP_UID);
|
||||
$criteria2->addSelectColumn(\ApplicationPeer::PRO_UID);
|
||||
|
||||
$rsCriteria2 = \ApplicationPeer::doSelectRS($criteria2);
|
||||
$rsCriteria2->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
@@ -3307,4 +3312,31 @@ class Cases
|
||||
|
||||
return $arrayAccess;
|
||||
}
|
||||
/**
|
||||
* Get index last participation from a user
|
||||
*
|
||||
* This function return the last participation
|
||||
* by default is not considered the status OPEN or CLOSED
|
||||
* in parallel cases return the first to find
|
||||
* @param string $appUid
|
||||
* @param string $userUid
|
||||
* @param string $threadStatus
|
||||
* @return integer delIndex
|
||||
*/
|
||||
public function getLastParticipatedByUser($appUid, $userUid, $threadStatus = '')
|
||||
{
|
||||
$criteria = new \Criteria('workflow');
|
||||
$criteria->addSelectColumn(\AppDelegationPeer::DEL_INDEX);
|
||||
$criteria->addSelectColumn(\AppDelegationPeer::DEL_THREAD_STATUS);
|
||||
$criteria->add(\AppDelegationPeer::APP_UID, $appUid, \Criteria::EQUAL);
|
||||
$criteria->add(\AppDelegationPeer::USR_UID, $userUid, \Criteria::EQUAL);
|
||||
if (!empty($threadStatus)) {
|
||||
$criteria->add(\AppDelegationPeer::DEL_THREAD_STATUS, $threadStatus, \Criteria::EQUAL);
|
||||
}
|
||||
$dataSet = \AppDelegationPeer::doSelectRS($criteria);
|
||||
$dataSet->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$dataSet->next();
|
||||
$row = $dataSet->getRow();
|
||||
return isset($row['DEL_INDEX']) ? $row['DEL_INDEX'] : 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -924,7 +924,7 @@ class OutputDocument
|
||||
}
|
||||
copy($sPath . $sFilename . '.html', PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.html');
|
||||
try {
|
||||
$status = $pipeline->process(((isset($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . '/files/' . $sApplication . '/outdocs/' . $sFilename . '.html', $g_media);
|
||||
$status = $pipeline->process((\G::is_https() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . '/files/' . $sApplication . '/outdocs/' . $sFilename . '.html', $g_media);
|
||||
copy(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.pdf', $sPath . $sFilename . '.pdf');
|
||||
unlink(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.pdf');
|
||||
unlink(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.html');
|
||||
|
||||
@@ -818,7 +818,17 @@ class Light
|
||||
case 'participated':
|
||||
$oCase = new \Cases();
|
||||
$iDelIndex = $oCase->getCurrentDelegationCase( $app_uid );
|
||||
$aFields = $oCase->loadCase( $app_uid, $iDelIndex );
|
||||
$aFields = $oCase->loadCase($app_uid, $iDelIndex);
|
||||
$response = $this->getInfoResume($userUid, $aFields, $type);
|
||||
break;
|
||||
case 'lastopenindex':
|
||||
//Get the last participate from a user
|
||||
$oNewCase = new \ProcessMaker\BusinessModel\Cases();
|
||||
$iDelIndex = $oNewCase->getLastParticipatedByUser($app_uid, $userUid, 'OPEN');
|
||||
$oCase = new \Cases();
|
||||
$aFields = $oCase->loadCase($app_uid, $iDelIndex);
|
||||
$aFields['DEL_INDEX'] = $iDelIndex === 0 ? '' : $iDelIndex;
|
||||
$aFields['USR_UID'] = $userUid;
|
||||
$response = $this->getInfoResume($userUid, $aFields, $type);
|
||||
break;
|
||||
}
|
||||
@@ -835,23 +845,8 @@ class Light
|
||||
*/
|
||||
public function getInfoResume($userUid, $Fields, $type)
|
||||
{
|
||||
//print_r($Fields);die;
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
/* Prepare page before to show */
|
||||
//$oCase = new \Cases();
|
||||
|
||||
// $participated = $oCase->userParticipatedInCase( $Fields['APP_UID'], $userUid );
|
||||
// if ($RBAC->userCanAccess( 'PM_ALLCASES' ) < 0 && $participated == 0) {
|
||||
// /*if (strtoupper($Fields['APP_STATUS']) != 'COMPLETED') {
|
||||
// $oCase->thisIsTheCurrentUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'SHOW_MESSAGE');
|
||||
// }*/
|
||||
// $aMessage['MESSAGE'] = G::LoadTranslation( 'ID_NO_PERMISSION_NO_PARTICIPATED' );
|
||||
// $G_PUBLISH = new Publisher();
|
||||
// $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
// G::RenderPage( 'publishBlank', 'blank' );
|
||||
// die();
|
||||
// }
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
$objProc = new \Process();
|
||||
$aProc = $objProc->load( $Fields['PRO_UID'] );
|
||||
@@ -869,15 +864,11 @@ class Light
|
||||
}
|
||||
|
||||
$Fields['TAS_TITLE'] = implode(" - ", array_values($Fields['TAS_TITLE']));
|
||||
} else {
|
||||
$aTask = $objTask->load( $Fields['TAS_UID'] );
|
||||
} elseif (isset($Fields['TAS_UID']) && !empty($Fields['TAS_UID'])) {
|
||||
$aTask = $objTask->load($Fields['TAS_UID']);
|
||||
$Fields['TAS_TITLE'] = $aTask['TAS_TITLE'];
|
||||
}
|
||||
|
||||
// require_once(PATH_GULLIVER .'../thirdparty/smarty/libs/Smarty.class.php');
|
||||
// $G_PUBLISH = new \Publisher();
|
||||
// $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_Resume.xml', '', $Fields, '' );
|
||||
// $G_PUBLISH->RenderContent();
|
||||
return $Fields;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user