[1138] | 1 | CWMAILD ;INDPLS/PLS- DELPHI VISTA MAIL SERVER CONT'D ;16-Jul-1999 11:13;PS
|
---|
| 2 | ;;2.1;CWMA GuiMail;;Jan 06, 1999
|
---|
| 3 | Q ;ROUTINE CAN'T BE CALLED DIRECTLY
|
---|
| 4 | ;
|
---|
| 5 | %BMSGD(CWDATA,CWINPUT,CWTEXT) ;BUILD MESSAGE DATA INTO GLOBAL
|
---|
| 6 | ;USE CREATE OR REPLY TO SEND ACTUAL MESSAGE OR REPLY
|
---|
| 7 | M ^TMP($J,"CWMAILLOAD")=CWTEXT
|
---|
| 8 | S CWDATA(1)="1^1^DATA SET"
|
---|
| 9 | BMSGDE Q
|
---|
| 10 | ;
|
---|
| 11 | %PERPREF(CWDATA,CWPARAM) ;retrieve personal preferences
|
---|
| 12 | ;CWPARAM is not used
|
---|
| 13 | N CWNAME,CWCNT
|
---|
| 14 | S CWCNT=2
|
---|
| 15 | S CWDATA(1)="0^^AN ERROR HAS OCCURRED"
|
---|
| 16 | I $$GETPKPM^CWMAILE(.CWDATA) D
|
---|
| 17 | .S CWCNT=$G(CWDATA(-9900))
|
---|
| 18 | .K CWDATA(-9900)
|
---|
| 19 | .S CWDATA(1)="1^1^Preferences have been retrieved"
|
---|
| 20 | E S CWDATA(1)="0^0^Unable to retrieve preferences"
|
---|
| 21 | S $P(CWDATA(1),U,2)=CWCNT-2
|
---|
| 22 | PERPREFE Q
|
---|
| 23 | ;
|
---|
| 24 | %USRLOG(CWDATA,DUZ) ;SET-UP USER PARTITION
|
---|
| 25 | ;
|
---|
| 26 | I +DUZ>0 D
|
---|
| 27 | . N XMDISPI,XMDUN,XMDUZ,CWNAME,CWNKNM,CWNMAIL,CWPMAIL
|
---|
| 28 | . S CWNKNM=$P($G(^VA(200,DUZ,.1)),U,4)
|
---|
| 29 | . D INIT^XMVVITAE
|
---|
| 30 | . S CWNMAIL=+$P($G(^XMB(3.7,DUZ,0)),U,6)
|
---|
| 31 | . S CWDATA(1)="1^"
|
---|
| 32 | . S $P(CWDATA(1),U,2)=XMV("DUZ NAME") ; SET USER NAME
|
---|
| 33 | . S $P(CWDATA(1),U,3)=CWNKNM ;SET USER NICKNAME
|
---|
| 34 | . S $P(CWDATA(1),U,4)=XMV("NEW MSGS") ;SET # OF NEW MSGS
|
---|
| 35 | . S $P(CWDATA(1),U,5)=$G(XMV("WARNING",1))="Priority Mail" ;SET PRIORITY MAIL FLAG
|
---|
| 36 | . S $P(CWDATA(1),U,6)=$P($G(XMV("NETNAME")),"@",2) ;get domain name for mail server
|
---|
| 37 | ;$G(^XMB("NETNAME")) ;get domain name for mail server
|
---|
| 38 | E S CWDATA(1)="0^USER NOT FOUND"
|
---|
| 39 | USRLOGE Q
|
---|
| 40 | %CHKMAIL(CWDATA,DUZ) ;CHECK FOR NEW MAIL
|
---|
| 41 | ;
|
---|
| 42 | N CWPMAIL,CWNMAIL,CWDAT
|
---|
| 43 | I +DUZ>0 D
|
---|
| 44 | . S CWDAT=$$NEWS^XMXUTIL(DUZ) ;FORMAT #NEWMSGS^PRIORITY^#NMSGIN^DT LAST MSG^
|
---|
| 45 | . S CWDATA(1)="1^"_U_U_+CWDAT_U_+$P(CWDAT,U,2)
|
---|
| 46 | E S CWDATA(1)="0^USER NOT FOUND"
|
---|
| 47 | CHKMAILE Q
|
---|
| 48 | ;
|
---|
| 49 | %PRTMSG(CWDATA,CWINPUT) ;PRINT A MESSAGE
|
---|
| 50 | ; CWINPUT - 1st piece: XMZ message number
|
---|
| 51 | ; 2nd piece: XMK message basket number
|
---|
| 52 | ; 3rd piece: Print from response number 0=all
|
---|
| 53 | ; 4th piece: null = no recpts 0=summary; 1=detail
|
---|
| 54 | ; 5th piece: printer name
|
---|
| 55 | ; 6th piece: 1=header, 0=headerless
|
---|
| 56 | N XMZ,XMK,XMKN
|
---|
| 57 | N XMINSTR,CWDAT1,CWDAT2,CWRESP,CWRECP,CWPRTN,XMMSG,XMTASK
|
---|
| 58 | S XMZ=+$P(CWINPUT,";")
|
---|
| 59 | S CWRESP=$P(CWINPUT,";",3)
|
---|
| 60 | S CWRECP=$P(CWINPUT,";",4),CWRECP=$S($L(CWRECP):+CWRECP,1:-1)
|
---|
| 61 | S CWPRTN=$P(CWINPUT,";",5)
|
---|
| 62 | ;D INMSG1^XMXUTIL2(XMDUZ,XMZ,,.CWDAT1,.CWDAT2) ;GET # OF RESPONSES - NOT CURRENTLY NEEDED
|
---|
| 63 | S XMINSTR("HDR")=$S('$L($P(CWINPUT,";",6)):1,1:+$P(CWINPUT,";",6)) ;DEFAULT TO PRINTING HEADER
|
---|
| 64 | S XMINSTR("RESPS")=$S(+CWRESP:+CWRESP_"-",1:"*") ;DEFINE RANGE TO PRINT +$G((CWDAT("RESPS"))) HOLDS TOTAL # OF RESPONSES
|
---|
| 65 | I CWRECP>-1 D
|
---|
| 66 | . S XMINSTR("RECIPS")=$S(+CWRECP:2,1:1) ;CONVERT CWMA TO XM NOMENCLATURE
|
---|
| 67 | E S XMINSTR("RECIPS")=0 ;Don't print recipient list
|
---|
| 68 | D:$L($G(CWPRTN)) PRTMSG^XMXAPI(XMDUZ,,XMZ,CWPRTN,.XMINSTR,,.XMTASK)
|
---|
| 69 | I +$G(XMTASK) S CWDATA(1)="1^1^"_$G(XMTASK)
|
---|
| 70 | E S CWDATA(1)="1^0^Message could not be printed"
|
---|
| 71 | PRTMSGE Q
|
---|
| 72 | ;
|
---|
| 73 | %SUPREF(CWDATA,CWINPUT,CWTEXT) ;Set user preferences
|
---|
| 74 | ;
|
---|
| 75 | N CWSDATA,CWSEDATA,CWLP
|
---|
| 76 | N CWPRM,CWVAL,CWLP1,CWERR
|
---|
| 77 | S CWDATA(1)="0^^AN ERROR HAS OCCURRED"
|
---|
| 78 | S CWSDATA=$G(CWTEXT(-9902),"[START DATA]"),CWSEDATA=$G(CWTEXT(-9903),"[END DATA]")
|
---|
| 79 | S CWLP=-1 D FNDLP^CWMAILB(.CWLP,CWSDATA)
|
---|
| 80 | G:$G(CWLP)="" SUPREND
|
---|
| 81 | F S CWLP=$O(CWTEXT(CWLP)) Q:CWLP="" Q:CWTEXT(CWLP)=CWSEDATA D
|
---|
| 82 | . I CWTEXT(CWLP)'?1"[".E1"]" D
|
---|
| 83 | . . S CWPRM=$$GETPRM^CWMAILE($P(CWTEXT(CWLP),"=")) ;get parameter
|
---|
| 84 | . . I $L(CWPRM) D
|
---|
| 85 | . . . S CWVAL=$P(CWTEXT(CWLP),"=",2) ;get value
|
---|
| 86 | . . . S CWERR=$$SETPARM(XMDUZ,CWPRM,CWVAL) ;set value into parameter
|
---|
| 87 | S CWDATA(1)="1^1^Preferences have been stored"
|
---|
| 88 | SUPREND Q
|
---|
| 89 | ;
|
---|
| 90 | SETPARM(CWDUZ,CWPARM,CWVALUE) ;Set value into parameter instance
|
---|
| 91 | ;Input: CWPARM - holds the return value of $$GETPRM^CWMAILE
|
---|
| 92 | ; CWVALUE - value to stuff (single value or comma delimited string)
|
---|
| 93 | ; CWDUZ - user
|
---|
| 94 | Q:'CWDUZ 1 ;must have a valid user
|
---|
| 95 | K CWERR
|
---|
| 96 | I 'CWPARM D ;single instance
|
---|
| 97 | . D EN^XPAR("USR.`"_CWDUZ,$P(CWPARM,"|",2),1,CWVALUE,.CWERR)
|
---|
| 98 | E D ;multiple instances
|
---|
| 99 | . N CWLP,CWX,CWXA
|
---|
| 100 | . S CWX=CWVALUE,CWLP=0
|
---|
| 101 | . F Q:$L(CWX,";")<(CWLP+1) D
|
---|
| 102 | . . S CWLP=CWLP+1
|
---|
| 103 | . . S CWXA=$P(CWX,";",CWLP) ;CWXA holds the column,width pair
|
---|
| 104 | . . D EN^XPAR("USR.`"_CWDUZ,$P(CWPARM,"|",2),CWLP,CWXA,.CWERR) ;stuff value
|
---|
| 105 | Q CWERR
|
---|
| 106 | ;
|
---|
| 107 | %GETSVER(CWDATA,CWPARAM) ;GET SERVER VERSION
|
---|
| 108 | S CWDATA(1)="1^1^"_+$$VERSION^XPDUTL("CWMA")
|
---|
| 109 | Q
|
---|