Permalink
Browse files

fixed ivpmodel bug on updating consultation

  • Loading branch information...
1 parent 33c25d0 commit 28dc77efb1c127b3245e0a6da707be0d417439ce @cpf-ch cpf-ch committed Jun 13, 2011
Showing with 8 additions and 2 deletions.
  1. +8 −2 application/models/ivpmodel.php
@@ -201,13 +201,19 @@ function update($old_ivp) {
if ($cid->num_rows() > 0) {
$row = $cid->row_array();
$consultation = $row['id'];
+ if (!isset($old_ivp['consultation']) || $old_ivp['consultation'] != $consultation) {
+ $change = array('consultation' => $consultation);
+ $this->db->where('id', $ivpid);
+ $this->db->update('ivps', $change);
+ $changed = TRUE;
+ }
}
}
$changes = array();
- $local_attribs = array('consultation', 'occasion', 'dialogue',
- 'measure', 'iv_minutes', 'own', 'group', 'misc');
+ $local_attribs = array('occasion', 'dialogue', 'measure',
+ 'iv_minutes', 'own', 'group', 'misc');
foreach ($local_attribs as $la) {
if ($new = $this->input->post($la)) {

0 comments on commit 28dc77e

Please sign in to comment.