Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: XMGAPI4

XMGAPI4.m

Go to the documentation of this file.
  1. XMGAPI4 ;(WASH ISC)/CAP-Get New Msg Info ;04/17/2002 09:01
  1. ;;8.0;MailMan;;Jun 28, 2002
  1. ; Entry points (DBIA 1201 - Private!):
  1. ; $$NU Get new message info
  1. NU(XMFORCE,XMMOVE,XMOUT) ;API for new message display
  1. ;Usage: S X=$$NU^XMGAPI4(1) = Display on screen
  1. ; S X=$$NU^XMGAPI4(0) = Do not display
  1. ; S X=$$NU^XMGAPI4(1,1,"ABC") Return displayable array "ABC"
  1. ;
  1. ;Inputs: DUZ must exist
  1. ; XMDUZ will exist if the context is in MailMan
  1. ;
  1. ;XMFORCE=1 to force new display
  1. ; =0 for no display
  1. ;XMMOVE =1 will cause an array to be passed back in array XMOUT,
  1. ; which should be passed in by value (as a quoted string).
  1. N XMARRAY,XMI,XMNEW
  1. D CHKMASTR($G(XMDUZ,DUZ),XMFORCE,.XMNEW,.XMARRAY,.XMI)
  1. I $G(XMMOVE),$G(XMOUT)?1.AN S XMARRAY=+$G(XMI) M @XMOUT=XMARRAY Q XMNEW
  1. ;Return values or write
  1. I XMFORCE S XMI=0 F S XMI=$O(XMARRAY(XMI)) Q:'XMI W !,XMARRAY(XMI)
  1. Q XMNEW
  1. CHK ; Sets Y = number of new messages for the user.
  1. S:$G(XMDUZ)'=.6 Y=$$TNMSGCT^XMXUTIL($G(XMDUZ,DUZ))
  1. D CLEANUP^XMXADDR
  1. Q
  1. CHKMASTR(XMUSER,XMFORCE,XMNEW,XMARRAY,XMI) ;
  1. D CHKUSER(XMUSER,XMFORCE,.XMNEW,.XMARRAY,.XMI)
  1. D CHKPRI(XMUSER,.XMARRAY,.XMI)
  1. Q:XMUSER=.5!'XMFORCE!'$D(^XMB(3.7,"AB",XMUSER,.5))
  1. Q:'$$TNMSGCT^XMXUTIL(.5)
  1. S XMI=$G(XMI)+1,XMARRAY(XMI)=""
  1. S XMI=XMI+1,XMARRAY(XMI)=$$EZBLD^DIALOG(38162) ; Checking POSTMASTER mailbox.
  1. D CHKUSER(.5,XMFORCE,.XMNEW,.XMARRAY,.XMI)
  1. Q
  1. CHKUSER(XMUSER,XMFORCE,XMNEW,XMARRAY,XMI) ;
  1. I '$D(^XMB(3.7,XMUSER,0)) S XMNEW=0 Q
  1. N XMREC,XMPARM
  1. S XMREC=$$NEWS^XMXUTIL(XMUSER,$D(DUZ("SAV")))
  1. S XMNEW=$P(XMREC,U,1) ; new messages
  1. Q:'XMFORCE!'XMNEW
  1. S XMPARM(1)=$P(XMREC,U,1) S:XMUSER=.5 XMPARM(2)=$$NAME^XMXUTIL(.5)
  1. 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).
  1. I $P(XMREC,U,6) D ; new messages in the default read (usually IN) basket.
  1. . S XMPARM(1)=$P(XMREC,U,6),XMPARM(2)=$P(XMREC,U,8)
  1. . S XMARRAY(XMI)=XMARRAY(XMI)_$$EZBLD^DIALOG(38157,.XMPARM) ; (|1| in the '|2|' basket)
  1. I $P(XMREC,U,5) D ; if last arrival > latest notification...
  1. . S XMI=XMI+1,XMARRAY(XMI)=$$EZBLD^DIALOG(38158,$$MMDT^XMXUTIL1($P(XMREC,U,4))) ; (Last arrival: |1|)"
  1. Q:XMUSER=.5
  1. S XMI=XMI+1,XMARRAY(XMI)=""
  1. S XMI=XMI+1,XMARRAY(XMI)=$$EZBLD^DIALOG(38161) ; Enter '^NML' to read your new messages.
  1. Q
  1. CHKPRI(XMUSER,XMARRAY,XMI) ;
  1. Q:'$D(^XMB(3.7,XMUSER,"N"))
  1. I '$D(IORVON) N IORVON,IORVOFF,IOBON,IOBOFF D ZIS^XM
  1. S XMI=$G(XMI)+1,XMARRAY(XMI)=$G(IORVON)_$$EZBLD^DIALOG(38159)_$G(IORVOFF) ; You've got PRIORITY mail!
  1. Q
  1. ; >>>> I don't think anything after here is used. <<<<
  1. LST(A,X,Y) ;List NEW message (or any other) array
  1. ; A=Array to list
  1. ; X=X address of box
  1. ; Y=Y address of box
  1. N I,S
  1. S I="",$P(S," ",IOM+1)=""
  1. F S I=$O(A(I)) Q:I="" D
  1. . I $G(X) S DX=X,DY=Y X IOXY
  1. . E W !
  1. . W $E(A(I)_S,1,IOM-$G(X))
  1. . I $D(Y) S Y=Y+1
  1. Q
  1. PRIALRT ; Priority Mail Alert
  1. N XQAID
  1. S XQAID="XM-PRIOMESS" D ALERT
  1. I '$D(XMDUZ) N XMDUZ S XMDUZ=DUZ
  1. W !,"Select new PRIORITY messages (one at a time) from the list given."
  1. D INIT^XMVVITAE
  1. D LISTALL^XMJMLN(XMDUZ,"N")
  1. Q
  1. NEWALRT ; Alert for NEW Mail
  1. N XQAID
  1. S XQAID="XM-NEWMESS" D ALERT
  1. I '$D(XMDUZ) N XMDUZ S XMDUZ=DUZ
  1. W !,"Select NEW messages (one at a time) from the list given."
  1. D INIT^XMVVITAE
  1. D LISTALL^XMJMLN(XMDUZ,"N0")
  1. Q
  1. ALERT ;
  1. N X,XQAKILL
  1. S X=$$NU(1,1,"X")
  1. D LST(.X)
  1. S XQA($S($G(XMDUZ):XMDUZ,1:DUZ))="",XQAKILL=1
  1. D DELETEA^XQALERT
  1. Q