source: WorldVistAEHR/trunk/r/MAILMAN-XM/XMJMFC.m@ 1361

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

initial load of WorldVistAEHR

File size: 6.0 KB
RevLine 
[613]1XMJMFC ;ISC-SF/GMB-Find message in file 3.9 ;07/12/2002 10:34
2 ;;8.0;MailMan;;Jun 28, 2002
3 ; Search for messages in the MESSAGE file
4FIND(XMDUZ,XMF,XMWAIT) ;
5 I $G(XMF("FLAGS"))["U",'$$SSPRIV^XMXSEC1 D Q
6 . D SHOW^XMJERR
7 . D WAIT^XMXUTIL
8 N XMKZ,XMCNT,XMABORT,XMLEN,XMFIRST,XMPAGE,XMDETAIL,XMPMAX,XMMORE,XMFLAGS,XMSCREEN,XMFROM,XMZOOM,XMCD,XMOPT,XMOX,XMSAVE
9 S XMSAVE("FDATE")=XMF("FDATE") K XMF("FDATE")
10 S XMSAVE("TDATE")=XMF("TDATE") K XMF("TDATE")
11 K ^TMP("XM",$J,"MSG"),^TMP("XM",$J,".")
12 S (XMKZ,XMZ,XMPAGE,XMCNT,XMZOOM,XMCD,XMABORT)=0,(XMDETAIL,XMMORE)=1,XMPMAX=IOSL-3
13 D SRCHINIT(XMDUZ,.XMF,.XMFLAGS,.XMSCREEN,.XMFROM,.XMABORT) Q:XMABORT
14 D INIT(XMDUZ,XMFLAGS,XMDETAIL,.XMLEN)
15 D SETOPT^XMJMLR1(XMDUZ,$S(XMFLAGS["U":"!",1:0),.XMOPT,.XMOX)
16 F D Q:XMABORT
17 . I XMCD S XMCD=0,XMDETAIL='XMDETAIL D INIT(XMDUZ,XMFLAGS,XMDETAIL,.XMLEN)
18 . D DISPLAY(XMDUZ,.XMF,XMFLAGS,XMSCREEN,.XMFROM,XMDETAIL,.XMKZ,.XMCNT,.XMFIRST,.XMPAGE,.XMMORE,.XMLEN,XMZOOM,XMPMAX)
19 . I XMCNT=0 S XMABORT=1 Q
20 . D CHOOSE^XMJMLN(XMDUZ,1,0,.XMKZ,.XMFIRST,.XMPAGE,XMMORE,.XMLEN,.XMZOOM,.XMOPT,.XMOX,"READMSG^XMJMFC",.XMABORT)
21 . S:'$D(^TMP("XM",$J,"MSG")) XMABORT=1
22 I XMCNT=0 D
23 . W $$EZBLD^DIALOG(34401) ; No matches found.
24 . Q:'$G(XMWAIT)
25 . W ! D WAIT^XMXUTIL
26 K ^TMP("XM",$J,"MSG"),^TMP("XM",$J,".")
27 S XMF("FDATE")=XMSAVE("FDATE"),XMF("TDATE")=XMSAVE("TDATE")
28 Q
29INIT(XMDUZ,XMFLAGS,XMDETAIL,XMLEN) ;
30 I XMFLAGS'["U" S XMLEN("BSKT")=10
31 S XMLEN("XMKZ")=3
32 D INIT^XMJML(XMDUZ,"","",XMDETAIL,.XMLEN,XMFLAGS["U")
33 Q
34SRCHINIT(XMDUZ,XMF,XMFLAGS,XMSCREEN,XMFROM,XMABORT) ;
35 I XMV("ORDER")=-1 D
36 . S XMFLAGS="B"
37 . S XMFROM=$O(^XMB(3.9,"C",XMSAVE("TDATE")))
38 E D
39 . S XMFLAGS=""
40 . S XMFROM=$O(^XMB(3.9,"C",XMSAVE("FDATE")),-1)
41 S XMFLAGS=$S(XMV("ORDER")=-1:"B",1:"")
42 I $G(XMF("FLAGS"))["U" D Q:XMABORT
43 . S XMFLAGS=XMFLAGS_"U" ; Ignore file screen
44 . D AUDIT(.XMF)
45 . Q:'$D(XMERR)
46 . S XMABORT=1
47 . D SHOW^XMJERR
48 . D WAIT^XMXUTIL
49 S:$D(XMF("SUBJ")) XMF("SUBJ","S")=$$UP^XLFSTR(XMF("SUBJ"))
50 S:$D(XMF("TEXT")) XMF("TEXT","S")=$S('XMF("TEXT","C"):$$UP^XLFSTR(XMF("TEXT")),1:XMF("TEXT"))
51 S XMSCREEN=$$SCREEN(XMDUZ)
52 Q
53AUDIT(XMF) ; Send a bulletin to G.XM SUPER SEARCH
54 N XMINSTR,XMPARM,XMTEXT,I
55 I '$$GOTLOCAL^XMXAPIG("XM SUPER SEARCH",90,2) D ERRSET^XMXUTIL(34413.6) Q
56 S XMINSTR("FROM")=.5
57 S XMPARM(1)=XMV("DUZ NAME")
58 S I=1,XMTEXT(I)=$$LJ^XLFSTR($$EZBLD^DIALOG(34443)_":",30)_$$FMTE^XLFDT(XMSAVE("FDATE"))_" - "_$$FMTE^XLFDT(XMSAVE("TDATE")) ; Search period
59 I $D(XMF("SUBJ")) D ; Subject contains
60 . S I=I+1,XMTEXT(I)=$$LJ^XLFSTR($$EZBLD^DIALOG(34438)_":",30)_XMF("SUBJ")
61 I $D(XMF("FROM")) D ; Message from
62 . S I=I+1,XMTEXT(I)=$$LJ^XLFSTR($$EZBLD^DIALOG(34440)_":",30)_$$NAME^XMXUTIL(XMF("FROM"))
63 I $D(XMF("TO")) D ; Message to
64 . S I=I+1,XMTEXT(I)=$$LJ^XLFSTR($$EZBLD^DIALOG(34440.2)_":",30)_XMF("TO")
65 I $D(XMF("FLINE")) D ; Lines of text, minimum
66 . S I=I+1,XMTEXT(I)=$$LJ^XLFSTR($$EZBLD^DIALOG(34449)_":",30)_XMF("FLINE")
67 ;I $D(XMF("TLINE")) D ; Lines of text, maximum
68 ;. S I=I+1,XMTEXT(I)=$$LJ^XLFSTR($$EZBLD^DIALOG(34450)_":",30)_XMF("TLINE")
69 I $D(XMF("RFROM")) D ; Response from
70 . S I=I+1,XMTEXT(I)=$$LJ^XLFSTR($$EZBLD^DIALOG(34440.1)_":",30)_$$NAME^XMXUTIL(XMF("RFROM"))
71 I $D(XMF("TEXT")) D
72 . ; x.1:Message / x.2:Message or Response / x.3:Response contains
73 . S I=I+1,XMTEXT(I)=$$LJ^XLFSTR($$EZBLD^DIALOG(34446+(XMF("TEXT","L")/10))_":",30)_XMF("TEXT")
74 D SENDBULL^XMXBULL(DUZ,"XM SUPER SEARCH",.XMPARM,"XMTEXT","G.XM SUPER SEARCH",.XMINSTR)
75 I $D(XMERR) D ERRSET^XMXUTIL(34413.6)
76 Q
77SCREEN(XMDUZ) ;
78 S XMSCREEN="N X S X=^(0)"
79 I XMDUZ'=.5 D
80 . N XMMIN
81 . S XMMIN=$P(^XMB(3.7,XMDUZ,0),U,7)
82 . ; If minimum date, don't choose lower date unless already in user's bskt
83 . I XMMIN>0 S XMSCREEN=" I ^(.6)'<"_XMMIN_"!$D(^XMB(3.7,""M"",Y,XMDUZ))"
84 ; Msg must not be SPOOL, msg must not be a reply.
85 Q XMSCREEN_" I $P(X,U,7)'=""S"",'$P(X,U,8),$P(X,U)'?1""R"".N,$$GOODMSG^XMJMFB(XMDUZ,0,Y,.XMF)"
86DISPLAY(XMDUZ,XMF,XMFLAGS,XMSCREEN,XMFROM,XMDETAIL,XMKZ,XMCNT,XMFIRST,XMPAGE,XMMORE,XMLEN,XMZOOM,XMPMAX) ;
87 N XMREC
88 S XMFIRST(XMPAGE)=XMKZ
89 D HEADER^XMJML(XMDETAIL,.XMLEN,$$EZBLD^DIALOG($S(XMFLAGS["U":34403.5,1:34403))) ; All Messages Super Search / All Messages Search
90 I XMZOOM D Q
91 . F S XMKZ=$O(^TMP("XM",$J,".",XMKZ)) Q:XMKZ="" D Q:$Y>XMPMAX
92 . . S XMREC=^TMP("XM",$J,"MSG",XMKZ)
93 . . D LISTMSG^XMJML($P(XMREC,U,1),$P(XMREC,U,2),XMKZ,$P(XMREC,U,3),XMDETAIL,.XMLEN)
94 F S XMKZ=$O(^TMP("XM",$J,"MSG",XMKZ)) Q:XMKZ="" D Q:$Y>XMPMAX
95 . S XMREC=^TMP("XM",$J,"MSG",XMKZ)
96 . D LISTMSG^XMJML($P(XMREC,U,1),$P(XMREC,U,2),XMKZ,$P(XMREC,U,3),XMDETAIL,.XMLEN)
97 Q:$Y>XMPMAX!'XMMORE
98 ; File screen ^DD(3.9,0,"SCR") insists that user be author or recipient.
99 ; If FLAGS["U", then file screen is ignored.
100 D LIST^DIC(3.9,"","@",XMFLAGS,XMPMAX-$Y+1,.XMFROM,"","C",XMSCREEN)
101 S:$P(^TMP("DILIST",$J,0),U,3)=0 XMMORE=0
102 D LISTMSG(XMDUZ,XMDETAIL,.XMCNT,.XMLEN,.XMMORE)
103 S XMKZ=XMCNT
104 K ^TMP("DILIST",$J)
105 W:'XMMORE !,$$EZBLD^DIALOG(34402) ; Search finished.
106 Q
107LISTMSG(XMDUZ,XMDETAIL,XMCNT,XMLEN,XMMORE) ; Check and List
108 N XMK,XMKN,XMZ,I,XMNA,XMSTOP,XMDATE
109 S I="",XMSTOP=0,XMNA=$$EZBLD^DIALOG(34014) ; * N/A *
110 I XMFLAGS["U" S XMK=0,XMKN=XMNA
111 F S I=$O(^TMP("DILIST",$J,2,I),XMV("ORDER")) Q:I'>0 D Q:XMSTOP
112 . S XMCNT=XMCNT+1
113 . S XMZ=^TMP("DILIST",$J,2,I)
114 . S XMDATE=+$G(^XMB(3.9,XMZ,.6))
115 . I XMDATE,XMDATE<XMSAVE("FDATE")!(XMDATE>XMSAVE("TDATE")) D Q
116 . . S XMMORE=0,XMSTOP=1
117 . I XMFLAGS'["U" D
118 . . S XMK=+$O(^XMB(3.7,"M",XMZ,XMDUZ,0))
119 . . S XMKN=$S(XMK:$P(^XMB(3.7,XMDUZ,2,XMK,0),U),1:XMNA)
120 . . I XMK,'$D(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)) D ADDITM^XMUT4A(XMDUZ,XMK,XMZ)
121 . D LISTMSG^XMJML(XMK,XMKN,XMCNT,XMZ,XMDETAIL,.XMLEN)
122 . S ^TMP("XM",$J,"MSG",XMCNT)=XMK_U_XMKN_U_XMZ
123 Q
124READMSG ; (XMDUZ,XMKZ,XMREC) <- needed!
125 N XMK,XMKN,XMZ,XMRDR ; $G(XMRDR) is checked in READMSG^XMJBM
126 I XMFLAGS["U" D
127 . S XMK="!",XMKN=$$EZBLD^DIALOG(34014) ; * N/A *
128 E D
129 . S XMK=$P(XMREC,U,1),XMKN=$P(XMREC,U,2)
130 S XMZ=$P(XMREC,U,3)
131 D READMSG^XMJBM(XMDUZ,XMK,XMKN,XMZ)
132 Q:XMFLAGS["U"
133 Q:$D(^XMB(3.7,"M",XMZ,XMDUZ,XMK))
134 S XMK=+$O(^XMB(3.7,"M",XMZ,XMDUZ,0))
135 S ^TMP("XM",$J,"MSG",XMKZ)=XMK_U_$S(XMK=0:$$EZBLD^DIALOG(34014),1:$P(^XMB(3.7,XMDUZ,2,XMK,0),U))_U_XMZ ; * N/A *
136 Q
Note: See TracBrowser for help on using the repository browser.