source: GuiMail/trunk/p/CWMAILC.m@ 1139

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

version 2.3 of GuiMail

File size: 3.6 KB
Line 
1CWMAILC ;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
5 ;
6%LATER(CWDATA,CWINPUT) ;LATER A MESSAGE
7 ;CWINPUT - HOLDS MESSAGE NUMBER AND LATER DATE/TIME - DELIMITER ';'
8 ; 1st - IEN of message
9 ; 2nd - Later date
10 N XMZ,XMDUZ,XMA
11 S CWDATA(1)="0^^AN ERROR HAS OCCURRED"
12 S XMZ=$P(CWINPUT,";")
13 S XMDUZ=DUZ
14 S XMA=$P(CWINPUT,";",2)
15 G:'XMZ!('$G(XMA)) LATERE
16 I $$LATER^CWMAIL1(XMZ,XMA) D
17 .S CWDATA(1)="1^1^Message has been latered"
18 E S CWDATA(1)="0^0^Unable to Later Message Number: "_XMZ
19LATERE Q
20 ;
21%MBOX(CWDATA,CWINPUT) ;RETRIEVE MAILBOXES
22 ;CWINPUT NOT USED
23 ;VARIABLES : CWNMSG = NEW MESSAGES
24 ; CWTMSG = TOTAL MESSAGE COUNT
25 K ^TMP($J,"CWMBSKT")
26 D LISTBSKT^XMXAPIB(XMDUZ,,,,,"^TMP($J,""CWMBSKT"")")
27 N CWLP,CWLP1,CWCNT,CWNMSG,CWTMSG,CWFPES,CWHSN,CWBNAME,CWBIEN
28 S CWDATA(1)="0^^AN ERROR HAS OCCURRED",CWCNT=2
29 S CWLP=0 F S CWLP=$O(^TMP($J,"CWMBSKT","XMLIST",CWLP)) Q:CWLP="" D
30 . S CWBIEN=+$G(^TMP($J,"CWMBSKT","XMLIST",CWLP))
31 . I CWBIEN D
32 . . S CWDATA(CWCNT)=$G(^TMP($J,"CWMBSKT","XMLIST",CWLP))
33 . . S CWCNT=CWCNT+1
34 I $O(CWDATA(1)) S CWDATA(1)="1^^DATA HAS BEEN FOUND"
35 E S CWDATA(1)="1^^No Mail Boxes could be found"
36 S $P(CWDATA(1),U,2)=CWCNT-2
37MBOXE K ^TMP($J,"CWMBSKT")
38 Q
39%PMBOX(CWDATA,CWINPUT) ;PURGE ENTIRE MAIL BOX
40 ;CWINPUT = MAIL BOX IEN
41 N CWLP,XMZ,XMK,CWX,CWY,XMKZA,XMMSG,CWCNT
42 S XMK=$P(CWINPUT,";",2)
43 G PMBOXE:'XMK
44 S CWDATA(1)="0^^AN ERROR HAS OCCURRED",CWCNT=2
45 ;delete basket regardless of content
46 D DELBSKT^XMXAPIB(XMDUZ,XMK,"D")
47 S CWDATA(1)="1^1"
48 ;E S CWDATA(1)="0^0"
49PMBOXE Q
50%RNMBOX(CWDATA,CWINPUT) ;RENAME EXISTING MAILBOX
51 ;CWINPUT - DELIMITER ';'
52 ; 1st - IEN of mailbox
53 ; 2nd - New name of mailbox
54 D NAMEBSKT^XMXAPIB(XMDUZ,$P(CWINPUT,";"),$P(CWINPUT,";",2))
55 S CWDATA(1)="1^1^MAILBOX NAME WAS CHANGED" ;FORCE TO SUCCESS
56RNMBOXE Q
57%MSGRCP(CWDATA,CWINPUT) ; RETURNS A LIST OF MESSAGE RECIPIENTS
58 ;CWINPUT = IEN of message
59 N CWDAT,CWI,XMZ
60 K CWDATA
61 S XMZ=+$P($G(CWINPUT),";",2)
62 D RECPT^CWMAIL1(.CWDATA,XMZ)
63MSGRCPE Q
64%NETINFO(CWDATA,CWINPUT) ; RETURNS NETWORK TRANSMISSION INFO
65 ;INPUT - IEN of message
66 N CWDAT,CWI,XMZ
67 K CWDATA
68 S XMZ=+$P($G(CWINPUT),";",2)
69 D NETINFO^CWMAIL1(.CWDATA,XMZ)
70NETINFOE Q
71 ;
72%ADRSTO(CWDATA,CWINPUT) ;RETURNS ARRAY OF ADDRESSED TO
73 ;CWINPUT - IEN of message
74 N CWDAT,CWI,XMZ
75 K CWDATA
76 S XMZ=+$P($G(CWINPUT),";",2)
77 D ADRSTO^CWMAIL1(.CWDATA,XMZ)
78ADRSTOE Q
79%GRPINF(CWDATA,CWINPUT) ;MAIL GROUP INFO
80 ;CWINPUT - IEN of mail group
81 N CWDAT,CWI,XMZ
82 K CWDATA
83 S CWI=2
84 S CWIEN=+$P($G(CWINPUT),";",2)
85 I $$GRPINFO^CWMAIL3(.CWDAT,CWIEN) D
86 .S CWI=+$G(CWDAT(-9900)) K CWDAT(-9900)
87 .M CWDATA=CWDAT
88 .S CWDATA(1)="1^^DATA HAS BEEN FOUND"
89 E S CWDATA(1)="1^^There was no Mail Group information found."
90 S $P(CWDATA(1),U,2)=CWI-2
91GRPINFE Q
92%USRINF(CWDATA,CWINPUT) ;MAIL USER INFO
93 ;CWINPUT - IEN of mail user
94 N CWDAT,CWI,CWIEN
95 K CWDATA
96 S CWI=2
97 S CWIEN=+$P($G(CWINPUT),";",2)
98 ;G:'CWIEN USRINFE
99 I $$USRINFO^CWMAIL3(.CWDAT,CWIEN) D
100 .S CWI=+$G(CWDAT(-9900)) K CWDAT(-9900)
101 .M CWDATA=CWDAT
102 .S CWDATA(1)="1^^DATA HAS BEEN FOUND"
103 E S CWDATA(1)="1^^There was no Mail User information found."
104 S $P(CWDATA(1),U,2)=CWI-2
105USRINFE Q
106MBOXD(CWDAT,CWUSR,CWIEN) ;RETURN DATA FOR MAILBOX
107 ;API NOT CURRENTLY USED
108 ;INPUT CWDAT = RETURN ARRAY
109 ; CWIEN = MAILBASKET IEN TO 3.7 FOR USER
110 ;OUTPUT CWDAT("NAME")
111 ; CWDAT("TMSG")
112 ; CWDAT("NMSG")
113 ; CWDAT("IEN")
114 N CWDATT
115 D QBSKT^XMXAPIB(CWUSR,CWIEN,.CWDATT)
116 S CWDAT("IEN")=$P(CWDATT,U)
117 S CWDAT("NAME")=$P(CWDATT,U,2)
118 S CWDAT("TMSG")=+$P(CWDATT,U,3)
119 S CWDAT("NMSG")=+$P(CWDATT,U,4)
120 Q
Note: See TracBrowser for help on using the repository browser.