Correcion de migracion de casos a nuevos listados
This commit is contained in:
@@ -1842,12 +1842,14 @@ class workspaceTools
|
|||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Migrate all cases to New list
|
* Migrate all cases to New list
|
||||||
*
|
*
|
||||||
* return all LIST TABLES with data
|
* return all LIST TABLES with data
|
||||||
*/
|
*/
|
||||||
public function migrateList ($workSpace){
|
public function migrateList ($workSpace)
|
||||||
|
{
|
||||||
$this->initPropel(true);
|
$this->initPropel(true);
|
||||||
$appCache = new AppCacheView();
|
$appCache = new AppCacheView();
|
||||||
G::LoadClass("case");
|
G::LoadClass("case");
|
||||||
@@ -1887,25 +1889,31 @@ class workspaceTools
|
|||||||
|
|
||||||
//Select data TO_DO OR DRAFT
|
//Select data TO_DO OR DRAFT
|
||||||
$inbCriteria = $appCache->getSelAllColumns();
|
$inbCriteria = $appCache->getSelAllColumns();
|
||||||
$inbCriteria->add(AppCacheViewPeer::APP_STATUS, "CANCELLED", CRITERIA::NOT_EQUAL);
|
|
||||||
$rsCriteria = AppCacheViewPeer::doSelectRS($inbCriteria);
|
$rsCriteria = AppCacheViewPeer::doSelectRS($inbCriteria);
|
||||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
//Insert new data LIST_INBOX
|
//Insert new data LIST_INBOX
|
||||||
while ($rsCriteria->next()) {
|
while ($rsCriteria->next()) {
|
||||||
$row = $rsCriteria->getRow();
|
$row = $rsCriteria->getRow();
|
||||||
|
$isSelfService = ($row['USR_UID'] == '') ? true : false;
|
||||||
if($row["DEL_THREAD_STATUS"] == 'OPEN'){
|
if($row["DEL_THREAD_STATUS"] == 'OPEN'){
|
||||||
|
$row["DEL_PREVIOUS_USR_UID"] = $row["PREVIOUS_USR_UID"];
|
||||||
$listInbox = new ListInbox();
|
$listInbox = new ListInbox();
|
||||||
$listInbox->remove($row["APP_UID"],$row["DEL_INDEX"]);
|
$listInbox->remove($row["APP_UID"],$row["DEL_INDEX"]);
|
||||||
$listInbox->setDeleted(false);
|
$listInbox->setDeleted(false);
|
||||||
$listInbox->create($row);
|
$listInbox->create($row, $isSelfService);
|
||||||
} else {
|
} else {
|
||||||
// create participated List when the thread is CLOSED
|
// create participated List when the thread is CLOSED
|
||||||
$listParticipatedHistory = new ListParticipatedHistory();
|
$listParticipatedHistory = new ListParticipatedHistory();
|
||||||
$listParticipatedHistory->remove($row['APP_UID'], $row['DEL_INDEX']);
|
$listParticipatedHistory->remove($row['APP_UID'], $row['DEL_INDEX']);
|
||||||
$listParticipatedHistory = new ListParticipatedHistory();
|
$listParticipatedHistory = new ListParticipatedHistory();
|
||||||
$listParticipatedHistory->create($row);
|
$listParticipatedHistory->create($row);
|
||||||
$listParticipatedLast = new ListParticipatedLast();
|
|
||||||
$listParticipatedLast->remove($row['APP_UID'], $row['USR_UID']);
|
$oCriteria = new Criteria('workflow');
|
||||||
|
$oCriteria->add(ListParticipatedLastPeer::APP_UID, $row['APP_UID']);
|
||||||
|
$oCriteria->add(ListParticipatedLastPeer::USR_UID, $row['USR_UID']);
|
||||||
|
ListParticipatedLastPeer::doDelete($oCriteria);
|
||||||
|
|
||||||
$listParticipatedLast = new ListParticipatedLast();
|
$listParticipatedLast = new ListParticipatedLast();
|
||||||
$listParticipatedLast->create($row);
|
$listParticipatedLast->create($row);
|
||||||
$listParticipatedLast = new ListParticipatedLast();
|
$listParticipatedLast = new ListParticipatedLast();
|
||||||
@@ -1913,6 +1921,7 @@ class workspaceTools
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CLI::logging("> Completed table LIST_INBOX\n");
|
CLI::logging("> Completed table LIST_INBOX\n");
|
||||||
//With this List is populated the LIST_PARTICIPATED_HISTORY and LIST_PARTICIPATED_LAST
|
//With this List is populated the LIST_PARTICIPATED_HISTORY and LIST_PARTICIPATED_LAST
|
||||||
CLI::logging("> Completed table LIST_PARTICIPATED_HISTORY\n");
|
CLI::logging("> Completed table LIST_PARTICIPATED_HISTORY\n");
|
||||||
@@ -1939,7 +1948,13 @@ class workspaceTools
|
|||||||
$delaycriteria->addSelectColumn(AppDelayPeer::PRO_UID);
|
$delaycriteria->addSelectColumn(AppDelayPeer::PRO_UID);
|
||||||
$delaycriteria->addSelectColumn(AppDelayPeer::APP_DEL_INDEX);
|
$delaycriteria->addSelectColumn(AppDelayPeer::APP_DEL_INDEX);
|
||||||
$delaycriteria->addSelectColumn(AppCacheViewPeer::APP_NUMBER);
|
$delaycriteria->addSelectColumn(AppCacheViewPeer::APP_NUMBER);
|
||||||
$delaycriteria->addJoin( AppCacheViewPeer::APP_UID, AppDelayPeer::APP_UID, Criteria::INNER_JOIN );
|
$delaycriteria->addSelectColumn(AppCacheViewPeer::USR_UID);
|
||||||
|
$delaycriteria->addSelectColumn(AppCacheViewPeer::APP_STATUS);
|
||||||
|
$delaycriteria->addSelectColumn(AppCacheViewPeer::TAS_UID);
|
||||||
|
|
||||||
|
$delaycriteria->addJoin( AppCacheViewPeer::APP_UID, AppDelayPeer::APP_UID . ' AND ' . AppCacheViewPeer::DEL_INDEX . ' = ' . AppDelayPeer::APP_DEL_INDEX, Criteria::INNER_JOIN );
|
||||||
|
$delaycriteria->add(AppDelayPeer::APP_DISABLE_ACTION_USER, "0", CRITERIA::EQUAL);
|
||||||
|
$delaycriteria->add(AppDelayPeer::APP_TYPE, "PAUSE", CRITERIA::EQUAL);
|
||||||
$rsCriteria = AppDelayPeer::doSelectRS($delaycriteria);
|
$rsCriteria = AppDelayPeer::doSelectRS($delaycriteria);
|
||||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
//Insert new data LIST_PAUSED
|
//Insert new data LIST_PAUSED
|
||||||
@@ -1948,7 +1963,6 @@ class workspaceTools
|
|||||||
$data = $row;
|
$data = $row;
|
||||||
$data["DEL_INDEX"] = $row["APP_DEL_INDEX"];
|
$data["DEL_INDEX"] = $row["APP_DEL_INDEX"];
|
||||||
$listPaused = new ListPaused();
|
$listPaused = new ListPaused();
|
||||||
$listPaused->remove($data["APP_UID"],$data["DEL_INDEX"]);
|
|
||||||
$listPaused->setDeleted(false);
|
$listPaused->setDeleted(false);
|
||||||
$listPaused->create($data);
|
$listPaused->create($data);
|
||||||
}
|
}
|
||||||
@@ -2006,6 +2020,7 @@ class workspaceTools
|
|||||||
$this->listFirstExecution('insert');
|
$this->listFirstExecution('insert');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function checks if List tables are going to migrated
|
* This function checks if List tables are going to migrated
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -49,8 +49,11 @@ class ListInbox extends BaseListInbox
|
|||||||
|
|
||||||
// remove and create participated last
|
// remove and create participated last
|
||||||
if (!$isSelfService) {
|
if (!$isSelfService) {
|
||||||
$listParticipatedLast = new ListParticipatedLast();
|
$oCriteria = new Criteria('workflow');
|
||||||
$listParticipatedLast->remove($data['APP_UID'], $data['USR_UID']);
|
$oCriteria->add(ListParticipatedLastPeer::APP_UID, $data['APP_UID']);
|
||||||
|
$oCriteria->add(ListParticipatedLastPeer::USR_UID, $data['USR_UID']);
|
||||||
|
ListParticipatedLastPeer::doDelete($oCriteria);
|
||||||
|
|
||||||
$listParticipatedLast = new ListParticipatedLast();
|
$listParticipatedLast = new ListParticipatedLast();
|
||||||
$listParticipatedLast->create($data);
|
$listParticipatedLast->create($data);
|
||||||
$listParticipatedLast = new ListParticipatedLast();
|
$listParticipatedLast = new ListParticipatedLast();
|
||||||
@@ -367,6 +370,11 @@ class ListInbox extends BaseListInbox
|
|||||||
{
|
{
|
||||||
$criteria = new Criteria();
|
$criteria = new Criteria();
|
||||||
$criteria->add( ListInboxPeer::USR_UID, $usr_uid, Criteria::EQUAL );
|
$criteria->add( ListInboxPeer::USR_UID, $usr_uid, Criteria::EQUAL );
|
||||||
|
if ($filters['action'] == 'draft') {
|
||||||
|
$criteria->add( ListInboxPeer::APP_STATUS, 'DRAFT', Criteria::EQUAL );
|
||||||
|
} else {
|
||||||
|
$criteria->add( ListInboxPeer::APP_STATUS, 'TO_DO', Criteria::EQUAL );
|
||||||
|
}
|
||||||
self::loadFilters($criteria, $filters);
|
self::loadFilters($criteria, $filters);
|
||||||
$total = ListInboxPeer::doCount( $criteria );
|
$total = ListInboxPeer::doCount( $criteria );
|
||||||
return (int)$total;
|
return (int)$total;
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ class ListMyInbox extends BaseListMyInbox
|
|||||||
|
|
||||||
if ($data['DEL_INDEX'] == 1 && $data['APP_STATUS'] == 'TO_DO') {
|
if ($data['DEL_INDEX'] == 1 && $data['APP_STATUS'] == 'TO_DO') {
|
||||||
$data['APP_CREATE_DATE'] = $data['APP_UPDATE_DATE'];
|
$data['APP_CREATE_DATE'] = $data['APP_UPDATE_DATE'];
|
||||||
|
$this->remove($data['APP_UID'], $data['USR_UID']);
|
||||||
$this->create($data);
|
$this->create($data);
|
||||||
} else {
|
} else {
|
||||||
unset($data['USR_UID']);
|
unset($data['USR_UID']);
|
||||||
|
|||||||
@@ -143,9 +143,9 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
|||||||
* @throws type
|
* @throws type
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function remove ($app_uid, $usr_uid)
|
public function remove ($app_uid, $usr_uid, $del_index)
|
||||||
{
|
{
|
||||||
$existField = ListParticipatedLastPeer::retrieveByPK($app_uid, $usr_uid);
|
$existField = ListParticipatedLastPeer::retrieveByPK($app_uid, $usr_uid, $del_index);
|
||||||
if (! is_null( $existField )) {
|
if (! is_null( $existField )) {
|
||||||
$users = new Users();
|
$users = new Users();
|
||||||
$users->refreshTotal($usr_uid, 'removed', 'participated');
|
$users->refreshTotal($usr_uid, 'removed', 'participated');
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class ListParticipatedLastMapBuilder
|
|||||||
|
|
||||||
$tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
$tMap->addPrimaryKey('USR_UID', 'UsrUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||||
|
|
||||||
$tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
|
$tMap->addPrimaryKey('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
|
||||||
|
|
||||||
$tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
$tMap->addColumn('TAS_UID', 'TasUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||||
|
|
||||||
|
|||||||
@@ -1686,6 +1686,7 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent
|
|||||||
|
|
||||||
$criteria->add(ListParticipatedLastPeer::APP_UID, $this->app_uid);
|
$criteria->add(ListParticipatedLastPeer::APP_UID, $this->app_uid);
|
||||||
$criteria->add(ListParticipatedLastPeer::USR_UID, $this->usr_uid);
|
$criteria->add(ListParticipatedLastPeer::USR_UID, $this->usr_uid);
|
||||||
|
$criteria->add(ListParticipatedLastPeer::DEL_INDEX, $this->del_index);
|
||||||
|
|
||||||
return $criteria;
|
return $criteria;
|
||||||
}
|
}
|
||||||
@@ -1703,6 +1704,8 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent
|
|||||||
|
|
||||||
$pks[1] = $this->getUsrUid();
|
$pks[1] = $this->getUsrUid();
|
||||||
|
|
||||||
|
$pks[2] = $this->getDelIndex();
|
||||||
|
|
||||||
return $pks;
|
return $pks;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1719,6 +1722,8 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent
|
|||||||
|
|
||||||
$this->setUsrUid($keys[1]);
|
$this->setUsrUid($keys[1]);
|
||||||
|
|
||||||
|
$this->setDelIndex($keys[2]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1734,8 +1739,6 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent
|
|||||||
public function copyInto($copyObj, $deepCopy = false)
|
public function copyInto($copyObj, $deepCopy = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
$copyObj->setDelIndex($this->del_index);
|
|
||||||
|
|
||||||
$copyObj->setTasUid($this->tas_uid);
|
$copyObj->setTasUid($this->tas_uid);
|
||||||
|
|
||||||
$copyObj->setProUid($this->pro_uid);
|
$copyObj->setProUid($this->pro_uid);
|
||||||
@@ -1781,6 +1784,8 @@ abstract class BaseListParticipatedLast extends BaseObject implements Persistent
|
|||||||
|
|
||||||
$copyObj->setUsrUid(''); // this is a pkey column, so set to default value
|
$copyObj->setUsrUid(''); // this is a pkey column, so set to default value
|
||||||
|
|
||||||
|
$copyObj->setDelIndex('0'); // this is a pkey column, so set to default value
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -487,6 +487,9 @@ abstract class BaseListParticipatedLastPeer
|
|||||||
$comparison = $criteria->getComparison(ListParticipatedLastPeer::USR_UID);
|
$comparison = $criteria->getComparison(ListParticipatedLastPeer::USR_UID);
|
||||||
$selectCriteria->add(ListParticipatedLastPeer::USR_UID, $criteria->remove(ListParticipatedLastPeer::USR_UID), $comparison);
|
$selectCriteria->add(ListParticipatedLastPeer::USR_UID, $criteria->remove(ListParticipatedLastPeer::USR_UID), $comparison);
|
||||||
|
|
||||||
|
$comparison = $criteria->getComparison(ListParticipatedLastPeer::DEL_INDEX);
|
||||||
|
$selectCriteria->add(ListParticipatedLastPeer::DEL_INDEX, $criteria->remove(ListParticipatedLastPeer::DEL_INDEX), $comparison);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$criteria = $values->buildCriteria(); // gets full criteria
|
$criteria = $values->buildCriteria(); // gets full criteria
|
||||||
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
||||||
@@ -560,10 +563,12 @@ abstract class BaseListParticipatedLastPeer
|
|||||||
|
|
||||||
$vals[0][] = $value[0];
|
$vals[0][] = $value[0];
|
||||||
$vals[1][] = $value[1];
|
$vals[1][] = $value[1];
|
||||||
|
$vals[2][] = $value[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
$criteria->add(ListParticipatedLastPeer::APP_UID, $vals[0], Criteria::IN);
|
$criteria->add(ListParticipatedLastPeer::APP_UID, $vals[0], Criteria::IN);
|
||||||
$criteria->add(ListParticipatedLastPeer::USR_UID, $vals[1], Criteria::IN);
|
$criteria->add(ListParticipatedLastPeer::USR_UID, $vals[1], Criteria::IN);
|
||||||
|
$criteria->add(ListParticipatedLastPeer::DEL_INDEX, $vals[2], Criteria::IN);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the correct dbName
|
// Set the correct dbName
|
||||||
@@ -626,10 +631,11 @@ abstract class BaseListParticipatedLastPeer
|
|||||||
* Retrieve object using using composite pkey values.
|
* Retrieve object using using composite pkey values.
|
||||||
* @param string $app_uid
|
* @param string $app_uid
|
||||||
* @param string $usr_uid
|
* @param string $usr_uid
|
||||||
|
* @param int $del_index
|
||||||
* @param Connection $con
|
* @param Connection $con
|
||||||
* @return ListParticipatedLast
|
* @return ListParticipatedLast
|
||||||
*/
|
*/
|
||||||
public static function retrieveByPK($app_uid, $usr_uid, $con = null)
|
public static function retrieveByPK($app_uid, $usr_uid, $del_index, $con = null)
|
||||||
{
|
{
|
||||||
if ($con === null) {
|
if ($con === null) {
|
||||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
$con = Propel::getConnection(self::DATABASE_NAME);
|
||||||
@@ -637,6 +643,7 @@ abstract class BaseListParticipatedLastPeer
|
|||||||
$criteria = new Criteria();
|
$criteria = new Criteria();
|
||||||
$criteria->add(ListParticipatedLastPeer::APP_UID, $app_uid);
|
$criteria->add(ListParticipatedLastPeer::APP_UID, $app_uid);
|
||||||
$criteria->add(ListParticipatedLastPeer::USR_UID, $usr_uid);
|
$criteria->add(ListParticipatedLastPeer::USR_UID, $usr_uid);
|
||||||
|
$criteria->add(ListParticipatedLastPeer::DEL_INDEX, $del_index);
|
||||||
$v = ListParticipatedLastPeer::doSelect($criteria, $con);
|
$v = ListParticipatedLastPeer::doSelect($criteria, $con);
|
||||||
|
|
||||||
return !empty($v) ? $v[0] : null;
|
return !empty($v) ? $v[0] : null;
|
||||||
|
|||||||
@@ -4017,7 +4017,7 @@
|
|||||||
</vendor>
|
</vendor>
|
||||||
<column name="APP_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/>
|
<column name="APP_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/>
|
||||||
<column name="USR_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/>
|
<column name="USR_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/>
|
||||||
<column name="DEL_INDEX" type="INTEGER" required="true" default="0"/>
|
<column name="DEL_INDEX" type="INTEGER" required="true" primaryKey="true" default=""/>
|
||||||
<column name="TAS_UID" type="VARCHAR" size="32" required="true" default=""/>
|
<column name="TAS_UID" type="VARCHAR" size="32" required="true" default=""/>
|
||||||
<column name="PRO_UID" type="VARCHAR" size="32" required="true" default=""/>
|
<column name="PRO_UID" type="VARCHAR" size="32" required="true" default=""/>
|
||||||
<column name="APP_NUMBER" type="INTEGER" required="true" default="0"/>
|
<column name="APP_NUMBER" type="INTEGER" required="true" default="0"/>
|
||||||
|
|||||||
@@ -2285,7 +2285,7 @@ CREATE TABLE `LIST_PARTICIPATED_LAST`
|
|||||||
`DEL_DUE_DATE` DATETIME,
|
`DEL_DUE_DATE` DATETIME,
|
||||||
`DEL_PRIORITY` VARCHAR(32) default '3' NOT NULL,
|
`DEL_PRIORITY` VARCHAR(32) default '3' NOT NULL,
|
||||||
`DEL_THREAD_STATUS` VARCHAR(32) default 'OPEN' NOT NULL,
|
`DEL_THREAD_STATUS` VARCHAR(32) default 'OPEN' NOT NULL,
|
||||||
PRIMARY KEY (`APP_UID`,`USR_UID`)
|
PRIMARY KEY (`APP_UID`,`USR_UID`,`DEL_INDEX`)
|
||||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Participated last list';
|
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Participated last list';
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
#-- LIST_COMPLETED
|
#-- LIST_COMPLETED
|
||||||
|
|||||||
@@ -176,6 +176,7 @@ class Lists {
|
|||||||
$filtersData['date_to'] = $filters["dateTo"];
|
$filtersData['date_to'] = $filters["dateTo"];
|
||||||
$response['filters'] = $filtersData;
|
$response['filters'] = $filtersData;
|
||||||
$response['data'] = $result;
|
$response['data'] = $result;
|
||||||
|
$filtersData['action'] = $filters["action"];
|
||||||
$response['totalCount'] = $list->countTotal($userUid, $filtersData);
|
$response['totalCount'] = $list->countTotal($userUid, $filtersData);
|
||||||
} else {
|
} else {
|
||||||
$response = $result;
|
$response = $result;
|
||||||
|
|||||||
Reference in New Issue
Block a user