From 537c7d0bf300e4c3e1ad712e207f35d1a0fcb8c2 Mon Sep 17 00:00:00 2001 From: norahmollo Date: Tue, 18 Feb 2014 15:10:00 -0400 Subject: [PATCH] BUG-14031 Do not exist ProcessMaker fields attribute identifier in generated HTML It has been added field attribute identifier "pm_fieldtype" and "pm_gridtype" in class xmlform for HTML file generated. --- gulliver/system/class.xmlform.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index 929e97494..6f140e648 100755 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -921,7 +921,7 @@ class XmlForm_Field_Title extends XmlForm_Field public function render ($value = null, &$owner = null) { $this->label = G::replaceDataField( $this->label, $owner->values ); - return 'name . ']\' name=\'form[' . $this->name . ']\'' . $this->NSFieldType() . '>' . $this->htmlentities( $this->label ) . ''; + return 'name . ']\' name=\'form[' . $this->name . ']\' ' . $this->NSFieldType() . ' >' . $this->htmlentities( $this->label ) . ''; } /** @@ -956,7 +956,7 @@ class XmlForm_Field_Subtitle extends XmlForm_Field */ public function render ($value = null) { - return 'name . ']\' name=\'form[' . $this->name . ']\'' . $this->NSFieldType() . '>' . $this->htmlentities( $this->label ) . ''; + return 'name . ']\' name=\'form[' . $this->name . ']\' ' . $this->NSFieldType() . ' >' . $this->htmlentities( $this->label ) . ''; } /** @@ -1882,14 +1882,14 @@ class XmlForm_Field_Password extends XmlForm_Field if ($this->mode === 'edit') { if ($this->readOnly) { - return 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSFieldType() . 'readOnly="readOnly"/>'; + return 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSFieldType() . ' readOnly="readOnly"/>'; } else { $html = 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSFieldType() . '/>'; $html .= $this->renderHint(); return $html; } } elseif ($this->mode === 'view') { - $html = 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\'' . $this->NSFieldType() . ' readOnly="readOnly"/>'; + $html = 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSFieldType() . ' readOnly="readOnly"/>'; $html .= $this->htmlentities( str_repeat( '*', 10 ), ENT_COMPAT, 'utf-8' ); return $html; } else { @@ -2749,7 +2749,7 @@ class XmlForm_Field_Link extends XmlForm_Field $target = G::replaceDataField($this->target, $v); $html = "htmlentities($link, ENT_QUOTES, "utf-8") . "\""; - $html = $html . " id=\"form[$id]\" name=\"form[$id]\" pm:field=\"pm:field\""; + $html = $html . " id=\"form[$id]\" name=\"form[$id]\" pm:field=\"pm:field\" "; $html .= $this->NSFieldType() . ' '; if ((strrpos($_SERVER['HTTP_USER_AGENT'], "Chrome") === false ? false : true) && trim($this->htmlentities($link, ENT_QUOTES, "utf-8")) === "#") { $html = $html . (($this->onclick) ? " onclick=\"" . htmlentities($onclick, ENT_QUOTES, "utf-8") . " return false;\"" : " onclick=\" return false;\""); @@ -2906,7 +2906,7 @@ class XmlForm_Field_File extends XmlForm_Field $styleDisplay = "display: none;"; } - $html = $html1 . "name . "]\" name=\"form" . $rowId . "[" . $this->name . "]\" " .$this->NSFieldType(). " value=\"" . $value . "\"class=\"module_app_input___gray_file\" style=\"" . $styleDisplay . "\"" . $mode . " " . $this->NSRequiredValue() . " />" . $html2; + $html = $html1 . "name . "]\" name=\"form" . $rowId . "[" . $this->name . "]\" " .$this->NSFieldType(). " value=\"" . $value . "\" class=\"module_app_input___gray_file\" style=\"" . $styleDisplay . "\"" . $mode . " " . $this->NSRequiredValue() . " />" . $html2; if (isset( $this->input ) && $this->input != null) { require_once ("classes/model/InputDocument.php"); @@ -3197,7 +3197,7 @@ class XmlForm_Field_Button extends XmlForm_Field $onclick = G::replaceDataField( $this->onclick, $owner->values ); $label = G::replaceDataField( $this->label, $owner->values ); if ($this->mode === 'edit') { - $re = "style}\" class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" " . $this->NSFieldType() . "name=\"form[{$this->name}]\" type='button' value=\"{$label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; + $re = "style}\" class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" " . $this->NSFieldType() . " name=\"form[{$this->name}]\" type='button' value=\"{$label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; return $re; } elseif ($this->mode === 'view') { return "style};display:none\" disabled='disabled' class='module_app_button___gray module_app_buttonDisabled___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='button' value=\"{$label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; @@ -3232,7 +3232,7 @@ class XmlForm_Field_Reset extends XmlForm_Field //return ''; // return "style}\" $mode class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='reset' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities ( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; if ($this->mode === 'edit') { - return "style}\" $mode class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" " . $this->NSFieldType() . "name=\"form[{$this->name}]\" type='reset' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; + return "style}\" $mode class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" " . $this->NSFieldType() . " name=\"form[{$this->name}]\" type='reset' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; } elseif ($this->mode === 'view') { return "style};display:none\" $mode class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='reset' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; } else { @@ -3349,15 +3349,13 @@ class XmlForm_Field_Hidden extends XmlForm_Field $result = array (); $r = 1; foreach ($values as $v) { - $result[] = 'NSGridType() . 'value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" />'; + $result[] = 'NSGridType() . ' value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" />'; $r ++; } return $result; } - //$arrayResult[] = $this->render( $v, $owner, "[" . $owner->name . "][" . $r . "]", $r, $therow ); - /** * Render the field in a table * @@ -4571,7 +4569,7 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText if ($this->editable != "0") { $html = '' . '' . ' ' . '' . '' . ' ' . '' . ''; } else { - $html = 'NSFieldType() . 'pm:required="' . $isRequired . '" id="' . $pID . '" name="' . $pID . '" pm:mask="' . $mask . '" pm:start="' . $startDate . '" pm:end="' . $endDate . '" pm:time="' . $Time . '" ' . $onchange . ' class="module_app_input___gray" size="' . $sizeend . '" value="' . $value . '" pm:defaultvalue="' . $defaultValue . '" readonly="readonly" />' . '' . ' ' . '' . '' . ' ' . '' . ''; + $html = 'NSFieldType() . ' pm:required="' . $isRequired . '" id="' . $pID . '" name="' . $pID . '" pm:mask="' . $mask . '" pm:start="' . $startDate . '" pm:end="' . $endDate . '" pm:time="' . $Time . '" ' . $onchange . ' class="module_app_input___gray" size="' . $sizeend . '" value="' . $value . '" pm:defaultvalue="' . $defaultValue . '" readonly="readonly" />' . '' . ' ' . '' . '' . ' ' . '' . ''; } } else { $html = "$value" . '';