Merged in dheeyi/processmaker/PM-3603 (pull request #2784)

PM-3603
This commit is contained in:
Julio Cesar Laura Avendaño
2015-09-15 08:42:52 -04:00
committed by Enrique Ponce De Leon
2 changed files with 16 additions and 6 deletions

View File

@@ -463,7 +463,6 @@ class Consolidated
$json = G::json_decode($dataTask["DYN_CONTENT"]);
$pmDyna->jsonr($json);
$fieldsDyna = $json->items[0]->items;
$xmlfrm = new \stdclass();
$xmlfrm->fields = array();
foreach ($fieldsDyna as $key => $value) {
@@ -478,7 +477,7 @@ class Consolidated
$temp->required = (isset($val->required)) ? $val->required : 0;
$temp->mode = (isset($val->mode)) ? $val->mode : 'edit';
if (!empty($val->options)) {
if (!empty($val->options) || !empty($val->optionsSql)) {
$temp->storeData = '[';
foreach ($val->options as $valueOption) {
if(isset($valueOption->value)){
@@ -487,6 +486,14 @@ class Consolidated
$temp->storeData .= '["' . $valueOption['value'] . '", "' . $valueOption['label'] . '"],';
}
}
foreach ($val->optionsSql as $valueOption) {
if(isset($valueOption->value)){
$temp->storeData .= '["' . $valueOption->value . '", "' . $valueOption->label . '"],';
}else{
$temp->storeData .= '["' . $valueOption['value'] . '", "' . $valueOption['label'] . '"],';
}
}
$temp->storeData = substr($temp->storeData,0,-1);
$temp->storeData .= ']';
}