3 <TITLE>Staffing Sheet</TITLE>
8 <a name="top"><H1>Staffing Sheet</H1></a>
10 <P><a href="#docs">Jump to documentation</a></P>
14 <P>{ warnings(); }</P>
16 <TABLE BORDER ALIGN=CENTER>
17 <TR BGCOLOR="#EE7700">
18 <TD WIDTH=50 ALIGN=CENTER>Time</TH>
19 <TD WIDTH=150 ALIGN=CENTER>Door 1</TH>
20 <TD WIDTH=150 ALIGN=CENTER>Door 2</TH>
21 <TD WIDTH=150 ALIGN=CENTER>Door 3</TH>
22 <TD WIDTH=150 ALIGN=CENTER>Door 4</TH></TR>
23 <TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>8:30</font></TD>
24 <TD ROWSPAN=3>{ inputbox("Door-1-A"); }</TD>
25 <TD ROWSPAN=3>{ inputbox("Door-2-A"); }</TD>
26 <TD ROWSPAN=3>{ inputbox("Door-3-A"); }</TD>
27 <TD ROWSPAN=3 BGCOLOR="FFEE77"> </TD></TR>
28 <TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>9:00</font></TD></TR>
29 <TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>9:30</font></TD></TR>
30 <TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>10:00</font></TD>
31 <TD ROWSPAN=3>{ inputbox("Door-1-B"); }</TD>
32 <TD ROWSPAN=3>{ inputbox("Door-2-B"); }</TD>
33 <TD ROWSPAN=3>{ inputbox("Door-3-B"); }</TD>
34 <TD ROWSPAN=3>{ inputbox("Door-4-B"); }</TD></TR>
35 <TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>10:30</font></TD></TR>
36 <TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>11:00</font></TD></TR>
37 <TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>11:30</font></TD>
38 <TD ROWSPAN=3>{ inputbox("Door-1-C"); }</TD>
39 <TD ROWSPAN=3>{ inputbox("Door-2-C"); }</TD>
40 <TD ROWSPAN=3>{ inputbox("Door-3-C"); }</TD>
41 <TD ROWSPAN=3>{ inputbox("Door-4-C"); }</TD></TR>
42 <TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>12:00</font></TD></TR>
43 <TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>12:30</font></TD></TR>
44 <TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>1:00</font></TD>
45 <TD ROWSPAN=3>{ inputbox("Door-1-D"); }</TD>
46 <TD ROWSPAN=3>{ inputbox("Door-2-D"); }</TD>
47 <TD ROWSPAN=3>{ inputbox("Door-3-D"); }</TD>
48 <TD ROWSPAN=6 BGCOLOR="FFEE77"> </TD></TR>
49 <TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>1:30</font></TD></TR>
50 <TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>2:00</font></TD></TR>
51 <TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>2:30</font></TD>
52 <TD ROWSPAN=3>{ inputbox("Door-1-E"); }</TD>
53 <TD ROWSPAN=3>{ inputbox("Door-2-E"); }</TD>
54 <TD ROWSPAN=3>{ inputbox("Door-3-E"); }</TD></TR>
55 <TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>3:00</font></TD></TR>
56 <TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>3:30</font></TD></TR>
57 <TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>4:00</font></TD>
58 <TD COLSPAN=4 BGCOLOR="#FFEE77" align=center>
59 <font size=-1>cleanup</font></TD></TR>
62 <P>Don't forget to include your e-mail address in the form!</P>
64 <INPUT TYPE="SUBMIT"><INPUT TYPE="RESET"><BR>
65 <INPUT TYPE="checkbox" NAME="__MAGIC" VALUE="print">show results in printable format</P>
71 <a name="docs"><H1>Documentation</H1></a>
73 <P>Copyright ©2000 Adam Gould<BR>
74 Copyright ©2000 Michal Migurski<BR>
75 Copyright ©2000 and 2001 Ivan Kohler<BR>
76 All rights reserved.<BR>
77 This program is free software; you can redistribute it and or modify it under
78 the terms of the <a href="http://www.gnu.org/copyleft/gpl.html">GNU General
79 Public License</a> or the
80 <a href="http://www.perl.com/pub/language/misc/Artistic.html">Artistic License</a>.
83 <P><a href="#top">Above</a> is an example of the Online Staffing Sheet in
84 action. Names can be modified by typing in the fields. Hitting "Submit"
85 automatically updates the storage directory.</P>
89 <P>All relevant files are included in the
90 <A HREF="staff-0.5.tar.gz">staff-0.5.tar.gz</A> archive.</P>
93 <A HREF="http://search.cpan.org/search?dist=Text-Template">Text::Template</A>,
94 <A HREF="http://search.cpan.org/search?dist=MailTools">MailTools</A> and
95 <A HREF="http://search.cpan.org/search?dist=TimeDate">TimeDate</A> perl
97 (<a href="http://www.perl.com/CPAN/doc/manual/html/lib/CPAN.html">CPAN</a>
98 will query, download and build perl modules automatically.)</P>
100 <H2>Configuration</H2>
102 <P>Configuring the staffing sheet is easy.</P>
104 <P><STRONG>Front-end</STRONG> changes can be made to the
105 <A HREF="table.html">table.html</A> file, which stores the layout of the
106 staffing sheet and is used to generate the database file. The table.html file
107 uses some non-standard tags:</P>
110 <LI><CODE>\{ form(); \}</CODE><br>
111 Use this tag to start your form instead of the HTML
112 <CODE><FORM></CODE> tag. (You should end the form with the normal
113 <CODE></FORM></CODE> tag.)
115 <LI><CODE>\{ inputbox("<i>shift</i>"); \}</CODE><BR>
116 This tag specifies the name of a workshift, as in
117 <CODE>\{ inputbox("Door 1"); \}</CODE>. The text enclosed in the
118 tag is used as the workshift name, and is used to generate FORM INPUT
119 fields by the shift.cgi program. Characters allowed within the tag
120 include spaces, digits, and letters; however the tag cannot begin or end
121 with a space. To ensure trouble-free use, please keep the tag on
122 <STRONG>ONE</STRONG> line. For an example of intended use, check the
123 source of <A HREF="table.html">table.html</A>.
125 <LI><CODE>\{ warnings(); \}</CODE><BR>
126 If, during the time between when you load the form and when you submit
127 your changes, one of the fields you are changing has been changed by
128 someone else, your changes will not be accepted and a warning will be
129 issued next to the input box for that field. You can use the
130 <CODE>\{ warnings(); \}</CODE> tag to return a list of all
131 warnings, so that you can locate them prominantly on the resulting page.
134 <CODE><WORKSHIFT><i>shift</i></WORKSHIFT></CODE> tags can be
135 converted to \{ inputbox("<i>shift</i>"); \} tags with the
136 convert-template.pl program:
137 <CODE>./convert-template.pl old-table-file.html >new-table-file.html</CODE>.
140 <P>Other than these tags, anything goes. You can (and probably should) include
141 tables, various types of text formatting, and anything else not covered by the
142 above restrictions. If you need to use the <STRONG>\{</STRONG> or
143 <STRONG>\}</STRONG> characters (the curly braces), you must preceed them with
144 a <STRONG>\</STRONG> (backslash). See the
145 <A HREF="http://search.cpan.org/doc/MJD/Text-Template-1.23/Template.pm">Text::Template</A>
146 documentation for details on the substitution language.</P>
148 <P><STRONG>Back-end</STRONG> configuration involves editing a few lines in the
149 <STRONG>shift.cgi</STRONG> file. The <CODE>$template_file</CODE> variable must
150 be set to the full path and name of the front-end table.html file. The
151 <CODE>$data_directory</CODE> must be set to the full path and name of a
152 directory where the data will be stored. If you want to enable the optional
153 mail-notification feature (will send email to anyone who has their shift
154 replaced if they included an email address), set the
155 <CODE>$mail_smtpserver</CODE> variable to the name of an SMTP server which will
156 relay your messages, set the <CODE>$mail_from</CODE> variable to the address
157 you wish to appear in the From:, Sender: and Reply-To: headers, set the
158 <CODE>$mail_subject</CODE> variable to the subject you wish to appear in the
159 Subject: header, set the <CODE>@mail_cc</CODE> variable to any addresses you
160 wish Cc:'ed, and set the <CODE>$mail_footer</CODE> variable to a message which
161 will appear at the bottom of all warning messages.<BR>
164 # user-servicable parts
167 $template_file = '/home/ivan/staffsheet/table.html';
168 $data_directory = '/home/ivan/staffsheet/data';
169 $mail_smtpserver = 'localhost'; # set blank to disable
170 $mail_from = 'ivan-misconfigured-shift-from@420.am';
171 $mail_subject = 'Your shift has been replaced';
173 'ivan-misconfigured-shift-cc@420.am',
174 'ivan-misconfigured-shift-cc2@420.am',
176 $mail_footer = <<END;
178 Sorry, I don't have any more information. The person who installed the
179 staff sheet didn't customize this message.
184 # end of user-servicable parts
190 <P>To use the files, install <STRONG>shift.cgi</STRONG> in a public web
191 directory as a CGI program. (probably by placing it in a
192 <A HREF="http://www.apache.org/docs/mod/mod_alias.html#scriptalias">cgi-bin</A>
194 <A HREF="http://www.apache.org/docs/mod/mod_mime.html#addhandler">AddHandler</A>).
195 Permissions for all files must be set correctly. To make the
196 <STRONG>shift.cgi</STRONG> excecutable, set its permissions to 755
197 (<CODE>rwxr-xr-x</CODE>):<BR>
199 <PRE>chmod 755 shift.cgi</PRE><BR>
201 To create the the data directory:<BR>
203 <PRE>mkdir /path/to/data_dir</PRE><BR>
205 The data directory needs to be writable by the user executing the CGI. It's
206 probably best to simply make the data directory owned by the user as which
207 <STRONG>shift.cgi</STRONG> runs (probably the
208 <A HREF=http://www.apache.org/docs/mod/core.html#user>user as which the web
209 server answers requests</A>, unless you are using
210 <A HREF="http://www.apache.org/docs/suexec.html">suEXEC</A>), and set its
211 permissions to 755:<BR>
213 <PRE>chown httpd /path/to/data_dir
214 chmod 755 /path/to/data_dir</PRE></P>
219 <!-- li><a href="search-list-archive.html">Search</a> or
220 <a href="list-archive">browse</a> the user mailing list archive. -->
222 <li>Subscribe to the user mailing list by sending a blank message to
223 <a href="mailto:stafflist-user-subscribe@420.am">
224 stafflist-user-subscribe@420.am</a>.
230 <li>Anonymous CVS access:<BR>CVSROOT is
231 <B>:pserver:anonymous@pouncequick.420.am:/home/cvs/cvsroot</B><BR>
232 The password for the user <B>anonymous</B> is <B>anonymous</B>.<BR>
233 The module name is <B>staff</B>.<BR>
234 So to check out the current tree, you would do (bash):<BR>
235 <PRE>$ export CVSROOT=":pserver:anonymous@pouncequick.420.am:/home/cvs/cvsroot"
237 (Logging in to anonymous@pouncequick.420.am)
242 <li>Browse the CVS tree online via <a href="/cgi-bin/viewcvs.cgi/staff">cvsweb</a>.
244 <!-- li><a href="search-devel-list-archive.html">Search</a> or <a href="devel-list-archive">browse</a> the development list archive. -->
246 <li>Subscribe to the development mailing list by sending a blank message to
247 <a href="mailto:stafflist-devel-subscribe@420.am">
248 stafflist-devel-subscribe@420.am</a>.