moved code from absences/index.tcl to separate procs for generating the where_clause by absence type and status, user_selection_id/user_selection_type, and timescale