source: FOIAVistA/trunk/r/MAILMAN-XM/XMA2.m@ 794

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

initial load of FOIAVistA 6/30/08 version

File size: 1.3 KB
Line 
1XMA2 ;ISC-SF/GMB-Create Message Stub API ;04/19/2002 12:35
2 ;;8.0;MailMan;;Jun 28, 2002
3 ; Was (WASH ISC)/CAP/THM
4 ;
5 ; Entry points (DBIA 10066):
6 ; GET get a message number
7 ; XMZ get a message number
8XMZ ; Create stub/return error
9 ; In:
10 ; XMDUZ User's DUZ or free text
11 ; XMSUB Message subject
12 ; Out:
13 ; XMZ Message number (-1 if error)
14 D MAKESTUB($G(XMDUZ),XMSUB,.XMZ,1)
15 Q
16GET ; Create stub
17 ; In:
18 ; XMDUZ User's DUZ or free text
19 ; XMSUB Message subject
20 ; Out:
21 ; XMZ Message number (HALT if error)
22 D MAKESTUB($G(XMDUZ),XMSUB,.XMZ)
23 Q
24MAKESTUB(XMDUZ,XMSUBJ,XMZ,XMRETURN) ;
25 N XMZREC,XMSENDR
26 I '$G(DUZ) N DUZ D DUZ^XUP(.5)
27 I XMDUZ=0!(XMDUZ="") S XMDUZ=DUZ
28 I $L(XMSUBJ)>65 S XMSUBJ=$E(XMSUBJ,1,65)
29 I $L(XMSUBJ)<3 S XMSUBJ=XMSUBJ_"..."
30 D VSUBJ^XMXPARM(.XMSUBJ)
31 I $D(XMERR) D Q
32 . S XMZ=-1
33 . D:'$D(ZTQUEUED) SHOW^XMJERR
34 . I '$G(XMRETURN) G ABORT
35 D CRE8XMZ^XMXSEND(XMSUBJ,.XMZ,1)
36 I XMZ<1 D Q
37 . I '$G(XMRETURN) G ABORT
38 . K XMERR,^TMP("XMERR",$J)
39 S XMZREC=^XMB(3.9,XMZ,0)
40 I XMDUZ=.6 S XMDUZ=DUZ,XMSENDR=.6
41 E S XMSENDR=DUZ
42 I XMDUZ=.5,XMSENDR'=.5 S $P(XMZREC,U,12)="y" ;Info Only / sent by Postmaster
43 S $P(XMZREC,U,2,4)=XMDUZ_U_$$NOW^XLFDT()_U_$S(XMDUZ'=XMSENDR&+XMDUZ:XMSENDR,1:"")
44 S ^XMB(3.9,XMZ,0)=XMZREC
45 Q
46ABORT ;
47 S X=^TMP("XMERR",$J,1,"TEXT",1)
48 K XMERR,^TMP("XMERR",$J)
49 X X
50 Q
Note: See TracBrowser for help on using the repository browser.