XMVVITA ;ISC-SF/GMB-Edit User's MailMan Variables ;04/29/2003 07:49
;;8.0;MailMan;**18**;Jun 28, 2002
; Replaces ^XMGAPI1,FWD^XMA21FWD,BANNER^XMA6,EDIT^XMA7 (ISC-WASH/CAP)
;
; Entry points used by MailMan options (not covered by DBIA):
; BANNER XMBANNER - Edit user's banner
; EDIT XMEDITUSER - Edit user's preferences
; FILTER XM FILTER EDIT - Edit user's message filters
; BASKET XM DELIVERY BASKET EDIT - Edit user's delivery basket preferences
; FORWARD XMEDITFWD - Edit user's forwarding address
; SURR XMEDITSURR - Edit user's surrogates
FORWARD ; Edit forwarding address
N XMIA
S XMIA=1
N DIE,DA,DR
S DIE=3.7
S DA=DUZ
S DR="2;2.1"
D ^DIE
Q
XMFWD(XMADDR,XMIA) ; Serves as input transform for 'forwarding address'
N XMERROR,XMRESTR,XMINSTR,XMFULL,XMFWDADD
I XMADDR'["@",".D.d.H.h.S.s."'[("."_$E(XMADDR,1,2)) K XMADDR Q
S XMINSTR("ADDR FLAGS")="X" ; do not create ^TMP(, just check.
S XMFWDADD=DUZ ; editing forwarding address
D ADDRESS^XMXADDR(DUZ,XMADDR,.XMFULL,.XMERROR)
I $D(XMERROR) K XMADDR Q
I XMFULL'["@" D
. ; Remote address is really local. OK if device or server.
. I ".D.H.S."[("."_$E(XMFULL,1,2)) S XMFULL=XMFULL_"@"_^XMB("NETNAME")
I XMFULL'["@" D Q
. ; Remote address is really local
. K XMADDR
. D EN^DDIOL($$EZBLD^DIALOG(38130)) ; You can't have your mail forwarded to a local address.
S XMADDR=XMFULL
Q
DELFWD(XMUSER,XMFWD,XMERROR) ; Delete a user's invalid forwarding address.
S XMFDA(3.7,XMUSER_",",2)="@"
D FILE^DIE("","XMFDA")
N XMPARM,XMINSTR,XMTEXT,XMAPPEND
S XMINSTR("FROM")=.5
S XMPARM(1)=XMFWD
I +XMERROR=XMERROR D
. D BLD^DIALOG(XMERROR,.XMERROR,"","XMTEXT","F")
. D MSG^DIALOG("AE",.XMAPPEND,"","","XMTEXT")
E D
. S XMPARM(2)=XMERROR
. S XMAPPEND=""
D TASKBULL^XMXBULL(.5,"XM FWD ADDRESS DELETE",.XMPARM,"XMAPPEND",XMUSER,.XMINSTR)
Q
BANNER ; Edit banner
N DIE,DA,DR
S DIE=3.7
S (XMDUZ,DA)=$G(XMDUZ,DUZ)
S DR=4
D ^DIE
D SETBAN^XMVVITAE(XMDUZ,.XMV)
Q
FILTER ; Edit filters
N DIE,DA,DR,XMIA
S XMIA=1
S DIE=3.7
S DA=DUZ
S DR="16;15" ; Message filters flag ; Message filters
D ^DIE
Q:$D(^XMB(3.7,DUZ,15,"AF"))
W !!,$C(7),$$EZBLD^DIALOG(38131) ; Note that you have no active filters.
Q
BASKET ; Edit delivery baskets
N DIE,DA,DR
S DIE=3.7
S DA=DUZ
S DR="16.2;S:X'=""S"" Y=0;1" ; Accept delivery basket? ; Select basket.
S DR(2,3.701)="3" ; Is this a delivery basket?
D ^DIE
Q
SURR ; Edit Surrogates
N DIE,DA,DR
S DIE="^XMB(3.7,"
S DA=DUZ
S DR="8" ; surrogate
D ^DIE
Q
EDIT ; Edit User Preferences
N DIE,DA,DR
D CHECK^XMVVITAE
W !!,$$EZBLD^DIALOG(38132,$$GET1^DID(3.7,"","","NAME")) ; Editing data in the MAILBOX file:
S DIE="^XMB(3.7,"
S DA=DUZ
S DR=""
S DR=DR_";4" ; banner
S DR=DR_";17" ; message display order
S DR=DR_";21" ; new message read order
S DR=DR_";18" ; message reader default
S DR=DR_";19" ; message reader prompt
S DR=DR_";20" ; new messages default option
S DR=DR_";6" ; show message preview
S DR=DR_";11" ; message action default
S DR=DR_";12" ; ask basket
S DR=DR_";13" ; show titles
S DR=DR_";14" ; priority responses flag
S DR=DR_";14.1" ; priority responses prompt
S DR=DR_";16.3" ; p-message queued from
S DR=DR_";9" ; mailman institution
S DR=DR_";2.21:2.23" ; network signature lines
S DR=DR_";4.5" ; introduction
S DR=$E(DR,2,99)
D ^DIE
D NEWORDER
W !!,$$EZBLD^DIALOG(38132,$$GET1^DID(200,"","","NAME")) ; Editing data in the NEW PERSON file:
S DIE="^VA(200,"
S DA=DUZ
S DR=""
S DR=DR_";31.3" ; preferred editor
S DR=DR_";.111" ; street address 1
S DR=DR_";.112" ; street address 2
S DR=DR_";.113" ; street address 3
S DR=DR_";.114" ; city
S DR=DR_";.115" ; state
S DR=DR_";.116" ; zip
S DR=DR_";.132" ; office phone
S DR=DR_";.136" ; fax #
S DR=DR_";.137" ; voice pager
S DR=DR_";.138" ; digital pager
S DR=DR_";.133"_$$EZBLD^DIALOG(38133,1) ; ADD'L PHONE 1 phone #3
S DR=DR_";.134"_$$EZBLD^DIALOG(38133,2) ; ADD'L PHONE 2 phone #4
S DR=$E(DR,2,99)
D ^DIE
D PREFER^XMVVITAE(DUZ,.XMV,.XMDISPI)
D SETBAN^XMVVITAE(XMDUZ,.XMV)
D SETNET^XMVVITAE(XMDUZ,.XMV)
Q
NEWORDER ;
N XMDIC,XMK
I $D(^XMB(3.7,DUZ,2,"AP")) D
. N I,XMKN,XMTEXT
. W !
. ;Current priority order for reading baskets with new messages:
. D BLD^DIALOG(38140,"","","XMTEXT","F")
. D MSG^DIALOG("WM","","","","XMTEXT")
. S (I,XMK)=0
. F S I=$O(^XMB(3.7,DUZ,2,"AP",I)) Q:'I D
. . F S XMK=$O(^XMB(3.7,DUZ,2,"AP",I,XMK)) Q:'XMK D
. . . S ^TMP("XM",$J,"AP",I,$$BSKTNAME^XMXUTIL(DUZ,XMK))=""
. S I=0,XMKN=""
. F S I=$O(^TMP("XM",$J,"AP",I)) Q:'I D
. . F S XMKN=$O(^TMP("XM",$J,"AP",I,XMKN)) Q:XMKN="" D
. . . W !,$J(I,4),?8,XMKN
. K ^TMP("XM",$J,"AP")
W !
;Editing the priority order for reading baskets with new messages.
;Note: You don't need priority ordering unless you want to change the
;default 'read new messages' basket from IN to other basket(s).
D BLD^DIALOG(38141,"","","XMTEXT","F")
D MSG^DIALOG("WM","","","","XMTEXT")
F D Q:XMK=U
. S XMDIC("B")="@" ; no default basket
. S XMDIC("S")="I Y>1" ; can't select IN or WASTE baskets
. S XMDIC("W")="W ?40,$P(^(0),U,4)"
. W !
. D SELBSKT^XMJBU(DUZ,"","",.XMDIC,.XMK) Q:XMK=U
. N DA,DR,DIE
. S DIE="^XMB(3.7,"_DUZ_",2,"
. S DA(1)=DUZ,DA=XMK
. S DR="4T" ; Read new messages basket priority
. D ^DIE
Q
GOTNS(XMDUZ) ; Function: Does the user have a network signature? (1=yes; 0=no)
Q "^^"'[$G(^XMB(3.7,XMDUZ,"NS1"))
CRE8NS ; The user does not have a network signature.
; Does the user want to create a network signature now?
; If the user creates one, routine sets $T to true; else false
N DIR,X,Y
S DIR(0)="Y",DIR("B")=$$EZBLD^DIALOG(39054) ; Yes
S DIR("A")=$$EZBLD^DIALOG(37309.5) ; Would you like to create a Network Signature now
D ^DIR Q:'Y
K DIR
D EDITNS
I $$GOTNS(DUZ)
Q
EDITNS ; Edit network signature
N DIE,DA,DR
S DIE="^XMB(3.7,",DA=DUZ,DR="2.21:2.23" D ^DIE
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXMVVITA 6215 printed Oct 16, 2024@18:14:36 Page 2
XMVVITA ;ISC-SF/GMB-Edit User's MailMan Variables ;04/29/2003 07:49
+1 ;;8.0;MailMan;**18**;Jun 28, 2002
+2 ; Replaces ^XMGAPI1,FWD^XMA21FWD,BANNER^XMA6,EDIT^XMA7 (ISC-WASH/CAP)
+3 ;
+4 ; Entry points used by MailMan options (not covered by DBIA):
+5 ; BANNER XMBANNER - Edit user's banner
+6 ; EDIT XMEDITUSER - Edit user's preferences
+7 ; FILTER XM FILTER EDIT - Edit user's message filters
+8 ; BASKET XM DELIVERY BASKET EDIT - Edit user's delivery basket preferences
+9 ; FORWARD XMEDITFWD - Edit user's forwarding address
+10 ; SURR XMEDITSURR - Edit user's surrogates
FORWARD ; Edit forwarding address
+1 NEW XMIA
+2 SET XMIA=1
+3 NEW DIE,DA,DR
+4 SET DIE=3.7
+5 SET DA=DUZ
+6 SET DR="2;2.1"
+7 DO ^DIE
+8 QUIT
XMFWD(XMADDR,XMIA) ; Serves as input transform for 'forwarding address'
+1 NEW XMERROR,XMRESTR,XMINSTR,XMFULL,XMFWDADD
+2 IF XMADDR'["@"
IF ".D.d.H.h.S.s."'[("."_$EXTRACT(XMADDR,1,2))
KILL XMADDR
QUIT
+3 ; do not create ^TMP(, just check.
SET XMINSTR("ADDR FLAGS")="X"
+4 ; editing forwarding address
SET XMFWDADD=DUZ
+5 DO ADDRESS^XMXADDR(DUZ,XMADDR,.XMFULL,.XMERROR)
+6 IF $DATA(XMERROR)
KILL XMADDR
QUIT
+7 IF XMFULL'["@"
Begin DoDot:1
+8 ; Remote address is really local. OK if device or server.
+9 IF ".D.H.S."[("."_$EXTRACT(XMFULL,1,2))
SET XMFULL=XMFULL_"@"_^XMB("NETNAME")
End DoDot:1
+10 IF XMFULL'["@"
Begin DoDot:1
+11 ; Remote address is really local
+12 KILL XMADDR
+13 ; You can't have your mail forwarded to a local address.
DO EN^DDIOL($$EZBLD^DIALOG(38130))
End DoDot:1
QUIT
+14 SET XMADDR=XMFULL
+15 QUIT
DELFWD(XMUSER,XMFWD,XMERROR) ; Delete a user's invalid forwarding address.
+1 SET XMFDA(3.7,XMUSER_",",2)="@"
+2 DO FILE^DIE("","XMFDA")
+3 NEW XMPARM,XMINSTR,XMTEXT,XMAPPEND
+4 SET XMINSTR("FROM")=.5
+5 SET XMPARM(1)=XMFWD
+6 IF +XMERROR=XMERROR
Begin DoDot:1
+7 DO BLD^DIALOG(XMERROR,.XMERROR,"","XMTEXT","F")
+8 DO MSG^DIALOG("AE",.XMAPPEND,"","","XMTEXT")
End DoDot:1
+9 IF '$TEST
Begin DoDot:1
+10 SET XMPARM(2)=XMERROR
+11 SET XMAPPEND=""
End DoDot:1
+12 DO TASKBULL^XMXBULL(.5,"XM FWD ADDRESS DELETE",.XMPARM,"XMAPPEND",XMUSER,.XMINSTR)
+13 QUIT
BANNER ; Edit banner
+1 NEW DIE,DA,DR
+2 SET DIE=3.7
+3 SET (XMDUZ,DA)=$GET(XMDUZ,DUZ)
+4 SET DR=4
+5 DO ^DIE
+6 DO SETBAN^XMVVITAE(XMDUZ,.XMV)
+7 QUIT
FILTER ; Edit filters
+1 NEW DIE,DA,DR,XMIA
+2 SET XMIA=1
+3 SET DIE=3.7
+4 SET DA=DUZ
+5 ; Message filters flag ; Message filters
SET DR="16;15"
+6 DO ^DIE
+7 if $DATA(^XMB(3.7,DUZ,15,"AF"))
QUIT
+8 ; Note that you have no active filters.
WRITE !!,$CHAR(7),$$EZBLD^DIALOG(38131)
+9 QUIT
BASKET ; Edit delivery baskets
+1 NEW DIE,DA,DR
+2 SET DIE=3.7
+3 SET DA=DUZ
+4 ; Accept delivery basket? ; Select basket.
SET DR="16.2;S:X'=""S"" Y=0;1"
+5 ; Is this a delivery basket?
SET DR(2,3.701)="3"
+6 DO ^DIE
+7 QUIT
SURR ; Edit Surrogates
+1 NEW DIE,DA,DR
+2 SET DIE="^XMB(3.7,"
+3 SET DA=DUZ
+4 ; surrogate
SET DR="8"
+5 DO ^DIE
+6 QUIT
EDIT ; Edit User Preferences
+1 NEW DIE,DA,DR
+2 DO CHECK^XMVVITAE
+3 ; Editing data in the MAILBOX file:
WRITE !!,$$EZBLD^DIALOG(38132,$$GET1^DID(3.7,"","","NAME"))
+4 SET DIE="^XMB(3.7,"
+5 SET DA=DUZ
+6 SET DR=""
+7 ; banner
SET DR=DR_";4"
+8 ; message display order
SET DR=DR_";17"
+9 ; new message read order
SET DR=DR_";21"
+10 ; message reader default
SET DR=DR_";18"
+11 ; message reader prompt
SET DR=DR_";19"
+12 ; new messages default option
SET DR=DR_";20"
+13 ; show message preview
SET DR=DR_";6"
+14 ; message action default
SET DR=DR_";11"
+15 ; ask basket
SET DR=DR_";12"
+16 ; show titles
SET DR=DR_";13"
+17 ; priority responses flag
SET DR=DR_";14"
+18 ; priority responses prompt
SET DR=DR_";14.1"
+19 ; p-message queued from
SET DR=DR_";16.3"
+20 ; mailman institution
SET DR=DR_";9"
+21 ; network signature lines
SET DR=DR_";2.21:2.23"
+22 ; introduction
SET DR=DR_";4.5"
+23 SET DR=$EXTRACT(DR,2,99)
+24 DO ^DIE
+25 DO NEWORDER
+26 ; Editing data in the NEW PERSON file:
WRITE !!,$$EZBLD^DIALOG(38132,$$GET1^DID(200,"","","NAME"))
+27 SET DIE="^VA(200,"
+28 SET DA=DUZ
+29 SET DR=""
+30 ; preferred editor
SET DR=DR_";31.3"
+31 ; street address 1
SET DR=DR_";.111"
+32 ; street address 2
SET DR=DR_";.112"
+33 ; street address 3
SET DR=DR_";.113"
+34 ; city
SET DR=DR_";.114"
+35 ; state
SET DR=DR_";.115"
+36 ; zip
SET DR=DR_";.116"
+37 ; office phone
SET DR=DR_";.132"
+38 ; fax #
SET DR=DR_";.136"
+39 ; voice pager
SET DR=DR_";.137"
+40 ; digital pager
SET DR=DR_";.138"
+41 ; ADD'L PHONE 1 phone #3
SET DR=DR_";.133"_$$EZBLD^DIALOG(38133,1)
+42 ; ADD'L PHONE 2 phone #4
SET DR=DR_";.134"_$$EZBLD^DIALOG(38133,2)
+43 SET DR=$EXTRACT(DR,2,99)
+44 DO ^DIE
+45 DO PREFER^XMVVITAE(DUZ,.XMV,.XMDISPI)
+46 DO SETBAN^XMVVITAE(XMDUZ,.XMV)
+47 DO SETNET^XMVVITAE(XMDUZ,.XMV)
+48 QUIT
NEWORDER ;
+1 NEW XMDIC,XMK
+2 IF $DATA(^XMB(3.7,DUZ,2,"AP"))
Begin DoDot:1
+3 NEW I,XMKN,XMTEXT
+4 WRITE !
+5 ;Current priority order for reading baskets with new messages:
+6 DO BLD^DIALOG(38140,"","","XMTEXT","F")
+7 DO MSG^DIALOG("WM","","","","XMTEXT")
+8 SET (I,XMK)=0
+9 FOR
SET I=$ORDER(^XMB(3.7,DUZ,2,"AP",I))
if 'I
QUIT
Begin DoDot:2
+10 FOR
SET XMK=$ORDER(^XMB(3.7,DUZ,2,"AP",I,XMK))
if 'XMK
QUIT
Begin DoDot:3
+11 SET ^TMP("XM",$JOB,"AP",I,$$BSKTNAME^XMXUTIL(DUZ,XMK))=""
End DoDot:3
End DoDot:2
+12 SET I=0
SET XMKN=""
+13 FOR
SET I=$ORDER(^TMP("XM",$JOB,"AP",I))
if 'I
QUIT
Begin DoDot:2
+14 FOR
SET XMKN=$ORDER(^TMP("XM",$JOB,"AP",I,XMKN))
if XMKN=""
QUIT
Begin DoDot:3
+15 WRITE !,$JUSTIFY(I,4),?8,XMKN
End DoDot:3
End DoDot:2
+16 KILL ^TMP("XM",$JOB,"AP")
End DoDot:1
+17 WRITE !
+18 ;Editing the priority order for reading baskets with new messages.
+19 ;Note: You don't need priority ordering unless you want to change the
+20 ;default 'read new messages' basket from IN to other basket(s).
+21 DO BLD^DIALOG(38141,"","","XMTEXT","F")
+22 DO MSG^DIALOG("WM","","","","XMTEXT")
+23 FOR
Begin DoDot:1
+24 ; no default basket
SET XMDIC("B")="@"
+25 ; can't select IN or WASTE baskets
SET XMDIC("S")="I Y>1"
+26 SET XMDIC("W")="W ?40,$P(^(0),U,4)"
+27 WRITE !
+28 DO SELBSKT^XMJBU(DUZ,"","",.XMDIC,.XMK)
if XMK=U
QUIT
+29 NEW DA,DR,DIE
+30 SET DIE="^XMB(3.7,"_DUZ_",2,"
+31 SET DA(1)=DUZ
SET DA=XMK
+32 ; Read new messages basket priority
SET DR="4T"
+33 DO ^DIE
End DoDot:1
if XMK=U
QUIT
+34 QUIT
GOTNS(XMDUZ) ; Function: Does the user have a network signature? (1=yes; 0=no)
+1 QUIT "^^"'[$GET(^XMB(3.7,XMDUZ,"NS1"))
CRE8NS ; The user does not have a network signature.
+1 ; Does the user want to create a network signature now?
+2 ; If the user creates one, routine sets $T to true; else false
+3 NEW DIR,X,Y
+4 ; Yes
SET DIR(0)="Y"
SET DIR("B")=$$EZBLD^DIALOG(39054)
+5 ; Would you like to create a Network Signature now
SET DIR("A")=$$EZBLD^DIALOG(37309.5)
+6 DO ^DIR
if 'Y
QUIT
+7 KILL DIR
+8 DO EDITNS
+9 IF $$GOTNS(DUZ)
+10 QUIT
EDITNS ; Edit network signature
+1 NEW DIE,DA,DR
+2 SET DIE="^XMB(3.7,"
SET DA=DUZ
SET DR="2.21:2.23"
DO ^DIE
+3 QUIT