Merged in paulis/processmaker/PM-2973 (pull request #2369)
PM-2973: classic, despues de derivar no actualiza la data de la grilla
This commit is contained in:
@@ -18,14 +18,13 @@ class ConsolidatedCases
|
|||||||
if (!$status) {
|
if (!$status) {
|
||||||
$oCaseConsolidated = new CaseConsolidatedCore();
|
$oCaseConsolidated = new CaseConsolidatedCore();
|
||||||
$oCaseConsolidated = CaseConsolidatedCorePeer::retrieveByPK($sTasUid);
|
$oCaseConsolidated = CaseConsolidatedCorePeer::retrieveByPK($sTasUid);
|
||||||
if (!(is_object($oCaseConsolidated)) || get_class($oCaseConsolidated) != 'CaseConsolidated') {
|
if (!(is_object($oCaseConsolidated)) || get_class($oCaseConsolidated) != 'CaseConsolidatedCore') {
|
||||||
$oCaseConsolidated = new CaseConsolidatedCore();
|
|
||||||
$oCaseConsolidated->setTasUid($sTasUid);
|
|
||||||
$oCaseConsolidated->delete();
|
|
||||||
$oCaseConsolidated = new CaseConsolidatedCore();
|
$oCaseConsolidated = new CaseConsolidatedCore();
|
||||||
$oCaseConsolidated->setTasUid($sTasUid);
|
$oCaseConsolidated->setTasUid($sTasUid);
|
||||||
$oCaseConsolidated->setConStatus('INACTIVE');
|
$oCaseConsolidated->setConStatus('INACTIVE');
|
||||||
$oCaseConsolidated->save();
|
$oCaseConsolidated->save();
|
||||||
|
}else{
|
||||||
|
$oCaseConsolidated->delete();
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -172,11 +171,21 @@ class ConsolidatedCases
|
|||||||
$sRepTabUid = $_POST['form']['REP_TAB_UID'];
|
$sRepTabUid = $_POST['form']['REP_TAB_UID'];
|
||||||
|
|
||||||
$oCaseConsolidated = CaseConsolidatedCorePeer::retrieveByPK($sTasUid);
|
$oCaseConsolidated = CaseConsolidatedCorePeer::retrieveByPK($sTasUid);
|
||||||
if (!(is_object($oCaseConsolidated)) || get_class($oCaseConsolidated) != 'CaseConsolidated') {
|
if (!(is_object($oCaseConsolidated)) || get_class($oCaseConsolidated) != 'CaseConsolidatedCore') {
|
||||||
$oCaseConsolidated = new CaseConsolidatedCore();
|
$oCaseConsolidated = new CaseConsolidatedCore();
|
||||||
$oCaseConsolidated->setTasUid($sTasUid);
|
$oCaseConsolidated->setTasUid($sTasUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$criteria = new Criteria();
|
||||||
|
$criteria->addSelectColumn(CaseConsolidatedCorePeer::TAS_UID);
|
||||||
|
$criteria->add(CaseConsolidatedCorePeer::TAS_UID, $sTasUid);
|
||||||
|
$rsCriteria = CaseConsolidatedCorePeer::doSelectRS($criteria);
|
||||||
|
if ($rsCriteria->next()) {
|
||||||
|
$row = $rsCriteria->getRow();
|
||||||
|
$oCaseConsolidated->delete();
|
||||||
|
$oCaseConsolidated = CaseConsolidatedCorePeer::retrieveByPK($sTasUid);
|
||||||
|
}
|
||||||
|
|
||||||
$oCaseConsolidated->setConStatus('ACTIVE');
|
$oCaseConsolidated->setConStatus('ACTIVE');
|
||||||
$oCaseConsolidated->setDynUid($sDynUid);
|
$oCaseConsolidated->setDynUid($sDynUid);
|
||||||
$oCaseConsolidated->setRepTabUid($sRepTabUid);
|
$oCaseConsolidated->setRepTabUid($sRepTabUid);
|
||||||
|
|||||||
@@ -1546,7 +1546,7 @@ class processMap
|
|||||||
|
|
||||||
if ($iForm == 8) {
|
if ($iForm == 8) {
|
||||||
$oCaseConsolidated = CaseConsolidatedCorePeer::retrieveByPK($_SESSION["cDhTajE2T2lxSkhqMzZUTXVacWYyNcKwV3A4eWYybDdyb1p3"]["TAS_UID"]);
|
$oCaseConsolidated = CaseConsolidatedCorePeer::retrieveByPK($_SESSION["cDhTajE2T2lxSkhqMzZUTXVacWYyNcKwV3A4eWYybDdyb1p3"]["TAS_UID"]);
|
||||||
if ((is_object($oCaseConsolidated)) && get_class($oCaseConsolidated) == "CaseConsolidated") {
|
if ((is_object($oCaseConsolidated)) && get_class($oCaseConsolidated) == "CaseConsolidatedCore") {
|
||||||
require_once ("classes/model/ReportTable.php");
|
require_once ("classes/model/ReportTable.php");
|
||||||
|
|
||||||
$aFields["CON_STATUS"] = $oCaseConsolidated->getConStatus();
|
$aFields["CON_STATUS"] = $oCaseConsolidated->getConStatus();
|
||||||
|
|||||||
@@ -590,10 +590,10 @@ class ajax_con extends WebResource
|
|||||||
$sRepTabUid = "";
|
$sRepTabUid = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
$oCaseConsolidated = CaseConsolidatedPeer::retrieveByPK($sTasUid);
|
$oCaseConsolidated = CaseConsolidatedCorePeer::retrieveByPK($sTasUid);
|
||||||
|
|
||||||
if (!(is_object($oCaseConsolidated)) || get_class($oCaseConsolidated) != 'CaseConsolidated') {
|
if (!(is_object($oCaseConsolidated)) || get_class($oCaseConsolidated) != 'CaseConsolidated') {
|
||||||
$oCaseConsolidated = new CaseConsolidated();
|
$oCaseConsolidated = new CaseConsolidatedCore();
|
||||||
$oCaseConsolidated->setTasUid($sTasUid);
|
$oCaseConsolidated->setTasUid($sTasUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,23 +65,37 @@ class Consolidated
|
|||||||
* @param string $app_number, Task Uid
|
* @param string $app_number, Task Uid
|
||||||
* @param string $del_index, Task Uid
|
* @param string $del_index, Task Uid
|
||||||
* @param string $usr_uid, Task Uid
|
* @param string $usr_uid, Task Uid
|
||||||
|
* @param string $fieldName, Field Name
|
||||||
|
* @param string $fieldValue, Field Value
|
||||||
* @return string
|
* @return string
|
||||||
*
|
*
|
||||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||||
* @copyright Colosa - Bolivia
|
* @copyright Colosa - Bolivia
|
||||||
*/
|
*/
|
||||||
public function postDerivate ($app_uid, $app_number, $del_index, $usr_uid)
|
public function postDerivate ($app_uid, $app_number, $del_index, $usr_uid, $fieldName='', $fieldValue='')
|
||||||
{
|
{
|
||||||
G::LoadClass("library");
|
G::LoadClass("library");
|
||||||
G::LoadClass("wsBase");
|
G::LoadClass("wsBase");
|
||||||
G::LoadClass("case");
|
G::LoadClass("case");
|
||||||
|
|
||||||
$ws = new \wsBase();
|
$ws = new \wsBase();
|
||||||
$oCase = new \Cases();
|
$oCase = new \Cases();
|
||||||
|
|
||||||
if (!isset($Fields["DEL_INIT_DATE"])) {
|
if (!isset($Fields["DEL_INIT_DATE"])) {
|
||||||
$oCase->setDelInitDate($app_uid, $del_index);
|
$oCase->setDelInitDate($app_uid, $del_index);
|
||||||
$aFields = $oCase->loadCase($app_uid, $del_index);
|
$aFields = $oCase->loadCase($app_uid, $del_index);
|
||||||
|
//Update data grid
|
||||||
|
$aData = $aFields['APP_DATA'];
|
||||||
|
foreach ($aData as $k => $dataField) {
|
||||||
|
if(is_array($dataField)){
|
||||||
|
$pos = count($dataField);
|
||||||
|
if(isset($aData[$k][$pos][$fieldName])){
|
||||||
|
$aData[$k][$pos][$fieldName] = $fieldValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$aFields['APP_DATA'] = $aData;
|
||||||
|
$oCase->updateCase($app_uid, $aFields);
|
||||||
|
//End update
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = $ws->derivateCase($usr_uid, $app_uid, $del_index, true);
|
$res = $ws->derivateCase($usr_uid, $app_uid, $del_index, true);
|
||||||
@@ -242,7 +256,7 @@ class Consolidated
|
|||||||
$tableUid = $item["REP_TAB_UID"];
|
$tableUid = $item["REP_TAB_UID"];
|
||||||
$tableName = $row["REP_TAB_NAME"];
|
$tableName = $row["REP_TAB_NAME"];
|
||||||
} else {
|
} else {
|
||||||
throw (new Exception("Not found the report table"));
|
throw new \Exception("Not found the report table");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,19 +136,21 @@ class Consolidated extends Api
|
|||||||
* @param string $app_uid {@min 1} {@max 32}
|
* @param string $app_uid {@min 1} {@max 32}
|
||||||
* @param string $app_number
|
* @param string $app_number
|
||||||
* @param string $del_index
|
* @param string $del_index
|
||||||
|
* @param string $field_grid
|
||||||
|
* @param string $field_grid_val
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||||
* @copyright Colosa - Bolivia
|
* @copyright Colosa - Bolivia
|
||||||
*
|
*
|
||||||
* @url POST /derivate/:app_uid/:app_number/:del_index
|
* @url POST /derivate/:app_uid/:app_number/:del_index/:field_grid/:field_grid_val
|
||||||
*/
|
*/
|
||||||
public function doPostDerivate($app_uid, $app_number, $del_index)
|
public function doPostDerivate($app_uid, $app_number, $del_index, $field_grid, $field_grid_val)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$usr_uid = $this->getUserId();
|
$usr_uid = $this->getUserId();
|
||||||
$consolidated = new \ProcessMaker\BusinessModel\Consolidated();
|
$consolidated = new \ProcessMaker\BusinessModel\Consolidated();
|
||||||
return $consolidated->postDerivate($app_uid, $app_number, $del_index, $usr_uid);
|
return $consolidated->postDerivate($app_uid, $app_number, $del_index, $usr_uid,$field_grid, $field_grid_val);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
var grdNumRows = 0; //
|
var grdNumRows = 0; //
|
||||||
var grdRowLabel = []; //
|
var grdRowLabel = []; //
|
||||||
|
var fieldGridGral = '';
|
||||||
|
var fieldGridGralVal = '';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -409,9 +410,16 @@ Ext.onReady(function () {
|
|||||||
var selectedRow = Ext.getCmp(gridId).getSelectionModel().getSelections();
|
var selectedRow = Ext.getCmp(gridId).getSelectionModel().getSelections();
|
||||||
var maxLenght = selectedRow.length;
|
var maxLenght = selectedRow.length;
|
||||||
for (var i in selectedRow) {
|
for (var i in selectedRow) {
|
||||||
|
rowGrid = selectedRow[i].data
|
||||||
|
for (fieldGrid in rowGrid){
|
||||||
|
if(fieldGrid != 'APP_UID' && fieldGrid != 'APP_NUMBER' && fieldGrid != 'APP_TITLE' && fieldGrid != 'DEL_INDEX' ){
|
||||||
|
fieldGridGral = fieldGrid;
|
||||||
|
fieldGridGralVal = rowGrid[fieldGrid];
|
||||||
|
}
|
||||||
|
}
|
||||||
if (selectedRow[i].data) {
|
if (selectedRow[i].data) {
|
||||||
//alert (derivateRequestAjax(selectedRow[i].data["company"]));
|
//alert (derivateRequestAjax(selectedRow[i].data["company"]));
|
||||||
ajaxDerivationRequest(selectedRow[i].data["APP_UID"], selectedRow[i].data["DEL_INDEX"], maxLenght, selectedRow[i].data["APP_NUMBER"]);
|
ajaxDerivationRequest(selectedRow[i].data["APP_UID"], selectedRow[i].data["DEL_INDEX"], maxLenght, selectedRow[i].data["APP_NUMBER"],fieldGridGral, fieldGridGralVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1298,14 +1306,14 @@ function generateGrid(proUid, tasUid, dynUid)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function ajaxDerivationRequest(appUid, delIndex, maxLenght, appNumber){
|
function ajaxDerivationRequest(appUid, delIndex, maxLenght, appNumber,fieldGridGral, fieldGridGralVal){
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Authorization': 'Bearer ' + credentials.access_token
|
'Authorization': 'Bearer ' + credentials.access_token
|
||||||
},
|
},
|
||||||
url: urlProxy + 'derivate/' + appUid + '/' + appNumber + '/' + delIndex,
|
url: urlProxy + 'derivate/' + appUid + '/' + appNumber + '/' + delIndex + '/' + fieldGridGral + '/' + fieldGridGralVal,
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
var dataResponse;
|
var dataResponse;
|
||||||
var fullResponseText = response.responseText;
|
var fullResponseText = response.responseText;
|
||||||
@@ -1333,7 +1341,7 @@ function ajaxDerivationRequest(appUid, delIndex, maxLenght, appNumber){
|
|||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fullResponseText.charAt(0) != "<") {
|
if (fullResponseText.charAt(0) != "<" && parent.document.getElementById("batchRoutingCasesNumRec") != null) {
|
||||||
parent.document.getElementById("batchRoutingCasesNumRec").innerHTML = parseInt(dataResponse.casesNumRec);
|
parent.document.getElementById("batchRoutingCasesNumRec").innerHTML = parseInt(dataResponse.casesNumRec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user