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

XMJMSO.m

Go to the documentation of this file.
  1. XMJMSO ;ISC-SF/GMB-Options at 'send' transmit prompt ;07/17/2003 14:06
  1. ;;8.0;MailMan;**20**;Jun 28, 2002
  1. ; Replaces ^XMA22 (ISC-WASH/CAP/THM)
  1. SENDMSG(XMDUZ,XMZ,XMSUBJ,XMINSTR,XMRESTR,XMABORT) ;
  1. N XMFINISH,XMDIR,XMY,XMOPT,XMOX
  1. I $$BCAST,'$D(XMINSTR("VAPOR")),$$QVAPOR D V
  1. S XMFINISH=0
  1. F D Q:XMFINISH!XMABORT
  1. . D SENDSET(.XMINSTR,.XMOPT,.XMOX,.XMDIR)
  1. . D XMDIR^XMJDIR(.XMDIR,.XMOPT,.XMOX,.XMY,.XMABORT) Q:XMABORT
  1. . K XMDIR,XMOPT,XMOX
  1. . D @XMY
  1. Q
  1. SENDSET(XMINSTR,XMOPT,XMOX,XMDIR) ;
  1. D OPTEDIT^XMXSEC2(.XMINSTR,.XMOPT,.XMOX,1)
  1. D SET^XMXSEC2("B",37331,.XMOPT,.XMOX) ; Backup to review message
  1. D SET^XMXSEC2("ER",37332,.XMOPT,.XMOX) ; Edit Recipients
  1. D SET^XMXSEC2("L",37333,.XMOPT,.XMOX) ; Transmit later
  1. D SET^XMXSEC2("IM",37445,.XMOPT,.XMOX) ; Include responses from another message
  1. D SET^XMXSEC2("T",37334,.XMOPT,.XMOX) ; Transmit now
  1. I $G(XMOPT("NS","?"))=37309.1 K XMOPT("NS","?") ; You have no Network Signature.
  1. S XMDIR("A")=$$EZBLD^DIALOG(34067) ; Select Message option:
  1. S XMDIR("B")=XMOX("O","T")_":"_XMOPT("T") ; Transmit now
  1. S XMDIR("??")="XM-U-MO-SEND"
  1. Q
  1. B ; Backup to review message
  1. D BACKUP^XMJMP(XMDUZ,0,"",XMZ)
  1. ; OR D PRINTIT^XMJMP1(....)
  1. Q
  1. FLAGTOGL(XMINSTR,XMFLAG,XMSET,XMREMOVE) ; Flag Toggle
  1. I $G(XMINSTR("FLAGS"))[XMFLAG D
  1. . S XMINSTR("FLAGS")=$TR(XMINSTR("FLAGS"),XMFLAG)
  1. . W !,$$EZBLD^DIALOG(XMREMOVE)
  1. E D
  1. . S XMINSTR("FLAGS")=$G(XMINSTR("FLAGS"))_XMFLAG
  1. . W !,$$EZBLD^DIALOG(XMSET)
  1. Q
  1. C ; Confidential msg
  1. D FLAGTOGL(.XMINSTR,"C",37301.9,37302.9)
  1. Q
  1. D ; Deliver to recipient basket
  1. I $D(XMINSTR("RCPT BSKT")) D Q
  1. . K XMINSTR("RCPT BSKT")
  1. . W !,$$EZBLD^DIALOG(37304.9) ; Delivery basket removed.
  1. N XMTEXT
  1. W !
  1. D BLD^DIALOG(37303.1,"","","XMTEXT","F")
  1. D MSG^DIALOG("WM","",80,"","XMTEXT")
  1. W !
  1. ;The delivery basket is the basket to which this message should be delivered
  1. ;for all recipients (even future ones, should the message be forwarded).
  1. ;Any message filters, which the recipient might have, are ignored."
  1. ;If the basket does not exist, it will be created."
  1. ;Note: The recipients must have chosen to allow delivery baskets by setting
  1. ;ACCEPT DELIVERY BASKET? under 'Personal Preferences|Delivery Basket Edit'
  1. ;to one of the following:
  1. ; YES - If basket doesn't exist, create it, and deliver the message to it.
  1. ; EXIST - If the basket already exists, then deliver the message to it.
  1. ; Else, just deliver the message as usual.
  1. ; SELECT - If the basket already exists AND accepts such messages,
  1. ; then deliver the message to it.
  1. ; Else, just deliver the message as usual.
  1. ;If the recipient has not set this field or has set it to NO, then
  1. ;the message would be delivered as usual.
  1. N XMDIC,XMK,XMKN
  1. S XMDIC("B")="@"
  1. S XMDIC("S")="I Y>1"
  1. D SELBSKT^XMJBU(XMDUZ,$$EZBLD^DIALOG(37303.2),"L",.XMDIC,.XMK,.XMKN) ; Select delivery basket:
  1. Q:XMK=U
  1. S XMINSTR("RCPT BSKT")=XMKN
  1. Q
  1. ER ; Additional Recipients
  1. D TOWHOM^XMJMT(XMDUZ,$$EZBLD^DIALOG(34110),.XMINSTR,.XMRESTR,.XMABORT) ; Send
  1. Q
  1. ES ; Edit Subject
  1. N XMOLDSUB,XMABORT
  1. S XMOLDSUB=XMSUBJ,XMABORT=0
  1. D SUBJ^XMJMS(.XMSUBJ,.XMABORT) Q:XMABORT
  1. Q:XMSUBJ=XMOLDSUB
  1. N XMFDA
  1. S XMFDA(3.9,XMZ_",",.01)=XMSUBJ
  1. D FILE^DIE("","XMFDA")
  1. Q
  1. ET ; Edit msg
  1. I $G(XMPAKMAN) Q:$$NOPAKEDT
  1. D BODY^XMJMS(XMDUZ,XMZ,XMSUBJ,.XMRESTR,.XMABORT)
  1. Q
  1. NOPAKEDT() ; Function returns 0 if OK to edit; 1, if not OK.
  1. I $D(XMSECURE) W !,$$EZBLD^DIALOG(37405.4) Q 1 ; You may not edit a secure KIDS or PackMan message.
  1. N DIR,X,Y,DIRUT
  1. W @IOF
  1. N XMTEXT
  1. D BLD^DIALOG(37306.1,"","","XMTEXT","F")
  1. D MSG^DIALOG("WM","",80,"","XMTEXT")
  1. ; W A R N I N G
  1. ; You are about to edit what appears to be a PackMan message.
  1. ; Please note the following:
  1. ; 1. If you edit this message you may compromise its integrity.
  1. ; 2. If you must edit it,
  1. ; - Do not edit the code.
  1. ; - Confine your editing to the text (the lines between $TXT and $ENDTXT).
  1. ; - You may insert lines in the text.
  1. ; - Do not begin any line with a '$' (dollar sign).
  1. ; - Be careful!
  1. S DIR(0)="Y"
  1. S DIR("A")=$$EZBLD^DIALOG(37306.2) ; Are you sure you want to edit this message
  1. S DIR("B")=$$EZBLD^DIALOG(39053) ; NO
  1. D ^DIR
  1. Q 'Y
  1. I ; Information only msg
  1. D FLAGTOGL(.XMINSTR,"I",37307.9,37308.9)
  1. Q
  1. IM ; Include responses from another message
  1. I $G(XMPAKMAN) D Q
  1. . W !,$$EZBLD^DIALOG(37445.4) ; You may not Include anything into a KIDS or PackMan message.
  1. D INCL^XMJMRO(XMDUZ,XMZ,XMZ,XMSUBJ,.XMRESTR,2,.XMABORT)
  1. Q
  1. L ; Transmit Later
  1. N DIR,X,Y,XMWHEN,ZTRTN,ZTDTH,ZTDESC,ZTIO,ZTSAVE,ZTSK,XMROOT,I,DIRUT
  1. I $E($O(^TMP("XMY0",$J,"G.")),1,2)="G." D
  1. . ;Note: When you send a message Later, it is sent to all members of
  1. . ;the groups to which you addressed it, even if you 'minus'ed anyone.
  1. . ;To have your 'minus'es honored, you must ^-out of this and Transmit
  1. . ;Now, not Later. If you didn't 'minus' anyone from the groups, just
  1. . ;ignore this note, and continue ...
  1. . N XMTEXT
  1. . W !
  1. . D BLD^DIALOG(37333.3,"","","XMTEXT","F")
  1. . D MSG^DIALOG("WM","",80,"","XMTEXT")
  1. . W !
  1. S DIR(0)="D^NOW:"_$$SCH^XLFDT("12M",DT)_":ETX"
  1. S DIR("A")=$$EZBLD^DIALOG(37333.1) ; Enter Date@time at which to send this message
  1. D ^DIR Q:$D(DIRUT)
  1. S XMWHEN=Y
  1. W !,$$EZBLD^DIALOG(37333.2) ; Latering ...
  1. S ZTIO=""
  1. S ZTRTN="LATER^XMXSEND"
  1. S ZTDTH=$$FMTH^XLFDT(XMWHEN)
  1. S ZTDESC=$$EZBLD^DIALOG(39310) ; MailMan: Send Message Later
  1. S XMROOT=$$GET1^DIQ(3.9,XMZ_",",3,"","^TMP(""XM"",$J,""BODY"")")
  1. F I="DUZ","XMDUZ","XMSUBJ","^TMP(""XMY0"",$J,","^TMP(""XM"",$J,""BODY"",","XMINSTR(" S ZTSAVE(I)=""
  1. D ^%ZTLOAD
  1. ;D HOME^%ZIS call this only if preceded by call to ^%ZIS
  1. I $D(ZTSK) D
  1. . S XMFINISH=1
  1. . W $$EZBLD^DIALOG(37333.9,ZTSK) ; Latered (Task #_ZTSK_)
  1. . D KILLMSG^XMXUTIL(XMZ)
  1. . D CLEANUP^XMXADDR
  1. E D
  1. . W !,$C(7),$$EZBLD^DIALOG(37333.8) ; Latering was not successful. Try again or transmit now.
  1. K ^TMP("XM",$J,"BODY")
  1. Q
  1. NS ; Add Network Signature
  1. I '$$GOTNS^XMVVITA(XMDUZ) D Q:'$$GOTNS^XMVVITA(XMDUZ)
  1. . W !!,$$EZBLD^DIALOG(37309.1) ; You have no Network Signature.
  1. . D CRE8NS^XMVVITA
  1. N XMMSG
  1. D NETSIG^XMXEDIT(XMDUZ,XMZ,.XMINSTR,.XMMSG)
  1. W !,XMMSG
  1. Q
  1. P ; Priority msg
  1. D FLAGTOGL(.XMINSTR,"P",37311.9,37312.9)
  1. Q
  1. R ; Confirm receipt of msg
  1. D FLAGTOGL(.XMINSTR,"R",37313.9,37314.9)
  1. Q
  1. S ; Scramble text
  1. I $D(XMINSTR("SCR KEY")) D Q
  1. . K XMINSTR("SCR KEY"),XMINSTR("SCR HINT")
  1. . W !,$$EZBLD^DIALOG(37316.8) ; Scramble removed
  1. N XMKEY,XMHINT,XMABORT
  1. S XMABORT=0
  1. D CRE8KEY^XMJMCODE(.XMKEY,.XMHINT,.XMABORT)
  1. I XMABORT W !,$$EZBLD^DIALOG(37315.8) Q ; Scramble aborted.
  1. S XMINSTR("SCR KEY")=XMKEY
  1. S XMINSTR("SCR HINT")=XMHINT
  1. Q
  1. T ; Transmit now
  1. S XMFINISH=1
  1. W $$EZBLD^DIALOG(34217,XMZ) ; Sending [_XMZ_]...
  1. D MOVEPART^XMXSEND(XMDUZ,XMZ,.XMINSTR)
  1. D SEND^XMKP(XMDUZ,XMZ,.XMINSTR)
  1. D CHECK^XMKPL
  1. W !,$$EZBLD^DIALOG(34213) ; Sent
  1. Q
  1. V ; Vaporize date
  1. I $G(XMINSTR("VAPOR")) D Q
  1. . K XMINSTR("VAPOR")
  1. . W !,$$EZBLD^DIALOG(37318.9) ; Vaporize Date removed
  1. N DIR,X,Y,DIRUT,XMTP1
  1. S XMTP1=$$FMADD^XLFDT($$NOW^XLFDT,,1)
  1. S DIR(0)="3.9,1.6"
  1. S DIR("A")=$$EZBLD^DIALOG(37317.1) ; Enter Vaporize Date
  1. S DIR("B")=$$MMDT^XMXUTIL1($$FMADD^XLFDT(DT,30))
  1. V2 D ^DIR Q:$D(DIRUT)
  1. I Y<XMTP1 D G V2
  1. . W " ??",$C(7),!,$$EZBLD^DIALOG(37317.2),! ; Must be no earlier than 1 hour from now.
  1. S XMINSTR("VAPOR")=Y
  1. Q
  1. X ; Closed msg
  1. D FLAGTOGL(.XMINSTR,"X",37319.9,37320.9)
  1. Q
  1. BCAST() ; Is this a broadcast (regular or limited)?
  1. N XMTO
  1. S XMTO=$O(^TMP("XMY0",$J,"*"))
  1. I $E(XMTO)="*" Q 1
  1. Q 0
  1. QVAPOR() ;
  1. N DIR
  1. W !
  1. S DIR(0)="Y"
  1. D BLD^DIALOG(37350,"","","DIR(""A"")")
  1. D BLD^DIALOG(37351,"","","DIR(""?"")")
  1. S DIR("??")="XM-U-M-VAPORIZE DATE SEND"
  1. S DIR("B")=$$EZBLD^DIALOG(39054) ; Yes
  1. D ^DIR Q:$D(DIRUT) 0
  1. Q Y