Esempio n. 1
0
    /**
     * Get the number of open attention items.
     *
     * @return int
     */
    protected function get_open_attention_count()
    {
        // Count the number of open attention items
        $sql = 'SELECT COUNT(a.attention_id) AS cnt
			FROM ' . TITANIA_ATTENTION_TABLE . ' a
			LEFT JOIN ' . TITANIA_CONTRIBS_TABLE . ' c
				ON (a.attention_object_type = ' . TITANIA_CONTRIB . '
					AND a.attention_object_id = c.contrib_id)
			WHERE a.attention_close_time = 0
				AND ' . \attention_overlord::get_permission_sql();
        $this->db->sql_query($sql);
        $attention_count = (int) $this->db->sql_fetchfield('cnt');
        $this->db->sql_freeresult();
        return $attention_count;
    }