HOR-1061 "Direct Case Link" SOLVED
Issue:
Direct Case Link
Cause:
Nuevo requerimiento
Solution:
Se implemento el "Direct Case Link"
This commit is contained in:
@@ -572,9 +572,11 @@ class Bootstrap
|
||||
* @author Fernando Ontiveros Lira <fernando@colosa.com>
|
||||
* @access public
|
||||
* @param string $urlLink
|
||||
* @param array $arrayFriendlyUri
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static public function parseURI($uri)
|
||||
static public function parseURI($uri, array $arrayFriendlyUri = null)
|
||||
{
|
||||
// *** process the $_POST with magic_quotes enabled
|
||||
// The magic_quotes_gpc feature has been DEPRECATED as of PHP 5.3.0.
|
||||
@@ -583,7 +585,7 @@ class Bootstrap
|
||||
}
|
||||
|
||||
$aRequestUri = explode('/', $uri);
|
||||
$args = self::parseNormalUri($aRequestUri);
|
||||
$args = self::parseNormalUri($aRequestUri, $arrayFriendlyUri);
|
||||
|
||||
if (! empty($args)) {
|
||||
define("SYS_LANG", $args ['SYS_LANG']);
|
||||
@@ -1148,7 +1150,7 @@ class Bootstrap
|
||||
//Read Configuration File
|
||||
$xmlConfiguration = file_get_contents($configurationFile);
|
||||
$xmlConfigurationObj = Bootstrap::xmlParser($xmlConfiguration);
|
||||
|
||||
|
||||
if (!isset($xmlConfigurationObj->result['skinConfiguration']['__CONTENT__']['cssFiles']['__CONTENT__'][$skinVariant]['__CONTENT__'])) {
|
||||
$xmlConfigurationObj->result['skinConfiguration']['__CONTENT__']['cssFiles']['__CONTENT__'][$skinVariant]['__CONTENT__'] = array('cssFile' => array());
|
||||
}
|
||||
@@ -2081,9 +2083,11 @@ class Bootstrap
|
||||
/**
|
||||
*
|
||||
* @param unknown_type $aRequestUri
|
||||
* @param array $arrayFriendlyUri
|
||||
*
|
||||
* @return multitype:string mixed Ambigous <number, string>
|
||||
*/
|
||||
public function parseNormalUri($aRequestUri)
|
||||
public function parseNormalUri($aRequestUri, array $arrayFriendlyUri = null)
|
||||
{
|
||||
if (substr($aRequestUri[1], 0, 3) == 'sys') {
|
||||
define('SYS_TEMP', substr($aRequestUri[1], 3));
|
||||
@@ -2146,8 +2150,21 @@ class Bootstrap
|
||||
$args["SYS_TARGET"] = array_shift($uriVars);
|
||||
|
||||
//to enable more than 2 directories...in the methods structure
|
||||
while (!empty($uriVars)) {
|
||||
$args["SYS_TARGET"] = $args["SYS_TARGET"] . "/" . array_shift($uriVars);
|
||||
$key = $args['SYS_COLLECTION'] . '/' . $args['SYS_TARGET'];
|
||||
$flagSysTarget = true;
|
||||
|
||||
if (!is_null($arrayFriendlyUri) && !empty($arrayFriendlyUri) && isset($arrayFriendlyUri[$key])) {
|
||||
if (!preg_match($arrayFriendlyUri[$key], array_shift($uriVars))) {
|
||||
$args['SYS_TARGET'] = false;
|
||||
}
|
||||
|
||||
$flagSysTarget = false;
|
||||
}
|
||||
|
||||
if ($flagSysTarget) {
|
||||
while (!empty($uriVars)) {
|
||||
$args['SYS_TARGET'] = $args['SYS_TARGET'] . '/' . array_shift($uriVars);
|
||||
}
|
||||
}
|
||||
|
||||
/* Fix to prevent use uxs skin outside siplified interface,
|
||||
|
||||
@@ -408,16 +408,32 @@ class Applications
|
||||
|
||||
// the criteria adds new fields if there are defined PM Table Fields in the cases list
|
||||
if ($oTmpCriteria != '') {
|
||||
$Criteria->add( $Criteria->getNewCriterion( AppCacheViewPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE )->addOr( $Criteria->getNewCriterion( AppCacheViewPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE )->addOr( $Criteria->getNewCriterion( AppCacheViewPeer::APP_NUMBER, $search, Criteria::LIKE )->addOr( $oTmpCriteria ) ) ) );
|
||||
$Criteria->add(
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::APP_NUMBER, $search, Criteria::EQUAL)->addOr(
|
||||
$oTmpCriteria
|
||||
)))));
|
||||
} else {
|
||||
$Criteria->add( $Criteria->getNewCriterion( AppCacheViewPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE )->addOr( $Criteria->getNewCriterion( AppCacheViewPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE )->addOr( $Criteria->getNewCriterion( AppCacheViewPeer::APP_NUMBER, $search, Criteria::LIKE ) ) ) );
|
||||
$Criteria->add(
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$Criteria->getNewCriterion(AppCacheViewPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
))));
|
||||
}
|
||||
|
||||
// the count query needs to be the normal criteria query if there are defined PM Table Fields in the cases list
|
||||
if ($oTmpCriteria != '') {
|
||||
$CriteriaCount = $Criteria;
|
||||
} else {
|
||||
$CriteriaCount->add( $CriteriaCount->getNewCriterion( AppCacheViewPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE )->addOr( $CriteriaCount->getNewCriterion( AppCacheViewPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE )->addOr( $CriteriaCount->getNewCriterion( AppCacheViewPeer::APP_NUMBER, $search, Criteria::LIKE ) ) ) );
|
||||
$CriteriaCount->add(
|
||||
$CriteriaCount->getNewCriterion(AppCacheViewPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$CriteriaCount->getNewCriterion(AppCacheViewPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$CriteriaCount->getNewCriterion(AppCacheViewPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$CriteriaCount->getNewCriterion(AppCacheViewPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -427,7 +427,7 @@ function evaluateFunction ($aGrid, $sExpresion)
|
||||
$pmScript->execute();
|
||||
|
||||
$aGrid[$i] = $pmScript->aFields;
|
||||
|
||||
|
||||
//compatibility for var_label
|
||||
foreach ($aFields as $j => $val) {
|
||||
if (isset($aGrid[$i][$j . "_label"]) && empty($aGrid[$i][$j . "_label"]) && !empty($aGrid[$i][$j])) {
|
||||
@@ -3352,3 +3352,42 @@ function PMFGetNextDerivationInfo($caseUid, $delIndex)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @method
|
||||
*
|
||||
* Direct case link
|
||||
*
|
||||
* @name PMFCaseLink
|
||||
* @label PMF Direct case link
|
||||
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFCaseLink.28.29
|
||||
*
|
||||
* @param string(32) | $caseUid | ID of the case | The unique ID of the case
|
||||
* @param string | $workspace = null | Workspace | The workspace
|
||||
* @param string | $language = null | Language | The language
|
||||
* @param string | $skin = null | Skin | The skin
|
||||
*
|
||||
* @return string | $url | Direct case link | Returns the direct case link, FALSE otherwise
|
||||
*/
|
||||
function PMFCaseLink($caseUid, $workspace = null, $language = null, $skin = null)
|
||||
{
|
||||
try {
|
||||
$case = new \ProcessMaker\BusinessModel\Cases();
|
||||
|
||||
$arrayApplicationData = $case->getApplicationRecordByPk($caseUid, [], false);
|
||||
|
||||
if ($arrayApplicationData === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$workspace = (!is_null($workspace))? $workspace : SYS_SYS;
|
||||
$language = (!is_null($language))? $language : SYS_LANG;
|
||||
$skin = (!is_null($skin))? $skin : SYS_SKIN;
|
||||
|
||||
$uri = '/sys' . $workspace . '/' . $language . '/' . $skin . '/cases/opencase/' . $caseUid;
|
||||
|
||||
//Return
|
||||
return ((G::is_https())? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $uri;
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,9 +204,11 @@ class ListCanceled extends BaseListCanceled {
|
||||
|
||||
if ($search != '') {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion( 'CON_APP.CON_VALUE', '%' . $search . '%', Criteria::LIKE )->
|
||||
addOr( $criteria->getNewCriterion( 'CON_TAS.CON_VALUE', '%' . $search . '%', Criteria::LIKE )->
|
||||
addOr( $criteria->getNewCriterion( ListCanceledPeer::APP_NUMBER, $search, Criteria::LIKE ) ) ) );
|
||||
$criteria->getNewCriterion('CON_APP.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion('CON_TAS.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListCanceledPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$criteria->getNewCriterion(ListCanceledPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
))));
|
||||
}
|
||||
|
||||
if ($process != '') {
|
||||
|
||||
@@ -221,9 +221,11 @@ class ListCompleted extends BaseListCompleted
|
||||
|
||||
if ($search != '') {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion( 'CON_APP.CON_VALUE', '%' . $search . '%', Criteria::LIKE )->
|
||||
addOr( $criteria->getNewCriterion( 'CON_TAS.CON_VALUE', '%' . $search . '%', Criteria::LIKE )->
|
||||
addOr( $criteria->getNewCriterion( ListCompletedPeer::APP_NUMBER, $search, Criteria::LIKE ) ) ) );
|
||||
$criteria->getNewCriterion('CON_APP.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion('CON_TAS.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListCompletedPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$criteria->getNewCriterion(ListCompletedPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
))));
|
||||
}
|
||||
|
||||
if ($process != '') {
|
||||
|
||||
@@ -72,7 +72,7 @@ class ListInbox extends BaseListInbox
|
||||
$listParticipatedLast = new ListParticipatedLast();
|
||||
$listParticipatedLast->refresh($data);
|
||||
} else {
|
||||
$data['USR_UID_CURRENT'] = $data['DEL_PREVIOUS_USR_UID'];
|
||||
$data['USR_UID_CURRENT'] = $data['DEL_PREVIOUS_USR_UID'];
|
||||
$data['DEL_CURRENT_USR_LASTNAME'] = '';
|
||||
$data['DEL_CURRENT_USR_USERNAME'] = '';
|
||||
$data['DEL_CURRENT_USR_FIRSTNAME'] = '';
|
||||
@@ -402,17 +402,12 @@ class ListInbox extends BaseListInbox
|
||||
|
||||
if ($search != '') {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion( ListInboxPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE )
|
||||
->addOr(
|
||||
$criteria->getNewCriterion( ListInboxPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE )
|
||||
->addOr(
|
||||
$criteria->getNewCriterion( ListInboxPeer::APP_NUMBER, $search, Criteria::LIKE )
|
||||
->addOr(
|
||||
$criteria->getNewCriterion( ListInboxPeer::APP_PRO_TITLE, '%' . $search . '%', Criteria::LIKE )
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$criteria->getNewCriterion(ListInboxPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListInboxPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListInboxPeer::APP_PRO_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListInboxPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$criteria->getNewCriterion(ListInboxPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
)))));
|
||||
}
|
||||
|
||||
if ($process != '') {
|
||||
|
||||
@@ -158,9 +158,11 @@ class ListMyInbox extends BaseListMyInbox
|
||||
|
||||
if ($search != '') {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion( 'CON_APP.CON_VALUE', '%' . $search . '%', Criteria::LIKE )->
|
||||
addOr( $criteria->getNewCriterion( 'CON_TAS.CON_VALUE', '%' . $search . '%', Criteria::LIKE )->
|
||||
addOr( $criteria->getNewCriterion( ListMyInboxPeer::APP_NUMBER, $search, Criteria::LIKE ) ) ) );
|
||||
$criteria->getNewCriterion('CON_APP.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion('CON_TAS.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListMyInboxPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$criteria->getNewCriterion(ListMyInboxPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
))));
|
||||
}
|
||||
|
||||
if ($process != '') {
|
||||
|
||||
@@ -117,9 +117,11 @@ class ListParticipatedHistory extends BaseListParticipatedHistory
|
||||
|
||||
if ($search != '') {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion( 'CON_APP.CON_VALUE', '%' . $search . '%', Criteria::LIKE )->
|
||||
addOr( $criteria->getNewCriterion( 'CON_TAS.CON_VALUE', '%' . $search . '%', Criteria::LIKE )->
|
||||
addOr( $criteria->getNewCriterion( ListParticipatedHistoryPeer::APP_NUMBER, $search, Criteria::LIKE ) ) ) );
|
||||
$criteria->getNewCriterion('CON_APP.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion('CON_TAS.CON_VALUE', '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListParticipatedHistoryPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$criteria->getNewCriterion(ListParticipatedHistoryPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
))));
|
||||
}
|
||||
|
||||
if ($process != '') {
|
||||
|
||||
@@ -48,14 +48,14 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
$aRow = $dataset->getRow();
|
||||
$data['DEL_CURRENT_USR_USERNAME'] = $aRow['USR_USERNAME'];
|
||||
$data['DEL_CURRENT_USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME'];
|
||||
$data['DEL_CURRENT_USR_LASTNAME'] = $aRow['USR_LASTNAME'];
|
||||
$data['DEL_CURRENT_USR_LASTNAME'] = $aRow['USR_LASTNAME'];
|
||||
$data['DEL_CURRENT_TAS_TITLE'] = $data['APP_TAS_TITLE'];
|
||||
|
||||
$users = new Users();
|
||||
$users->refreshTotal($data['USR_UID'], 'add', 'participated');
|
||||
}
|
||||
} else {
|
||||
$getData['USR_UID'] = $data['USR_UID_CURRENT'];
|
||||
$getData['USR_UID'] = $data['USR_UID_CURRENT'];
|
||||
$getData['APP_UID'] = $data['APP_UID'];
|
||||
$row = $this->getRowFromList($getData);
|
||||
if(is_array($row) && sizeof($row)) {
|
||||
@@ -63,7 +63,7 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
$this->updateCurrentUser($row, $set);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($this->primaryKeysExists($data)) {
|
||||
return;
|
||||
}
|
||||
@@ -151,7 +151,7 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
|
||||
if (isset($data['APP_TAS_TITLE'])) {
|
||||
$criteriaSet->add(ListParticipatedLastPeer::DEL_CURRENT_TAS_TITLE, $data['APP_TAS_TITLE']);
|
||||
}
|
||||
}
|
||||
|
||||
BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
|
||||
|
||||
@@ -229,9 +229,11 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
|
||||
if ($search != '' ) {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion( ListParticipatedLastPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE )->
|
||||
addOr( $criteria->getNewCriterion( ListParticipatedLastPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE )->
|
||||
addOr( $criteria->getNewCriterion( ListParticipatedLastPeer::APP_NUMBER, $search, Criteria::LIKE ) ) ) );
|
||||
$criteria->getNewCriterion(ListParticipatedLastPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListParticipatedLastPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListParticipatedLastPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$criteria->getNewCriterion(ListParticipatedLastPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
))));
|
||||
}
|
||||
|
||||
if($filterStatus != ''){
|
||||
@@ -353,12 +355,12 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
public function primaryKeysExists($data) {
|
||||
$criteria = new Criteria("workflow");
|
||||
$criteria->add(ListParticipatedLastPeer::APP_UID, $data['APP_UID']);
|
||||
$criteria->add(ListParticipatedLastPeer::USR_UID, $data['USR_UID']);
|
||||
$criteria->add(ListParticipatedLastPeer::DEL_INDEX, $data['DEL_INDEX']);
|
||||
$criteria->add(ListParticipatedLastPeer::DEL_INDEX, $data['DEL_INDEX']);
|
||||
$dataset = UsersPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
@@ -370,7 +372,7 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public function getRowFromList($data) {
|
||||
$criteria = new Criteria("workflow");
|
||||
$criteria->add(ListParticipatedLastPeer::APP_UID, $data['APP_UID']);
|
||||
@@ -386,14 +388,14 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public function updateCurrentUser($where, $set)
|
||||
{
|
||||
{
|
||||
$con = Propel::getConnection('workflow');
|
||||
//Update - WHERE
|
||||
$criteriaWhere = new Criteria("workflow");
|
||||
$criteriaWhere->add(ListParticipatedLastPeer::APP_UID, $where["APP_UID"], Criteria::EQUAL);
|
||||
$criteriaWhere->add(ListParticipatedLastPeer::USR_UID, $where["USR_UID"], Criteria::EQUAL);
|
||||
$criteriaWhere->add(ListParticipatedLastPeer::USR_UID, $where["USR_UID"], Criteria::EQUAL);
|
||||
$criteriaWhere->add(ListParticipatedLastPeer::DEL_INDEX, $where["DEL_INDEX"], Criteria::EQUAL);
|
||||
//Update - SET
|
||||
$criteriaSet = new Criteria("workflow");
|
||||
|
||||
@@ -221,9 +221,11 @@ class ListPaused extends BaseListPaused {
|
||||
|
||||
if ($search != '') {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion( ListPausedPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE )->
|
||||
addOr( $criteria->getNewCriterion( ListPausedPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE )->
|
||||
addOr( $criteria->getNewCriterion( ListPausedPeer::APP_NUMBER, $search, Criteria::LIKE ) ) ) );
|
||||
$criteria->getNewCriterion(ListPausedPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListPausedPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListPausedPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$criteria->getNewCriterion(ListPausedPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
))));
|
||||
}
|
||||
|
||||
if ($process != '') {
|
||||
|
||||
@@ -188,9 +188,11 @@ class ListUnassigned extends BaseListUnassigned
|
||||
|
||||
if ($search != '') {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion( ListUnassignedPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE )->
|
||||
addOr( $criteria->getNewCriterion( ListUnassignedPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE )->
|
||||
addOr( $criteria->getNewCriterion( ListUnassignedPeer::APP_NUMBER, $search, Criteria::LIKE ) ) ) );
|
||||
$criteria->getNewCriterion(ListUnassignedPeer::APP_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListUnassignedPeer::APP_TAS_TITLE, '%' . $search . '%', Criteria::LIKE)->addOr(
|
||||
$criteria->getNewCriterion(ListUnassignedPeer::APP_UID, $search, Criteria::EQUAL)->addOr(
|
||||
$criteria->getNewCriterion(ListUnassignedPeer::APP_NUMBER, $search, Criteria::EQUAL)
|
||||
))));
|
||||
}
|
||||
|
||||
if ($process != '') {
|
||||
|
||||
@@ -3,6 +3,7 @@ unset($_SESSION['APPLICATION']);
|
||||
|
||||
//get the action from GET or POST, default is todo
|
||||
$action = isset( $_GET['action'] ) ? $_GET['action'] : (isset( $_POST['action'] ) ? $_POST['action'] : 'todo');
|
||||
$openApplicationUid = (isset($_GET['openApplicationUid']))? $_GET['openApplicationUid'] : null;
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$filterAction = isset( $_GET['filterAction'] ) ? $_GET['filterAction'] : (isset( $_POST['filterAction'] ) ? $_POST['filterAction'] : '');
|
||||
@@ -224,6 +225,8 @@ $oHeadPublisher->addContent( 'cases/casesListExtJs' ); //adding a html file .ht
|
||||
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
|
||||
$oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState());
|
||||
$oHeadPublisher->assign('isIE', Bootstrap::isIE());
|
||||
$oHeadPublisher->assign('__OPEN_APPLICATION_UID__', $openApplicationUid);
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
function getUserArray ($action, $userUid)
|
||||
@@ -319,7 +322,7 @@ function getStatusArray($action, $userUid)
|
||||
$status[] = array('DRAFT', G::LoadTranslation('ID_CASES_STATUS_DRAFT'));
|
||||
$status[] = array('TO_DO', G::LoadTranslation('ID_CASES_STATUS_TO_DO'));
|
||||
$status[] = array('CANCELLED', G::LoadTranslation('ID_CASES_STATUS_CANCELLED'));
|
||||
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,11 +64,52 @@ if (isset( $arrayConfig["DEFAULT_CASES_MENU"] )) {
|
||||
$confDefaultOption = "CASES_INBOX";
|
||||
}
|
||||
|
||||
if (isset( $_GET["id"] ) && isset( $_GET["id"] )) {
|
||||
$defaultOption = "../cases/open?APP_UID=" . $_GET["id"] . "&DEL_INDEX=" . $_GET["i"];
|
||||
if (isset($_SESSION['__OPEN_APPLICATION_UID__'])) {
|
||||
$case = new \ProcessMaker\BusinessModel\Cases();
|
||||
|
||||
if (isset( $_GET["a"] )) {
|
||||
$defaultOption .= "&action=" . $_GET["a"];
|
||||
$confDefaultOption = 'CASES_SEARCH';
|
||||
$action = 'search';
|
||||
|
||||
$arrayResult = $case->getStatusInfo($_SESSION['__OPEN_APPLICATION_UID__'], 0, $_SESSION['USER_LOGGED']);
|
||||
$arrayDelIndex = [];
|
||||
|
||||
if (!empty($arrayResult)) {
|
||||
$arrayDefaultOption = [
|
||||
'TO_DO' => ['CASES_INBOX', 'todo'],
|
||||
'DRAFT' => ['CASES_DRAFT', 'draft'],
|
||||
'CANCELLED' => ['CASES_SENT', 'sent'],
|
||||
'COMPLETED' => ['CASES_SENT', 'sent'],
|
||||
'PARTICIPATED' => ['CASES_SENT', 'sent'],
|
||||
'UNASSIGNED' => ['CASES_SELFSERVICE', 'unassigned'],
|
||||
'PAUSED' => ['CASES_PAUSED', 'paused']
|
||||
];
|
||||
|
||||
$confDefaultOption = $arrayDefaultOption[$arrayResult['APP_STATUS']][0];
|
||||
$action = $arrayDefaultOption[$arrayResult['APP_STATUS']][1];
|
||||
|
||||
$arrayDelIndex = $arrayResult['DEL_INDEX'];
|
||||
} else {
|
||||
$arrayResult = $case->getStatusInfo($_SESSION['__OPEN_APPLICATION_UID__']);
|
||||
|
||||
$arrayDelIndex = $arrayResult['DEL_INDEX'];
|
||||
}
|
||||
|
||||
if (count($arrayDelIndex) == 1) {
|
||||
$defaultOption = '../cases/open?APP_UID=' . $_SESSION['__OPEN_APPLICATION_UID__'] .
|
||||
'&DEL_INDEX=' . $arrayDelIndex[0] . '&action=' . $action;
|
||||
} else {
|
||||
$defaultOption = '../cases/casesListExtJs?action=' . $action .
|
||||
'&openApplicationUid=' . $_SESSION['__OPEN_APPLICATION_UID__'];
|
||||
}
|
||||
|
||||
unset($_SESSION['__OPEN_APPLICATION_UID__']);
|
||||
} else {
|
||||
if (isset($_GET['id'])) {
|
||||
$defaultOption = '../cases/open?APP_UID=' . $_GET['id'] . '&DEL_INDEX=' . $_GET['i'];
|
||||
|
||||
if (isset($_GET['a'])) {
|
||||
$defaultOption .= '&action=' . $_GET['a'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
40
workflow/engine/methods/cases/opencase.php
Normal file
40
workflow/engine/methods/cases/opencase.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
$RBAC->requirePermissions('PM_CASES');
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
|
||||
$_POST['qs'] = '';
|
||||
|
||||
$arrayAux = explode('?', $_SERVER['REQUEST_URI']);
|
||||
|
||||
preg_match('/^.*\/cases\/opencase\/([\w\-]{32})$/', $arrayAux[0], $arrayMatch);
|
||||
|
||||
$applicationUid = $arrayMatch[1];
|
||||
|
||||
$case = new \ProcessMaker\BusinessModel\Cases();
|
||||
|
||||
$arrayApplicationData = $case->getApplicationRecordByPk($applicationUid, [], false);
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
if ($arrayApplicationData !== false) {
|
||||
$_SESSION['__CD__'] = '../';
|
||||
$_SESSION['__OPEN_APPLICATION_UID__'] = $applicationUid;
|
||||
|
||||
$G_PUBLISH->AddContent('view', 'cases/cases_Load');
|
||||
|
||||
$headPublisher = &headPublisher::getSingleton();
|
||||
$headPublisher->addScriptFile('/jscore/src/PM.js');
|
||||
$headPublisher->addScriptFile('/jscore/src/Sessions.js');
|
||||
} else {
|
||||
$G_PUBLISH->AddContent(
|
||||
'xmlform',
|
||||
'xmlform',
|
||||
'login/showMessage',
|
||||
'',
|
||||
['MESSAGE' => \G::LoadTranslation('ID_CASE_DOES_NOT_EXIST2', ['app_uid', $applicationUid])]
|
||||
);
|
||||
}
|
||||
|
||||
G::RenderPage('publish');
|
||||
@@ -32,6 +32,10 @@ $type = isset( $_GET["type"] ) ? $_GET["type"] : (isset( $_REQUEST["type"] ) ? $
|
||||
$dateFrom = isset( $_REQUEST["dateFrom"] ) ? substr( $_REQUEST["dateFrom"], 0, 10 ) : "";
|
||||
$dateTo = isset( $_REQUEST["dateTo"] ) ? substr( $_REQUEST["dateTo"], 0, 10 ) : "";
|
||||
$first = isset( $_REQUEST["first"] ) ? true :false;
|
||||
$openApplicationUid = (isset($_REQUEST['openApplicationUid']) && $_REQUEST['openApplicationUid'] != '')?
|
||||
$_REQUEST['openApplicationUid'] : null;
|
||||
|
||||
$search = (!is_null($openApplicationUid))? $openApplicationUid : $search;
|
||||
|
||||
if ($sort == 'CASE_SUMMARY' || $sort == 'CASE_NOTES_COUNT') {
|
||||
$sort = 'APP_NUMBER';//DEFAULT VALUE
|
||||
|
||||
@@ -33,6 +33,8 @@ try {
|
||||
$filters['action'] = isset( $_REQUEST["action"] ) ? $filter->sanitizeInputValue($_REQUEST["action"], 'nosql') : "";
|
||||
$listName = isset( $_REQUEST["list"] ) ? $filter->sanitizeInputValue($_REQUEST["list"], 'nosql') : "inbox";
|
||||
$filters['filterStatus'] = isset( $_REQUEST["filterStatus"] ) ? $filter->sanitizeInputValue($_REQUEST["filterStatus"], 'nosql') : "";
|
||||
$openApplicationUid = (isset($_REQUEST['openApplicationUid']) && $_REQUEST['openApplicationUid'] != '')?
|
||||
$_REQUEST['openApplicationUid'] : null;
|
||||
|
||||
// Select list
|
||||
switch ($listName) {
|
||||
@@ -73,6 +75,8 @@ try {
|
||||
|
||||
|
||||
// Validate filters
|
||||
$filters['search'] = (!is_null($openApplicationUid))? $openApplicationUid : $filters['search'];
|
||||
|
||||
$filters['start'] = (int)$filters['start'];
|
||||
$filters['start'] = abs($filters['start']);
|
||||
if ($filters['start'] != 0) {
|
||||
|
||||
@@ -2386,14 +2386,39 @@ class Cases
|
||||
return $aField;
|
||||
}
|
||||
|
||||
private function __getStatusInfoDataByRsCriteria($rsCriteria)
|
||||
{
|
||||
try {
|
||||
$arrayData = [];
|
||||
|
||||
if ($rsCriteria->next()) {
|
||||
$record = $rsCriteria->getRow();
|
||||
|
||||
$arrayData = ['APP_STATUS' => $record['APP_STATUS'], 'DEL_INDEX' => []];
|
||||
$arrayData['DEL_INDEX'][] = $record['DEL_INDEX'];
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$record = $rsCriteria->getRow();
|
||||
|
||||
$arrayData['DEL_INDEX'][] = $record['DEL_INDEX'];
|
||||
}
|
||||
}
|
||||
|
||||
//Return
|
||||
return $arrayData;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get status info Case
|
||||
*
|
||||
* @param string $applicationUid Unique id of Case
|
||||
* @param int $del_index {@min 1}
|
||||
* @param int $delIndex Delegation index
|
||||
* @param string $userUid Unique id of User
|
||||
*
|
||||
* return array Return an array with status info Case, array empty otherwise
|
||||
* @return array Return an array with status info Case, array empty otherwise
|
||||
*/
|
||||
public function getStatusInfo($applicationUid, $delIndex = 0, $userUid = "")
|
||||
{
|
||||
@@ -2407,7 +2432,8 @@ class Cases
|
||||
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn($delimiter . "PAUSED" . $delimiter . " AS APP_STATUS");
|
||||
$criteria->setDistinct();
|
||||
$criteria->addSelectColumn($delimiter . 'PAUSED' . $delimiter . ' AS APP_STATUS');
|
||||
$criteria->addSelectColumn(\AppDelayPeer::APP_DEL_INDEX . " AS DEL_INDEX");
|
||||
|
||||
$criteria->add(\AppDelayPeer::APP_UID, $applicationUid, \Criteria::EQUAL);
|
||||
@@ -2428,16 +2454,48 @@ class Cases
|
||||
$rsCriteria = \AppDelayPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
if ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
$arrayData = $this->__getStatusInfoDataByRsCriteria($rsCriteria);
|
||||
|
||||
//Return
|
||||
return array("APP_STATUS" => $row["APP_STATUS"], "DEL_INDEX" => $row["DEL_INDEX"]);
|
||||
if (!empty($arrayData)) {
|
||||
return $arrayData;
|
||||
}
|
||||
|
||||
//Status is UNASSIGNED
|
||||
if ($userUid != '') {
|
||||
$appCacheView = new \AppCacheView();
|
||||
|
||||
$criteria = $appCacheView->getUnassignedListCriteria($userUid);
|
||||
} else {
|
||||
$criteria = new \Criteria('workflow');
|
||||
|
||||
$criteria->add(\AppCacheViewPeer::DEL_FINISH_DATE, null, \Criteria::ISNULL);
|
||||
$criteria->add(\AppCacheViewPeer::USR_UID, '', \Criteria::EQUAL);
|
||||
}
|
||||
|
||||
$criteria->setDistinct();
|
||||
$criteria->clearSelectColumns();
|
||||
$criteria->addSelectColumn($delimiter . 'UNASSIGNED' . $delimiter . ' AS APP_STATUS');
|
||||
$criteria->addSelectColumn(\AppCacheViewPeer::DEL_INDEX);
|
||||
|
||||
$criteria->add(\AppCacheViewPeer::APP_UID, $applicationUid, \Criteria::EQUAL);
|
||||
|
||||
if ($delIndex != 0) {
|
||||
$criteria->add(\AppCacheViewPeer::DEL_INDEX, $delIndex, \Criteria::EQUAL);
|
||||
}
|
||||
|
||||
$rsCriteria = \AppCacheViewPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$arrayData = $this->__getStatusInfoDataByRsCriteria($rsCriteria);
|
||||
|
||||
if (!empty($arrayData)) {
|
||||
return $arrayData;
|
||||
}
|
||||
|
||||
//Status is TO_DO, DRAFT
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->setDistinct();
|
||||
$criteria->addSelectColumn(\ApplicationPeer::APP_STATUS);
|
||||
$criteria->addSelectColumn(\AppDelegationPeer::DEL_INDEX);
|
||||
|
||||
@@ -2469,11 +2527,10 @@ class Cases
|
||||
$rsCriteria = \ApplicationPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
if ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
$arrayData = $this->__getStatusInfoDataByRsCriteria($rsCriteria);
|
||||
|
||||
//Return
|
||||
return array("APP_STATUS" => $row["APP_STATUS"], "DEL_INDEX" => $row["DEL_INDEX"]);
|
||||
if (!empty($arrayData)) {
|
||||
return $arrayData;
|
||||
}
|
||||
|
||||
//Status is CANCELLED, COMPLETED
|
||||
@@ -2487,9 +2544,6 @@ class Cases
|
||||
$arrayCondition[] = array(\ApplicationPeer::APP_UID, $delimiter . $applicationUid . $delimiter, \Criteria::EQUAL);
|
||||
$criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
|
||||
|
||||
$criteria->add(\ApplicationPeer::APP_STATUS, array("CANCELLED", "COMPLETED"), \Criteria::IN);
|
||||
$criteria->add(\AppDelegationPeer::DEL_LAST_INDEX, 1, \Criteria::EQUAL);
|
||||
|
||||
if ($delIndex != 0) {
|
||||
$criteria->add(\AppDelegationPeer::DEL_INDEX, $delIndex, \Criteria::EQUAL);
|
||||
}
|
||||
@@ -2498,14 +2552,38 @@ class Cases
|
||||
$criteria->add(\AppDelegationPeer::USR_UID, $userUid, \Criteria::EQUAL);
|
||||
}
|
||||
|
||||
$rsCriteria = \ApplicationPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$criteria2 = clone $criteria;
|
||||
|
||||
if ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
$criteria2->setDistinct();
|
||||
|
||||
//Return
|
||||
return array("APP_STATUS" => $row["APP_STATUS"], "DEL_INDEX" => $row["DEL_INDEX"]);
|
||||
$criteria2->add(\ApplicationPeer::APP_STATUS, ['CANCELLED', 'COMPLETED'], \Criteria::IN);
|
||||
$criteria2->add(\AppDelegationPeer::DEL_LAST_INDEX, 1, \Criteria::EQUAL);
|
||||
|
||||
$rsCriteria2 = \ApplicationPeer::doSelectRS($criteria2);
|
||||
$rsCriteria2->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$arrayData = $this->__getStatusInfoDataByRsCriteria($rsCriteria2);
|
||||
|
||||
if (!empty($arrayData)) {
|
||||
return $arrayData;
|
||||
}
|
||||
|
||||
//Status is PARTICIPATED
|
||||
$criteria2 = clone $criteria;
|
||||
|
||||
$criteria2->setDistinct();
|
||||
$criteria2->clearSelectColumns();
|
||||
$criteria2->addSelectColumn($delimiter . 'PARTICIPATED' . $delimiter . ' AS APP_STATUS');
|
||||
$criteria2->addSelectColumn(\AppDelegationPeer::DEL_INDEX);
|
||||
$criteria2->addSelectColumn(\ApplicationPeer::APP_UID);
|
||||
|
||||
$rsCriteria2 = \ApplicationPeer::doSelectRS($criteria2);
|
||||
$rsCriteria2->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$arrayData = $this->__getStatusInfoDataByRsCriteria($rsCriteria2);
|
||||
|
||||
if (!empty($arrayData)) {
|
||||
return $arrayData;
|
||||
}
|
||||
|
||||
//Return
|
||||
|
||||
@@ -812,6 +812,12 @@ Ext.onReady ( function() {
|
||||
autoSave: true, // <-- false would delay executing create, update, destroy requests until specifically told to do so with some [save] buton.
|
||||
sortInfo:{field: 'APP_CACHE_VIEW.APP_NUMBER', direction: "DESC"},
|
||||
listeners: {
|
||||
beforeload: function (store, options)
|
||||
{
|
||||
this.setBaseParam(
|
||||
"openApplicationUid", (__OPEN_APPLICATION_UID__ !== null)? __OPEN_APPLICATION_UID__ : ""
|
||||
);
|
||||
},
|
||||
load: function(response){
|
||||
|
||||
if (response.reader.jsonData.result === false) {
|
||||
@@ -2313,12 +2319,16 @@ Ext.onReady ( function() {
|
||||
|
||||
var viewText = Ext.getCmp('casesGrid').getView();
|
||||
storeCases.removeAll();
|
||||
if (action != 'search') {
|
||||
|
||||
if (action != "search" || __OPEN_APPLICATION_UID__ !== null) {
|
||||
storeCases.load();
|
||||
} else {
|
||||
viewText.emptyText = _('ID_ENTER_SEARCH_CRITERIA');
|
||||
storeCases.load( {params: { first: true}} );
|
||||
}
|
||||
|
||||
__OPEN_APPLICATION_UID__ = null;
|
||||
|
||||
//newPopUp.add(reassignGrid);
|
||||
newPopUp.add(gridForm);
|
||||
newPopUp.addButton(btnExecReassignSelected);
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
<?php
|
||||
G::LoadSystem('inputfilter');
|
||||
$cd = (isset($_SESSION['__CD__']))? $_SESSION['__CD__'] : '';
|
||||
unset($_SESSION['__CD__']);
|
||||
|
||||
$filter = new InputFilter();
|
||||
?>
|
||||
<html>
|
||||
<style type="text/css">
|
||||
.Footer .content {
|
||||
padding :0px !important;
|
||||
}
|
||||
}
|
||||
*html body {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
</style>
|
||||
<body onresize="autoResizeScreen()" onload="autoResizeScreen()">
|
||||
<iframe name="casesFrame" id="casesFrame" src ="../cases/main_init<?php echo $filter->xssFilterHard($_POST['qs']);?>" width="99%" height="768" frameborder="0">
|
||||
<p>Your browser does not support iframes.</p>
|
||||
</iframe>
|
||||
<iframe name="casesFrame" id="casesFrame" src ="<?php echo $cd; ?>../cases/main_init<?php echo $filter->xssFilterHard($_POST['qs']); ?>" width="99%" height="768" frameborder="0">
|
||||
<p>Your browser does not support iframes.</p>
|
||||
</iframe>
|
||||
</body>
|
||||
<script>
|
||||
if ( document.getElementById('pm_submenu') )
|
||||
@@ -28,7 +30,7 @@ $filter = new InputFilter();
|
||||
var containerList1, containerList2;
|
||||
oCasesFrame = document.getElementById('casesFrame');
|
||||
oClientWinSize = getClientWindowSize();
|
||||
|
||||
|
||||
containerList1 = document.getElementById("pm_header");
|
||||
if (document.getElementById("mainMenuBG") &&
|
||||
document.getElementById("mainMenuBG").parentNode &&
|
||||
|
||||
@@ -468,7 +468,15 @@ if (Bootstrap::virtualURI( $_SERVER['REQUEST_URI'], $virtualURITable, $realPath
|
||||
} //virtual URI parser
|
||||
|
||||
// the request correspond to valid php page, now parse the URI
|
||||
Bootstrap::parseURI( getenv( "REQUEST_URI" ) );
|
||||
$arrayFriendlyUri = [];
|
||||
$arrayFriendlyUri['cases/opencase'] = '/^[\w\-]{32}$/';
|
||||
|
||||
Bootstrap::parseURI(getenv('REQUEST_URI'), $arrayFriendlyUri);
|
||||
|
||||
if (SYS_TARGET === false) {
|
||||
header('Location: /errors/error404.php?url=' . urlencode($_SERVER['REQUEST_URI']));
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// Bootstrap::mylog("sys_temp: ".SYS_TEMP);
|
||||
if (Bootstrap::isPMUnderUpdating()) {
|
||||
|
||||
Reference in New Issue
Block a user