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

XMJMOI.m

Go to the documentation of this file.
  1. XMJMOI ;ISC-SF/GMB-Options at Ignore prompt ;03/20/2003 09:28
  1. ;;8.0;MailMan;**15**;Jun 28, 2002
  1. ; Replaces ^XMA1,^XMA10 (ISC-WASH/CAP/THM)
  1. READMSG(XMNEWS,XMDUZ,XMK,XMKN,XMZ,XMABORT) ;
  1. N XMFINISH,XMFROM,XMINSTR,XMRESTR,XMIEN,XMSUBJ,XMSETPRI,XMRESPSO,XMRESP,XMORIGN8,XMDIR,XMY,XMOPT,XMOX
  1. D INIT^XMJMOI1(XMDUZ,XMZ,.XMSUBJ,.XMFROM,.XMORIGN8,.XMINSTR,.XMRESTR,.XMIEN,.XMRESPSO,.XMRESP)
  1. S (XMFINISH,XMABORT)=0
  1. F D Q:XMFINISH!XMABORT
  1. . N XMNAME,XMEDITOK
  1. . D CHKBSKT(XMDUZ,XMZ,.XMK,.XMKN)
  1. . D READSET^XMJMOI1(XMDUZ,XMK,XMKN,XMZ,XMFROM,XMORIGN8,.XMINSTR,XMIEN,.XMDIR,.XMOPT,.XMOX)
  1. . I XMIEN,'$D(XMOPT("B","?")) D CHKRESP^XMJMP(XMDUZ,XMZ,XMRESPSO,XMRESP)
  1. . D XMDIR^XMJDIR(.XMDIR,.XMOPT,.XMOX,.XMY,.XMABORT)
  1. . S XMEDITOK='$D(XMOPT("E","?")) ; Used in 'forward'
  1. . K XMDIR,XMOPT,XMOX
  1. . Q:XMABORT
  1. . D CHKBSKT(XMDUZ,XMZ,.XMK,.XMKN)
  1. . D @XMY
  1. D:XMINSTR("FLAGS")["P" PRIORITY^XMJMOI1
  1. I XMINSTR("FLAGS")["N" D Q
  1. . I XMNEWS D Q
  1. . . I $D(^XTMP("XM","MAKENEW",XMDUZ,XMZ)),$D(^XMB(3.7,XMDUZ,"N0",XMK,XMZ)) D NONEW^XMXUTIL(XMDUZ,XMK,XMZ,1)
  1. . D MAKENEW^XMXUTIL(XMDUZ,XMK,XMZ,1)
  1. ;I 'XMABORT,$D(^XMB(3.7,XMDUZ,"N0",XMK,XMZ)),+XMRESP=+$P($G(^XMB(3.9,XMZ,3,0)),U,4) D NONEW^XMXUTIL(XMDUZ,XMK,XMZ,1)
  1. I 'XMABORT,$D(^XMB(3.7,XMDUZ,"N0",XMK,XMZ)) D NONEW^XMXUTIL(XMDUZ,XMK,XMZ,1)
  1. I XMABORT,XMNEWS,'$D(^XMB(3.7,XMDUZ,"N0",XMK,XMZ)) S ^XTMP("XM","MAKENEW",XMDUZ,XMZ)=""
  1. Q
  1. CHKBSKT(XMDUZ,XMZ,XMK,XMKN) ; Is the message still where we think it is?
  1. I XMK,'$D(^XMB(3.7,"M",XMZ,XMDUZ,XMK)) D RESETXMK^XMJMOI1(XMDUZ,XMZ,.XMK,.XMKN) Q
  1. I 'XMK,$D(^XMB(3.7,"M",XMZ,XMDUZ)) D RESETXMK^XMJMOI1(XMDUZ,XMZ,.XMK,.XMKN)
  1. Q
  1. A ; Answer to sender only
  1. I '$$GOTNS^XMVVITA(XMDUZ) D Q:'$$GOTNS^XMVVITA(XMDUZ)
  1. . W !!,$$EZBLD^DIALOG(37401.1) ; You must have a Network Signature to Answer a message.
  1. . D CRE8NS^XMVVITA
  1. D ANSWER^XMJMA(XMDUZ,XMZ,XMSUBJ,XMFROM)
  1. D IMBACK^XMJMOI1(34070) ; Finished with 'Answer' command.
  1. Q
  1. AA ; Access Attachments
  1. N XMAPBLOB
  1. I $G(IOT)="IMPC" D BLOB^XMAPBLOB Q
  1. D NODISP^XMAPBLOB
  1. Q
  1. B ; Backup
  1. D BACKUP^XMJMP(XMDUZ,XMK,XMKN,XMZ)
  1. S XMRESP=$P($G(^XMB(3.9,XMZ,1,XMIEN,0)),U,2)
  1. Q
  1. BR ; Print to the Browser
  1. D PRINT(1,1)
  1. Q
  1. C ; Copy
  1. D COPY^XMJMC(XMDUZ,XMK,XMZ,XMFROM)
  1. D IMBACK^XMJMOI1(34071) ; Finished with 'Copy' command.
  1. Q
  1. D ; Delete
  1. D DEL^XMXMSGS2(XMDUZ,XMK,XMZ)
  1. W !,$$EZBLD^DIALOG(34302.2) ; Message deleted.
  1. S XMFINISH=1
  1. Q:XMINSTR("FLAGS")'["N"
  1. S XMINSTR("FLAGS")=$TR(XMINSTR("FLAGS"),"N")
  1. K:XMNEWS ^XTMP("XM","MAKENEW",XMDUZ,XMZ)
  1. Q
  1. E ; Edit
  1. D EDIT^XMJMOIE(XMDUZ,XMK,XMZ,.XMSUBJ,.XMINSTR,.XMRESTR)
  1. Q
  1. F ; Forward
  1. N XMABORT
  1. D GETRESTR^XMJMOI1(XMDUZ,XMZ,"",.XMINSTR,.XMRESTR)
  1. S XMABORT=0
  1. D INIT^XMXADDR
  1. D TOWHOM^XMJMT(XMDUZ,$$EZBLD^DIALOG(34111),.XMINSTR,.XMRESTR,.XMABORT) ; Find out to whom to forward
  1. I 'XMABORT D
  1. . I XMEDITOK,'$D(XMINSTR("VAPOR")),$$BCAST^XMJMSO D I XMABORT W !,$$EZBLD^DIALOG(34309.4) Q ; Message not forwarded.
  1. . . I '$$QVAPOR^XMJMSO S:$D(DTOUT)!$D(DUOUT) XMABORT=1 Q
  1. . . D V^XMJMOIE I $D(DTOUT)!$D(DUOUT) S XMABORT=1
  1. . D FWD^XMKP(XMDUZ,XMZ,.XMINSTR)
  1. . W !,$$EZBLD^DIALOG(34309.2) ; Message forwarded.
  1. D CLEANUP^XMXADDR
  1. Q
  1. H ; Headerless Print
  1. D PRINT(0)
  1. Q
  1. HG ; Help:Group Information
  1. D HELP^XMHIG
  1. Q
  1. HU ; Help:User Information
  1. D HELP^XMHIU
  1. Q
  1. I ; Ignore
  1. S XMFINISH=1
  1. Q
  1. IN ; Information Only toggle
  1. I $G(XMINSTR("FLAGS"))["I" D
  1. . S XMINSTR("FLAGS")=$TR(XMINSTR("FLAGS"),"I")
  1. . S $P(^XMB(3.9,XMZ,0),U,12)=""
  1. . W !,$$EZBLD^DIALOG(37409.9) ; Message is no longer 'Information only'.
  1. E D
  1. . S XMINSTR("FLAGS")=$G(XMINSTR("FLAGS"))_"I"
  1. . S $P(^XMB(3.9,XMZ,0),U,12)="y"
  1. . W !,$$EZBLD^DIALOG(37408.9) ; Message is now 'Information only'. No one may reply.
  1. Q
  1. K ; Toggle Priority of future replies
  1. I $G(XMINSTR("FLAGS"))["K" D
  1. . S XMINSTR("FLAGS")=$TR(XMINSTR("FLAGS"),"K")
  1. . S $P(^XMB(3.9,XMZ,1,XMIEN,0),U,9)=1
  1. . W !,$$EZBLD^DIALOG(37412.9) ; Responses will not be delivered as Priority Mail.
  1. E D
  1. . S XMINSTR("FLAGS")=$G(XMINSTR("FLAGS"))_"K"
  1. . S $P(^XMB(3.9,XMZ,1,XMIEN,0),U,9)=""
  1. . W !,$$EZBLD^DIALOG(37411.9) ; Responses will be delivered as Priority Mail.
  1. S XMSETPRI=1
  1. Q
  1. L ; Later
  1. D LATER^XMJMD(XMDUZ,XMZ)
  1. Q
  1. N ; Toggle New
  1. I XMINSTR("FLAGS")["N" D
  1. . S XMINSTR("FLAGS")=$TR(XMINSTR("FLAGS"),"N")
  1. . K:XMNEWS ^XTMP("XM","MAKENEW",XMDUZ,XMZ)
  1. . W !,$$EZBLD^DIALOG(37415.9) ; Message will NOT be new next time.
  1. E D
  1. . S XMINSTR("FLAGS")=XMINSTR("FLAGS")_"N"
  1. . S:XMNEWS ^XTMP("XM","MAKENEW",XMDUZ,XMZ)=""
  1. . W !,$$EZBLD^DIALOG(37414.9) ; Message will be new next time.
  1. . I XMK>.5!XMNEWS Q
  1. . D SAVEMSG(XMDUZ,.XMK,.XMKN,XMZ,XMSUBJ,XMFROM,$G(XMINSTR("RCPT BSKT")))
  1. Q
  1. P ; Print
  1. D PRINT(1)
  1. Q
  1. PRINT(XMPRTHDR,XMBROWSE) ;
  1. N XMABORT
  1. S XMABORT=0
  1. I '$G(XMBROWSE),XMINSTR("TYPE")["K"!(XMINSTR("TYPE")["X") D Q:XMABORT
  1. . N DIR,XMMSG,XMPARM
  1. . S XMMSG=$$EZBLD^DIALOG($S(XMINSTR("TYPE")["K":34076,1:34077)) ; KIDS build / PackMan message
  1. . D BLD^DIALOG(34078,XMMSG,"","DIR(""A"")") ; Print just the descriptive text of this _XMMSG
  1. . ;This is a _XMMSG_.
  1. . ;Answer YES to print just the descriptive text.
  1. . ;Answer NO to print the whole thing (x lines) and/or any responses.
  1. . S XMPARM(1)=XMMSG,XMPARM(2)=$$LINE^XMXUTIL2(XMZ)
  1. . D BLD^DIALOG(34079,.XMPARM,"","DIR(""?"")") ; Print just the descriptive text of this _XMMSG
  1. . S DIR(0)="Y",DIR("B")=$$EZBLD^DIALOG(39054) ; Yes
  1. . D ^DIR I $D(DIRUT) S XMABORT=1 Q
  1. . Q:'Y
  1. . N A,DIE,DIF,X,XCF,XCN,XMR
  1. . S XMR=^XMB(3.9,XMZ,0)
  1. . D XT^XMP2
  1. . S XMABORT=1
  1. D PRINT^XMJMP(XMDUZ,XMK,XMZ,XMPRTHDR,.XMBROWSE)
  1. S XMRESP=$P($G(^XMB(3.9,XMZ,1,XMIEN,0)),U,2)
  1. Q
  1. Q ; Query
  1. D Q^XMJMQ(XMDUZ,XMK,XMKN,XMZ)
  1. Q
  1. QC ; Query Current
  1. D QX^XMJMQ(XMDUZ,XMK,XMKN,XMZ,"QC")
  1. Q
  1. QD ; Query Detailed
  1. I $D(XMNAME) D QNAMEX^XMJMQ(XMDUZ,XMK,XMKN,XMZ,XMNAME) Q
  1. D QD^XMJMQ(XMDUZ,XMK,XMKN,XMZ)
  1. Q
  1. QN ; Query Network
  1. D QN^XMJMQ(XMDUZ,XMK,XMKN,XMZ)
  1. Q
  1. QNC ; Query Not Current
  1. D QX^XMJMQ(XMDUZ,XMK,XMKN,XMZ,"QNC")
  1. Q
  1. QT ; Query Terminated
  1. D QX^XMJMQ(XMDUZ,XMK,XMKN,XMZ,"QT")
  1. Q
  1. RI ; Reply, Include previous response(s)
  1. R ; Reply
  1. N XMINCL
  1. S XMINCL=(XMY="RI")
  1. I $D(^XMB(3.7,XMDUZ,"N0",XMK,XMZ)),+XMRESP=+$P($G(^XMB(3.9,XMZ,3,0)),U,4) D NONEW^XMXUTIL(XMDUZ,XMK,XMZ,1)
  1. D REPLY^XMJMR(XMDUZ,.XMK,.XMKN,XMZ,XMSUBJ,XMFROM,.XMINSTR,XMIEN,XMRESPSO,XMINCL,.XMRESP)
  1. Q
  1. S ; Save (replaces S^XMA1B)
  1. N XMKTO,XMDIC
  1. I XMK,XMK'=.5 S XMDIC("B")="@" ; no default basket
  1. E D
  1. . N XMKTO
  1. . S XMKTO=0
  1. . D CHEKBSKT^XMTDL2(XMDUZ,.XMKTO,XMSUBJ,XMFROM,$G(XMINSTR("RCPT BSKT")))
  1. . S XMDIC("B")=$P(^XMB(3.7,XMDUZ,2,XMKTO,0),U)
  1. D SELBSKT^XMJBU(XMDUZ,$$EZBLD^DIALOG(34325.1),"L",.XMDIC,.XMKTO) Q:XMKTO=U ; Save message into basket:
  1. D CHKBSKT(XMDUZ,XMZ,.XMK,.XMKN)
  1. I XMKTO=XMK D
  1. . W !,$$EZBLD^DIALOG(34326.1) ; That's the same basket the message is already in.
  1. E D
  1. . I $D(^XMB(3.7,XMDUZ,"N0",XMK,XMZ)) D NONEW^XMXUTIL(XMDUZ,XMK,XMZ,1)
  1. . D MOVEIT^XMXMSGS2(XMDUZ,XMK,XMZ,XMKTO)
  1. . W !,$$EZBLD^DIALOG(34324.2) ; Message saved.
  1. . S XMK=XMKTO
  1. S XMFINISH=1
  1. Q
  1. T ; Terminate (replaces T^XMA1)
  1. D TERM^XMXMSGS2(XMDUZ,XMK,XMZ)
  1. W !,$$EZBLD^DIALOG($S(XMK<1:34331.1,1:34331)) ; You won't see future replies. (In WASTE basket)
  1. S XMFINISH=1
  1. S:XMINSTR("FLAGS")["P" XMINSTR("FLAGS")=$TR(XMINSTR("FLAGS"),"P")
  1. Q:XMINSTR("FLAGS")'["N"
  1. S XMINSTR("FLAGS")=$TR(XMINSTR("FLAGS"),"N")
  1. K:XMNEWS ^XTMP("XM","MAKENEW",XMDUZ,XMZ)
  1. Q
  1. V ; Set Vaporize date for msg in basket (replaces DATE^XMA11A)
  1. N DIE,DA,DR
  1. L +^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0):1
  1. S DIE="^XMB(3.7,"_XMDUZ_",2,"_XMK_",1,"
  1. S DA(2)=XMDUZ,DA(1)=XMK,DA=XMZ
  1. S DR=5
  1. D ^DIE
  1. L -^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)
  1. Q
  1. W ; Write a new msg
  1. N XMSECURE,XMPAKMAN,XMSECBAD ; Needed! (In case Write from KIDS msg.)
  1. D SEND^XMJMS
  1. D IMBACK^XMJMOI1(34072) ; Finished with 'Write' command.
  1. Q
  1. X ; Xtract PackMan msg
  1. I XMDUZ=.5,XMK>999 G XP
  1. N X,DIC,C,I,ER,J,K,T,X2,XCF,XCM,XCN,XMLOC,XMN,XMP0,XMR,XMS
  1. S X=XMZ,DIC(0)="N"
  1. D MM^XMP
  1. Q
  1. XP ; Xmit Priority Toggle (for remote transmit queues only)
  1. N XMTPRI,XMABORT
  1. S XMABORT=0
  1. D ASKPRI^XMJMORX(.XMTPRI,.XMABORT) Q:XMABORT
  1. D XP^XMXMSGS1(XMDUZ,XMK,XMZ,XMTPRI)
  1. Q
  1. SAVEMSG(XMDUZ,XMK,XMKN,XMZ,XMSUBJ,XMFROM,XMZBSKT) ;
  1. ; The message is currently in the waste basket or no basket.
  1. ; Save it to an appropriate (not waste) basket.
  1. N XMKTO
  1. S XMKTO=0
  1. D CHEKBSKT^XMTDL2(XMDUZ,.XMKTO,XMSUBJ,XMFROM,$G(XMINSTR("RCPT BSKT")))
  1. S:XMKTO=.5 XMKTO=1
  1. S XMKN=$P(^XMB(3.7,XMDUZ,2,XMKTO,0),U,1)
  1. I 'XMK D
  1. . D PUTMSG^XMXMSGS2(XMDUZ,XMKTO,XMKN,XMZ)
  1. E D
  1. . ; Message is in waste basket
  1. . D COPYIT^XMXMSGS2(XMDUZ,.5,XMZ,XMKTO)
  1. . D ZAPIT^XMXMSGS2(XMDUZ,.5,XMZ)
  1. S XMK=XMKTO
  1. W !,$$EZBLD^DIALOG(34325.9,XMKN) ; Message saved to _XMKN_ basket.
  1. Q