im_future_vacationing_employees db { coverage " " } { report_date " " } { purpose " " }What it does:
Returns a string that gives a list of recent employeesDefined in: /web/philip/tcl/intranet-defs.tcl
Source code:
# We need a "distinct" because there can be more than one # mapping between a user and a group, one for each role. # set selection [ns_db select $db "select distinct u.user_id, first_names, last_name, email, to_char(user_vacations.start_date,'Mon DD, YYYY') || ' - ' || to_char(user_vacations.end_date,'Mon DD, YYYY') as dates, user_vacations.end_date from users_active u, user_vacations , user_group_map ugm where u.user_id = ugm.user_id and ugm.group_id = [im_employee_group_id $db] and u.user_id = user_vacations.user_id and user_vacations.start_date > to_date('$report_date', 'YYYY-MM-DD') and user_vacations.start_date < to_date('$report_date', 'YYYY-MM-DD') + 30 order by user_vacations.end_date"] set return_list [list] while { [ns_db getrow $db $selection] } { set_variables_after_query if {$purpose == "web_display"} { lappend return_list "<a href=[im_url_stub]/users/view?[export_url_vars user_id]>$first_names $last_name</a>- $dates" } else { lappend return_list "$first_names $last_name - $dates" } } if {[llength $return_list] == 0} { return "None \n" } if {$purpose == "web_display"} { return "<ul><li>[join $return_list "<li>"]</ul>" } else { return "\n[join $return_list "\n"] " }