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

XMA21.m

Go to the documentation of this file.
  1. XMA21 ;ISC-SF/GMB-Address lookup APIs ;07/17/2003 13:03
  1. ;;8.0;MailMan;**20**;Jun 28, 2002
  1. ; Was (WASH ISC)/CAP
  1. ;
  1. ; Entry points (DBIA 10067):
  1. ; CHK Check to see if a user is a member of a mail group.
  1. ; DES Interactive addressing. Set next default recipient.
  1. ; DEST Interactive addressing. Set first default recipient.
  1. ; INST Non-interactive addressing. (Same as WHO)
  1. ; WHO Non-interactive addressing.
  1. ;
  1. ; Entry points used by MailMan options (not covered by DBIA):
  1. ; DX XMDXNAME - Test name resolution (interactive)
  1. ;
  1. CHK ; Check to see if a user is a member of a mail group.
  1. ; Sets $T if member.
  1. ; Needs:
  1. ; XMDUZ DUZ of the user
  1. ; Y IEN of the mail group
  1. I $D(^XMB(3.8,Y,1,"B",XMDUZ)) Q
  1. Q
  1. DX ;
  1. N XMINSTR,XMV,XMABORT
  1. D INITAPI^XMVVITAE
  1. S XMABORT=0
  1. D INIT^XMXADDR
  1. D TOWHOM^XMJMT(XMDUZ,$$EZBLD^DIALOG(34110),.XMINSTR,"",XMABORT) ;Send
  1. D CLEANUP^XMXADDR
  1. Q
  1. DES ; Interactive addressing. Set next default recipient.
  1. ; XMY is not killed upon entry.
  1. ; Needs:
  1. ; XMMG Next default recipient
  1. ; See entry point TO for other needs and outputs associated with
  1. ; this entry point.
  1. D TO(.XMMG)
  1. Q
  1. DEST ; Interactive addressing. Set first default recipient.
  1. ; XMY is killed upon entry.
  1. ; Needs:
  1. ; XMDUN First default recipient
  1. ; See entry point TO for other needs and outputs associated with
  1. ; this entry point.
  1. K XMY
  1. D TO(XMDUN)
  1. Q
  1. TO(XMTO) ;
  1. ; Entry points DES and DEST also Need:
  1. ; XMDUZ DUZ of user
  1. ; XMDF if $D(XMDF) then do not restrict addressees
  1. ; Output:
  1. ; XMY( Array of addressees: XMY(addressee)=""
  1. ; XMOUT if $D(XMOUT) user aborted addressing
  1. ; X if X="^" user aborted addressing, else X=""
  1. N XMV,XMINSTR,XMABORT,XMDUN
  1. S XMABORT=0
  1. I XMDUZ'>0 N XMDUZ S XMDUZ=DUZ
  1. D INITAPI^XMVVITAE
  1. I $D(XMDF) S XMINSTR("ADDR FLAGS")="R" ; No addressee restrictions
  1. I $D(XMTO) S XMINSTR("TO PROMPT")=XMTO
  1. D INIT^XMXADDR
  1. D TOWHOM^XMJMT(XMDUZ,$$EZBLD^DIALOG(34110),.XMINSTR,"",.XMABORT) ;Send
  1. I XMABORT D Q
  1. . S XMOUT=1,X=U
  1. . D CLEANUP^XMXADDR
  1. K XMOUT
  1. S X=""
  1. D SW
  1. I $D(XMINSTR("SELF BSKT")) S XMY(XMDUZ,0)=XMINSTR("SELF BSKT")
  1. I $D(XMINSTR("SHARE BSKT")) S XMY(.6,0)=XMINSTR("SHARE BSKT")
  1. I $D(XMINSTR("SHARE DATE")) S XMY(.6,"D")=XMINSTR("SHARE DATE")
  1. D CLEANUP^XMXADDR
  1. Q
  1. SW ;
  1. N %X,%Y
  1. S %X="^TMP(""XMY"","_$J_",",%Y="XMY(" D %XY^%RCR
  1. Q
  1. INST ; Non-interactive addressing (Just fall thru to WHO)
  1. WHO ; Non-interactive addressing
  1. ; Needs:
  1. ; XMDUZ user's DUZ
  1. ; X local or remote address
  1. ; (-X will remove address)
  1. ; XMDF if $D(XMDF) then do not restrict addressees
  1. ; XMLOC if $D(XMLOC), forces output of XMMG error message if error
  1. ; Output:
  1. ; XMY address: XMY(address)=""
  1. ; Y if Y=-1, then lookup has failed
  1. ; = <DUZ^full name> if local addressee
  1. ; = <domain ien^domain name> if remote addressee
  1. ; XMMG contains error message if Y=-1
  1. ; = "" if local addressee
  1. ; = via domain message if remote addressee
  1. N XMV,XMINSTR,XMSTRIKE
  1. I XMDUZ'>0 N XMDUZ S XMDUZ=DUZ
  1. D INITAPI^XMVVITAE
  1. I $D(XMDF) S XMINSTR("ADDR FLAGS")="R" ; No addressee restrictions
  1. D INIT^XMXADDR
  1. I $E(X)="-" S XMSTRIKE=1,X=$E(X,2,99)
  1. K XMERR,^TMP("XMERR",$J)
  1. D CHKADDR^XMXADDR(XMDUZ,X,.XMINSTR,"",.Y)
  1. I $D(XMERR) D Q
  1. . S XMMG=^TMP("XMERR",$J,1,"TEXT",1)
  1. . K XMERR,^TMP("XMERR",$J)
  1. . S Y=-1
  1. . I $D(XMLOC) W " ",XMMG
  1. . D CLEANUP^XMXADDR
  1. I $G(XMSTRIKE) D Q
  1. . N XMADDR
  1. . S X=Y
  1. . S XMADDR=""
  1. . F S XMADDR=$O(^TMP("XMY",$J,XMADDR)) Q:XMADDR="" K XMY(XMADDR)
  1. . S XMMG=""
  1. . D CLEANUP^XMXADDR
  1. I Y["@" D Q
  1. . N XMIEN
  1. . S XMIEN=^TMP("XMY",$J,Y) ; IEN
  1. . S XMY(Y)=XMIEN
  1. . S X=$P(Y,"@",2)
  1. . S Y=XMIEN_U_$P(^DIC(4.2,XMIEN,0),U,1)
  1. . S XMMG=$$EZBLD^DIALOG(39101,$P(Y,U,2)) ; via |1|
  1. . D CLEANUP^XMXADDR
  1. D SW
  1. I $E(X,1,2)="G." D
  1. . S X=$E(Y,3,99)
  1. . S Y=$O(^XMB(3.8,"B",X,0))_U_X ; ien^mail group name
  1. E I $L(X>2),".D.H.S."[("."_$E(X,1,2)) D
  1. . S X=$E(Y,3,99)
  1. . S Y=XMY(Y)_U_X ; ien^full name
  1. E D
  1. . S X=Y ; full name
  1. . S Y=$O(XMY(""))_U_Y ; duz^full name
  1. S XMMG=""
  1. D CLEANUP^XMXADDR
  1. Q