XMUT1 ;(WASH ISC)/CAP-Recover msgs for a user ;04/17/2002 11:49
;;8.0;MailMan;;Jun 28, 2002
; Entry points used by MailMan options (not covered by DBIA):
; A XMUT-REC-FIND
; G XMUT-REC-DELIVER
Q
A ;
W !!,"WE WILL FIND THE MESSAGES AND STORE THEM IN ^TMP('XMUT1'..."
W !,"LATER WE WILL LOAD THEM INTO PERSON'S MAILBOX.",!!
W !!,"This routine recovers 'ALL' messages that the user has not been"
W !,"terminated from. It will not recover some messages that were"
W !,"sent after reinstatement if the user previously lost Mail-Baskets."
S DIR(0)="Y",DIR("B")="N",DIR("A")="THIS MAY TAKE A LONG TIME.... DO YOU WISH TO CONTINUE" D ^DIR K DIR,DIRUT G EXIT:"yY"'[$E(X)!(X="")
S XMA0=^DD("DD")
B S DIC("A")="Enter the USER for whom you wish to recover messages: "
S DIC="^VA(200,",DIC(0)="AEQZM" D ^DIC
K DIC I "^"[$E(X) G EXIT
I Y<1 W !,"Enter '^' to abort or a Valid User who has a Mailbox." G B
I '$D(^XMB(3.7,+Y,2,1,0)) W $C(7),"You cannot recover messages for this user (no Mailbox)." G B
S XMC0=+Y,XMB0=Y(0) K Y
S DIR(0)="Y",DIR("B")="NO",DIR("A")="DO YOU MEAN '"_$P(XMB0,"^")_"' "
D ^DIR K DIR,DIRUT I "Yy"'[$E(X)!(X="") G B
S (F,A,G)=0,D=XMC0 K XMC0
W !!,"*=100 MESSAGES PROCESSED",!!
L S A=$O(^XMB(3.7,"M",A)) G Q:'A,L:$D(^(A,D)) S G=G+1 W:G#100=0 "*" S E=$O(^XMB(3.9,A,1,"C",D,0)) G L:'E,L:$D(^XMB(3.9,A,1,E,"D"))
S F=F+1,X=^XMB(3.9,A,0),^TMP("XMUT1",D,A)=X W !,$P(X,"^"),!
G L
Q W !!,G," MESSAGES PROCESSED, ",F," MESSAGES FOUND"
K %1,A,D,E,F,G,X,XMA0,XMB0,Y,Z,%,%H,%DT
Q
QQ S (A,G,F)=0,C=1,XMA0=^DD("DD") H 3600 D L G H^XUS
;
G ;LOAD DOCUMENTS FOUND INTO USER'S 'IN' BOX
S (J,C,F)="" W !!,"CHOOSE FROM:",!
F I=0:0 S I=$O(^TMP("XMUT1",I)) Q:'I I $D(^VA(200,I,0)) W !,$J(I,8)," ",$$NAME^XMXUTIL(I) I 'J S J=I
I 'J W !!!,"NONE RECOVERED FOR ANYBODY !!!" K C,F,I,J,X Q
F W !!,"WHICH ONE: ",J,"// " R X:DTIME I X="" S X=J
G E:"^"[$E(X) I X="?" D H1^XMUT1A G F
I X="??" G G
S D=X I '$D(^TMP("XMUT1",D)) W " << NOT ON LIST !!!",$C(7) G G
W !!,"RECOVERING MESSAGES ('+'=RECOVERED, '.'=MESSAGE PROCESSED)",!!
S D=X,(C,F)=0
P S A=$O(^TMP("XMUT1",D,0)) G QQQ:'A W "." I $X>77 W !
S C=C+1 W "+" G T:$D(^XMB(3.7,"M",A,D)),T:'$D(^XMB(3.9,A))
S F=F+1
L +^XMB(3.7,D)
D PUTMSG^XMXMSGS2(D,1,"IN",A)
L -^XMB(3.7,D)
T K ^TMP("XMUT1",D,A) G P
QQQ W !!,C," POTENTIAL ENTRIES PROCESSED. ",F," MESSAGES RECOVERED.",!!
E K %,%1,A,C,D,F,I,J,Y,Z,%H
Q
EXIT K X1,X2
Q
;
;LIST MESSAGES IN MAILBOXES OF DUZ
M G MBOX^XMJBL
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXMUT1 2511 printed Dec 13, 2024@02:13:29 Page 2
XMUT1 ;(WASH ISC)/CAP-Recover msgs for a user ;04/17/2002 11:49
+1 ;;8.0;MailMan;;Jun 28, 2002
+2 ; Entry points used by MailMan options (not covered by DBIA):
+3 ; A XMUT-REC-FIND
+4 ; G XMUT-REC-DELIVER
+5 QUIT
A ;
+1 WRITE !!,"WE WILL FIND THE MESSAGES AND STORE THEM IN ^TMP('XMUT1'..."
+2 WRITE !,"LATER WE WILL LOAD THEM INTO PERSON'S MAILBOX.",!!
+3 WRITE !!,"This routine recovers 'ALL' messages that the user has not been"
+4 WRITE !,"terminated from. It will not recover some messages that were"
+5 WRITE !,"sent after reinstatement if the user previously lost Mail-Baskets."
+6 SET DIR(0)="Y"
SET DIR("B")="N"
SET DIR("A")="THIS MAY TAKE A LONG TIME.... DO YOU WISH TO CONTINUE"
DO ^DIR
KILL DIR,DIRUT
if "yY"'[$EXTRACT(X)!(X="")
GOTO EXIT
+7 SET XMA0=^DD("DD")
B SET DIC("A")="Enter the USER for whom you wish to recover messages: "
+1 SET DIC="^VA(200,"
SET DIC(0)="AEQZM"
DO ^DIC
+2 KILL DIC
IF "^"[$EXTRACT(X)
GOTO EXIT
+3 IF Y<1
WRITE !,"Enter '^' to abort or a Valid User who has a Mailbox."
GOTO B
+4 IF '$DATA(^XMB(3.7,+Y,2,1,0))
WRITE $CHAR(7),"You cannot recover messages for this user (no Mailbox)."
GOTO B
+5 SET XMC0=+Y
SET XMB0=Y(0)
KILL Y
+6 SET DIR(0)="Y"
SET DIR("B")="NO"
SET DIR("A")="DO YOU MEAN '"_$PIECE(XMB0,"^")_"' "
+7 DO ^DIR
KILL DIR,DIRUT
IF "Yy"'[$EXTRACT(X)!(X="")
GOTO B
+8 SET (F,A,G)=0
SET D=XMC0
KILL XMC0
+9 WRITE !!,"*=100 MESSAGES PROCESSED",!!
L SET A=$ORDER(^XMB(3.7,"M",A))
if 'A
GOTO Q
if $DATA(^(A,D))
GOTO L
SET G=G+1
if G#100=0
WRITE "*"
SET E=$ORDER(^XMB(3.9,A,1,"C",D,0))
if 'E
GOTO L
if $DATA(^XMB(3.9,A,1,E,"D"))
GOTO L
+1 SET F=F+1
SET X=^XMB(3.9,A,0)
SET ^TMP("XMUT1",D,A)=X
WRITE !,$PIECE(X,"^"),!
+2 GOTO L
Q WRITE !!,G," MESSAGES PROCESSED, ",F," MESSAGES FOUND"
+1 KILL %1,A,D,E,F,G,X,XMA0,XMB0,Y,Z,%,%H,%DT
+2 QUIT
QQ SET (A,G,F)=0
SET C=1
SET XMA0=^DD("DD")
HANG 3600
DO L
GOTO H^XUS
+1 ;
G ;LOAD DOCUMENTS FOUND INTO USER'S 'IN' BOX
+1 SET (J,C,F)=""
WRITE !!,"CHOOSE FROM:",!
+2 FOR I=0:0
SET I=$ORDER(^TMP("XMUT1",I))
if 'I
QUIT
IF $DATA(^VA(200,I,0))
WRITE !,$JUSTIFY(I,8)," ",$$NAME^XMXUTIL(I)
IF 'J
SET J=I
+3 IF 'J
WRITE !!!,"NONE RECOVERED FOR ANYBODY !!!"
KILL C,F,I,J,X
QUIT
F WRITE !!,"WHICH ONE: ",J,"// "
READ X:DTIME
IF X=""
SET X=J
+1 if "^"[$EXTRACT(X)
GOTO E
IF X="?"
DO H1^XMUT1A
GOTO F
+2 IF X="??"
GOTO G
+3 SET D=X
IF '$DATA(^TMP("XMUT1",D))
WRITE " << NOT ON LIST !!!",$CHAR(7)
GOTO G
+4 WRITE !!,"RECOVERING MESSAGES ('+'=RECOVERED, '.'=MESSAGE PROCESSED)",!!
+5 SET D=X
SET (C,F)=0
P SET A=$ORDER(^TMP("XMUT1",D,0))
if 'A
GOTO QQQ
WRITE "."
IF $X>77
WRITE !
+1 SET C=C+1
WRITE "+"
if $DATA(^XMB(3.7,"M",A,D))
GOTO T
if '$DATA(^XMB(3.9,A))
GOTO T
+2 SET F=F+1
+3 LOCK +^XMB(3.7,D)
+4 DO PUTMSG^XMXMSGS2(D,1,"IN",A)
+5 LOCK -^XMB(3.7,D)
T KILL ^TMP("XMUT1",D,A)
GOTO P
QQQ WRITE !!,C," POTENTIAL ENTRIES PROCESSED. ",F," MESSAGES RECOVERED.",!!
E KILL %,%1,A,C,D,F,I,J,Y,Z,%H
+1 QUIT
EXIT KILL X1,X2
+1 QUIT
+2 ;
+3 ;LIST MESSAGES IN MAILBOXES OF DUZ
M GOTO MBOX^XMJBL
+1 QUIT