conflicts

This commit is contained in:
Paula Quispe
2017-03-10 16:55:43 -04:00
96 changed files with 6076 additions and 2147 deletions

View File

@@ -3374,4 +3374,37 @@ class Cases
$row = $dataSet->getRow();
return isset($row['DEL_INDEX']) ? $row['DEL_INDEX'] : 0;
}
/**
* Get last index, we can considering the pause thread
*
* This function return the last index thread and will be considered the paused cases
* Is created by Jump to and redirect the correct thread
* by default is not considered the paused thread
* in parallel cases return the first thread to find
* @param string $appUid
* @param boolean $checkCaseIsPaused
* @return integer delIndex
*/
public function getOneLastThread($appUid, $checkCaseIsPaused = false)
{
$criteria = new \Criteria('workflow');
$criteria->addSelectColumn(\AppDelegationPeer::DEL_INDEX);
$criteria->addSelectColumn(\AppDelegationPeer::DEL_THREAD_STATUS);
$criteria->add(\AppDelegationPeer::APP_UID, $appUid, \Criteria::EQUAL);
$dataSet = \AppDelegationPeer::doSelectRS($criteria);
$dataSet->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$dataSet->next();
$row = $dataSet->getRow();
$delIndex = 0;
while (is_array($row)) {
$delIndex = $row['DEL_INDEX'];
if ($checkCaseIsPaused && \AppDelay::isPaused($appUid, $delIndex)) {
return $delIndex;
}
$dataSet->next();
$row = $dataSet->getRow();
}
return $delIndex;
}
}

View File

@@ -148,7 +148,7 @@ class FilesManager
*
* @access public
*/
public function addProcessFilesManager($sProcessUID, $userUID, $aData)
public function addProcessFilesManager($sProcessUID, $userUID, $aData, $isImport = false)
{
try {
$aData['prf_path'] = rtrim($aData['prf_path'], '/') . '/';
@@ -190,7 +190,7 @@ class FilesManager
if ($extention == '.exe') {
throw new \Exception(\G::LoadTranslation('ID_FILE_UPLOAD_INCORRECT_EXTENSION'));
}
if (\Bootstrap::getDisablePhpUploadExecution() === 1 && $extention === '.php') {
if (\Bootstrap::getDisablePhpUploadExecution() === 1 && $extention === '.php' && !$isImport) {
$message = \G::LoadTranslation('THE_UPLOAD_OF_PHP_FILES_WAS_DISABLED');
\Bootstrap::registerMonologPhpUploadExecution('phpUpload', 550, $message, $aData['prf_filename']);
throw new \Exception($message);
@@ -708,7 +708,7 @@ class FilesManager
*
* return void
*/
public function processFilesUpgrade($projectUid = "")
public function processFilesUpgrade($projectUid = "", $isImport = false)
{
try {
//Set variables
@@ -778,7 +778,7 @@ class FilesManager
"prf_content" => ""
);
$arrayData = $this->addProcessFilesManager($row["PRJ_UID"], "00000000000000000000000000000001", $arrayData);
$arrayData = $this->addProcessFilesManager($row["PRJ_UID"], "00000000000000000000000000000001", $arrayData, $isImport);
rename($dir . PATH_SEP . $file . ".tmp", $dir . PATH_SEP . $file);
}

View File

@@ -201,7 +201,7 @@ class Lists {
}
if ($total) {
$total = $list->countTotal($userUid, $filters);
$total = $list->getCountList($userUid, $filters);
return $total;
}
@@ -249,7 +249,7 @@ class Lists {
$response['filters'] = $filtersData;
$response['data'] = $result;
$filtersData['action'] = $filters["action"];
$response['totalCount'] = $list->countTotal($userUid, $filtersData);
$response['totalCount'] = $list->getCountList($userUid, $filtersData);
} else {
$response = $result;
}
@@ -267,8 +267,8 @@ class Lists {
$response = array();
foreach ($list as $listObject => $item) {
switch ($listObject) {
case 'ListInbox':
$total = $this->$listObject->getCountList($userId, 'TO_DO');
case 'ListDraft':
$total = $this->$listObject->getCountList($userId, array('action'=>'draft'));
array_push($response, (array('count' => $total, 'item' => $item)));
break;
/*----------------------------------********---------------------------------*/

View File

@@ -36,7 +36,7 @@ class ProcessDefinitionMigrator implements Importable, Exportable
{
try {
//Bpmn elements
$pjrUid = $this->bpmn->createFromStruct($data['bpmn'], false);
$pjrUid = $this->bpmn->createFromStruct($data['bpmn'], false, $data);
//Import workflow elements
} catch (\Exception $e) {
$exception = new ImportException($e->getMessage());

View File

@@ -571,7 +571,7 @@ class WebEntry
*
* return array Return data of the new Web Entry created
*/
public function create($processUid, $userUidCreator, array $arrayData)
public function create($processUid, $userUidCreator, array $arrayData, $validate = true)
{
try {
//Verify data
@@ -590,7 +590,9 @@ class WebEntry
//Verify data
$process->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]);
$this->throwExceptionIfDataIsInvalid("", $processUid, $arrayData);
if ($validate === true) {
$this->throwExceptionIfDataIsInvalid("", $processUid, $arrayData);
}
//Create
$cnn = \Propel::getConnection("workflow");
@@ -946,5 +948,90 @@ class WebEntry
throw $e;
}
}
/**
* Check the existence of a file of type web entry, returns true if it exists
* and false otherwise. Verification is done by the field WE_DATA and PRO_UID.
* The PRO_UID key and the file path are required.
* @param type $proUid
* @param type $filePath
* @return boolean
*/
public static function isWebEntry($proUid, $filePath)
{
$fileName = basename($filePath);
if (empty($proUid) || empty($fileName)) {
return false;
}
$fileName = trim($fileName);
$postfix = "Post.php";
$n = strlen($postfix);
$string = substr($fileName, 0, -$n);
if ($string . $postfix === $fileName) {
$fileName = $string . ".php";
}
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\WebEntryPeer::WE_DATA);
$criteria->add(\WebEntryPeer::PRO_UID, $proUid, \Criteria::EQUAL);
$criteria->add(\WebEntryPeer::WE_DATA, $fileName, \Criteria::EQUAL);
$resultSet = \WebEntryPeer::doSelectRS($criteria);
$resultSet->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$resultSet->next();
$row = $resultSet->getRow();
return isset($row["WE_DATA"]);
}
/**
* Fill the WEB_ENTRY table for the classic processes.
* @param type $data
*/
public function createClassic($data)
{
$cnn = \Propel::getConnection("workflow");
$criteria = new \Criteria("workflow");
$criteria->add(\WebEntryPeer::PRO_UID, $data["PRO_UID"], \Criteria::EQUAL);
$criteria->add(\WebEntryPeer::WE_DATA, $data["WE_DATA"], \Criteria::EQUAL);
$result = \WebEntryPeer::doSelect($criteria, $cnn);
if (isset($result[0])) {
$webEntry = $result[0];
$webEntry->fromArray($data, \BasePeer::TYPE_FIELDNAME);
} else {
$webEntry = new \WebEntry();
$webEntry->fromArray($data, \BasePeer::TYPE_FIELDNAME);
$webEntry->setWeUid(\ProcessMaker\Util\Common::generateUID());
$webEntry->setWeCreateDate("now");
$webEntry->setWeMethod("WS");
$webEntry->setWeInputDocumentAccess(1);
}
$webEntry->setWeUpdateDate("now");
if ($webEntry->validate()) {
$cnn->begin();
$result = $webEntry->save();
$cnn->commit();
}
}
/**
* Removes a record from the WEB_ENTRY table for the classic processes.
* The PRO_UID key and the file path are required.
* @param type $proUid
* @param type $filePath
* @return boolean
*/
public function deleteClassic($proUid, $filePath)
{
$fileName = basename($filePath);
if (empty($proUid) || empty($fileName)) {
return false;
}
$criteria = new \Criteria("workflow");
$criteria->add(\WebEntryPeer::PRO_UID, $proUid, \Criteria::EQUAL);
$criteria->add(\WebEntryPeer::WE_DATA, $fileName, \Criteria::EQUAL);
$result = \WebEntryPeer::doDelete($criteria);
return $result;
}
}