s4

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 diff
     1.1 --- a/s4-blog.sh	Fri Jan 29 12:00:50 2016 +0859
     1.2 +++ b/s4-blog.sh	Fri Jan 29 15:20:12 2016 +0859
     1.3 @@ -30,6 +30,10 @@
     1.4        else
     1.5  	emails=`collectemail $blogowner`
     1.6        fi
     1.7 +      notifyto=`getpar notifyto`
     1.8 +      if [ -n "$replyto" ]; then
     1.9 +	emails=$emails" `email4groupbyuid \"$blogowner\" $notifyto`"
    1.10 +      fi
    1.11  	;;
    1.12      no)		return ;;
    1.13      *)		emails=`collectemail $blogowner` ;;
    1.14 @@ -265,6 +269,10 @@
    1.15        fi
    1.16      fi
    1.17    fi
    1.18 +  case `getvalbyid blog notify "$2"` in # "all", "admin" or "no" (or NULL)
    1.19 +    admin)	notifyto=1 ;;
    1.20 +    *)		notifyto="" ;;
    1.21 +  esac
    1.22  
    1.23    err "SELECT id from $tbl where rowid=$rowid"
    1.24    id=`query "select id from $tbl where rowid=$rowid;"`
    1.25 @@ -358,6 +366,11 @@
    1.26  	WHEN '$user' THEN a.rowid||'+'||$rowid
    1.27  	ELSE ''
    1.28  	END edit,
    1.29 +	CASE -- 「通知送信」ボタンの有無
    1.30 +	WHEN '$notifyto' = '' THEN ''	-- 不要モードならなし
    1.31 +	WHEN '$user' = author THEN ''	-- 筆者自身ならなし
    1.32 +	ELSE "yes"
    1.33 +	END notify,
    1.34  	(SELECT rowid FROM user WHERE name=author) user_rid,
    1.35  	coalesce((SELECT val FROM user_s
    1.36  			 WHERE name=author AND key='gecos'),
    1.37 @@ -373,12 +386,15 @@
    1.38       a_s s
    1.39    ON a.id=s.id;
    1.40  EOF
    1.41 -    while IFS='|' read id edit uid uname tm hte imgids; do
    1.42 +    while IFS='|' read id edit notify uid uname tm hte imgids; do
    1.43 +      nt="<label style=\"font-size: 70%;\"><input type=\"checkbox\"
    1.44 +	 name=\"notifyto\" value=\"$uid\">返信通知送信</label>"
    1.45        cat<<EOF |
    1.46  <tr id="$id">
    1.47  <td>${edit:+<a href="$elink+$edit">編集</a>}
    1.48  <a href="$hlink+$uid">$uname</a>
    1.49 -$tm</td><td>`echo "$hte"|unhexize|htmlescape`
    1.50 +$tm
    1.51 +${notify:+$nt}</td><td>`echo "$hte"|unhexize|htmlescape`
    1.52  EOF
    1.53        sed -e "s|^href=\([-A-Za-z0-9,.:/~_%#&+?]*\)|<a &>\1</a>|"
    1.54        for i in $imgids; do