summaryrefslogtreecommitdiff
path: root/table.html
blob: 86b0335e7739829938aaaa0ecca5aa7aabd01eaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<HTML>
<HEAD>
<TITLE>Staffing Sheet</TITLE>
</HEAD>

<BODY>

<a name="top"><H1>Staffing Sheet</H1></a>

<P><a href="#docs">Jump to documentation</a></P>

<P>{ form(); }</P>

<P>{ warnings(); }</P>

<TABLE BORDER ALIGN=CENTER>
<TR BGCOLOR="#EE7700">
    <TD WIDTH=50 ALIGN=CENTER>Time</TH>
    <TD WIDTH=150 ALIGN=CENTER>Door 1</TH>
    <TD WIDTH=150 ALIGN=CENTER>Door 2</TH>
    <TD WIDTH=150 ALIGN=CENTER>Door 3</TH>
    <TD WIDTH=150 ALIGN=CENTER>Door 4</TH></TR>
<TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>8:30</font></TD>
    <TD ROWSPAN=3>{ inputbox("Door-1-A"); }</TD>
    <TD ROWSPAN=3>{ inputbox("Door-2-A"); }</TD>
    <TD ROWSPAN=3>{ inputbox("Door-3-A"); }</TD>
    <TD ROWSPAN=3 BGCOLOR="FFEE77">&nbsp;</TD></TR>
<TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>9:00</font></TD></TR>
<TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>9:30</font></TD></TR>
<TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>10:00</font></TD>
    <TD ROWSPAN=3>{ inputbox("Door-1-B"); }</TD>
    <TD ROWSPAN=3>{ inputbox("Door-2-B"); }</TD>
    <TD ROWSPAN=3>{ inputbox("Door-3-B"); }</TD>
    <TD ROWSPAN=3>{ inputbox("Door-4-B"); }</TD></TR>
<TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>10:30</font></TD></TR>
<TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>11:00</font></TD></TR>
<TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>11:30</font></TD>
    <TD ROWSPAN=3>{ inputbox("Door-1-C"); }</TD>
    <TD ROWSPAN=3>{ inputbox("Door-2-C"); }</TD>
    <TD ROWSPAN=3>{ inputbox("Door-3-C"); }</TD>
    <TD ROWSPAN=3>{ inputbox("Door-4-C"); }</TD></TR>
<TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>12:00</font></TD></TR>
<TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>12:30</font></TD></TR>
<TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>1:00</font></TD>
    <TD ROWSPAN=3>{ inputbox("Door-1-D"); }</TD>
    <TD ROWSPAN=3>{ inputbox("Door-2-D"); }</TD>
    <TD ROWSPAN=3>{ inputbox("Door-3-D"); }</TD>
    <TD ROWSPAN=6 BGCOLOR="FFEE77">&nbsp;</TD></TR>
<TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>1:30</font></TD></TR>
<TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>2:00</font></TD></TR>
<TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>2:30</font></TD>
    <TD ROWSPAN=3>{ inputbox("Door-1-E"); }</TD>
    <TD ROWSPAN=3>{ inputbox("Door-2-E"); }</TD>
    <TD ROWSPAN=3>{ inputbox("Door-3-E"); }</TD></TR>
<TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>3:00</font></TD></TR>
<TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>3:30</font></TD></TR>
<TR><TD ALIGN=RIGHT BGCOLOR="#FF4400"><font size=-1>4:00</font></TD>
    <TD COLSPAN=4 BGCOLOR="#FFEE77" align=center>
	<font size=-1>cleanup</font></TD></TR>
</TABLE>

<P>Don't forget to include your e-mail address in the form!</P>

<INPUT TYPE="SUBMIT"><INPUT TYPE="RESET"><BR>
<INPUT TYPE="checkbox" NAME="__MAGIC" VALUE="print">show results in printable format</P>

</FORM>

<hr>

<a name="docs"><H1>Documentation</H1></a>

<P>Copyright &copy;2000 Adam Gould<BR>
Copyright &copy;2000 Michal Migurski<BR>
Copyright &copy;2000 and 2001 Ivan Kohler<BR>
All rights reserved.<BR>
This program is free software; you can redistribute it and or modify it under 
the terms of the <a href="http://www.gnu.org/copyleft/gpl.html">GNU General 
Public License</a> or the 
<a href="http://www.perl.com/pub/language/misc/Artistic.html">Artistic License</a>.
</P>

<P><a href="#top">Above</a> 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.</P>

<H2>Download</H2>
        
<P>All relevant files are included in the 
<A HREF="staff-0.5.tar.gz">staff-0.5.tar.gz</A> archive.</P>

<P>You also need the 
<A HREF="http://search.cpan.org/search?dist=Text-Template">Text::Template</A>, 
<A HREF="http://search.cpan.org/search?dist=MailTools">MailTools</A> and 
<A HREF="http://search.cpan.org/search?dist=TimeDate">TimeDate</A> perl 
modules.  
(<a href="http://www.perl.com/CPAN/doc/manual/html/lib/CPAN.html">CPAN</a> 
will query, download and build perl modules automatically.)</P>

<H2>Configuration</H2>
        
<P>Configuring the staffing sheet is easy.</P>

<P><STRONG>Front-end</STRONG> changes can be made to the 
<A HREF="table.html">table.html</A> 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:</P>

<UL>
<LI><CODE>\{&nbsp;form();&nbsp;\}</CODE><br>
    Use this tag to start your form instead of the HTML 
    <CODE>&lt;FORM&gt;</CODE> tag.  (You should end the form with the normal 
    <CODE>&lt;/FORM&gt;</CODE> tag.)

<LI><CODE>\{&nbsp;inputbox("<i>shift</i>");&nbsp;\}</CODE><BR>
    This tag specifies the name of a workshift, as in 
    <CODE>\{&nbsp;inputbox("Door 1");&nbsp;\}</CODE>. 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 
    <STRONG>ONE</STRONG> line.  For an example of intended use, check the 
    source of <A HREF="table.html">table.html</A>.

<LI><CODE>\{&nbsp;warnings();&nbsp;\}</CODE><BR>
    If, during the time between when you load the form and when you submit
    your changes, one of the fields you are changing has been changed by 
    someone else, your changes will not be accepted and a warning will be 
    issued next to the input box for that field.  You can use the 
    <CODE>\{&nbsp;warnings();&nbsp;\}</CODE> tag to return a list of all 
    warnings, so that you can locate them prominantly on the resulting page.

<LI>Note: old-style 
    <CODE>&lt;WORKSHIFT&gt;<i>shift</i>&lt;/WORKSHIFT&gt;</CODE> tags can be 
    converted to \{&nbsp;inputbox("<i>shift</i>");&nbsp;\} tags with the 
    convert-template.pl program: 
    <CODE>./convert-template.pl&nbsp;old-table-file.html&nbsp;&gt;new-table-file.html</CODE>.
</UL>

<P>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 <STRONG>\{</STRONG> or 
<STRONG>\}</STRONG> characters (the curly braces), you must preceed them with
a <STRONG>\</STRONG> (backslash).  See the 
<A HREF="http://search.cpan.org/doc/MJD/Text-Template-1.23/Template.pm">Text::Template</A> 
documentation for details on the substitution language.</P>
        
<P><STRONG>Back-end</STRONG> configuration involves editing a few lines in the
<STRONG>shift.cgi</STRONG> file. The <CODE>$template_file</CODE> variable must 
be set to the full path and name of the front-end table.html file.  The 
<CODE>$data_directory</CODE> 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 
<CODE>$mail_smtpserver</CODE> variable to the name of an SMTP server which will
relay your messages, set the <CODE>$mail_from</CODE> variable to the address 
you wish to appear in the From:, Sender: and Reply-To: headers, set the 
<CODE>$mail_subject</CODE> variable to the subject you wish to appear in the 
Subject: header, set the <CODE>@mail_cc</CODE> variable to any addresses you 
wish Cc:'ed, and set the <CODE>$mail_footer</CODE> variable to a message which 
will appear at the bottom of all warning messages.<BR>

<PRE>###
# 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 = &lt;&lt;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
###
</PRE>
        
<H2>Use</H2>
        
<P>To use the files, install <STRONG>shift.cgi</STRONG> in a public web    
directory as a CGI program.  (probably by placing it in a 
<A HREF="http://www.apache.org/docs/mod/mod_alias.html#scriptalias">cgi-bin</A> 
directory or using 
<A HREF="http://www.apache.org/docs/mod/mod_mime.html#addhandler">AddHandler</A>).  
Permissions for all files must be set correctly. To make the 
<STRONG>shift.cgi</STRONG> excecutable, set its permissions to 755 
(<CODE>rwxr-xr-x</CODE>):<BR>

<PRE>chmod 755 shift.cgi</PRE><BR>

To create the the data directory:<BR>

<PRE>mkdir /path/to/data_dir</PRE><BR>

The data directory needs to be writable by the user executing the CGI.  It's 
probably best to simply make the data directory owned by the user as which 
<STRONG>shift.cgi</STRONG> runs (probably the 
<A HREF=http://www.apache.org/docs/mod/core.html#user>user as which the web
server answers requests</A>, unless you are using 
<A HREF="http://www.apache.org/docs/suexec.html">suEXEC</A>), and set its 
permissions to 755:<BR>

<PRE>chown httpd /path/to/data_dir
chmod 755 /path/to/data_dir</PRE></P>

<H2>Help</H2>
        
<ul>
<!-- li><a href="search-list-archive.html">Search</a> or 
    <a href="list-archive">browse</a> the user mailing list archive. -->

<li>Subscribe to the user mailing list by sending a blank message to 
    <a href="mailto:stafflist-user-subscribe@420.am">
    stafflist-user-subscribe@420.am</a>.
</ul>

<H2>Development</H2>

<ul>
<li>Anonymous CVS access:<BR>CVSROOT is 
    <B>:pserver:anonymous@pouncequick.420.am:/home/cvs/cvsroot</B><BR>
    The password for the user <B>anonymous</B> is <B>anonymous</B>.<BR>
    The module name is <B>staff</B>.<BR>
    So to check out the current tree, you would do (bash):<BR>
<PRE>$ export CVSROOT=":pserver:anonymous@pouncequick.420.am:/home/cvs/cvsroot"
$ cvs login
(Logging in to anonymous@pouncequick.420.am)
CVS password:
$ cvs checkout staff
</PRE>

<li>Browse the CVS tree online via <a href="/cgi-bin/viewcvs.cgi/staff">cvsweb</a>.

<!-- li><a href="search-devel-list-archive.html">Search</a> or <a href="devel-list-archive">browse</a> the development list archive. -->

<li>Subscribe to the development mailing list by sending a blank message to 
    <a href="mailto:stafflist-devel-subscribe@420.am">
    stafflist-devel-subscribe@420.am</a>.
</ul>

</BODY>
</HTML>