source: WorldVistAEHR/trunk/r/MAILMAN-XM/XMJML.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.4 KB
RevLine 
[613]1XMJML ;ISC-SF/GMB-List messages in basket (can't read) ;04/17/2002 10:03
2 ;;8.0;MailMan;;Jun 28, 2002
3 ; Replaces 1^XMAL0 (ISC-WASH/THM/CAP)
4LIST(XMDUZ,XMK,XMKN,XMKZ,XMDETAIL) ; List messages in one basket
5 ; (This routine does NOT let the user read the messages.)
6 ; XMDETAIL 0=Summary; 1=Detailed
7 N XMLEN,XMORDER,XMHDLINE,XMABORT
8 I XMDUZ=.5,XMK>999 S XMORDER=XMV("ORDER"),XMV("ORDER")=1
9 S XMABORT=0
10 D INIT(XMDUZ,XMK,XMKN,XMDETAIL,.XMLEN,1)
11 S XMHDLINE=$$HEADLINE(XMDUZ,XMK,XMKN)
12 D HEADER(XMDETAIL,.XMLEN,XMHDLINE)
13 S:XMKZ'="" XMKZ=XMKZ-XMV("ORDER")
14 F S XMKZ=$O(^XMB(3.7,XMDUZ,2,XMK,1,"C",XMKZ),XMV("ORDER")) Q:XMKZ="" D Q:XMABORT
15 . S XMZ=$O(^XMB(3.7,XMDUZ,2,XMK,1,"C",XMKZ,""))
16 . I '$D(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)) D ADDITC^XMUT4A(XMDUZ,XMK,XMZ,XMKZ)
17 . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
18 . I $Y+4>IOSL D PAGE^XMXUTIL(.XMABORT) Q:XMABORT D
19 . . D HEADER(XMDETAIL,.XMLEN,XMHDLINE)
20 . D LISTMSG(XMK,XMKN,XMKZ,XMZ,XMDETAIL,.XMLEN)
21 I $D(XMORDER) S XMV("ORDER")=XMORDER
22 Q
23LISTNEW(XMDUZ,XMK,XMKN) ; List new messages in one basket
24 ; (This routine does NOT let the user read the messages.)
25 ; XMDETAIL 0=Summary; 1=Detailed
26 I '$O(^XMB(3.7,XMDUZ,"N0",XMK,0)) D Q
27 . I $P(^XMB(3.7,XMDUZ,2,XMK,0),U,2) S $P(^(0),U,2)=0
28 . W !!,$C(7),$$EZBLD^DIALOG(34013),! ;No NEW messages
29 N XMKZ,XMZ,XMLEN,XMDETAIL,XMTYPE,XMHDLINE,XMABORT
30 S XMDETAIL=1,XMTYPE="N0",XMABORT=0
31 D INIT(XMDUZ,XMK,XMKN,XMDETAIL,.XMLEN,1)
32 S XMHDLINE=$$HEADLINE^XMJMLN(XMDUZ,0,XMK,XMKN,XMTYPE)
33 D HEADER(XMDETAIL,.XMLEN,XMHDLINE)
34 S XMZ=""
35 F S XMZ=$O(^XMB(3.7,XMDUZ,XMTYPE,XMK,XMZ),XMV("ORDER")) Q:XMZ="" D Q:XMABORT
36 . S XMKZ=$P($G(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)),U,2)
37 . I 'XMKZ D
38 . . D ADDITN^XMUT4A(XMDUZ,XMTYPE,XMK,XMZ)
39 . . S XMKZ=$P($G(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)),U,2)
40 . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
41 . I $Y+4>IOSL D PAGE^XMXUTIL(.XMABORT) Q:XMABORT D
42 . . D HEADER(XMDETAIL,.XMLEN,XMHDLINE)
43 . D LISTMSG(XMK,XMKN,XMKZ,XMZ,XMDETAIL,.XMLEN)
44 Q
45LISTPRI(XMDUZ) ; List priority messages in all baskets (Replaces PRIO^XMAL0)
46 ; (This routine does NOT let the user read the messages.)
47 ; XMDETAIL 0=Summary; 1=Detailed
48 N XMK,XMKN,XMKZ,XMZ,XMLEN,XMDETAIL,XMTYPE,XMHDLINE,XMABORT
49 S XMDETAIL=1,XMTYPE="N",XMABORT=0
50 D INIT^XMJMLN(XMDUZ,XMTYPE,XMDETAIL,1,.XMLEN)
51 S XMHDLINE=$$HEADLINE^XMJMLN(XMDUZ,1,"","",XMTYPE)
52 D HEADER(XMDETAIL,.XMLEN,XMHDLINE)
53 S XMK=""
54 F S XMK=$O(^XMB(3.7,XMDUZ,XMTYPE,XMK)) Q:XMK="" D Q:XMABORT
55 . S XMZ="",XMKN=$P(^XMB(3.7,XMDUZ,2,XMK,0),U,1)
56 . F S XMZ=$O(^XMB(3.7,XMDUZ,XMTYPE,XMK,XMZ),XMV("ORDER")) Q:XMZ="" D Q:XMABORT
57 . . S XMKZ=$P($G(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)),U,2)
58 . . I 'XMKZ D
59 . . . D ADDITN^XMUT4A(XMDUZ,XMTYPE,XMK,XMZ)
60 . . . S XMKZ=$P($G(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)),U,2)
61 . . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
62 . . I $Y+4>IOSL D PAGE^XMXUTIL(.XMABORT) Q:XMABORT D
63 . . . D HEADER(XMDETAIL,.XMLEN,XMHDLINE)
64 . . D LISTMSG(XMK,XMKN,XMKZ,XMZ,XMDETAIL,.XMLEN)
65 Q
66INIT(XMDUZ,XMK,XMKN,XMDETAIL,XMLEN,XMONE) ;
67 N XMLEFT
68 S XMLEFT=79
69 I XMDETAIL D
70 . S XMLEN("XMZ")=$L($O(^XMB(3.9,":"),-1))+2
71 . ;S XMLEN("XMZ")=$L($O(^XMB(3.7,XMDUZ,2,XMK,1,":"),-1))+2
72 . S XMLEN("LINE")=5
73 . I '$G(XMONE),'$D(XMLEN("BSKT")) S XMLEN("BSKT")=$$MIN^XLFMTH($L(XMKN),10)
74 . S XMLEN("RESP")=9
75 . S XMLEN("DATE")=$L($$MMDT^XMXUTIL1(DT))
76 . S XMLEFT=XMLEFT-XMLEN("XMZ")-XMLEN("LINE")-$G(XMLEN("BSKT"))-XMLEN("RESP")-XMLEN("DATE")-3+$S($G(XMLEN("BSKT")):0,1:1)
77 S:'$D(XMLEN("XMKZ")) XMLEN("XMKZ")=$L($O(^XMB(3.7,XMDUZ,2,XMK,1,"C",""),-1))
78 S XMLEFT=XMLEFT-XMLEN("XMKZ")-5
79 S XMLEN("SUBJ")=XMLEFT*2\3
80 S XMLEN("FROM")=XMLEFT-XMLEN("SUBJ")
81 Q
82LISTMSG(XMK,XMKN,XMKZ,XMZ,XMDETAIL,XMLEN) ;
83 N XMZREC
84 S XMZREC=$G(^XMB(3.9,XMZ,0))
85 I XMDUZ=.5,XMK>999 D
86 . N XMTPRI ; Transmit priority
87 . S XMTPRI=$P($G(^XMB(3.7,.5,2,XMK,1,XMZ,0)),U,6)
88 . W !,$S($D(^TMP("XM",$J,".",XMKZ)):">",1:" "),$S('XMTPRI:" ",XMTPRI=1:"^",1:"v"),$J(XMKZ,XMLEN("XMKZ")),". "
89 E W !,$S($D(^TMP("XM",$J,".",XMKZ)):">",1:" "),$S('$D(^XMB(3.7,XMDUZ,"N0",XMK,XMZ)):" ",$P(XMZREC,U,7)["P":"!",1:"*"),$J(XMKZ,XMLEN("XMKZ")),". "
90 I XMDETAIL D
91 . W:$D(XMLEN("BSKT")) $$LJ^XLFSTR($E(XMKN,1,XMLEN("BSKT")),XMLEN("BSKT"))," "
92 . W $J("["_XMZ_"]",XMLEN("XMZ"))," ",$$DATE^XMXUTIL2(XMZREC,0)
93 . W " ",$$MELD^XMXUTIL1($$SUBJ^XMXUTIL2(XMZREC),$$LINES(XMZ),XMLEN("SUBJ")+XMLEN("LINE"))
94 . W " ",$$MELD^XMXUTIL1($$NAME^XMXUTIL($P(XMZREC,U,2)),$$RESPONSE(XMDUZ,XMK,XMZ),XMLEN("FROM")+9)
95 E D
96 . W $$LJ^XLFSTR($E($$SUBJ^XMXUTIL2(XMZREC),1,XMLEN("SUBJ")),XMLEN("SUBJ"))," ",$E($$NAME^XMXUTIL($P(XMZREC,U,2)),1,XMLEN("FROM"))
97 Q
98HEADLINE(XMDUZ,XMK,XMKN) ;
99 N XMNEWCNT,XMCNT
100 S XMNEWCNT=$P(^XMB(3.7,XMDUZ,2,XMK,0),U,2)
101 S XMCNT=$P(^XMB(3.7,XMDUZ,2,XMK,1,0),U,4)
102 ;Basket / messages / message / new
103 Q XMKN_" "_$$EZBLD^DIALOG(34011)_", "_XMCNT_$S(XMCNT>1:$$EZBLD^DIALOG(34007.1)_" ("_$O(^XMB(3.7,XMDUZ,2,XMK,1,"C",0))_"-"_$O(^(""),-1)_")",1:$$EZBLD^DIALOG(34007))_$S(XMNEWCNT:", "_XMNEWCNT_$$EZBLD^DIALOG(34008),1:"")
104HEADER(XMDETAIL,XMLEN,XMHDLINE) ;
105 I $D(XMHDLINE) W @IOF,XMHDLINE,!
106 E W @IOF
107 I XMDETAIL D
108 . W $$LJ^XLFSTR($$EZBLD^DIALOG(34001),XMLEN("XMZ")+$G(XMLEN("BSKT"),-1)+XMLEN("XMKZ")+XMLEN("DATE")+7,".") ;*=New/!=Priority
109 . W $$COMBO($$EZBLD^DIALOG(34002),$$EZBLD^DIALOG(34003.1),XMLEN("SUBJ")+XMLEN("LINE")) ;Subject / Lines
110 . W "."
111 . W $$COMBO($$EZBLD^DIALOG(34006),$$EZBLD^DIALOG(34004),XMLEN("FROM")+XMLEN("RESP")) ;From / Read/Rcvd
112 E D
113 . W $$LJ^XLFSTR($$EZBLD^DIALOG(34005),79-XMLEN("FROM"),"."),$$LJ^XLFSTR($$EZBLD^DIALOG(34006),XMLEN("FROM"),".") ;*=New/!=Priority.......Subject / From
114 Q
115COMBO(XMSTR1,XMSTR2,XMLEN) ;
116 Q $$LJ^XLFSTR($E(XMSTR1,1,XMLEN-$L(XMSTR2)-1),XMLEN-$L(XMSTR2),".")_XMSTR2
117LINES(XMZ) ;
118 Q +$P($G(^XMB(3.9,XMZ,2,0)),U,4)
119RESPONSE(XMDUZ,XMK,XMZ) ;
120 I XMDUZ=.5,XMK>999 Q ""
121 N XMPTR,XMRESP,XMRESPS
122 S XMRESPS=+$P($G(^XMB(3.9,XMZ,3,0)),U,4)
123 I XMRESPS=0 Q ""
124 ;S XMPTR=$O(^XMB(3.9,XMZ,1,"C",$S(XMDUZ=.6:DUZ,1:XMDUZ),0))
125 S XMPTR=+$O(^XMB(3.9,XMZ,1,"C",XMDUZ,0))
126 S XMRESP=+$P($G(^XMB(3.9,XMZ,1,XMPTR,0)),U,2)
127 Q XMRESP_"/"_XMRESPS
128LISTTMP ; List messages in ^TMP global
129 ; (This routine does NOT let the user read the messages.)
130 ; The following variables are expected to exist:
131 ; XMDETAIL 0=Summary; 1=Detailed
132 ; XMLEN
133 N XMK,XMKN,XMKZ,XMZ,XMABORT,XMREC
134 S XMABORT=0
135 D HEADER(XMDETAIL,.XMLEN)
136 S XMKZ=0
137 F S XMKZ=$O(^TMP("XM",$J,"MSG",XMKZ)) Q:XMKZ="" D Q:XMABORT
138 . I $Y+4>IOSL D PAGE^XMXUTIL(.XMABORT) Q:XMABORT D
139 . . D HEADER(XMDETAIL,.XMLEN)
140 . S XMREC=^TMP("XM",$J,"MSG",XMKZ)
141 . S XMK=$P(XMREC,U,1),XMKN=$P(XMREC,U,2),XMZ=$P(XMREC,U,3)
142 . D LISTMSG(XMK,XMKN,XMKZ,XMZ,XMDETAIL,.XMLEN)
143 Q
Note: See TracBrowser for help on using the repository browser.