source: WorldVistAEHR/trunk/r/MAILMAN-XM/XMJMLR1.m@ 1306

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

initial load of WorldVistAEHR

File size: 5.2 KB
Line 
1XMJMLR1 ;ISC-SF/GMB-List/Read messages in basket (cont.) ;05/20/2002 15:15
2 ;;8.0;MailMan;;Jun 28, 2002
3 ; Replaces 1^XMAL0 (ISC-WASH/THM/CAP)
4XMDIR(XMDUZ,XMLO,XMHI,XMPAGE,XMMORE,XMHELP,XMINSTR,XMOPT,XMOX,XMY,XMABORT) ;
5 N XMX K XMY
6 D ZOOMOPT(.XMOPT)
7 F D Q:$D(XMY)!XMABORT
8 . W !,$$EZBLD^DIALOG(34050) ; Enter message number or command:
9 . R XMX:DTIME I '$T S XMABORT=1 Q
10 . I XMX[U S XMABORT=1 Q
11 . I "="[XMX S XMY=XMX Q
12 . I XMX?.E1C.E D HELPSCR Q
13 . I $E(XMX)="?" D QUESTION Q
14 . I '$$OK K XMY D HELPSCR Q
15 . Q:'$D(XMOPT(XMY,"?"))
16 . D SHOWERR
17 I $G(XMY)="=" K XMY
18 Q
19OK() ;
20 N XMLO
21 S XMLO=0
22 I XMX?1N.N Q $$NUMBERZ
23 I $E(XMX)="." Q $$DOT
24 S XMY=XMX
25 I XMX?1(1"+",1"-").N Q $L(XMX)<26
26 S XMY=$$COMMAND^XMJDIR(.XMOPT,.XMOX,XMX)
27 Q XMY'=-1
28NUMBERZ() ;
29 Q:$L(XMX)>25 0
30 S (XMX,XMY)=+XMX
31 I XMX'<XMLO,XMX'>XMHI Q 1
32 I $D(^XMB(3.9,XMX,0)) Q 1
33 Q 0
34DOT() ;
35 N XMXR,I,XMOK,XMSTRIKE
36 S XMOK=1
37 S XMX=$TR(XMX," ")
38 I $E(XMX,2)="-" S XMSTRIKE=1,XMX=$E(XMX,3,999)
39 E S XMSTRIKE=0,XMX=$E(XMX,2,999)
40 I XMX="*" S XMY="."_$S(XMSTRIKE:"-",1:"")_XMX Q 1
41 F I=1:1:$L(XMX,",") D Q:'XMOK
42 . S XMXR=$P(XMX,",",I)
43 . I XMXR?1.25N1"-"1.25N D Q
44 . . I $P(XMXR,"-",1)<XMLO S XMOK=0 Q
45 . . I $P(XMXR,"-",2)>XMHI S XMOK=0 Q
46 . . I $P(XMXR,"-",1)>$P(XMXR,"-",2) S XMOK=0
47 . I XMXR?1.25N D Q
48 . . I XMXR<XMLO S XMOK=0 Q
49 . . I XMXR>XMHI S XMOK=0
50 . I XMXR?1.25N1"-" D Q
51 . . I $P(XMXR,"-",1)<XMLO S XMOK=0 Q
52 . . I $P(XMXR,"-",1)>XMHI S XMOK=0
53 . S XMOK=0
54 I XMOK S XMY="."_$S(XMSTRIKE:"-",1:"")_XMX Q 1
55 Q 0
56SHOWERR ;
57 D SHOWERR^XMJDIR(.XMOPT,XMY)
58 D WAIT^XMXUTIL
59 S XMY="="
60 Q
61QUESTION ;
62 I XMX="?" D HELPSCR Q
63 I XMX?2."?"!("?HELP"[$$UP^XLFSTR(XMX)) S XQH=XMHELP D EN^XQH S XMY="=" Q
64 I $L(XMX)>64 D HELPSCR Q
65 I XMX?2"?"1N.N,$D(^XMB(3.9,$E(XMX,3,99),0)) S XMY=$E(XMX,3,99) Q
66 I '$D(XMOPT("Q")) D HELPSCR Q
67 S XMY="Q"
68 I $D(XMOPT("Q","?")) D SHOWERR Q
69 N I F I=1,2 Q:$E(XMX,I+1)'="?"
70 S XMY=XMY_I,XMY(0)=$E(XMX,I+1,99)
71 Q
72HELPSCR ;
73 N XMTEXT,XMPARM,XMLINES
74 W !
75 S XMPARM(1)=XMLO,XMPARM(2)=XMHI
76 D BLD^DIALOG($S($G(XMINSTR("GOTO")):34051,1:34051.1),.XMPARM,"","XMTEXT","F") ; Enter a message number (_XMLO_-_XMHI_) to read a message.
77 I $D(XMOPT("Q")),'$D(XMOPT("Q","?")) D BLD^DIALOG(34052,"","","XMTEXT","FS")
78 ; ?string Search for messages in this basket whose subject
79 ; contains the specified string
80 ; ??string Search for messages you once sent or received
81 ; whose subject begins with the specified string
82 D BLD^DIALOG(34053,"","","XMTEXT","FS")
83 ; .(-)n or n-m,a,c-d (de)select message n or a list of messages
84 ; .(-)* (de)select all messages
85 S XMLINES=IOSL-DIHELP-5
86 D MSG^DIALOG("WH","",$G(IOM),"","XMTEXT")
87 D HELPCMD^XMJDIR(.XMOPT,.XMOX,.XMLINES)
88 I XMMORE D
89 . I XMPAGE D BLD^DIALOG($S($G(XMINSTR("GOTO")):34055,1:34056),"","","XMTEXT","FS") Q
90 . D BLD^DIALOG($S($G(XMINSTR("GOTO")):34057,1:34058),"","","XMTEXT","FS")
91 E D
92 . I XMPAGE D BLD^DIALOG($S($G(XMINSTR("GOTO")):34060,1:34061),"","","XMTEXT","FS") Q
93 . D BLD^DIALOG(34059,"","","XMTEXT","FS")
94 ; Press ENTER or + to go to the next page. Enter +n to page forward n pages.
95 ; Enter - to go to the previous page. Enter -n to page back n pages.
96 ; Enter 0 to go to the first page; = to refresh this page; ^ to exit.
97 D MSG^DIALOG("WH","",$G(IOM),"","XMTEXT")
98 W !
99 Q
100SETOPT(XMDUZ,XMK,XMOPT,XMOX) ;
101 D OPTGRP^XMXSEC1(XMDUZ,XMK,.XMOPT,.XMOX,1)
102 D SET^XMXSEC1("CD",37221,.XMOPT,.XMOX) ; Change Detail
103 D SET^XMXSEC1("O",37222,.XMOPT,.XMOX) ; Opposite selection toggle
104 D SET^XMXSEC1("Z",37223,.XMOPT,.XMOX) ; Zoom selection toggle
105 Q
106ZOOMOPT(XMOPT) ;
107 N I
108 I $D(^TMP("XM",$J,".")) D Q
109 . I $D(XMOPT("Z","?")) K XMOPT("O","?"),XMOPT("Z","?")
110 . I $D(XMOPT("Q")) F I="Q","N","R" S XMOPT(I,"?")=37232 ; You can't do this with messages selected.
111 F I="O","Z" S XMOPT(I,"?")=37231 ; You can't do this unless messages are selected.
112 I $D(XMOPT("Q")) K XMOPT("Q","?"),XMOPT("N","?"),XMOPT("R","?")
113 Q
114FWD(XMDUZ,XMZ,XMZREC,XMWAIT,XMOK) ; User is trying to access a message.
115 N X ; User (XMDUZ) is not authorized to see it. If user (DUZ)
116 S XMOK=0 ; is, then we'll give him a chance to forward it.
117 I '$D(^TMP("XMERR",$J,"E",37103)) D Q
118 . D SHOW^XMJERR ; User (XMDUZ and/or DUZ) is not authorized to see it.
119 . D:XMWAIT WAIT^XMXUTIL
120 ; User is trying to access a message as a surrogate for someone else.
121 ; User (DUZ) is authorized to see the message, but the someone else
122 ; (XMDUZ) isn't. We must check to see if we can allow the user to
123 ; forward the message to XMDUZ.
124 D NOGOID^XMJMP2(XMZ,XMZREC,1) ; Show 'subject' & 'from'
125 D SHOW^XMJERR
126 S X=$$FORWARD^XMXSEC(DUZ,XMZ,XMZREC)
127 I XMDUZ=.6 D
128 . I $$CLOSED^XMXSEC(XMZREC) D ERRSET^XMXUTIL(39020) Q
129 . I $$CONFID^XMXSEC(XMZREC) D ERRSET^XMXUTIL(39021)
130 I $D(XMERR) D Q
131 . D SHOW^XMJERR
132 . D:XMWAIT WAIT^XMXUTIL
133 N DIR,X,Y
134 W !
135 S DIR(0)="Y"
136 ;Do you want to forward this message to |1|
137 D BLD^DIALOG(37104,XMV("NAME"),"","DIR(""A"")","F")
138 S DIR("B")=$$EZBLD^DIALOG(39053) ; No
139 D ^DIR Q:'Y!$D(DIRUT)
140 K DIR,X,Y
141 N XMERROR,XMINSTR,XMMSG
142 I XMDUZ=.6 D ASKSHARE^XMXADDR1(.XMINSTR) Q:$D(XMERROR)
143 S XMINSTR("FWD BY")=XMV("DUZ NAME")
144 D FWDMSG^XMXMSGS(DUZ,"",XMZ,XMDUZ,.XMINSTR,.XMMSG)
145 I $D(XMERR) D Q
146 . D SHOW^XMJERR
147 . D:XMWAIT WAIT^XMXUTIL
148 I $D(XMMSG) D
149 . W !,XMMSG
150 . D:XMWAIT WAIT^XMXUTIL
151 S XMOK=1
152 Q
Note: See TracBrowser for help on using the repository browser.