initial module creation
[staff.git] / table.html
1 <!-- #include "header.incl" -->
2 <!-- HEADER BEGIN -->
3
4 <HTML>
5 <HEAD>
6
7 <TITLE>Viberation</TITLE>
8
9 <SCRIPT LANGUAGE = "JavaScript">
10 <!--
11 function makeRemote() \{
12         remote = window.open("","remotewin","width=620,height=480,toolbar=no,directories=no,menubar=no,status=yes,location=no,scrollbars=no,resizable=no");
13         remote.location.href = "vibe_main.html";
14         if (remote.opener == null) \{ remote.opener = window; \} 
15         remote.opener.name = "opener";
16 \}
17
18 function testmovie_DoFSCommand(command, args) \{ 
19         if ( command == "call_alert" )
20         \{ 
21                 alert("Here's the Flash message: " + args);
22         \}
23 \}
24 //-->
25
26 </SCRIPT>
27
28 <STYLE type="text/css">
29 <!--
30         A:active \{ color: #FF0000; \}
31         A:visited \{ color: #336699; \}
32         A:link \{ color: #0033FF; \}
33
34         P \{
35                 font-family: arial, helvetica, sans-serif;
36                 color: #666666; 
37         \}
38
39         P EM \{
40                 font-style: italic;
41         \}
42
43         P STRONG \{
44                 font-weight: bold;
45         \}
46
47         H1, H2, H3, H4, H5, H6 \{
48                 font-family: "trebuchet ms", arial,
49                                 helvetica, sans-serif;
50         \}
51         
52 -->
53 </STYLE>
54
55 </HEAD>
56 <BODY TEXT="#666666" LINK="#0033FF" VLINK="#336699" ALINK="#FF0000" BGCOLOR="#FFFFFF">
57
58 <CENTER>
59
60 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="90%" HEIGHT="90%">
61 <TR><TD ALIGN=CENTER VALIGN=MIDDLE>
62         
63         <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
64         <TR VALIGN=BOTTOM>
65                 <TD ALIGN=RIGHT><A HREF="http://www.viberation.com/index.html"><IMG SRC="http://www.viberation.com/graphics/head_left.gif" WIDTH="181" HEIGHT="40" BORDER="0"></A></TD>
66                 <TD ALIGN=LEFT><A HREF="http://www.viberation.com/index.html"><IMG SRC="http://www.viberation.com/graphics/head_right_sfba.gif" WIDTH="216" HEIGHT="40" BORDER="0"></A></TD>
67         </TR>
68         <TR VALIGN=TOP>
69                 <TD></TD>
70                 <TD ALIGN=LEFT NOWRAP>
71                 
72                 &nbsp;<BR>
73                 &nbsp;<BR>
74                 
75 <!-- HEADER END -->
76 <!-- end include -->
77
78
79 { form(); }
80
81 <P>{ warnings(); }</P>
82
83 <P><INPUT TYPE="SUBMIT"><INPUT TYPE="RESET"><BR>
84 <INPUT TYPE="checkbox" NAME="__MAGIC" VALUE="print">show results in printable format</P>
85
86 <TABLE BORDER="1" CELLSPACING="1" CELLPADDING="4">
87         <TR>
88                 <TH WIDTH="70" BGCOLOR="#999999" NOWRAP>Time</TD>
89                 <TH WIDTH="70" BGCOLOR="#999999" NOWRAP>Door</TD>
90                 <TH COLSPAN="2" BGCOLOR="#999999" NOWRAP>Parking</TD>
91                 <TH WIDTH="70" BGCOLOR="#999999" NOWRAP>Time</TD>
92         </TR>
93         <TR>
94                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>9pm - 10pm</TD>
95                 <TD ROWSPAN="2" BGCOLOR="#CCCCCC" ALIGN=LEFT>{ inputbox("Door 1"); }</TD>
96                 <TD WIDTH="70" ROWSPAN="2" BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>{ inputbox("Park 1"); }</TD>
97                 <TD WIDTH="70" ALIGN=LEFT NOWRAP>&nbsp;</TD>
98                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>9pm - 10pm</TD>
99         </TR>
100         <TR>
101                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>10pm - 11pm</TD>
102                 <TD ROWSPAN="2" BGCOLOR="#CCCCCC" ALIGN=LEFT>{ inputbox("Park 2"); }</TD>
103                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>10pm - 11pm</TD>
104         </TR>
105         <TR>
106                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>11pm - 12am</TD>
107                 <TD ROWSPAN="2" BGCOLOR="#CCCCCC" ALIGN=LEFT>{ inputbox("Door 2"); }</TD>
108                 <TD ROWSPAN="2" BGCOLOR="#CCCCCC" ALIGN=LEFT>{ inputbox("Park 3"); }</TD>
109                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>11pm - 12am</TD>
110         </TR>
111         <TR>
112                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>12am - 1am</TD>
113                 <TD ROWSPAN="2" BGCOLOR="#CCCCCC" ALIGN=LEFT>{ inputbox("Park 4"); }</TD>
114                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>12am - 1am</TD>
115         </TR>
116         <TR>
117                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>1am - 2am</TD>
118                 <TD ROWSPAN="2" BGCOLOR="#CCCCCC" ALIGN=LEFT>{ inputbox("Door 3"); }</TD>
119                 <TD ROWSPAN="2" BGCOLOR="#CCCCCC" ALIGN=LEFT>{ inputbox("Park 5"); }</TD>
120                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>1am - 2am</TD>
121         </TR>
122         <TR>
123                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>2am - 3am</TD>
124                 <TD ROWSPAN="2" BGCOLOR="#CCCCCC" ALIGN=LEFT>{ inputbox("Park 6"); }</TD>
125                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>2am - 3am</TD>
126         </TR>
127         <TR>
128                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>3am - 4am</TD>
129                 <TD ROWSPAN="2" BGCOLOR="#CCCCCC" ALIGN=LEFT>{ inputbox("Door 5"); }</TD>
130                 <TD ROWSPAN="2" BGCOLOR="#CCCCCC" ALIGN=LEFT>{ inputbox("Park 7"); }</TD>
131                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>3am - 4am</TD>
132         </TR>
133         <TR>
134                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>4am - 5am</TD>
135                 <TD ROWSPAN="2" BGCOLOR="#CCCCCC" ALIGN=LEFT>{ inputbox("Park 8"); }</TD>
136                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>4am - 5am</TD>
137         </TR>
138         <TR>
139                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>5am - 6am</TD>
140                 <TD ALIGN=LEFT NOWRAP>&nbsp;</TD>
141                 <TD ALIGN=LEFT NOWRAP>&nbsp;</TD>
142                 <TD BGCOLOR="#CCCCCC" ALIGN=LEFT NOWRAP>5am - 6am</TD>
143         </TR>
144 </TABLE>
145
146 <P><SUBMIT_RESET></P>
147
148 </FORM>
149
150
151 <P>
152 &copy;2000 Adam Gould and Michal Migurski.
153 </P>
154
155
156 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="400">
157 <TR><TD ALIGN=LEFT VALIGN=TOP>
158
159         <P>
160         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.
161         </P>
162
163         <H2>Download</H2>
164         
165         <P>All relevant files are included in the <A HREF="staffingsheet.sit">staffingsheet.sit</A> archive.</P>
166         <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)
167
168
169         <H2>Configuration</H2>
170         
171         <P>
172         Configuring the staffing sheet is easy.
173         </P>
174         
175         <P>
176         <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:
177         <UL>
178                 <LI><CODE>\{&nbsp;form();&nbsp;\}</CODE><BR>
179                         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.)
180                 <LI><CODE>\{&nbsp;inputbox("<i>shift</i>");&nbsp;\}</CODE><BR>
181                         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>.
182                 <LI><CODE>\{&nbsp;warnings();&nbsp;\}</CODE><BR>
183                         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.
184                 <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;>new-table-file.html</CODE>.
185         </UL>
186         Other than these tags, anything goes. You can 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.
187         </P>
188         
189         <P>
190         <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>
191 <PRE>###
192 # user-servicable parts
193 ###
194
195 $template_file = '/home/ivan/staffsheet/table.html';
196 $data_directory = '/home/ivan/staffsheet/data';
197 $mail_smtpserver = 'localhost'; # set blank to disable
198 $mail_from = 'ivan-misconfigured-shift-from@420.am';
199 $mail_subject = 'Your shift has been replaced';
200 @mail_cc = (
201   'ivan-misconfigured-shift-cc@420.am',
202   'ivan-misconfigured-shift-cc2@420.am',
203 );
204 $mail_footer = &lt;&lt;END;
205
206 Sorry, I don't have any more information.  The person who installed the 
207 staff sheet didn't customize this message.
208
209 END
210
211 ###
212 # end of user-servicable parts
213 ###
214 </PRE>
215         
216         <H2>Use</H2>
217         
218         <P>
219         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>
220         <PRE>chmod 755 shift.cgi</PRE><BR>
221         To create the the data directory:<BR>
222         <PRE>mkdir /path/to/data_dir</PRE><BR>
223         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>
224         <PRE>chown httpd /path/to/data_dir
225 chmod 755 /path/to/data_dir</PRE>
226         </P>
227         
228         <H2>Contact</H2>
229         
230         <P>
231         Any questions or problems with the staffing sheet should be directed at <A HREF="mailto:mike@viberation.com">mike@viberation.com</A> or <A HREF="mailto:goolie@cloudfactory.org">goolie@cloudfactory.org</A> - We'd be happy to answer reasonable questions about the functions of the staffing list program.<BR>
232         </P>
233
234 </TD></TR>
235 </TABLE>
236
237
238 <!-- #include "footer.incl" -->
239 <!-- FOOTER BEGIN -->
240
241 <!--            &nbsp;ÇBRÈ
242                 &nbsp;ÇBRÈ
243
244                 ÇPÈ
245                 ÇA HREF="index.html"ÈHome.Ç/AÈ
246                 Ç/PÈ -->
247                 
248                 </TD>
249         </TR>
250         </TABLE>
251 </TD></TR>
252 </TABLE>
253
254 </CENTER>
255
256 </BODY>
257 </HTML>
258
259 <!-- FOOTER END -->
260 <!-- end include -->