source: FOIAVistA/tag/r/MAILMAN-XM/XMJMR1.m@ 628

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

initial load of FOIAVistA 6/30/08 version

File size: 4.8 KB
Line 
1XMJMR1 ;ISC-SF/GMB-Interactive Reply (cont.) ;08/24/2001 08:29
2 ;;8.0;MailMan;;Jun 28, 2002
3INIT(XMDUZ,XMK,XMKN,XMZO,XMZOSUBJ,XMZOFROM,XMINSTR,XMINCL,XMZI,XMWHICH,XMABORT) ;
4 N DIR,Y,DIRUT,XMRESPS
5 I XMDUZ=.6,DUZ=.6 D Q
6 . ; This is already handled in OPTMSG^XMXSEC2, but, just in case...
7 . S XMABORT=1
8 . W !,$$EZBLD^DIALOG(37422.6) ; SHARED,MAIL may not Reply to a message.
9 . G H^XUS
10 D CHKLOCK^XMJMS(XMDUZ,.XMABORT) Q:XMABORT
11 I XMINSTR("FLAGS")["P" D Q:XMABORT
12 . N XMTEXT
13 . W !,$C(7)
14 . D BLD^DIALOG(34200,"","","XMTEXT","F") ; Responses to priority messages are not ... (need priority? send a new msg)
15 . D MSG^DIALOG("WH","","","","XMTEXT")
16 . W !
17 . D PAGE^XMXUTIL(.XMABORT)
18 I XMZOFROM["POSTMASTER",XMZOFROM["@" D Q:XMABORT
19 . N XMTEXT
20 . W !,$C(7)
21 . D BLD^DIALOG(34201,"","","XMTEXT","F") ; Because this message is from a remote ... (reply stays local)
22 . D MSG^DIALOG("WH","","","","XMTEXT")
23 . W !
24 . D PAGE^XMXUTIL(.XMABORT)
25 D CHKBSKT^XMJMOI(XMDUZ,XMZO,.XMK,.XMKN)
26 I +XMK<1 D
27 . W !
28 . D SAVEMSG^XMJMOI(XMDUZ,.XMK,.XMKN,XMZO,XMZOSUBJ,XMZOFROM,$G(XMINSTR("RCPT BSKT")))
29 S XMRESPS=+$P($G(^XMB(3.9,XMZO,3,0)),U,4)
30 D WHICH(XMDUZ,XMZO,XMINCL,.XMZI,.XMWHICH,.XMABORT)
31 Q
32WHICH(XMDUZ,XMZO,XMINCL,XMZI,XMWHICH,XMABORT) ;
33 ; XMINCL =0 Do not include previous responses. Just reply.
34 ; =1 Include previous response(s) from this message
35 ; or include response(s) from another message in reply.
36 ; =2 Include response(s) from another message in a new message.
37 Q:XMINCL=0
38 D WHICHMSG(XMDUZ,XMZO,XMINCL,.XMZI,.XMABORT) Q:XMABORT
39 D WHICH^XMJMC(XMZI,$$EZBLD^DIALOG(34209),.XMWHICH,.XMABORT) ; include
40 Q
41WHICHMSG(XMDUZ,XMZO,XMINCL,XMZI,XMABORT) ; Include responses from which (different) message
42 N DIR,X,Y,XMIN,XMAX,XMPARM
43 S (XMPARM(1),XMIN)=$O(^XMB(3.9,0)),(XMPARM(2),XMAX)=$O(^XMB(3.9,":"),-1)
44 W !
45 S DIR("A")=$$EZBLD^DIALOG(34270) ; Include responses from which message
46 I XMINCL=1 D
47 . S DIR("B")=$$EZBLD^DIALOG(34271) ; This message
48 . S DIR(0)="FO^"_$$MIN^XLFMTH($L(XMIN),$L(DIR("B")))_":"_$$MAX^XLFMTH($L(XMAX),$L(DIR("B")))_"^D CHKMSG^XMJMR1(.Y)"
49 . D BLD^DIALOG(34272,.XMPARM,"","DIR(""?"")")
50 . ;Press Enter to include previous responses from this message
51 . ;or enter the internal entry number of a different message
52 . ;(_XMIN_-_XMAX_) to include any of its responses.
53 E D
54 . S DIR(0)="NO^"_XMIN_":"_XMAX_":0^D CHKMSG^XMJMR1(.Y)"
55 . D BLD^DIALOG(34273,.XMPARM,"","DIR(""?"")")
56 . ;Enter the internal entry number of a different message
57 . ;(_XMIN_-_XMAX_) to include any of its responses.
58 D ^DIR
59 I 'Y S XMABORT=1 Q
60 S XMZI=+Y
61 Q:XMINCL=1
62 ; Do you want to review this message first?
63 Q
64CHKMSG(XMZI) ;
65 I XMINCL=1,XMZI=DIR("B") S XMZI=XMZO Q ; Include previous responses from this message.
66 I XMINCL=1,$S(XMZI'?.N:1,XMZI<XMIN:1,XMZI>XMAX:1,1:0) K X W $C(7)," ?" Q
67 I XMINCL=2,XMZI=XMZO D Q
68 . K X
69 . W !,$$EZBLD^DIALOG(34274) ; You can't include the message you're editing.
70 N XMZIREC ; Include responses from another message.
71 S XMZIREC=$G(^XMB(3.9,XMZI,0))
72 I XMZIREC="" K X Q
73 I '$$INCLUDE^XMXSEC(XMDUZ,XMZI) D Q
74 . K X
75 . D SHOW^XMJERR
76 W " ",$P(XMZIREC,U,1)
77 Q
78COPYTEXT(XMZI,XMZ,XMWHICH,XMHDR) ;
79 N I,XMRESP,XMRANGE,XMC
80 I $G(XMHDR) S XMHDR("XMZ")=XMZI,XMHDR("REC")=^XMB(3.9,XMZI,0)
81 W !,$$EZBLD^DIALOG(34202) ; Copying...
82 S XMC=+$O(^XMB(3.9,XMZ,2,""),-1)
83 F I=1:1:$L(XMWHICH,",") D
84 . S XMRANGE=$P(XMWHICH,",",I)
85 . Q:XMRANGE="" ; (XMWHICH can end with a ",", giving us a null piece.)
86 . F XMRESP=$P(XMRANGE,"-",1):1:$S(XMRANGE["-":$P(XMRANGE,"-",2),1:XMRANGE) D
87 . . I XMRESP=0 D COPYRESP(XMRESP,XMZI,XMZ,.XMC,.XMHDR) Q
88 . . D COPYRESP(XMRESP,+$G(^XMB(3.9,XMZI,3,XMRESP,0)),XMZ,.XMC,.XMHDR)
89 S ^XMB(3.9,XMZ,2,0)="^3.92A^"_XMC_U_XMC_U_DT
90 Q
91COPYRESP(XMRESP,XMZI,XMZ,XMC,XMHDR) ;
92 N XMF,XMFROM,XMDT,XMZREC,XMPARM
93 S XMC=XMC+1
94 S ^XMB(3.9,XMZ,2,XMC,0)=""
95 S XMZREC=$G(^XMB(3.9,XMZI,0))
96 S XMFROM=$$NAME^XMXUTIL($P(XMZREC,U,2))
97 S XMDT=$P(XMZREC,U,3)
98 I $G(XMHDR) D
99 . S XMC=XMC+1
100 . S ^XMB(3.9,XMZ,2,XMC,0)="In the message:"
101 . S XMC=XMC+1
102 . S ^XMB(3.9,XMZ,2,XMC,0)=">"_$$EZBLD^DIALOG(34536,$$SUBJ^XMXUTIL2(XMHDR("REC")))_" "_$$EZBLD^DIALOG(34537,XMHDR("XMZ")) ; Subj: / [#]
103 . S XMC=XMC+1
104 . S ^XMB(3.9,XMZ,2,XMC,0)=">"_$$EZBLD^DIALOG(34538,$$FROM^XMXUTIL2(XMHDR("REC")))_$S($P(XMHDR("REC"),U,4)="":"",1:" "_$$EZBLD^DIALOG(34533,$$NAME^XMXUTIL($P(XMHDR("REC"),U,4)))) ; From: |1| (Sender: |1|)
105 . S XMC=XMC+1
106 . S ^XMB(3.9,XMZ,2,XMC,0)=">"_$$EZBLD^DIALOG(34585,$$MMDT^XMXUTIL1($P(XMHDR("REC"),U,3))) ; Sent: |1|
107 S XMC=XMC+1
108 S XMPARM(1)=$$MMDT^XMXUTIL1(XMDT)
109 S XMPARM(2)=$S(XMRESP:$$EZBLD^DIALOG(34204,XMRESP),1:$$EZBLD^DIALOG(34205)) ; Response #|1| / Original message
110 S XMPARM(3)=XMFROM
111 S ^XMB(3.9,XMZ,2,XMC,0)=$$EZBLD^DIALOG(34203,.XMPARM) ; On |1| (|2|) |3| wrote:
112 S XMF=.999999
113 F S XMF=$O(^XMB(3.9,XMZI,2,XMF)) Q:XMF="" D
114 . S XMC=XMC+1
115 . W:XMC#50=0 "."
116 . S ^XMB(3.9,XMZ,2,XMC,0)=$E(">"_^XMB(3.9,XMZI,2,XMF,0),1,254)
117 Q
Note: See TracBrowser for help on using the repository browser.