From 1f01b365b07c5952ec878a4ca0d4b69f2ed14f80 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 4 Sep 2012 21:12:26 +0100 Subject: [PATCH] found --- mason/edit | 42 ++++++++++++++++++++++++++++++++++++++++++ mason/txtable | 31 +++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100755 mason/edit create mode 100644 mason/txtable diff --git a/mason/edit b/mason/edit new file mode 100755 index 0000000..7869cc8 --- /dev/null +++ b/mason/edit @@ -0,0 +1,42 @@ +<%init> +use AwayMsg; +db_connect(); + + +<%args> +$create => undef + + +<%perl> + +my $textid; + +if (defined $create) { +} else { + foreach my $k (keys %ARGS) { + if ($k =~ m/^t(\d{0,7})$/) { + $textid= $1; + last; + } + } + die unless defined $textid; +} + +my $sth = $dbh->prepare("SELECT * FROM texts WHERE textid=?"); +$sth->execute($textid); +my $tx = $sth->fetchrow_hashref();# + +if (!$tx) { die "no such text $textid"; } + + + +Editing - <% $tx->{'desc'} |h %> - Email "out of office" setup + +

Edit "<% $tx->{'desc'} |h %>"

+
+<&| txtable, tx => $tx, inputs => 1 &> +TXTABLE CONTENT + + + diff --git a/mason/txtable b/mason/txtable new file mode 100644 index 0000000..b2bdc72 --- /dev/null +++ b/mason/txtable @@ -0,0 +1,31 @@ + +<%args> +$tx +$inputs => 0 + + +% my $ent = sub { +% my ($head,$name,$val,$style,$size,$input_xinfo) = @_; +<% $head %> + +% if ($inputs) { +% $size ||= 70; + +<% $input_xinfo %> +% } else { +% if (defined $style) { +<% "<$style>" %> +% } +<% $val |h %> +% if (defined $style) { +<% "" %> +% } +% } +% }; + + +% $ent->('Short name:', 'desc', $tx->{'desc'}); +<% $m->content %> +% $ent->('Subject:', 'subject', $tx->{'subject'}, 'code'); +
+

-- 2.30.2