source: GuiMail/trunk/p/CWMAIL1.m@ 1582

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

version 2.3 of GuiMail

File size: 3.1 KB
Line 
1CWMAIL1 ;INDPLS/PLS- GUI MAIL UTILITIES ;21-Jun-2005 06:34;CLC
2 ;;2.3;CWMAIL;;Jul 19, 2005
3 ;MODIFIED FOR XM*7.1*50
4LATER(CWXMZ,CWXMA) ;LATER A MESSAGE
5 S $ZT="LATERE^CWMAIL1"
6 N CWFLG,X,Y,%H,NOW,CWINSTR,CWXMMSG,CWTMDF
7 S CWFLG=0
8 G:'CWXMZ!('$G(CWXMA)) LATERE
9 ;S CWTMDF=$G(^XMB("TIMEDIFF")) ;get time diff for site
10 ;I CWXMA[":" D
11 ;. I '$L(CWTMDF) S CWXMA=$P(CWXMA," ") ;use date and not date/time
12 ;. E S CWXMA=CWXMA_" "_CWTMDF ;append time zone diff
13 S CWXMA=$$CONVERT^XMXUTIL1(CWXMA,$S(CWXMA[":":1,1:0)) ;convert to fileman date/time
14CK S NOW=$$NOW^XLFDT S CWXMA=$S(CWXMA>NOW:CWXMA,1:(NOW+.0010)) ;DEFAULT TO 10 MINUTES IN FUTURE
15 I CWXMA>0 D
16 . S CWINSTR("LATER")=CWXMA
17 . D LATERMSG^XMXAPI(XMDUZ,"",CWXMZ,.CWINSTR,.CWXMMSG)
18 . I CWXMMSG S CWFLG=1
19LATERE ;
20 Q CWFLG
21 ;
22 ;
23NETINFO(CWDAT,XMZ) ;RETRIEVE NETWORK TRANMISSION INFORMATION
24 ;
25 K CWDAT
26 S CWDAT=$NA(^TMP($J,"CWMAIL"))
27 S $ZT="NETINFOE^CWMAIL1"
28 N CWLP,CWCNT
29 S CWLP=0,CWCNT=2
30 D QN^XMXUTIL3(XMZ,,,) ;DEFAULTS TO ALL LINES;START AT 0 AND SET TO ^TMP("XMLIST",$J)
31 F S CWLP=$O(^TMP("XMLIST",$J,CWLP)) Q:CWLP<1 D
32 . S @CWDAT@(CWCNT)=^TMP("XMLIST",$J,CWLP),CWCNT=CWCNT+1
33NETINFOE ;
34 I $O(@CWDAT@(1)) D
35 . S @CWDAT@(1)="1^^DATA HAS BEEN FOUND"
36 E S @CWDAT@(1)="1^^There was no Transmission Information available."
37 S $P(@CWDAT@(1),U,2)=CWCNT-2
38 Q
39 ;
40ADRSTO(CWDAT,XMZ) ;RETRIEVE ADDRESSED TO INFO
41 ;
42 K CWDAT
43 S CWDAT=$NA(^TMP($J,"CWMAIL"))
44 N CWLP,CWCNT
45 S CWLP=0,CWCNT=2
46 D Q^XMXUTIL3(XMZ) ;DEFAULTS TO ALL LINES;START AT 0 AND SET TO ^TMP("XMLIST",$J)
47 F S CWLP=$O(^TMP("XMLIST",$J,CWLP)) Q:CWLP<1 D
48 . S @CWDAT@(CWCNT)=$G(^TMP("XMLIST",$J,CWLP,"TO NAME")),CWCNT=CWCNT+1
49 I $O(@CWDAT@(1)) D
50 . S @CWDAT@(1)="1^^DATA HAS BEEN FOUND"
51 E S @CWDAT@(1)="1^^There was no ADDRESSED TO recipients found."
52 S $P(@CWDAT@(1),U,2)=CWCNT-2
53ADRSTOE Q
54 ;
55RECPT(CWDAT,XMZ) ;BUILD RECIPIENT LIST
56 K CWDAT
57 S CWDAT=$NA(^TMP($J,"CWMAIL"))
58 N CWLP,CWCNT,CWIM,CWIU,CWINSTR
59 N CWRECPT,CWLR,CWLRSPRD,CWFR,CWFWD,CWTERM,CWRMI,CWNTT,CWSNT
60 S CWLP=0,CWCNT=2
61 D QD^XMXUTIL3(XMZ) ;
62 F S CWLP=$O(^TMP("XMLIST",$J,CWLP)) Q:CWLP<1 D
63 . S CWRECPT=$G(^TMP("XMLIST",$J,CWLP,"TO NAME")) ;recipient name
64 . S CWLR=$$FMDTE^CWMAIL4($G(^("LREAD")),"5MZ") ;last read date/time
65 . S CWLRSPRD=$G(^("RESP")) ;last response read
66 . S CWFR=$$FMDTE^CWMAIL4($G(^("FREAD")),"5MZ") ;first read date/time
67 . S CWFWD=$S($D(^("FWD ON")):"*",1:"") ;forwarded message
68 . S CWTERM=$S($D(^("TERM")):"*",1:"") ;terminated message
69 . S CWRMI=$G(^("ID")) ;remote message id
70 . S CWNTT=$G(^("SECS")) ;network trans time
71 . S CWSNT=$$FMDTE^CWMAIL4($G(^("XDATE")),"5MZ") ;network sent date/time
72 . S @CWDAT@(CWCNT)=U_CWRECPT_U_CWLR_U_CWFR_U_CWFWD_U_CWTERM_U_CWRMI_U_CWNTT_U_CWSNT_U_CWLRSPRD_U
73 . S CWCNT=CWCNT+1
74 D INMSG1^XMXUTIL2(XMDUZ,XMZ,,"F",.CWIM,.CWIU) ;retrieve total recipients
75 D INMSG2^XMXUTIL2(XMDUZ,XMZ,,.CWIM,.CWINSTR,.CWIU) ;and responses.
76RECPTE I $O(@CWDAT@(1)) D
77 . S @CWDAT@(1)="1^^DATA HAS BEEN FOUND"_U_+$G(CWIM("RECIPS"))_U_+$G(CWIM("RESPS"))
78 E S @CWDAT@(1)="1^^There were no recipients found."_U_0_U_0
79 S $P(@CWDAT@(1),U,2)=CWCNT-2
80 Q
Note: See TracBrowser for help on using the repository browser.