#!perl our $white = "white"; #our $header_color = "#eef7ee"; our $header_color = "#eeffff"; our $sep_color = "#889999"; our $textcolor = "black"; our $textcolor_disabled = "#444444"; #our $bgcolor_today = "beige"; our $bgcolor_today = "#ffffdd"; our $bgcolor_other_days = "white"; our $bgcolor_holiday = "#fff7ff"; our $admin_warning_color = "red"; our $static_warning_color = "purple"; #our $color_mine_static = "#00ff00"; our $color_mine_static = "#ff8fff"; our $color_mine_booked = "#aaffaa"; #our $color_other_static = "#999999"; our $color_other_static = "#ffcfff"; our $color_other_booked = "#bbffff"; #our $color_mine_cancelled = "#aaaaaa"; our $color_mine_cancelled = "#dddddd"; our $color_other_cancelled = "#dddddd"; our $body_bgcolor = "#f7ffff"; #our $body_bgcolor = "midnightblue"; our $body_textcolor = "black"; our $body_linkcolor = "blue"; our ($max_x, $max_y); our $cell_count = 0; our $scroll_to_wday; BEGIN { -d 'cgi-bin' && chdir 'cgi-bin'; } # !!! use strict; use warnings; use IO::File; use CGI ':standard'; use CGI::Carp 'fatalsToBrowser'; require "lib_pl"; require "lib_bookings_pl"; use Date; use File::Copy; use Spreadsheet::SimpleExcel; use Time::localtime; set_close_window_on_logout(); set_program_name("the bookings program"); use sort 'stable'; # session variables our $session_data = {}; our ($uid, $password, $token, $session_code, $authenticated, $ou_allowed); our ($short_uid_type); # descriptive, for messages our ($screenwidth, $screenheight); our $mode; # other vars from lib_pl our ($program, $submit_i, $file_i, $password_i, @month, @weekday); our ($common_conf); our %N; our ($content_type); # config our @week_desc = ("this week", "next week", "fortnight"); #our @periods_all = ("Period 1", "Period 2", "Recess", "Period 3", "Period 4", "Lunch", "Period 5", "Period 6", "After School"); our @periods_all = ("Period 1", "Period 2", "Period 3", "Period 4", "Lunch", "Period 5", "Period 6", "Evening"); our $n_weeks; our $week_min; our $week_max; # appearence config our $cellwidth_major = 110; # classes our $cellwidth_minor = 90; # recess, etc FIXME not in use??? our $cellwidth_resource = 58; our $cellwidth_weekday = 100; our $cellwidth_fudge_scrollbar = 16; our $cellwidth; our $cellpadding = 2; #our $sep = qq{}; #}; our $sep = qq{}; # globals (I would use OO but perl's sucks too bad) our ($conf, $dir, $lock_file, $booked_file, $static_file, $cancelled_file, $holidays_file, $info_file, $static_info_file); our ($laptops_file, $laptops_log_file); our ($users); our ($booked, $static, $cancelled, $booked_x, $static_x, $cancelled_x, $holidays, $info, $info_x, $static_info, $static_info_x); our ($max_bookings, $n_bookings, $my_bookings, $too_many_bookings); our ($category, $week, $today_wday, $monday1, $monday, $resources, $n_resources, @periods, $n_periods); our ($date, $wday, $ymd2, $past, $today, $holiday, $weekday, $month_day, $weekday_short, $month_day_short); our ($resource, $resource_full, $resource_info, $resource_info__hack); our ($period, $class); our ($static_booker, $cancelled_by, $booker, $is_static, $mine, $cancellable, $info_editable, $available, $my_cancelled, $cell_name); our ($changed_cancelled, $changed_booked, $changed_static, $changed_info, $changed_static_info, $changed_bookings_conf, $changed_holidays); our ($mode_normal, $mode_admin, $mode_static, $mode_admin_any); our ($bgcolor, $fgcolor); our ($reset); our ($info_missing_msg); our ($user); our ($teacher_names, $teacher_ids); our ($new_booker); our ($id); # short_uid our ($editable_day); our ($n_bookings_unlimited, $n_bookings_left); our ($day_header_bgcolor); our ($description_of); our (@weekday_dates); our ($x, $y); our ($table, $rowspan, $colspan, $colwidth, $flipped); our ($res_n, $period_n); our ($period_1_column, $period_1_row); our ($page, $previous_page); our $singleton; our $this_category_is_limited; our $more_than_a_page_so_repeat_headers; our $max_wday; our $day_name; our $save_button = qq{}; #save  };