chiark / gitweb /
7869cc814c4cc6526c0aec599e2efd881d48223a
[nj-awaymsg.git] / mason / edit
1 <%init>
2 use AwayMsg;
3 db_connect();
4 </%init>
5
6 <%args>
7 $create => undef
8 </%args>
9
10 <%perl>
11
12 my $textid;
13
14 if (defined $create) {
15 } else {
16     foreach my $k (keys %ARGS) {
17         if ($k =~ m/^t(\d{0,7})$/) {
18             $textid= $1;
19             last;
20         }
21     }
22     die unless defined $textid;
23 }
24
25 my $sth = $dbh->prepare("SELECT * FROM texts WHERE textid=?");
26 $sth->execute($textid);
27 my $tx = $sth->fetchrow_hashref();#
28
29 if (!$tx) { die "no such text $textid"; }
30
31 </%perl>
32 <html lang="en"><head>
33 <title>Editing - <% $tx->{'desc'} |h %> - Email "out of office" setup</title>
34 </head><body>
35 <h1>Edit "<% $tx->{'desc'} |h %>"</h1>
36 <form action="save" method="post">
37 <&| txtable, tx => $tx, inputs => 1 &>
38 <tr><td>TXTABLE CONTENT</td></tr>
39 </&>
40
41 <input type="submit" name="t<% $tx->{'textid'} %>"
42    value="Edit or configure this message">