ticket_assigned_users

one of the documented procedures in this installation of the ACS
Usage:
ticket_assigned_users   db   project_id   domain_id   domain_group_id   msg_id   one_line   my_return_url   { admin_p "0" }
What it does:
generate the list of assigned users with remove and picklist to add more if an admin for the group to which the ticket is assigned
Defined in: /web/philip/tcl/ticket-defs.tcl

Source code:

 
    set selection [ns_db select $db "select
  last_name || ', ' || first_names as assigned_name,
  u.email as assigned_email,
  u.user_id as assigned_user_id
  from users u, ticket_issue_assignments tia where tia.msg_id = $msg_id and u.user_id = tia.user_id
  order by upper(last_name) asc, upper(first_names) asc"]

    set users {}
    set pre {<strong>Assigned users:</strong><ul><li>}
    while {[ns_db getrow $db $selection]} { 
        set_variables_after_query
        append users "$pre [ticket_user_display $assigned_name $assigned_email $assigned_user_id ] &lt<a href=\"mailto:$assigned_email\">$assigned_email</a>&gt;"
        if { $admin_p } { 
            append users " (<a href=\"/ticket/ticket-remove-assignment?msg_id=$msg_id&user_id=$assigned_user_id&$my_return_url\">remove</a>)"
        }
        set pre {<li>}
    }

    if {[empty_string_p $users]} { 
        append users "<br><strong><font color=red>No assigned users</font></strong><br>"
    } else { 
        append users "</ul>"
        
    }

    # add assignment
    if { $admin_p } { 
        append users "<form method=get action=\"/ticket/ticket-update-assignment\">
      Assign to: [ticket_assignee_select $db $project_id $domain_id $domain_group_id {} {-- Remove all assignees --}]
      <input type=hidden name=return_url value=\"[philg_quote_double_quotes "[ns_conn url]?[export_ns_set_vars url]"]\">
      <input type=hidden name=one_line value=\"[philg_quote_double_quotes $one_line]\">
      <input type=hidden name=msg_id value=\"[philg_quote_double_quotes $msg_id]\">
      <input type=submit value=\"Go\"></form>"

    }

    set watchers [database_to_tcl_list $db "select first_names || ' ' || last_name from users u, ticket_email_alerts tea where u.user_id = tea.user_id and tea.msg_id = $msg_id"]
    if {![empty_string_p $watchers]} { 
        append users "<strong>Ticket watchers:</strong><ul><li>[join $watchers "<LI>"]</ul>"
    }

    return $users


philg@mit.edu