source: FOIAVistA/tag/r/MAILMAN-XM/XMXEDIT.m@ 1326

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

initial load of FOIAVistA 6/30/08 version

File size: 5.1 KB
Line 
1XMXEDIT ;ISC-SF/GMB-Edit msg that user has sent to self ;05/19/2000 13:41
2 ;;8.0;MailMan;;Jun 28, 2002
3 ; All entry points covered by DBIA 2730.
4 ; These entry points edit a message. They do not perform any checks to
5 ; see whether it is appropriate to do so. That is the responsibility
6 ; of the calling routine.
7 ; For these entry points, it is expected that:
8 ; OPTMSG^XMXSEC2 has been called and has given its permission to
9 ; edit the message or to toggle information only.
10 ; OPTEDIT^XMXSEC2 has been called and has given its permission to
11 ; edit the particular thing we are editing here.
12 ; INMSG2^XMXUTIL2 has been called to set XMINSTR. These routines expect
13 ; that XMINSTR has been correctly set. They will change
14 ; XMINSTR according to the edit.
15CLOSED(XMZ,XMINSTR,XMMSG) ; Toggle Closed msg
16 I $D(^TMP("XMY",$J,.6)) D ERRSET^XMXUTIL(37320.6) Q ; Messages addressed to SHARED,MAIL may not be closed
17 D FLAGTOGL(XMZ,1.95,.XMINSTR,"X",37319.9,37320.9,.XMMSG)
18 Q
19CONFID(XMZ,XMINSTR,XMMSG) ; Toggle Confidential msg
20 I $D(^TMP("XMY",$J,.6)) D ERRSET^XMXUTIL(37301.6) Q ; Messages addressed to SHARED,MAIL may not be confidential
21 D FLAGTOGL(XMZ,1.96,.XMINSTR,"C",37301.9,37302.9,.XMMSG)
22 Q
23CONFIRM(XMZ,XMINSTR,XMMSG) ; Toggle Confirm receipt of msg
24 D FLAGTOGL(XMZ,1.3,.XMINSTR,"R",37313.9,37314.9,.XMMSG)
25 Q
26DELIVER(XMZ,XMDBSKT,XMINSTR,XMMSG) ; Delivery basket
27 I XMDBSKT="@" D Q
28 . K XMINSTR("RCPT BSKT")
29 . S XMFDA(3.9,XMZ_",",21)="@"
30 . D FILE^DIE("","XMFDA")
31 . S XMMSG=$$EZBLD^DIALOG(37304.9) ; Delivery basket removed
32 S XMINSTR("RCPT BSKT")=XMDBSKT
33 S XMFDA(3.9,XMZ_",",21)=XMINSTR("RCPT BSKT")
34 D FILE^DIE("","XMFDA")
35 S XMMSG=$$EZBLD^DIALOG(37303.9) ; Delivery basket set
36 Q
37INFO(XMZ,XMINSTR,XMMSG) ; Toggle Information only msg
38 D FLAGTOGL(XMZ,1.97,.XMINSTR,"I",37307.9,37308.9,.XMMSG)
39 Q
40NETSIG(XMDUZ,XMZ,XMINSTR,XMMSG) ; Add Network Signature
41 N I,XMNSIG
42 S XMNSIG(.1)=""
43 S XMNSIG(.2)=""
44 S XMNSIG(.3)=$$REPEAT^XLFSTR("-",79)
45 S XMNSIG=$G(^XMB(3.7,XMDUZ,"NS1"))
46 F I=1:1:3 S:$P(XMNSIG,U,I)'="" XMNSIG(I)=$P(XMNSIG,U,I)
47 N XMABORT
48 I $D(^XMB(3.9,XMZ,"K")) D Q:XMABORT
49 . ; If XMSECURE does not exist, then XMINSTR("SCR KEY") must hold the
50 . ; correct scramble key.
51 . I '$D(XMSECURE) N XMSECURE
52 . I '$D(XMSECURE),'$$GOODKEY^XMJMCODE(XMZ,XMINSTR("SCR KEY")) D Q
53 . . D ERRSET^XMXUTIL(34623) ; The key is not correct.
54 . . S XMABORT=1
55 . S XMABORT=0
56 . S I=0
57 . F S I=$O(XMNSIG(I)) Q:'I S XMNSIG(I)=$$ENCSTR^XMJMCODE(XMNSIG(I))
58 D MOVEBODY^XMXSEND(XMZ,"XMNSIG","A") ; Add the network signature
59 S XMMSG=$$EZBLD^DIALOG(37309.9) ; Network Signature added
60 Q
61PRIORITY(XMZ,XMINSTR,XMMSG) ; Toggle Priority msg
62 D FLAGTOGL(XMZ,1.7,.XMINSTR,"P",37311.9,37312.9,.XMMSG)
63 Q
64SCRAMBLE(XMZ,XMINSTR,XMMSG) ; Scramble or Unscramble the message text
65 N XMFDA,XMIENS
66 S XMIENS=XMZ_","
67 I $D(^XMB(3.9,XMZ,"K")) D Q
68 . ; Unscramble the text.
69 . ; If XMSECURE does not exist, then XMINSTR("SCR KEY") must hold the
70 . ; correct scramble key.
71 . I '$D(XMSECURE),'$$GOODKEY^XMJMCODE(XMZ,XMINSTR("SCR KEY")) D ERRSET^XMXUTIL(34623) Q ; The key is not correct.
72 . S XMFDA(3.9,XMIENS,1.8)="@"
73 . S XMFDA(3.9,XMIENS,1.85)="@"
74 . D FILE^DIE("","XMFDA")
75 . D DECMSG^XMJMCODE(XMZ)
76 . K XMSECURE,XMINSTR("SCR KEY"),XMINSTR("SCR HINT"),^XMB(3.9,XMZ,"K")
77 . S XMMSG=$$EZBLD^DIALOG(37316.9) ; Message text UnScrambled
78 ; Check the key and hint
79 D XMKEY^XMXPARM1($G(XMINSTR("SCR KEY")))
80 D:$G(XMINSTR("SCR HINT"))'="" XMHINT^XMXPARM1(XMINSTR("SCR HINT"))
81 Q:$D(XMERR)
82 ; Scramble the text.
83 N XMKEY
84 K XMSECURE
85 S XMFDA(3.9,XMIENS,1.8)=$S($G(XMINSTR("SCR HINT"))="":" ",1:XMINSTR("SCR HINT"))
86 D LOADCODE^XMJMCODE ; XMSECURE is created here
87 S XMKEY=XMINSTR("SCR KEY")
88 D ADJUST^XMJMCODE(.XMKEY) ; XMSECURE is adjusted here
89 S XMFDA(3.9,XMIENS,1.85)="1"_$$ENCSTR^XMJMCODE(XMKEY)
90 D ENCMSG^XMJMCODE(XMZ)
91 D FILE^DIE("","XMFDA")
92 S XMMSG=$$EZBLD^DIALOG(37315.9) ; Message text Scrambled
93 Q
94SUBJ(XMZ,XMSUBJ,XMIM) ; Replace Subject
95 S XMSUBJ=$$XMSUBJ^XMXPARM("XMSUBJ",$G(XMSUBJ)) Q:$D(XMERR)
96 S (XMIM("SUBJ"),XMFDA(3.9,XMZ_",",.01))=$$ENCODEUP^XMXUTIL1(XMSUBJ)
97 D FILE^DIE("","XMFDA")
98 Q
99TEXT(XMZ,XMBODY) ; Replace Text
100 D WP^DIE(3.9,XMZ_",",3,"",XMBODY)
101 Q
102VAPOR(XMZ,XMVAPOR,XMINSTR,XMMSG) ; Vaporize date
103 I XMVAPOR="@" D Q
104 . K XMINSTR("VAPOR")
105 . S XMFDA(3.9,XMZ_",",1.6)="@"
106 . D FILE^DIE("","XMFDA")
107 . S XMMSG=$$EZBLD^DIALOG(37318.9) ; Vaporize Date removed
108 S XMINSTR("VAPOR")=XMVAPOR
109 S XMFDA(3.9,XMZ_",",1.6)=XMINSTR("VAPOR")
110 D FILE^DIE("","XMFDA")
111 S XMMSG=$$EZBLD^DIALOG(37317.9) ; Vaporize Date set
112 Q
113FLAGTOGL(XMZ,XMFIELD,XMINSTR,XMFLAG,XMSET,XMREMOVE,XMMSG) ; Flag Toggle (For internal MM use only!)
114 N XMFDA
115 I $G(XMINSTR("FLAGS"))[XMFLAG D
116 . S XMINSTR("FLAGS")=$TR(XMINSTR("FLAGS"),XMFLAG)
117 . S XMMSG=$$EZBLD^DIALOG(XMREMOVE)
118 . I XMFLAG="P" D
119 . . S XMFDA(3.9,XMZ_",",XMFIELD)=$S($G(XMINSTR("TYPE"))="":"@",1:XMINSTR("TYPE"))
120 . E S XMFDA(3.9,XMZ_",",XMFIELD)="@"
121 E D
122 . S XMINSTR("FLAGS")=$G(XMINSTR("FLAGS"))_XMFLAG
123 . S XMMSG=$$EZBLD^DIALOG(XMSET)
124 . I XMFLAG="P" S XMFDA(3.9,XMZ_",",XMFIELD)=$G(XMINSTR("TYPE"))_"P"
125 . E S XMFDA(3.9,XMZ_",",XMFIELD)="y"
126 D FILE^DIE("","XMFDA")
127 Q
Note: See TracBrowser for help on using the repository browser.