Merged master into fixing-broken-features

This commit is contained in:
Veronica Aruquipa
2015-01-09 09:37:46 -04:00
8 changed files with 72 additions and 25 deletions

View File

@@ -230,8 +230,7 @@ def buildMafe(homeDir, targetDir, mode)
"#{homeDir}/build/js/designer.js" => "#{mafeDir}/designer.min.js",
"#{homeDir}/build/js/mafe.js" => "#{mafeDir}/mafe.min.js",
"#{homeDir}/build/css/mafe.css" => "#{mafeDir}/mafe.min.css",
"#{homeDir}/img/*.*" => "#{imgTargetDir}",
"#{homeDir}/srcForm/img/*.*" => "#{imgTargetDir}"
"#{homeDir}/img/*.*" => "#{imgTargetDir}"
})
puts "\nCopying lib files into: #{jsTargetDir}".bold

View File

@@ -69,8 +69,10 @@ pake_task('workspace-backup', 'project_exists');
pake_desc("restore a previously backed-up workspace\n args: [-o|--overwrite] <filename> <workspace>");
pake_task('workspace-restore', 'project_exists');
/*----------------------------------********---------------------------------*/
pake_desc("check standard code\n args: <directory>");
pake_task('check-standard-code', 'project_exists' );
/*----------------------------------********---------------------------------*/
/**
* Function run_version

View File

@@ -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";

View File

@@ -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,30 @@ class Cases
throw $e;
}
}
}
/**
* Put execute triggers
*
* @access public
* @param string $app_uid , Uid for case
* @param bool|string $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);
}
}

View File

@@ -610,6 +610,7 @@ class Variable
$variableSql = "";
$sqlLimit = "";
$variableSqlLimit = "";
$sqlConditionLike = "";
$criteria = new \Criteria("workflow");

View File

@@ -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,27 @@ class Cases extends Api
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* Execute triggers
*
* @param string $app_uid {@min 1}{@max 32}
* @param string $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()));
}
}
}

View File

@@ -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>

View File

@@ -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,