diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index 33fdb0450..89d9bc1e9 100755 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -834,6 +834,17 @@ class XmlForm_Field } } + /** + * Prepares NS Field Type + * + * @author Julio Cesar Laura + * @return string + */ + public function NSFieldType () + { + return 'pm:fieldtype="' . $this->type . '"'; + } + /** * Prepares NS Grid Type * @@ -993,12 +1004,12 @@ class XmlForm_Field_SimpleText extends XmlForm_Field $onkeypress = G::replaceDataField( $this->onkeypress, $owner->values ); if ($this->mode === 'edit') { if ($this->readOnly) { - return 'maxLength ) ? ' maxlength="' . $this->maxLength . '"' : '') . ' value=\'' . htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSRequiredValue() . ' readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>'; + return 'maxLength ) ? ' maxlength="' . $this->maxLength . '"' : '') . ' value=\'' . htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSRequiredValue() . ' ' . $this->NSFieldType() . ' readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>'; } else { - return 'maxLength ) ? ' maxlength="' . $this->maxLength . '"' : '') . ' value=\'' . htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSRequiredValue() . ' style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>'; + return 'maxLength ) ? ' maxlength="' . $this->maxLength . '"' : '') . ' value=\'' . htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSRequiredValue() . ' ' . $this->NSFieldType() . ' style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>'; } } elseif ($this->mode === 'view') { - return 'maxLength ) ? ' maxlength="' . $this->maxLength . '"' : '') . ' value=\'' . htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSRequiredValue() . ' style="display:none;' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . htmlentities( $value, ENT_COMPAT, 'utf-8' ); + return 'maxLength ) ? ' maxlength="' . $this->maxLength . '"' : '') . ' value=\'' . htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSRequiredValue() . ' ' . $this->NSFieldType() . ' style="display:none;' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>' . htmlentities( $value, ENT_COMPAT, 'utf-8' ); } else { return $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ); } @@ -1076,6 +1087,7 @@ class XmlForm_Field_Text extends XmlForm_Field_SimpleText public $sql = ''; public $sqlOption = array (); //Attributes only for grids + public $gridFieldType = 'text'; public $formula = ''; public $function = ''; public $replaceTags = 0; @@ -1145,6 +1157,7 @@ class XmlForm_Field_Text extends XmlForm_Field_SimpleText $html .= 'onkeypress="' . $this->htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '" '; $html .= $this->NSDefaultValue() . ' '; $html .= $this->NSRequiredValue() . ' '; + $html .= $this->NSFieldType() . ' '; $html .= 'pm:decimal_separator="' . $this->comma_separator . '" '; $html .= '/>'; } else { @@ -1256,6 +1269,7 @@ class XmlForm_Field_Suggest extends XmlForm_Field_SimpleText //by neyek public $sql = ''; public $sqlOption = array (); //Atributes only for grids + public $gridFieldType = 'suggest'; public $formula = ''; public $function = ''; public $replaceTags = 0; @@ -1330,14 +1344,14 @@ class XmlForm_Field_Suggest extends XmlForm_Field_SimpleText //by neyek if ($this->mode === 'edit') { if ($this->readOnly) { - return 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>'; + return 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSFieldType() . ' readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>'; } else { // $str = ''; if (strlen( trim( $formVariableValue ) ) > 0) { $value = $formVariableValue; } $name = "'" . $this->name . "'"; - $str = 'NSFieldType() . ' onblur="idSet(' . $name . ');" '; $str .= $this->NSDependentFields( true ) . ' '; $str .= '/>'; $str .= 'mode === 'edit') { if ($this->readOnly) { - return 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>'; + return 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSGridType() . ' readOnly="readOnly" style="' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" onkeypress="' . htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '"/>'; } else { if (strlen( trim( $formVariableValue ) ) > 0) { $value = $formVariableValue; } $name = "'" . $this->name . "'"; - $str = 'NSGridType() . ' onblur="idSet(' . $name . ');" '; $str .= $this->NSDependentFields( true ) . ' '; $str .= $this->NSRequiredValue() . ' '; $str .= $this->NSGridLabel() . ' '; @@ -2093,7 +2107,7 @@ class XmlForm_Field_Currency extends XmlForm_Field_SimpleText $html .= 'onkeypress="' . $this->htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '" '; $html .= $this->NSDefaultValue() . ' '; $html .= $this->NSRequiredValue() . ' '; - $html .= $this->NSGridType() . ' '; + $html .= $this->NSFieldType() . ' '; $html .= 'pm:decimal_separator="' . $this->comma_separator . '" '; $html .= '/>'; } else { @@ -2230,6 +2244,7 @@ class XmlForm_Field_Percentage extends XmlForm_Field_SimpleText $html .= 'onkeypress="' . $this->htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '" '; $html .= $this->NSDefaultValue() . ' '; $html .= $this->NSRequiredValue() . ' '; + $html .= $this->NSFieldType() . ' '; $html .= 'pm:decimal_separator="' . $this->comma_separator . '" '; $html .= '/>'; } else { @@ -2605,6 +2620,7 @@ class XmlForm_Field_YesNo extends XmlForm_Field $html .= 'name="form[' . $this->name . ']" '; $html .= $this->NSDefaultValue() . ' '; $html .= $this->NSRequiredValue() . ' '; + $html .= $this->NSFieldType() . ' '; $html .= '>'; $html .= ''; $html .= ''; @@ -3428,7 +3444,7 @@ class XmlForm_Field_Dropdown extends XmlForm_Field $html .= $this->NSRequiredValue() . ' '; $html .= $this->NSDefaultValue() . ' '; $html .= $this->NSGridLabel() . ' '; - $html .= $this->NSGridType() . ' '; + $html .= $rowId == '' ? $this->NSFieldType() : $this->NSGridType() . ' '; $html .= $this->NSDependentFields( true ) . ' '; $html .= '>'; $findValue = ''; @@ -3561,7 +3577,7 @@ class XmlForm_Field_Listbox extends XmlForm_Field if ($this->width != '') { $itemWidth = 'style="width:' . $this->width . '"'; } - $html = 'NSFieldType() . '>'; foreach ($this->option as $optionName => $option) { $html .= ''; } @@ -3573,7 +3589,7 @@ class XmlForm_Field_Listbox extends XmlForm_Field $html .= $this->renderHint(); return $html; } elseif ($this->mode === 'view') { - $html = 'NSFieldType() . ' disabled>'; //disabled>'; foreach ($this->option as $optionName => $option) { if ((in_array( $optionName, $value )) == 1) { $html .= ' '; @@ -4305,10 +4321,10 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText $mask = str_replace( "%", "", $this->mask ); $v = date( masktophp($mask, $v) ); } - $html = 'NSRequiredValue() . ' class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" required="' . $isRequired . '" style="display:none;' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '"/>' . htmlentities( $v, ENT_COMPAT, 'utf-8' ); + $html = 'NSRequiredValue() . ' class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" required="' . $isRequired . '" style="display:none;' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" ' . $this->NSGridType() . '/>' . htmlentities( $v, ENT_COMPAT, 'utf-8' ); } else { $id = 'form[' . $owner->name . '][' . $r . '][' . $this->name . ']'; - $html = $this->__draw_widget( $id, $v, $owner ); + $html = $this->__draw_widget( $id, $v, $owner, true ); } } else { $html = $v; @@ -4327,7 +4343,7 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText * @param $owner * @return */ - public function __draw_widget ($pID, $value, $owner = '') + public function __draw_widget ($pID, $value, $owner = '', $inGrid = false) { $startDate = G::replaceDataField( $this->startDate, $owner->values ); $endDate = G::replaceDataField( $this->endDate, $owner->values ); @@ -4453,9 +4469,9 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText $isRequired = '0'; } if ($this->editable != "0") { - $html = '' . ' ' . ' ' . '' . '' . ' ' . '' . ''; + $html = 'NSFieldType() : $this->NSGridType()) . '/>' . ' ' . ' ' . '' . '' . ' ' . '' . ''; } else { - $html = '' . '' . ' ' . '' . '' . ' ' . '' . ''; + $html = 'NSFieldType() : $this->NSGridType()) . ' />' . '' . ' ' . '' . '' . ' ' . '' . ''; } } else { $html = "$value" . ''; diff --git a/workflow/engine/methods/dynaforms/fieldsGetterAjax.php b/workflow/engine/methods/dynaforms/fieldsGetterAjax.php index 555dfcdd3..0114b8386 100755 --- a/workflow/engine/methods/dynaforms/fieldsGetterAjax.php +++ b/workflow/engine/methods/dynaforms/fieldsGetterAjax.php @@ -50,9 +50,6 @@ function validateGridConversion ($gridFields) case 'checkgroup': $invalidFields[] = $value['XMLNODE_NAME']; break; - case 'file': - $invalidFields[] = $value['XMLNODE_NAME']; - break; case 'javascript': $invalidFields[] = $value['XMLNODE_NAME']; break;