static function &GetTicketValues($ticketid, $ticket) { if (empty(FSSCF::$_ticketvalues)) { FSSCF::$_ticketvalues = array(); } if (!array_key_exists($ticketid, FSSCF::$_ticketvalues)) { $allfields = FSSCF::GetAllCustomFields(true); $db = JFactory::getDBO(); $qry = "SELECT * FROM #__fss_ticket_field WHERE ticket_id ='" . FSSJ3Helper::getEscaped($db, $ticketid) . "'"; $db->setQuery($qry); $values = $db->loadAssocList('field_id'); if (is_array($ticket)) { $values2 = FSSCF::GetUserValues($ticket['user_id'], $ticket['id']); } else { $values2 = FSSCF::GetUserValues($ticket->user_id, $ticket->id); } foreach ($values2 as $id => $value) { if (array_key_exists($id, $allfields) && $allfields[$id]['peruser']) { $values[$id] = $value; } } FSSCF::$_ticketvalues[$ticketid] = $values; } return FSSCF::$_ticketvalues[$ticketid]; }