source: WorldVistAEHR/trunk/r/MAILMAN-XM/XMCQH.m@ 1150

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

initial load of WorldVistAEHR

File size: 4.1 KB
Line 
1XMCQH ;ISC-SF/GMB-Transmit Queue History ;01/08/2003 13:52
2 ;;8.0;MailMan;**8,14**;Jun 28, 2002
3 ; Was (WASH ISC)/CAP/AML/RJ
4 ;
5 ; Entry points used by MailMan options (not covered by DBIA):
6 ; ENTER XMQHIST (was ^XMS4)
7ENTER ;
8 N XMPARM,XMABORT
9 S XMABORT=0
10 D INIT(.XMPARM,.XMABORT) Q:XMABORT
11 S ZTSAVE("XMPARM(")=""
12 D EN^XUTMDEVQ("ENT^XMCQH",$$EZBLD^DIALOG(42100),.ZTSAVE) ; MailMan: Transmission Queue History Report
13 Q
14INIT(XMPARM,XMABORT) ; Get period to report on. Default is current month.
15 S (XMPARM("START"),XMPARM("END"))=$E(DT,1,5)
16 Q:$D(ZTQUEUED)
17 D START(.XMPARM,.XMABORT) Q:XMABORT
18 D END(.XMPARM,.XMABORT)
19 Q
20START(XMPARM,XMABORT) ; Start of report period
21 N DIR,Y,X
22 S DIR(0)="DO^:DT:E"
23 S DIR("A")=$$EZBLD^DIALOG(42107) ; Start of report period
24 D BLD^DIALOG(42107.1,"","","DIR(""?"")")
25 ;Enter a month and year or just a year. Any day will be ignored.
26 ;This is the start of the period you want reported. The report will
27 ;start on the first day of the period you enter.
28 S DIR("B")=$$FMTE^XLFDT(XMPARM("START")_"00")
29 D ^DIR I $D(DUOUT)!$D(DTOUT) S XMABORT=1 Q
30 S XMPARM("START")=$E(Y,1,5)
31 Q
32END(XMPARM,XMABORT) ; End of report period
33 S XMPARM("END")=XMPARM("START")
34 Q:$E(XMPARM("START"),1,5)=$E(DT,1,5) ; This month
35 Q:XMPARM("START")=($E(DT,1,3)_"00") ; This year
36 N DIR,Y,X,XMDT
37 S XMDT=XMPARM("START")
38 S:$E(XMDT,4,5)="00" XMDT=$E(XMDT,1,3)_"01"
39 S DIR(0)="DO^"_XMDT_"01:DT:E"
40 S DIR("A")=$$EZBLD^DIALOG(42108) ; End of report period
41 D BLD^DIALOG(42108.1,"","","DIR(""?"")")
42 ;Enter a month and year or just a year. Press enter to accept the default.
43 ;This is the end of the period you want reported. The report will go
44 ;through the last day of the period you enter.
45 I $E(XMPARM("END"),4,5)="00" S XMPARM("END")=$E(XMPARM("END"),1,3)_"1200"
46 E S XMPARM("END")=$$SCH^XLFDT("1M(L)",XMPARM("END")_"01")
47 S DIR("B")=$$FMTE^XLFDT(XMPARM("END"))
48 D ^DIR I $D(DUOUT)!$D(DTOUT) S XMABORT=1 Q
49 S XMPARM("END")=$E(Y,1,5)
50 Q
51ENT ;
52 N XMNAME,XMRPT,XMIEN,XMREC,XMABORT,XMQD,XMCNT,XMTITLE,XMMON,XMSENT,XMRCVD
53 ;Transmission Queue History
54 ;Domain Queued Sent Rcvd Domain Queued Sent Rcvd
55 I $E(XMPARM("END"),4,5)'="00",$E(XMPARM("START"),4,5)="00" D
56 . I $E(XMPARM("END"),4,5)=12 S XMPARM("END")=XMPARM("START") Q
57 . S $E(XMPARM("START"),4,5)="01"
58 I $E(XMPARM("END"),4,5)="00",$E(XMPARM("START"),4,5)'="00" D
59 . I $E(XMPARM("END"),1,3)=$E(DT,1,3) S XMPARM("END")=$E(DT,1,5) Q
60 . S $E(XMPARM("END"),4,5)=12
61 I XMPARM("START")=XMPARM("END") D
62 . S XMTITLE=$$EZBLD^DIALOG(42101,$$FMTE^XLFDT(XMPARM("START")_"00")) ;Transmission Queue History, |1|
63 E D
64 . N XMP S XMP(1)=$$FMTE^XLFDT(XMPARM("START")_"00"),XMP(2)=$$FMTE^XLFDT(XMPARM("END")_"00")
65 . S XMTITLE=$$EZBLD^DIALOG(42101.1,.XMP) ;Transmission Queue History, |1| - |2|
66 D INIT^XMCQA(.XMRPT,XMTITLE,42102)
67 I $E(XMPARM("END"),4,5)="00" S XMPARM("END")=$E(XMPARM("END"),1,3)_"12"
68 S XMNAME="",(XMCNT,XMABORT,XMCNT("SENT"),XMCNT("RCVD"),XMCNT("QD"))=0
69 F S XMNAME=$O(^DIC(4.2,"B",XMNAME)) Q:XMNAME="" D Q:XMABORT
70 . S XMIEN=""
71 . F S XMIEN=$O(^DIC(4.2,"B",XMNAME,XMIEN)) Q:'XMIEN D Q:XMABORT
72 . . S (XMSENT,XMRCVD)=0
73 . . S XMMON=XMPARM("START")-.01
74 . . F S XMMON=$O(^XMBS(4.2999,XMIEN,100,XMMON)) Q:XMMON>XMPARM("END")!'XMMON D
75 . . . S XMREC=$G(^XMBS(4.2999,XMIEN,100,XMMON,0))
76 . . . S XMSENT=XMSENT+$P(XMREC,U,2),XMRCVD=XMRCVD+$P(XMREC,U,3)
77 . . S XMQD=$$BMSGCT^XMXUTIL(.5,XMIEN+1000)
78 . . I 'XMQD,'XMSENT,'XMRCVD Q
79 . . S XMCNT("SENT")=XMCNT("SENT")+XMSENT
80 . . S XMCNT("RCVD")=XMCNT("RCVD")+XMRCVD
81 . . S XMCNT("QD")=XMCNT("QD")+XMQD
82 . . S XMCNT=XMCNT+1
83 . . I XMCNT#2 D Q:XMABORT
84 . . . I $Y+3>IOSL D Q:XMABORT
85 . . . . D PAGE^XMCQA(.XMABORT) Q:XMABORT
86 . . . . D HDR^XMCQA(.XMRPT)
87 . . . W !
88 . . E W " "
89 . . W $$MELD^XMXUTIL1(XMNAME,XMQD,22),$J(XMSENT,8),$J(XMRCVD,8)
90 Q:XMABORT
91 I $Y+7>IOSL D Q:XMABORT
92 . D PAGE^XMCQA(.XMABORT)
93 . D HDR^XMCQA(.XMRPT)
94 W !!,$$MELD^XMXUTIL1($$EZBLD^DIALOG(42103),XMCNT,27) ; Total Domains:
95 W !,$$MELD^XMXUTIL1($$EZBLD^DIALOG(42104),XMCNT("QD"),27) ; Total Queued:
96 W !,$$MELD^XMXUTIL1($$EZBLD^DIALOG(42105),XMCNT("SENT"),27) ; Total Sent:
97 W !,$$MELD^XMXUTIL1($$EZBLD^DIALOG(42106),XMCNT("RCVD"),27) ; Total Received:
98 I $D(ZTQUEUED) S ZTREQ="@"
99 Q
Note: See TracBrowser for help on using the repository browser.