XMXPRT ;ISC-SF/GMB-Print messages ;12/04/2002 13:52
;;8.0;MailMan;**10**;Jun 28, 2002
; For messages printed to the P-MESSAGE device,
; XMAPSUBJ = message subject
; XMY = message addressees
PRINT1(XMDUZ,XMZ,XMPRTTO,XMINSTR,ZTSK,XMAPSUBJ,XMY) ; Print one message
N XMWHICH,XMRECIPS,XMPRTHDR,ZTSAVE,ZTRTN,ZTDESC,ZTIO,ZTDTH,ZTUCI
D PINIT(.XMINSTR,.XMPRTHDR,.XMRECIPS,.XMWHICH,.ZTDTH)
F I="XMV(","DUZ","XMDUZ","XMZ","XMWHICH","XMRECIPS","XMPRTHDR","XMAPSUBJ","XMY(" S ZTSAVE(I)=""
;S:$D(XMSECURE) (ZTSAVE("XMSECURE"),ZTSAVE("XMSECURE("))=""
S ZTIO=XMPRTTO
S ZTDESC=$$EZBLD^DIALOG(34501) ; MailMan: Print
S ZTRTN="XPMSG^XMXPRT"
D ^%ZTLOAD
Q
PRINTM(XMDUZ,XMPRTTO,XMINSTR,ZTSK,XMAPSUBJ,XMY) ; Print more than one message
N XMWHICH,XMRECIPS,XMPRTHDR,ZTSAVE,ZTRTN,ZTDESC,ZTIO,ZTDTH,ZTUCI
D PINIT(.XMINSTR,.XMPRTHDR,.XMRECIPS,.XMWHICH,.ZTDTH)
I "^0^*^"'[(U_XMWHICH_U) S XMWHICH="*"
F I="XMV(","DUZ","XMDUZ","XMZ","XMWHICH","XMRECIPS","XMPRTHDR","^TMP(""XM"",$J,""XMZ"",","XMAPSUBJ","XMY(" S ZTSAVE(I)=""
;S:$D(XMSECURE) (ZTSAVE("XMSECURE"),ZTSAVE("XMSECURE("))=""
S ZTIO=XMPRTTO
S ZTDESC=$$EZBLD^DIALOG(34501) ; MailMan: Print
S ZTRTN="XPRANGE^XMXPRT"
D ^%ZTLOAD
Q
PINIT(XMINSTR,XMPRTHDR,XMRECIPS,XMWHICH,XMWHEN) ;
; XMPRTHDR 1=Print header (default)
; 0=don't (headerless print)
; XMRECIPS 0=Don't print recipients (default)
; 1=Print summary recipients
; 2=Print detail recipients
S XMPRTHDR=+$G(XMINSTR("HDR"),1)
S XMRECIPS=+$G(XMINSTR("RECIPS"))
S XMWHICH=$G(XMINSTR("RESPS"),"*")
S XMWHEN=$G(XMINSTR("WHEN"),"NOW")
S XMWHEN=$S(XMWHEN="NOW":$H,1:$$FMTH^XLFDT(XMWHEN))
Q
PMSG(XMDUZ,XMZ,XMWHICH,XMRECIPS,XMPRTHDR,XMFIRST) ;
XPMSG ;
N XMK,XMKN,XMZREC,XMRESPS,XMPTR
S ZTREQ="@"
S XMK=+$O(^XMB(3.7,"M",XMZ,XMDUZ,""))
S XMKN=$S(XMK:$P(^XMB(3.7,XMDUZ,2,XMK,0),U,1),1:$$EZBLD^DIALOG(34014)) ; * N/A *
D RESPONSE^XMJMP(XMDUZ,XMZ,.XMRESPS,.XMPTR)
S:XMWHICH="*" XMWHICH=$S(XMRESPS:"0-"_XMRESPS,1:0)
S XMZREC=^XMB(3.9,XMZ,0)
I $E(IOST,1,2)="C-"!'$G(XMFIRST,1) W @IOF
D:XMPRTHDR IDHDR^XMJMP(XMDUZ)
D PRINTIT^XMJMP1(XMDUZ,XMK,XMKN,XMZ,XMZREC,XMRESPS,XMPTR,XMWHICH,XMRECIPS,0,XMPRTHDR)
Q
PRANGE(XMDUZ,XMWHICH,XMRECIPS,XMPRTHDR) ;
XPRANGE ; Print a range of messages.
N XMZ,XMFIRST
S XMZ=""
S XMFIRST=1
F S XMZ=$O(^TMP("XM",$J,"XMZ",XMZ)) Q:'XMZ D
. Q:'$D(^XMB(3.9,XMZ,0))
. D PMSG(XMDUZ,XMZ,XMWHICH,XMRECIPS,XMPRTHDR,.XMFIRST)
. S XMFIRST=0
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXMXPRT 2471 printed Dec 13, 2024@02:14:21 Page 2
XMXPRT ;ISC-SF/GMB-Print messages ;12/04/2002 13:52
+1 ;;8.0;MailMan;**10**;Jun 28, 2002
+2 ; For messages printed to the P-MESSAGE device,
+3 ; XMAPSUBJ = message subject
+4 ; XMY = message addressees
PRINT1(XMDUZ,XMZ,XMPRTTO,XMINSTR,ZTSK,XMAPSUBJ,XMY) ; Print one message
+1 NEW XMWHICH,XMRECIPS,XMPRTHDR,ZTSAVE,ZTRTN,ZTDESC,ZTIO,ZTDTH,ZTUCI
+2 DO PINIT(.XMINSTR,.XMPRTHDR,.XMRECIPS,.XMWHICH,.ZTDTH)
+3 FOR I="XMV(","DUZ","XMDUZ","XMZ","XMWHICH","XMRECIPS","XMPRTHDR","XMAPSUBJ","XMY("
SET ZTSAVE(I)=""
+4 ;S:$D(XMSECURE) (ZTSAVE("XMSECURE"),ZTSAVE("XMSECURE("))=""
+5 SET ZTIO=XMPRTTO
+6 ; MailMan: Print
SET ZTDESC=$$EZBLD^DIALOG(34501)
+7 SET ZTRTN="XPMSG^XMXPRT"
+8 DO ^%ZTLOAD
+9 QUIT
PRINTM(XMDUZ,XMPRTTO,XMINSTR,ZTSK,XMAPSUBJ,XMY) ; Print more than one message
+1 NEW XMWHICH,XMRECIPS,XMPRTHDR,ZTSAVE,ZTRTN,ZTDESC,ZTIO,ZTDTH,ZTUCI
+2 DO PINIT(.XMINSTR,.XMPRTHDR,.XMRECIPS,.XMWHICH,.ZTDTH)
+3 IF "^0^*^"'[(U_XMWHICH_U)
SET XMWHICH="*"
+4 FOR I="XMV(","DUZ","XMDUZ","XMZ","XMWHICH","XMRECIPS","XMPRTHDR","^TMP(""XM"",$J,""XMZ"",","XMAPSUBJ","XMY("
SET ZTSAVE(I)=""
+5 ;S:$D(XMSECURE) (ZTSAVE("XMSECURE"),ZTSAVE("XMSECURE("))=""
+6 SET ZTIO=XMPRTTO
+7 ; MailMan: Print
SET ZTDESC=$$EZBLD^DIALOG(34501)
+8 SET ZTRTN="XPRANGE^XMXPRT"
+9 DO ^%ZTLOAD
+10 QUIT
PINIT(XMINSTR,XMPRTHDR,XMRECIPS,XMWHICH,XMWHEN) ;
+1 ; XMPRTHDR 1=Print header (default)
+2 ; 0=don't (headerless print)
+3 ; XMRECIPS 0=Don't print recipients (default)
+4 ; 1=Print summary recipients
+5 ; 2=Print detail recipients
+6 SET XMPRTHDR=+$GET(XMINSTR("HDR"),1)
+7 SET XMRECIPS=+$GET(XMINSTR("RECIPS"))
+8 SET XMWHICH=$GET(XMINSTR("RESPS"),"*")
+9 SET XMWHEN=$GET(XMINSTR("WHEN"),"NOW")
+10 SET XMWHEN=$SELECT(XMWHEN="NOW":$HOROLOG,1:$$FMTH^XLFDT(XMWHEN))
+11 QUIT
PMSG(XMDUZ,XMZ,XMWHICH,XMRECIPS,XMPRTHDR,XMFIRST) ;
XPMSG ;
+1 NEW XMK,XMKN,XMZREC,XMRESPS,XMPTR
+2 SET ZTREQ="@"
+3 SET XMK=+$ORDER(^XMB(3.7,"M",XMZ,XMDUZ,""))
+4 ; * N/A *
SET XMKN=$SELECT(XMK:$PIECE(^XMB(3.7,XMDUZ,2,XMK,0),U,1),1:$$EZBLD^DIALOG(34014))
+5 DO RESPONSE^XMJMP(XMDUZ,XMZ,.XMRESPS,.XMPTR)
+6 if XMWHICH="*"
SET XMWHICH=$SELECT(XMRESPS:"0-"_XMRESPS,1:0)
+7 SET XMZREC=^XMB(3.9,XMZ,0)
+8 IF $EXTRACT(IOST,1,2)="C-"!'$GET(XMFIRST,1)
WRITE @IOF
+9 if XMPRTHDR
DO IDHDR^XMJMP(XMDUZ)
+10 DO PRINTIT^XMJMP1(XMDUZ,XMK,XMKN,XMZ,XMZREC,XMRESPS,XMPTR,XMWHICH,XMRECIPS,0,XMPRTHDR)
+11 QUIT
PRANGE(XMDUZ,XMWHICH,XMRECIPS,XMPRTHDR) ;
XPRANGE ; Print a range of messages.
+1 NEW XMZ,XMFIRST
+2 SET XMZ=""
+3 SET XMFIRST=1
+4 FOR
SET XMZ=$ORDER(^TMP("XM",$JOB,"XMZ",XMZ))
if 'XMZ
QUIT
Begin DoDot:1
+5 if '$DATA(^XMB(3.9,XMZ,0))
QUIT
+6 DO PMSG(XMDUZ,XMZ,XMWHICH,XMRECIPS,XMPRTHDR,.XMFIRST)
+7 SET XMFIRST=0
End DoDot:1
+8 QUIT