app/helpers/week_plan_helper.rb
def table_rows_for_week( curr_date, schedules, appointments_cache, dom_xref_hash )
    sOut = ""
    app_length = AppParameterCustomizations.get_appointment_length_in_mins()

                                        # Morning (AM) schedule:
    app_result = AppParameterCustomizations.get_morning_schedule()
    am_start_time = app_result[:start_time]
    am_total_appointments = app_result[:total_appointments]
    throw( "Missing AppParameter configuration parameter values for default AM schedule size! Check database app_parameter table." ) if am_start_time.nil? || am_total_appointments.nil?
    
    n = 0
    while n < am_total_appointments do
      schedule = nil
      if (schedules != nil) && (schedules.length > n)
        schedule = schedules[n]
      end
      sOut << table_row_for_week( curr_date, am_start_time, app_length * n, schedule, appointments_cache, dom_xref_hash )
      n = n + 1
    end
                                        # Lunch break:
    sOut << "  #{content_tag(:tr, '', :class => 'schedule-gap')}\r\n"

                                        # Noon (PM) schedule:
    app_result = AppParameterCustomizations.get_noon_schedule()
    pm_start_time = app_result[:start_time]
    pm_total_appointments = app_result[:total_appointments]
    throw( "Missing AppParameter configuration parameter values for default PM schedule size! Check database app_parameter table." ) if pm_start_time.nil? || pm_total_appointments.nil?

    n = 0
    while n < pm_total_appointments do
      schedule = nil
      if (schedules != nil) && (schedules.length > am_total_appointments + n)
        schedule = schedules[am_total_appointments + n]
      end
      sOut << table_row_for_week( curr_date, pm_start_time, app_length * n, schedule, appointments_cache, dom_xref_hash )
      n = n + 1
    end

    return sOut
  end
# Builds an HTML table for displaying current week's appointment 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.
# dom_xref_hash : Hash containing all the lookup tables for DOM IDs, Appointment IDs, and empty-date place-holders' IDs.
#                The hash will be filled during the construction of the table with several arrays, one for each cross-reference needed.
# 
Builds an HTML table for displaying current week's appointment 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.
dom_xref_hash : Hash containing all the lookup tables for DOM IDs, Appointment IDs, and empty-date place-holders' IDs.
The hash will be filled during the construction of the table with several arrays, one for each cross-reference needed.
Builds an HTML table for displaying current week ' s appointment 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 . dom_xref_hash : Hash containing all the lookup tables for DOM IDs Appointment IDs and empty - date place - holders ' IDs . The hash will be filled during the construction of the table with several arrays one for each cross - reference needed .
def table_rows_for_week( curr_date, schedules, appointments_cache, dom_xref_hash )
    sOut = ""
    app_length = AppParameterCustomizations.get_appointment_length_in_mins()
    app_result = AppParameterCustomizations.get_morning_schedule()
    am_start_time = app_result[:start_time]
    am_total_appointments = app_result[:total_appointments]
    throw( "Missing AppParameter configuration parameter values for default AM schedule size! Check database app_parameter table." ) if am_start_time.nil? || am_total_appointments.nil?
    n = 0
    while n < am_total_appointments do
      schedule = nil
      if (schedules != nil) && (schedules.length > n)
        schedule = schedules[n]
      end
      sOut << table_row_for_week( curr_date, am_start_time, app_length * n, schedule, appointments_cache, dom_xref_hash )
      n = n + 1
    end
    sOut << "  #{content_tag(:tr, '', :class => 'schedule-gap')}\r\n"
    app_result = AppParameterCustomizations.get_noon_schedule()
    pm_start_time = app_result[:start_time]
    pm_total_appointments = app_result[:total_appointments]
    throw( "Missing AppParameter configuration parameter values for default PM schedule size! Check database app_parameter table." ) if pm_start_time.nil? || pm_total_appointments.nil?
    n = 0
    while n < pm_total_appointments do
      schedule = nil
      if (schedules != nil) && (schedules.length > am_total_appointments + n)
        schedule = schedules[am_total_appointments + n]
      end
      sOut << table_row_for_week( curr_date, pm_start_time, app_length * n, schedule, appointments_cache, dom_xref_hash )
      n = n + 1
    end
    return sOut
  end
def table_rows_for_week ( curr_date , schedules , appointments_cache , dom_xref_hash ) sOut = "" app_length = AppParameterCustomizations . get_appointment_length_in_mins ( ) app_result = AppParameterCustomizations . get_morning_schedule ( ) am_start_time = app_result [ :start_time ] am_total_appointments = app_result [ :total_appointments ] throw ( "Missing AppParameter configuration parameter values for default AM schedule size! Check database app_parameter table." ) if am_start_time . nil? || am_total_appointments . nil? n = 0 while n < am_total_appointments do schedule = nil if ( schedules != nil ) && ( schedules . length > n ) schedule = schedules [ n ] end sOut << table_row_for_week ( curr_date , am_start_time , app_length * n , schedule , appointments_cache , dom_xref_hash ) n = n + 1 end sOut << "  #{content_tag(:tr, '', :class => 'schedule-gap')}\r\n" app_result = AppParameterCustomizations . get_noon_schedule ( ) pm_start_time = app_result [ :start_time ] pm_total_appointments = app_result [ :total_appointments ] throw ( "Missing AppParameter configuration parameter values for default PM schedule size! Check database app_parameter table." ) if pm_start_time . nil? || pm_total_appointments . nil? n = 0 while n < pm_total_appointments do schedule = nil if ( schedules != nil ) && ( schedules . length > am_total_appointments + n ) schedule = schedules [ am_total_appointments + n ] end sOut << table_row_for_week ( curr_date , pm_start_time , app_length * n , schedule , appointments_cache , dom_xref_hash ) n = n + 1 end return sOut end
Builds an HTML table for displaying current week's appointment schedule.
Builds an HTML table for displaying current week ' s appointment schedule .
# Morning (AM) schedule: # Lunch break: # Noon (PM) schedule:
curr_date
schedules
appointments_cache
dom_xref_hash