{ form(); }
{ warnings(); }
Time | Door 1 | Door 2 | Door 3 | Door 4 |
8:30 | { inputbox("Door-1-A"); } | { inputbox("Door-2-A"); } | { inputbox("Door-3-A"); } | |
9:00 | ||||
9:30 | ||||
10:00 | { inputbox("Door-1-B"); } | { inputbox("Door-2-B"); } | { inputbox("Door-3-B"); } | { inputbox("Door-4-B"); } |
10:30 | ||||
11:00 | ||||
11:30 | { inputbox("Door-1-C"); } | { inputbox("Door-2-C"); } | { inputbox("Door-3-C"); } | { inputbox("Door-4-C"); } |
12:00 | ||||
12:30 | ||||
1:00 | { inputbox("Door-1-D"); } | { inputbox("Door-2-D"); } | { inputbox("Door-3-D"); } | |
1:30 | ||||
2:00 | ||||
2:30 | { inputbox("Door-1-E"); } | { inputbox("Door-2-E"); } | { inputbox("Door-3-E"); } | |
3:00 | ||||
3:30 | ||||
4:00 | cleanup |
Don't forget to include your e-mail address in the form!
Copyright ©2000 Adam Gould
Copyright ©2000 Michal Migurski
Copyright ©2000 and 2001 Ivan Kohler
All rights reserved.
This program is free software; you can redistribute it and or modify it under
the terms of the GNU General
Public License or the
Artistic License.
Above is an example of the Online Staffing Sheet in action. Names can be modified by typing in the fields. Hitting "Submit" automatically updates the storage directory.
All relevant files are included in the staff-0.4.tar.gz archive. (released Jun 24 2003, fixes bug with very large staff sheets)
You also need the Text::Template, MailTools and TimeDate perl modules. (CPAN will query, download and build perl modules automatically.)
Configuring the staffing sheet is easy.
Front-end changes can be made to the table.html file, which stores the layout of the staffing sheet and is used to generate the database file. The table.html file uses some non-standard tags:
\{ form(); \}
<FORM>
tag. (You should end the form with the normal
</FORM>
tag.)
\{ inputbox("shift"); \}
\{ inputbox("Door 1"); \}
. The text enclosed in the
tag is used as the workshift name, and is used to generate FORM INPUT
fields by the shift.cgi program. Characters allowed within the tag
include spaces, digits, and letters; however the tag cannot begin or end
with a space. To ensure trouble-free use, please keep the tag on
ONE line. For an example of intended use, check the
source of table.html.
\{ warnings(); \}
\{ warnings(); \}
tag to return a list of all
warnings, so that you can locate them prominantly on the resulting page.
<WORKSHIFT>shift</WORKSHIFT>
tags can be
converted to \{ inputbox("shift"); \} tags with the
convert-template.pl program:
./convert-template.pl old-table-file.html >new-table-file.html
.
Other than these tags, anything goes. You can (and probably should) include tables, various types of text formatting, and anything else not covered by the above restrictions. If you need to use the \{ or \} characters (the curly braces), you must preceed them with a \ (backslash). See the Text::Template documentation for details on the substitution language.
Back-end configuration involves editing a few lines in the
shift.cgi file. The $template_file
variable must
be set to the full path and name of the front-end table.html file. The
$data_directory
must be set to the full path and name of a
directory where the data will be stored. If you want to enable the optional
mail-notification feature (will send email to anyone who has their shift
replaced if they included an email address), set the
$mail_smtpserver
variable to the name of an SMTP server which will
relay your messages, set the $mail_from
variable to the address
you wish to appear in the From:, Sender: and Reply-To: headers, set the
$mail_subject
variable to the subject you wish to appear in the
Subject: header, set the @mail_cc
variable to any addresses you
wish Cc:'ed, and set the $mail_footer
variable to a message which
will appear at the bottom of all warning messages.
### # user-servicable parts ### $template_file = '/home/ivan/staffsheet/table.html'; $data_directory = '/home/ivan/staffsheet/data'; $mail_smtpserver = 'localhost'; # set blank to disable $mail_from = 'ivan-misconfigured-shift-from@420.am'; $mail_subject = 'Your shift has been replaced'; @mail_cc = ( 'ivan-misconfigured-shift-cc@420.am', 'ivan-misconfigured-shift-cc2@420.am', ); $mail_footer = <<END; Sorry, I don't have any more information. The person who installed the staff sheet didn't customize this message. END ### # end of user-servicable parts ###
To use the files, install shift.cgi in a public web
directory as a CGI program. (probably by placing it in a
cgi-bin
directory or using
AddHandler).
Permissions for all files must be set correctly. To make the
shift.cgi excecutable, set its permissions to 755
(rwxr-xr-x
):
chmod 755 shift.cgi
mkdir /path/to/data_dir
chown httpd /path/to/data_dir chmod 755 /path/to/data_dir
$ export CVSROOT=":pserver:anonymous@cleanwhisker.420.am:/home/cvs/cvsroot" $ cvs login (Logging in to anonymous@cleanwhisker.420.am) CVS password: $ cvs checkout staff