#!/usr/bin/perl # edit_time.cgi # Show a form for editing or creating a time range require './itsecur-lib.pl'; &can_use_error("times"); &ReadParse(); if ($in{'new'}) { &header($text{'time_title1'}, "", undef, undef, undef, undef, &apply_button()); $time = { 'hours' => '*', 'days' => '*' }; } else { &header($text{'time_title2'}, "", undef, undef, undef, undef, &apply_button()); @times = &list_times(); if (defined($in{'idx'})) { $time = $times[$in{'idx'}]; } else { ($time) = grep { $_->{'name'} eq $in{'name'} } @times; $in{'idx'} = $time->{'index'}; } } print "