source: WorldVistAEHR/trunk/r/MAILMAN-XM/XMVSURR.m@ 824

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

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1XMVSURR ;ISC-SF/GMB-Surrogate management ;04/19/2002 11:32
2 ;;8.0;MailMan;;Jun 28, 2002
3 ; Replaces ^XMA7 (ISC-WASH/RJ/THM/CAP)
4 ; Entry points used by MailMan options (not covered by DBIA):
5 ; SHARE XMSHARE - Become SHARED,MAIL
6 ; ASSUME XMASSUME - Become another user
7SHARE ; Assume the identity of SHARED,MAIL
8 Q:'$$CHKOK
9 S XMDUZ=.6
10 D SURROGAT^XMVVITAE(XMDUZ,.XMV,.XMDUN,"",.XMPRIV)
11 D HEADER^XM
12 D MANAGE^XMJBM
13 D SELF
14 Q
15CHKOK() ;
16 I $D(^XUSEC("XMNOPRIV",DUZ)) D Q 0
17 . N XMTEXT ;You have been given the XMNOPRIV key
18 . W $C(7) ;and may not become anyone's surrogate.
19 . D BLD^DIALOG(38053,"","","XMTEXT","F")
20 . D MSG^DIALOG("WE","","","","XMTEXT")
21 D CHECK^XMVVITAE
22 Q 1
23SELF ;
24 D SELF^XMVVITAE
25 W $C(7),!,$$EZBLD^DIALOG(38054),! ;You are now yourself again.
26 D HEADER^XM
27 Q
28ASSUME ; Assume someone else's identity
29 I '$D(^XMB(3.7,"AB",DUZ)) D SHARE Q
30 Q:'$$CHKOK
31 D LISTEM
32 N DIC,Y
33 S DIC(0)="AEMQZ"
34 S D="B^BB^C^D"
35 S DIC="^VA(200,"
36 S DIC("W")="D SHOWPRIV^XMVSURR(Y)"
37 S DIC("S")="I Y=.6!$D(^XMB(3.7,""AB"",DUZ,Y))"
38 I XMDUZ=DUZ D
39 . S DIC("B")=$$NAME^XMXUTIL(.6) ; SHARED,MAIL
40 E D
41 . N XMTEXT
42 . S DIC("S")=DIC("S")_"!(Y=DUZ),Y'=XMDUZ"
43 . S DIC("B")=XMV("DUZ NAME")
44 . ;You may select yourself to resume your own identity.
45 . D BLD^DIALOG(38055,"","","XMTEXT","F")
46 . D MSG^DIALOG("WE","","","","XMTEXT")
47 D MIX^DIC1 I Y=-1!$D(DUOUT)!$D(DTOUT) Q
48 S XMDUZ=+Y
49 I XMDUZ=DUZ D SELF Q
50 I XMDUZ=.6 D SHARE Q
51 D OTHER^XMVVITAE
52 D HEADER^XM
53 Q
54LISTEM ; List surrogates a user may become
55 N XMDUZ
56 W !,$$EZBLD^DIALOG(38056) ;Choose from:
57 S XMDUZ=0
58 F S XMDUZ=$O(^XMB(3.7,"AB",DUZ,XMDUZ)) Q:'XMDUZ W !,?3,$E($$NAME^XMXUTIL(XMDUZ),1,32) D SHOWPRIV(XMDUZ)
59 W !,?3,$$NAME^XMXUTIL(.6) D SHOWPRIV(.6) W !
60 Q
61SHOWPRIV(XMDUZ) ;
62 Q:XMDUZ=DUZ
63 I XMDUZ=.6 W ?37,$$EZBLD^DIALOG(38048) Q ;Read Privilege
64 N XMPRIV,XMNEW
65 S XMPRIV=$P($G(^XMB(3.7,XMDUZ,9,+$O(^XMB(3.7,"AB",DUZ,XMDUZ,0)),0)),U,2,3)
66 I XMPRIV'["y" W ?37,$$EZBLD^DIALOG(38046) Q ;No Privileges
67 I $L(XMPRIV,"y")>2 W ?37,$$EZBLD^DIALOG(38047) ;Read and Send Privileges
68 E W ?37,$$EZBLD^DIALOG($S($P(XMPRIV,U)["y":38048,1:38049)) ; Read/Send Privilege
69 S XMNEW=$$TNMSGCT^XMXUTIL(XMDUZ)
70 W " ",$J($$EZBLD^DIALOG($S(XMNEW:38052,1:38051),XMNEW),79-$X) ; x/No New Msgs
71 Q
Note: See TracBrowser for help on using the repository browser.