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

XMJML.m

Go to the documentation of this file.
  1. XMJML ;ISC-SF/GMB-List messages in basket (can't read) ;04/17/2002 10:03
  1. ;;8.0;MailMan;;Jun 28, 2002
  1. ; Replaces 1^XMAL0 (ISC-WASH/THM/CAP)
  1. LIST(XMDUZ,XMK,XMKN,XMKZ,XMDETAIL) ; List messages in one basket
  1. ; (This routine does NOT let the user read the messages.)
  1. ; XMDETAIL 0=Summary; 1=Detailed
  1. N XMLEN,XMORDER,XMHDLINE,XMABORT
  1. I XMDUZ=.5,XMK>999 S XMORDER=XMV("ORDER"),XMV("ORDER")=1
  1. S XMABORT=0
  1. D INIT(XMDUZ,XMK,XMKN,XMDETAIL,.XMLEN,1)
  1. S XMHDLINE=$$HEADLINE(XMDUZ,XMK,XMKN)
  1. D HEADER(XMDETAIL,.XMLEN,XMHDLINE)
  1. S:XMKZ'="" XMKZ=XMKZ-XMV("ORDER")
  1. F S XMKZ=$O(^XMB(3.7,XMDUZ,2,XMK,1,"C",XMKZ),XMV("ORDER")) Q:XMKZ="" D Q:XMABORT
  1. . S XMZ=$O(^XMB(3.7,XMDUZ,2,XMK,1,"C",XMKZ,""))
  1. . I '$D(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)) D ADDITC^XMUT4A(XMDUZ,XMK,XMZ,XMKZ)
  1. . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
  1. . I $Y+4>IOSL D PAGE^XMXUTIL(.XMABORT) Q:XMABORT D
  1. . . D HEADER(XMDETAIL,.XMLEN,XMHDLINE)
  1. . D LISTMSG(XMK,XMKN,XMKZ,XMZ,XMDETAIL,.XMLEN)
  1. I $D(XMORDER) S XMV("ORDER")=XMORDER
  1. Q
  1. LISTNEW(XMDUZ,XMK,XMKN) ; List new messages in one basket
  1. ; (This routine does NOT let the user read the messages.)
  1. ; XMDETAIL 0=Summary; 1=Detailed
  1. I '$O(^XMB(3.7,XMDUZ,"N0",XMK,0)) D Q
  1. . I $P(^XMB(3.7,XMDUZ,2,XMK,0),U,2) S $P(^(0),U,2)=0
  1. . W !!,$C(7),$$EZBLD^DIALOG(34013),! ;No NEW messages
  1. N XMKZ,XMZ,XMLEN,XMDETAIL,XMTYPE,XMHDLINE,XMABORT
  1. S XMDETAIL=1,XMTYPE="N0",XMABORT=0
  1. D INIT(XMDUZ,XMK,XMKN,XMDETAIL,.XMLEN,1)
  1. S XMHDLINE=$$HEADLINE^XMJMLN(XMDUZ,0,XMK,XMKN,XMTYPE)
  1. D HEADER(XMDETAIL,.XMLEN,XMHDLINE)
  1. S XMZ=""
  1. F S XMZ=$O(^XMB(3.7,XMDUZ,XMTYPE,XMK,XMZ),XMV("ORDER")) Q:XMZ="" D Q:XMABORT
  1. . S XMKZ=$P($G(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)),U,2)
  1. . I 'XMKZ D
  1. . . D ADDITN^XMUT4A(XMDUZ,XMTYPE,XMK,XMZ)
  1. . . S XMKZ=$P($G(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)),U,2)
  1. . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
  1. . I $Y+4>IOSL D PAGE^XMXUTIL(.XMABORT) Q:XMABORT D
  1. . . D HEADER(XMDETAIL,.XMLEN,XMHDLINE)
  1. . D LISTMSG(XMK,XMKN,XMKZ,XMZ,XMDETAIL,.XMLEN)
  1. Q
  1. LISTPRI(XMDUZ) ; List priority messages in all baskets (Replaces PRIO^XMAL0)
  1. ; (This routine does NOT let the user read the messages.)
  1. ; XMDETAIL 0=Summary; 1=Detailed
  1. N XMK,XMKN,XMKZ,XMZ,XMLEN,XMDETAIL,XMTYPE,XMHDLINE,XMABORT
  1. S XMDETAIL=1,XMTYPE="N",XMABORT=0
  1. D INIT^XMJMLN(XMDUZ,XMTYPE,XMDETAIL,1,.XMLEN)
  1. S XMHDLINE=$$HEADLINE^XMJMLN(XMDUZ,1,"","",XMTYPE)
  1. D HEADER(XMDETAIL,.XMLEN,XMHDLINE)
  1. S XMK=""
  1. F S XMK=$O(^XMB(3.7,XMDUZ,XMTYPE,XMK)) Q:XMK="" D Q:XMABORT
  1. . S XMZ="",XMKN=$P(^XMB(3.7,XMDUZ,2,XMK,0),U,1)
  1. . F S XMZ=$O(^XMB(3.7,XMDUZ,XMTYPE,XMK,XMZ),XMV("ORDER")) Q:XMZ="" D Q:XMABORT
  1. . . S XMKZ=$P($G(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)),U,2)
  1. . . I 'XMKZ D
  1. . . . D ADDITN^XMUT4A(XMDUZ,XMTYPE,XMK,XMZ)
  1. . . . S XMKZ=$P($G(^XMB(3.7,XMDUZ,2,XMK,1,XMZ,0)),U,2)
  1. . . I '$D(^XMB(3.9,XMZ,0)) D ZAPIT^XMXMSGS2(XMDUZ,XMK,XMZ) Q
  1. . . I $Y+4>IOSL D PAGE^XMXUTIL(.XMABORT) Q:XMABORT D
  1. . . . D HEADER(XMDETAIL,.XMLEN,XMHDLINE)
  1. . . D LISTMSG(XMK,XMKN,XMKZ,XMZ,XMDETAIL,.XMLEN)
  1. Q
  1. INIT(XMDUZ,XMK,XMKN,XMDETAIL,XMLEN,XMONE) ;
  1. N XMLEFT
  1. S XMLEFT=79
  1. I XMDETAIL D
  1. . S XMLEN("XMZ")=$L($O(^XMB(3.9,":"),-1))+2
  1. . ;S XMLEN("XMZ")=$L($O(^XMB(3.7,XMDUZ,2,XMK,1,":"),-1))+2
  1. . S XMLEN("LINE")=5
  1. . I '$G(XMONE),'$D(XMLEN("BSKT")) S XMLEN("BSKT")=$$MIN^XLFMTH($L(XMKN),10)
  1. . S XMLEN("RESP")=9
  1. . S XMLEN("DATE")=$L($$MMDT^XMXUTIL1(DT))
  1. . S XMLEFT=XMLEFT-XMLEN("XMZ")-XMLEN("LINE")-$G(XMLEN("BSKT"))-XMLEN("RESP")-XMLEN("DATE")-3+$S($G(XMLEN("BSKT")):0,1:1)
  1. S:'$D(XMLEN("XMKZ")) XMLEN("XMKZ")=$L($O(^XMB(3.7,XMDUZ,2,XMK,1,"C",""),-1))
  1. S XMLEFT=XMLEFT-XMLEN("XMKZ")-5
  1. S XMLEN("SUBJ")=XMLEFT*2\3
  1. S XMLEN("FROM")=XMLEFT-XMLEN("SUBJ")
  1. Q
  1. LISTMSG(XMK,XMKN,XMKZ,XMZ,XMDETAIL,XMLEN) ;
  1. N XMZREC
  1. S XMZREC=$G(^XMB(3.9,XMZ,0))
  1. I XMDUZ=.5,XMK>999 D
  1. . N XMTPRI ; Transmit priority
  1. . S XMTPRI=$P($G(^XMB(3.7,.5,2,XMK,1,XMZ,0)),U,6)
  1. . W !,$S($D(^TMP("XM",$J,".",XMKZ)):">",1:" "),$S('XMTPRI:" ",XMTPRI=1:"^",1:"v"),$J(XMKZ,XMLEN("XMKZ")),". "
  1. E W !,$S($D(^TMP("XM",$J,".",XMKZ)):">",1:" "),$S('$D(^XMB(3.7,XMDUZ,"N0",XMK,XMZ)):" ",$P(XMZREC,U,7)["P":"!",1:"*"),$J(XMKZ,XMLEN("XMKZ")),". "
  1. I XMDETAIL D
  1. . W:$D(XMLEN("BSKT")) $$LJ^XLFSTR($E(XMKN,1,XMLEN("BSKT")),XMLEN("BSKT"))," "
  1. . W $J("["_XMZ_"]",XMLEN("XMZ"))," ",$$DATE^XMXUTIL2(XMZREC,0)
  1. . W " ",$$MELD^XMXUTIL1($$SUBJ^XMXUTIL2(XMZREC),$$LINES(XMZ),XMLEN("SUBJ")+XMLEN("LINE"))
  1. . W " ",$$MELD^XMXUTIL1($$NAME^XMXUTIL($P(XMZREC,U,2)),$$RESPONSE(XMDUZ,XMK,XMZ),XMLEN("FROM")+9)
  1. E D
  1. . W $$LJ^XLFSTR($E($$SUBJ^XMXUTIL2(XMZREC),1,XMLEN("SUBJ")),XMLEN("SUBJ"))," ",$E($$NAME^XMXUTIL($P(XMZREC,U,2)),1,XMLEN("FROM"))
  1. Q
  1. HEADLINE(XMDUZ,XMK,XMKN) ;
  1. N XMNEWCNT,XMCNT
  1. S XMNEWCNT=$P(^XMB(3.7,XMDUZ,2,XMK,0),U,2)
  1. S XMCNT=$P(^XMB(3.7,XMDUZ,2,XMK,1,0),U,4)
  1. ;Basket / messages / message / new
  1. Q XMKN_" "_$$EZBLD^DIALOG(34011)_", "_XMCNT_$S(XMCNT>1:$$EZBLD^DIALOG(34007.1)_" ("_$O(^XMB(3.7,XMDUZ,2,XMK,1,"C",0))_"-"_$O(^(""),-1)_")",1:$$EZBLD^DIALOG(34007))_$S(XMNEWCNT:", "_XMNEWCNT_$$EZBLD^DIALOG(34008),1:"")
  1. I $D(XMHDLINE) W @IOF,XMHDLINE,!
  1. E W @IOF
  1. I XMDETAIL D
  1. . W $$LJ^XLFSTR($$EZBLD^DIALOG(34001),XMLEN("XMZ")+$G(XMLEN("BSKT"),-1)+XMLEN("XMKZ")+XMLEN("DATE")+7,".") ;*=New/!=Priority
  1. . W $$COMBO($$EZBLD^DIALOG(34002),$$EZBLD^DIALOG(34003.1),XMLEN("SUBJ")+XMLEN("LINE")) ;Subject / Lines
  1. . W "."
  1. . W $$COMBO($$EZBLD^DIALOG(34006),$$EZBLD^DIALOG(34004),XMLEN("FROM")+XMLEN("RESP")) ;From / Read/Rcvd
  1. E D
  1. . W $$LJ^XLFSTR($$EZBLD^DIALOG(34005),79-XMLEN("FROM"),"."),$$LJ^XLFSTR($$EZBLD^DIALOG(34006),XMLEN("FROM"),".") ;*=New/!=Priority.......Subject / From
  1. Q
  1. COMBO(XMSTR1,XMSTR2,XMLEN) ;
  1. Q $$LJ^XLFSTR($E(XMSTR1,1,XMLEN-$L(XMSTR2)-1),XMLEN-$L(XMSTR2),".")_XMSTR2
  1. LINES(XMZ) ;
  1. Q +$P($G(^XMB(3.9,XMZ,2,0)),U,4)
  1. RESPONSE(XMDUZ,XMK,XMZ) ;
  1. I XMDUZ=.5,XMK>999 Q ""
  1. N XMPTR,XMRESP,XMRESPS
  1. S XMRESPS=+$P($G(^XMB(3.9,XMZ,3,0)),U,4)
  1. I XMRESPS=0 Q ""
  1. ;S XMPTR=$O(^XMB(3.9,XMZ,1,"C",$S(XMDUZ=.6:DUZ,1:XMDUZ),0))
  1. S XMPTR=+$O(^XMB(3.9,XMZ,1,"C",XMDUZ,0))
  1. S XMRESP=+$P($G(^XMB(3.9,XMZ,1,XMPTR,0)),U,2)
  1. Q XMRESP_"/"_XMRESPS
  1. LISTTMP ; List messages in ^TMP global
  1. ; (This routine does NOT let the user read the messages.)
  1. ; The following variables are expected to exist:
  1. ; XMDETAIL 0=Summary; 1=Detailed
  1. ; XMLEN
  1. N XMK,XMKN,XMKZ,XMZ,XMABORT,XMREC
  1. S XMABORT=0
  1. D HEADER(XMDETAIL,.XMLEN)
  1. S XMKZ=0
  1. F S XMKZ=$O(^TMP("XM",$J,"MSG",XMKZ)) Q:XMKZ="" D Q:XMABORT
  1. . I $Y+4>IOSL D PAGE^XMXUTIL(.XMABORT) Q:XMABORT D
  1. . . D HEADER(XMDETAIL,.XMLEN)
  1. . S XMREC=^TMP("XM",$J,"MSG",XMKZ)
  1. . S XMK=$P(XMREC,U,1),XMKN=$P(XMREC,U,2),XMZ=$P(XMREC,U,3)
  1. . D LISTMSG(XMK,XMKN,XMKZ,XMZ,XMDETAIL,.XMLEN)
  1. Q