XMCXU ;ISC-SF/GMB- Select Domains/Scripts ;04/17/2002 08:43
;;8.0;MailMan;;Jun 28, 2002
ASK(XMINST,XMSITE,XMB,XMABORT,XMSCREEN,XMOKTYPE) ;
D ASKINST(.XMINST,.XMSITE,.XMABORT,.XMSCREEN) Q:XMABORT
D ASKSCR(XMINST,XMSITE,.XMB,.XMABORT,.XMOKTYPE)
Q
ASKINST(XMINST,XMSITE,XMABORT,XMSCREEN) ; Lookup domain, perhaps using screen
N DIC,X,Y,D,XMCX,XMCXC,XMCXM
S XMCXM=$$EZBLD^DIALOG(34007.2) ; msgs
S XMCXC=$$EZBLD^DIALOG(42281) ;* Closed *
S DIC=4.2,DIC(0)="AEQM",D="B^C"
S DIC("W")="S XMCX=($P(^(0),U,2)[""C"") W ?50,$J($$BMSGCT^XMXUTIL(.5,Y+1000),6),XMCXM W:XMCX ?65,XMCXC"
I $G(XMSCREEN)'="" D
. I $L(XMSCREEN)>1 S DIC("S")=XMSCREEN
. I XMSCREEN="M" D
. . N XMTEXT
. . W !
. . ;This option lets you select only those queues which have messages.
. . ;If you can't select a queue, it either doesn't exist or it has no messages.
. . D BLD^DIALOG(42282,"","","XMTEXT","F")
. . D MSG^DIALOG("WM","","","","XMTEXT")
. . W !
. . S DIC("S")="I $O(^XMB(3.7,.5,2,Y+1000,1,0))"
. . ;Select queue. Only queues with messages are shown.
. . D BLD^DIALOG(42283,"","","DIC(""?"")")
D MIX^DIC1 I Y=-1 S XMABORT=1 Q
S XMINST=+Y
S XMSITE=$P(Y,U,2)
Q
ASKSCR(XMINST,XMSITE,XMB,XMABORT,XMOKTYPE) ;
D SCRIPT^XMKPR1(XMINST,XMSITE,.XMB,.XMOKTYPE)
I 'XMB("SCR IEN") W !,$$EZBLD^DIALOG(42284) S XMABORT=1 Q ;No valid script for this domain!
D SCRIPT(XMINST,XMSITE,.XMB,.XMABORT) Q:XMABORT
Q
SCRIPT(XMINST,XMSITE,XMB,XMABORT) ; Ask user to select the script.
; List valid entries.
N I,XMREC,XMTEXT
W !
; # Script Name Type Priority
; -- ----------- ---- --------
D BLD^DIALOG(42285,"","","XMTEXT","F")
D MSG^DIALOG("WM","","","","XMTEXT")
S I=0
F S I=$O(^DIC(4.2,XMINST,1,I)) Q:'I S XMREC=^(I,0) W !,$J(I,3),?5,$P(XMREC,U),?30,$P(XMREC,U,4),?40,$J($P(XMREC,U,2),2) I $P(XMREC,U,7) W ?50,$$EZBLD^DIALOG(42286) ;* Out of Service *
W !
I $O(^DIC(4.2,XMINST,1,0))=XMB("SCR IEN"),+$O(^(XMB("SCR IEN")))=0 Q
N DIC,X,Y
S DIC="^DIC(4.2,XMINST,1,"
S DIC(0)="AEQMNZ"
S DIC("A")=$$EZBLD^DIALOG(42287) ;Select Script:
S DIC("B")=XMB("SCR IEN")
S DIC("W")="W ?30,$P(^(0),U,4),?40,$J($P(^(0),U,2),2) W:$P(^(0),U,7) ?60,$$EZBLD^DIALOG(42286)" ;* Out of Service *
D ^DIC I Y=-1 S XMABORT=1 Q
Q:+Y=XMB("SCR IEN")
S (XMB("SCR IEN"),XMB("FIRST SCRIPT"))=+Y
D INITSCR^XMKPR1(XMINST,XMSITE,.XMB)
Q
CHKTSK(XMINST,XMCHOOSE,XMABORT) ;
N XMTSK,XMTEXT,XMPARM
S XMTSK=$$TSKEXIST^XMKPR(XMINST) Q:'XMTSK
I +XMTSK=XMTSK D Q
. W !,$C(7) ;Task |1| is transmitting this domain's messages now.
. D BLD^DIALOG(42288,XMTSK,"","XMTEXT","F")
. D MSG^DIALOG("WM","","","","XMTEXT")
. S XMABORT=1
W !,$C(7) ;Task |1| is scheduled to transmit this domain's messages
;on |2|.
S XMPARM(1)=+XMTSK,XMPARM(2)=$$HTE^XLFDT($P(XMTSK,U,2),5)
D BLD^DIALOG(42288.1,.XMPARM,"","XMTEXT","F")
D MSG^DIALOG("WM","","","","XMTEXT")
S XMTSK=+XMTSK
N DIR,X,Y
S DIR(0)="Y",DIR("B")=$$EZBLD^DIALOG(39053) ;NO
D BLD^DIALOG($S(XMCHOOSE=1:42289,1:42289.1),XMTSK,"","DIR(""A"")")
;1: Do you want to kill task |1| and queue up a new one
;2: Do you want to kill task |1| before we play the script
D ^DIR I $D(DIRUT) S XMABORT=1 Q
I 'Y S:XMCHOOSE=1 XMABORT=1 Q
D KILLTSK^XMKPR(XMINST,XMTSK)
Q
XMCXU ;ISC-SF/GMB- Select Domains/Scripts ;04/17/2002 08:43
+1 ;;8.0;MailMan;;Jun 28, 2002
ASK(XMINST,XMSITE,XMB,XMABORT,XMSCREEN,XMOKTYPE) ;
+1 DO ASKINST(.XMINST,.XMSITE,.XMABORT,.XMSCREEN)
IF XMABORT
QUIT
+2 DO ASKSCR(XMINST,XMSITE,.XMB,.XMABORT,.XMOKTYPE)
+3 QUIT
ASKINST(XMINST,XMSITE,XMABORT,XMSCREEN) ; Lookup domain, perhaps using screen
+1 NEW DIC,X,Y,D,XMCX,XMCXC,XMCXM
+2 ; msgs
SET XMCXM=$$EZBLD^DIALOG(34007.2)
+3 ;* Closed *
SET XMCXC=$$EZBLD^DIALOG(42281)
+4 SET DIC=4.2
SET DIC(0)="AEQM"
SET D="B^C"
+5 SET DIC("W")="S XMCX=($P(^(0),U,2)[""C"") W ?50,$J($$BMSGCT^XMXUTIL(.5,Y+1000),6),XMCXM W:XMCX ?65,XMCXC"
+6 IF $GET(XMSCREEN)'=""
Begin DoDot:1
+7 IF $LENGTH(XMSCREEN)>1
SET DIC("S")=XMSCREEN
+8 IF XMSCREEN="M"
Begin DoDot:2
+9 NEW XMTEXT
+10 WRITE !
+11 ;This option lets you select only those queues which have messages.
+12 ;If you can't select a queue, it either doesn't exist or it has no messages.
+13 DO BLD^DIALOG(42282,"","","XMTEXT","F")
+14 DO MSG^DIALOG("WM","","","","XMTEXT")
+15 WRITE !
+16 SET DIC("S")="I $O(^XMB(3.7,.5,2,Y+1000,1,0))"
+17 ;Select queue. Only queues with messages are shown.
+18 DO BLD^DIALOG(42283,"","","DIC(""?"")")
End DoDot:2
End DoDot:1
+19 DO MIX^DIC1
IF Y=-1
SET XMABORT=1
QUIT
+20 SET XMINST=+Y
+21 SET XMSITE=$PIECE(Y,U,2)
+22 QUIT
ASKSCR(XMINST,XMSITE,XMB,XMABORT,XMOKTYPE) ;
+1 DO SCRIPT^XMKPR1(XMINST,XMSITE,.XMB,.XMOKTYPE)
+2 ;No valid script for this domain!
IF 'XMB("SCR IEN")
WRITE !,$$EZBLD^DIALOG(42284)
SET XMABORT=1
QUIT
+3 DO SCRIPT(XMINST,XMSITE,.XMB,.XMABORT)
IF XMABORT
QUIT
+4 QUIT
SCRIPT(XMINST,XMSITE,XMB,XMABORT) ; Ask user to select the script.
+1 ; List valid entries.
+2 NEW I,XMREC,XMTEXT
+3 WRITE !
+4 ; # Script Name Type Priority
+5 ; -- ----------- ---- --------
+6 DO BLD^DIALOG(42285,"","","XMTEXT","F")
+7 DO MSG^DIALOG("WM","","","","XMTEXT")
+8 SET I=0
+9 ;* Out of Service *
FOR
SET I=$ORDER(^DIC(4.2,XMINST,1,I))
IF 'I
QUIT
SET XMREC=^(I,0)
WRITE !,$JUSTIFY(I,3),?5,$PIECE(XMREC,U),?30,$PIECE(XMREC,U,4),?40,$JUSTIFY($PIECE(XMREC,U,2),2)
IF $PIECE(XMREC,U,7)
WRITE ?50,$$EZBLD^DIALOG(42286)
+10 WRITE !
+11 IF $ORDER(^DIC(4.2,XMINST,1,0))=XMB("SCR IEN")
IF +$ORDER(^(XMB("SCR IEN")))=0
QUIT
+12 NEW DIC,X,Y
+13 SET DIC="^DIC(4.2,XMINST,1,"
+14 SET DIC(0)="AEQMNZ"
+15 ;Select Script:
SET DIC("A")=$$EZBLD^DIALOG(42287)
+16 SET DIC("B")=XMB("SCR IEN")
+17 ;* Out of Service *
SET DIC("W")="W ?30,$P(^(0),U,4),?40,$J($P(^(0),U,2),2) W:$P(^(0),U,7) ?60,$$EZBLD^DIALOG(42286)"
+18 DO ^DIC
IF Y=-1
SET XMABORT=1
QUIT
+19 IF +Y=XMB("SCR IEN")
QUIT
+20 SET (XMB("SCR IEN"),XMB("FIRST SCRIPT"))=+Y
+21 DO INITSCR^XMKPR1(XMINST,XMSITE,.XMB)
+22 QUIT
CHKTSK(XMINST,XMCHOOSE,XMABORT) ;
+1 NEW XMTSK,XMTEXT,XMPARM
+2 SET XMTSK=$$TSKEXIST^XMKPR(XMINST)
IF 'XMTSK
QUIT
+3 IF +XMTSK=XMTSK
Begin DoDot:1
+4 ;Task |1| is transmitting this domain's messages now.
WRITE !,$CHAR(7)
+5 DO BLD^DIALOG(42288,XMTSK,"","XMTEXT","F")
+6 DO MSG^DIALOG("WM","","","","XMTEXT")
+7 SET XMABORT=1
End DoDot:1
QUIT
+8 ;Task |1| is scheduled to transmit this domain's messages
WRITE !,$CHAR(7)
+9 ;on |2|.
+10 SET XMPARM(1)=+XMTSK
SET XMPARM(2)=$$HTE^XLFDT($PIECE(XMTSK,U,2),5)
+11 DO BLD^DIALOG(42288.1,.XMPARM,"","XMTEXT","F")
+12 DO MSG^DIALOG("WM","","","","XMTEXT")
+13 SET XMTSK=+XMTSK
+14 NEW DIR,X,Y
+15 ;NO
SET DIR(0)="Y"
SET DIR("B")=$$EZBLD^DIALOG(39053)
+16 DO BLD^DIALOG($SELECT(XMCHOOSE=1:42289,1:42289.1),XMTSK,"","DIR(""A"")")
+17 ;1: Do you want to kill task |1| and queue up a new one
+18 ;2: Do you want to kill task |1| before we play the script
+19 DO ^DIR
IF $DATA(DIRUT)
SET XMABORT=1
QUIT
+20 IF 'Y
IF XMCHOOSE=1
SET XMABORT=1
QUIT
+21 DO KILLTSK^XMKPR(XMINST,XMTSK)
+22 QUIT