changeset 170:45d6954af516

TEST: notifyto button added for evaluation
author HIROSE Yuuji <yuuji@gentei.org>
date Fri, 29 Jan 2016 15:20:12 +0859
parents daf3f670b5c2
children cdade692e17d
files s4-blog.sh
diffstat 1 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/s4-blog.sh	Fri Jan 29 12:00:50 2016 +0859
+++ b/s4-blog.sh	Fri Jan 29 15:20:12 2016 +0859
@@ -30,6 +30,10 @@
       else
 	emails=`collectemail $blogowner`
       fi
+      notifyto=`getpar notifyto`
+      if [ -n "$replyto" ]; then
+	emails=$emails" `email4groupbyuid \"$blogowner\" $notifyto`"
+      fi
 	;;
     no)		return ;;
     *)		emails=`collectemail $blogowner` ;;
@@ -265,6 +269,10 @@
       fi
     fi
   fi
+  case `getvalbyid blog notify "$2"` in # "all", "admin" or "no" (or NULL)
+    admin)	notifyto=1 ;;
+    *)		notifyto="" ;;
+  esac
 
   err "SELECT id from $tbl where rowid=$rowid"
   id=`query "select id from $tbl where rowid=$rowid;"`
@@ -358,6 +366,11 @@
 	WHEN '$user' THEN a.rowid||'+'||$rowid
 	ELSE ''
 	END edit,
+	CASE -- 「通知送信」ボタンの有無
+	WHEN '$notifyto' = '' THEN ''	-- 不要モードならなし
+	WHEN '$user' = author THEN ''	-- 筆者自身ならなし
+	ELSE "yes"
+	END notify,
 	(SELECT rowid FROM user WHERE name=author) user_rid,
 	coalesce((SELECT val FROM user_s
 			 WHERE name=author AND key='gecos'),
@@ -373,12 +386,15 @@
      a_s s
   ON a.id=s.id;
 EOF
-    while IFS='|' read id edit uid uname tm hte imgids; do
+    while IFS='|' read id edit notify uid uname tm hte imgids; do
+      nt="<label style=\"font-size: 70%;\"><input type=\"checkbox\"
+	 name=\"notifyto\" value=\"$uid\">返信通知送信</label>"
       cat<<EOF |
 <tr id="$id">
 <td>${edit:+<a href="$elink+$edit">編集</a>}
 <a href="$hlink+$uid">$uname</a>
-$tm</td><td>`echo "$hte"|unhexize|htmlescape`
+$tm
+${notify:+$nt}</td><td>`echo "$hte"|unhexize|htmlescape`
 EOF
       sed -e "s|^href=\([-A-Za-z0-9,.:/~_%#&+?]*\)|<a &>\1</a>|"
       for i in $imgids; do

yatex.org