bboard_urgent_message_items

one of the documented procedures in this installation of the ACS
Usage:
bboard_urgent_message_items   db   { archived_p "f" }   { show_min "0" }   { show_max "50000" }   { skip_first "0" }
What it does:
Returns a string of
  • with hyperlinks to the current bboard items that are marked urgent.
  • Defined in: /web/philip/tcl/bboard-defs.tcl

    Source code:

    
    
        if {$archived_p == "t"} {
    	set archived_qual "and sign(bboard.posting_time + [ad_parameter DaysConsideredUrgent bboard] - sysdate) < 1"
            set sort_key "posting_time desc"
        } else {
    	set archived_qual ""
            #set sort_key "urgent_sign desc, answered_p asc, posting_time desc"
            set sort_key "urgent_sign desc, posting_time desc"
    
        }
     
    # (bd Nov 1999) Note to the usage of NVL function on two places below:
    # I wanted to get rid of the annoying Oracle error message
    # in the log file "Warning of a NULL column in an aggregate function"
    
        set selection [ns_db select $db "select bboard.msg_id, 
    bboard.one_line,  sort_key, bboard.topic_id, bboard_topics.topic, bboard_topics.presentation_type,
    users.email, users.first_names || ' ' || last_name as name, users.user_id,
    bboard.posting_time, sign(bboard.posting_time + [ad_parameter DaysConsideredUrgent bboard] - sysdate) as urgent_sign,
    max(nvl(bboard_new_answers_helper.posting_time, '0001-01-01')) as last_response,
    sign(count(nvl(bboard_new_answers_helper.root_msg_id,0))) as answered_p
    from bboard, bboard_new_answers_helper, bboard_topics, users
    where bboard.user_id = users.user_id
    and bboard_new_answers_helper.root_msg_id(+) = bboard.msg_id
    and bboard_topics.topic_id = bboard.topic_id
    and (bboard_topics.read_access in ('any', 'public'))
    and bboard.urgent_p = 't'
    $archived_qual
    group by bboard.msg_id, bboard.one_line, bboard.topic_id, 
    bboard_topics.topic, bboard_topics.presentation_type, sort_key, users.user_id, users.first_names || ' ' || last_name, email, bboard.posting_time
    order by $sort_key"]
    
        # Siemens wants to display, at a minimum, the last 3 urgent
    
        set urgent_items ""
        set count 0
        while { [ns_db getrow $db $selection] } {
    	set_variables_after_query
    	if { [string first "." $sort_key] == -1 } {
    	    # there is no period in the sort key so this is the start of a thread
    	    set thread_start_msg_id $sort_key
    	} else {
    	    # strip off the stuff before the period
    	    regexp {(.*)\..*} $sort_key match thread_start_msg_id
    	}
    	if {$count < $show_max && ($urgent_sign == 1 || $archived_p == "t" || $count < $show_min)} {
    	    if {$count >= $skip_first} {
    	          append urgent_items "<li><a href=\"/bboard/[bboard_msg_url $presentation_type $thread_start_msg_id $topic]\">$one_line</a> <i>(<a href=\"/shared/community-member?[export_url_vars user_id]\">$name</a> on $posting_time in $topic"
                      if {"$last_response" != "0001-01-01"} {
    	         	append urgent_items ", last response on $last_response"
    	          }
    	    append urgent_items ")</i>\n"
    	    }
    	} else {
    	    break
    	}
    	incr count
        }
        return $urgent_items
    
    

    philg@mit.edu