0.5!
[staff.git] / table.html
1 <HTML>
2 <HEAD>
3 <TITLE>Staffing Sheet</TITLE>
4 </HEAD>
5
6 <BODY>
7
8 <a name="top"><H1>Staffing Sheet</H1></a>
9
10 <P><a href="#docs">Jump to documentation</a></P>
11
12 <P>{ form(); }</P>
13
14 <P>{ warnings(); }</P>
15
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">&nbsp;</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">&nbsp;</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>
60 </TABLE>
61
62 <P>Don't forget to include your e-mail address in the form!</P>
63
64 <INPUT TYPE="SUBMIT"><INPUT TYPE="RESET"><BR>
65 <INPUT TYPE="checkbox" NAME="__MAGIC" VALUE="print">show results in printable format</P>
66
67 </FORM>
68
69 <hr>
70
71 <a name="docs"><H1>Documentation</H1></a>
72
73 <P>Copyright &copy;2000 Adam Gould<BR>
74 Copyright &copy;2000 Michal Migurski<BR>
75 Copyright &copy;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>.
81 </P>
82
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>
86
87 <H2>Download</H2>
88         
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>
91
92 <P>You also need the 
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 
96 modules.  
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>
99
100 <H2>Configuration</H2>
101         
102 <P>Configuring the staffing sheet is easy.</P>
103
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>
108
109 <UL>
110 <LI><CODE>\{&nbsp;form();&nbsp;\}</CODE><br>
111     Use this tag to start your form instead of the HTML 
112     <CODE>&lt;FORM&gt;</CODE> tag.  (You should end the form with the normal 
113     <CODE>&lt;/FORM&gt;</CODE> tag.)
114
115 <LI><CODE>\{&nbsp;inputbox("<i>shift</i>");&nbsp;\}</CODE><BR>
116     This tag specifies the name of a workshift, as in 
117     <CODE>\{&nbsp;inputbox("Door 1");&nbsp;\}</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>.
124
125 <LI><CODE>\{&nbsp;warnings();&nbsp;\}</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>\{&nbsp;warnings();&nbsp;\}</CODE> tag to return a list of all 
131     warnings, so that you can locate them prominantly on the resulting page.
132
133 <LI>Note: old-style 
134     <CODE>&lt;WORKSHIFT&gt;<i>shift</i>&lt;/WORKSHIFT&gt;</CODE> tags can be 
135     converted to \{&nbsp;inputbox("<i>shift</i>");&nbsp;\} tags with the 
136     convert-template.pl program: 
137     <CODE>./convert-template.pl&nbsp;old-table-file.html&nbsp;&gt;new-table-file.html</CODE>.
138 </UL>
139
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>
147         
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>
162
163 <PRE>###
164 # user-servicable parts
165 ###
166
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';
172 @mail_cc = (
173   'ivan-misconfigured-shift-cc@420.am',
174   'ivan-misconfigured-shift-cc2@420.am',
175 );
176 $mail_footer = &lt;&lt;END;
177
178 Sorry, I don't have any more information.  The person who installed the 
179 staff sheet didn't customize this message.
180
181 END
182
183 ###
184 # end of user-servicable parts
185 ###
186 </PRE>
187         
188 <H2>Use</H2>
189         
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> 
193 directory or using 
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>
198
199 <PRE>chmod 755 shift.cgi</PRE><BR>
200
201 To create the the data directory:<BR>
202
203 <PRE>mkdir /path/to/data_dir</PRE><BR>
204
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>
212
213 <PRE>chown httpd /path/to/data_dir
214 chmod 755 /path/to/data_dir</PRE></P>
215
216 <H2>Help</H2>
217         
218 <ul>
219 <!-- li><a href="search-list-archive.html">Search</a> or 
220     <a href="list-archive">browse</a> the user mailing list archive. -->
221
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>.
225 </ul>
226
227 <H2>Development</H2>
228
229 <ul>
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"
236 $ cvs login
237 (Logging in to anonymous@pouncequick.420.am)
238 CVS password:
239 $ cvs checkout staff
240 </PRE>
241
242 <li>Browse the CVS tree online via <a href="/cgi-bin/viewcvs.cgi/staff">cvsweb</a>.
243
244 <!-- li><a href="search-devel-list-archive.html">Search</a> or <a href="devel-list-archive">browse</a> the development list archive. -->
245
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>.
249 </ul>
250
251 </BODY>
252 </HTML>
253