84 lines
2.9 KiB
Mathematica
84 lines
2.9 KiB
Mathematica
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
|
|
HEADER ;
|
|
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
|