BUG 6881 solucionado problema con campos tipo file en modo view

This commit is contained in:
Alvaro Campos
2011-07-26 16:17:22 -04:00
parent 5b22027acc
commit 327ede5ed0

View File

@@ -2177,10 +2177,12 @@ class XmlForm_Field_File extends XmlForm_Field {
* @return string
*/
function render($value = NULL) {
$mode = ($this->mode == 'view') ? ' disabled="disabled"' : '';
$html = '<input class="module_app_input___gray_file" ' . $mode . 'id="form[' . $this->name . ']" name="form[' . $this->name . ']" type=\'file\' value=\'' . $value . '\'/>';
if($this->mode == 'view'){
$mode = ($this->mode == 'view') ? ' disabled="disabled"' : '';
$html = '<input class="module_app_input___gray_file" ' . $mode . 'id="form[' . $this->name . ']" name="form[' . $this->name . ']" type=\'text\' value=\'' . $value . '\'/>';
}else{
$html = '<input class="module_app_input___gray_file" ' . $mode . 'id="form[' . $this->name . ']" name="form[' . $this->name . ']" type=\'file\' value=\'' . $value . '\'/>';
}
if( isset($this->input) && $this->input != ''){
require_once 'classes/model/InputDocument.php';
$oiDoc = new InputDocument;
@@ -2188,7 +2190,6 @@ class XmlForm_Field_File extends XmlForm_Field {
$aDoc['INP_DOC_TITLE'] = isset($aDoc['INP_DOC_TITLE'])? $aDoc['INP_DOC_TITLE']: '';
$html .= '<label><img src="/images/inputdocument.gif" width="22px" width="22px"/><font size="1">('.trim($aDoc['INP_DOC_TITLE']).')</font></label>';
}
$html .= $this->renderHint();
return $html;
}