source: WorldVistAEHR/trunk/r/MAILMAN-XM/XMUT5.m@ 1042

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1XMUT5 ;ISC-SF/GMB-Check Background Filer (local delivery queues) ;02/12/2003 07:42
2 ;;8.0;MailMan;**10,2**;Jun 28, 2002
3 ;(WASH ISC)/CAP
4 ;
5 ; Entry points used by MailMan options (not covered by DBIA):
6 ; CHECK XMMGR-CHECK-BACKGROUND-FILER
7CHECK ;
8 N XMTEXT
9 ;* Latest Delivery shows last user with message in mailbox.
10 ;Meaningful for new messages, possibly meaningful for (f) forwarded messages.
11 ;Not meaningful and not shown for responses.
12 D BLD^DIALOG(36222,"","","XMTEXT(""*"")","F")
13 D BLD^DIALOG(36219,"","","XMTEXT(""M"")","F")
14 D BLD^DIALOG(36220,"","","XMTEXT(""R"")","F")
15 I $D(ZTQUEUED)!($E($G(IOST),1,2)'="C-") D DISPLAY Q
16 F D DISPLAY D Q:'(Y!$D(DTOUT))
17 . W !
18 . N DIR,X,DTIME
19 . S DTIME=5
20 . S DIR(0)="Y",DIR("A")=$$EZBLD^DIALOG(36210) ; Refresh
21 . S DIR("B")=$$EZBLD^DIALOG(39054) ; YES
22 . D BLD^DIALOG(36211,"","","DIR(""?"")")
23 . ;Answer YES if you want the display refreshed.
24 . ;Answer NO if you don't.
25 . ;If you don't answer, the display will be refreshed every five seconds.
26 . D ^DIR
27 Q
28DISPLAY ;
29 N XMQLIST,M,R,XMTSTAMP,XMPARM
30 W !!,$$EZBLD^DIALOG(36212,$$FMTE^XLFDT($$NOW^XLFDT,5)),! ; Delivery Queue Status as of
31 S M=$G(^XMBPOST("STATS","M")),R=$G(^("R"))
32 I M+R>0 D
33 . S XMPARM(1)=M+R,XMPARM(2)=M,XMPARM(3)=R
34 . W !,$$EZBLD^DIALOG(36213,.XMPARM) ; Deliveries COMPLETED since last 1/2 hour: _M+R_ (_M_ Msg, _R_ Resp)
35 D GO^XMUT5B
36 D GETQ^XMKPLQ(.XMQLIST)
37 S XMPARM(1)=$S(XMQLIST("M")="":1,1:$L(XMQLIST("M"),",")+1)
38 S XMPARM(2)=$S(XMQLIST("R")="":1,1:$L(XMQLIST("R"),",")+1)
39 W !,$$EZBLD^DIALOG(36214,.XMPARM) ; Number of delivery queues: |1| Message and |2| Response
40 S XMTSTAMP=$O(^XMBPOST("BOX",0))
41 I XMTSTAMP W !,$$EZBLD^DIALOG(36215,$$WAITIME(XMTSTAMP)) ; Waiting time for items to be put in the delivery queues:
42 E W !,$$EZBLD^DIALOG(36216) ; Nothing waiting to be put in the delivery queues.
43 I M("T")+R("T")<1 W !!,$$EZBLD^DIALOG(36217) ; Nothing in the delivery queues.
44 E D
45 . W !,$$EZBLD^DIALOG(36218,M("T")+R("T")) ; Items currently waiting in delivery queues:
46 . I M("T")>0 D SHOWQ("M",.M,XMQLIST("M"))
47 . I R("T")>0 D SHOWQ("R",.R,XMQLIST("R"))
48 . I M("T") D MSG^DIALOG("SWM","",80,"","XMTEXT(""*"")")
49 D SHOWFILR
50 Q
51SHOWQ(XMGROUP,Q,XMQLIST) ;
52 D MSG^DIALOG("SWM","",80,"","XMTEXT(XMGROUP)")
53 N I,XMCNT
54 S XMCNT=0
55 F I=1:1:10 I Q("O",I) D
56 . S XMCNT=XMCNT+1
57 . W !,$J(I,2)," ",$$QRANGE(XMQLIST,I)
58 . W ?17,$J(+Q("O",I),7),?27,$J($P(Q("O",I),U,3),8),?39,$J($$WAITIME($P(Q("O",I),U,2)),12),$J($P(Q("O",I),U,4),16),$J($P(Q("O",I),U,5),3),$J($P(Q("O",I),U,6),9)
59 I XMCNT>1 W !,?3,$$EZBLD^DIALOG(36221),?17,$J(+Q("T"),7),?27,$J($P(Q("T"),U,3),8),?39,$J($$WAITIME($P(Q("T"),U,2)),12) ; Summary
60 Q
61SHOWFILR ;
62 N XMSTATUS,I
63 D STATUS^XMKPL(.XMSTATUS)
64 W !!,$$EZBLD^DIALOG(36224) ; Background filer status:
65 I $D(XMSTATUS)<10 D
66 . W $$EZBLD^DIALOG(36225) ; ALL Background Delivery jobs are RUNNING.
67 E D
68 . I $P(^XMB(1,1,0),U,16) D
69 . . N XMTEXT ; The Background Filers have been shut down.
70 . . D BLD^DIALOG(36226,"","","XMTEXT","F")
71 . . D MSG^DIALOG("SWM","",80,"","XMTEXT")
72 . W !
73 . S I=""
74 . F S I=$O(XMSTATUS(I)) Q:I="" W !,XMSTATUS(I)
75 Q
76QRANGE(XMQLIST,I) ; Queue range
77 I XMQLIST="" Q "(...)"
78 I I=1 Q "<"_+XMQLIST
79 I I>$L(XMQLIST,",") Q $P(XMQLIST,",",I-1)_"+"
80 Q $P(XMQLIST,",",I-1)_"-"_($P(XMQLIST,",",I)-1)
81WAITIME(X) ;
82 N XMDIFF,XMWAIT
83 S XMDIFF=$$TSTAMP^XMXUTIL1-X
84 S XMWAIT=""
85 S:XMDIFF'<86400 XMWAIT=(XMDIFF\86400)_" "
86 S:XMDIFF#86400 XMWAIT=XMWAIT_(XMDIFF#86400\3600)_":"_$E(XMDIFF#3600\60+100,2,3)_":"_$E(XMDIFF#60+100,2,3)
87 Q XMWAIT
Note: See TracBrowser for help on using the repository browser.