HOR-1107: Plugin Custom Cases List Builder y nueva estructura de Base Datos
correccion obervacion CR correcciones CR .
This commit is contained in:
@@ -910,5 +910,65 @@ class PmTable
|
|||||||
$m->execute( $args );
|
$m->execute( $args );
|
||||||
$m->runBuild();
|
$m->runBuild();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function addPMFieldsToList($action)
|
||||||
|
{
|
||||||
|
$conf = new Configurations();
|
||||||
|
$confCasesList = $conf->getConfiguration('casesList', $action);
|
||||||
|
|
||||||
|
if (!class_exists('AdditionalTables')) {
|
||||||
|
require_once ("classes/model/AdditionalTables.php");
|
||||||
|
}
|
||||||
|
|
||||||
|
$oCriteria = new Criteria('workflow');
|
||||||
|
$oCriteria->clearSelectColumns();
|
||||||
|
|
||||||
|
//If there is PMTable for this case list
|
||||||
|
if (is_array($confCasesList) && count($confCasesList) > 0 && isset($confCasesList["PMTable"]) && trim($confCasesList["PMTable"]) != "") {
|
||||||
|
//Getting the table name
|
||||||
|
$additionalTableUid = $confCasesList["PMTable"];
|
||||||
|
|
||||||
|
$additionalTable = AdditionalTablesPeer::retrieveByPK($additionalTableUid);
|
||||||
|
$tableName = $additionalTable->getAddTabName();
|
||||||
|
|
||||||
|
$additionalTable = new AdditionalTables();
|
||||||
|
$tableData = $additionalTable->load($additionalTableUid, true);
|
||||||
|
|
||||||
|
$tableField = array();
|
||||||
|
|
||||||
|
foreach ($tableData["FIELDS"] as $arrayField) {
|
||||||
|
$tableField[] = $arrayField["FLD_NAME"];
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($confCasesList["second"]["data"] as $fieldData) {
|
||||||
|
$fieldData['name'] = ($fieldData['name'] == 'APP_STATUS_LABEL')? 'APP_STATUS' : $fieldData['name'];
|
||||||
|
if (in_array($fieldData["name"], $tableField)) {
|
||||||
|
$fieldTable = $fieldData["name"];
|
||||||
|
$fieldName = $tableName . "." . $fieldTable;
|
||||||
|
$oCriteria->addSelectColumn($fieldName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($action) {
|
||||||
|
case "sent":
|
||||||
|
$listTablePeer = 'ListParticipatedLastPeer';
|
||||||
|
break;
|
||||||
|
case "selfservice":
|
||||||
|
case "unassigned":
|
||||||
|
$listTablePeer = 'ListUnassignedPeer';
|
||||||
|
break;
|
||||||
|
case "paused":
|
||||||
|
$listTablePeer = 'ListPausedPeer';
|
||||||
|
break;
|
||||||
|
case "todo":
|
||||||
|
case 'draft':
|
||||||
|
$listTablePeer = 'ListInboxPeer';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$oCriteria->addJoin($listTablePeer::APP_UID, $tableName.'.APP_UID', Criteria::LEFT_JOIN);
|
||||||
|
}
|
||||||
|
return $oCriteria;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -499,7 +499,8 @@ class ListInbox extends BaseListInbox
|
|||||||
*/
|
*/
|
||||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||||
{
|
{
|
||||||
$criteria = new Criteria();
|
$pmTable = new PmTable();
|
||||||
|
$criteria = $pmTable->addPMFieldsToList('todo');
|
||||||
|
|
||||||
$criteria->addSelectColumn(ListInboxPeer::APP_UID);
|
$criteria->addSelectColumn(ListInboxPeer::APP_UID);
|
||||||
$criteria->addSelectColumn(ListInboxPeer::DEL_INDEX);
|
$criteria->addSelectColumn(ListInboxPeer::DEL_INDEX);
|
||||||
@@ -600,5 +601,6 @@ class ListInbox extends BaseListInbox
|
|||||||
$aRow = $dataset->getRow();
|
$aRow = $dataset->getRow();
|
||||||
return isset($aRow[$fieldName]) ? $aRow[$fieldName] : NULL;
|
return isset($aRow[$fieldName]) ? $aRow[$fieldName] : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -295,8 +295,9 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
|||||||
|
|
||||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||||
{
|
{
|
||||||
$criteria = new Criteria();
|
$pmTable = new PmTable();
|
||||||
|
$criteria = $pmTable->addPMFieldsToList('sent');
|
||||||
|
|
||||||
$criteria->addSelectColumn(ListParticipatedLastPeer::APP_UID);
|
$criteria->addSelectColumn(ListParticipatedLastPeer::APP_UID);
|
||||||
$criteria->addSelectColumn(ListParticipatedLastPeer::DEL_INDEX);
|
$criteria->addSelectColumn(ListParticipatedLastPeer::DEL_INDEX);
|
||||||
$criteria->addSelectColumn(ListParticipatedLastPeer::USR_UID);
|
$criteria->addSelectColumn(ListParticipatedLastPeer::USR_UID);
|
||||||
|
|||||||
@@ -276,7 +276,8 @@ class ListPaused extends BaseListPaused {
|
|||||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||||
{
|
{
|
||||||
$resp = array();
|
$resp = array();
|
||||||
$criteria = new Criteria();
|
$pmTable = new PmTable();
|
||||||
|
$criteria = $pmTable->addPMFieldsToList('paused');
|
||||||
|
|
||||||
$criteria->addSelectColumn(ListPausedPeer::APP_UID);
|
$criteria->addSelectColumn(ListPausedPeer::APP_UID);
|
||||||
$criteria->addSelectColumn(ListPausedPeer::USR_UID);
|
$criteria->addSelectColumn(ListPausedPeer::USR_UID);
|
||||||
|
|||||||
@@ -246,7 +246,8 @@ class ListUnassigned extends BaseListUnassigned
|
|||||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||||
{
|
{
|
||||||
$resp = array();
|
$resp = array();
|
||||||
$criteria = new Criteria();
|
$pmTable = new PmTable();
|
||||||
|
$criteria = $pmTable->addPMFieldsToList('unassigned');
|
||||||
|
|
||||||
$criteria->addSelectColumn(ListUnassignedPeer::APP_UID);
|
$criteria->addSelectColumn(ListUnassignedPeer::APP_UID);
|
||||||
$criteria->addSelectColumn(ListUnassignedPeer::DEL_INDEX);
|
$criteria->addSelectColumn(ListUnassignedPeer::DEL_INDEX);
|
||||||
|
|||||||
@@ -83,11 +83,6 @@ try {
|
|||||||
$generalConfCasesList = array ();
|
$generalConfCasesList = array ();
|
||||||
}
|
}
|
||||||
|
|
||||||
$caseListBuilder = (count($confCasesList)) ? 1 : 0;
|
|
||||||
if ($caseListBuilder) {
|
|
||||||
$urlProxy = 'proxyCasesList';
|
|
||||||
}
|
|
||||||
|
|
||||||
// reassign header configuration
|
// reassign header configuration
|
||||||
$confReassignList = getReassignList();
|
$confReassignList = getReassignList();
|
||||||
|
|
||||||
|
|||||||
@@ -200,4 +200,3 @@ try {
|
|||||||
$msg = array("error" => $e->getMessage());
|
$msg = array("error" => $e->getMessage());
|
||||||
echo G::json_encode($msg);
|
echo G::json_encode($msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user