X-Git-Url: http://git.pippins.net/embedvideo/.git/static/git-logo.png?a=blobdiff_plain;f=inc%2Fclass.eq.inc.php;h=9b59778a16192a093c58ed19d00f7b3c79536323;hb=5b890635d41024cad8348023e9fccae419ddaaca;hp=dd8cff777d6393019e1a1a319dee087b0a991949;hpb=991350fc9802caacbe14fa9052d7abd2e8fc00d6;p=eq%2F.git diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php index dd8cff7..9b59778 100644 --- a/inc/class.eq.inc.php +++ b/inc/class.eq.inc.php @@ -660,15 +660,15 @@ class eq $this->t->set_var('edit',$GLOBALS['phpgw']->link('/eq/index.php',$link_data)); $this->t->set_var('lang_edit','Edit'); - $link_data['menuaction'] = 'eq.eq.act_update'; - $link_data['activity'] = '0'; - $link_data['action'] = 'add'; - $this->t->set_var('add','
'); - $this->t->fp('list','act_list',True); } + $link_data['menuaction'] = 'eq.eq.act_update'; + $link_data['activity'] = '0'; + $link_data['action'] = 'add'; + $this->t->set_var('add','
'); + $this->t->pfp('out','act_list_t'); $this->save_sessiondata(); } @@ -772,12 +772,14 @@ class eq // Re-add the elders who are checked as having participated in this activity $elders = get_var('elder_name',array('POST')); - foreach ($elders as $elder) - { - $this->db->query("INSERT INTO eq_participation (elder,activity) " - . "VALUES (" . $elder . ",". $activity['activity'] . ")",__LINE__,__FILE__); - } - + if(is_array($elders)) { // Only do the foreach loop if we have a valid array of elders to work with + foreach ($elders as $elder) + { + $this->db->query("INSERT INTO eq_participation (elder,activity) " + . "VALUES (" . $elder . ",". $activity['activity'] . ")",__LINE__,__FILE__); + } + } + $this->act_list(); return false; } @@ -1599,7 +1601,7 @@ class eq $this->db2->query($sql,__LINE__,__FILE__); if(!$this->db2->next_record()) { - $sql = "SELECT * FROM eq_ppi WHERE elder=" . $id . " ORDER BY date DESC"; + $sql = "SELECT * FROM eq_ppi WHERE elder=" . $id . " AND eqpresppi=1 ORDER BY date DESC"; $this->db->query($sql,__LINE__,__FILE__); if($this->db->next_record()) { $date = $this->db->f('date'); } else { $date = ""; } $link_data['menuaction'] = 'eq.eq.ppi_update';