;;; -*- Mode: Common-Lisp; Package: ZWEI; Base: 8.; Patch-File: T -*-

;;; Reason: Changed :bug-report-boby to reflect TI's new mailing address.

;;;                           RESTRICTED RIGHTS LEGEND
;;;
;;; Use, duplication, or disclosure by the Government is subject to
;;; restrictions as set forth in subdivision (c)(1)(ii) of the Rights in
;;; Technical Data and Computer Software clause at 52.227-7013.
;;;
;;;   TEXAS INSTRUMENTS INCORPORATED      
;;;   P.O. BOX 2909, M/S 2151             
;;;   AUSTIN, TEXAS 78769                 
;;;
;;; Copyright (C) 1989 Texas Instruments Incorporated.
;;; All rights reserved.

;;; Written 07/13/89 12:23:01 by BERGER,
;;; while running on ARIES from band LOD1
;;; With SYSTEM 6.11, VIRTUAL-MEMORY 6.1, EH 6.3, MAKE-SYSTEM 6.0, MICRONET 6.0, LOCAL-FILE 6.0,
;;;  BASIC-PATHNAME 6.1, NETWORK-SUPPORT-COLD 6.0, BASIC-NAMESPACE 6.1, NETWORK-NAMESPACE 6.0,
;;;  DISK-IO 6.0, DISK-LABEL 6.0, BASIC-FILE 6.2, MAC-PATHNAME 6.0, NETWORK-PATHNAME 6.0,
;;;  COMPILER 6.9, TV 6.12, DATALINK 6.0, CHAOSNET 6.0, GC 6.3, MEMORY-AUX 6.0, NVRAM 6.1,
;;;  SYSLOG 6.1, STREAMER-TAPE 6.4, UCL 6.0, INPUT-EDITOR 6.0, METER 6.1, ZWEI 6.3,
;;;  DEBUG-TOOLS 6.3, NETWORK-SUPPORT 6.0, NETWORK-SERVICE 6.1, DATALINK-DISPLAYS 6.0,
;;;  FONT-EDITOR 6.1, SERIAL 6.0, PRINTER 6.3, MAC-PRINTER-TYPES 6.1, PRINTER-TYPES 6.1,
;;;  IMAGEN 6.0, SUGGESTIONS 6.0, MAIL-DAEMON 6.2, MAIL-READER 6.1, TELNET 6.0, VT100 6.0,
;;;  NAMESPACE-EDITOR 6.0, PROFILE 6.1, VISIDOC 6.2, TI-CLOS 6.17, CLEH 6.4, IP 3.47,
;;;  Experimental BUG 11.10, Experimental CLX 6.2, CLUE 6.9, X11M 6.1, RPC 6.1, NFS 3.9,
;;;   microcode 429, Band Name: 6.0 + patches 6/26

#!C
; From file BUG-REPORT.LISP#> MAIL-READER; SYS:
#8R ZWEI#:
(COMPILER-LET ((*PACKAGE* (FIND-PACKAGE "ZWEI"))
                          (SI:*LISP-MODE* :COMMON-LISP)
                          (*READTABLE* SYS:COMMON-LISP-READTABLE)
                          (SI:*READER-SYMBOL-SUBSTITUTIONS* SYS::*COMMON-LISP-SYMBOL-SUBSTITUTIONS*))
  (COMPILER#:PATCH-SOURCE-FILE "SYS: MAIL-READER; BUG-REPORT.#"


(defmethod (BUG-REPORT-OBJECT :BUG-REPORT-BODY) ()
  ;; Returns a string with the bug report body (no headers like to: cc: subject:)

  (string-append
    "      EXPLORER (TM) BUG REPORT" #\return #\return
    "DATE-TIME   : " date-time #\return
    "PRIORITY    : " priority     "     (H)igh (M)edium (L)ow" #\return
    "TYPE        : " type         "     (B)ug  (D)esign (M)anual" #\return
    "MACHINE-TYPE: " machine-type "     (E)xplorer (M)icroExplorer" #\return #\return
    "DESCRIPTION-OF-PROBLEM:" #\return "   " user-description #\return #\return
    "WORK-AROUND:" #\return "   " work-around #\return #\return
    "CUSTOMER-ID: " tracking-id #\return #\return
    "NAME       : " name #\return
    "LOCATION   : " location #\return
    "ADDRESS    : " postal-address #\return
    "PHONE      : " phone #\return
    "NET-ADDRESS: " mail-address #\return #\return
    (if (and backtrace
	     (plusp (length backtrace)))
	(string-append "BACKTRACE:" #\return #\return backtrace #\return)
	"")
    "SOFTWARE-CONFIGURATION:" #\return #\return software-configuration #\return #\return
    "HARDWARE-CONFIGURATION:" #\return hardware-configuration #\return
    "
		    ********************************
		    *         Return to:           *
		    *                              *
		    *  EXPLORER BUG REPORTS        *
		    *  c/o Explorer Project Manager*
		    *  TEXAS INSTRUMENTS, MS 2201  *
		    *  P.O. Box 149149             *
		    *  Austin, Texas   78714-9149  *
		    ********************************" #\return))
))



#!C
; From file BUG-REPORT.LISP#> SEND-MAIL; SYS:
#8R ZWEI#:
(COMPILER-LET ((*PACKAGE* (FIND-PACKAGE "ZWEI"))
                          (SI:*LISP-MODE* :COMMON-LISP)
                          (*READTABLE* SYS:COMMON-LISP-READTABLE)
                          (SI:*READER-SYMBOL-SUBSTITUTIONS* SYS::*COMMON-LISP-SYMBOL-SUBSTITUTIONS*))
  (COMPILER#:PATCH-SOURCE-FILE "SYS: SEND-MAIL; BUG-REPORT.#"



(define-mail-template bug-report-template "Bug" :mail
  "This is the bug report template received from META-X Bug."
  (turn-on-mode 'overwrite-mode)
  (insert-moving (point) "TO      : ")
  (move-bp (mark) (point))
  (insert-moving (point) #\return)
  (insert-moving (point) "CC      : ")
  (insert-moving (point) #\return)
  (insert-moving (point) "SUBJECT : ")
  (insert-moving (point) #\return)
  (insert-moving (point) #\return)
  (insert-moving (point) "                                         EXPLORER (TM) BUG REPORT")
  (dotimes (count 3 nil)
    (insert-moving (point) #\return))
  (insert-moving (point) "CUSTOMER TRACKING ID:  ")
  (insert-moving (point) #\return)
  (insert-moving (point) "SUBMITTER NAME:  ")
  (when (and (not (equal fs:user-personal-name-first-name-first ""))
	     (not (null fs:user-personal-name-first-name-first)))
    (insert-moving (point) (format nil "~a"  fs:user-personal-name-first-name-first)))
  (insert-moving (point) #\return)
  (insert-moving (point) "LOCATION:  ")
  (when (and (not (equal (global:short-site-name) ""))
	     (not (null (global:short-site-name))))
    (insert-moving (point) (format nil "~a" (global:short-site-name))))
  (dotimes (count 3 nil)
    (insert-moving (point) #\return))
  (insert-moving (point)
		 "                                                        ______________________________")
  (insert-moving (point) #\return)
  (insert-moving (point)
		 "ADDRESS:  __________________________________            |  TI Internal Use Only      | ")
  (insert-moving (point) #\return)
  (insert-moving (point)
		 "          __________________________________            | BUG NUMBER: _________      | ")
  (insert-moving (point) #\return)
  (insert-moving (point)
		 "          __________________________________            | Received: ___/___/___      | ")
  (insert-moving (point) #\return)
  (insert-moving (point)
		 "                                                        | Entered: ___/___/___       | ")
  (insert-moving (point) #\return)
  (insert-moving (point)
		 "                                                        ------------------------------ ")
  (insert-moving (point) #\return)
  (insert-moving (point) "PHONE:  (___)___-____")
  (insert-moving (point) #\return)
  (insert-moving (point) #\return)
  (insert-moving (point) (format nil "LOCAL NAME OR ID:  ~a"  si:local-host))
  (dotimes (count 2 nil)
    (insert-moving (point) #\return))
  (insert-moving (point) "System Software Configuration (give version number and patch level):")
  (dotimes (count 2 nil)
    (insert-moving (point) #\return))
  (insert-moving (point)
		 "   FILE Band: __________ LOD Band: __________ MCR Band: __________ BOOT Band: __________")
  (dotimes (count 2 nil)
    (insert-moving (point) #\return))
  (insert-moving (point)
		 "         Diag Band: __________     GDOS Band: __________    EXPT Band __________")
  (dotimes (count 2 nil)
    (insert-moving (point) #\return))
  (insert-moving (point) "   TI & 3rd Party Software Installed: _________________________________")
  (dotimes (count 3 nil)
    (insert-moving (point) #\return))
  (insert-moving (point) "           TYPE OF PROBLEM (CHECK ONE)")
  (insert-moving (point) #\return)
  (insert-moving (point) #\return)
  (insert-moving (point) "              ___ = DOCUMENTATION DEFICIENCY.  SEE DOCUMENT: _______________________")
  (insert-moving (point) #\return)
  (insert-moving (point) "              ___ = SOFTWARE DESIGN REQUEST")
  (insert-moving (point) #\return)
  (insert-moving (point) "              ___ = SOFTWARE BUG")
  (insert-moving (point) #\return)
  (insert-moving (point) "              ___ = HARDWARE DESIGN REQUEST")
  (insert-moving (point) #\return)
  (insert-moving (point) "              ___ = HARDWARE BUG")
  (insert-moving (point) #\return)
  (insert-moving (point) "              ___ = OTHER.  EXPLAIN: _______________________________________________")
  (insert-moving (point) #\return)
  (insert-moving (point) #\return)
  (insert-moving (point) "           PRIORITY OF PROBLEM:  (H)igh (M)edium (L)ow:  __")
  (dotimes (count 4 nil)
    (insert-moving (point) #\return))
  (insert-moving (point) (format nil "DESCRIPTION OF PROBLEM:  (ATTACH SUPPORTING DOCUMENTS, EXPLORER BUG REPORT FILES ~%                         OR ANY ADDITIONAL SHEETS)"))
  (dotimes (count 14 nil)
    (insert-moving (point) #\return))
  (insert-moving (point) "           WORK AROUND? (YES/NO): ___  IF YES, BRIEFLY DESCRIBE IT:")
  (dotimes (count 5 nil)
    (insert-moving (point) #\return))
  (insert-moving (point) "ARE THERE ANY ATTACHMENTS TO THE BUG REPORT? (YES/NO): ___ NUMBER OF PAGES: ___")
  (insert-moving (point) #\return)
  (insert-moving (point) "           DESCRIPTION OF ATTACHMENTS:  ")
  (dotimes (count 4 nil)
    (insert-moving (point) #\return))


  (let ((system-description (si:system-version-info)))
    (loop with line-start = 0
	  for start = 0 then (+ comma-pos 2)
	  as prev-comma-pos = nil then comma-pos
	  as comma-pos = (position ", " system-description start)
	  when (> (- (or comma-pos (string-length system-description )) line-start) 72.)
	  unless (null prev-comma-pos)
	  do (aset #\cr system-description (1+ prev-comma-pos))
	  (setq line-start (+ prev-comma-pos 2))
	  (setq comma-pos prev-comma-pos)
	  until (null comma-pos))
    (insert-moving (point) (format nil "~a" system-description)))
  (insert-moving (point) #\return)
  (insert-moving (point) (format nil "~a" (mail:get-revv)))
  (dotimes (count 3 nil)
    (insert-moving (point) #\return))
  (insert-moving (point) "                     ******************************************")
  (insert-moving (point) #\return)
  (insert-moving (point) "                     *              RETURN TO:                *")
  (insert-moving (point) #\return)
  (insert-moving (point) "                     *                                        *")
  (insert-moving (point) #\return)
  (insert-moving (point) "                     *       EXPLORER BUG REPORTS             *")
  (insert-moving (point) #\return)
  (insert-moving (point) "                     *       c/o Explorer Project Manager     *")
  (insert-moving (point) #\return)
  (insert-moving (point) "                     *       TEXAS INSTRUMENTS, M/S 2201      *")
  (insert-moving (point) #\return)
  (insert-moving (point) "                     *       P.O. Box 149149                  *")
  (insert-moving (point) #\return)
  (insert-moving (point) "                     *       Austin, Texas  78714-9149        *")
  (insert-moving (point) #\return)
  (insert-moving (point) "                     ******************************************")
  (move-bp (point) (mark)))

))
