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

XMJMR.m

Go to the documentation of this file.
XMJMR ;ISC-SF/GMB-Interactive Reply ;04/24/2002  10:28
 ;;8.0;MailMan;;Jun 28, 2002
 ; Replaces REPLY^XMA11,^XMA2,^XMA20,^XMAH1 (ISC-WASH/CAP/THM)
REPLY(XMDUZ,XMK,XMKN,XMZO,XMZOSUBJ,XMZOFROM,XMINSTR,XMPTR,XMRESPSO,XMINCL,XMRESP) ;
 N XMABORT,XMZ,XMID,XMWHICH,XMZI
 S XMABORT=0
 D INIT^XMJMR1(XMDUZ,.XMK,.XMKN,XMZO,XMZOSUBJ,XMZOFROM,.XMINSTR,XMINCL,.XMZI,.XMWHICH,.XMABORT) Q:XMABORT
 D CRE8XMZ^XMXSEND("R"_XMZO,.XMZ,1) I XMZ<1 S XMABORT=1 Q
 S XMID=$S(XMDUZ=.6:DUZ,1:XMDUZ)
 D EDITON^XMJMS(XMID,XMZ,XMZO)
 D PROCESS(XMID,XMK,XMKN,XMZO,XMZOSUBJ,XMZOFROM,XMZ,.XMINSTR,XMPTR,XMRESPSO,.XMRESP,.XMZI,.XMWHICH,.XMABORT)
 I XMABORT=DTIME D HALT^XMJMS($$EZBLD^DIALOG(34220)) ; replying to
 D EDITOFF^XMJMS(XMID)
 D:XMABORT KILLMSG^XMXUTIL(XMZ)
 Q
PROCESS(XMDUZ,XMK,XMKN,XMZO,XMZOSUBJ,XMZOFROM,XMZ,XMINSTR,XMPTR,XMRESPSO,XMRESP,XMZI,XMWHICH,XMABORT) ;
 N XMRESTR
 S XMRESTR("REPLYTO")=XMZO
 D:$D(XMWHICH) COPYTEXT^XMJMR1(XMZI,XMZ,XMWHICH,(XMZI'=XMZO))
 D BODY^XMJMS(XMDUZ,XMZ,XMZOSUBJ,.XMRESTR,.XMABORT) Q:XMABORT
 D REPLYMSG^XMJMRO(XMDUZ,XMK,XMKN,XMZO,XMZ,XMZOSUBJ,.XMRESTR,XMPTR,XMRESPSO,.XMRESP,.XMABORT) Q:XMABORT
 I XMZOFROM["@",$$UP^XLFSTR(XMZOFROM)'["POSTMASTER" D REMOTE(XMDUZ,XMZO,XMZOSUBJ,XMZ,.XMINSTR)
 Q
REMOTE(XMDUZ,XMZO,XMZOSUBJ,XMZ,XMINSTR) ;
 N DIR,Y,XMSUBJ,XMTO,XMABORT
 S XMABORT=0
 S DIR("A")=$$EZBLD^DIALOG(34206) ; Do you wish to send this reply across the network?
 S DIR(0)="Y",DIR("B")=$$EZBLD^DIALOG(39053) ; No
 D BLD^DIALOG(34207,"","","DIR(""?"")") ; Enter YES if you wish your response ...
 S DIR("??")="^D RHELP^XMJMR"
 D ^DIR Q:'Y!$D(DIRUT)
 S XMRE=$$EZBLD^DIALOG(37006) ; Re:
 S XMSUBJ=$S($$UP^XLFSTR($E(XMZOSUBJ,1,$L(XMRE)))=$$UP^XLFSTR(XMRE):XMZOSUBJ,1:$E(XMRE_XMZOSUBJ,1,65))
 D SUBJ^XMJMS(.XMSUBJ,.XMABORT) Q:XMABORT
 D REPLYTO(XMZO,.XMTO,.XMABORT) Q:XMABORT
 W !,$$EZBLD^DIALOG(34211,XMTO) ; Addressing the reply to: |1|
 D INIT^XMXADDR
 S XMINSTR("EXACT")=1 ; Match on exact domain name
 D ADDR^XMXADDR(XMDUZ,XMTO,.XMINSTR)
 K XMINSTR("EXACT")
 ;S:XMTO[".DOMAIN.EXT" XMTO=$TR($P(XMTO,"@"),"._+",", .")_"@"_$P(XMTO,"@",2)
 I $$GOTADDR^XMXADDR D
 . W !,$$EZBLD^DIALOG(34212) ; Sending network reply...
 . D NETREPLY^XMXREPLY(XMDUZ,XMZO,XMZ,XMSUBJ,.XMINSTR)
 . W $$EZBLD^DIALOG(34213) ; Sent
 D CLEANUP^XMXADDR
 Q
RHELP ;
 N XMTEXT
 D BLD^DIALOG(34208,"","","XMTEXT","F") ; A network response will go to all message ... (explains network reply)
 D MSG^DIALOG("WH","","","","XMTEXT")
 Q
REPLYTO(XMZ,XMFROM,XMABORT) ;
 N XMREPLTO,XMF,XMR
 D REPLYTO^XMXREPLY(XMZ,.XMFROM,.XMREPLTO)
 S XMF=XMFROM
 S XMFROM=$$REMADDR^XMXADDR3(XMFROM)
 Q:$G(XMREPLTO)=""
 S XMR=XMREPLTO
 S XMREPLTO=$$REMADDR^XMXADDR3(XMREPLTO)
 Q:$$UP^XLFSTR(XMREPLTO)=$$UP^XLFSTR(XMFROM)
 N DIR,Y
 S DIR(0)="S^"
 S DIR(0)=DIR(0)_"F:'FROM'     "_XMF
 S DIR(0)=DIR(0)_";R:'REPLY-TO' "_XMR
 S DIR("B")="R"
 D BLD^DIALOG(34214,"","","DIR(""A"")") ; This message has a 'reply-to' address ... (use which address?)
 D BLD^DIALOG(34215,"","","DIR(""?"")") ; Generally, we recommend that you use ...
 D ^DIR I $D(DIRUT) S XMABORT=1 Q
 S:Y="R" XMFROM=XMREPLTO
 Q
RECOVER(XMDUZ,XMZ,XMZO) ;
 I XMDUZ'=DUZ,$$ZCONFID^XMXSEC(XMZO) D  Q
 . ; If user is surrogate & msg is confidential, delete unsent reply.
 . D EDITOFF^XMJMS(XMDUZ)
 . D KILLMSG^XMXUTIL(XMZ)
 N XMSUBJ,DIR,Y,XMTEXT
 S XMSUBJ=$P(^XMB(3.9,XMZO,0),U,1)
 S:XMSUBJ["~U~" XMSUBJ=$$DECODEUP^XMXUTIL1(XMSUBJ)
 W $C(7),!
 ;You have / |1| has an unsent response in your buffer.
 D BLD^DIALOG($S(XMDUZ=DUZ:34222,1:34222.1),XMV("NAME"),"","XMTEXT","F")
 ;Subj: _XMSUBJ
 D BLD^DIALOG(34536,XMSUBJ,"","XMTEXT","FS")
 D MSG^DIALOG("WM","",79,"","XMTEXT")
 W !
 ;You may continue to reply, or delete the remaining text.
 ;Shall we delete the unsent response?
 D BLD^DIALOG(34222.3,"","","DIR(""A"")")
 S DIR(0)="Y"
 S DIR("B")=$$EZBLD^DIALOG(39053) ; No
 D BLD^DIALOG(34223,"","","DIR(""?"")") ; Enter YES to delete the unsent response...
 D ^DIR
 I $D(DTOUT) D HALT^XMJMS($$EZBLD^DIALOG(34221)) ; recovering
 I Y=1!$D(DUOUT) D  Q
 . D EDITOFF^XMJMS(XMDUZ)
 . D KILLMSG^XMXUTIL(XMZ)
 N XMK,XMKN,XMZOSUBJ,XMZOFROM,XMINSTR,XMABORT,XMSECURE,XMPAKMAN,XMWHICH,XMPTR,XMRESPSO,XMRESP
 S XMABORT=0
 D RECINIT(XMDUZ,XMZO,.XMK,.XMKN,.XMZOSUBJ,.XMZOFROM,.XMINSTR,.XMPTR,.XMRESPSO,.XMRESP)
 D WAIT^XMXUTIL
 D INIT^XMJMR1(XMDUZ,.XMK,.XMKN,XMZO,XMZOSUBJ,XMZOFROM,.XMINSTR,0,"",.XMWHICH,.XMABORT) Q:XMV("NOSEND")
 I XMABORT D HALT^XMJMS($$EZBLD^DIALOG(34221)) ; recovering
 D PROCESS(XMDUZ,XMK,XMKN,XMZO,XMZOSUBJ,XMZOFROM,XMZ,.XMINSTR,XMPTR,XMRESPSO,.XMRESP,"",.XMWHICH,.XMABORT)
 I XMABORT=DTIME D HALT^XMJMS($$EZBLD^DIALOG(34220)) ; replying to
 D EDITOFF^XMJMS(XMDUZ)
 D:XMABORT KILLMSG^XMXUTIL(XMZ)
 Q
RECINIT(XMDUZ,XMZO,XMK,XMKN,XMZOSUBJ,XMZOFROM,XMINSTR,XMPTR,XMRESPSO,XMRESP) ;
 N XMSECBAD,XMIM,XMIU
 S XMK=+$O(^XMB(3.7,"M",XMZO,XMDUZ,""))
 S XMKN=$P($G(^XMB(3.7,XMDUZ,2,XMK,0)),U,1)
 D DISPMSG^XMJMP(XMDUZ,XMK,XMKN,XMZO,.XMSECBAD,1)
 I $G(XMSECBAD) D HALT^XMJMS($$EZBLD^DIALOG(34221)) ; recovering
 D INMSG^XMXUTIL2(XMDUZ,0,XMZO,"","I",.XMIM,.XMINSTR,.XMIU)
 S XMZOSUBJ=XMIM("SUBJ")
 S XMZOFROM=XMIM("FROM")
 S XMRESPSO=XMIM("RESPS")
 S XMPTR=XMIU("IEN")
 S XMRESP=XMIU("RESP")
 Q