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

XMXEDIT.m

Go to the documentation of this file.
  1. XMXEDIT ;ISC-SF/GMB-Edit msg that user has sent to self ;05/19/2000 13:41
  1. ;;8.0;MailMan;;Jun 28, 2002
  1. ; All entry points covered by DBIA 2730.
  1. ; These entry points edit a message. They do not perform any checks to
  1. ; see whether it is appropriate to do so. That is the responsibility
  1. ; of the calling routine.
  1. ; For these entry points, it is expected that:
  1. ; OPTMSG^XMXSEC2 has been called and has given its permission to
  1. ; edit the message or to toggle information only.
  1. ; OPTEDIT^XMXSEC2 has been called and has given its permission to
  1. ; edit the particular thing we are editing here.
  1. ; INMSG2^XMXUTIL2 has been called to set XMINSTR. These routines expect
  1. ; that XMINSTR has been correctly set. They will change
  1. ; XMINSTR according to the edit.
  1. CLOSED(XMZ,XMINSTR,XMMSG) ; Toggle Closed msg
  1. I $D(^TMP("XMY",$J,.6)) D ERRSET^XMXUTIL(37320.6) Q ; Messages addressed to SHARED,MAIL may not be closed
  1. D FLAGTOGL(XMZ,1.95,.XMINSTR,"X",37319.9,37320.9,.XMMSG)
  1. Q
  1. CONFID(XMZ,XMINSTR,XMMSG) ; Toggle Confidential msg
  1. I $D(^TMP("XMY",$J,.6)) D ERRSET^XMXUTIL(37301.6) Q ; Messages addressed to SHARED,MAIL may not be confidential
  1. D FLAGTOGL(XMZ,1.96,.XMINSTR,"C",37301.9,37302.9,.XMMSG)
  1. Q
  1. CONFIRM(XMZ,XMINSTR,XMMSG) ; Toggle Confirm receipt of msg
  1. D FLAGTOGL(XMZ,1.3,.XMINSTR,"R",37313.9,37314.9,.XMMSG)
  1. Q
  1. DELIVER(XMZ,XMDBSKT,XMINSTR,XMMSG) ; Delivery basket
  1. I XMDBSKT="@" D Q
  1. . K XMINSTR("RCPT BSKT")
  1. . S XMFDA(3.9,XMZ_",",21)="@"
  1. . D FILE^DIE("","XMFDA")
  1. . S XMMSG=$$EZBLD^DIALOG(37304.9) ; Delivery basket removed
  1. S XMINSTR("RCPT BSKT")=XMDBSKT
  1. S XMFDA(3.9,XMZ_",",21)=XMINSTR("RCPT BSKT")
  1. D FILE^DIE("","XMFDA")
  1. S XMMSG=$$EZBLD^DIALOG(37303.9) ; Delivery basket set
  1. Q
  1. INFO(XMZ,XMINSTR,XMMSG) ; Toggle Information only msg
  1. D FLAGTOGL(XMZ,1.97,.XMINSTR,"I",37307.9,37308.9,.XMMSG)
  1. Q
  1. NETSIG(XMDUZ,XMZ,XMINSTR,XMMSG) ; Add Network Signature
  1. N I,XMNSIG
  1. S XMNSIG(.1)=""
  1. S XMNSIG(.2)=""
  1. S XMNSIG(.3)=$$REPEAT^XLFSTR("-",79)
  1. S XMNSIG=$G(^XMB(3.7,XMDUZ,"NS1"))
  1. F I=1:1:3 S:$P(XMNSIG,U,I)'="" XMNSIG(I)=$P(XMNSIG,U,I)
  1. N XMABORT
  1. I $D(^XMB(3.9,XMZ,"K")) D Q:XMABORT
  1. . ; If XMSECURE does not exist, then XMINSTR("SCR KEY") must hold the
  1. . ; correct scramble key.
  1. . I '$D(XMSECURE) N XMSECURE
  1. . I '$D(XMSECURE),'$$GOODKEY^XMJMCODE(XMZ,XMINSTR("SCR KEY")) D Q
  1. . . D ERRSET^XMXUTIL(34623) ; The key is not correct.
  1. . . S XMABORT=1
  1. . S XMABORT=0
  1. . S I=0
  1. . F S I=$O(XMNSIG(I)) Q:'I S XMNSIG(I)=$$ENCSTR^XMJMCODE(XMNSIG(I))
  1. D MOVEBODY^XMXSEND(XMZ,"XMNSIG","A") ; Add the network signature
  1. S XMMSG=$$EZBLD^DIALOG(37309.9) ; Network Signature added
  1. Q
  1. PRIORITY(XMZ,XMINSTR,XMMSG) ; Toggle Priority msg
  1. D FLAGTOGL(XMZ,1.7,.XMINSTR,"P",37311.9,37312.9,.XMMSG)
  1. Q
  1. SCRAMBLE(XMZ,XMINSTR,XMMSG) ; Scramble or Unscramble the message text
  1. N XMFDA,XMIENS
  1. S XMIENS=XMZ_","
  1. I $D(^XMB(3.9,XMZ,"K")) D Q
  1. . ; Unscramble the text.
  1. . ; If XMSECURE does not exist, then XMINSTR("SCR KEY") must hold the
  1. . ; correct scramble key.
  1. . I '$D(XMSECURE),'$$GOODKEY^XMJMCODE(XMZ,XMINSTR("SCR KEY")) D ERRSET^XMXUTIL(34623) Q ; The key is not correct.
  1. . S XMFDA(3.9,XMIENS,1.8)="@"
  1. . S XMFDA(3.9,XMIENS,1.85)="@"
  1. . D FILE^DIE("","XMFDA")
  1. . D DECMSG^XMJMCODE(XMZ)
  1. . K XMSECURE,XMINSTR("SCR KEY"),XMINSTR("SCR HINT"),^XMB(3.9,XMZ,"K")
  1. . S XMMSG=$$EZBLD^DIALOG(37316.9) ; Message text UnScrambled
  1. ; Check the key and hint
  1. D XMKEY^XMXPARM1($G(XMINSTR("SCR KEY")))
  1. D:$G(XMINSTR("SCR HINT"))'="" XMHINT^XMXPARM1(XMINSTR("SCR HINT"))
  1. Q:$D(XMERR)
  1. ; Scramble the text.
  1. N XMKEY
  1. K XMSECURE
  1. S XMFDA(3.9,XMIENS,1.8)=$S($G(XMINSTR("SCR HINT"))="":" ",1:XMINSTR("SCR HINT"))
  1. D LOADCODE^XMJMCODE ; XMSECURE is created here
  1. S XMKEY=XMINSTR("SCR KEY")
  1. D ADJUST^XMJMCODE(.XMKEY) ; XMSECURE is adjusted here
  1. S XMFDA(3.9,XMIENS,1.85)="1"_$$ENCSTR^XMJMCODE(XMKEY)
  1. D ENCMSG^XMJMCODE(XMZ)
  1. D FILE^DIE("","XMFDA")
  1. S XMMSG=$$EZBLD^DIALOG(37315.9) ; Message text Scrambled
  1. Q
  1. SUBJ(XMZ,XMSUBJ,XMIM) ; Replace Subject
  1. S XMSUBJ=$$XMSUBJ^XMXPARM("XMSUBJ",$G(XMSUBJ)) Q:$D(XMERR)
  1. S (XMIM("SUBJ"),XMFDA(3.9,XMZ_",",.01))=$$ENCODEUP^XMXUTIL1(XMSUBJ)
  1. D FILE^DIE("","XMFDA")
  1. Q
  1. TEXT(XMZ,XMBODY) ; Replace Text
  1. D WP^DIE(3.9,XMZ_",",3,"",XMBODY)
  1. Q
  1. VAPOR(XMZ,XMVAPOR,XMINSTR,XMMSG) ; Vaporize date
  1. I XMVAPOR="@" D Q
  1. . K XMINSTR("VAPOR")
  1. . S XMFDA(3.9,XMZ_",",1.6)="@"
  1. . D FILE^DIE("","XMFDA")
  1. . S XMMSG=$$EZBLD^DIALOG(37318.9) ; Vaporize Date removed
  1. S XMINSTR("VAPOR")=XMVAPOR
  1. S XMFDA(3.9,XMZ_",",1.6)=XMINSTR("VAPOR")
  1. D FILE^DIE("","XMFDA")
  1. S XMMSG=$$EZBLD^DIALOG(37317.9) ; Vaporize Date set
  1. Q
  1. FLAGTOGL(XMZ,XMFIELD,XMINSTR,XMFLAG,XMSET,XMREMOVE,XMMSG) ; Flag Toggle (For internal MM use only!)
  1. N XMFDA
  1. I $G(XMINSTR("FLAGS"))[XMFLAG D
  1. . S XMINSTR("FLAGS")=$TR(XMINSTR("FLAGS"),XMFLAG)
  1. . S XMMSG=$$EZBLD^DIALOG(XMREMOVE)
  1. . I XMFLAG="P" D
  1. . . S XMFDA(3.9,XMZ_",",XMFIELD)=$S($G(XMINSTR("TYPE"))="":"@",1:XMINSTR("TYPE"))
  1. . E S XMFDA(3.9,XMZ_",",XMFIELD)="@"
  1. E D
  1. . S XMINSTR("FLAGS")=$G(XMINSTR("FLAGS"))_XMFLAG
  1. . S XMMSG=$$EZBLD^DIALOG(XMSET)
  1. . I XMFLAG="P" S XMFDA(3.9,XMZ_",",XMFIELD)=$G(XMINSTR("TYPE"))_"P"
  1. . E S XMFDA(3.9,XMZ_",",XMFIELD)="y"
  1. D FILE^DIE("","XMFDA")
  1. Q