app/helpers/week_plan_helper.rb
# Builds up HTML table for displaying a week's schedule based on a
# specified date (defaults to today), starting from the beginning of the
# week.
# Supports drag'n'drop, but only if the global switch of the framework has been
# enabled and the currently logged-in user is allowed to modify the weekly schedule.
#
# curr_date : Date instance for extracting current week;
# schedules : a collection of all the Schedule notes of the current week.
# appointments_cache : a collection of all the Appointment instances of the current week.
#
Builds up HTML table for displaying a week's schedule based on a
specified date (defaults to today), starting from the beginning of the
week.
Supports drag'n'drop, but only if the global switch of the framework has been
enabled and the currently logged-in user is allowed to modify the weekly schedule.

curr_date : Date instance for extracting current week;
schedules : a collection of all the Schedule notes of the current week.
appointments_cache : a collection of all the Appointment instances of the current week.
Builds up HTML table for displaying a week ' s schedule based on a specified date ( defaults to today ) starting from the beginning of the week . Supports drag ' n ' drop but only if the global switch of the framework has been enabled and the currently logged - in user is allowed to modify the weekly schedule . curr_date : Date instance for extracting current week ; schedules : a collection of all the Schedule notes of the current week . appointments_cache : a collection of all the Appointment instances of the current week .
def build_week_plan_table( curr_date, schedules, appointments_cache )
    sOut = "    \r\n"                               
    dom_xref_hash = {
      :drag_appointment_ids  => [],
      :drag_appointment_doms => [],
      :drag_schedule_ids  => [],
      :drag_schedule_doms => [],
      :drop_date_schedules     => [],
      :drop_date_schedule_doms => []
    }
    sOut << content_tag( :thead, table_header_for_week( curr_date ) )
    sOut << content_tag( :tbody, table_rows_for_week( curr_date, schedules, appointments_cache, dom_xref_hash ) )
    sOut << "    \r\n"                              
    current_user = LeUser.find(session[:le_user_id])
    session["#{controller_name()}_dom_xref_hash".to_sym] = dom_xref_hash if DRAG_N_DROP_GLOBAL_SWITCH && current_user && current_user.can_do(:appointments, :update)
    return sOut
  end
def build_week_plan_table ( curr_date , schedules , appointments_cache ) sOut = "    \r\n" dom_xref_hash = { :drag_appointment_ids => [ ] , :drag_appointment_doms => [ ] , :drag_schedule_ids => [ ] , :drag_schedule_doms => [ ] , :drop_date_schedules => [ ] , :drop_date_schedule_doms => [ ] } sOut << content_tag ( :thead , table_header_for_week ( curr_date ) ) sOut << content_tag ( :tbody , table_rows_for_week ( curr_date , schedules , appointments_cache , dom_xref_hash ) ) sOut << "    \r\n" current_user = LeUser . find ( session [ :le_user_id ] ) session [ "#{controller_name()}_dom_xref_hash" . to_sym ] = dom_xref_hash if DRAG_N_DROP_GLOBAL_SWITCH && current_user && current_user . can_do ( :appointments , :update ) return sOut end
Builds up HTML table for displaying a week's schedule based on a
specified date (defaults to today), starting from the beginning of the
week.
Builds up HTML table for displaying a week ' s schedule based on a specified date ( defaults to today ) starting from the beginning of the week .
# (Add CR+LF for each table row to improve generated source readibility) # This will contain all the lookup tables for DOM IDs, Appointment IDs, and empty-date place-holders' IDs # and will be filled during the construction of the table with several arrays, one for each cross-reference needed: # (Only used when drag'n'drop support is enabled)  # (Add CR+LF for each table row to improve generated source readibility) # Ugly but working: store in the session the X-ref. tables of the drag'n'drop DOM IDs:
curr_date
schedules
appointments_cache