X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=nj-awaymsg.git;a=blobdiff_plain;f=mason%2Fmain;h=42cfaac56e48329390f41856deb226eb73c93593;hp=8a2533f3dec18ece1ce9ec8efc8139ad5f29bf60;hb=47aa1f68c037b4f199b66740c94f837a7110ca2f;hpb=e4d5c2aa7fa9dc49cbdece5472dcb155d5833ea9 diff --git a/mason/main b/mason/main index 8a2533f..42cfaac 100755 --- a/mason/main +++ b/mason/main @@ -1,35 +1,74 @@ <%init> use AwayMsg; +db_connect(); +my ($sth,$row,$sthi,$rowi); -Email "out of office" setup +Email away message setup -

Email "out of office" setup

-

Our email addresses

- +

Email away message setup

+

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) { - - - +% } else { + + +% } + +% } +
AddressO-o-o statusStatus Which message?Expiry date
<% $row->{'emailaddr'} |h %>active<% $row->{'textid'} |h %><% $row->{'expires'} |h %> +<% $row->{'desc'} |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

+ +