source: WorldVistAEHR/trunk/r/MAILMAN-XM/XMGAPI4.m@ 862

Last change on this file since 862 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1XMGAPI4 ;(WASH ISC)/CAP-Get New Msg Info ;04/17/2002 09:01
2 ;;8.0;MailMan;;Jun 28, 2002
3 ; Entry points (DBIA 1201 - Private!):
4 ; $$NU Get new message info
5NU(XMFORCE,XMMOVE,XMOUT) ;API for new message display
6 ;Usage: S X=$$NU^XMGAPI4(1) = Display on screen
7 ; S X=$$NU^XMGAPI4(0) = Do not display
8 ; S X=$$NU^XMGAPI4(1,1,"ABC") Return displayable array "ABC"
9 ;
10 ;Inputs: DUZ must exist
11 ; XMDUZ will exist if the context is in MailMan
12 ;
13 ;XMFORCE=1 to force new display
14 ; =0 for no display
15 ;XMMOVE =1 will cause an array to be passed back in array XMOUT,
16 ; which should be passed in by value (as a quoted string).
17 N XMARRAY,XMI,XMNEW
18 D CHKMASTR($G(XMDUZ,DUZ),XMFORCE,.XMNEW,.XMARRAY,.XMI)
19 I $G(XMMOVE),$G(XMOUT)?1.AN S XMARRAY=+$G(XMI) M @XMOUT=XMARRAY Q XMNEW
20 ;Return values or write
21 I XMFORCE S XMI=0 F S XMI=$O(XMARRAY(XMI)) Q:'XMI W !,XMARRAY(XMI)
22 Q XMNEW
23CHK ; Sets Y = number of new messages for the user.
24 S:$G(XMDUZ)'=.6 Y=$$TNMSGCT^XMXUTIL($G(XMDUZ,DUZ))
25 D CLEANUP^XMXADDR
26 Q
27CHKMASTR(XMUSER,XMFORCE,XMNEW,XMARRAY,XMI) ;
28 D CHKUSER(XMUSER,XMFORCE,.XMNEW,.XMARRAY,.XMI)
29 D CHKPRI(XMUSER,.XMARRAY,.XMI)
30 Q:XMUSER=.5!'XMFORCE!'$D(^XMB(3.7,"AB",XMUSER,.5))
31 Q:'$$TNMSGCT^XMXUTIL(.5)
32 S XMI=$G(XMI)+1,XMARRAY(XMI)=""
33 S XMI=XMI+1,XMARRAY(XMI)=$$EZBLD^DIALOG(38162) ; Checking POSTMASTER mailbox.
34 D CHKUSER(.5,XMFORCE,.XMNEW,.XMARRAY,.XMI)
35 Q
36CHKUSER(XMUSER,XMFORCE,XMNEW,XMARRAY,XMI) ;
37 I '$D(^XMB(3.7,XMUSER,0)) S XMNEW=0 Q
38 N XMREC,XMPARM
39 S XMREC=$$NEWS^XMXUTIL(XMUSER,$D(DUZ("SAV")))
40 S XMNEW=$P(XMREC,U,1) ; new messages
41 Q:'XMFORCE!'XMNEW
42 S XMPARM(1)=$P(XMREC,U,1) S:XMUSER=.5 XMPARM(2)=$$NAME^XMXUTIL(.5)
43 S XMI=$G(XMI)+1,XMARRAY(XMI)=$$EZBLD^DIALOG($S(XMUSER=DUZ:38155,1:38156)+$S(XMPARM(1)>1:0,'XMPARM(1):.2,1:.1),.XMPARM) ; You have/|2| has |1|/no new message(s).
44 I $P(XMREC,U,6) D ; new messages in the default read (usually IN) basket.
45 . S XMPARM(1)=$P(XMREC,U,6),XMPARM(2)=$P(XMREC,U,8)
46 . S XMARRAY(XMI)=XMARRAY(XMI)_$$EZBLD^DIALOG(38157,.XMPARM) ; (|1| in the '|2|' basket)
47 I $P(XMREC,U,5) D ; if last arrival > latest notification...
48 . S XMI=XMI+1,XMARRAY(XMI)=$$EZBLD^DIALOG(38158,$$MMDT^XMXUTIL1($P(XMREC,U,4))) ; (Last arrival: |1|)"
49 Q:XMUSER=.5
50 S XMI=XMI+1,XMARRAY(XMI)=""
51 S XMI=XMI+1,XMARRAY(XMI)=$$EZBLD^DIALOG(38161) ; Enter '^NML' to read your new messages.
52 Q
53CHKPRI(XMUSER,XMARRAY,XMI) ;
54 Q:'$D(^XMB(3.7,XMUSER,"N"))
55 I '$D(IORVON) N IORVON,IORVOFF,IOBON,IOBOFF D ZIS^XM
56 S XMI=$G(XMI)+1,XMARRAY(XMI)=$G(IORVON)_$$EZBLD^DIALOG(38159)_$G(IORVOFF) ; You've got PRIORITY mail!
57 Q
58 ; >>>> I don't think anything after here is used. <<<<
59LST(A,X,Y) ;List NEW message (or any other) array
60 ; A=Array to list
61 ; X=X address of box
62 ; Y=Y address of box
63 N I,S
64 S I="",$P(S," ",IOM+1)=""
65 F S I=$O(A(I)) Q:I="" D
66 . I $G(X) S DX=X,DY=Y X IOXY
67 . E W !
68 . W $E(A(I)_S,1,IOM-$G(X))
69 . I $D(Y) S Y=Y+1
70 Q
71PRIALRT ; Priority Mail Alert
72 N XQAID
73 S XQAID="XM-PRIOMESS" D ALERT
74 I '$D(XMDUZ) N XMDUZ S XMDUZ=DUZ
75 W !,"Select new PRIORITY messages (one at a time) from the list given."
76 D INIT^XMVVITAE
77 D LISTALL^XMJMLN(XMDUZ,"N")
78 Q
79NEWALRT ; Alert for NEW Mail
80 N XQAID
81 S XQAID="XM-NEWMESS" D ALERT
82 I '$D(XMDUZ) N XMDUZ S XMDUZ=DUZ
83 W !,"Select NEW messages (one at a time) from the list given."
84 D INIT^XMVVITAE
85 D LISTALL^XMJMLN(XMDUZ,"N0")
86 Q
87ALERT ;
88 N X,XQAKILL
89 S X=$$NU(1,1,"X")
90 D LST(.X)
91 S XQA($S($G(XMDUZ):XMDUZ,1:DUZ))="",XQAKILL=1
92 D DELETEA^XQALERT
93 Q
Note: See TracBrowser for help on using the repository browser.