BUG 9136 Employment Application Process, web entry

- The hierachy of the modes was incorrect
- Fixed the hierachy of modes
This commit is contained in:
Julio Cesar Laura
2012-07-10 17:58:55 -04:00
parent 21e9f7d550
commit bb02ac5d9e

View File

@@ -124,11 +124,19 @@ class XmlForm_Field {
$this->options = (isset ( $this->option )) ? $this->option : array (); $this->options = (isset ( $this->option )) ? $this->option : array ();
//Sql Options : cause warning because values are not setted yet. //Sql Options : cause warning because values are not setted yet.
//if ($this->sql!=='') $this->executeSQL(); //if ($this->sql!=='') $this->executeSQL();
//maybe $ownerMode is not defined.. if (isset($owner)) {
$ownerMode = isset ( $owner->mode ) ? $owner->mode : 'edit'; if (isset($owner->mode)) {
if ($this->mode === '') $ownerMode = $owner->mode;
$this->mode = $ownerMode !== '' ? $ownerMode : 'edit'; } else {
$this->modeForGrid = $this->mode ; $ownerMode = '';
}
} else {
$ownerMode = '';
}
if ($ownerMode != '') {
$this->mode = $ownerMode;
}
$this->modeForGrid = $this->mode;
} }
/** /**
@@ -3196,10 +3204,22 @@ class XmlForm_Field_Grid extends XmlForm_Field
function renderGrid($values, $owner = NULL, $therow = -1) function renderGrid($values, $owner = NULL, $therow = -1)
{ {
$this->id = $this->owner->id . $this->name; $this->id = $this->owner->id . $this->name;
$using_template = "grid"; $using_template = 'grid';
if( $this->mode == 'view' || $this->modeGrid === 'view' ){ if (isset($this->mode)) {
$using_template = "grid_view"; $ownerMode = $this->mode;
} else {
$ownerMode = '';
}
if ($ownerMode != '') {
$this->mode = $ownerMode;
}
$this->modeForGrid = $this->mode;
if ($this->mode == 'view') {
$using_template = 'grid_view';
} }
$tpl = new xmlformTemplate ( $this, PATH_CORE . "templates/{$using_template}.html" ); $tpl = new xmlformTemplate ( $this, PATH_CORE . "templates/{$using_template}.html" );