XMXAPIU ;ISC-SF/GMB-APIs for users to use interactively ;03/26/2003 08:57
;;8.0;MailMan;**15**;Jun 28, 2002
; All entry points covered by DBIA 2774.
;
; The following are meant to be in an option's ROUTINE field.
; They expect that DUZ exists, and if the user is acting as a surrogate,
; that XMDUZ exists, too. Otherwise, XMDUZ will be set to DUZ.
; If the XMV variables do not exist, INIT^XMVVITAE will be called.
Q
READ ; Read/Manage messages in your Mailbox
; Needs XMDUZ
I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
G MANAGE^XMJBM
Q
READNEW ; Read new messages in your Mailbox
I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
G NEW^XMJBN
Q
SEND ; Send a message
I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
G SEND^XMJMS
Q
; The following are meant to be called from within a program.
; Output, common to the following:
; XMERR If there's any errors, then XMERR is set to the number of
; errors, otherwise XMERR is undefined.
; ^TMP("XMERR",$J,error number,"TEXT",line number)=error text
SUBJ(XMSUBJ) ; Ask user for msg subject
; XMSUBJ (in/out) Subject
N XMABORT
K XMERR,^TMP("XMERR",$J)
S XMABORT=0
D SUBJ^XMJMS(.XMSUBJ,.XMABORT) Q:'XMABORT
D ERRSET^XMXUTIL($S(XMABORT=1:37000,1:37001)) ; up-arrow out / time out
Q
TOWHOM(XMDUZ,XMZ,XMTYPE,XMINSTR) ; Ask user for msg addressees
; XMDUZ User's DUZ
; XMZ message number in ^XMB(3.9,
; XMTYPE
; XMINSTR
I '$D(XMV) N XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
D ITOWHOM^XMXPARM(.XMDUZ,.XMZ,.XMTYPE,.XMINSTR) Q:$D(XMERR)
D ITOWHOM^XMXTO(XMDUZ,.XMZ,XMTYPE,.XMINSTR)
Q
SHOWERR ; Print the errors to the screen.
; Displays the errors in ^TMP("XMERR",$J),
; and then kills XMERR and ^TMP("XMERR",$J).
D SHOW^XMJERR
Q
XMXAPIU ;ISC-SF/GMB-APIs for users to use interactively ;03/26/2003 08:57
+1 ;;8.0;MailMan;**15**;Jun 28, 2002
+2 ; All entry points covered by DBIA 2774.
+3 ;
+4 ; The following are meant to be in an option's ROUTINE field.
+5 ; They expect that DUZ exists, and if the user is acting as a surrogate,
+6 ; that XMDUZ exists, too. Otherwise, XMDUZ will be set to DUZ.
+7 ; If the XMV variables do not exist, INIT^XMVVITAE will be called.
+8 QUIT
READ ; Read/Manage messages in your Mailbox
+1 ; Needs XMDUZ
+2 IF '$DATA(XMV)
NEW XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
+3 GOTO MANAGE^XMJBM
+4 QUIT
READNEW ; Read new messages in your Mailbox
+1 IF '$DATA(XMV)
NEW XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
+2 GOTO NEW^XMJBN
+3 QUIT
SEND ; Send a message
+1 IF '$DATA(XMV)
NEW XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
+2 GOTO SEND^XMJMS
+3 QUIT
+4 ; The following are meant to be called from within a program.
+5 ; Output, common to the following:
+6 ; XMERR If there's any errors, then XMERR is set to the number of
+7 ; errors, otherwise XMERR is undefined.
+8 ; ^TMP("XMERR",$J,error number,"TEXT",line number)=error text
SUBJ(XMSUBJ) ; Ask user for msg subject
+1 ; XMSUBJ (in/out) Subject
+2 NEW XMABORT
+3 KILL XMERR,^TMP("XMERR",$JOB)
+4 SET XMABORT=0
+5 DO SUBJ^XMJMS(.XMSUBJ,.XMABORT)
IF 'XMABORT
QUIT
+6 ; up-arrow out / time out
DO ERRSET^XMXUTIL($SELECT(XMABORT=1:37000,1:37001))
+7 QUIT
TOWHOM(XMDUZ,XMZ,XMTYPE,XMINSTR) ; Ask user for msg addressees
+1 ; XMDUZ User's DUZ
+2 ; XMZ message number in ^XMB(3.9,
+3 ; XMTYPE
+4 ; XMINSTR
+5 IF '$DATA(XMV)
NEW XMV,XMDISPI,XMDUN,XMNOSEND,XMPRIV
+6 DO ITOWHOM^XMXPARM(.XMDUZ,.XMZ,.XMTYPE,.XMINSTR)
IF $DATA(XMERR)
QUIT
+7 DO ITOWHOM^XMXTO(XMDUZ,.XMZ,XMTYPE,.XMINSTR)
+8 QUIT
SHOWERR ; Print the errors to the screen.
+1 ; Displays the errors in ^TMP("XMERR",$J),
+2 ; and then kills XMERR and ^TMP("XMERR",$J).
+3 DO SHOW^XMJERR
+4 QUIT