]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Add one reference example to illustrate what can be done with templates, and
authorDarren Nickerson <darren.nickerson@ifax.com>
Fri, 9 Feb 2007 15:52:49 +0000 (15:52 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Fri, 9 Feb 2007 15:52:49 +0000 (15:52 +0000)
for folks to use as a stepping stone to branding HylaFAX with their own 'look
and feel'. This is not meant to be the 'one true way' to do it, but rather
just a sample that illustrates most of the features/functionality. We hope
to see several other samples in here in future releases.

26 files changed:
etc/Makefile.in
etc/templates/html-sample1/css.inc [new file with mode: 0644]
etc/templates/html-sample1/divider.inc [new file with mode: 0644]
etc/templates/html-sample1/fax-attach.inc [new file with mode: 0644]
etc/templates/html-sample1/fax-data.inc [new file with mode: 0644]
etc/templates/html-sample1/fax-dispatched.inc [new file with mode: 0644]
etc/templates/html-sample1/faxrcvd-error.txt [new file with mode: 0644]
etc/templates/html-sample1/faxrcvd-failure.txt [new file with mode: 0644]
etc/templates/html-sample1/faxrcvd-notify-error.txt [new file with mode: 0644]
etc/templates/html-sample1/faxrcvd-notify-success.txt [new file with mode: 0644]
etc/templates/html-sample1/faxrcvd-success.txt [new file with mode: 0644]
etc/templates/html-sample1/footer.inc [new file with mode: 0644]
etc/templates/html-sample1/header.inc [new file with mode: 0644]
etc/templates/html-sample1/hook.sh [new file with mode: 0644]
etc/templates/html-sample1/job-data.inc [new file with mode: 0644]
etc/templates/html-sample1/notify-blocked.txt [new file with mode: 0644]
etc/templates/html-sample1/notify-done.txt [new file with mode: 0644]
etc/templates/html-sample1/notify-failed.txt [new file with mode: 0644]
etc/templates/html-sample1/notify-format_failed.txt [new file with mode: 0644]
etc/templates/html-sample1/notify-killed.txt [new file with mode: 0644]
etc/templates/html-sample1/notify-no_formatter.txt [new file with mode: 0644]
etc/templates/html-sample1/notify-rejected.txt [new file with mode: 0644]
etc/templates/html-sample1/notify-removed.txt [new file with mode: 0644]
etc/templates/html-sample1/notify-requeued.txt [new file with mode: 0644]
etc/templates/html-sample1/notify-timedout.txt [new file with mode: 0644]
etc/templates/html-sample1/session_log.inc [new file with mode: 0644]

index 37e722d4b488e6597aa407dc68609882ef2a8b9d..6736d0c8a9eac85d7b17cdeef19a222b530f5ea0 100644 (file)
@@ -54,7 +54,7 @@ DIALRULES=dialrules \
        dialrules.europe
 TARGETS        = config.fax hosts.hfaxd xferfaxlog lockname ondelay
 
-TEMPLATES = en fr de ro pt_BR pt es it pl
+TEMPLATES = en fr de ro pt_BR pt es it pl html-sample1
 
 default all::
        @${MAKE} targets
diff --git a/etc/templates/html-sample1/css.inc b/etc/templates/html-sample1/css.inc
new file mode 100644 (file)
index 0000000..51ee937
--- /dev/null
@@ -0,0 +1,60 @@
+body div td
+{
+       font-size: 13px;
+       font-family: Verdana, Arial, Helvetica, Swiss, Futura, sans-serif;
+       color: #000000;
+}
+
+#logo {
+padding:10px;
+width:740px;
+background-color: #89EC77;
+-moz-border-radius: 8px;
+text-align:left;
+color:green;
+font-size: 22px;
+margin: 0px;
+}
+
+#content {
+ text-align: left;
+ margin: 0;
+ width: 740px;
+}
+
+#pdfblurb {
+ font-size: 13px;
+ padding:10px;
+ width:740px;
+ -moz-border-radius: 8px;
+}
+
+.tagline {
+ font-size: 12px;
+ font-style: italic
+}
+
+hr {
+ border: 0;
+ clear: both;
+ color: white;
+ border-bottom: 1px dotted #A9A9A9;
+ margin: 1em;
+}
+
+#fax
+{
+ font-size: 13px;
+ margin: 2em;
+}
+
+#faxdata
+{
+  border: 1px;
+}
+
+#error.blockquote
+{
+background-color: #89EC77;
+-moz-border-radius: 8px;
+}
diff --git a/etc/templates/html-sample1/divider.inc b/etc/templates/html-sample1/divider.inc
new file mode 100644 (file)
index 0000000..556004b
--- /dev/null
@@ -0,0 +1 @@
+<hr class="divider"/>
diff --git a/etc/templates/html-sample1/fax-attach.inc b/etc/templates/html-sample1/fax-attach.inc
new file mode 100644 (file)
index 0000000..bb277ab
--- /dev/null
@@ -0,0 +1,11 @@
+ <div id="pdfblurb" align="left">
+  <blockquote>
+    Your fax is attached to this email in PDF format. If you have
+    problems decoding this attachment, you may need to install a PDF
+    viewer. A common viewer available for many operating systems is
+    Adobe's Acrobat reader, which may be
+    <a href="http://www.adobe.com/products/acrobat/readstep2.html">
+     downloaded here
+    </a>.
+  </blockquote>
+ </div>
diff --git a/etc/templates/html-sample1/fax-data.inc b/etc/templates/html-sample1/fax-data.inc
new file mode 100644 (file)
index 0000000..be7b838
--- /dev/null
@@ -0,0 +1,39 @@
+   <div id="faxdata">
+    <table border="0" align="center">
+     <tr>
+      <td colspan="2"></td>
+      <td rowspan="9" width="20"></td>
+      <td rowspan="9" bgcolor="#cccccc" width="1"></td>
+      <td rowspan="9" width="20"></td>
+      <td colspan="2"></td>
+     </tr>
+     <tr>
+       <td align="right">Received:</td><td>$RECEIVED</td>
+       <td align="right">Pages:</td><td>$PAGES</td>
+     </tr>
+     <tr>
+       <td align="right">Sender:</td><td>$SENDER</td>
+       <td align="right">Quality:</td><td>$QUALITY</td>
+     </tr>
+     <tr>
+       <td align="right">CID:</td><td>$CALLID1</td>
+       <td align="right">Page Size:</td><td>$PAGE</td>
+     </tr>
+     <tr>
+       <td align="right">DID:</td><td>$CALLID2</td>
+       <td align="right">TimeToRecv:</td><td>$TIMETORECV</td>
+     </tr>
+     <tr>
+       <td align="right">CommID:</td><td>$COMMID</td>
+       <td align="right">SignalRate:</td><td>$SIGNALRATE</td>
+     </tr>
+     <tr>
+       <td align="right">ReceivedOn:</td><td>$DEVICE</td>
+       <td align="right">DataFormat:</td><td>$DATAFORMAT</td>
+     </tr>
+     <tr>
+       <td align="right"></td><td></td>
+       <td align="right"></td><td></td>
+     </tr>
+    </table>
+   </div>
diff --git a/etc/templates/html-sample1/fax-dispatched.inc b/etc/templates/html-sample1/fax-dispatched.inc
new file mode 100644 (file)
index 0000000..f0bcd2a
--- /dev/null
@@ -0,0 +1,4 @@
+<div>
+  The fax has automatically been dispatched to:<br/>
+  <blockquote><pre>$SENDTO_HTML</pre></blockquote>
+</div>
diff --git a/etc/templates/html-sample1/faxrcvd-error.txt b/etc/templates/html-sample1/faxrcvd-error.txt
new file mode 100644 (file)
index 0000000..68c0f86
--- /dev/null
@@ -0,0 +1,29 @@
+To: $SENDTO
+From: $FROMADDR
+Subject: Partial FAX received from $SENDER
+Content-type: text/html; charset=UTF-8
+Content-Transfer-Encoding: base64
+
+
+#INCLUDE header.inc
+
+    <hr class="divider"/>
+
+#INCLUDE fax-data.inc
+
+    <hr class="divider"/>
+
+    <div id=error>
+       The full document was not received because:<br/>
+       <blockquote>
+           $MSG
+       </blockquote>
+#INCLUDE session_log.inc
+    </div>
+
+    <hr class="divider"/>
+
+#INCLUDE fax-attach.inc
+
+#INCLUDE footer.inc
+
diff --git a/etc/templates/html-sample1/faxrcvd-failure.txt b/etc/templates/html-sample1/faxrcvd-failure.txt
new file mode 100644 (file)
index 0000000..a25b432
--- /dev/null
@@ -0,0 +1,21 @@
+To: $TOADDR
+From: $FROMADDR
+Subject: FAX not received on $DEVICE
+Content-type: text/html; charset=UTF-8
+Content-Transfer-Encoding: base64
+
+
+#INCLUDE header.inc
+
+    <hr class="divider"/>
+
+    <div id=error>
+       An attempt to receive a fax failed because:<br/>
+       <blockquote>
+           $MSG
+       </blockquote>
+#INCLUDE session_log.inc
+    </div>
+
+#INCLUDE footer.inc
+
diff --git a/etc/templates/html-sample1/faxrcvd-notify-error.txt b/etc/templates/html-sample1/faxrcvd-notify-error.txt
new file mode 100644 (file)
index 0000000..81bf71d
--- /dev/null
@@ -0,0 +1,29 @@
+To: $TOADDR
+From: $FROMADDR
+Subject: Partial FAX received on $DEVICE from "$SENDER"
+Content-type: text/html; charset=UTF-8
+Content-Transfer-Encoding: base64
+
+
+#INCLUDE header.inc
+
+#INCLUDE divider.inc
+
+#INCLUDE fax-data.inc
+
+#INCLUDE divider.inc
+
+    <div id=error>
+       The full document was not received because:<br/>
+       <blockquote>
+           $MSG
+       </blockquote>
+#INCLUDE session_log.inc
+    </div>
+
+#INCLUDE divider.inc
+
+#INCLUDE fax-dispatched.inc
+
+#INCLUDE footer.inc
+
diff --git a/etc/templates/html-sample1/faxrcvd-notify-success.txt b/etc/templates/html-sample1/faxrcvd-notify-success.txt
new file mode 100644 (file)
index 0000000..a622075
--- /dev/null
@@ -0,0 +1,19 @@
+To: $TOADDR
+From: $FROMADDR
+Subject: FAX received on $DEVICE from "$SENDER"
+Content-type: text/html; charset=UTF-8
+Content-Transfer-Encoding: base64
+
+
+#INCLUDE header.inc
+
+#INCLUDE divider.inc
+
+#INCLUDE fax-data.inc
+
+#INCLUDE divider.inc
+
+#INCLUDE fax-dispatched.inc
+
+#INCLUDE footer.inc
+
diff --git a/etc/templates/html-sample1/faxrcvd-success.txt b/etc/templates/html-sample1/faxrcvd-success.txt
new file mode 100644 (file)
index 0000000..6dfe622
--- /dev/null
@@ -0,0 +1,19 @@
+To: $SENDTO
+From: $FROMADDR
+Subject: FAX received from $SENDER
+Content-type: text/html; charset=UTF-8
+Content-Transfer-Encoding: base64
+
+
+#INCLUDE header.inc
+
+#INCLUDE divider.inc
+
+#INCLUDE fax-data.inc
+
+#INCLUDE divider.inc
+
+#INCLUDE fax-attach.inc
+
+#INCLUDE footer.inc
+
diff --git a/etc/templates/html-sample1/footer.inc b/etc/templates/html-sample1/footer.inc
new file mode 100644 (file)
index 0000000..0474f00
--- /dev/null
@@ -0,0 +1,4 @@
+
+ </div>
+</body>
+</html>
diff --git a/etc/templates/html-sample1/header.inc b/etc/templates/html-sample1/header.inc
new file mode 100644 (file)
index 0000000..c13b68d
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<style type="text/css">
+<!--
+#INCLUDE css.inc
+ -->
+</style>
+</head>
+
+<body bgcolor="#FFFFFF" align="center">
+
+ <div id="logo">
+     <img src="http://people.ifax.com/~aidan/hylafax/templates/images/small_frog.png" style="vertical-align:text-bottom;"> HylaFAX <span class="tagline">The world's most advanced open source fax server</span>
+ </div>
+
+ <div id="content" align="center">
diff --git a/etc/templates/html-sample1/hook.sh b/etc/templates/html-sample1/hook.sh
new file mode 100644 (file)
index 0000000..26080ac
--- /dev/null
@@ -0,0 +1,14 @@
+# We need HTMLizing certain fields 
+
+html_sanitize()
+{
+    for i in $*
+    do
+       #printf '%s: \n' "$i"
+       val=`eval echo "$""$i" | sed -e 's/</\&lt;/g;s/>/\&gt;/g'`
+       eval "$i"_HTML='"'"$val"'"'
+       eval export "$i"_HTML
+    done
+}
+
+html_sanitize SENDTO
diff --git a/etc/templates/html-sample1/job-data.inc b/etc/templates/html-sample1/job-data.inc
new file mode 100644 (file)
index 0000000..55580d8
--- /dev/null
@@ -0,0 +1,53 @@
+
+   <div id="faxdata">
+    <table border="0" align="center">
+     <tr>
+      <td colspan="2"></td>
+      <td rowspan="99" width="20"></td>
+      <td rowspan="99" bgcolor="#cccccc" width="1"></td>
+      <td rowspan="99" width="20"></td>
+      <td colspan="2"></td>
+     </tr>
+     <tr>
+       <td align="right">Pages:</td><td>$npages / $totpages</td>
+       <td align="right">Number:</td><td>$number</td>
+     </tr>
+     <tr>
+       <td align="right">Page Width:</td><td>$pagewidth (mm)</td>
+       <td align="right">Receiver:</td><td>$receiver</td>
+     </tr>
+     <tr>
+       <td align="right">Page Length:</td><td>$pagelength</td>
+       <td align="right">Company:</td><td>$company</td>
+     </tr>
+     <tr>
+       <td align="right">Resolution:</td><td>$resolution (lpi)</td>
+       <td align="right">Remote Station:</td><td>$csi</td>
+     </tr>
+     <tr>
+       <td align="right">Sender:</td><td>$sender</td>
+       <td align="right">Signal Rate:</td><td>$signalrate</td>
+     </tr>
+     <tr>
+       <td align="right">Address</td><td>$mailaddr</td>
+       <td align="right">Dials:</td><td>$ndials</td>
+     </tr>
+     <tr>
+       <td align="right">Submitted from:</td><td>$client</td>
+       <td align="right">Calls:</td><td>$totdials</td>
+     </tr>
+     <tr>
+       <td align="right">Modem Group:</td><td>$modem</td>
+       <td align="right">Dialogs:</td><td>$tottries</td>
+     </tr>
+     <tr>
+       <td align="right">CommID:</td><td>$commid</td>
+       <td align="right">Attempts:</td><td>$ntries</td>
+     </tr>
+     <tr>
+       <td align="right"></td><td></td>
+       <td align="right"></td><td></td>
+     </tr>
+    </table>
+
+   </div>
diff --git a/etc/templates/html-sample1/notify-blocked.txt b/etc/templates/html-sample1/notify-blocked.txt
new file mode 100644 (file)
index 0000000..5abef94
--- /dev/null
@@ -0,0 +1,21 @@
+To: $SENDTO
+From: $FROMADDR
+Subject: Fax $jobid to $DESTINATION blocked
+Content-type: text/html; charset=UTF-8
+Content-Transfer-Encoding: base64
+
+
+#INCLUDE header.inc
+
+#INCLUDE divider.inc
+
+Your fax <b>$jobid</b> to $DESTINATION is <i>delayed</i> in
+the scheduling queue because:
+<blockquote>
+    $faxstatus
+</blockquote>
+<br/>
+The job will be processed as soon as possible.
+
+#INCLUDE footer.inc
+
diff --git a/etc/templates/html-sample1/notify-done.txt b/etc/templates/html-sample1/notify-done.txt
new file mode 100644 (file)
index 0000000..9ca2429
--- /dev/null
@@ -0,0 +1,21 @@
+To: $SENDTO
+From: $FROMADDR
+Subject: Fax $jobid to $DESTINATION completed
+Content-type: text/html; charset=UTF-8
+Content-Transfer-Encoding: base64
+
+
+#INCLUDE header.inc
+
+#INCLUDE divider.inc
+
+Your fax <b>$jobid</b> to $DESTINATION was <i>completed successfully</i> in $JTIME.
+
+#INCLUDE job-data.inc
+
+#INCLUDE divider.inc
+
+#INCLUDE fax-attach.inc
+
+#INCLUDE footer.inc
+
diff --git a/etc/templates/html-sample1/notify-failed.txt b/etc/templates/html-sample1/notify-failed.txt
new file mode 100644 (file)
index 0000000..90b6fce
--- /dev/null
@@ -0,0 +1,34 @@
+To: $SENDTO
+From: $FROMADDR
+Subject: Fax $jobid to $DESTINATION failed
+Content-type: text/html; charset=UTF-8
+Content-Transfer-Encoding: base64
+
+
+#INCLUDE header.inc
+
+#INCLUDE divider.inc
+
+Your fax <b>$jobid</b> to $DESTINATION has <i>failed</i>.
+
+
+#INCLUDE job-data.inc
+
+Processing time was $JTIME.
+
+#INCLUDE divider.inc
+
+    <div id=error>
+       The last attempt failed because:<br/>
+       <blockquote>
+           $faxstatus
+       </blockquote>
+#INCLUDE session_log.inc
+    </div>
+
+#INCLUDE divider.inc
+
+#INCLUDE fax-attach.inc
+
+#INCLUDE footer.inc
+
diff --git a/etc/templates/html-sample1/notify-format_failed.txt b/etc/templates/html-sample1/notify-format_failed.txt
new file mode 100644 (file)
index 0000000..1cc621e
--- /dev/null
@@ -0,0 +1,23 @@
+To: $SENDTO
+Subject: Fax $jobid to $DESTINATION failed
+From: $FROMADDR
+Content-type: text/html; charset=UTF-8
+Content-Transfer-Encoding: base64
+
+#INCLUDE header.inc
+
+#INCLUDE divider.inc
+
+Your fax <b>$jobid</b> to $DESTINATION was <i>not sent</i> because document conversion
+failed.  The output from the converter program was:
+<blockquote>
+    <pre>$faxstatus</pre>
+</blockquote>
+<br/>
+Check any PostScript documents for non-standard fonts and invalid constructs
+
+#INCLUDE divider.inc
+
+#INCLUDE job-data.inc
+
+#INCLUDE footer.inc
diff --git a/etc/templates/html-sample1/notify-killed.txt b/etc/templates/html-sample1/notify-killed.txt
new file mode 100644 (file)
index 0000000..ad264c3
--- /dev/null
@@ -0,0 +1,19 @@
+To: $SENDTO
+From: $FROMADDR
+Subject: Fax $jobid to $DESTINATION was removed
+Content-type: text/html; charset=UTF-8
+Content-Transfer-Encoding: base64
+
+
+#INCLUDE header.inc
+
+#INCLUDE divider.inc
+
+Your fax <b>$jobid</b> to $DESTINATION was <i>removed</i> from the queue.
+
+#INCLUDE divider.inc
+
+#INCLUDE job-data.inc
+
+#INCLUDE footer.inc
+
diff --git a/etc/templates/html-sample1/notify-no_formatter.txt b/etc/templates/html-sample1/notify-no_formatter.txt
new file mode 100644 (file)
index 0000000..54cbdea
--- /dev/null
@@ -0,0 +1,18 @@
+To: $SENDTO
+Subject: Fax $jobid to $DESTINATION failed
+From: $FROMADDR
+Content-type: text/html; charset=UTF-8
+Content-Transfer-Encoding: base64
+
+#INCLUDE header.inc
+
+#INCLUDE divider.inc
+
+Your fax <b>$jobid> to $DESTINATION <i>failed</i> because the document
+conversion script was not found.
+
+#INCLUDE divider.inc
+
+#INCLUDE job-data.inc
+
+#INCLUDE footer.inc
diff --git a/etc/templates/html-sample1/notify-rejected.txt b/etc/templates/html-sample1/notify-rejected.txt
new file mode 100644 (file)
index 0000000..f3bd9a3
--- /dev/null
@@ -0,0 +1,21 @@
+To: $SENDTO
+From: $FROMADDR
+Subject: Fax $jobid to $DESTINATION rejected
+Content-type: text/html; charset=UTF-8
+Content-Transfer-Encoding: base64
+
+#INCLUDE header.inc
+
+Your job to $DESTINATION was <i>rejected</i> because:
+<blockquote>
+    <pre>$faxstatus</pre>
+</blockquote>
+<br/>
+
+#INCLUDE divider.inc
+
+#INCLUDE job-data.inc
+
+#INCLUDE divider.inc
+
+#INCLUDE footer.inc
diff --git a/etc/templates/html-sample1/notify-removed.txt b/etc/templates/html-sample1/notify-removed.txt
new file mode 100644 (file)
index 0000000..ad264c3
--- /dev/null
@@ -0,0 +1,19 @@
+To: $SENDTO
+From: $FROMADDR
+Subject: Fax $jobid to $DESTINATION was removed
+Content-type: text/html; charset=UTF-8
+Content-Transfer-Encoding: base64
+
+
+#INCLUDE header.inc
+
+#INCLUDE divider.inc
+
+Your fax <b>$jobid</b> to $DESTINATION was <i>removed</i> from the queue.
+
+#INCLUDE divider.inc
+
+#INCLUDE job-data.inc
+
+#INCLUDE footer.inc
+
diff --git a/etc/templates/html-sample1/notify-requeued.txt b/etc/templates/html-sample1/notify-requeued.txt
new file mode 100644 (file)
index 0000000..d8ead5a
--- /dev/null
@@ -0,0 +1,30 @@
+To: $SENDTO
+From: $FROMADDR
+Subject: Fax $jobid to $DESTINATION requeued
+Content-type: text/html; charset=UTF-8
+Content-Transfer-Encoding: base64
+
+
+#INCLUDE header.inc
+
+#INCLUDE divider.inc
+
+Your fax <b>$jobid</b> to $DESTINATION has been <i>requeued</i>.
+<br/>
+The last attempt to send it was unsuccessful:
+<blockquote id=error>
+    <code>$faxstatus</code>
+</blockquote>
+
+#INCLUDE job-data.inc
+
+It will be retried again at $NEXT.
+
+#INCLUDE divider.inc
+    <div id=error>
+       The last attempt failed because:<br/>
+#INCLUDE session_log.inc
+    </div>
+
+#INCLUDE footer.inc
+
diff --git a/etc/templates/html-sample1/notify-timedout.txt b/etc/templates/html-sample1/notify-timedout.txt
new file mode 100644 (file)
index 0000000..5c633df
--- /dev/null
@@ -0,0 +1,19 @@
+To: $SENDTO
+From: $FROMADDR
+Subject: Fax $jobid to $DESTINATION timed out
+Content-type: text/html; charset=UTF-8
+Content-Transfer-Encoding: base64
+
+
+#INCLUDE header.inc
+
+#INCLUDE divider.inc
+
+Your fax <b>$jobid</b> to $DESTINATION has <i>timed out</i>
+and has been removed from the queue.
+
+#INCLUDE divider.inc
+
+#INCLUDE job-data.inc
+
+#INCLUDE footer.inc
diff --git a/etc/templates/html-sample1/session_log.inc b/etc/templates/html-sample1/session_log.inc
new file mode 100644 (file)
index 0000000..49311d9
--- /dev/null
@@ -0,0 +1 @@
+       <textarea cols="90" wrap="off" rows="15" readonly>$SESSION_LOG</textarea>