XMJBL ;ISC-SF/GMB-List contents of user's Mailbox ;12/04/2002 13:46
;;8.0;MailMan;**10**;Jun 28, 2002
; Entry points used by MailMan options (not covered by DBIA):
; LISTMBOX XMBASKLIST - List all messages in user's mailbox
MBOX ; List messages in mailbox of DUZ
N DIC,Y
S DIC(0)="AEQZ",DIC=3.7
D ^DIC Q:Y=-1
D LISTM(+Y,$P(Y(0,0),U))
Q
LISTMBOX ; Option to list mailbox contents comes in here
N ZTSAVE,XMNAME,DIR,X,Y,XMALL
D CHECK^XMVVITAE
S DIR("A")=$$EZBLD^DIALOG(34650) ; List contents of
S XMALL=$$EZBLD^DIALOG(34651) ; A:All Baskets
S DIR(0)="S^"_XMALL_";"_$$EZBLD^DIALOG(34652) ; O:One Basket
S DIR("B")=$P(XMALL,":",2) ; All Baskets
D ^DIR Q:$D(DIRUT)
S XMNAME=XMV("NAME")
S (ZTSAVE("XMDUZ"),ZTSAVE("XMNAME"),ZTSAVE("XMV(""ORDER"")"))=""
I Y=$P(XMALL,":",1) D EN^XUTMDEVQ("ZLISTM^XMJBL",$$EZBLD^DIALOG(34654),.ZTSAVE) Q ; MailMan: Mailbox Contents List
N XMK,XMKN
D SELBSKT^XMJBU(XMDUZ,34653,"","",.XMK,.XMKN) Q:XMK=U ; List contents of MAIL BASKET:
S (ZTSAVE("XMK"),ZTSAVE("XMKN"))=""
D EN^XUTMDEVQ("ZLISTB^XMJBL",$$EZBLD^DIALOG(34655),.ZTSAVE) ; MailMan: Basket Contents List
Q
LISTM(XMDUZ,XMNAME) ; List Mailbox
ZLISTM ;
N XMPAGE,XMLEN,XMK,XMKN,XMABORT
S XMKN=""
S XMLEN("XMKZ")=6
D INIT(.XMNAME,.XMLEN,.XMPAGE,.XMABORT)
F S XMKN=$O(^XMB(3.7,XMDUZ,2,"B",XMKN)) Q:XMKN="" D Q:XMABORT
. S XMK=$O(^(XMKN,"")) ; Naked reference to above line
. D LB(XMDUZ,XMNAME,XMK,XMKN,.XMLEN,.XMPAGE,.XMABORT)
Q:$E($G(IOST),1,2)'="C-"!XMABORT
D WAIT^XMXUTIL
Q
LISTB(XMDUZ,XMNAME,XMK,XMKN) ; List Basket
ZLISTB ;
N XMPAGE,XMLEN,XMABORT
S XMLEN("XMKZ")=$L($O(^XMB(3.7,XMDUZ,2,XMK,1,"C",""),-1))
D INIT(.XMNAME,.XMLEN,.XMPAGE,.XMABORT)
D LB(XMDUZ,XMNAME,XMK,XMKN,.XMLEN,.XMPAGE,.XMABORT)
Q:$E($G(IOST),1,2)'="C-"!XMABORT
D WAIT^XMXUTIL
Q
LB(XMDUZ,XMNAME,XMK,XMKN,XMLEN,XMPAGE,XMABORT) ;
N XMKZ,XMZ,XMZREC
I $Y+5>IOSL D PAGE Q:XMABORT
W !!,$$EZBLD^DIALOG(34656,XMKN) ; Basket: |1|
S XMKZ=""
F S XMKZ=$O(^XMB(3.7,XMDUZ,2,XMK,1,"C",XMKZ),XMV("ORDER")) Q:XMKZ'>0 D Q:XMABORT
. S XMZ=$O(^(XMKZ,"")) ; Naked reference to line above
. S XMZREC=$G(^XMB(3.9,XMZ,0))
. I XMZREC="" D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
. I $Y+3>IOSL D Q:XMABORT
. . D PAGE Q:XMABORT
. . W !!,$$EZBLD^DIALOG(34656.1,XMKN) ; Basket: |1| (continued)
. W !,$J(XMKZ,XMLEN("XMKZ")),". ",$J("["_XMZ_"]",XMLEN("XMZ"))," ",$$DATE^XMXUTIL2(XMZREC,1)," ",$E($$SUBJ^XMXUTIL2(XMZREC),1,XMLEN("SUBJ"))
Q
INIT(XMNAME,XMLEN,XMPAGE,XMABORT) ;
I $D(ZTQUEUED) S ZTREQ="@"
S (XMPAGE,XMABORT)=0
S XMLEN("XMZ")=$L($O(^XMB(3.9,":"),-1))+2
S XMLEN("DATE")=$L($$MMDT^XMXUTIL1($$NOW^XLFDT))
S XMLEN("SUBJ")=79-XMLEN("DATE")-XMLEN("XMKZ")-XMLEN("XMZ")-5
S XMNAME=XMNAME_" - "_$$MMDT^XMXUTIL1($$NOW^XLFDT)
W:$E($G(IOST),1,2)="C-" @IOF
D HEADER
Q
PAGE ;
I $E($G(IOST),1,2)="C-" D PAGE^XMXUTIL(.XMABORT) Q:XMABORT
W @IOF
D HEADER
Q
N XMPARM
S XMPAGE=XMPAGE+1
S XMPARM(1)=XMNAME,XMPARM(2)=XMPAGE
W $$EZBLD^DIALOG(34657,.XMPARM) ; Mailbox Content for |1| Page: |2|
W !,$$REPEAT^XLFSTR("-",79)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXMJBL 3101 printed Dec 13, 2024@02:11:44 Page 2
XMJBL ;ISC-SF/GMB-List contents of user's Mailbox ;12/04/2002 13:46
+1 ;;8.0;MailMan;**10**;Jun 28, 2002
+2 ; Entry points used by MailMan options (not covered by DBIA):
+3 ; LISTMBOX XMBASKLIST - List all messages in user's mailbox
MBOX ; List messages in mailbox of DUZ
+1 NEW DIC,Y
+2 SET DIC(0)="AEQZ"
SET DIC=3.7
+3 DO ^DIC
if Y=-1
QUIT
+4 DO LISTM(+Y,$PIECE(Y(0,0),U))
+5 QUIT
LISTMBOX ; Option to list mailbox contents comes in here
+1 NEW ZTSAVE,XMNAME,DIR,X,Y,XMALL
+2 DO CHECK^XMVVITAE
+3 ; List contents of
SET DIR("A")=$$EZBLD^DIALOG(34650)
+4 ; A:All Baskets
SET XMALL=$$EZBLD^DIALOG(34651)
+5 ; O:One Basket
SET DIR(0)="S^"_XMALL_";"_$$EZBLD^DIALOG(34652)
+6 ; All Baskets
SET DIR("B")=$PIECE(XMALL,":",2)
+7 DO ^DIR
if $DATA(DIRUT)
QUIT
+8 SET XMNAME=XMV("NAME")
+9 SET (ZTSAVE("XMDUZ"),ZTSAVE("XMNAME"),ZTSAVE("XMV(""ORDER"")"))=""
+10 ; MailMan: Mailbox Contents List
IF Y=$PIECE(XMALL,":",1)
DO EN^XUTMDEVQ("ZLISTM^XMJBL",$$EZBLD^DIALOG(34654),.ZTSAVE)
QUIT
+11 NEW XMK,XMKN
+12 ; List contents of MAIL BASKET:
DO SELBSKT^XMJBU(XMDUZ,34653,"","",.XMK,.XMKN)
if XMK=U
QUIT
+13 SET (ZTSAVE("XMK"),ZTSAVE("XMKN"))=""
+14 ; MailMan: Basket Contents List
DO EN^XUTMDEVQ("ZLISTB^XMJBL",$$EZBLD^DIALOG(34655),.ZTSAVE)
+15 QUIT
LISTM(XMDUZ,XMNAME) ; List Mailbox
ZLISTM ;
+1 NEW XMPAGE,XMLEN,XMK,XMKN,XMABORT
+2 SET XMKN=""
+3 SET XMLEN("XMKZ")=6
+4 DO INIT(.XMNAME,.XMLEN,.XMPAGE,.XMABORT)
+5 FOR
SET XMKN=$ORDER(^XMB(3.7,XMDUZ,2,"B",XMKN))
if XMKN=""
QUIT
Begin DoDot:1
+6 ; Naked reference to above line
SET XMK=$ORDER(^(XMKN,""))
+7 DO LB(XMDUZ,XMNAME,XMK,XMKN,.XMLEN,.XMPAGE,.XMABORT)
End DoDot:1
if XMABORT
QUIT
+8 if $EXTRACT($GET(IOST),1,2)'="C-"!XMABORT
QUIT
+9 DO WAIT^XMXUTIL
+10 QUIT
LISTB(XMDUZ,XMNAME,XMK,XMKN) ; List Basket
ZLISTB ;
+1 NEW XMPAGE,XMLEN,XMABORT
+2 SET XMLEN("XMKZ")=$LENGTH($ORDER(^XMB(3.7,XMDUZ,2,XMK,1,"C",""),-1))
+3 DO INIT(.XMNAME,.XMLEN,.XMPAGE,.XMABORT)
+4 DO LB(XMDUZ,XMNAME,XMK,XMKN,.XMLEN,.XMPAGE,.XMABORT)
+5 if $EXTRACT($GET(IOST),1,2)'="C-"!XMABORT
QUIT
+6 DO WAIT^XMXUTIL
+7 QUIT
LB(XMDUZ,XMNAME,XMK,XMKN,XMLEN,XMPAGE,XMABORT) ;
+1 NEW XMKZ,XMZ,XMZREC
+2 IF $Y+5>IOSL
DO PAGE
if XMABORT
QUIT
+3 ; Basket: |1|
WRITE !!,$$EZBLD^DIALOG(34656,XMKN)
+4 SET XMKZ=""
+5 FOR
SET XMKZ=$ORDER(^XMB(3.7,XMDUZ,2,XMK,1,"C",XMKZ),XMV("ORDER"))
if XMKZ'>0
QUIT
Begin DoDot:1
+6 ; Naked reference to line above
SET XMZ=$ORDER(^(XMKZ,""))
+7 SET XMZREC=$GET(^XMB(3.9,XMZ,0))
+8 IF XMZREC=""
DO ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ)
QUIT
+9 IF $Y+3>IOSL
Begin DoDot:2
+10 DO PAGE
if XMABORT
QUIT
+11 ; Basket: |1| (continued)
WRITE !!,$$EZBLD^DIALOG(34656.1,XMKN)
End DoDot:2
if XMABORT
QUIT
+12 WRITE !,$JUSTIFY(XMKZ,XMLEN("XMKZ")),". ",$JUSTIFY("["_XMZ_"]",XMLEN("XMZ"))," ",$$DATE^XMXUTIL2(XMZREC,1)," ",$EXTRACT($$SUBJ^XMXUTIL2(XMZREC),1,XMLEN("SUBJ"))
End DoDot:1
if XMABORT
QUIT
+13 QUIT
INIT(XMNAME,XMLEN,XMPAGE,XMABORT) ;
+1 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+2 SET (XMPAGE,XMABORT)=0
+3 SET XMLEN("XMZ")=$LENGTH($ORDER(^XMB(3.9,":"),-1))+2
+4 SET XMLEN("DATE")=$LENGTH($$MMDT^XMXUTIL1($$NOW^XLFDT))
+5 SET XMLEN("SUBJ")=79-XMLEN("DATE")-XMLEN("XMKZ")-XMLEN("XMZ")-5
+6 SET XMNAME=XMNAME_" - "_$$MMDT^XMXUTIL1($$NOW^XLFDT)
+7 if $EXTRACT($GET(IOST),1,2)="C-"
WRITE @IOF
+8 DO HEADER
+9 QUIT
PAGE ;
+1 IF $EXTRACT($GET(IOST),1,2)="C-"
DO PAGE^XMXUTIL(.XMABORT)
if XMABORT
QUIT
+2 WRITE @IOF
+3 DO HEADER
+4 QUIT
+1 NEW XMPARM
+2 SET XMPAGE=XMPAGE+1
+3 SET XMPARM(1)=XMNAME
SET XMPARM(2)=XMPAGE
+4 ; Mailbox Content for |1| Page: |2|
WRITE $$EZBLD^DIALOG(34657,.XMPARM)
+5 WRITE !,$$REPEAT^XLFSTR("-",79)
+6 QUIT