Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: XMVVITA

XMVVITA.m

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