X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=mason%2Fmain;h=11dba6bc637c571f84d0f7b54e070f0b96fe02c5;hb=71f90a83b22c354ea81a40259d0ced34b73353b9;hp=ec7c6536abc0158f524c84bcae49484c4778b5fd;hpb=42a6560ca0aa3325296f3ea72096232cdc056cb5;p=nj-awaymsg.git diff --git a/mason/main b/mason/main index ec7c653..11dba6b 100755 --- a/mason/main +++ b/mason/main @@ -1,29 +1,28 @@ <%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(<prepare(<execute(); - - +
- + @@ -31,14 +30,14 @@ END % if (defined $row->{'textid'}) { -% my $expiry = expires2timet($row->{'expires'}); -% if ($expiry > time) { - -% } else { +% my $expires = expires2timet($row->{'expires'}); +% if (defined($expires) && $expires < time) { +% } else { + % } - - + + % } else { @@ -47,3 +46,35 @@ END % }
AddressO-o-o statusStatus Which message? Expiry date
<% $row->{'emailaddr'} |h %>activeexpiredactive<% $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 %>"

+ +<&| txtable, tx => $row &> +% $sthi->execute($row->{'textid'}); +% while (my $rowi= $sthi->fetchrow_hashref()) { +Used for:<% $rowi->{'emailaddr'} |h %> +% } + +
+<% $row->{'text'} |h %>
+
+ + +% } +

Add new message

+ +