source: FOIAVistA/tag/r/MAILMAN-XM/XMJMLN.m@ 1226

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

initial load of FOIAVistA 6/30/08 version

File size: 8.3 KB
Line 
1XMJMLN ;ISC-SF/GB-List/Read new messages ;12/12/2001 08:53
2 ;;8.0;MailMan;;Jun 28, 2002
3 ; Replaces LIST,PRIO^XMA0A (ISC-WASH/CAP)
4LISTONE(XMDUZ,XMK,XMKN,XMTYPE) ; List new/priority messages in one basket
5 ; XMTYPE N0=New; N=Priority
6 N XMKZ,XMZ,XMCNT,XMABORT,XMLEN,XMFIRST,XMPAGE,XMDETAIL,XMPMAX,XMKALL,XMIA,XMZOOM,XMMORE,XMCD,XMOPT,XMOX
7 S XMIA=1 ; Interactive
8 I '$D(^XMB(3.7,XMDUZ,XMTYPE,XMK)) D Q
9 . W !!,$$EZBLD^DIALOG($S(XMTYPE="N":34016,1:34015)) ; You have no new (priority) messages in this basket.
10 K ^TMP("XM",$J,"MSG"),^TMP("XM",$J,".")
11 S (XMKZ,XMZ)="",(XMPAGE,XMCNT,XMKALL,XMZOOM,XMCD,XMABORT)=0,(XMDETAIL,XMMORE)=1
12 S XMPMAX=IOSL-3
13 D SETOPT^XMJMLR1(XMDUZ,0,.XMOPT,.XMOX)
14 S XMLEN("XMKZ")=$L($P(^XMB(3.7,XMDUZ,2,XMK,0),U,2))
15 D INIT^XMJML(XMDUZ,XMK,XMKN,XMDETAIL,.XMLEN,1)
16 F D Q:XMABORT
17 . I XMCD S XMCD=0,XMDETAIL='XMDETAIL D INIT^XMJML(XMDUZ,XMK,XMKN,XMDETAIL,.XMLEN,1)
18 . D DISPLAY(XMDUZ,XMKALL,XMTYPE,XMDETAIL,XMK,XMKN,.XMKZ,.XMZ,.XMCNT,.XMFIRST,.XMPAGE,.XMMORE,.XMLEN,XMZOOM,XMPMAX)
19 . D CHOOSE(XMDUZ,XMKALL,XMK,.XMKZ,.XMFIRST,.XMPAGE,XMMORE,.XMLEN,.XMZOOM,.XMOPT,.XMOX,"READMSG",.XMABORT)
20 . S:'$D(^XMB(3.7,XMDUZ,XMTYPE,XMK)) XMABORT=1
21 K ^TMP("XM",$J,"MSG"),^TMP("XM",$J,".")
22 Q
23LISTALL(XMDUZ,XMTYPE) ; List new/priority messages in all baskets
24 ; XMTYPE N0=New; N=Priority
25 N XMK,XMKZ,XMZ,XMCNT,XMABORT,XMLEN,XMFIRST,XMPAGE,XMDETAIL,XMPMAX,XMKALL,XMIA,XMZOOM,XMMORE,XMCD,XMOPT,XMOX
26 S XMIA=1 ; Interactive
27 I '$D(^XMB(3.7,XMDUZ,XMTYPE)) D Q
28 . W !!,$$EZBLD^DIALOG($S(XMTYPE="N":34018,1:34017)) ; You have no new (priority) messages.
29 K ^TMP("XM",$J,"MSG"),^TMP("XM",$J,".")
30 S (XMKZ,XMZ)="",(XMPAGE,XMCNT,XMZOOM,XMCD,XMABORT)=0,(XMK,XMDETAIL,XMMORE,XMKALL)=1
31 S XMPMAX=IOSL-3
32 D SETOPT^XMJMLR1(XMDUZ,0,.XMOPT,.XMOX)
33 D INIT(XMDUZ,XMTYPE,XMDETAIL,0,.XMLEN)
34 F D Q:XMABORT
35 . I XMCD S XMCD=0,XMDETAIL='XMDETAIL D INIT(XMDUZ,XMTYPE,XMDETAIL,0,.XMLEN)
36 . D DISPLAY(XMDUZ,XMKALL,XMTYPE,XMDETAIL,.XMK,"",.XMKZ,.XMZ,.XMCNT,.XMFIRST,.XMPAGE,.XMMORE,.XMLEN,XMZOOM,XMPMAX)
37 . D CHOOSE(XMDUZ,XMKALL,0,.XMKZ,.XMFIRST,.XMPAGE,XMMORE,.XMLEN,.XMZOOM,.XMOPT,.XMOX,"READMSG",.XMABORT)
38 . S:'$D(^XMB(3.7,XMDUZ,XMTYPE)) XMABORT=1
39 K ^TMP("XM",$J,"MSG"),^TMP("XM",$J,".")
40 Q
41INIT(XMDUZ,XMTYPE,XMDETAIL,XMACTUAL,XMLEN) ;
42 ; XMACTUAL 1/0=do/do not use actual XMKZ
43 N XMK,XMKN,XMKNMAX,XMKZL
44 S XMLEN("XMKZ")=$S(XMACTUAL:0,1:$L($P(^XMB(3.7,XMDUZ,0),U,6)))
45 S XMK=0,XMKNMAX=""
46 F S XMK=$O(^XMB(3.7,XMDUZ,XMTYPE,XMK)) Q:XMK="" D
47 . S XMKN=$P(^XMB(3.7,XMDUZ,2,XMK,0),U,1)
48 . S:$L(XMKN)>$L(XMKNMAX) XMKNMAX=XMKN
49 . Q:'XMACTUAL
50 . S XMKZL=$L($O(^XMB(3.7,XMDUZ,2,XMK,1,"C",""),-1))
51 . S:XMKZL>XMLEN("XMKZ") XMLEN("XMKZ")=XMKZL
52 D INIT^XMJML(XMDUZ,"",XMKNMAX,XMDETAIL,.XMLEN)
53 Q
54DISPLAY(XMDUZ,XMKALL,XMTYPE,XMDETAIL,XMK,XMKN,XMKZ,XMZ,XMCNT,XMFIRST,XMPAGE,XMMORE,XMLEN,XMZOOM,XMPMAX) ;
55 N XMREC,XMHDLINE
56 S XMFIRST(XMPAGE)=XMKZ
57 S XMHDLINE=$$HEADLINE(XMDUZ,XMKALL,XMK,XMKN,XMTYPE)
58 D HEADER^XMJML(XMDETAIL,.XMLEN,XMHDLINE)
59 I XMZOOM D Q
60 . F S XMKZ=$O(^TMP("XM",$J,".",XMKZ)) Q:XMKZ="" D Q:$Y>XMPMAX
61 . . S XMREC=^TMP("XM",$J,"MSG",XMKZ)
62 . . D LISTMSG^XMJML($P(XMREC,U,1),$P(XMREC,U,2),XMKZ,$P(XMREC,U,3),XMDETAIL,.XMLEN)
63 F S XMKZ=$O(^TMP("XM",$J,"MSG",XMKZ)) Q:XMKZ="" D Q:$Y>XMPMAX
64 . S XMREC=^TMP("XM",$J,"MSG",XMKZ)
65 . D LISTMSG^XMJML($P(XMREC,U,1),$P(XMREC,U,2),XMKZ,$P(XMREC,U,3),XMDETAIL,.XMLEN)
66 Q:$Y>XMPMAX!'XMMORE
67 I XMKALL D
68 . S XMK=XMK-.01
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,XMTYPE,XMK,XMZ)
90 . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
91 . S XMCNT=XMCNT+1
92 . S ^TMP("XM",$J,"MSG",XMCNT)=XMK_U_XMKN_U_XMZ
93 . D LISTMSG^XMJML(XMK,XMKN,XMCNT,XMZ,XMDETAIL,.XMLEN)
94 Q
95CHOOSE(XMDUZ,XMKALL,XMK,XMKZ,XMFIRST,XMPAGE,XMMORE,XMLEN,XMZOOM,XMOPT,XMOX,XMREAD,XMABORT) ;
96 N XMY,XMHI,XMLO
97 I XMZOOM D
98 . S XMMORE=$S(XMKZ="":0,1:1)
99 E I $O(XMFIRST(XMPAGE)),XMKZ,$O(^TMP("XM",$J,"MSG",XMKZ)) D
100 . S XMMORE=1
101 . S XMFIRST(XMPAGE+1)=XMKZ
102 S XMLO=$O(^TMP("XM",$J,"MSG",""))
103 S XMHI=$O(^TMP("XM",$J,"MSG",""),-1)
104 D XMDIR^XMJMLR1(XMDUZ,XMLO,XMHI,XMPAGE,XMMORE,"XM-U-BO-FULL SCREEN LIST","",.XMOPT,.XMOX,.XMY,.XMABORT) Q:XMABORT
105 I '$D(XMY) S XMKZ=XMFIRST(XMPAGE) Q
106 I XMY=""!($E(XMY)="+") D Q ; Next page
107 . I XMMORE S XMPAGE=XMPAGE+1 Q
108 . I XMPAGE=0 S XMABORT=1 Q
109 . D AGAIN^XMJMLR(.XMABORT) Q:XMABORT
110 . S XMPAGE=0
111 . S XMKZ=XMFIRST(XMPAGE)
112 I $E(XMY)="." D Q ; (De)Select messages
113 . D DODOT
114 . I XMZOOM,'$D(^TMP("XM",$J,".")) D Z
115 . S XMKZ=XMFIRST(XMPAGE)
116 I XMY>0 D Q
117 . N XMREC
118 . S XMREC=$G(^TMP("XM",$J,"MSG",XMY))
119 . I XMREC="" D
120 . . W $C(7)
121 . E D
122 . . N XMKZ
123 . . S XMKZ=XMY
124 . . D @XMREAD
125 . . I XMZOOM,'$D(^TMP("XM",$J,".")) D Z
126 . S XMKZ=XMFIRST(XMPAGE)
127 I XMY=0 D Q ; First page
128 . S XMPAGE=0
129 . S XMKZ=XMFIRST(XMPAGE)
130 I $E(XMY)="-" D Q ; Previous page
131 . S:XMPAGE>0 XMPAGE=XMPAGE-1
132 . S XMKZ=XMFIRST(XMPAGE)
133 D @XMY
134 S XMKZ=XMFIRST(XMPAGE)
135 Q
136READMSG ; (XMDUZ,XMKZ,XMREC,XMTYPE) <- needed!
137 N XMK,XMKN,XMZ
138 S XMK=$P(XMREC,U,1),XMKN=$P(XMREC,U,2),XMZ=$P(XMREC,U,3)
139 I XMDUZ'=DUZ,'$$SURRACC^XMXSEC(XMDUZ,"",XMZ,$G(^XMB(3.9,XMZ,0))) D Q ; "read"
140 . D SHOW^XMJERR
141 . D WAIT^XMXUTIL
142 D READNEW^XMJBN(XMDUZ,XMK,XMKN,XMZ)
143 Q:$D(^XMB(3.7,XMDUZ,XMTYPE,XMK,XMZ))
144 K ^TMP("XM",$J,"MSG",XMKZ)
145 K:$D(^TMP("XM",$J,".",XMKZ)) ^TMP("XM",$J,".",XMKZ)
146 Q
147DODOT ;
148 N I,XMSTRIKE,XM1,XMN,XMKZ
149 I $E(XMY,2)="-" S XMSTRIKE=1,XMY=$E(XMY,3,999)
150 E S XMSTRIKE=0,XMY=$E(XMY,2,999)
151 I XMY="*" D Q
152 . I XMSTRIKE K ^TMP("XM",$J,".") Q
153 . S XMKZ=""
154 . F S XMKZ=$O(^TMP("XM",$J,"MSG",XMKZ)) Q:'XMKZ S ^TMP("XM",$J,".",XMKZ)=""
155 F I=1:1:$L(XMY,",") D
156 . S XMKZ=$P(XMY,",",I)
157 . I XMKZ["-" D Q
158 . . S XM1=$P(XMKZ,"-")
159 . . S XMN=$P(XMKZ,"-",2) S:XMN="" XMN=XMHI
160 . . S XMKZ=XM1-.1
161 . . I 'XMSTRIKE D Q
162 . . . F S XMKZ=$O(^TMP("XM",$J,"MSG",XMKZ)) Q:XMKZ>XMN!'XMKZ D
163 . . . . S:'$D(^TMP("XM",$J,".",XMKZ)) ^TMP("XM",$J,".",XMKZ)=""
164 . . F S XMKZ=$O(^TMP("XM",$J,".",XMKZ)) Q:XMKZ>XMN!'XMKZ K ^TMP("XM",$J,".",XMKZ)
165 . I 'XMSTRIKE D Q
166 . . I $D(^TMP("XM",$J,"MSG",XMKZ)),'$D(^TMP("XM",$J,".",XMKZ)) S ^TMP("XM",$J,".",XMKZ)=""
167 . I $D(^TMP("XM",$J,".",XMKZ)) K ^TMP("XM",$J,".",XMKZ)
168 Q
169CD ; Change Detail
170 S XMCD=1
171 Q
172D ; Delete messages
173 D DELETE^XMJMORX(XMDUZ,XMKALL,XMK)
174 D WAIT^XMXUTIL
175 I XMZOOM,'$D(^TMP("XM",$J,".")) D Z
176 Q
177F ; Forward messages
178 D FORWARD^XMJMORX(XMDUZ,XMKALL,XMK)
179 D WAIT^XMXUTIL
180 Q
181FI ; Filter messages
182 D FILTER^XMJMORX(XMDUZ,XMKALL,XMK)
183 D WAIT^XMXUTIL
184 Q
185H ; Headerless Print messages
186 D PRINT^XMJMORX(XMDUZ,0)
187 D WAIT^XMXUTIL
188 Q
189L ; Later messages
190 D LATER^XMJMORX(XMDUZ,XMKALL,XMK)
191 D WAIT^XMXUTIL
192 Q
193NT ; New Toggle messages
194 D NEWTOGL^XMJMORX(XMDUZ,XMKALL,XMK)
195 D WAIT^XMXUTIL
196 Q
197O ; Opposite toggle
198 N XMKZ
199 S XMKZ=0
200 F S XMKZ=$O(^TMP("XM",$J,"MSG",XMKZ)) Q:'XMKZ D
201 . I $D(^TMP("XM",$J,".",XMKZ)) K ^TMP("XM",$J,".",XMKZ) Q
202 . S ^TMP("XM",$J,".",XMKZ)=""
203 S XMPAGE=0
204 Q
205P ; Print messages
206 D PRINT^XMJMORX(XMDUZ,1)
207 D WAIT^XMXUTIL
208 Q
209S ; Save messages
210 D SAVE^XMJMORX(XMDUZ,XMKALL,XMK)
211 D WAIT^XMXUTIL
212 I XMZOOM,'$D(^TMP("XM",$J,".")) D Z
213 Q
214T ; Terminate messages
215 D TERM^XMJMORX(XMDUZ,XMKALL,XMK)
216 D WAIT^XMXUTIL
217 I XMZOOM,'$D(^TMP("XM",$J,".")) D Z
218 Q
219V ; Vaporize messages
220 D VAPOR^XMJMORX(XMDUZ,XMKALL,XMK)
221 D WAIT^XMXUTIL
222 Q
223X ; Xmit Priority Toggle messages (for Postmaster only)
224 D XMTPRI^XMJMOR(XMDUZ,XMK)
225 D WAIT^XMXUTIL
226 Q
227Z ; Zoom toggle
228 N I
229 I XMZOOM D
230 . S XMZOOM=0
231 . S I=""
232 . F S I=$O(XMFIRST(0,I)) Q:I="" S XMFIRST(I)=XMFIRST(0,I)
233 . S XMPAGE=XMPAGE(0)
234 E D
235 . S XMZOOM=1
236 . S I=""
237 . F S I=$O(XMFIRST(I)) Q:I="" S XMFIRST(0,I)=XMFIRST(I)
238 . S XMPAGE(0)=XMPAGE
239 . S XMPAGE=0
240 Q
Note: See TracBrowser for help on using the repository browser.