changeset 8:55548317a101 draft

RCS-revision 1.9 date: 2004/01/16 14:45:49; author: yuuji; state: Exp; lines: +16 -6 Use parameter sub_nt* instead of nt* at actual submission.
author HIROSE Yuuji <yuuji@gentei.org>
date Fri, 16 Jan 2004 14:45:49 +0859
parents 51440ee77ae4
children fbe1de450bd7
files after5.rb
diffstat 1 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/after5.rb	Fri Jan 16 04:28:06 2004 +0859
+++ b/after5.rb	Fri Jan 16 14:45:49 2004 +0859
@@ -2,8 +2,8 @@
 #
 # Associative Scheduling Table - after5
 # (C)2003, 2004 by HIROSE Yuuji [yuuji@gentei.org]
-# $Id: after5.rb,v 1.8 2004/01/16 04:28:06 yuuji Exp $
-# Last modified Fri Jan 16 13:10:10 2004 on firestorm
+# $Id: after5.rb,v 1.9 2004/01/16 14:45:49 yuuji Exp $
+# Last modified Fri Jan 16 23:25:14 2004 on firestorm
 # See http://www.gentei.org/~yuuji/software/after5/
 # このスクリプトはEUCで保存してください。
 
@@ -931,6 +931,7 @@
       'hostcmd'		=> '/usr/bin/host',
       'nslookup'	=> '/usr/sbin/nsookup',
       'bg'		=> 'ivory',
+      'name'		=> nil,
       'at_bsd'		=> '%H:%M %b %d %Y',
       'at_solaris'	=> '%H:%M %b %d,%Y',
       'schedir'		=> 's',
@@ -994,8 +995,13 @@
     @params['user'] = safecopy(@params['user'])
 
     eval @job
+    a5name = if @opt['name'] && @opt['name'] > ''
+	       sprintf("(%s)", @opt['name'])
+	     else
+	       ""
+	     end
     @O.append(@H.contenttype() +
-	      @H.head("After 5"+@job.sub(/\s*/, ' '), @opt['css']))
+	      @H.head(a5name+"After 5"+@job.sub(/\s*/, ' '), @opt['css']))
     # @job is here
     @O.print @H.startelement("body", bodyclass, true)
     @O.print @H.endelement(nil, true) # body
@@ -1018,7 +1024,7 @@
 	'error'		=> ['エラー:', 'Error: '],
 	'mailerror'	=> ['メイルアドレスが違います', 'Invalid email address'],
 	'pswderror'	=> ['パスワードが違います', 'Password incorrect'],
-	'fmtdaysschedule'=> ['%sの予定', 'Schedule on %s'],
+	'fmtdaysschedule'=> ['%s〜の予定', 'Schedule from %s'],
 	'noplan'	=> ['登録されている予定はありません', 'No plans'],
 	'allday'	=> ['全日', 'whole day'],
 	'addsched'	=> ['新規予定項目の登録', 'Register new schedule'],
@@ -1478,6 +1484,7 @@
     start = 1-wday1
     wname = @wnames
     today = Time.now
+    todayy = today.year
     todaym = today.month
     todayd = today.day
     tdclass = {}
@@ -1511,7 +1518,7 @@
     while column <= last
       @O.print @H.elementln("tr", nil){
 	(column..column+6).collect{|d|
-	  todayp = (day.month==todaym && d==todayd)
+	  todayp = (day.year==todayy && day.month==todaym && d==todayd)
 	  wd=d-column
 	  hd = holiday.isHoliday(day.year, day.month, d, wd)
 	  tdclass['class'] = (hd ? 'holiday' : wname[wd])
@@ -1808,7 +1815,8 @@
       @H.elementln("p"){	# put notify mail checkbox
 	msg('reqnotify') + '<br>' + \
 	@ntlist.collect{|n, v|
-	  @H.checkbox(n, 'yes', v, @params[n])
+	  # Actual variables of notifylist for submitting is "sub_"+n
+	  @H.checkbox("sub_"+n, 'yes', v, @params[n])
 	}.join("\n") + \
 	" " + @H.checkbox('rightnow', 'yes', msg('rightnow'), true) + \
 	"\n"
@@ -1929,6 +1937,8 @@
     
     filearg = [user, year, month, day, t]
     @ntlist.each{|k, v|
+      # @params[k]s are always defined in cookies, so we use @params["sub_"+k]
+      @params[k] = @params["sub_"+k]
       nt_time = notify_time(year, month, day, t, k)
       if !nt_time
 	# do nothing for allday schedule's notification before some minutes

yatex.org