ticket_user_contributions

one of the documented procedures in this installation of the ACS
Usage:
ticket_user_contributions   db   user_id   purpose
What it does:
Returns list items, one for each bboard posting
Defined in: /web/philip/tcl/ticket-defs.tcl

Source code:


    if { $purpose != "site_admin" } {
	return [list]
    } 
    set selection [ns_db 0or1row $db "select 
    count(tia.msg_id) as total,
    sum(decode(status_class,'closed',1,0)) as closed,
    sum(decode(status_class,'closed',0,'defer',0,NULL,0,1)) as open,
    sum(decode(status_class,'defer',1,0)) as deferred,
    max(last_modified) as lastmod,
    min(posting_time) as oldest
  from ticket_issues ti, ticket_issue_assignments tia
  where tia.user_id = $user_id
    and ti.msg_id = tia.msg_id"]

    if { [empty_string_p $selection] } {
	return [list]
    }

    set_variables_after_query
    if { $total == 0 } {
	return [list]
    }

    set items "<li>Total tickets:  $total ($closed closed; $open open; $deferred deferred)
 <li>Last modification:  [util_AnsiDatetoPrettyDate $lastmod]
 <li>Oldest:  [util_AnsiDatetoPrettyDate $oldest]"
    return [list 0 [ticket_system_name] "<ul>\n\n$items\n\n</ul>"]


philg@mit.edu