Merge branch 'master' of bitbucket.org:colosa/processmaker into PM-940
This commit is contained in:
@@ -186,6 +186,7 @@ EOT
|
||||
CLI::taskArg("workspace-name", true, true);
|
||||
CLI::taskRun("run_database_generate_self_service_by_value");
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
CLI::taskName("check-workspace-disabled-code");
|
||||
CLI::taskDescription(<<<EOT
|
||||
Check disabled code for the specified workspace(s).
|
||||
@@ -198,6 +199,7 @@ EOT
|
||||
);
|
||||
CLI::taskArg("workspace-name", true, true);
|
||||
CLI::taskRun("run_check_workspace_disabled_code");
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
/**
|
||||
* Function run_info
|
||||
@@ -579,7 +581,7 @@ function run_database_generate_self_service_by_value($args, $opts)
|
||||
echo CLI::error($e->getMessage()) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
function run_check_workspace_disabled_code($args, $opts)
|
||||
{
|
||||
try {
|
||||
@@ -630,4 +632,4 @@ function run_check_workspace_disabled_code($args, $opts)
|
||||
echo CLI::error($e->getMessage()) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
@@ -923,6 +923,7 @@ class Applications
|
||||
|
||||
$stepItem['title'] = $oDocument->getDynTitle();
|
||||
$stepItem['url'] = "cases/cases_Step?UID=$stepUid&TYPE=$stepType&POSITION=$stepPosition&ACTION=EDIT";
|
||||
$stepItem['version'] = $oDocument->getDynVersion();
|
||||
break;
|
||||
case 'OUTPUT_DOCUMENT':
|
||||
$oDocument = OutputDocumentPeer::retrieveByPK( $caseStep->getStepUidObj() );
|
||||
|
||||
@@ -46,21 +46,6 @@ $(window).load(function () {
|
||||
|
||||
var form = document.getElementsByTagName("form")[0];
|
||||
|
||||
var el = form.elements;
|
||||
var dt = data.items[0].items;
|
||||
for (var i = 0; i < dt.length; i++) {
|
||||
var dr = dt[i];
|
||||
for (var j = 0; j < dr.length; j++) {
|
||||
if (dr[j].name) {
|
||||
for (var k = 0; k < el.length; k++) {
|
||||
if (el[k].name === dr[j].name) {
|
||||
el[k].name = "form[" + dr[j].name + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var type = document.createElement("input");
|
||||
type.type = "hidden";
|
||||
type.name = "TYPE";
|
||||
|
||||
@@ -1424,11 +1424,12 @@ class Cases
|
||||
* @access public
|
||||
* @param string $app_uid, Uid for case
|
||||
* @param array $app_data, Data for case variables
|
||||
* @param string $dyn_uid, Uid for dynaform
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function setCaseVariables($app_uid, $app_data)
|
||||
public function setCaseVariables($app_uid, $app_data, $dyn_uid = null)
|
||||
{
|
||||
Validator::isString($app_uid, '$app_uid');
|
||||
Validator::appUid($app_uid, '$app_uid');
|
||||
@@ -1436,7 +1437,18 @@ class Cases
|
||||
|
||||
$case = new \Cases();
|
||||
$fields = $case->loadCase($app_uid);
|
||||
$data['APP_DATA'] = array_merge($fields['APP_DATA'], $app_data);
|
||||
$_POST['form'] = $app_data;
|
||||
|
||||
if (!is_null($dyn_uid)) {
|
||||
$oDynaform = \DynaformPeer::retrieveByPK($dyn_uid);
|
||||
|
||||
if ($oDynaform->getDynVersion() < 2) {
|
||||
$oForm = new \Form ( $fields['PRO_UID'] . "/" . $dyn_uid, PATH_DYNAFORM );
|
||||
$oForm->validatePost();
|
||||
}
|
||||
}
|
||||
|
||||
$data['APP_DATA'] = array_merge($fields['APP_DATA'], $_POST['form']);
|
||||
$case->updateCase($app_uid, $data);
|
||||
}
|
||||
|
||||
@@ -1905,5 +1917,57 @@ class Cases
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Put execute triggers
|
||||
*
|
||||
* @access public
|
||||
* @param string $app_uid , Uid for case
|
||||
* @param int $del_index , Index for case
|
||||
* @param string $obj_type , Index for case
|
||||
* @param string $obj_uid , Index for case
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function putExecuteTriggers($app_uid, $del_index, $obj_type, $obj_uid)
|
||||
{
|
||||
Validator::isString($app_uid, '$app_uid');
|
||||
Validator::appUid($app_uid, '$app_uid');
|
||||
Validator::isInteger($del_index, '$del_index');
|
||||
|
||||
$oCase = new \Cases();
|
||||
$aField = $oCase->loadCase($app_uid, $del_index);
|
||||
$tas_uid = $aField["TAS_UID"];
|
||||
|
||||
$task = new \Tasks();
|
||||
$aField["APP_DATA"] = $oCase->executeTriggers($tas_uid, $obj_type, $obj_uid, "AFTER", $aField["APP_DATA"]);
|
||||
$aField = $oCase->updateCase($app_uid, $aField);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Steps evaluate
|
||||
*
|
||||
* @access public
|
||||
* @param string $app_uid, Uid for case
|
||||
* @param int $del_index , Index for case
|
||||
* @return array
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*/
|
||||
public function getSteps($app_uid, $del_index)
|
||||
{
|
||||
Validator::isString($app_uid, '$app_uid');
|
||||
Validator::appUid($app_uid, '$app_uid');
|
||||
Validator::isInteger($del_index, '$del_index');
|
||||
|
||||
$oCase = new \Cases();
|
||||
$aCaseField = $oCase->loadCase($app_uid, $del_index);
|
||||
$tas_uid = $aCaseField["TAS_UID"];
|
||||
$pro_uid = $aCaseField["PRO_UID"];
|
||||
|
||||
$oApplication = new \Applications();
|
||||
$aField = $oApplication->getSteps($app_uid, $del_index, $tas_uid, $pro_uid);
|
||||
|
||||
return $aField;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -610,6 +610,7 @@ class Variable
|
||||
$variableSql = "";
|
||||
$sqlLimit = "";
|
||||
$variableSqlLimit = "";
|
||||
$sqlConditionLike = "";
|
||||
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
|
||||
@@ -838,17 +838,18 @@ class Cases extends Api
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
* @param array $request_data
|
||||
* @param string $dyn_uid {@from path}
|
||||
*
|
||||
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url PUT /:app_uid/variable
|
||||
*/
|
||||
public function doPutCaseVariables($app_uid, $request_data)
|
||||
public function doPutCaseVariables($app_uid, $request_data, $dyn_uid = '')
|
||||
{
|
||||
try {
|
||||
$cases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$cases->setCaseVariables($app_uid, $request_data);
|
||||
$cases->setCaseVariables($app_uid, $request_data, $dyn_uid);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
@@ -994,5 +995,48 @@ class Cases extends Api
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute triggers
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
* @param int $del_index {@from body}
|
||||
* @param string $obj_type {@from body}
|
||||
* @param string $obj_uid {@from body}
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url PUT /:app_uid/execute-triggers
|
||||
*/
|
||||
public function doPutExecuteTriggers($app_uid, $del_index, $obj_type, $obj_uid)
|
||||
{
|
||||
try {
|
||||
$cases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$cases->putExecuteTriggers($app_uid, $del_index, $obj_type, $obj_uid);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET /:app_uid/:del_index/steps
|
||||
*
|
||||
* @param string $app_uid {@min 32}{@max 32}
|
||||
* @param int $del_index
|
||||
*
|
||||
*/
|
||||
public function doGetSteps($app_uid, $del_index)
|
||||
{
|
||||
try {
|
||||
$case = new \ProcessMaker\BusinessModel\Cases();
|
||||
$case->setFormatFieldNameInUppercase(false);
|
||||
|
||||
$response = $case->getSteps($app_uid, $del_index);
|
||||
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -132,10 +132,10 @@
|
||||
<a href="#" class="mafe-menu-variable"></a>
|
||||
<a href="#" class="btn_create mafe-menu-variable-create"><span></span></a>
|
||||
</li>
|
||||
<li>
|
||||
<!--<li>
|
||||
<a href="#" class="mafe-menu-eventmessages"></a>
|
||||
<a href="#" class="btn_create mafe-menu-eventmessages-create"><span></span></a>
|
||||
</li>
|
||||
</li>-->
|
||||
<li>
|
||||
<a href="#" class="mafe-menu-dynaform"></a>
|
||||
<a href="#" class="btn_create mafe-menu-dynaform-create"><span></span></a>
|
||||
|
||||
@@ -967,7 +967,7 @@ function validateFieldSizeAutoincrement(valueType, defaultValue) {
|
||||
|
||||
items.push({
|
||||
id: 'REP_TAB_NAME',
|
||||
fieldLabel: _("ID_TABLE_NAME") + ' <span style="font-size:9">('+_("ID_AUTO_PREFIX") + ' "PMT")</span>',
|
||||
fieldLabel: _("ID_TABLE_NAME") + ' <span style="font-size:9">('+_("ID_AUTO_PREFIX") + ' "PMT_")</span>',
|
||||
xtype:'textfield',
|
||||
emptyText: _("ID_SET_A_TABLE_NAME"),
|
||||
width: 250,
|
||||
|
||||
Reference in New Issue
Block a user