source: GuiMail/trunk/p/CWMAILF.m@ 1154

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

version 2.3 of GuiMail

File size: 2.8 KB
Line 
1CWMAILF ;INDPLS/PLS- DELPHI VISTA MAIL SERVER CONT'D ;21-Jun-2005 06:34;CLC
2 ;;2.3;CWMAIL;;Jul 19, 2005
3 ;MODIFIED FOR XM*7.1*50
4 Q ;ROUTINE CAN'T BE CALLED DIRECTLY
5BLDLST(CWDATA,CWDATSRC,CWDCNT) ; build list of messages - called by CWMAILA
6 ;Input: CWDATA - pass by reference
7 ; CWDATSRC - $NA containing data
8 ; CWDCNT - node counter
9 ;Return: CWDATA array
10 ;CWARY format: piece value
11 ; 1 message basket
12 ; 2 message ien
13 ; 3 message subject
14 ; 4 message date sent
15 ; 5 not used
16 ; 6 message type
17 ; 7 confirmation flag
18 ; 8 closed flag
19 ; 9 info flag
20 ; 10 confidential flag
21 ; 11 sender ien
22 ; 12 broadcast flag
23 ; 13 sender name
24 ; 14 total # of recipients
25 ; 15 total # of replies
26 ; 16 priority flag
27 ; 17 last response read
28 ; 18 message basket sequence number
29 ; 19 new message flag
30 ; 20 answer message flag
31 ;
32 S CWDATA(1)="0^AN ERROR HAS OCCURRED"
33 N CWVAL,CWMSG,CWMSGSUB,CWMSGDT,CWMAIB,CWMSGBX,CWMSGLP
34 N CWARY
35 S CWMSG=0,CWDCNT=2,CWMSGLP=0
36 ;CALL API TO RETRIEVE MESSAGES
37 F S CWMSGLP=$O(@CWDATSRC@(CWMSGLP)) Q:CWMSGLP<1 D
38 . S CWARY(1)=+$G(@CWDATSRC@(CWMSGLP,"BSKT"))
39 . S CWARY(2)=+$G(@CWDATSRC@(CWMSGLP))
40 . S CWARY(3)=$G(@CWDATSRC@(CWMSGLP,"SUBJ"))
41 . S CWARY(4)=$P($G(@CWDATSRC@(CWMSGLP,"DATE")),U)
42 . I CWARY(4)?1.N1".".N S CWARY(4)=$$FMDTE^CWMAIL4(CWARY(4),"5MZ")
43 . E S CWARY(4)=$$FMDTE^CWMAIL4($$CONVERT^XMXUTIL1(CWARY(4),1),"5MZ")
44 . S CWARY(18)=$G(@CWDATSRC@(CWMSGLP,"SEQN"))
45 . S CWARY(19)=+$G(@CWDATSRC@(CWMSGLP,"NEW"))
46 . S CWDATA(CWDCNT)=$$ADDMP^CWMAIL0(CWARY(2),.CWARY)
47 . S CWDCNT=CWDCNT+1
48 Q
49 ;
50%MSGISRC(CWDATA,CWINPUT) ;SEARCH FOR A PARTICULAR MESSAGE NUMBER
51 ;CWINPUT - IEN of Message
52 N CWI,CWMIEN,CWDATT,CWDCNT
53 K CWDATA
54 S CWDCNT=2
55 S CWMIEN=+$P($G(CWINPUT),";")
56 I $$ACCESS^XMXSEC(XMDUZ,CWMIEN) D
57 . D MSGINIT(CWMIEN,.CWDATT)
58 . D BLDLST(.CWDATA,$NA(CWDATT),.CWDCNT)
59 . ;S CWDATA(1)="1^^DATA HAS BEEN FOUND"
60 ;E S CWDATA(1)="1^^Message not found or you don't have access to it."
61 I $O(CWDATA(1)) S CWDATA(1)="1^^DATA HAS BEEN FOUND"
62 E S CWDATA(1)="1^^Message not found or you lack access to it."
63 S $P(CWDATA(1),U,2)=CWDCNT-2
64MSGISRCE Q
65 ;
66MSGINIT(CWMIEN,CWDATT) ;Individual Message Pre-processor
67 N CWIM,CWINSTR,CWIU
68 D INMSG^XMXUTIL2(XMDUZ,"",CWMIEN,,,.CWIM,.CWINSTR,.CWIU)
69 S CWDATT(1)=CWMIEN
70 S CWDATT(1,"DATE")=$G(CWIM("DATE"))
71 S CWDATT(1,"SUBJ")=$G(CWIM("SUBJ"))
72 S CWDATT(1,"SEQN")=""
73 S CWDATT(1,"BSKT")=$$BSKT^XMXUTIL2(XMDUZ,CWMIEN,1)
74 S CWDATT(1,"NEW")=$G(CWIU("NEW"))>0
75 Q
Note: See TracBrowser for help on using the repository browser.