HOR-4408
This commit is contained in:
@@ -332,7 +332,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
{
|
||||
try {
|
||||
$aData = $this->load($sUID, true);
|
||||
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
@@ -383,7 +383,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$_SESSION["PROCESS"] = $aData['PRO_UID'];
|
||||
}
|
||||
$aData['DBS_UID'] = $aData['DBS_UID'] ? $aData['DBS_UID'] : 'workflow';
|
||||
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
@@ -531,7 +531,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
{
|
||||
try {
|
||||
$aData = $this->load($sUID, true);
|
||||
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
@@ -550,7 +550,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
{
|
||||
try {
|
||||
$aData = $this->load($sUID, true);
|
||||
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
@@ -604,7 +604,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
{
|
||||
try {
|
||||
$aData = $this->load($sUID, true);
|
||||
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
@@ -632,7 +632,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
try {
|
||||
//$sPMUID = $aFields['PM_UNIQUE_ID'];
|
||||
$aData = $this->load($sUID, true);
|
||||
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
@@ -679,7 +679,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
{
|
||||
try {
|
||||
$aData = $this->load($sUID, true);
|
||||
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
|
||||
? $aData['ADD_TAB_CLASS_NAME']
|
||||
: $this->getPHPName($aData['ADD_TAB_NAME']));
|
||||
@@ -1159,7 +1159,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$sClassName = $this->getPHPName($sTableName);
|
||||
}
|
||||
|
||||
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
|
||||
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
|
||||
if (!file_exists($sPath)) {
|
||||
G::mk_dir($sPath);
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ class AddonsStore extends BaseAddonsStore
|
||||
$sStatus = $oDetails->isEnabled() ? G::LoadTranslation('ID_ENABLED') : G::LoadTranslation('ID_DISABLED');
|
||||
|
||||
if ($oDetails->getWorkspaces()) {
|
||||
if (!in_array(SYS_SYS, $oDetails->getWorkspaces())) {
|
||||
if (!in_array(config("system.workspace"), $oDetails->getWorkspaces())) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,50 +448,6 @@ class AppCacheView extends BaseAppCacheView
|
||||
return $this->getUnassigned($userUid, false);
|
||||
}
|
||||
|
||||
public function getProUidSupervisor($userUid)
|
||||
{
|
||||
//finding cases PRO_UID where $userUid is supervising
|
||||
require_once ('classes/model/ProcessUser.php');
|
||||
require_once ('classes/model/GroupUser.php');
|
||||
|
||||
$oCriteria = new Criteria('workflow');
|
||||
|
||||
if (!empty($userUid)) {
|
||||
$oCriteria->add(ProcessUserPeer::USR_UID, $userUid);
|
||||
}
|
||||
|
||||
$oCriteria->add(ProcessUserPeer::PU_TYPE, 'SUPERVISOR');
|
||||
$oDataset = ProcessUserPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$aProcesses = array();
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aProcesses[] = $aRow['PRO_UID'];
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(ProcessUserPeer::PRO_UID);
|
||||
$oCriteria->add(ProcessUserPeer::PU_TYPE, 'GROUP_SUPERVISOR');
|
||||
$oCriteria->addJoin(ProcessUserPeer::USR_UID, GroupUserPeer::GRP_UID, Criteria::LEFT_JOIN);
|
||||
|
||||
if (!empty($userUid)) {
|
||||
$oCriteria->add(GroupUserPeer::USR_UID, $userUid);
|
||||
}
|
||||
|
||||
$oDataset = ProcessUserPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aProcesses[] = $aRow['PRO_UID'];
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
return $aProcesses;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the PAUSED cases list criteria
|
||||
* param $userUid the current userUid
|
||||
@@ -509,7 +465,8 @@ class AppCacheView extends BaseAppCacheView
|
||||
$criteria = $this->addPMFieldsToCriteria('paused');
|
||||
}
|
||||
|
||||
$aProcesses = $this->getProUidSupervisor($userUid);
|
||||
$processUser = new ProcessUser();
|
||||
$listProcess = $processUser->getProUidSupervisor($userUid);
|
||||
|
||||
//add a validation to show the processes of which $userUid is supervisor
|
||||
//$criteria->add(AppCacheViewPeer::USR_UID, $userUid);
|
||||
@@ -517,16 +474,16 @@ class AppCacheView extends BaseAppCacheView
|
||||
if (!empty($userUid)) {
|
||||
$criterionAux = $criteria->getNewCriterion(AppCacheViewPeer::USR_UID, $userUid, Criteria::EQUAL);
|
||||
|
||||
if ($flagSupervisor && !empty($aProcesses)) {
|
||||
if ($flagSupervisor && !empty($listProcess)) {
|
||||
$criterionAux = $criterionAux->addOr(
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::PRO_UID, $aProcesses, Criteria::IN)
|
||||
$criteria->getNewCriterion(AppCacheViewPeer::PRO_UID, $listProcess, Criteria::IN)
|
||||
);
|
||||
}
|
||||
|
||||
$criteria->add($criterionAux);
|
||||
} else {
|
||||
if ($flagSupervisor && !empty($aProcesses)) {
|
||||
$criteria->add(AppCacheViewPeer::PRO_UID, $aProcesses, Criteria::IN);
|
||||
if ($flagSupervisor && !empty($listProcess)) {
|
||||
$criteria->add(AppCacheViewPeer::PRO_UID, $listProcess, Criteria::IN);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -576,7 +533,8 @@ class AppCacheView extends BaseAppCacheView
|
||||
*/
|
||||
public function getToRevise($userUid, $doCount)
|
||||
{
|
||||
$aProcesses = $this->getProUidSupervisor($userUid, $doCount);
|
||||
$processUser = new ProcessUser();
|
||||
$listProcess = $processUser->getProUidSupervisor($userUid);
|
||||
|
||||
if ($doCount && !isset($this->confCasesList['PMTable']) && !empty($this->confCasesList['PMTable'])) {
|
||||
$c = new Criteria('workflow');
|
||||
@@ -584,7 +542,7 @@ class AppCacheView extends BaseAppCacheView
|
||||
$c = $this->addPMFieldsToCriteria('todo');
|
||||
}
|
||||
|
||||
$c->add(AppCacheViewPeer::PRO_UID, $aProcesses, Criteria::IN);
|
||||
$c->add(AppCacheViewPeer::PRO_UID, $listProcess, Criteria::IN);
|
||||
$c->add(AppCacheViewPeer::APP_STATUS, 'TO_DO');
|
||||
$c->add(AppCacheViewPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
|
||||
$c->add(AppCacheViewPeer::APP_THREAD_STATUS, 'OPEN');
|
||||
@@ -1168,9 +1126,10 @@ class AppCacheView extends BaseAppCacheView
|
||||
GLOBAL $RBAC;
|
||||
$aUser = $RBAC->userObj->load( $_SESSION['USER_LOGGED'] );
|
||||
|
||||
$aProcesses = $this->getProUidSupervisor($aUser['USR_UID']);
|
||||
$processUser = new ProcessUser();
|
||||
$listProcess = $processUser->getProUidSupervisor($aUser['USR_UID']);
|
||||
$criteria = $this->getToReassign($userUid, true);
|
||||
$criteria->add(AppCacheViewPeer::PRO_UID, $aProcesses, Criteria::IN);
|
||||
$criteria->add(AppCacheViewPeer::PRO_UID, $listProcess, Criteria::IN);
|
||||
return $criteria;
|
||||
}
|
||||
|
||||
@@ -1183,9 +1142,10 @@ class AppCacheView extends BaseAppCacheView
|
||||
GLOBAL $RBAC;
|
||||
$aUser = $RBAC->userObj->load( $_SESSION['USER_LOGGED'] );
|
||||
|
||||
$aProcesses = $this->getProUidSupervisor($aUser['USR_UID']);
|
||||
$processUser = new ProcessUser();
|
||||
$listProcess = $processUser->getProUidSupervisor($aUser['USR_UID']);
|
||||
$criteria = $this->getToReassign($userUid, false);
|
||||
$criteria->add(AppCacheViewPeer::PRO_UID, $aProcesses, Criteria::IN);
|
||||
$criteria->add(AppCacheViewPeer::PRO_UID, $listProcess, Criteria::IN);
|
||||
return $criteria;
|
||||
}
|
||||
|
||||
@@ -1260,20 +1220,6 @@ class AppCacheView extends BaseAppCacheView
|
||||
}
|
||||
}
|
||||
|
||||
public function setSuperForUser($mysqlUser)
|
||||
{
|
||||
try {
|
||||
$con = Propel::getConnection("root");
|
||||
$stmt = $con->createStatement();
|
||||
$sql = "GRANT SUPER on *.* to '$mysqlUser' ";
|
||||
$rs1 = $stmt->executeQuery($sql, ResultSet::FETCHMODE_NUM);
|
||||
|
||||
return array();
|
||||
} catch (Exception $e) {
|
||||
return array('error' => true, 'msg' => $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* search for table APP_CACHE_VIEW
|
||||
* @return void
|
||||
|
||||
@@ -788,18 +788,26 @@ class AppDelegation extends BaseAppDelegation
|
||||
return $data['TAS_UID'];
|
||||
}
|
||||
|
||||
/**
|
||||
* This function get the current user related to the specific case and index
|
||||
* @param string $appUid, Uid related to the case
|
||||
* @param integer $index, Index to review
|
||||
* @return array
|
||||
*/
|
||||
public function getCurrentUsers($appUid, $index)
|
||||
{
|
||||
$oCriteria = new Criteria();
|
||||
$oCriteria->addSelectColumn( AppDelegationPeer::USR_UID );
|
||||
$oCriteria->add( AppDelegationPeer::APP_UID, $appUid );
|
||||
$oCriteria->add( AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN' );
|
||||
$oCriteria->add( AppDelegationPeer::DEL_INDEX, $index );
|
||||
$oRuleSet = AppDelegationPeer::doSelectRS( $oCriteria );
|
||||
$oRuleSet->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oRuleSet->next();
|
||||
$data = $oRuleSet->getRow();
|
||||
return $data;
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn( AppDelegationPeer::USR_UID );
|
||||
$criteria->add( AppDelegationPeer::APP_UID, $appUid );
|
||||
$criteria->add( AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN' );
|
||||
$criteria->add( AppDelegationPeer::DEL_INDEX, $index );
|
||||
$dataResult = AppDelegationPeer::doSelectRS( $criteria );
|
||||
$dataResult->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
if($dataResult->next()) {
|
||||
return $dataResult->getRow();
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -914,4 +922,37 @@ class AppDelegation extends BaseAppDelegation
|
||||
return $index;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function get the columns by Id indexing
|
||||
*
|
||||
* @param string $appUid
|
||||
* @param integer $delIndex
|
||||
*
|
||||
* @return array|null
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getColumnIds($appUid, $delIndex)
|
||||
{
|
||||
try {
|
||||
$columnsId = [];
|
||||
if ($delIndex > 0) {
|
||||
$row = AppDelegationPeer::retrieveByPK($appUid, $delIndex);
|
||||
if (!is_null($row)) {
|
||||
$fields = $row->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$this->fromArray($fields, BasePeer::TYPE_FIELDNAME);
|
||||
$columnsId['APP_NUMBER'] = $fields['APP_NUMBER'];
|
||||
$columnsId['USR_ID'] = $fields['USR_ID'];
|
||||
$columnsId['TAS_ID'] = $fields['TAS_ID'];
|
||||
$columnsId['PRO_ID'] = $fields['PRO_ID'];
|
||||
return $columnsId;
|
||||
} else {
|
||||
throw (new Exception("The row '" . $appUid . "' , '" . $delIndex . "' in table APP_DELEGATION doesn't exist!"));
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -611,12 +611,16 @@ class AppDocument extends BaseAppDocument
|
||||
$aColumns['PRO_UID'],
|
||||
$appUid,
|
||||
array(),
|
||||
array('INPUT_DOCUMENTS' => 'VIEW')
|
||||
array('INPUT_DOCUMENTS' => 'VIEW', 'ATTACHMENTS' => 'VIEW')
|
||||
);
|
||||
//Has permissions?
|
||||
if (in_array($appDocUid, $userAuthorization['objectPermissions']['INPUT_DOCUMENTS'])) {
|
||||
return true;
|
||||
}
|
||||
//Has permissions?
|
||||
if (in_array($appDocUid, $userAuthorization['objectPermissions']['ATTACHMENTS'])) {
|
||||
return true;
|
||||
}
|
||||
//Is supervisor?
|
||||
if ($userAuthorization['supervisor']) {
|
||||
//Review if the supervisor has assigned the object input document
|
||||
|
||||
@@ -83,7 +83,7 @@ class AppNotes extends BaseAppNotes
|
||||
$oDataset->next();
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$aRow['NOTE_CONTENT'] = htmlentities(stripslashes($aRow['NOTE_CONTENT']), ENT_QUOTES, 'UTF-8');
|
||||
$aRow['NOTE_CONTENT'] = stripslashes($aRow['NOTE_CONTENT']);
|
||||
$response['notes'][] = $aRow;
|
||||
$oDataset->next();
|
||||
}
|
||||
@@ -240,5 +240,21 @@ class AppNotes extends BaseAppNotes
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add htmlEntities to notes in node_content
|
||||
* @param $notes
|
||||
* @return array
|
||||
*/
|
||||
public static function applyHtmlentitiesInNotes($notes)
|
||||
{
|
||||
if (isset($notes) && isset($notes["array"])) {
|
||||
foreach ($notes["array"]["notes"] as &$note) {
|
||||
$note["NOTE_CONTENT"] = htmlentities($note["NOTE_CONTENT"], ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
}
|
||||
return $notes;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -332,7 +332,7 @@ class CaseScheduler extends BaseCaseScheduler
|
||||
}
|
||||
}
|
||||
|
||||
$url = SERVER_NAME . $port . "/sys" . SYS_SYS . "/" . SYS_LANG . "/classic/services/wsdl2";
|
||||
$url = SERVER_NAME . $port . "/sys" . config("system.workspace") . "/" . SYS_LANG . "/classic/services/wsdl2";
|
||||
|
||||
$testConnection = true;
|
||||
try {
|
||||
|
||||
@@ -312,8 +312,11 @@ class Content extends BaseContent
|
||||
*
|
||||
* @param array $langs
|
||||
*/
|
||||
public function regenerateContent ($langs, $workSpace = SYS_SYS)
|
||||
public function regenerateContent ($langs, $workSpace = null)
|
||||
{
|
||||
if ($workSpace === null) {
|
||||
$workSpace = config("system.workspace");
|
||||
}
|
||||
//Search the language
|
||||
$key = array_search( 'en', $langs );
|
||||
if ($key === false) {
|
||||
|
||||
@@ -121,34 +121,31 @@ class Language extends BaseLanguage
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Import a language file
|
||||
*
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmail>
|
||||
* @param string $sLanguageFile
|
||||
* @param string $bXml
|
||||
* @return void
|
||||
* @param string $languageFile
|
||||
* @param bool $updateXml
|
||||
* @param bool $updateDB
|
||||
* @param bool $generateMafe
|
||||
* @return Object
|
||||
* @throws Exception
|
||||
*/
|
||||
public function import ($sLanguageFile, $updateXml = true, $updateDB = true, $generateMafe = true)
|
||||
public function import($languageFile, $updateXml = true, $updateDB = true, $generateMafe = true)
|
||||
{
|
||||
try {
|
||||
|
||||
//get labels MichelangeloFE
|
||||
$translation = new Translation();
|
||||
try {
|
||||
$oTranslation = new Translation();
|
||||
$MichelangeloFE = PATH_HOME . "../workflow/public_html/lib/js";
|
||||
if (file_exists($MichelangeloFE)) {
|
||||
$labels = self::readLabelsDirectory($MichelangeloFE, true);
|
||||
foreach ($labels as $label) {
|
||||
$oTranslation->addTranslation('LABEL', 'ID_MAFE_' . G::encryptOld($label), 'en', $label);
|
||||
}
|
||||
//We get all MichelangeloFE and PMDynaform translatable labels.
|
||||
$labels = array_merge(self::getLabelsMafe(), self::getLabelsPMDynaform());
|
||||
foreach ($labels as $label) {
|
||||
$translation->addTranslation('LABEL', 'ID_MAFE_' . G::encryptOld($label), 'en', $label);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
error_log($e->getMessage());
|
||||
}
|
||||
|
||||
|
||||
$POFile = new i18n_PO( $sLanguageFile );
|
||||
$POFile = new i18n_PO($languageFile);
|
||||
$POFile->readInit();
|
||||
$POHeaders = $POFile->getHeaders();
|
||||
|
||||
@@ -156,13 +153,13 @@ class Language extends BaseLanguage
|
||||
$langName = $POHeaders['X-Poedit-Language'];
|
||||
//find the lang id
|
||||
$language = new Language();
|
||||
$langRecord = $language->findByLanName( $langName );
|
||||
$langRecord = $language->findByLanName($langName);
|
||||
|
||||
if (! isset( $langRecord['LAN_ID'] )) {
|
||||
$langRecord = $language->findById( $langName );
|
||||
if (! isset( $langRecord['LAN_ID'] )) {
|
||||
if (!isset($langRecord['LAN_ID'])) {
|
||||
$langRecord = $language->findById($langName);
|
||||
if (!isset($langRecord['LAN_ID'])) {
|
||||
//if the language doesn't exist abort
|
||||
throw new Exception( 'The .po file has a invalid X-Poedit-Language definition!' );
|
||||
throw new Exception('The .po file has a invalid X-Poedit-Language definition!');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,11 +169,11 @@ class Language extends BaseLanguage
|
||||
$countryName = $POHeaders['X-Poedit-Country'];
|
||||
if ($countryName != '.') {
|
||||
$isoCountry = new IsoCountry();
|
||||
$countryRecord = $isoCountry->findByIcName( $countryName );
|
||||
$countryRecord = $isoCountry->findByIcName($countryName);
|
||||
|
||||
if (! isset( $countryRecord['IC_UID'] )) {
|
||||
if (!isset($countryRecord['IC_UID'])) {
|
||||
//if the language doesn't exist abort
|
||||
throw new Exception( 'The .po file has a invalid X-Poedit-Country definition!' );
|
||||
throw new Exception('The .po file has a invalid X-Poedit-Country definition!');
|
||||
}
|
||||
|
||||
$countryID = $countryRecord['IC_UID'];
|
||||
@@ -186,23 +183,22 @@ class Language extends BaseLanguage
|
||||
$LOCALE = $languageID;
|
||||
}
|
||||
|
||||
$oTranslation = new Translation();
|
||||
$countItems = 0;
|
||||
$countItemsSuccess = 0;
|
||||
$errorMsg = '';
|
||||
|
||||
while ($rowTranslation = $POFile->getTranslation()) {
|
||||
$countItems ++;
|
||||
if (! isset( $POFile->translatorComments[0] ) || ! isset( $POFile->translatorComments[1] ) || ! isset( $POFile->references[0] )) {
|
||||
throw new Exception( 'The .po file doesn\'t have valid directives for Processmaker!' );
|
||||
$countItems++;
|
||||
if (!isset($POFile->translatorComments[0]) || !isset($POFile->translatorComments[1]) || !isset($POFile->references[0])) {
|
||||
throw new Exception('The .po file doesn\'t have valid directives for Processmaker!');
|
||||
}
|
||||
|
||||
foreach ($POFile->translatorComments as $a => $aux) {
|
||||
$aux = trim( $aux );
|
||||
$aux = trim($aux);
|
||||
if ($aux == 'TRANSLATION') {
|
||||
$identifier = $aux;
|
||||
} else {
|
||||
$var = explode( '/', $aux );
|
||||
$var = explode('/', $aux);
|
||||
if ($var[0] == 'LABEL') {
|
||||
$context = $aux;
|
||||
}
|
||||
@@ -210,10 +206,10 @@ class Language extends BaseLanguage
|
||||
$context = $aux;
|
||||
}
|
||||
}
|
||||
if (preg_match( '/^([\w-]+)\/([\w-]+\/*[\w-]*\.xml\?)/', $aux, $match )) {
|
||||
if (preg_match('/^([\w-]+)\/([\w-]+\/*[\w-]*\.xml\?)/', $aux, $match)) {
|
||||
$identifier = $aux;
|
||||
} else {
|
||||
if (preg_match( '/^([\w-]+)\/([\w-]+\/*[\w-]*\.xml$)/', $aux, $match )) {
|
||||
if (preg_match('/^([\w-]+)\/([\w-]+\/*[\w-]*\.xml$)/', $aux, $match)) {
|
||||
$context = $aux;
|
||||
}
|
||||
}
|
||||
@@ -224,10 +220,10 @@ class Language extends BaseLanguage
|
||||
// it is a Sql insert on TRANSLATIONS TAble
|
||||
if ($identifier == 'TRANSLATION') {
|
||||
if ($updateDB) {
|
||||
list ($category, $id) = explode( '/', $context );
|
||||
$result = $oTranslation->addTranslation( $category, $id, $LOCALE, trim( stripcslashes( str_replace( chr( 10 ), '', $rowTranslation['msgstr'] ) ) ) );
|
||||
list ($category, $id) = explode('/', $context);
|
||||
$result = $translation->addTranslation($category, $id, $LOCALE, trim(stripcslashes(str_replace(chr(10), '', $rowTranslation['msgstr']))));
|
||||
if ($result['codError'] == 0) {
|
||||
$countItemsSuccess ++;
|
||||
$countItemsSuccess++;
|
||||
} else {
|
||||
$errorMsg .= $id . ': ' . $result['message'] . "\n";
|
||||
}
|
||||
@@ -236,52 +232,52 @@ class Language extends BaseLanguage
|
||||
elseif ($updateXml) {
|
||||
$xmlForm = $context;
|
||||
//erik: expresion to prevent and hable correctly dropdown values like -1, -2 etc.
|
||||
preg_match( '/^([\w_]+)\s-\s([\w_]+)\s*-*\s*([\w\W]*)$/', $reference, $match );
|
||||
preg_match('/^([\w_]+)\s-\s([\w_]+)\s*-*\s*([\w\W]*)$/', $reference, $match);
|
||||
|
||||
if (! file_exists( PATH_XMLFORM . $xmlForm )) {
|
||||
if (!file_exists(PATH_XMLFORM . $xmlForm)) {
|
||||
$errorMsg .= 'file doesn\'t exist: ' . PATH_XMLFORM . $xmlForm . "\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (count( $match ) < 4) {
|
||||
$near = isset( $rowTranslation['msgid'] ) ? $rowTranslation['msgid'] : (isset( $rowTranslation['msgstr'] ) ? $rowTranslation['msgstr'] : '');
|
||||
if (count($match) < 4) {
|
||||
$near = isset($rowTranslation['msgid']) ? $rowTranslation['msgid'] : (isset($rowTranslation['msgstr']) ? $rowTranslation['msgstr'] : '');
|
||||
$errorMsg .= "Invalid Translation reference: \"$reference\", near -> " . strip_tags($near) . "\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$dynaform = new DynaformHandler( PATH_XMLFORM . $xmlForm );
|
||||
$dynaform = new DynaformHandler(PATH_XMLFORM . $xmlForm);
|
||||
$fieldName = $match[2];
|
||||
|
||||
$codes = explode( '-', $reference );
|
||||
$codes = explode('-', $reference);
|
||||
|
||||
if (sizeof( $codes ) == 2) {
|
||||
if (sizeof($codes) == 2) {
|
||||
//is a normal node
|
||||
$dynaform->addChilds( $fieldName, Array ($LOCALE => stripcslashes( str_replace( chr( 10 ), '', $rowTranslation['msgstr'] ) )
|
||||
) );
|
||||
} elseif (sizeof( $codes ) > 2) {
|
||||
$dynaform->addChilds($fieldName, Array($LOCALE => stripcslashes(str_replace(chr(10), '', $rowTranslation['msgstr']))
|
||||
));
|
||||
} elseif (sizeof($codes) > 2) {
|
||||
//is a node child for a language node
|
||||
$name = $match[3] == "''" ? '' : $match[3];
|
||||
$childNode = Array (Array ('name' => 'option','value' => $rowTranslation['msgstr'],'attributes' => Array ('name' => $name
|
||||
$childNode = Array(Array('name' => 'option', 'value' => $rowTranslation['msgstr'], 'attributes' => Array('name' => $name
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$dynaform->addChilds( $fieldName, Array ($LOCALE => null
|
||||
), $childNode );
|
||||
$dynaform->addChilds($fieldName, Array($LOCALE => null
|
||||
), $childNode);
|
||||
}
|
||||
$countItemsSuccess ++;
|
||||
$countItemsSuccess++;
|
||||
}
|
||||
}
|
||||
|
||||
$oLanguage = new Language();
|
||||
$oLanguage->update( array ('LAN_ID' => $languageID,'LAN_ENABLED' => '1'
|
||||
) );
|
||||
$language = new Language();
|
||||
$language->update(array('LAN_ID' => $languageID, 'LAN_ENABLED' => '1'
|
||||
));
|
||||
|
||||
if ($updateXml) {
|
||||
$trn = new Translation();
|
||||
$trn->generateFileTranslation( $LOCALE );
|
||||
$trn->addTranslationEnvironment( $LOCALE, $POHeaders, $countItemsSuccess );
|
||||
$trn->generateFileTranslation($LOCALE);
|
||||
$trn->addTranslationEnvironment($LOCALE, $POHeaders, $countItemsSuccess);
|
||||
}
|
||||
|
||||
if ($generateMafe) {
|
||||
@@ -297,26 +293,26 @@ class Language extends BaseLanguage
|
||||
$results->headers = $POHeaders;
|
||||
$results->errMsg = $errorMsg;
|
||||
|
||||
G::auditLog("UploadLanguage", "Language: ".$languageID);
|
||||
G::auditLog("UploadLanguage", "Language: " . $languageID);
|
||||
|
||||
return $results;
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
} catch (Exception $error) {
|
||||
throw ($error);
|
||||
}
|
||||
}
|
||||
|
||||
//export
|
||||
/**
|
||||
* Export language to Download
|
||||
* @throws Exception
|
||||
*/
|
||||
public function export ()
|
||||
{
|
||||
//get labels MichelangeloFE
|
||||
$translation = new Translation();
|
||||
try {
|
||||
$oTranslation = new Translation();
|
||||
$MichelangeloFE = PATH_HOME . "../workflow/public_html/lib/js";
|
||||
if (file_exists($MichelangeloFE)) {
|
||||
$labels = self::readLabelsDirectory($MichelangeloFE, true);
|
||||
foreach ($labels as $label) {
|
||||
$oTranslation->addTranslation('LABEL', 'ID_MAFE_' . G::encryptOld($label), 'en', $label);
|
||||
}
|
||||
//We get all MichelangeloFE and PMDynaform translatable labels.
|
||||
$labels = array_merge(self::getLabelsMafe(), self::getLabelsPMDynaform());
|
||||
foreach ($labels as $label) {
|
||||
$translation->addTranslation('LABEL', 'ID_MAFE_' . G::encryptOld($label), 'en', $label);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
error_log($e->getMessage());
|
||||
@@ -412,8 +408,7 @@ class Language extends BaseLanguage
|
||||
|
||||
// IF the translations id "TRN_ID" has invalid characteres or has not accepted categories
|
||||
if ($sTestResult[0] !== $trnCategory || ($trnCategory != 'LABEL' && $trnCategory != 'JAVASCRIPT')) {
|
||||
$oTranslation = new Translation();
|
||||
$oTranslation->remove( $aRow1['TRN_CATEGORY'], $aRow1['TRN_ID'], 'en' ); //remove not accepted translations
|
||||
$translation->remove( $aRow1['TRN_CATEGORY'], $aRow1['TRN_ID'], 'en' ); //remove not accepted translations
|
||||
continue; //jump to next iteration
|
||||
}
|
||||
|
||||
@@ -561,6 +556,67 @@ class Language extends BaseLanguage
|
||||
G::auditLog("ExportLanguage", "Language: ".$_GET['LOCALE']);
|
||||
G::streamFile( $sPOFile, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Labels MAFE (Michelangelo Project)
|
||||
* @return array
|
||||
*/
|
||||
public static function getLabelsMafe()
|
||||
{
|
||||
$labels = [];
|
||||
$buildhash = PATH_HTML . "lib/buildhash";
|
||||
if (!file_exists($buildhash)) {
|
||||
throw new RuntimeException("Unable to generate labels for MAFE!.\nMissing file '{$buildhash}'.");
|
||||
}
|
||||
$buildhash = file_get_contents($buildhash);
|
||||
|
||||
$michelangeloFE = PATH_HTML . "lib/js";
|
||||
$pathFileMafe = array_pop(glob($michelangeloFE . '/' . '*' . $buildhash . '*', GLOB_BRACE));
|
||||
if (file_exists($pathFileMafe) && is_readable($pathFileMafe)) {
|
||||
$labels = self::readLabelsDirectory($pathFileMafe, true);
|
||||
}
|
||||
return $labels;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Labels PMDynaform (PMDynaform Project)
|
||||
* @return array
|
||||
*/
|
||||
public static function getLabelsPMDynaform()
|
||||
{
|
||||
$labels = [];
|
||||
$pathFilePMDynaform = PATH_HTML . "lib/pmdynaform/build/js/PMDynaform.js";
|
||||
if (file_exists($pathFilePMDynaform) && is_readable($pathFilePMDynaform)) {
|
||||
$labels = self::readLabelsDirectory($pathFilePMDynaform, true);
|
||||
}
|
||||
return $labels;
|
||||
}
|
||||
|
||||
/**
|
||||
* We read all labels
|
||||
* @param $path
|
||||
* @param bool $unique
|
||||
* @return array
|
||||
*/
|
||||
public static function readLabelsDirectory($path, $unique = false)
|
||||
{
|
||||
$labels = [];
|
||||
if (is_file($path)) {
|
||||
$info = pathinfo($path);
|
||||
if (strtolower($info["extension"]) === "js") {
|
||||
$file = file_get_contents($path);
|
||||
//search string 'xx\'xx\'xx'.translate()
|
||||
$labels = array_merge($labels, self::readLabelsFile($file, "'"));
|
||||
//search string "xx\"xx\"xx".translate()
|
||||
$labels = array_merge($labels, self::readLabelsFile($file, "\""));
|
||||
}
|
||||
}
|
||||
if ($unique) {
|
||||
$labels = array_unique($labels);
|
||||
}
|
||||
return $labels;
|
||||
}
|
||||
|
||||
public function updateLanguagePlugin ($plugin, $idLanguage)
|
||||
{
|
||||
if (!file_exists(PATH_PLUGINS . $plugin)) {
|
||||
@@ -835,33 +891,6 @@ class Language extends BaseLanguage
|
||||
} //end foreach
|
||||
}
|
||||
}
|
||||
|
||||
public static function readLabelsDirectory($path, $unique = false)
|
||||
{
|
||||
$labels = array();
|
||||
$items = opendir($path);
|
||||
while (false !== ($item = readdir($items))) {
|
||||
$a = $path . "/" . $item;
|
||||
if ($item !== "." && $item !== ".." && is_dir($a)) {
|
||||
$labels = array_merge($labels, self::readLabelsDirectory($a, false));
|
||||
}
|
||||
if (is_file($a)) {
|
||||
$info = pathinfo($a);
|
||||
if ($info["extension"] === "js" || $info["extension"] === "JS") {
|
||||
$file = file_get_contents($a);
|
||||
//search string 'xx\'xx\'xx'.translate()
|
||||
$labels = array_merge($labels, self::readLabelsFile($file, "'"));
|
||||
//search string "xx\"xx\"xx".translate()
|
||||
$labels = array_merge($labels, self::readLabelsFile($file, "\""));
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($unique) {
|
||||
$labels = array_unique($labels);
|
||||
}
|
||||
closedir($items);
|
||||
return $labels;
|
||||
}
|
||||
|
||||
public static function readLabelsFile($file, $sep)
|
||||
{
|
||||
|
||||
77
workflow/engine/classes/model/ListBaseTrait.php
Normal file
77
workflow/engine/classes/model/ListBaseTrait.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* List basic methods
|
||||
*
|
||||
*/
|
||||
trait ListBaseTrait
|
||||
{
|
||||
private $additionalClassName = '';
|
||||
private $userDisplayFormat = '';
|
||||
|
||||
/**
|
||||
* Get the $additionalClassName value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAdditionalClassName()
|
||||
{
|
||||
return $this->additionalClassName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of $additionalClassName.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setAdditionalClassName($v)
|
||||
{
|
||||
$this->additionalClassName = $v;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the $userDisplayFormat value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUserDisplayFormat()
|
||||
{
|
||||
return $this->userDisplayFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of $userDisplayFormat.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setUserDisplayFormat($v)
|
||||
{
|
||||
$this->userDisplayFormat = $v;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of cases by class and user.
|
||||
*
|
||||
* @param type $peerClass
|
||||
* @param type $usrUid
|
||||
* @param type $filters
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
protected function getCountListFromPeer($peerClass, $usrUid, $filters = [])
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
||||
$criteria->add($peerClass::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
if (count($filters)) {
|
||||
self::loadFilters($criteria, $filters);
|
||||
}
|
||||
$dataset = $peerClass::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$row = $dataset->getRow();
|
||||
return (int) $row['TOTAL'];
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,10 @@ require_once 'classes/model/om/BaseListCanceled.php';
|
||||
* @package classes.model
|
||||
*/
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListCanceled extends BaseListCanceled
|
||||
class ListCanceled extends BaseListCanceled implements ListInterface
|
||||
{
|
||||
use ListBaseTrait;
|
||||
|
||||
// @codingStandardsIgnoreEnd
|
||||
/**
|
||||
* Create List Canceled Table
|
||||
@@ -283,7 +285,7 @@ class ListCanceled extends BaseListCanceled
|
||||
}
|
||||
}
|
||||
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||
public function loadList($usr_uid, $filters = array(), callable $callbackRecord = null)
|
||||
{
|
||||
$resp = array();
|
||||
$criteria = new Criteria();
|
||||
@@ -346,16 +348,7 @@ class ListCanceled extends BaseListCanceled
|
||||
*/
|
||||
public function getCountList($usrUid, $filters = array())
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
||||
$criteria->add(ListCanceledPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
if (count($filters)) {
|
||||
self::loadFilters($criteria, $filters);
|
||||
}
|
||||
$dataset = ListCanceledPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
return (int)$aRow['TOTAL'];
|
||||
return $this->getCountListFromPeer
|
||||
(ListCanceledPeer::class, $usrUid, $filters);
|
||||
}
|
||||
} // ListCanceled
|
||||
|
||||
@@ -15,8 +15,10 @@ require_once 'classes/model/om/BaseListCompleted.php';
|
||||
* @package classes.model
|
||||
*/
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListCompleted extends BaseListCompleted
|
||||
class ListCompleted extends BaseListCompleted implements ListInterface
|
||||
{
|
||||
use ListBaseTrait;
|
||||
|
||||
// @codingStandardsIgnoreEnd
|
||||
/**
|
||||
* Create List Completed Table
|
||||
@@ -271,7 +273,7 @@ class ListCompleted extends BaseListCompleted
|
||||
}
|
||||
}
|
||||
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||
public function loadList($usr_uid, $filters = array(), callable $callbackRecord = null)
|
||||
{
|
||||
$resp = array();
|
||||
$criteria = new Criteria();
|
||||
@@ -324,23 +326,16 @@ class ListCompleted extends BaseListCompleted
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of cases of a user
|
||||
* Returns the number of cases of a user.
|
||||
*
|
||||
* @param $usrUid
|
||||
* @param array $filters
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCountList($usrUid, $filters = array())
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
||||
$criteria->add(ListCompletedPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
if (count($filters)) {
|
||||
self::loadFilters($criteria, $filters);
|
||||
}
|
||||
$dataset = ListCompletedPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
return (int)$aRow['TOTAL'];
|
||||
return $this->getCountListFromPeer
|
||||
(ListCompletedPeer::class, $usrUid, $filters);
|
||||
}
|
||||
} // ListCompleted
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
require_once 'classes/model/om/BaseListInbox.php';
|
||||
use ProcessMaker\BusinessModel\Cases as BmCases;
|
||||
use ProcessMaker\BusinessModel\User as BmUser;
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'LIST_INBOX' table.
|
||||
@@ -13,17 +15,17 @@ require_once 'classes/model/om/BaseListInbox.php';
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListInbox extends BaseListInbox
|
||||
|
||||
class ListInbox extends BaseListInbox implements ListInterface
|
||||
{
|
||||
private $additionalClassName = '';
|
||||
use ListBaseTrait;
|
||||
|
||||
/**
|
||||
* Create List Inbox Table
|
||||
*
|
||||
* @param type $data
|
||||
* @return type
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create($data, $isSelfService = false)
|
||||
{
|
||||
@@ -115,7 +117,7 @@ class ListInbox extends BaseListInbox
|
||||
*
|
||||
* @param type $data
|
||||
* @return type
|
||||
* @throws type
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update($data, $isSelfService = false)
|
||||
{
|
||||
@@ -209,7 +211,7 @@ class ListInbox extends BaseListInbox
|
||||
*
|
||||
* @param type $seqName
|
||||
* @return type
|
||||
* @throws type
|
||||
* @throws Exception
|
||||
*
|
||||
*/
|
||||
public function remove($app_uid, $del_index)
|
||||
@@ -233,7 +235,7 @@ class ListInbox extends BaseListInbox
|
||||
*
|
||||
* @param type $seqName
|
||||
* @return type
|
||||
* @throws type
|
||||
* @throws Exception
|
||||
*
|
||||
*/
|
||||
public function removeAll($app_uid)
|
||||
@@ -416,12 +418,24 @@ class ListInbox extends BaseListInbox
|
||||
break;
|
||||
case 'to_revise':
|
||||
$criteria->add(ListInboxPeer::APP_STATUS, 'TO_DO', Criteria::EQUAL);
|
||||
$oAppCache = new AppCacheView();
|
||||
$aProcesses = $oAppCache->getProUidSupervisor($usrUid);
|
||||
$criteria->add(ListInboxPeer::PRO_UID, $aProcesses, Criteria::IN);
|
||||
$processUser = new ProcessUser();
|
||||
$listProcess = $processUser->getProUidSupervisor($usrUid);
|
||||
$criteria->add(ListInboxPeer::PRO_UID, $listProcess, Criteria::IN);
|
||||
break;
|
||||
case 'to_reassign':
|
||||
global $RBAC;
|
||||
$criteria->add(ListInboxPeer::APP_STATUS, 'TO_DO', Criteria::EQUAL);
|
||||
$user = new BmUser();
|
||||
$listProcess = $user->getProcessToReassign(['PM_REASSIGNCASE','PM_REASSIGNCASE_SUPERVISOR']);
|
||||
|
||||
//If is not a supervisor and does not have the permission for view all cases we can not list cases
|
||||
//If is a supervisor, we can list only his processes
|
||||
if (
|
||||
(empty($listProcess) && $RBAC->userCanAccess('PM_REASSIGNCASE') !== 1) ||
|
||||
(is_array($listProcess) && count($listProcess) > 0)
|
||||
) {
|
||||
$criteria->add(ListInboxPeer::PRO_UID, $listProcess, Criteria::IN);
|
||||
}
|
||||
if ($usrUid !== '') {
|
||||
$criteria->add(ListInboxPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
}
|
||||
@@ -478,8 +492,14 @@ class ListInbox extends BaseListInbox
|
||||
$criteria->add(ListInboxPeer::APP_UID, $search, Criteria::EQUAL);
|
||||
} else {
|
||||
//If we have additional tables configured in the custom cases list, prepare the variables for search
|
||||
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
||||
$casesList->getSearchCriteriaListCases($criteria, __CLASS__ . 'Peer', $search, $this->additionalClassName, $additionalColumns);
|
||||
$casesList = new BmCases();
|
||||
$casesList->getSearchCriteriaListCases(
|
||||
$criteria,
|
||||
__CLASS__ . 'Peer',
|
||||
$search,
|
||||
$this->getAdditionalClassName(),
|
||||
$additionalColumns
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -515,16 +535,16 @@ class ListInbox extends BaseListInbox
|
||||
* This function get the information in the corresponding cases list
|
||||
* @param string $usr_uid, must be show cases related to this user
|
||||
* @param array $filters for apply in the result
|
||||
* @param null $callbackRecord
|
||||
* @param callable $callbackRecord
|
||||
* @return array $data
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||
public function loadList($usr_uid, $filters = array(), callable $callbackRecord = null)
|
||||
{
|
||||
$pmTable = new PmTable();
|
||||
$list = isset($filters['action']) ? $filters['action'] : "";
|
||||
$criteria = $pmTable->addPMFieldsToList($list);
|
||||
$this->additionalClassName = $pmTable->tableClassName;
|
||||
$this->setAdditionalClassName($pmTable->tableClassName);
|
||||
$additionalColumns = $criteria->getSelectColumns();
|
||||
$filters['usr_uid'] = $usr_uid;
|
||||
|
||||
@@ -556,14 +576,16 @@ class ListInbox extends BaseListInbox
|
||||
self::loadFilters($criteria, $filters, $additionalColumns);
|
||||
|
||||
//We will be defined the sort
|
||||
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
||||
$casesList = new BmCases();
|
||||
|
||||
$sort = $casesList->getSortColumn(
|
||||
__CLASS__ . 'Peer',
|
||||
BasePeer::TYPE_FIELDNAME,
|
||||
empty($filters['sort']) ? "APP_UPDATE_DATE" : $filters['sort'],
|
||||
"APP_UPDATE_DATE",
|
||||
$this->additionalClassName,
|
||||
$additionalColumns
|
||||
$this->getAdditionalClassName(),
|
||||
$additionalColumns,
|
||||
$this->getUserDisplayFormat()
|
||||
);
|
||||
|
||||
$dir = isset($filters['dir']) ? $filters['dir'] : "ASC";
|
||||
@@ -571,10 +593,20 @@ class ListInbox extends BaseListInbox
|
||||
$limit = isset($filters['limit']) ? $filters['limit'] : "25";
|
||||
$paged = isset($filters['paged']) ? $filters['paged'] : 1;
|
||||
|
||||
if ($dir == "DESC") {
|
||||
$criteria->addDescendingOrderByColumn($sort);
|
||||
if (is_array($sort) && count($sort) > 0) {
|
||||
foreach ($sort as $key) {
|
||||
if ($dir == 'DESC') {
|
||||
$criteria->addDescendingOrderByColumn($key);
|
||||
} else {
|
||||
$criteria->addAscendingOrderByColumn($key);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$criteria->addAscendingOrderByColumn($sort);
|
||||
if ($dir == 'DESC') {
|
||||
$criteria->addDescendingOrderByColumn($sort);
|
||||
} else {
|
||||
$criteria->addAscendingOrderByColumn($sort);
|
||||
}
|
||||
}
|
||||
|
||||
if ($paged == 1) {
|
||||
@@ -598,6 +630,15 @@ class ListInbox extends BaseListInbox
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function get the TAS_PRIORITY_VARIABLE related to the task
|
||||
*
|
||||
* @param string $taskUid
|
||||
* @param string $proUid
|
||||
* @param string $appUid
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getTaskPriority($taskUid, $proUid, $appUid)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
@@ -620,6 +661,14 @@ class ListInbox extends BaseListInbox
|
||||
return $priority != "" ? $priority : 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function get the TAS_PRIORITY_VARIABLE related to the task
|
||||
*
|
||||
* @param array $filters
|
||||
* @param string $fieldName
|
||||
*
|
||||
* @return mixed null|string
|
||||
*/
|
||||
public function getAppDelegationInfo($filters, $fieldName)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
@@ -636,8 +685,10 @@ class ListInbox extends BaseListInbox
|
||||
|
||||
/**
|
||||
* Returns the number of cases of a user
|
||||
*
|
||||
* @param string $usrUid
|
||||
* @param array $filters
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCountList($usrUid, $filters = array())
|
||||
@@ -645,14 +696,13 @@ class ListInbox extends BaseListInbox
|
||||
$filters['usr_uid'] = $usrUid;
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
||||
$criteria->add(ListInboxPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
if (count($filters)) {
|
||||
self::loadFilters($criteria, $filters);
|
||||
}
|
||||
|
||||
//The function loadFilters will add some condition in the query
|
||||
$this->loadFilters($criteria, $filters);
|
||||
$dataset = ListInboxPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
return (int)$aRow['TOTAL'];
|
||||
$row = $dataset->getRow();
|
||||
return (int) $row['TOTAL'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,10 @@ require_once 'classes/model/om/BaseListMyInbox.php';
|
||||
* @package classes.model
|
||||
*/
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListMyInbox extends BaseListMyInbox
|
||||
class ListMyInbox extends BaseListMyInbox implements ListInterface
|
||||
{
|
||||
use ListBaseTrait;
|
||||
|
||||
// @codingStandardsIgnoreEnd
|
||||
/**
|
||||
* Create List My Inbox Table
|
||||
@@ -248,7 +250,7 @@ class ListMyInbox extends BaseListMyInbox
|
||||
}
|
||||
}
|
||||
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||
public function loadList($usr_uid, $filters = array(), callable $callbackRecord = null)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
|
||||
|
||||
@@ -15,8 +15,10 @@ require_once 'classes/model/om/BaseListParticipatedHistory.php';
|
||||
* @package classes.model
|
||||
*/
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListParticipatedHistory extends BaseListParticipatedHistory
|
||||
class ListParticipatedHistory extends BaseListParticipatedHistory implements ListInterface
|
||||
{
|
||||
use ListBaseTrait;
|
||||
|
||||
// @codingStandardsIgnoreEnd
|
||||
/**
|
||||
* Create List Participated History Table
|
||||
@@ -203,7 +205,7 @@ class ListParticipatedHistory extends BaseListParticipatedHistory
|
||||
}
|
||||
}
|
||||
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||
public function loadList($usr_uid, $filters = array(), callable $callbackRecord = null)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
// @codingStandardsIgnoreStart
|
||||
require_once 'classes/model/om/BaseListParticipatedLast.php';
|
||||
use ProcessMaker\BusinessModel\Cases as BmCases;
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'LIST_PARTICIPATED_LAST' table.
|
||||
@@ -12,9 +12,9 @@ require_once 'classes/model/om/BaseListParticipatedLast.php';
|
||||
* application requirements. This class will only be generated as
|
||||
* long as it does not already exist in the output directory.
|
||||
*/
|
||||
class ListParticipatedLast extends BaseListParticipatedLast
|
||||
class ListParticipatedLast extends BaseListParticipatedLast implements ListInterface
|
||||
{
|
||||
private $additionalClassName = '';
|
||||
use ListBaseTrait;
|
||||
|
||||
/**
|
||||
* Create List Participated History Table.
|
||||
@@ -22,6 +22,7 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
* @param type $data
|
||||
*
|
||||
* @return type
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create($data)
|
||||
{
|
||||
@@ -142,7 +143,7 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
*
|
||||
* @return type
|
||||
*
|
||||
* @throws type
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update($data)
|
||||
{
|
||||
@@ -180,11 +181,12 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
/**
|
||||
* Refresh List Participated Last.
|
||||
*
|
||||
* @param type $seqName
|
||||
* @param array $data
|
||||
* @param boolean $isSelfService
|
||||
*
|
||||
* @return type
|
||||
*
|
||||
* @throws type
|
||||
* @throws Exception
|
||||
*/
|
||||
public function refresh($data, $isSelfService = false)
|
||||
{
|
||||
@@ -235,11 +237,13 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
/**
|
||||
* Remove List Participated History.
|
||||
*
|
||||
* @param type $seqName
|
||||
* @param string $app_uid
|
||||
* @param string $usr_uid
|
||||
* @param integer $del_index
|
||||
*
|
||||
* @return type
|
||||
*
|
||||
* @throws type
|
||||
* @throws Exception
|
||||
*/
|
||||
public function remove($app_uid, $usr_uid, $del_index)
|
||||
{
|
||||
@@ -319,8 +323,14 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
$criteria->add(ListParticipatedLastPeer::APP_UID, $search, Criteria::EQUAL);
|
||||
} else {
|
||||
//If we have additional tables configured in the custom cases list, prepare the variables for search
|
||||
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
||||
$casesList->getSearchCriteriaListCases($criteria, __CLASS__ . 'Peer', $search, $this->additionalClassName, $additionalColumns);
|
||||
$casesList = new BmCases();
|
||||
$casesList->getSearchCriteriaListCases(
|
||||
$criteria,
|
||||
__CLASS__ . 'Peer',
|
||||
$search,
|
||||
$this->getAdditionalClassName(),
|
||||
$additionalColumns
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,16 +362,16 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
* This function get the information in the corresponding cases list
|
||||
* @param string $usr_uid, must be show cases related to this user
|
||||
* @param array $filters for apply in the result
|
||||
* @param null $callbackRecord
|
||||
* @param callable $callbackRecord
|
||||
* @param string $appUid related to the specific case
|
||||
* @return array $data
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null, $appUid = '')
|
||||
public function loadList($usr_uid, $filters = array(), callable $callbackRecord = null, $appUid = '')
|
||||
{
|
||||
$pmTable = new PmTable();
|
||||
$criteria = $pmTable->addPMFieldsToList('sent');
|
||||
$this->additionalClassName = $pmTable->tableClassName;
|
||||
$this->setAdditionalClassName($pmTable->tableClassName);
|
||||
$additionalColumns = $criteria->getSelectColumns();
|
||||
|
||||
$criteria->addSelectColumn(ListParticipatedLastPeer::APP_UID);
|
||||
@@ -397,14 +407,15 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
self::loadFilters($criteria, $filters, $additionalColumns);
|
||||
|
||||
//We will be defined the sort
|
||||
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
||||
$casesList = new BmCases();
|
||||
$sort = $casesList->getSortColumn(
|
||||
__CLASS__ . 'Peer',
|
||||
BasePeer::TYPE_FIELDNAME,
|
||||
empty($filters['sort']) ? "DEL_DELEGATE_DATE" : $filters['sort'],
|
||||
"DEL_DELEGATE_DATE",
|
||||
$this->additionalClassName,
|
||||
$additionalColumns
|
||||
$this->getAdditionalClassName(),
|
||||
$additionalColumns,
|
||||
$this->getUserDisplayFormat()
|
||||
);
|
||||
|
||||
$dir = isset($filters['dir']) ? $filters['dir'] : 'ASC';
|
||||
@@ -412,10 +423,20 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
$limit = isset($filters['limit']) ? $filters['limit'] : '25';
|
||||
$paged = isset($filters['paged']) ? $filters['paged'] : 1;
|
||||
|
||||
if ($dir == 'DESC') {
|
||||
$criteria->addDescendingOrderByColumn($sort);
|
||||
if (is_array($sort) && count($sort) > 0) {
|
||||
foreach ($sort as $key) {
|
||||
if ($dir == 'DESC') {
|
||||
$criteria->addDescendingOrderByColumn($key);
|
||||
} else {
|
||||
$criteria->addAscendingOrderByColumn($key);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$criteria->addAscendingOrderByColumn($sort);
|
||||
if ($dir == 'DESC') {
|
||||
$criteria->addDescendingOrderByColumn($sort);
|
||||
} else {
|
||||
$criteria->addAscendingOrderByColumn($sort);
|
||||
}
|
||||
}
|
||||
|
||||
if ($paged == 1) {
|
||||
@@ -490,18 +511,8 @@ class ListParticipatedLast extends BaseListParticipatedLast
|
||||
*/
|
||||
public function getCountList($usrUid, $filters = array())
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
||||
$criteria->add(ListParticipatedLastPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
if (count($filters)) {
|
||||
self::loadFilters($criteria, $filters);
|
||||
}
|
||||
$dataset = ListParticipatedLastPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
|
||||
return (int) $aRow['TOTAL'];
|
||||
return $this->getCountListFromPeer
|
||||
(ListParticipatedLastPeer::class, $usrUid, $filters);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
require_once 'classes/model/om/BaseListPaused.php';
|
||||
|
||||
use ProcessMaker\BusinessModel\Cases as BmCases;
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'LIST_PAUSED' table.
|
||||
@@ -14,17 +14,17 @@ require_once 'classes/model/om/BaseListPaused.php';
|
||||
*
|
||||
* @package classes.model
|
||||
*/
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListPaused extends BaseListPaused
|
||||
|
||||
class ListPaused extends BaseListPaused implements ListInterface
|
||||
{
|
||||
private $additionalClassName = '';
|
||||
use ListBaseTrait;
|
||||
|
||||
/**
|
||||
* Create List Paused Table
|
||||
*
|
||||
* @param type $data
|
||||
* @return type
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function create($data)
|
||||
{
|
||||
@@ -153,7 +153,7 @@ class ListPaused extends BaseListPaused
|
||||
*
|
||||
* @param type $data
|
||||
* @return type
|
||||
* @throws type
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update($data)
|
||||
{
|
||||
@@ -187,9 +187,12 @@ class ListPaused extends BaseListPaused
|
||||
/**
|
||||
* Remove List Paused
|
||||
*
|
||||
* @param type $seqName
|
||||
* @param string $app_uid
|
||||
* @param integer $del_index
|
||||
* @param array $data_inbox
|
||||
*
|
||||
* @return type
|
||||
* @throws type
|
||||
* @throws Exception
|
||||
*
|
||||
*/
|
||||
public function remove($app_uid, $del_index, $data_inbox)
|
||||
@@ -246,8 +249,14 @@ class ListPaused extends BaseListPaused
|
||||
$criteria->add(ListPausedPeer::APP_UID, $search, Criteria::EQUAL);
|
||||
} else {
|
||||
//If we have additional tables configured in the custom cases list, prepare the variables for search
|
||||
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
||||
$casesList->getSearchCriteriaListCases($criteria, __CLASS__ . 'Peer', $search, $this->additionalClassName, $additionalColumns);
|
||||
$casesList = new BmCases();
|
||||
$casesList->getSearchCriteriaListCases(
|
||||
$criteria,
|
||||
__CLASS__ . 'Peer',
|
||||
$search,
|
||||
$this->getAdditionalClassName(),
|
||||
$additionalColumns
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,16 +279,16 @@ class ListPaused extends BaseListPaused
|
||||
* This function get the information in the corresponding cases list
|
||||
* @param string $usr_uid, must be show cases related to this user
|
||||
* @param array $filters for apply in the result
|
||||
* @param null $callbackRecord
|
||||
* @param callable $callbackRecord
|
||||
* @return array $data
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function loadList($usr_uid, $filters = array(), $callbackRecord = null)
|
||||
public function loadList($usr_uid, $filters = array(), callable $callbackRecord = null)
|
||||
{
|
||||
$resp = array();
|
||||
$pmTable = new PmTable();
|
||||
$criteria = $pmTable->addPMFieldsToList('paused');
|
||||
$this->additionalClassName = $pmTable->tableClassName;
|
||||
$this->setAdditionalClassName($pmTable->tableClassName);
|
||||
$additionalColumns = $criteria->getSelectColumns();
|
||||
|
||||
$criteria->addSelectColumn(ListPausedPeer::APP_UID);
|
||||
@@ -308,14 +317,15 @@ class ListPaused extends BaseListPaused
|
||||
self::loadFilters($criteria, $filters, $additionalColumns);
|
||||
|
||||
//We will be defined the sort
|
||||
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
||||
$casesList = new BmCases();
|
||||
$sort = $casesList->getSortColumn(
|
||||
__CLASS__ . 'Peer',
|
||||
BasePeer::TYPE_FIELDNAME,
|
||||
empty($filters['sort']) ? "APP_PAUSED_DATE" : $filters['sort'],
|
||||
"APP_PAUSED_DATE",
|
||||
$this->additionalClassName,
|
||||
$additionalColumns
|
||||
$this->getAdditionalClassName(),
|
||||
$additionalColumns,
|
||||
$this->getUserDisplayFormat()
|
||||
);
|
||||
|
||||
$dir = isset($filters['dir']) ? $filters['dir'] : "ASC";
|
||||
@@ -323,10 +333,20 @@ class ListPaused extends BaseListPaused
|
||||
$limit = isset($filters['limit']) ? $filters['limit'] : "25";
|
||||
$paged = isset($filters['paged']) ? $filters['paged'] : 1;
|
||||
|
||||
if ($dir == "DESC") {
|
||||
$criteria->addDescendingOrderByColumn($sort);
|
||||
if (is_array($sort) && count($sort) > 0) {
|
||||
foreach ($sort as $key) {
|
||||
if ($dir == 'DESC') {
|
||||
$criteria->addDescendingOrderByColumn($key);
|
||||
} else {
|
||||
$criteria->addAscendingOrderByColumn($key);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$criteria->addAscendingOrderByColumn($sort);
|
||||
if ($dir == 'DESC') {
|
||||
$criteria->addDescendingOrderByColumn($sort);
|
||||
} else {
|
||||
$criteria->addAscendingOrderByColumn($sort);
|
||||
}
|
||||
}
|
||||
|
||||
if ($paged == 1) {
|
||||
@@ -354,16 +374,7 @@ class ListPaused extends BaseListPaused
|
||||
*/
|
||||
public function getCountList($usrUid, $filters = array())
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
|
||||
$criteria->add(ListPausedPeer::USR_UID, $usrUid, Criteria::EQUAL);
|
||||
if (count($filters)) {
|
||||
self::loadFilters($criteria, $filters);
|
||||
}
|
||||
$dataset = ListPausedPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
return (int)$aRow['TOTAL'];
|
||||
return $this->getCountListFromPeer
|
||||
(ListPausedPeer::class, $usrUid, $filters);
|
||||
}
|
||||
} // ListPaused
|
||||
|
||||
@@ -15,9 +15,10 @@ require_once 'classes/model/om/BaseListUnassigned.php';
|
||||
* @package classes.model
|
||||
*/
|
||||
// @codingStandardsIgnoreStart
|
||||
class ListUnassigned extends BaseListUnassigned
|
||||
class ListUnassigned extends BaseListUnassigned implements ListInterface
|
||||
{
|
||||
private $additionalClassName = '';
|
||||
use ListBaseTrait;
|
||||
|
||||
private $total = 0;
|
||||
|
||||
/**
|
||||
@@ -192,7 +193,7 @@ class ListUnassigned extends BaseListUnassigned
|
||||
} else {
|
||||
//If we have additional tables configured in the custom cases list, prepare the variables for search
|
||||
$casesList = new \ProcessMaker\BusinessModel\Cases();
|
||||
$casesList->getSearchCriteriaListCases($criteria, __CLASS__ . 'Peer', $search, $this->additionalClassName, $additionalColumns);
|
||||
$casesList->getSearchCriteriaListCases($criteria, __CLASS__ . 'Peer', $search, $this->getAdditionalClassName(), $additionalColumns);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,7 +242,7 @@ class ListUnassigned extends BaseListUnassigned
|
||||
{
|
||||
$pmTable = new PmTable();
|
||||
$criteria = $pmTable->addPMFieldsToList('unassigned');
|
||||
$this->additionalClassName = $pmTable->tableClassName;
|
||||
$this->setAdditionalClassName($pmTable->tableClassName);
|
||||
$additionalColumns = $criteria->getSelectColumns();
|
||||
|
||||
$criteria->addSelectColumn(ListUnassignedPeer::APP_UID);
|
||||
@@ -273,8 +274,9 @@ class ListUnassigned extends BaseListUnassigned
|
||||
BasePeer::TYPE_FIELDNAME,
|
||||
empty($filters['sort']) ? "DEL_DELEGATE_DATE" : $filters['sort'],
|
||||
"DEL_DELEGATE_DATE",
|
||||
$this->additionalClassName,
|
||||
$additionalColumns
|
||||
$this->getAdditionalClassName(),
|
||||
$additionalColumns,
|
||||
$this->getUserDisplayFormat()
|
||||
);
|
||||
|
||||
$dir = isset($filters['dir']) ? $filters['dir'] : "ASC";
|
||||
@@ -282,10 +284,20 @@ class ListUnassigned extends BaseListUnassigned
|
||||
$limit = isset($filters['limit']) ? $filters['limit'] : "25";
|
||||
$paged = isset($filters['paged']) ? $filters['paged'] : 1;
|
||||
$count = isset($filters['count']) ? $filters['count'] : 1;
|
||||
if ($dir == "DESC") {
|
||||
$criteria->addDescendingOrderByColumn($sort);
|
||||
if (is_array($sort) && count($sort) > 0) {
|
||||
foreach ($sort as $key) {
|
||||
if ($dir == 'DESC') {
|
||||
$criteria->addDescendingOrderByColumn($key);
|
||||
} else {
|
||||
$criteria->addAscendingOrderByColumn($key);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$criteria->addAscendingOrderByColumn($sort);
|
||||
if ($dir == 'DESC') {
|
||||
$criteria->addDescendingOrderByColumn($sort);
|
||||
} else {
|
||||
$criteria->addAscendingOrderByColumn($sort);
|
||||
}
|
||||
}
|
||||
$this->total = ListUnassignedPeer::doCount($criteria);
|
||||
if ($paged == 1) {
|
||||
@@ -364,14 +376,17 @@ class ListUnassigned extends BaseListUnassigned
|
||||
}
|
||||
|
||||
/**
|
||||
* get user's SelfService tasks
|
||||
* Get user's SelfService tasks
|
||||
*
|
||||
* @param string $userUid
|
||||
* @param boolean $adHocUsers
|
||||
*
|
||||
* @return array $tasks
|
||||
*/
|
||||
public function getSelfServiceTasks($userUid = '')
|
||||
public function getSelfServiceTasks($userUid = '', $adHocUsers = false)
|
||||
{
|
||||
$rows[] = array();
|
||||
$tasks = array();
|
||||
$rows[] = [];
|
||||
$tasks = [];
|
||||
|
||||
//check self service tasks assigned directly to this user
|
||||
$c = new Criteria();
|
||||
@@ -384,6 +399,10 @@ class ListUnassigned extends BaseListUnassigned
|
||||
$c->add(TaskPeer::TAS_ASSIGN_TYPE, 'SELF_SERVICE');
|
||||
$c->add(TaskPeer::TAS_GROUP_VARIABLE, '');
|
||||
$c->add(TaskUserPeer::USR_UID, $userUid);
|
||||
//TU_TYPE = 2 is a AdHoc task
|
||||
if (!$adHocUsers) {
|
||||
$c->add(TaskUserPeer::TU_TYPE, 1);
|
||||
}
|
||||
|
||||
$rs = TaskPeer::doSelectRS($c);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
@@ -397,7 +416,7 @@ class ListUnassigned extends BaseListUnassigned
|
||||
}
|
||||
|
||||
$group = new Groups();
|
||||
$aGroups = $group->getActiveGroupsForAnUser($userUid);
|
||||
$groupsList = $group->getActiveGroupsForAnUser($userUid);
|
||||
|
||||
$c = new Criteria();
|
||||
$c->clearSelectColumns();
|
||||
@@ -408,7 +427,11 @@ class ListUnassigned extends BaseListUnassigned
|
||||
$c->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
|
||||
$c->add(TaskPeer::TAS_ASSIGN_TYPE, 'SELF_SERVICE');
|
||||
$c->add(TaskPeer::TAS_GROUP_VARIABLE, '');
|
||||
$c->add(TaskUserPeer::USR_UID, $aGroups, Criteria::IN);
|
||||
$c->add(TaskUserPeer::USR_UID, $groupsList, Criteria::IN);
|
||||
//TU_TYPE = 2 is a AdHoc task
|
||||
if (!$adHocUsers) {
|
||||
$c->add(TaskUserPeer::TU_TYPE, 1);
|
||||
}
|
||||
|
||||
$rs = TaskPeer::doSelectRS($c);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
@@ -1,12 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* ObjectPermission.php
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
|
||||
//require_once 'classes/model/om/BaseObjectPermission.php';
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'OBJECT_PERMISSION' table.
|
||||
*
|
||||
@@ -18,19 +10,31 @@
|
||||
*
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
|
||||
use ProcessMaker\BusinessModel\Cases\InputDocument;
|
||||
|
||||
class ObjectPermission extends BaseObjectPermission
|
||||
{
|
||||
public function load ($UID)
|
||||
/**
|
||||
* Get the fields related to the user uid
|
||||
*
|
||||
* @param string $usrUid
|
||||
*
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function load($usrUid)
|
||||
{
|
||||
try {
|
||||
$oRow = ObjectPermissionPeer::retrieveByPK( $UID );
|
||||
if (! is_null( $oRow )) {
|
||||
$aFields = $oRow->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$this->fromArray( $aFields, BasePeer::TYPE_FIELDNAME );
|
||||
$this->setNew( false );
|
||||
return $aFields;
|
||||
$row = ObjectPermissionPeer::retrieveByPK($usrUid);
|
||||
if (!is_null($row)) {
|
||||
$fields = $row->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$this->fromArray($fields, BasePeer::TYPE_FIELDNAME);
|
||||
$this->setNew(false);
|
||||
|
||||
return $fields;
|
||||
} else {
|
||||
throw (new Exception( "The row '" . $UsrUid . "' in table USER doesn't exist!" ));
|
||||
throw (new Exception("The row '" . $usrUid . "' in table USER doesn't exist!"));
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
@@ -367,44 +371,57 @@ class ObjectPermission extends BaseObjectPermission
|
||||
*/
|
||||
public function objectPermissionByOutputInput ($appUid, $proUid, $opTaskSource, $obType = 'OUTPUT', $opObjUid = '', $statusCase = '')
|
||||
{
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(AppDocumentPeer::APP_DOC_UID);
|
||||
$oCriteria->addSelectColumn(AppDocumentPeer::APP_DOC_TYPE);
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->addSelectColumn(AppDocumentPeer::APP_DOC_UID);
|
||||
$criteria->addSelectColumn(AppDocumentPeer::APP_DOC_TYPE);
|
||||
$arrayCondition = array();
|
||||
$arrayCondition[] = array(AppDelegationPeer::APP_UID, AppDocumentPeer::APP_UID, Criteria::EQUAL);
|
||||
$arrayCondition[] = array(AppDelegationPeer::DEL_INDEX, AppDocumentPeer::DEL_INDEX, Criteria::EQUAL);
|
||||
$oCriteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN);
|
||||
$oCriteria->add(AppDelegationPeer::APP_UID, $appUid);
|
||||
$oCriteria->add(AppDelegationPeer::PRO_UID, $proUid);
|
||||
$criteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN);
|
||||
$criteria->add(AppDelegationPeer::APP_UID, $appUid);
|
||||
$criteria->add(AppDelegationPeer::PRO_UID, $proUid);
|
||||
|
||||
if ($statusCase != 'COMPLETED' && $opTaskSource != '' && (int)$opTaskSource != 0) {
|
||||
$oCriteria->add(AppDelegationPeer::TAS_UID, $opTaskSource);
|
||||
$criteria->add(AppDelegationPeer::TAS_UID, $opTaskSource);
|
||||
}
|
||||
if ($opObjUid != '' && $opObjUid != '0') {
|
||||
$oCriteria->add(AppDocumentPeer::DOC_UID, $opObjUid);
|
||||
$criteria->add(AppDocumentPeer::DOC_UID, $opObjUid);
|
||||
}
|
||||
|
||||
$supervisorDocuments = [];
|
||||
switch ($obType) {
|
||||
case 'INPUT':
|
||||
$oCriteria->add(AppDocumentPeer::APP_DOC_TYPE, 'INPUT');
|
||||
$criteria->add(AppDocumentPeer::APP_DOC_TYPE, 'INPUT');
|
||||
//We will to get the supervisor's documents with index = 100000
|
||||
$inputDocument = new InputDocument();
|
||||
$supervisorDocuments = $inputDocument->getSupervisorDocuments($appUid);
|
||||
break;
|
||||
case 'ATTACHED':
|
||||
$oCriteria->add(AppDocumentPeer::APP_DOC_TYPE, 'ATTACHED');
|
||||
$criteria->add(AppDocumentPeer::APP_DOC_TYPE, 'ATTACHED');
|
||||
break;
|
||||
case 'OUTPUT':
|
||||
$oCriteria->add(AppDocumentPeer::APP_DOC_TYPE, 'OUTPUT');
|
||||
$criteria->add(AppDocumentPeer::APP_DOC_TYPE, 'OUTPUT');
|
||||
break;
|
||||
}
|
||||
|
||||
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset = AppDelegationPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
$result = array();
|
||||
while ($oDataset->next()) {
|
||||
$aRow = $oDataset->getRow();
|
||||
if (!in_array($aRow['APP_DOC_UID'], $result)) {
|
||||
array_push($result, $aRow['APP_DOC_UID']);
|
||||
$result = [];
|
||||
while ($dataset->next()) {
|
||||
$row = $dataset->getRow();
|
||||
if (!in_array($row['APP_DOC_UID'], $result)) {
|
||||
array_push($result, $row['APP_DOC_UID']);
|
||||
}
|
||||
}
|
||||
|
||||
//We will to add the supervisor's documents in the result
|
||||
foreach ($supervisorDocuments as $key => $value) {
|
||||
if (!in_array($value['APP_DOC_UID'], $result)) {
|
||||
array_push($result, $value['APP_DOC_UID']);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@@ -739,7 +739,7 @@ class Process extends BaseProcess
|
||||
|
||||
}
|
||||
|
||||
$memcache = & PMmemcached::getSingleton( SYS_SYS );
|
||||
$memcache = & PMmemcached::getSingleton( config("system.workspace") );
|
||||
if (isset($memcache) && $memcache->enabled == 1 ) {
|
||||
return $aProcesses;
|
||||
}
|
||||
@@ -766,7 +766,7 @@ class Process extends BaseProcess
|
||||
GROUP BY PRO_UID, APP_STATUS*/
|
||||
require_once 'classes/model/Application.php';
|
||||
|
||||
$memcache = & PMmemcached::getSingleton( SYS_SYS );
|
||||
$memcache = & PMmemcached::getSingleton( config("system.workspace") );
|
||||
$memkey = 'getCasesCountInAllProcesses';
|
||||
if (($aProcesses = $memcache->get( $memkey )) === false) {
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
@@ -877,7 +877,7 @@ class Process extends BaseProcess
|
||||
$limit = 25;
|
||||
$start = 0;
|
||||
|
||||
$memcache = PMmemcached::getSingleton( SYS_SYS );
|
||||
$memcache = PMmemcached::getSingleton( config("system.workspace") );
|
||||
|
||||
for ($start = 0; $start <= 50 - 1; $start ++) {
|
||||
$memkey = "processList-allProcesses-" . ($start * $limit) . "-" . $limit;
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
|
||||
//require_once 'classes/model/om/BaseProcessUser.php';
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'PROCESS_USER' table.
|
||||
*
|
||||
@@ -127,5 +124,55 @@ class ProcessUser extends BaseProcessUser
|
||||
throw ($oError);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of process where the user is supervisor
|
||||
* finding cases PRO_UID where $userUid is supervising
|
||||
*
|
||||
* @param string $userUid
|
||||
*
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getProUidSupervisor($userUid)
|
||||
{
|
||||
try {
|
||||
|
||||
$processes = [];
|
||||
|
||||
//Get the process when the user is supervisor
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(ProcessUserPeer::PU_TYPE, 'SUPERVISOR');
|
||||
$criteria->add(ProcessUserPeer::USR_UID, $userUid);
|
||||
$dataset = ProcessUserPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
|
||||
while ($row = $dataset->getRow()) {
|
||||
$processes[] = $row['PRO_UID'];
|
||||
$dataset->next();
|
||||
}
|
||||
|
||||
//Get the process when the user is assigned into the group supervisor
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(ProcessUserPeer::PU_TYPE, 'GROUP_SUPERVISOR');
|
||||
$criteria->addSelectColumn(ProcessUserPeer::PRO_UID);
|
||||
$criteria->addJoin(ProcessUserPeer::USR_UID, GroupUserPeer::GRP_UID, Criteria::LEFT_JOIN);
|
||||
$criteria->add(GroupUserPeer::USR_UID, $userUid);
|
||||
$dataset = ProcessUserPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
|
||||
while ($row = $dataset->getRow()) {
|
||||
$processes[] = $row['PRO_UID'];
|
||||
$dataset->next();
|
||||
}
|
||||
|
||||
return $processes;
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -811,6 +811,33 @@ class Task extends BaseTask
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function get the columns by Id indexing
|
||||
*
|
||||
* @param string $tasUid
|
||||
*
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getColumnIds($tasUid)
|
||||
{
|
||||
try {
|
||||
$columnsId = [];
|
||||
$row = TaskPeer::retrieveByPK($tasUid);
|
||||
if (!is_null($row)) {
|
||||
$fields = $row->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$this->fromArray($fields, BasePeer::TYPE_FIELDNAME);
|
||||
$columnsId['TAS_ID'] = $fields['TAS_ID'];
|
||||
$columnsId['PRO_ID'] = $fields['PRO_ID'];
|
||||
return $columnsId;
|
||||
} else {
|
||||
throw (new Exception("The row '" . $tasUid . "' in table TASK doesn't exist!"));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -258,10 +258,10 @@ class UsersProperties extends BaseUsersProperties
|
||||
$url = $this->_getDefaultLocation();
|
||||
return $url;
|
||||
} else {
|
||||
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/main';
|
||||
$url = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/main';
|
||||
}
|
||||
} else {
|
||||
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/main';
|
||||
$url = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . SYS_SKIN . '/main';
|
||||
}
|
||||
global $RBAC;
|
||||
$oConf = new Configurations();
|
||||
@@ -330,9 +330,9 @@ class UsersProperties extends BaseUsersProperties
|
||||
$pathMethod = $detail->getPathMethod();
|
||||
if (isset($pathMethod) && $detail->equalRoleCodeTo($userRole)) {
|
||||
if (isset($_COOKIE['workspaceSkin'])) {
|
||||
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/' . $pathMethod;
|
||||
$url = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/' . $pathMethod;
|
||||
} else {
|
||||
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/' . $pathMethod;
|
||||
$url = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . SYS_SKIN . '/' . $pathMethod;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -376,7 +376,7 @@ class UsersProperties extends BaseUsersProperties
|
||||
case 'SINGLE':
|
||||
$_SESSION['user_experience'] = $uxType;
|
||||
$_SESSION['user_last_skin'] = SYS_SKIN;
|
||||
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/uxs/' . 'home';
|
||||
$url = '/sys' . config("system.workspace") . '/' . $this->lang . '/uxs/' . 'home';
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -393,11 +393,10 @@ class UsersProperties extends BaseUsersProperties
|
||||
$oConf = new Configurations();
|
||||
$oConf->loadConfig( $x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '' );
|
||||
|
||||
//$baseUrl = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/';
|
||||
if (isset($_COOKIE['workspaceSkin'])) {
|
||||
$baseUrl = '/sys' . SYS_SYS . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/';
|
||||
$baseUrl = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/';
|
||||
} else {
|
||||
$baseUrl = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/';
|
||||
$baseUrl = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . SYS_SKIN . '/';
|
||||
}
|
||||
$url = '';
|
||||
|
||||
|
||||
@@ -101,6 +101,10 @@ class AppMessageMapBuilder
|
||||
|
||||
$tMap->addColumn('APP_MSG_ERROR', 'AppMsgError', 'string', CreoleTypes::LONGVARCHAR, false, null);
|
||||
|
||||
$tMap->addColumn('TAS_ID', 'TasId', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // AppMessageMapBuilder
|
||||
|
||||
@@ -69,7 +69,7 @@ class PluginsRegistryMapBuilder
|
||||
|
||||
$tMap->addColumn('PLUGIN_NAMESPACE', 'PluginNamespace', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||
|
||||
$tMap->addColumn('PLUGIN_DESCRIPTION', 'PluginDescription', 'string', CreoleTypes::VARCHAR, false, 200);
|
||||
$tMap->addColumn('PLUGIN_DESCRIPTION', 'PluginDescription', 'string', CreoleTypes::LONGVARCHAR, false, null);
|
||||
|
||||
$tMap->addColumn('PLUGIN_CLASS_NAME', 'PluginClassName', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||
|
||||
|
||||
@@ -135,6 +135,18 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
||||
*/
|
||||
protected $app_msg_error;
|
||||
|
||||
/**
|
||||
* The value for the tas_id field.
|
||||
* @var int
|
||||
*/
|
||||
protected $tas_id = 0;
|
||||
|
||||
/**
|
||||
* The value for the app_number field.
|
||||
* @var int
|
||||
*/
|
||||
protected $app_number = 0;
|
||||
|
||||
/**
|
||||
* Flag to prevent endless save loop, if this object is referenced
|
||||
* by another object which falls in this transaction.
|
||||
@@ -389,6 +401,28 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
||||
return $this->app_msg_error;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [tas_id] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getTasId()
|
||||
{
|
||||
|
||||
return $this->tas_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [app_number] column value.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getAppNumber()
|
||||
{
|
||||
|
||||
return $this->app_number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value of [app_msg_uid] column.
|
||||
*
|
||||
@@ -799,6 +833,50 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
||||
|
||||
} // setAppMsgError()
|
||||
|
||||
/**
|
||||
* Set the value of [tas_id] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setTasId($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is integer,
|
||||
// we will cast the input value to an int (if it is not).
|
||||
if ($v !== null && !is_int($v) && is_numeric($v)) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->tas_id !== $v || $v === 0) {
|
||||
$this->tas_id = $v;
|
||||
$this->modifiedColumns[] = AppMessagePeer::TAS_ID;
|
||||
}
|
||||
|
||||
} // setTasId()
|
||||
|
||||
/**
|
||||
* Set the value of [app_number] column.
|
||||
*
|
||||
* @param int $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setAppNumber($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is integer,
|
||||
// we will cast the input value to an int (if it is not).
|
||||
if ($v !== null && !is_int($v) && is_numeric($v)) {
|
||||
$v = (int) $v;
|
||||
}
|
||||
|
||||
if ($this->app_number !== $v || $v === 0) {
|
||||
$this->app_number = $v;
|
||||
$this->modifiedColumns[] = AppMessagePeer::APP_NUMBER;
|
||||
}
|
||||
|
||||
} // setAppNumber()
|
||||
|
||||
/**
|
||||
* Hydrates (populates) the object variables with values from the database resultset.
|
||||
*
|
||||
@@ -852,12 +930,16 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
||||
|
||||
$this->app_msg_error = $rs->getString($startcol + 17);
|
||||
|
||||
$this->tas_id = $rs->getInt($startcol + 18);
|
||||
|
||||
$this->app_number = $rs->getInt($startcol + 19);
|
||||
|
||||
$this->resetModified();
|
||||
|
||||
$this->setNew(false);
|
||||
|
||||
// FIXME - using NUM_COLUMNS may be clearer.
|
||||
return $startcol + 18; // 18 = AppMessagePeer::NUM_COLUMNS - AppMessagePeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
return $startcol + 20; // 20 = AppMessagePeer::NUM_COLUMNS - AppMessagePeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating AppMessage object", $e);
|
||||
@@ -1115,6 +1197,12 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
||||
case 17:
|
||||
return $this->getAppMsgError();
|
||||
break;
|
||||
case 18:
|
||||
return $this->getTasId();
|
||||
break;
|
||||
case 19:
|
||||
return $this->getAppNumber();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
@@ -1153,6 +1241,8 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
||||
$keys[15] => $this->getAppMsgSendDate(),
|
||||
$keys[16] => $this->getAppMsgShowMessage(),
|
||||
$keys[17] => $this->getAppMsgError(),
|
||||
$keys[18] => $this->getTasId(),
|
||||
$keys[19] => $this->getAppNumber(),
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
@@ -1238,6 +1328,12 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
||||
case 17:
|
||||
$this->setAppMsgError($value);
|
||||
break;
|
||||
case 18:
|
||||
$this->setTasId($value);
|
||||
break;
|
||||
case 19:
|
||||
$this->setAppNumber($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
@@ -1333,6 +1429,14 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
||||
$this->setAppMsgError($arr[$keys[17]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[18], $arr)) {
|
||||
$this->setTasId($arr[$keys[18]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[19], $arr)) {
|
||||
$this->setAppNumber($arr[$keys[19]]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1416,6 +1520,14 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
||||
$criteria->add(AppMessagePeer::APP_MSG_ERROR, $this->app_msg_error);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(AppMessagePeer::TAS_ID)) {
|
||||
$criteria->add(AppMessagePeer::TAS_ID, $this->tas_id);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(AppMessagePeer::APP_NUMBER)) {
|
||||
$criteria->add(AppMessagePeer::APP_NUMBER, $this->app_number);
|
||||
}
|
||||
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -1504,6 +1616,10 @@ abstract class BaseAppMessage extends BaseObject implements Persistent
|
||||
|
||||
$copyObj->setAppMsgError($this->app_msg_error);
|
||||
|
||||
$copyObj->setTasId($this->tas_id);
|
||||
|
||||
$copyObj->setAppNumber($this->app_number);
|
||||
|
||||
|
||||
$copyObj->setNew(true);
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ abstract class BaseAppMessagePeer
|
||||
const CLASS_DEFAULT = 'classes.model.AppMessage';
|
||||
|
||||
/** The total number of columns. */
|
||||
const NUM_COLUMNS = 18;
|
||||
const NUM_COLUMNS = 20;
|
||||
|
||||
/** The number of lazy-loaded columns. */
|
||||
const NUM_LAZY_LOAD_COLUMNS = 0;
|
||||
@@ -85,6 +85,12 @@ abstract class BaseAppMessagePeer
|
||||
/** the column name for the APP_MSG_ERROR field */
|
||||
const APP_MSG_ERROR = 'APP_MESSAGE.APP_MSG_ERROR';
|
||||
|
||||
/** the column name for the TAS_ID field */
|
||||
const TAS_ID = 'APP_MESSAGE.TAS_ID';
|
||||
|
||||
/** the column name for the APP_NUMBER field */
|
||||
const APP_NUMBER = 'APP_MESSAGE.APP_NUMBER';
|
||||
|
||||
/** The PHP to DB Name Mapping */
|
||||
private static $phpNameMap = null;
|
||||
|
||||
@@ -96,10 +102,10 @@ abstract class BaseAppMessagePeer
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
private static $fieldNames = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('AppMsgUid', 'MsgUid', 'AppUid', 'DelIndex', 'AppMsgType', 'AppMsgSubject', 'AppMsgFrom', 'AppMsgTo', 'AppMsgBody', 'AppMsgDate', 'AppMsgCc', 'AppMsgBcc', 'AppMsgTemplate', 'AppMsgStatus', 'AppMsgAttach', 'AppMsgSendDate', 'AppMsgShowMessage', 'AppMsgError', ),
|
||||
BasePeer::TYPE_COLNAME => array (AppMessagePeer::APP_MSG_UID, AppMessagePeer::MSG_UID, AppMessagePeer::APP_UID, AppMessagePeer::DEL_INDEX, AppMessagePeer::APP_MSG_TYPE, AppMessagePeer::APP_MSG_SUBJECT, AppMessagePeer::APP_MSG_FROM, AppMessagePeer::APP_MSG_TO, AppMessagePeer::APP_MSG_BODY, AppMessagePeer::APP_MSG_DATE, AppMessagePeer::APP_MSG_CC, AppMessagePeer::APP_MSG_BCC, AppMessagePeer::APP_MSG_TEMPLATE, AppMessagePeer::APP_MSG_STATUS, AppMessagePeer::APP_MSG_ATTACH, AppMessagePeer::APP_MSG_SEND_DATE, AppMessagePeer::APP_MSG_SHOW_MESSAGE, AppMessagePeer::APP_MSG_ERROR, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('APP_MSG_UID', 'MSG_UID', 'APP_UID', 'DEL_INDEX', 'APP_MSG_TYPE', 'APP_MSG_SUBJECT', 'APP_MSG_FROM', 'APP_MSG_TO', 'APP_MSG_BODY', 'APP_MSG_DATE', 'APP_MSG_CC', 'APP_MSG_BCC', 'APP_MSG_TEMPLATE', 'APP_MSG_STATUS', 'APP_MSG_ATTACH', 'APP_MSG_SEND_DATE', 'APP_MSG_SHOW_MESSAGE', 'APP_MSG_ERROR', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, )
|
||||
BasePeer::TYPE_PHPNAME => array ('AppMsgUid', 'MsgUid', 'AppUid', 'DelIndex', 'AppMsgType', 'AppMsgSubject', 'AppMsgFrom', 'AppMsgTo', 'AppMsgBody', 'AppMsgDate', 'AppMsgCc', 'AppMsgBcc', 'AppMsgTemplate', 'AppMsgStatus', 'AppMsgAttach', 'AppMsgSendDate', 'AppMsgShowMessage', 'AppMsgError', 'TasId', 'AppNumber', ),
|
||||
BasePeer::TYPE_COLNAME => array (AppMessagePeer::APP_MSG_UID, AppMessagePeer::MSG_UID, AppMessagePeer::APP_UID, AppMessagePeer::DEL_INDEX, AppMessagePeer::APP_MSG_TYPE, AppMessagePeer::APP_MSG_SUBJECT, AppMessagePeer::APP_MSG_FROM, AppMessagePeer::APP_MSG_TO, AppMessagePeer::APP_MSG_BODY, AppMessagePeer::APP_MSG_DATE, AppMessagePeer::APP_MSG_CC, AppMessagePeer::APP_MSG_BCC, AppMessagePeer::APP_MSG_TEMPLATE, AppMessagePeer::APP_MSG_STATUS, AppMessagePeer::APP_MSG_ATTACH, AppMessagePeer::APP_MSG_SEND_DATE, AppMessagePeer::APP_MSG_SHOW_MESSAGE, AppMessagePeer::APP_MSG_ERROR, AppMessagePeer::TAS_ID, AppMessagePeer::APP_NUMBER, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('APP_MSG_UID', 'MSG_UID', 'APP_UID', 'DEL_INDEX', 'APP_MSG_TYPE', 'APP_MSG_SUBJECT', 'APP_MSG_FROM', 'APP_MSG_TO', 'APP_MSG_BODY', 'APP_MSG_DATE', 'APP_MSG_CC', 'APP_MSG_BCC', 'APP_MSG_TEMPLATE', 'APP_MSG_STATUS', 'APP_MSG_ATTACH', 'APP_MSG_SEND_DATE', 'APP_MSG_SHOW_MESSAGE', 'APP_MSG_ERROR', 'TAS_ID', 'APP_NUMBER', ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -109,10 +115,10 @@ abstract class BaseAppMessagePeer
|
||||
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
private static $fieldKeys = array (
|
||||
BasePeer::TYPE_PHPNAME => array ('AppMsgUid' => 0, 'MsgUid' => 1, 'AppUid' => 2, 'DelIndex' => 3, 'AppMsgType' => 4, 'AppMsgSubject' => 5, 'AppMsgFrom' => 6, 'AppMsgTo' => 7, 'AppMsgBody' => 8, 'AppMsgDate' => 9, 'AppMsgCc' => 10, 'AppMsgBcc' => 11, 'AppMsgTemplate' => 12, 'AppMsgStatus' => 13, 'AppMsgAttach' => 14, 'AppMsgSendDate' => 15, 'AppMsgShowMessage' => 16, 'AppMsgError' => 17, ),
|
||||
BasePeer::TYPE_COLNAME => array (AppMessagePeer::APP_MSG_UID => 0, AppMessagePeer::MSG_UID => 1, AppMessagePeer::APP_UID => 2, AppMessagePeer::DEL_INDEX => 3, AppMessagePeer::APP_MSG_TYPE => 4, AppMessagePeer::APP_MSG_SUBJECT => 5, AppMessagePeer::APP_MSG_FROM => 6, AppMessagePeer::APP_MSG_TO => 7, AppMessagePeer::APP_MSG_BODY => 8, AppMessagePeer::APP_MSG_DATE => 9, AppMessagePeer::APP_MSG_CC => 10, AppMessagePeer::APP_MSG_BCC => 11, AppMessagePeer::APP_MSG_TEMPLATE => 12, AppMessagePeer::APP_MSG_STATUS => 13, AppMessagePeer::APP_MSG_ATTACH => 14, AppMessagePeer::APP_MSG_SEND_DATE => 15, AppMessagePeer::APP_MSG_SHOW_MESSAGE => 16, AppMessagePeer::APP_MSG_ERROR => 17, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('APP_MSG_UID' => 0, 'MSG_UID' => 1, 'APP_UID' => 2, 'DEL_INDEX' => 3, 'APP_MSG_TYPE' => 4, 'APP_MSG_SUBJECT' => 5, 'APP_MSG_FROM' => 6, 'APP_MSG_TO' => 7, 'APP_MSG_BODY' => 8, 'APP_MSG_DATE' => 9, 'APP_MSG_CC' => 10, 'APP_MSG_BCC' => 11, 'APP_MSG_TEMPLATE' => 12, 'APP_MSG_STATUS' => 13, 'APP_MSG_ATTACH' => 14, 'APP_MSG_SEND_DATE' => 15, 'APP_MSG_SHOW_MESSAGE' => 16, 'APP_MSG_ERROR' => 17, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, )
|
||||
BasePeer::TYPE_PHPNAME => array ('AppMsgUid' => 0, 'MsgUid' => 1, 'AppUid' => 2, 'DelIndex' => 3, 'AppMsgType' => 4, 'AppMsgSubject' => 5, 'AppMsgFrom' => 6, 'AppMsgTo' => 7, 'AppMsgBody' => 8, 'AppMsgDate' => 9, 'AppMsgCc' => 10, 'AppMsgBcc' => 11, 'AppMsgTemplate' => 12, 'AppMsgStatus' => 13, 'AppMsgAttach' => 14, 'AppMsgSendDate' => 15, 'AppMsgShowMessage' => 16, 'AppMsgError' => 17, 'TasId' => 18, 'AppNumber' => 19, ),
|
||||
BasePeer::TYPE_COLNAME => array (AppMessagePeer::APP_MSG_UID => 0, AppMessagePeer::MSG_UID => 1, AppMessagePeer::APP_UID => 2, AppMessagePeer::DEL_INDEX => 3, AppMessagePeer::APP_MSG_TYPE => 4, AppMessagePeer::APP_MSG_SUBJECT => 5, AppMessagePeer::APP_MSG_FROM => 6, AppMessagePeer::APP_MSG_TO => 7, AppMessagePeer::APP_MSG_BODY => 8, AppMessagePeer::APP_MSG_DATE => 9, AppMessagePeer::APP_MSG_CC => 10, AppMessagePeer::APP_MSG_BCC => 11, AppMessagePeer::APP_MSG_TEMPLATE => 12, AppMessagePeer::APP_MSG_STATUS => 13, AppMessagePeer::APP_MSG_ATTACH => 14, AppMessagePeer::APP_MSG_SEND_DATE => 15, AppMessagePeer::APP_MSG_SHOW_MESSAGE => 16, AppMessagePeer::APP_MSG_ERROR => 17, AppMessagePeer::TAS_ID => 18, AppMessagePeer::APP_NUMBER => 19, ),
|
||||
BasePeer::TYPE_FIELDNAME => array ('APP_MSG_UID' => 0, 'MSG_UID' => 1, 'APP_UID' => 2, 'DEL_INDEX' => 3, 'APP_MSG_TYPE' => 4, 'APP_MSG_SUBJECT' => 5, 'APP_MSG_FROM' => 6, 'APP_MSG_TO' => 7, 'APP_MSG_BODY' => 8, 'APP_MSG_DATE' => 9, 'APP_MSG_CC' => 10, 'APP_MSG_BCC' => 11, 'APP_MSG_TEMPLATE' => 12, 'APP_MSG_STATUS' => 13, 'APP_MSG_ATTACH' => 14, 'APP_MSG_SEND_DATE' => 15, 'APP_MSG_SHOW_MESSAGE' => 16, 'APP_MSG_ERROR' => 17, 'TAS_ID' => 18, 'APP_NUMBER' => 19, ),
|
||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -249,6 +255,10 @@ abstract class BaseAppMessagePeer
|
||||
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_ERROR);
|
||||
|
||||
$criteria->addSelectColumn(AppMessagePeer::TAS_ID);
|
||||
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_NUMBER);
|
||||
|
||||
}
|
||||
|
||||
const COUNT = 'COUNT(APP_MESSAGE.APP_MSG_UID)';
|
||||
|
||||
@@ -43,7 +43,7 @@ abstract class BasePluginsRegistry extends BaseObject implements Persistent
|
||||
* The value for the plugin_description field.
|
||||
* @var string
|
||||
*/
|
||||
protected $plugin_description = '';
|
||||
protected $plugin_description;
|
||||
|
||||
/**
|
||||
* The value for the plugin_class_name field.
|
||||
@@ -508,7 +508,7 @@ abstract class BasePluginsRegistry extends BaseObject implements Persistent
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->plugin_description !== $v || $v === '') {
|
||||
if ($this->plugin_description !== $v) {
|
||||
$this->plugin_description = $v;
|
||||
$this->modifiedColumns[] = PluginsRegistryPeer::PLUGIN_DESCRIPTION;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user