source: WorldVistAEHR/trunk/r/MAILMAN-XM/XMUTERM2.m@ 1361

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

initial load of WorldVistAEHR

File size: 4.9 KB
Line 
1XMUTERM2 ;ISC-SF/GMB-Delete Mailbox (cont.) ;04/17/2002 12:09
2 ;;8.0;MailMan;;Jun 28, 2002
3 ;
4 ; The following are called from CHOOSE^XMUTERM
5 ;
6MMCHOOSE(XMGRACE,XMCUTOFF) ;
7 N XMI,XMABORT,XMTERM
8 S (XMI,XMABORT)=0
9 F S XMI=$O(^XMB(3.7,XMI)) Q:XMI'>0 D Q:XMABORT
10 . D CHECK1^XMUTERM1(XMI,XMGRACE,XMCUTOFF,.XMTERM) I XMTERM D DELETE(XMI,.XMABORT) Q
11 . D CHECK2^XMUTERM1(XMI,XMCUTOFF,.XMTERM) I XMTERM D DELETE(XMI,.XMABORT)
12 Q
13ICHOOSE(XMGRACE,XMCUTOFF) ;
14 F D Q:XMABORT
15 . N DIC,Y
16 . S DIC="^XMB(3.7,"
17 . S DIC(0)="AEQM"
18 . S DIC("S")="N XMTERM,XMFORGET D CHECK1^XMUTERM1(Y,XMGRACE,XMCUTOFF,.XMTERM),CHECK2^XMUTERM1(Y,XMCUTOFF,.XMFORGET) I XMTERM!XMFORGET"
19 . W ! D ^DIC I Y=-1 S XMABORT=1 Q
20 . D DELETE(+Y)
21 Q
22DELETE(XMI,XMABORT) ;
23 N XMREC1,XMREC2,XMDELETE
24 S XMREC1=$G(^VA(200,XMI,0))
25 I XMREC1'="" D Q:'XMDELETE
26 . N DIR,Y
27 . W !!,$$NAME^XMXUTIL(XMI)
28 . W !,$$EZBLD^DIALOG(36336),$$EZBLD^DIALOG($S($P(XMREC1,U,3)="":36334,1:36335)) ; Access Code: NONE / <Hidden>
29 . W ?25,$$EZBLD^DIALOG(36337),$$EZBLD^DIALOG($S($P($G(^VA(200,XMI,.1)),U,2)="":36334,1:36335)) ; Verify Code: NONE / <hidden>
30 . W ?50,$$EZBLD^DIALOG(36338),$S($P($G(^VA(200,XMI,201)),U,1)="":$$EZBLD^DIALOG(36334),1:$P($G(^DIC(19,$P(^(201),U),0)),U)) ; Primary Menu: NONE / ...
31 . W !,$$EZBLD^DIALOG(36339),$S($P($G(^VA(200,XMI,1)),U,7)="":$$EZBLD^DIALOG(36334),1:$$FMTE^XLFDT($P(^(1),U,7),"2D")) ; Date Entered: NONE / date
32 . W ?25,$$EZBLD^DIALOG(36340),$S($P($G(^VA(200,XMI,1.1)),U,1)="":$$EZBLD^DIALOG(36334),1:$$FMTE^XLFDT($P(^(1.1),U,1),"2D")) ; Last Logon: NONE / date
33 . W ?50,"DISUSER: ",$$EZBLD^DIALOG($S($P(XMREC1,U,7):39054,1:39053)) ; YES / NO
34 . W !,$$EZBLD^DIALOG(36341),$S($P(XMREC1,U,11)="":$$EZBLD^DIALOG(36334),1:$$FMTE^XLFDT($P(XMREC1,U,11),"2D")) ; Term Date: NONE / date
35 . W:$P(XMREC1,U,11) ?25,$$EZBLD^DIALOG(36342),$$EZBLD^DIALOG($S($P(XMREC1,U,5)="y":39054,1:39053)) ; Delete Mail: YES / NO
36 . S XMREC2=^XMB(3.7,XMI,0)
37 . W ?50,$$EZBLD^DIALOG(36343),$P(XMREC2,U,6) ; New Messages:
38 . W !,$$EZBLD^DIALOG(38012),$S($P($G(^XMB(3.7,XMI,"L")),U)="":$$EZBLD^DIALOG(38002),1:$P(^("L"),U)) ; last used mailman: Never / date
39 . W !,$$EZBLD^DIALOG(38004) ; Forwarding Address:
40 . I $P(XMREC2,U,2)="" D
41 . . W $$EZBLD^DIALOG(36334) ; NONE
42 . E D
43 . . W $P(XMREC2,U,2),$$EZBLD^DIALOG($S($P(XMREC2,U,8):38005,1:38006)) ; fwding addr, local deliver on/off
44 . W !
45 . S DIR(0)="Y"
46 . S DIR("B")=$$EZBLD^DIALOG(39053) ; NO
47 . S DIR("A")=$$EZBLD^DIALOG(36344) ; Delete this user's mailbox
48 . D ^DIR I $D(DIRUT) S XMDELETE=0,XMABORT=1 Q
49 . I 'Y S XMDELETE=0 Q
50 . S XMDELETE=1
51 N XMPARM
52 S XMPARM(1)=XMI,XMPARM(2)=$S(XMREC1="":$$EZBLD^DIALOG(36346),1:$P(XMREC1,U)) ; * not in NEW PERSON file *
53 W !,$$EZBLD^DIALOG(36345,.XMPARM) ; Deleting mailbox for user |1| |2|
54 D TERMINAT^XMUTERM1(XMI)
55 Q
56 ;
57 ; The following are called from TERMINAT^XMUTERM1
58 ;
59GROUP(XMDUZ) ; Remove user from mail groups
60 N XMI,XMJ,DIK,DA
61 ; Remove user as member from all mail groups
62 S XMI=0
63 F S XMI=$O(^XMB(3.8,"AB",XMDUZ,XMI)) Q:XMI'>0 D
64 . S DA(1)=XMI,DIK="^XMB(3.8,XMI,1,",XMJ=0
65 . F S XMJ=$O(^XMB(3.8,"AB",XMDUZ,XMI,XMJ)) Q:XMJ'>0 S DA=XMJ D ^DIK
66 K ^XMB(3.8,"AB",XMDUZ)
67 ; Remove user as coordinator from all mail groups
68 S XMI=0
69 F S XMI=$O(^XMB(3.8,"AC",XMDUZ,XMI)) Q:XMI'>0 D
70 . S XMFDA(3.8,XMI_",",5.1)=.5 ; (change coord to postmaster)
71 . D FILE^DIE("","XMFDA")
72 K ^XMB(3.8,"AC",XMDUZ)
73 ; Remove user's personal mail groups, and
74 ; remove user as organizer or authorized sender from all mail groups.
75 S XMI=0
76 F S XMI=$O(^XMB(3.8,XMI)) Q:XMI'>0 D
77 . I +$G(^XMB(3.8,XMI,3))=XMDUZ D ; user is organizer
78 . . I $P(^XMB(3.8,XMI,0),U,6)=1 S DA=XMI,DIK="^XMB(3.8," D ^DIK Q ; delete personal group
79 . . S XMFDA(3.8,XMI_",",5)=.5 ; (change organizer to postmaster)
80 . . D FILE^DIE("","XMFDA")
81 . ; Remove user as authorized sender from all mail groups
82 . Q:'$D(^XMB(3.8,XMI,4,"B",XMDUZ))
83 . S DA=$O(^XMB(3.8,XMI,4,"B",XMDUZ,0))
84 . I '$D(^XMB(3.8,XMI,4,DA,0)) K ^XMB(3.8,XMI,4,"B",XMDUZ) Q
85 . S DA(1)=XMI,DIK="^XMB(3.8,XMI,4," D ^DIK
86 Q
87SURROGAT(XMDUZ) ; Remove as mail surrogate
88 N XMI,DA,DIK
89 S XMI=0,DIK="^XMB(3.7,XMI,9,"
90 F S XMI=$O(^XMB(3.7,"AB",XMDUZ,XMI)) Q:XMI'>0 D
91 . S DA=$O(^XMB(3.7,"AB",XMDUZ,XMI,0))
92 . I '$D(^XMB(3.7,XMI,9,DA,0)) K ^XMB(3.7,"AB",XMDUZ,XMI) Q
93 . S DA(1)=XMI D ^DIK
94 K ^XMB(3.7,"AB",XMDUZ)
95 Q
96MAILBOX(XMDUZ) ; Remove user's mailbox
97 Q:'$D(^XMB(3.7,XMDUZ))
98 N DIK,DA
99 S DIK="^XMB(3.7,",DA=XMDUZ D ^DIK
100 K:$D(^XMB(3.7,XMDUZ)) ^XMB(3.7,XMDUZ) ; just in case!
101 K:$D(^XMB(3.7,"B",XMDUZ)) ^XMB(3.7,"B",XMDUZ)
102 Q
103LATERNEW(XMDUZ) ; Remove the scheduling of any messages slated to become new for this user
104 N DIK,DA
105 S DIK="^XMB(3.73,"
106 S DA=""
107 F S DA=$O(^XMB(3.73,"C",XMDUZ,DA)) Q:'DA D ^DIK
108 Q
109LATERSND(XMDUZ) ; Remove the scheduling of any messages slated to be sent by this user.
110 N XMZ,DIK,DA
111 S XMZ=0
112 F S XMZ=$O(^XMB(3.9,"AW",XMDUZ,XMZ)) Q:'XMZ D
113 . S DA(1)=XMZ
114 . S DIK="^XMB(3.9,"_DA(1)_",7,"
115 . S DA=0
116 . F S DA=$O(^XMB(3.9,"AW",XMDUZ,XMZ,DA)) Q:'DA D ^DIK
117 Q
Note: See TracBrowser for help on using the repository browser.