XMA1B ;ISC-SF/GMB-Save/Delete Message APIs ;04/17/2002 07:09
;;8.0;MailMan;;Jun 28, 2002
; Was (WASH ISC)/CAP/THM
;
; Entry points (DBIA 10065):
; KL Delete a message from a basket
; KLQ Delete a message from a basket and put it in the WASTE basket.
; S2 Put a message in a basket
;
KL ; Delete a message from a basket
; In:
; XMDUZ User's DUZ
; XMK Basket number (optional)
; XMZ Message number
I '$D(XMK) S XMK=$O(^XMB(3.7,"M",XMZ,XMDUZ,0)) Q:'XMK
I XMK,'$D(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)) S XMK=$O(^XMB(3.7,"M",XMZ,XMDUZ,0)) Q:'XMK
D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ)
Q
KLQ ; Delete a message from a basket AND put it in waste basket
; In:
; XMDUZ User's DUZ
; XMK Basket number (optional)
; XMZ Message number
D KL Q:XMK=.5
S XMKM=.5
; Fall through to S2
S2 ; Put a message in a basket.
; In:
; XMDUZ User's DUZ
; XMKM Basket number
; XMZ Message number
N XMK,XMKN
K XMERR,^TMP("XMERR",$J)
S XMK=$$XMK^XMXPARM(XMDUZ,"XMKM",.XMKM)
I $D(XMERR) K XMERR,^TMP("XMERR",$J) Q
I XMK>1 S XMKN=$P(^XMB(3.7,XMDUZ,2,XMK,0),U,1)
E S XMKN=$$EZBLD^DIALOG($S(XMK=.5:37004,1:37005)) ; WASTE / IN
D PUTMSG^XMXMSGS2(XMDUZ,XMK,XMKN,XMZ)
K XMKM
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXMA1B 1234 printed Dec 13, 2024@02:10:46 Page 2
XMA1B ;ISC-SF/GMB-Save/Delete Message APIs ;04/17/2002 07:09
+1 ;;8.0;MailMan;;Jun 28, 2002
+2 ; Was (WASH ISC)/CAP/THM
+3 ;
+4 ; Entry points (DBIA 10065):
+5 ; KL Delete a message from a basket
+6 ; KLQ Delete a message from a basket and put it in the WASTE basket.
+7 ; S2 Put a message in a basket
+8 ;
KL ; Delete a message from a basket
+1 ; In:
+2 ; XMDUZ User's DUZ
+3 ; XMK Basket number (optional)
+4 ; XMZ Message number
+5 IF '$DATA(XMK)
SET XMK=$ORDER(^XMB(3.7,"M",XMZ,XMDUZ,0))
if 'XMK
QUIT
+6 IF XMK
IF '$DATA(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0))
SET XMK=$ORDER(^XMB(3.7,"M",XMZ,XMDUZ,0))
if 'XMK
QUIT
+7 DO ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ)
+8 QUIT
KLQ ; Delete a message from a basket AND put it in waste basket
+1 ; In:
+2 ; XMDUZ User's DUZ
+3 ; XMK Basket number (optional)
+4 ; XMZ Message number
+5 DO KL
if XMK=.5
QUIT
+6 SET XMKM=.5
+7 ; Fall through to S2
S2 ; Put a message in a basket.
+1 ; In:
+2 ; XMDUZ User's DUZ
+3 ; XMKM Basket number
+4 ; XMZ Message number
+5 NEW XMK,XMKN
+6 KILL XMERR,^TMP("XMERR",$JOB)
+7 SET XMK=$$XMK^XMXPARM(XMDUZ,"XMKM",.XMKM)
+8 IF $DATA(XMERR)
KILL XMERR,^TMP("XMERR",$JOB)
QUIT
+9 IF XMK>1
SET XMKN=$PIECE(^XMB(3.7,XMDUZ,2,XMK,0),U,1)
+10 ; WASTE / IN
IF '$TEST
SET XMKN=$$EZBLD^DIALOG($SELECT(XMK=.5:37004,1:37005))
+11 DO PUTMSG^XMXMSGS2(XMDUZ,XMK,XMKN,XMZ)
+12 KILL XMKM
+13 QUIT