Commit 203601c3b5ec6e99e6b8e97547e586c797581b95

Authored by Eduardo Junior
1 parent 9e2498b2

fix new and edit instituicao. Fixes #40

Showing 1 changed file with 13 additions and 0 deletions   Show diff stats
ieducar/intranet/educar_instituicao_cad.php
@@ -194,6 +194,13 @@ class indice extends clsCadastro @@ -194,6 +194,13 @@ class indice extends clsCadastro
194 $obj->data_base_remanejamento = Portabilis_Date_Utils::brToPgSQL($this->data_base_remanejamento); 194 $obj->data_base_remanejamento = Portabilis_Date_Utils::brToPgSQL($this->data_base_remanejamento);
195 $obj->data_base_transferencia = Portabilis_Date_Utils::brToPgSQL($this->data_base_transferencia); 195 $obj->data_base_transferencia = Portabilis_Date_Utils::brToPgSQL($this->data_base_transferencia);
196 196
  197 + if ($this->data_base_remanejamento == '')
  198 + unset($obj->data_base_remanejamento);
  199 +
  200 + if ($this->data_base_transferencia == '')
  201 + unset($obj->data_base_transferencia);
  202 +
  203 +
197 $cadastrou = $obj->cadastra(); 204 $cadastrou = $obj->cadastra();
198 if( $cadastrou ) 205 if( $cadastrou )
199 { 206 {
@@ -218,6 +225,12 @@ class indice extends clsCadastro @@ -218,6 +225,12 @@ class indice extends clsCadastro
218 $obj->data_base_remanejamento = Portabilis_Date_Utils::brToPgSQL($this->data_base_remanejamento); 225 $obj->data_base_remanejamento = Portabilis_Date_Utils::brToPgSQL($this->data_base_remanejamento);
219 $obj->data_base_transferencia = Portabilis_Date_Utils::brToPgSQL($this->data_base_transferencia); 226 $obj->data_base_transferencia = Portabilis_Date_Utils::brToPgSQL($this->data_base_transferencia);
220 227
  228 + if ($this->data_base_remanejamento == '')
  229 + unset($obj->data_base_remanejamento);
  230 +
  231 + if ($this->data_base_transferencia == '')
  232 + unset($obj->data_base_transferencia);
  233 +
221 $editou = $obj->edita(); 234 $editou = $obj->edita();
222 if( $editou ) 235 if( $editou )
223 { 236 {