Merged in darojas/processmaker (pull request #648)
Se agrega al end point de PROCESS_VARIABLES, las variables de los nuevos dynaforms. Se corrige code style en VARIABLE y bug en DYNAFORM
This commit is contained in:
@@ -1014,6 +1014,7 @@ class DynaForm
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$arrayVariables = array();
|
$arrayVariables = array();
|
||||||
|
$arrayVariablesDef = array();
|
||||||
//Verify data
|
//Verify data
|
||||||
Validator::proUid($projectUid, '$prj_uid');
|
Validator::proUid($projectUid, '$prj_uid');
|
||||||
$this->throwExceptionIfNotExistsDynaForm($dynaFormUid, "", $this->arrayFieldNameForException["dynaFormUid"]);
|
$this->throwExceptionIfNotExistsDynaForm($dynaFormUid, "", $this->arrayFieldNameForException["dynaFormUid"]);
|
||||||
@@ -1096,9 +1097,6 @@ class DynaForm
|
|||||||
if (isset($value[0]["readonly"])) {
|
if (isset($value[0]["readonly"])) {
|
||||||
$aVariables = array_merge(array('readonly' => $value[0]["readonly"]), $aVariables);
|
$aVariables = array_merge(array('readonly' => $value[0]["readonly"]), $aVariables);
|
||||||
}
|
}
|
||||||
if (isset($value[0]["readonly"])) {
|
|
||||||
$aVariables = array_merge(array('readonly' => $value[0]["readonly"]), $aVariables);
|
|
||||||
}
|
|
||||||
if (isset($value[0]["colSpan"])) {
|
if (isset($value[0]["colSpan"])) {
|
||||||
$aVariables = array_merge(array('colSpan' => $value[0]["colSpan"]), $aVariables);
|
$aVariables = array_merge(array('colSpan' => $value[0]["colSpan"]), $aVariables);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1512,7 +1512,8 @@ class Process
|
|||||||
return array(
|
return array(
|
||||||
$this->getFieldNameByFormatFieldName("VAR_NAME") => trim($record["name"]),
|
$this->getFieldNameByFormatFieldName("VAR_NAME") => trim($record["name"]),
|
||||||
$this->getFieldNameByFormatFieldName("VAR_LABEL") => trim($record["label"]),
|
$this->getFieldNameByFormatFieldName("VAR_LABEL") => trim($record["label"]),
|
||||||
$this->getFieldNameByFormatFieldName("VAR_TYPE") => trim($record["type"])
|
$this->getFieldNameByFormatFieldName("VAR_TYPE") => trim($record["type"]),
|
||||||
|
$this->getFieldNameByFormatFieldName("VAR_SOURCE") => trim($record["source"])
|
||||||
);
|
);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
@@ -1566,8 +1567,12 @@ class Process
|
|||||||
$arrayVar = self::getDynaformsVars($processUid);
|
$arrayVar = self::getDynaformsVars($processUid);
|
||||||
|
|
||||||
foreach ($arrayVar as $key => $value) {
|
foreach ($arrayVar as $key => $value) {
|
||||||
$arrayVariable[] = $this->getVariableDataFromRecord(array("name" => $value["sName"], "label" => $value["sLabel"], "type" => $value["sType"]));
|
$arrayVariable[] = $this->getVariableDataFromRecord(array("name" => $value["sName"], "label" => $value["sLabel"], "type" => $value["sType"], "source" => $value["sUid"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$arrayHtmlVariable = self::getHtmlFormVars($processUid);
|
||||||
|
$arrayVariable = array_merge($arrayVariable, $arrayHtmlVariable);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1633,10 +1638,10 @@ class Process
|
|||||||
if ($bSystemVars) {
|
if ($bSystemVars) {
|
||||||
$aAux = G::getSystemConstants();
|
$aAux = G::getSystemConstants();
|
||||||
foreach ($aAux as $sName => $sValue) {
|
foreach ($aAux as $sName => $sValue) {
|
||||||
$aFields[] = array ('sName' => $sName,'sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES'));
|
$aFields[] = array ('sName' => $sName,'sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES'), 'sUid' => '');
|
||||||
}
|
}
|
||||||
//we're adding the ping variable to the system list
|
//we're adding the ping variable to the system list
|
||||||
$aFields[] = array ('sName' => 'PIN','sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES'));
|
$aFields[] = array ('sName' => 'PIN','sType' => 'system','sLabel' => G::LoadTranslation('ID_TINY_SYSTEM_VARIABLES'), 'sUid' => '');
|
||||||
}
|
}
|
||||||
|
|
||||||
$aInvalidTypes = array("title", "subtitle", "file", "button", "reset", "submit", "javascript");
|
$aInvalidTypes = array("title", "subtitle", "file", "button", "reset", "submit", "javascript");
|
||||||
@@ -1648,6 +1653,7 @@ class Process
|
|||||||
|
|
||||||
$oCriteria = new Criteria( 'workflow' );
|
$oCriteria = new Criteria( 'workflow' );
|
||||||
$oCriteria->addSelectColumn( \DynaformPeer::DYN_FILENAME );
|
$oCriteria->addSelectColumn( \DynaformPeer::DYN_FILENAME );
|
||||||
|
$oCriteria->addSelectColumn( \DynaformPeer::DYN_UID );
|
||||||
$oCriteria->add( \DynaformPeer::PRO_UID, $sProcessUID );
|
$oCriteria->add( \DynaformPeer::PRO_UID, $sProcessUID );
|
||||||
$oCriteria->add( \DynaformPeer::DYN_TYPE, 'xmlform' );
|
$oCriteria->add( \DynaformPeer::DYN_TYPE, 'xmlform' );
|
||||||
$oDataset = \DynaformPeer::doSelectRS( $oCriteria );
|
$oDataset = \DynaformPeer::doSelectRS( $oCriteria );
|
||||||
@@ -1678,8 +1684,8 @@ class Process
|
|||||||
$aFields[] = array (
|
$aFields[] = array (
|
||||||
'sName' => $field->tagName,
|
'sName' => $field->tagName,
|
||||||
'sType' => $field->getAttribute("type"),
|
'sType' => $field->getAttribute("type"),
|
||||||
'sLabel' => ($field->getAttribute("type") != 'grid' ? $label : '[ ' . G::LoadTranslation('ID_GRID') . ' ]')
|
'sLabel' => ($field->getAttribute("type") != 'grid' ? $label : '[ ' . G::LoadTranslation('ID_GRID') . ' ]'),
|
||||||
);
|
'sUid' => $aRow['DYN_UID']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1777,5 +1783,44 @@ class Process
|
|||||||
|
|
||||||
return $aFields;
|
return $aFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function getHtmlFormVars
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @param string $sProcessUID
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function getHtmlFormVars ($sProcessUID)
|
||||||
|
{
|
||||||
|
//Get data
|
||||||
|
$criteria = new \Criteria("workflow");
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_UID);
|
||||||
|
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_NAME);
|
||||||
|
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_LABEL);
|
||||||
|
$criteria->addSelectColumn(\ProcessVariablesPeer::VAR_FIELD_TYPE);
|
||||||
|
|
||||||
|
$criteria->add(\ProcessVariablesPeer::PRJ_UID, $sProcessUID, \Criteria::EQUAL);
|
||||||
|
|
||||||
|
$rsCriteria = \ProcessVariablesPeer::doSelectRS($criteria);
|
||||||
|
|
||||||
|
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
|
$rsCriteria->next();
|
||||||
|
$arrayVariables = array();
|
||||||
|
|
||||||
|
while ($aRow = $rsCriteria->getRow()) {
|
||||||
|
$arrayVariables[] = array( 'var_name' => $aRow['VAR_NAME'],
|
||||||
|
'var_label' => $aRow['VAR_LABEL'],
|
||||||
|
'var_type' => $aRow['VAR_FIELD_TYPE'],
|
||||||
|
'var_source' => $aRow['VAR_UID']);
|
||||||
|
$rsCriteria->next();
|
||||||
|
}
|
||||||
|
//Return
|
||||||
|
return $arrayVariables;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -581,7 +581,7 @@ class Variable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
|
|||||||
Reference in New Issue
Block a user