#!/bin/csh -f

# This script moves mail messages into the central tkWWW bug repository
set name = `scan cur -format "%(friendly{from})"`
set rootdir = /afs/athena.mit.edu/course/other/cdsdev
cd $rootdir/scripts

clear 
echo "*** Courseware Development System ***"
echo "*** Bug Management Script         ***"
echo -n "Look at letter (y/n)? "

if ($< =~ [Yy]*) then
   show
endif

echo ""
echo "Reply options "
echo "1) File and send automated thank you letter"
echo "2) File and send personal response"
echo "3) File and do nothing"
echo "4) Do nothing"
echo -n "Please select an option "

switch ($<) 
   case 1:
      echo "Filing letter in bugs ..."
      refile +$rootdir/mail-archive/tk-www-bugs 	
      echo "Sending thank you ..."
      cat bug.form.letter | mhmail $name -subject "tkWWW Comments"
      echo "done"
      breaksw
   case 2:
      echo "Filing letter in bugs ..."
      refile +$rootdir/mail-archive/tk-www-bugs
      folder -push +$rootdir/mail-archive/tk-www-bugs
      echo "Generating reply"
      repl -annotate -filter $cwd/bug.filter -fcc +$rootdir/mail-archive/tk-www-bugs last
      folder -pop
      breaksw
   case 3:
      echo "Filing letter in bugs ..."
      refile +$rootdir/mail-archive/tk-www-bugs 		
   default:
      echo "No reply sent"
endsw
endif

