X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=mason%2Fmain;h=e8c29e6fd7c864ec49941a2fc02e56d33ad10162;hb=8b294424211f992a399bc48919b4f868c23530b9;hp=de9a0a3b9b4ab9238acde36d15881e0a3a2e181c;hpb=fa1084e8d681187707259ed712f6d5d5c7b99526;p=nj-awaymsg.git diff --git a/mason/main b/mason/main old mode 100644 new mode 100755 index de9a0a3..e8c29e6 --- a/mason/main +++ b/mason/main @@ -1,36 +1,74 @@ -<%doc> -<%/doc> <%init> use AwayMsg; +db_connect(); +my ($sth,$row,$sthi,$rowi); + Email "out of office" setup

Email "out of office" setup

-

Our email addresses

- +

Email addresses and their configuration

<%perl> -my %row; -my $sth = $dbh->prepare("SELECT emailaddr, textid, expires" - " FROM schema - " RIGHT JOIN addresses USING (emailaddr)". - " JOIN texts USING (textid)", - " ORDER BY emailaddr"); +$sth = $dbh->prepare(<execute(); - - +
- + -% while ($row= $sth->fetchrow_hashref()) { +% while (my $row= $sth->fetchrow_hashref()) { + % if (defined $row->{'textid'}) { -% my $expiry = expires2timet($row->{'expires'}); -% if ($expiry > time) { +% my $expires = expires2timet($row->{'expires'}); +% if (defined($expires) && $expires < time) { + +% } else { - - - + +% } else { + + + +% } + +% } +
AddressO-o-o statusStatus Which message? Expiry date
<% $row->{'emailaddr'} |h %>expiredactive<% $row->{'textid'} |h %><% $row->{'expires'} |h %> +% } +<% $row->{'desc'} |h %><% expirestime2show($expires) |h %>inactive
+ +

Outbound messages

+<%perl> +$sth = $dbh->prepare("SELECT * FROM texts ORDER BY desc"); +$sthi = $dbh->prepare(<execute(); + +% while (my $row= $sth->fetchrow_hashref()) { +

Message "<% $row->{'desc'} |h %>"

+ + + + + +
Short name:<% $row->{'desc'} |h %>
Expires:<% + expirestime2show(expires2timet($row->{'expires'})) + |h %>
Subject:<% $row->{'subject'} |h %>
+

+

+<% $row->{'text'} |h %>
+
+% }