source: FOIAVistA/tag/r/MAILMAN-XM/XMJMFA.m@ 1154

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

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1XMJMFA ;ISC-SF/GMB-Find message: Subject starts with ;04/18/2002 07:47
2 ;;8.0;MailMan;;Jun 28, 2002
3 ; Search for message subjects that partial match input.
4 ; Replaces ^XMA03 (ISC-WASH/CAP/THM)
5FIND(XMDUZ,XMSTRING,XMWAIT) ;
6 N XMKZ,XMCNT,XMABORT,XMLEN,XMFIRST,XMPAGE,XMDETAIL,XMPMAX,XMMORE,XMFLAGS,XMSCREEN,XMFROM,XMZOOM,XMCD,XMOPT,XMOX
7 K ^TMP("XM",$J,"MSG"),^TMP("XM",$J,".")
8 S (XMKZ,XMZ,XMPAGE,XMCNT,XMZOOM,XMCD,XMABORT)=0,(XMDETAIL,XMMORE)=1,XMPMAX=IOSL-3
9 D SRCHINIT(XMDUZ,.XMFLAGS,.XMSCREEN)
10 D INIT(XMDUZ,XMDETAIL,.XMLEN)
11 D SETOPT^XMJMLR1(XMDUZ,0,.XMOPT,.XMOX)
12 F D Q:XMABORT
13 . I XMCD S XMCD=0,XMDETAIL='XMDETAIL D INIT(XMDUZ,XMDETAIL,.XMLEN)
14 . D DISPLAY(XMDUZ,XMSTRING,XMFLAGS,XMSCREEN,.XMFROM,XMDETAIL,.XMKZ,.XMCNT,.XMFIRST,.XMPAGE,.XMMORE,.XMLEN,XMZOOM,XMPMAX)
15 . I XMCNT=0 S XMABORT=1 Q
16 . D CHOOSE^XMJMLN(XMDUZ,1,0,.XMKZ,.XMFIRST,.XMPAGE,XMMORE,.XMLEN,.XMZOOM,.XMOPT,.XMOX,"READMSG^XMJMFA",.XMABORT)
17 . S:'$D(^TMP("XM",$J,"MSG")) XMABORT=1
18 I XMCNT=0 D
19 . W $$EZBLD^DIALOG(34401) ; No matches found.
20 . Q:'$G(XMWAIT)
21 . W ! D WAIT^XMXUTIL
22 K ^TMP("XM",$J,"MSG"),^TMP("XM",$J,".")
23 Q
24SRCHINIT(XMDUZ,XMFLAGS,XMSCREEN) ;
25 S XMSCREEN="",XMFLAGS=$S(XMV("ORDER")=-1:"B",1:"")
26 I XMDUZ=.5 S XMFLAGS=XMFLAGS_"U" Q ; Ignore file screen
27 S XMSCREEN=XMSCREEN_"N X S X=^(0)"
28 N XMMIN
29 S XMMIN=$P(^XMB(3.7,XMDUZ,0),U,7)
30 ; If minimum date, don't choose lower date unless already in user's bskt
31 I XMMIN>0 S XMSCREEN=" I ^(.6)'<"_XMMIN_"!$D(^XMB(3.7,""M"",Y,XMDUZ))"
32 ; Msg must not be SPOOL, msg must not be a reply.
33 S XMSCREEN=XMSCREEN_" I $P(X,U,7)'=""S"",$S($P(X,U,8):0,$P(X,U)?1""R"".N:0,1:1)"
34 Q
35INIT(XMDUZ,XMDETAIL,XMLEN) ;
36 S XMLEN("BSKT")=10
37 S XMLEN("XMKZ")=3
38 D INIT^XMJML(XMDUZ,"","",XMDETAIL,.XMLEN)
39 Q
40DISPLAY(XMDUZ,XMSTRING,XMFLAGS,XMSCREEN,XMFROM,XMDETAIL,XMKZ,XMCNT,XMFIRST,XMPAGE,XMMORE,XMLEN,XMZOOM,XMPMAX) ;
41 N XMREC
42 S XMFIRST(XMPAGE)=XMKZ
43 D HEADER^XMJML(XMDETAIL,.XMLEN,$$EZBLD^DIALOG(34403)) ; All Messages Search
44 I XMZOOM D Q
45 . F S XMKZ=$O(^TMP("XM",$J,".",XMKZ)) Q:XMKZ="" D Q:$Y>XMPMAX
46 . . S XMREC=^TMP("XM",$J,"MSG",XMKZ)
47 . . D LISTMSG^XMJML($P(XMREC,U,1),$P(XMREC,U,2),XMKZ,$P(XMREC,U,3),XMDETAIL,.XMLEN)
48 F S XMKZ=$O(^TMP("XM",$J,"MSG",XMKZ)) Q:XMKZ="" D Q:$Y>XMPMAX
49 . S XMREC=^TMP("XM",$J,"MSG",XMKZ)
50 . D LISTMSG^XMJML($P(XMREC,U,1),$P(XMREC,U,2),XMKZ,$P(XMREC,U,3),XMDETAIL,.XMLEN)
51 Q:$Y>XMPMAX!'XMMORE
52 ; File screen ^DD(3.9,0,"SCR") insists that user be author or recipient.
53 ; If FLAGS["U", then file screen is ignored.
54 D LIST^DIC(3.9,"","@",XMFLAGS,XMPMAX-$Y+1,.XMFROM,XMSTRING,"",XMSCREEN)
55 S:$P(^TMP("DILIST",$J,0),U,3)=0 XMMORE=0
56 D LISTMSG(XMDUZ,XMDETAIL,.XMCNT,.XMLEN)
57 S XMKZ=XMCNT
58 K ^TMP("DILIST",$J)
59 W:'XMMORE !,$$EZBLD^DIALOG(34402) ; Search finished.
60 Q
61LISTMSG(XMDUZ,XMDETAIL,XMCNT,XMLEN) ; Check and List
62 N XMK,XMKN,XMZ,I
63 S I=""
64 F S I=$O(^TMP("DILIST",$J,2,I),XMV("ORDER")) Q:I'>0 D
65 . S XMCNT=XMCNT+1
66 . S XMZ=^TMP("DILIST",$J,2,I)
67 . S XMK=+$O(^XMB(3.7,"M",XMZ,XMDUZ,0))
68 . S XMKN=$S(XMK:$P(^XMB(3.7,XMDUZ,2,XMK,0),U),1:$$EZBLD^DIALOG(34014)) ; * N/A *
69 . I XMK,'$D(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)) D ADDITM^XMUT4A(XMDUZ,XMK,XMZ)
70 . D LISTMSG^XMJML(XMK,XMKN,XMCNT,XMZ,XMDETAIL,.XMLEN)
71 . S ^TMP("XM",$J,"MSG",XMCNT)=XMK_U_XMKN_U_XMZ
72 Q
73READMSG ; (XMDUZ,XMKZ,XMREC) <- needed!
74 N XMK,XMKN,XMZ,XMRDR ; $G(XMRDR) is checked in READMSG^XMJBM
75 S XMK=$P(XMREC,U,1),XMKN=$P(XMREC,U,2),XMZ=$P(XMREC,U,3)
76 I XMDUZ=.5,'XMK,'$$ACCESS^XMXSEC(XMDUZ,XMZ,$G(^XMB(3.9,XMZ,0))) D Q
77 . D SHOW^XMJERR
78 . D WAIT^XMXUTIL
79 D READMSG^XMJBM(XMDUZ,XMK,XMKN,XMZ)
80 Q:$D(^XMB(3.7,"M",XMZ,XMDUZ,XMK))
81 S XMK=+$O(^XMB(3.7,"M",XMZ,XMDUZ,0))
82 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 *
83 Q
Note: See TracBrowser for help on using the repository browser.