XMJMF2 ;ISC-SF/GMB-XMJMF (cont.) ;07/12/2002 10:11
;;8.0;MailMan;;Jun 28, 2002
B ; Search one basket
N XMDIC,XMFBSKT
S XMDIC("B")=$G(XMFBSKTN,$$EZBLD^DIALOG(37005)) ; IN
D SELBSKT^XMJBU(XMDUZ,34439,"",.XMDIC,.XMFBSKT,.XMFBSKTN) I XMFBSKT=U S XMABORT=1 Q ; Select basket to search:
S XMF("BSKT")=XMFBSKT
Q
BA ; Search all baskets
S XMF("BSKT")="*"
Q
DA ; Message sent on or after date
N DIR,Y,X
S DIR(0)="DO^:"_$G(XMF("TDATE"),DT)_":EX"
S DIR("A")=$$EZBLD^DIALOG(34444) ; Message sent on or after
D BLD^DIALOG(34444.1,"","","DIR(""?"")")
; Enter a date. It must include day, month, and year.
S:$D(XMF("FDATE")) DIR("B")=XMFFDTX
D ^DIR I $D(DUOUT)!$D(DTOUT) S XMABORT=1 Q
I X="@" D Q
. I XMK="!" D NODELETE Q
. K XMF("FDATE")
Q:Y=""
S XMF("FDATE")=Y
S XMFFDTX=$$MMDT^XMXUTIL1(XMF("FDATE"))
Q
NODELETE ;This search requires a date range.
;You may change the dates, but you may not delete them.
N XMTEXT
D BLD^DIALOG(34444.5,"","","XMTEXT","F")
D MSG^DIALOG("WE","","","","XMTEXT")
D WAIT^XMXUTIL
Q
DB ; Message sent on or before date
N DIR,Y,X
S DIR(0)="DO^"_$G(XMF("FDATE"))_":DT:EX"
S DIR("A")=$$EZBLD^DIALOG(34445) ; Message sent on or before
D BLD^DIALOG(34444.1,"","","DIR(""?"")")
; Enter a date. It must include day, month, and year.
S:$D(XMF("TDATE")) DIR("B")=XMFTDTX
D ^DIR I $D(DUOUT)!$D(DTOUT) S XMABORT=1 Q
I X="@" D Q
. I XMK="!" D NODELETE Q
. K XMF("TDATE")
Q:Y=""
S XMF("TDATE")=Y
S XMFTDTX=$$MMDT^XMXUTIL1(XMF("TDATE"))
Q
F ; Message from
D GETPERS(XMDUZ,.XMF,"FROM",.XMFFRN,34440,34441,.XMABORT)
Q
G ; Go search
W !,$$EZBLD^DIALOG(34417) ; Searching...
I XMK="!" D FIND^XMJMFC(XMDUZ,.XMF,1) Q
I $G(XMF("BSKT"))="*" D FINDALL^XMJMFB(XMDUZ,.XMF) Q
D FIND1^XMJMFB(XMDUZ,.XMF,1)
Q
LM ; Message has this many lines or more
N DIR,Y,X
S DIR(0)="FO^1:12^K:'$$LMOK^XMJMF2(X) X"
S DIR("A")=$$EZBLD^DIALOG(34449) ; Lines of text, minimum
D BLD^DIALOG(34449.1,"","","DIR(""?"")")
; Enter a number from 100 to 100,000.
; We will find all messages with that many lines of text or more.
S:$D(XMF("FLINE")) DIR("B")=XMF("FLINE")
D ^DIR I $D(DUOUT)!$D(DTOUT) S XMABORT=1 Q
I X="@" K XMF("FLINE") Q
I Y S XMF("FLINE")=Y
Q
LMOK(X) ;
I X="@" Q 1
I X'?1N.N Q 0
I $G(XMF("TLINE")),X>XMF("TLINE") Q 0
I X<100 Q 0
I X>100000 Q 0
Q 1
LX ; Message has this many lines or less
N DIR,Y,X
S DIR(0)="FO^1:12^K:'$$LXOK^XMJMF2(X) X"
S DIR("A")=$$EZBLD^DIALOG(34450) ; Lines of text, maximum
D BLD^DIALOG(34450.1,"","","DIR(""?"")")
; Enter a number from 100 to 100,000.
; We will find all messages with that many lines of text or less.
S:$D(XMF("TLINE")) DIR("B")=XMF("TLINE")
D ^DIR I $D(DUOUT)!$D(DTOUT) S XMABORT=1 Q
I X="@" K XMF("TLINE") Q
I Y S XMF("TLINE")=Y
Q
LXOK(X) ;
I X="@" Q 1
I X'?1N.N Q 0
I $G(XMF("FLINE")),X<XMF("FLINE") Q 0
I X<100 Q 0
I X>100000 Q 0
Q 1
Q ; Quit
S XMABORT=1
Q
R ; Response from
D GETPERS(XMDUZ,.XMF,"RFROM",.XMFRFRN,34440.1,34441.1,.XMABORT)
Q
S ; Subject contains
N DIR,Y,X
S DIR(0)="FO^3:30"
S DIR("A")=$$EZBLD^DIALOG(34438) ; Subject contains
S:$D(XMF("SUBJ")) DIR("B")=XMF("SUBJ")
D BLD^DIALOG(34438.1,"","","DIR(""?"")")
;Enter the string that the subject contains.
;It may be from 3 to 30 characters.
;The search is NOT case-sensitive.
D ^DIR I $D(DUOUT)!$D(DTOUT) S XMABORT=1 Q
I X="@" K XMF("SUBJ") Q
Q:Y=""
S XMF("SUBJ")=Y
Q
T ; Message to
D GETPERS(XMDUZ,.XMF,"TO",$G(XMF("TO")),34440.2,34441.2,.XMABORT)
Q
X ; Message contains
N DIR,Y,X
S DIR(0)="FO^3:30"
S DIR("A")=$$EZBLD^DIALOG(34446.1) ; Message contains
S:$D(XMF("TEXT")) DIR("B")=XMF("TEXT")
D BLD^DIALOG(34446.4,"","","DIR(""?"")")
;Enter the string to search for. It may be from 3 to 30 characters.
;Note that if the string you are searching for is not all on one line
;in the message, the search will not be able to find it.
D ^DIR I $D(DUOUT)!$D(DTOUT) S XMABORT=1 Q
I X="@" K XMF("TEXT") Q
Q:Y=""
S XMF("TEXT")=Y
K DIR,X,Y
S DIR(0)="Y"
S DIR("A")=$$EZBLD^DIALOG(34447) ; Should the search be case-sensitive
S DIR("B")=$$EZBLD^DIALOG($S($G(XMF("TEXT","C"),1):39054,1:39053)) ; Yes/No
D BLD^DIALOG(34447.1,"","","DIR(""?"")")
;Your answer determines whether case (upper/lower) matters in the search.
;It also affects the speed of the search.
;A case-sensitive search (one in which case matters) is faster.
;A case-insensitive search (one in which case does not matter) may find
;more matches, but will be slower.
;Answer YES for a faster search, when case matters.
;Answer NO for a slower search, when case does not matter.
D ^DIR I $D(DUOUT)!$D(DTOUT) S XMABORT=1 Q
S XMF("TEXT","C")=Y
K DIR,X,Y N I
S DIR("A")=$$EZBLD^DIALOG(34448) ; Where should we search
; x.1:Message only / x.2:Message and Responses / x.3:Responses only
S DIR(0)=""
F I=1,2,3 S DIR(0)=DIR(0)_";"_I_":"_$$EZBLD^DIALOG(34448+(I/10))
S DIR(0)="S^"_$E(DIR(0),2,999)
; x.1:Message only / x.2:Message and Responses / x.3:Responses only
S DIR("B")=$$EZBLD^DIALOG(34448+($G(XMF("TEXT","L"),1)/10))
D ^DIR I $D(DUOUT)!$D(DTOUT) S XMABORT=1 Q
S XMF("TEXT","L")=Y
Q
GETPERS(XMDUZ,XMF,XMWHICH,XMNAME,XMPROMPT,XMHELP,XMABORT) ;
N DIR,Y,X,XMOK
S DIR(0)="FO^1:30"
S DIR("A")=$$EZBLD^DIALOG(XMPROMPT) ; Message from / Message to / Response from
S DIR("?")="^D HGETPERS^XMJMF2"
I $D(XMF(XMWHICH)) D
. S DIR("B")=XMNAME
. I XMNAME'["@" S DIR(0)="FrO^1:30" ; ('r' means no 'replace...with...' prompt)
. Q:XMWHICH'="TO"
. Q:"^G.^g.^"'[(U_$E(XMNAME,1,2)_U)
. N XMPRIVAT
. S XMPRIVAT=$$EZBLD^DIALOG(39135) ; " [Private Mail Group]"
. I XMNAME[XMPRIVAT S DIR("B")=$P(XMNAME,XMPRIVAT)
F D Q:XMABORT!XMOK
. S XMOK=1
. D ^DIR I $D(DUOUT)!$D(DTOUT) S XMABORT=1 Q
. I X="@" K XMF(XMWHICH),XMNAME Q
. I Y="" Q
. I X["@" S (XMNAME,XMF(XMWHICH))=$$UP^XLFSTR(Y) Q
. I XMWHICH="TO" D Q
. . N XMINSTR
. . K XMNAME
. . S XMINSTR("ADDR FLAGS")="X" ; don't create ^TMP("XMY" globals
. . D ADDR^XMXADDR(XMDUZ,X,.XMINSTR,"",.XMNAME)
. . I '$D(XMNAME) S XMOK=0 Q
. . S XMF(XMWHICH)=XMNAME
. N DIC,X
. S X=Y
. S DIC="^VA(200,",DIC(0)="MNEQ"
. D ^DIC I $D(DUOUT)!$D(DTOUT) S XMABORT=1 Q
. I Y=-1 S XMOK=0 Q
. S XMF(XMWHICH)=+Y
. S XMNAME=$$NAME^XMXUTIL(+Y)
Q
HGETPERS ;
N XMTEXT
D BLD^DIALOG(XMHELP,"","","XMTEXT","F")
;Enter the name of the person who sent the message/response.
; - or -
;Enter the message addressee. It may be a person, group, device, or server.
I XMWHICH'="TO" D BLD^DIALOG(34441.3,"","","XMTEXT","F")
;If it's from a local VistA package/fake sender, just put '@' after
;the sender, like ACCOUNTS RECEIVABLE@
D BLD^DIALOG(34442,"","","XMTEXT","F")
;For remote users, enter name@, name@domain, or @domain.
;'Name' must be found somewhere in the user's name.
;'Domain' must be found somewhere in the user's domain.
;The more characters you provide, the narrower the search will be.
;MailMan may capitalize some names to facilitate filtering.
D MSG^DIALOG("WH","",IOM,"","XMTEXT")
Q
XMJMF2 ;ISC-SF/GMB-XMJMF (cont.) ;07/12/2002 10:11
+1 ;;8.0;MailMan;;Jun 28, 2002
B ; Search one basket
+1 NEW XMDIC,XMFBSKT
+2 ; IN
SET XMDIC("B")=$GET(XMFBSKTN,$$EZBLD^DIALOG(37005))
+3 ; Select basket to search:
DO SELBSKT^XMJBU(XMDUZ,34439,"",.XMDIC,.XMFBSKT,.XMFBSKTN)
IF XMFBSKT=U
SET XMABORT=1
QUIT
+4 SET XMF("BSKT")=XMFBSKT
+5 QUIT
BA ; Search all baskets
+1 SET XMF("BSKT")="*"
+2 QUIT
DA ; Message sent on or after date
+1 NEW DIR,Y,X
+2 SET DIR(0)="DO^:"_$GET(XMF("TDATE"),DT)_":EX"
+3 ; Message sent on or after
SET DIR("A")=$$EZBLD^DIALOG(34444)
+4 DO BLD^DIALOG(34444.1,"","","DIR(""?"")")
+5 ; Enter a date. It must include day, month, and year.
+6 IF $DATA(XMF("FDATE"))
SET DIR("B")=XMFFDTX
+7 DO ^DIR
IF $DATA(DUOUT)!$DATA(DTOUT)
SET XMABORT=1
QUIT
+8 IF X="@"
Begin DoDot:1
+9 IF XMK="!"
DO NODELETE
QUIT
+10 KILL XMF("FDATE")
End DoDot:1
QUIT
+11 IF Y=""
QUIT
+12 SET XMF("FDATE")=Y
+13 SET XMFFDTX=$$MMDT^XMXUTIL1(XMF("FDATE"))
+14 QUIT
NODELETE ;This search requires a date range.
+1 ;You may change the dates, but you may not delete them.
+2 NEW XMTEXT
+3 DO BLD^DIALOG(34444.5,"","","XMTEXT","F")
+4 DO MSG^DIALOG("WE","","","","XMTEXT")
+5 DO WAIT^XMXUTIL
+6 QUIT
DB ; Message sent on or before date
+1 NEW DIR,Y,X
+2 SET DIR(0)="DO^"_$GET(XMF("FDATE"))_":DT:EX"
+3 ; Message sent on or before
SET DIR("A")=$$EZBLD^DIALOG(34445)
+4 DO BLD^DIALOG(34444.1,"","","DIR(""?"")")
+5 ; Enter a date. It must include day, month, and year.
+6 IF $DATA(XMF("TDATE"))
SET DIR("B")=XMFTDTX
+7 DO ^DIR
IF $DATA(DUOUT)!$DATA(DTOUT)
SET XMABORT=1
QUIT
+8 IF X="@"
Begin DoDot:1
+9 IF XMK="!"
DO NODELETE
QUIT
+10 KILL XMF("TDATE")
End DoDot:1
QUIT
+11 IF Y=""
QUIT
+12 SET XMF("TDATE")=Y
+13 SET XMFTDTX=$$MMDT^XMXUTIL1(XMF("TDATE"))
+14 QUIT
F ; Message from
+1 DO GETPERS(XMDUZ,.XMF,"FROM",.XMFFRN,34440,34441,.XMABORT)
+2 QUIT
G ; Go search
+1 ; Searching...
WRITE !,$$EZBLD^DIALOG(34417)
+2 IF XMK="!"
DO FIND^XMJMFC(XMDUZ,.XMF,1)
QUIT
+3 IF $GET(XMF("BSKT"))="*"
DO FINDALL^XMJMFB(XMDUZ,.XMF)
QUIT
+4 DO FIND1^XMJMFB(XMDUZ,.XMF,1)
+5 QUIT
LM ; Message has this many lines or more
+1 NEW DIR,Y,X
+2 SET DIR(0)="FO^1:12^K:'$$LMOK^XMJMF2(X) X"
+3 ; Lines of text, minimum
SET DIR("A")=$$EZBLD^DIALOG(34449)
+4 DO BLD^DIALOG(34449.1,"","","DIR(""?"")")
+5 ; Enter a number from 100 to 100,000.
+6 ; We will find all messages with that many lines of text or more.
+7 IF $DATA(XMF("FLINE"))
SET DIR("B")=XMF("FLINE")
+8 DO ^DIR
IF $DATA(DUOUT)!$DATA(DTOUT)
SET XMABORT=1
QUIT
+9 IF X="@"
KILL XMF("FLINE")
QUIT
+10 IF Y
SET XMF("FLINE")=Y
+11 QUIT
LMOK(X) ;
+1 IF X="@"
QUIT 1
+2 IF X'?1N.N
QUIT 0
+3 IF $GET(XMF("TLINE"))
IF X>XMF("TLINE")
QUIT 0
+4 IF X<100
QUIT 0
+5 IF X>100000
QUIT 0
+6 QUIT 1
LX ; Message has this many lines or less
+1 NEW DIR,Y,X
+2 SET DIR(0)="FO^1:12^K:'$$LXOK^XMJMF2(X) X"
+3 ; Lines of text, maximum
SET DIR("A")=$$EZBLD^DIALOG(34450)
+4 DO BLD^DIALOG(34450.1,"","","DIR(""?"")")
+5 ; Enter a number from 100 to 100,000.
+6 ; We will find all messages with that many lines of text or less.
+7 IF $DATA(XMF("TLINE"))
SET DIR("B")=XMF("TLINE")
+8 DO ^DIR
IF $DATA(DUOUT)!$DATA(DTOUT)
SET XMABORT=1
QUIT
+9 IF X="@"
KILL XMF("TLINE")
QUIT
+10 IF Y
SET XMF("TLINE")=Y
+11 QUIT
LXOK(X) ;
+1 IF X="@"
QUIT 1
+2 IF X'?1N.N
QUIT 0
+3 IF $GET(XMF("FLINE"))
IF X<XMF("FLINE")
QUIT 0
+4 IF X<100
QUIT 0
+5 IF X>100000
QUIT 0
+6 QUIT 1
Q ; Quit
+1 SET XMABORT=1
+2 QUIT
R ; Response from
+1 DO GETPERS(XMDUZ,.XMF,"RFROM",.XMFRFRN,34440.1,34441.1,.XMABORT)
+2 QUIT
S ; Subject contains
+1 NEW DIR,Y,X
+2 SET DIR(0)="FO^3:30"
+3 ; Subject contains
SET DIR("A")=$$EZBLD^DIALOG(34438)
+4 IF $DATA(XMF("SUBJ"))
SET DIR("B")=XMF("SUBJ")
+5 DO BLD^DIALOG(34438.1,"","","DIR(""?"")")
+6 ;Enter the string that the subject contains.
+7 ;It may be from 3 to 30 characters.
+8 ;The search is NOT case-sensitive.
+9 DO ^DIR
IF $DATA(DUOUT)!$DATA(DTOUT)
SET XMABORT=1
QUIT
+10 IF X="@"
KILL XMF("SUBJ")
QUIT
+11 IF Y=""
QUIT
+12 SET XMF("SUBJ")=Y
+13 QUIT
T ; Message to
+1 DO GETPERS(XMDUZ,.XMF,"TO",$GET(XMF("TO")),34440.2,34441.2,.XMABORT)
+2 QUIT
X ; Message contains
+1 NEW DIR,Y,X
+2 SET DIR(0)="FO^3:30"
+3 ; Message contains
SET DIR("A")=$$EZBLD^DIALOG(34446.1)
+4 IF $DATA(XMF("TEXT"))
SET DIR("B")=XMF("TEXT")
+5 DO BLD^DIALOG(34446.4,"","","DIR(""?"")")
+6 ;Enter the string to search for. It may be from 3 to 30 characters.
+7 ;Note that if the string you are searching for is not all on one line
+8 ;in the message, the search will not be able to find it.
+9 DO ^DIR
IF $DATA(DUOUT)!$DATA(DTOUT)
SET XMABORT=1
QUIT
+10 IF X="@"
KILL XMF("TEXT")
QUIT
+11 IF Y=""
QUIT
+12 SET XMF("TEXT")=Y
+13 KILL DIR,X,Y
+14 SET DIR(0)="Y"
+15 ; Should the search be case-sensitive
SET DIR("A")=$$EZBLD^DIALOG(34447)
+16 ; Yes/No
SET DIR("B")=$$EZBLD^DIALOG($SELECT($GET(XMF("TEXT","C"),1):39054,1:39053))
+17 DO BLD^DIALOG(34447.1,"","","DIR(""?"")")
+18 ;Your answer determines whether case (upper/lower) matters in the search.
+19 ;It also affects the speed of the search.
+20 ;A case-sensitive search (one in which case matters) is faster.
+21 ;A case-insensitive search (one in which case does not matter) may find
+22 ;more matches, but will be slower.
+23 ;Answer YES for a faster search, when case matters.
+24 ;Answer NO for a slower search, when case does not matter.
+25 DO ^DIR
IF $DATA(DUOUT)!$DATA(DTOUT)
SET XMABORT=1
QUIT
+26 SET XMF("TEXT","C")=Y
+27 KILL DIR,X,Y
NEW I
+28 ; Where should we search
SET DIR("A")=$$EZBLD^DIALOG(34448)
+29 ; x.1:Message only / x.2:Message and Responses / x.3:Responses only
+30 SET DIR(0)=""
+31 FOR I=1,2,3
SET DIR(0)=DIR(0)_";"_I_":"_$$EZBLD^DIALOG(34448+(I/10))
+32 SET DIR(0)="S^"_$EXTRACT(DIR(0),2,999)
+33 ; x.1:Message only / x.2:Message and Responses / x.3:Responses only
+34 SET DIR("B")=$$EZBLD^DIALOG(34448+($GET(XMF("TEXT","L"),1)/10))
+35 DO ^DIR
IF $DATA(DUOUT)!$DATA(DTOUT)
SET XMABORT=1
QUIT
+36 SET XMF("TEXT","L")=Y
+37 QUIT
GETPERS(XMDUZ,XMF,XMWHICH,XMNAME,XMPROMPT,XMHELP,XMABORT) ;
+1 NEW DIR,Y,X,XMOK
+2 SET DIR(0)="FO^1:30"
+3 ; Message from / Message to / Response from
SET DIR("A")=$$EZBLD^DIALOG(XMPROMPT)
+4 SET DIR("?")="^D HGETPERS^XMJMF2"
+5 IF $DATA(XMF(XMWHICH))
Begin DoDot:1
+6 SET DIR("B")=XMNAME
+7 ; ('r' means no 'replace...with...' prompt)
IF XMNAME'["@"
SET DIR(0)="FrO^1:30"
+8 IF XMWHICH'="TO"
QUIT
+9 IF "^G.^g.^"'[(U_$EXTRACT(XMNAME,1,2)_U)
QUIT
+10 NEW XMPRIVAT
+11 ; " [Private Mail Group]"
SET XMPRIVAT=$$EZBLD^DIALOG(39135)
+12 IF XMNAME[XMPRIVAT
SET DIR("B")=$PIECE(XMNAME,XMPRIVAT)
End DoDot:1
+13 FOR
Begin DoDot:1
+14 SET XMOK=1
+15 DO ^DIR
IF $DATA(DUOUT)!$DATA(DTOUT)
SET XMABORT=1
QUIT
+16 IF X="@"
KILL XMF(XMWHICH),XMNAME
QUIT
+17 IF Y=""
QUIT
+18 IF X["@"
SET (XMNAME,XMF(XMWHICH))=$$UP^XLFSTR(Y)
QUIT
+19 IF XMWHICH="TO"
Begin DoDot:2
+20 NEW XMINSTR
+21 KILL XMNAME
+22 ; don't create ^TMP("XMY" globals
SET XMINSTR("ADDR FLAGS")="X"
+23 DO ADDR^XMXADDR(XMDUZ,X,.XMINSTR,"",.XMNAME)
+24 IF '$DATA(XMNAME)
SET XMOK=0
QUIT
+25 SET XMF(XMWHICH)=XMNAME
End DoDot:2
QUIT
+26 NEW DIC,X
+27 SET X=Y
+28 SET DIC="^VA(200,"
SET DIC(0)="MNEQ"
+29 DO ^DIC
IF $DATA(DUOUT)!$DATA(DTOUT)
SET XMABORT=1
QUIT
+30 IF Y=-1
SET XMOK=0
QUIT
+31 SET XMF(XMWHICH)=+Y
+32 SET XMNAME=$$NAME^XMXUTIL(+Y)
End DoDot:1
IF XMABORT!XMOK
QUIT
+33 QUIT
HGETPERS ;
+1 NEW XMTEXT
+2 DO BLD^DIALOG(XMHELP,"","","XMTEXT","F")
+3 ;Enter the name of the person who sent the message/response.
+4 ; - or -
+5 ;Enter the message addressee. It may be a person, group, device, or server.
+6 IF XMWHICH'="TO"
DO BLD^DIALOG(34441.3,"","","XMTEXT","F")
+7 ;If it's from a local VistA package/fake sender, just put '@' after
+8 ;the sender, like ACCOUNTS RECEIVABLE@
+9 DO BLD^DIALOG(34442,"","","XMTEXT","F")
+10 ;For remote users, enter name@, name@domain, or @domain.
+11 ;'Name' must be found somewhere in the user's name.
+12 ;'Domain' must be found somewhere in the user's domain.
+13 ;The more characters you provide, the narrower the search will be.
+14 ;MailMan may capitalize some names to facilitate filtering.
+15 DO MSG^DIALOG("WH","",IOM,"","XMTEXT")
+16 QUIT