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

XMJMF2.m

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