BUG 0000 Problem in file type on dynaform when has a input doc linked. FIXED!

This commit is contained in:
Erik Amaru Ortiz
2012-01-06 11:34:42 -04:00
parent 350cf82714
commit 90770bd0bb
2 changed files with 14 additions and 5 deletions

View File

@@ -2198,16 +2198,25 @@ class XmlForm_Field_File extends XmlForm_Field {
if($this->mode == 'view'){
$displayStyle = 'display:none;';
$html = $value.'<input class="module_app_input___gray_file" ' . $mode .'style='.$displayStyle .' id="form[' . $this->name . ']" name="form[' . $this->name . ']" type=\'file\' value=\'' . $value . '\' />';
}else{
}
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 != ''){
if( isset($this->input) && $this->input != '') {
require_once 'classes/model/InputDocument.php';
$oiDoc = new InputDocument;
try {
$aDoc = $oiDoc->load($this->input);
$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>';
}
catch (Exception $e) {
// then the input document doesn't exits, id referencial broken
$html .= '&nbsp;<font color="red"><img src="/images/alert_icon.gif" width="16px" width="16px"/><font size="1">('.G::loadTranslation('ID_INPUT_DOC_DOESNT_EXIST').')</font></font>';
}
}
$html .= $this->renderHint();
return $html;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 496 B

After

Width:  |  Height:  |  Size: 226 B