XMJMLR1 ;ISC-SF/GMB-List/Read messages in basket (cont.) ;05/20/2002 15:15
;;8.0;MailMan;;Jun 28, 2002
; Replaces 1^XMAL0 (ISC-WASH/THM/CAP)
XMDIR(XMDUZ,XMLO,XMHI,XMPAGE,XMMORE,XMHELP,XMINSTR,XMOPT,XMOX,XMY,XMABORT) ;
N XMX K XMY
D ZOOMOPT(.XMOPT)
F D Q:$D(XMY)!XMABORT
. W !,$$EZBLD^DIALOG(34050) ; Enter message number or command:
. R XMX:DTIME I '$T S XMABORT=1 Q
. I XMX[U S XMABORT=1 Q
. I "="[XMX S XMY=XMX Q
. I XMX?.E1C.E D HELPSCR Q
. I $E(XMX)="?" D QUESTION Q
. I '$$OK K XMY D HELPSCR Q
. Q:'$D(XMOPT(XMY,"?"))
. D SHOWERR
I $G(XMY)="=" K XMY
Q
OK() ;
N XMLO
S XMLO=0
I XMX?1N.N Q $$NUMBERZ
I $E(XMX)="." Q $$DOT
S XMY=XMX
I XMX?1(1"+",1"-").N Q $L(XMX)<26
S XMY=$$COMMAND^XMJDIR(.XMOPT,.XMOX,XMX)
Q XMY'=-1
NUMBERZ() ;
Q:$L(XMX)>25 0
S (XMX,XMY)=+XMX
I XMX'<XMLO,XMX'>XMHI Q 1
I $D(^XMB(3.9,XMX,0)) Q 1
Q 0
DOT() ;
N XMXR,I,XMOK,XMSTRIKE
S XMOK=1
S XMX=$TR(XMX," ")
I $E(XMX,2)="-" S XMSTRIKE=1,XMX=$E(XMX,3,999)
E S XMSTRIKE=0,XMX=$E(XMX,2,999)
I XMX="*" S XMY="."_$S(XMSTRIKE:"-",1:"")_XMX Q 1
F I=1:1:$L(XMX,",") D Q:'XMOK
. S XMXR=$P(XMX,",",I)
. I XMXR?1.25N1"-"1.25N D Q
. . I $P(XMXR,"-",1)<XMLO S XMOK=0 Q
. . I $P(XMXR,"-",2)>XMHI S XMOK=0 Q
. . I $P(XMXR,"-",1)>$P(XMXR,"-",2) S XMOK=0
. I XMXR?1.25N D Q
. . I XMXR<XMLO S XMOK=0 Q
. . I XMXR>XMHI S XMOK=0
. I XMXR?1.25N1"-" D Q
. . I $P(XMXR,"-",1)<XMLO S XMOK=0 Q
. . I $P(XMXR,"-",1)>XMHI S XMOK=0
. S XMOK=0
I XMOK S XMY="."_$S(XMSTRIKE:"-",1:"")_XMX Q 1
Q 0
SHOWERR ;
D SHOWERR^XMJDIR(.XMOPT,XMY)
D WAIT^XMXUTIL
S XMY="="
Q
QUESTION ;
I XMX="?" D HELPSCR Q
I XMX?2."?"!("?HELP"[$$UP^XLFSTR(XMX)) S XQH=XMHELP D EN^XQH S XMY="=" Q
I $L(XMX)>64 D HELPSCR Q
I XMX?2"?"1N.N,$D(^XMB(3.9,$E(XMX,3,99),0)) S XMY=$E(XMX,3,99) Q
I '$D(XMOPT("Q")) D HELPSCR Q
S XMY="Q"
I $D(XMOPT("Q","?")) D SHOWERR Q
N I F I=1,2 Q:$E(XMX,I+1)'="?"
S XMY=XMY_I,XMY(0)=$E(XMX,I+1,99)
Q
HELPSCR ;
N XMTEXT,XMPARM,XMLINES
W !
S XMPARM(1)=XMLO,XMPARM(2)=XMHI
D BLD^DIALOG($S($G(XMINSTR("GOTO")):34051,1:34051.1),.XMPARM,"","XMTEXT","F") ; Enter a message number (_XMLO_-_XMHI_) to read a message.
I $D(XMOPT("Q")),'$D(XMOPT("Q","?")) D BLD^DIALOG(34052,"","","XMTEXT","FS")
; ?string Search for messages in this basket whose subject
; contains the specified string
; ??string Search for messages you once sent or received
; whose subject begins with the specified string
D BLD^DIALOG(34053,"","","XMTEXT","FS")
; .(-)n or n-m,a,c-d (de)select message n or a list of messages
; .(-)* (de)select all messages
S XMLINES=IOSL-DIHELP-5
D MSG^DIALOG("WH","",$G(IOM),"","XMTEXT")
D HELPCMD^XMJDIR(.XMOPT,.XMOX,.XMLINES)
I XMMORE D
. I XMPAGE D BLD^DIALOG($S($G(XMINSTR("GOTO")):34055,1:34056),"","","XMTEXT","FS") Q
. D BLD^DIALOG($S($G(XMINSTR("GOTO")):34057,1:34058),"","","XMTEXT","FS")
E D
. I XMPAGE D BLD^DIALOG($S($G(XMINSTR("GOTO")):34060,1:34061),"","","XMTEXT","FS") Q
. D BLD^DIALOG(34059,"","","XMTEXT","FS")
; Press ENTER or + to go to the next page. Enter +n to page forward n pages.
; Enter - to go to the previous page. Enter -n to page back n pages.
; Enter 0 to go to the first page; = to refresh this page; ^ to exit.
D MSG^DIALOG("WH","",$G(IOM),"","XMTEXT")
W !
Q
SETOPT(XMDUZ,XMK,XMOPT,XMOX) ;
D OPTGRP^XMXSEC1(XMDUZ,XMK,.XMOPT,.XMOX,1)
D SET^XMXSEC1("CD",37221,.XMOPT,.XMOX) ; Change Detail
D SET^XMXSEC1("O",37222,.XMOPT,.XMOX) ; Opposite selection toggle
D SET^XMXSEC1("Z",37223,.XMOPT,.XMOX) ; Zoom selection toggle
Q
ZOOMOPT(XMOPT) ;
N I
I $D(^TMP("XM",$J,".")) D Q
. I $D(XMOPT("Z","?")) K XMOPT("O","?"),XMOPT("Z","?")
. I $D(XMOPT("Q")) F I="Q","N","R" S XMOPT(I,"?")=37232 ; You can't do this with messages selected.
F I="O","Z" S XMOPT(I,"?")=37231 ; You can't do this unless messages are selected.
I $D(XMOPT("Q")) K XMOPT("Q","?"),XMOPT("N","?"),XMOPT("R","?")
Q
FWD(XMDUZ,XMZ,XMZREC,XMWAIT,XMOK) ; User is trying to access a message.
N X ; User (XMDUZ) is not authorized to see it. If user (DUZ)
S XMOK=0 ; is, then we'll give him a chance to forward it.
I '$D(^TMP("XMERR",$J,"E",37103)) D Q
. D SHOW^XMJERR ; User (XMDUZ and/or DUZ) is not authorized to see it.
. D:XMWAIT WAIT^XMXUTIL
; User is trying to access a message as a surrogate for someone else.
; User (DUZ) is authorized to see the message, but the someone else
; (XMDUZ) isn't. We must check to see if we can allow the user to
; forward the message to XMDUZ.
D NOGOID^XMJMP2(XMZ,XMZREC,1) ; Show 'subject' & 'from'
D SHOW^XMJERR
S X=$$FORWARD^XMXSEC(DUZ,XMZ,XMZREC)
I XMDUZ=.6 D
. I $$CLOSED^XMXSEC(XMZREC) D ERRSET^XMXUTIL(39020) Q
. I $$CONFID^XMXSEC(XMZREC) D ERRSET^XMXUTIL(39021)
I $D(XMERR) D Q
. D SHOW^XMJERR
. D:XMWAIT WAIT^XMXUTIL
N DIR,X,Y
W !
S DIR(0)="Y"
;Do you want to forward this message to |1|
D BLD^DIALOG(37104,XMV("NAME"),"","DIR(""A"")","F")
S DIR("B")=$$EZBLD^DIALOG(39053) ; No
D ^DIR Q:'Y!$D(DIRUT)
K DIR,X,Y
N XMERROR,XMINSTR,XMMSG
I XMDUZ=.6 D ASKSHARE^XMXADDR1(.XMINSTR) Q:$D(XMERROR)
S XMINSTR("FWD BY")=XMV("DUZ NAME")
D FWDMSG^XMXMSGS(DUZ,"",XMZ,XMDUZ,.XMINSTR,.XMMSG)
I $D(XMERR) D Q
. D SHOW^XMJERR
. D:XMWAIT WAIT^XMXUTIL
I $D(XMMSG) D
. W !,XMMSG
. D:XMWAIT WAIT^XMXUTIL
S XMOK=1
Q
XMJMLR1 ;ISC-SF/GMB-List/Read messages in basket (cont.) ;05/20/2002 15:15
+1 ;;8.0;MailMan;;Jun 28, 2002
+2 ; Replaces 1^XMAL0 (ISC-WASH/THM/CAP)
XMDIR(XMDUZ,XMLO,XMHI,XMPAGE,XMMORE,XMHELP,XMINSTR,XMOPT,XMOX,XMY,XMABORT) ;
+1 NEW XMX
KILL XMY
+2 DO ZOOMOPT(.XMOPT)
+3 FOR
Begin DoDot:1
+4 ; Enter message number or command:
WRITE !,$$EZBLD^DIALOG(34050)
+5 READ XMX:DTIME
IF '$TEST
SET XMABORT=1
QUIT
+6 IF XMX[U
SET XMABORT=1
QUIT
+7 IF "="[XMX
SET XMY=XMX
QUIT
+8 IF XMX?.E1C.E
DO HELPSCR
QUIT
+9 IF $EXTRACT(XMX)="?"
DO QUESTION
QUIT
+10 IF '$$OK
KILL XMY
DO HELPSCR
QUIT
+11 IF '$DATA(XMOPT(XMY,"?"))
QUIT
+12 DO SHOWERR
End DoDot:1
IF $DATA(XMY)!XMABORT
QUIT
+13 IF $GET(XMY)="="
KILL XMY
+14 QUIT
OK() ;
+1 NEW XMLO
+2 SET XMLO=0
+3 IF XMX?1N.N
QUIT $$NUMBERZ
+4 IF $EXTRACT(XMX)="."
QUIT $$DOT
+5 SET XMY=XMX
+6 IF XMX?1(1"+",1"-").N
QUIT $LENGTH(XMX)<26
+7 SET XMY=$$COMMAND^XMJDIR(.XMOPT,.XMOX,XMX)
+8 QUIT XMY'=-1
NUMBERZ() ;
+1 IF $LENGTH(XMX)>25
QUIT 0
+2 SET (XMX,XMY)=+XMX
+3 IF XMX'<XMLO
IF XMX'>XMHI
QUIT 1
+4 IF $DATA(^XMB(3.9,XMX,0))
QUIT 1
+5 QUIT 0
DOT() ;
+1 NEW XMXR,I,XMOK,XMSTRIKE
+2 SET XMOK=1
+3 SET XMX=$TRANSLATE(XMX," ")
+4 IF $EXTRACT(XMX,2)="-"
SET XMSTRIKE=1
SET XMX=$EXTRACT(XMX,3,999)
+5 IF '$TEST
SET XMSTRIKE=0
SET XMX=$EXTRACT(XMX,2,999)
+6 IF XMX="*"
SET XMY="."_$SELECT(XMSTRIKE:"-",1:"")_XMX
QUIT 1
+7 FOR I=1:1:$LENGTH(XMX,",")
Begin DoDot:1
+8 SET XMXR=$PIECE(XMX,",",I)
+9 IF XMXR?1.25N1"-"1.25N
Begin DoDot:2
+10 IF $PIECE(XMXR,"-",1)<XMLO
SET XMOK=0
QUIT
+11 IF $PIECE(XMXR,"-",2)>XMHI
SET XMOK=0
QUIT
+12 IF $PIECE(XMXR,"-",1)>$PIECE(XMXR,"-",2)
SET XMOK=0
End DoDot:2
QUIT
+13 IF XMXR?1.25N
Begin DoDot:2
+14 IF XMXR<XMLO
SET XMOK=0
QUIT
+15 IF XMXR>XMHI
SET XMOK=0
End DoDot:2
QUIT
+16 IF XMXR?1.25N1"-"
Begin DoDot:2
+17 IF $PIECE(XMXR,"-",1)<XMLO
SET XMOK=0
QUIT
+18 IF $PIECE(XMXR,"-",1)>XMHI
SET XMOK=0
End DoDot:2
QUIT
+19 SET XMOK=0
End DoDot:1
IF 'XMOK
QUIT
+20 IF XMOK
SET XMY="."_$SELECT(XMSTRIKE:"-",1:"")_XMX
QUIT 1
+21 QUIT 0
SHOWERR ;
+1 DO SHOWERR^XMJDIR(.XMOPT,XMY)
+2 DO WAIT^XMXUTIL
+3 SET XMY="="
+4 QUIT
QUESTION ;
+1 IF XMX="?"
DO HELPSCR
QUIT
+2 IF XMX?2."?"!("?HELP"[$$UP^XLFSTR(XMX))
SET XQH=XMHELP
DO EN^XQH
SET XMY="="
QUIT
+3 IF $LENGTH(XMX)>64
DO HELPSCR
QUIT
+4 IF XMX?2"?"1N.N
IF $DATA(^XMB(3.9,$EXTRACT(XMX,3,99),0))
SET XMY=$EXTRACT(XMX,3,99)
QUIT
+5 IF '$DATA(XMOPT("Q"))
DO HELPSCR
QUIT
+6 SET XMY="Q"
+7 IF $DATA(XMOPT("Q","?"))
DO SHOWERR
QUIT
+8 NEW I
FOR I=1,2
IF $EXTRACT(XMX,I+1)'="?"
QUIT
+9 SET XMY=XMY_I
SET XMY(0)=$EXTRACT(XMX,I+1,99)
+10 QUIT
HELPSCR ;
+1 NEW XMTEXT,XMPARM,XMLINES
+2 WRITE !
+3 SET XMPARM(1)=XMLO
SET XMPARM(2)=XMHI
+4 ; Enter a message number (_XMLO_-_XMHI_) to read a message.
DO BLD^DIALOG($SELECT($GET(XMINSTR("GOTO")):34051,1:34051.1),.XMPARM,"","XMTEXT","F")
+5 IF $DATA(XMOPT("Q"))
IF '$DATA(XMOPT("Q","?"))
DO BLD^DIALOG(34052,"","","XMTEXT","FS")
+6 ; ?string Search for messages in this basket whose subject
+7 ; contains the specified string
+8 ; ??string Search for messages you once sent or received
+9 ; whose subject begins with the specified string
+10 DO BLD^DIALOG(34053,"","","XMTEXT","FS")
+11 ; .(-)n or n-m,a,c-d (de)select message n or a list of messages
+12 ; .(-)* (de)select all messages
+13 SET XMLINES=IOSL-DIHELP-5
+14 DO MSG^DIALOG("WH","",$GET(IOM),"","XMTEXT")
+15 DO HELPCMD^XMJDIR(.XMOPT,.XMOX,.XMLINES)
+16 IF XMMORE
Begin DoDot:1
+17 IF XMPAGE
DO BLD^DIALOG($SELECT($GET(XMINSTR("GOTO")):34055,1:34056),"","","XMTEXT","FS")
QUIT
+18 DO BLD^DIALOG($SELECT($GET(XMINSTR("GOTO")):34057,1:34058),"","","XMTEXT","FS")
End DoDot:1
+19 IF '$TEST
Begin DoDot:1
+20 IF XMPAGE
DO BLD^DIALOG($SELECT($GET(XMINSTR("GOTO")):34060,1:34061),"","","XMTEXT","FS")
QUIT
+21 DO BLD^DIALOG(34059,"","","XMTEXT","FS")
End DoDot:1
+22 ; Press ENTER or + to go to the next page. Enter +n to page forward n pages.
+23 ; Enter - to go to the previous page. Enter -n to page back n pages.
+24 ; Enter 0 to go to the first page; = to refresh this page; ^ to exit.
+25 DO MSG^DIALOG("WH","",$GET(IOM),"","XMTEXT")
+26 WRITE !
+27 QUIT
SETOPT(XMDUZ,XMK,XMOPT,XMOX) ;
+1 DO OPTGRP^XMXSEC1(XMDUZ,XMK,.XMOPT,.XMOX,1)
+2 ; Change Detail
DO SET^XMXSEC1("CD",37221,.XMOPT,.XMOX)
+3 ; Opposite selection toggle
DO SET^XMXSEC1("O",37222,.XMOPT,.XMOX)
+4 ; Zoom selection toggle
DO SET^XMXSEC1("Z",37223,.XMOPT,.XMOX)
+5 QUIT
ZOOMOPT(XMOPT) ;
+1 NEW I
+2 IF $DATA(^TMP("XM",$JOB,"."))
Begin DoDot:1
+3 IF $DATA(XMOPT("Z","?"))
KILL XMOPT("O","?"),XMOPT("Z","?")
+4 ; You can't do this with messages selected.
IF $DATA(XMOPT("Q"))
FOR I="Q","N","R"
SET XMOPT(I,"?")=37232
End DoDot:1
QUIT
+5 ; You can't do this unless messages are selected.
FOR I="O","Z"
SET XMOPT(I,"?")=37231
+6 IF $DATA(XMOPT("Q"))
KILL XMOPT("Q","?"),XMOPT("N","?"),XMOPT("R","?")
+7 QUIT
FWD(XMDUZ,XMZ,XMZREC,XMWAIT,XMOK) ; User is trying to access a message.
+1 ; User (XMDUZ) is not authorized to see it. If user (DUZ)
NEW X
+2 ; is, then we'll give him a chance to forward it.
SET XMOK=0
+3 IF '$DATA(^TMP("XMERR",$JOB,"E",37103))
Begin DoDot:1
+4 ; User (XMDUZ and/or DUZ) is not authorized to see it.
DO SHOW^XMJERR
+5 IF XMWAIT
DO WAIT^XMXUTIL
End DoDot:1
QUIT
+6 ; User is trying to access a message as a surrogate for someone else.
+7 ; User (DUZ) is authorized to see the message, but the someone else
+8 ; (XMDUZ) isn't. We must check to see if we can allow the user to
+9 ; forward the message to XMDUZ.
+10 ; Show 'subject' & 'from'
DO NOGOID^XMJMP2(XMZ,XMZREC,1)
+11 DO SHOW^XMJERR
+12 SET X=$$FORWARD^XMXSEC(DUZ,XMZ,XMZREC)
+13 IF XMDUZ=.6
Begin DoDot:1
+14 IF $$CLOSED^XMXSEC(XMZREC)
DO ERRSET^XMXUTIL(39020)
QUIT
+15 IF $$CONFID^XMXSEC(XMZREC)
DO ERRSET^XMXUTIL(39021)
End DoDot:1
+16 IF $DATA(XMERR)
Begin DoDot:1
+17 DO SHOW^XMJERR
+18 IF XMWAIT
DO WAIT^XMXUTIL
End DoDot:1
QUIT
+19 NEW DIR,X,Y
+20 WRITE !
+21 SET DIR(0)="Y"
+22 ;Do you want to forward this message to |1|
+23 DO BLD^DIALOG(37104,XMV("NAME"),"","DIR(""A"")","F")
+24 ; No
SET DIR("B")=$$EZBLD^DIALOG(39053)
+25 DO ^DIR
IF 'Y!$DATA(DIRUT)
QUIT
+26 KILL DIR,X,Y
+27 NEW XMERROR,XMINSTR,XMMSG
+28 IF XMDUZ=.6
DO ASKSHARE^XMXADDR1(.XMINSTR)
IF $DATA(XMERROR)
QUIT
+29 SET XMINSTR("FWD BY")=XMV("DUZ NAME")
+30 DO FWDMSG^XMXMSGS(DUZ,"",XMZ,XMDUZ,.XMINSTR,.XMMSG)
+31 IF $DATA(XMERR)
Begin DoDot:1
+32 DO SHOW^XMJERR
+33 IF XMWAIT
DO WAIT^XMXUTIL
End DoDot:1
QUIT
+34 IF $DATA(XMMSG)
Begin DoDot:1
+35 WRITE !,XMMSG
+36 IF XMWAIT
DO WAIT^XMXUTIL
End DoDot:1
+37 SET XMOK=1
+38 QUIT