Hi. i tryed to get some parent field usiong action_listview.php with some query.
this in controller.phpCode:function action_ListView() { $this->view = 'list'; $GLOBALS['view'] = $this->view; global $db; $query = "select (CASE WHEN c.priority='P0' THEN s.slacrireshw ELSE (CASE WHEN c.priority='P1' THEN s.slaaltreshw ELSE (CASE WHEN c.priority='P2' THEN s.slamedreshw ELSE s.slabaireshw END) END) END) as slareshw, " . "(CASE WHEN c.priority='P0' THEN s.slacriressw ELSE (CASE WHEN c.priority='P1' THEN s.slaaltressw ELSE (CASE WHEN c.priority='P2' THEN s.slamedressw ELSE s.slabairessw END) END) END) as slaressw, s.description, " . "ADDTIME(SUBTIME(c.date_entered,'03:00:00'), (CASE WHEN c.type='Software' THEN (CASE WHEN c.priority='P0' THEN s.slacriressw ELSE (CASE WHEN c.priority='P1' THEN s.slaaltressw ELSE (CASE WHEN c.priority='P2' THEN s.slamedressw ELSE s.slabairessw END) END) END) ELSE (CASE WHEN c.priority='P0' THEN s.slacrireshw ELSE (CASE WHEN c.priority='P1' THEN s.slaaltreshw ELSE (CASE WHEN c.priority='P2' THEN s.slamedreshw ELSE s.slabaireshw END) END) END) END)) as vencimento " . "from sup_contratosuporte s, sup_contratuporte_cases_c cstm, cases c where s.id=cstm.sup_contra8d4esuporte_ida and c.id=cstm.sup_contra20a5escases_idb and c.deleted=0 and cstm.deleted=0 and s.deleted=0 and c.id= '" . $this->bean->id . "'"; $result = $db->query($query, true); while($row = $db->fetchByAssoc($result)) { $this->bean->sup_contratosuporte_cases_sla_critico_resolucao_hw = $row['slareshw']; $this->bean->sup_contratosuporte_cases_sla_critico_atendimento_hw = $row['slaressw']; $this->bean->sup_contratosuporte_cases_descricao = $row['description']; $this->bean->data_vencimento = $row['vencimento'] ; } }
it works for editview. how can i get it working for listview either?


LinkBack URL
About LinkBacks




Reply With Quote


Bookmarks