Merged colosa/processmaker into master
This commit is contained in:
@@ -861,15 +861,33 @@ class Cases
|
||||
*
|
||||
* @access public
|
||||
* @param string $app_uid, Uid for case
|
||||
* @param string $usr_uid, Uid user
|
||||
* @return array
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function deleteCase($app_uid)
|
||||
public function deleteCase($app_uid, $usr_uid)
|
||||
{
|
||||
Validator::isString($app_uid, '$app_uid');
|
||||
Validator::appUid($app_uid, '$app_uid');
|
||||
|
||||
$criteria = new \Criteria();
|
||||
$criteria->addSelectColumn( \ApplicationPeer::APP_STATUS );
|
||||
$criteria->addSelectColumn( \ApplicationPeer::APP_INIT_USER );
|
||||
$criteria->add( \ApplicationPeer::APP_UID, $app_uid, \Criteria::EQUAL );
|
||||
$dataset = \ApplicationPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
if ($aRow['APP_STATUS'] != 'DRAFT') {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_DELETE_CASE_NO_STATUS")));
|
||||
}
|
||||
|
||||
if ($aRow['APP_INIT_USER'] != $usr_uid) {
|
||||
throw (new \Exception(\G::LoadTranslation("ID_DELETE_CASE_NO_OWNER")));
|
||||
}
|
||||
|
||||
$case = new \Cases();
|
||||
$case->removeCase( $app_uid );
|
||||
}
|
||||
|
||||
@@ -190,12 +190,11 @@ class FilesManager
|
||||
break;
|
||||
}
|
||||
$content = $aData['prf_content'];
|
||||
if (is_string($content)) {
|
||||
if (file_exists($sDirectory)) {
|
||||
$directory = $sMainDirectory. PATH_SEP . $sSubDirectory . $aData['prf_filename'];
|
||||
throw new \Exception(\G::LoadTranslation("ID_EXISTS_FILE", array($directory)));
|
||||
}
|
||||
if (file_exists($sDirectory) ) {
|
||||
$directory = $sMainDirectory. PATH_SEP . $sSubDirectory . $aData['prf_filename'];
|
||||
throw new \Exception(\G::LoadTranslation("ID_EXISTS_FILE", array($directory)));
|
||||
}
|
||||
|
||||
if (!file_exists($sCheckDirectory)) {
|
||||
$sPkProcessFiles = \G::generateUniqueID();
|
||||
$oProcessFiles = new \ProcessFiles();
|
||||
@@ -555,4 +554,3 @@ class FilesManager
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -497,7 +497,10 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
//Setting as start Task
|
||||
//or
|
||||
//Remove as start Task
|
||||
$this->wp->setStartTask($arrayFlowData["FLO_ELEMENT_DEST"], $flagStartTask);
|
||||
$bwp = new self;
|
||||
if ($bwp->getActivity($arrayFlowData["FLO_ELEMENT_DEST"])) {
|
||||
$this->wp->setStartTask($arrayFlowData["FLO_ELEMENT_DEST"], $flagStartTask);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1384,6 +1387,10 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
|
||||
$activity = $bwp->getActivity($activityData["ACT_UID"]);
|
||||
|
||||
if ($activity["BOU_CONTAINER"] != $activityData["BOU_CONTAINER"]) {
|
||||
$activity = null;
|
||||
}
|
||||
|
||||
if ($forceInsert || is_null($activity)) {
|
||||
if ($generateUid) {
|
||||
//Generate and update UID
|
||||
|
||||
@@ -809,8 +809,9 @@ class Cases extends Api
|
||||
public function doDeleteCase($cas_uid)
|
||||
{
|
||||
try {
|
||||
$usr_uid = $this->getUserId();
|
||||
$cases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$cases->deleteCase($cas_uid);
|
||||
$cases->deleteCase($cas_uid, $usr_uid);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
|
||||
@@ -47,6 +47,10 @@ class DynaForm extends Api
|
||||
$dynaForm->setArrayFieldNameForException(array("processUid" => "prj_uid"));
|
||||
|
||||
$arrayData = $dynaForm->executeCreate($prj_uid, $request_data);
|
||||
if (!array_key_exists('dyn_content', $request_data)) {
|
||||
$request_data['dyn_content']="{}";
|
||||
}
|
||||
$arrayData = $dynaForm->update($arrayData['dyn_uid'], $request_data);
|
||||
|
||||
$response = $arrayData;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user