diff --git a/workflow/engine/classes/class.reportTables.php b/workflow/engine/classes/class.reportTables.php index 657a4797b..4a290f566 100755 --- a/workflow/engine/classes/class.reportTables.php +++ b/workflow/engine/classes/class.reportTables.php @@ -603,6 +603,9 @@ class ReportTables if(is_array($aFields[$aField['sFieldName']])){ $sQuery .= "'" . (isset( $aFields[$aField['sFieldName']] ) ? $aFields[$aField['sFieldName']][0] : '') . "',"; }else{ + if (!isset($aFields[$aField['sFieldName'] . '_label'])) { + $aFields[$aField['sFieldName'].'_label'] = ''; + } if($aFields[$aField['sFieldName']] == $aFields[$aField['sFieldName'].'_label']){ $sQuery .= "'" . (isset( $aFields[$aField['sFieldName']] ) ? @mysql_real_escape_string( $aFields[$aField['sFieldName']] ) : '') . "',"; }else{ diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Consolidated.php b/workflow/engine/src/ProcessMaker/BusinessModel/Consolidated.php index 328a12172..a423d4ca8 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Consolidated.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Consolidated.php @@ -467,47 +467,46 @@ class Consolidated $xmlfrm->fields = array(); foreach ($fieldsDyna as $key => $value) { foreach ($value as $val) { - if ($val->type == 'title' || $val->type == 'submit' || $val->type == 'panel' || $val->type == 'image' || $val->type == 'button' || $val->type == 'grid' || $val->type == 'checkgroup' || $val->type == 'radiogroup' || $val->type == 'radio' || $val->type == 'hidden' || $val->type == 'link' || $val->type == 'file' || $val->type == 'subform' || $val->type == 'label') { - continue; - } - $temp = new \stdclass(); - $temp->type = $val->type; - $temp->label = $val->label; - $temp->name = $val->name; - $temp->required = (isset($val->required)) ? $val->required : 0; - $temp->mode = (isset($val->mode)) ? $val->mode : 'edit'; + if (isset($val->type) && ($val->type == 'text' || $val->type == 'textarea' || $val->type == 'dropdown' || $val->type == 'checkbox' || $val->type == 'datetime')) { + $temp = new \stdclass(); + $temp->type = $val->type; + $temp->label = $val->label; + $temp->name = $val->name; + $temp->required = (isset($val->required)) ? $val->required : 0; + $temp->mode = (isset($val->mode)) ? $val->mode : 'edit'; - if ((isset($val->options) && !empty($val->options)) || (isset($val->optionsSql) && !empty($val->optionsSql))) { - $temp->storeData = '['; + if ((isset($val->options) && !empty($val->options)) || (isset($val->optionsSql) && !empty($val->optionsSql))) { + $temp->storeData = '['; - if (isset($val->options) && !empty($val->options)) { - foreach ($val->options as $valueOption) { - if(isset($valueOption->value)){ - $temp->storeData .= '["' . $valueOption->value . '", "' . $valueOption->label . '"],'; - }else{ - $temp->storeData .= '["' . $valueOption['value'] . '", "' . $valueOption['label'] . '"],'; + if (isset($val->options) && !empty($val->options)) { + foreach ($val->options as $valueOption) { + if (isset($valueOption->value)) { + $temp->storeData .= '["' . $valueOption->value . '", "' . $valueOption->label . '"],'; + } else { + $temp->storeData .= '["' . $valueOption['value'] . '", "' . $valueOption['label'] . '"],'; + } } } - } - if (isset($val->optionsSql) && !empty($val->optionsSql)) { - foreach ($val->optionsSql as $valueOption) { - if(isset($valueOption->value)){ - $temp->storeData .= '["' . $valueOption->value . '", "' . $valueOption->label . '"],'; - }else{ - $temp->storeData .= '["' . $valueOption['value'] . '", "' . $valueOption['label'] . '"],'; + if (isset($val->optionsSql) && !empty($val->optionsSql)) { + 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 .= ']'; } - $temp->storeData = substr($temp->storeData,0,-1); - $temp->storeData .= ']'; - } - - $temp->readOnly = ($temp->mode == 'view') ? "1" : "0"; - $temp->colWidth = 200; - $xmlfrm->fields[] = $temp; + $temp->readOnly = ($temp->mode == 'view') ? "1" : "0"; + $temp->colWidth = 200; + $xmlfrm->fields[] = $temp; } + } } } else { $filename = $pro_uid . PATH_SEP . $dyn_uid . ".xml";