added AD group support to notifications system
This commit is contained in:
@ -14,7 +14,6 @@ COMPILE FUNCTION obj_Notes_Sent(Method,Parms)
|
||||
|
||||
*/
|
||||
|
||||
|
||||
DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables
|
||||
DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, ErrMsg, Btree.Extract,ErrMsg, Update_Index
|
||||
|
||||
@ -26,7 +25,7 @@ $INSERT LOGICAL
|
||||
$INSERT SRPMail_Inserts
|
||||
|
||||
EQU TARGET_ACTIVELIST$ TO 5
|
||||
|
||||
|
||||
|
||||
ErrTitle = 'Error in Stored Procedure "obj_Notes_Sent"'
|
||||
ErrorMsg = ''
|
||||
@ -47,7 +46,7 @@ BEGIN CASE
|
||||
CASE Method = 'GetUserKeys' ; GOSUB GetUserKeys
|
||||
CASE 1
|
||||
ErrorMsg = 'Unknown Method ':QUOTE(Method):' passed to object.'
|
||||
|
||||
|
||||
END CASE
|
||||
|
||||
IF ErrorMsg NE '' THEN
|
||||
@ -58,77 +57,74 @@ END
|
||||
RETURN Result
|
||||
|
||||
|
||||
|
||||
* * * * * * *
|
||||
Create:
|
||||
* * * * * * *
|
||||
|
||||
Recipient = Parms[1,@RM]
|
||||
NoteID = Parms[COL2()+1,@RM]
|
||||
TxDTM = Parms[COL2()+1,@RM] ;* In External format
|
||||
|
||||
IF Recipient = '' THEN ErrorMsg = 'Unassigned Parameter "Recipient" passed to object. (':Method:')'
|
||||
IF NoteID = '' THEN ErrorMsg = 'Unassigned Parameter "NoteID" passed to object. (':Method:')'
|
||||
IF TxDTM = '' THEN ErrorMsg = 'Unassigned Parameter "TxDTM" passed to object. (':Method:')'
|
||||
|
||||
IF ErrorMsg NE '' THEN RETURN
|
||||
|
||||
thisTxDTM = ICONV(TxDTM,'DT')
|
||||
|
||||
IF thisTxDTM = '' THEN
|
||||
ErrorMsg = 'Invalid parameter "TxDTM" = ':QUOTE(TxDTM):' passed to object. (':Method:')'
|
||||
RETURN
|
||||
END
|
||||
|
||||
OtParms = 'NOTES_SENT':@RM:Recipient:'*':NoteID:@RM:@RM:TxDTM ;* First (and only) field in record is TxDTM
|
||||
obj_Tables('WriteRec',OtParms) ;* Writes new record
|
||||
|
||||
Update_Index('NOTES_SENT','USER_ID','')
|
||||
|
||||
|
||||
|
||||
Recipient = Parms[1,@RM]
|
||||
NoteID = Parms[COL2()+1,@RM]
|
||||
TxDTM = Parms[COL2()+1,@RM] ;* In External format
|
||||
|
||||
IF Recipient = '' THEN ErrorMsg = 'Unassigned Parameter "Recipient" passed to object. (':Method:')'
|
||||
IF NoteID = '' THEN ErrorMsg = 'Unassigned Parameter "NoteID" passed to object. (':Method:')'
|
||||
IF TxDTM = '' THEN ErrorMsg = 'Unassigned Parameter "TxDTM" passed to object. (':Method:')'
|
||||
|
||||
IF ErrorMsg NE '' THEN RETURN
|
||||
|
||||
thisTxDTM = ICONV(TxDTM,'DT')
|
||||
|
||||
IF thisTxDTM = '' THEN
|
||||
ErrorMsg = 'Invalid parameter "TxDTM" = ':QUOTE(TxDTM):' passed to object. (':Method:')'
|
||||
RETURN
|
||||
END
|
||||
|
||||
OtParms = 'NOTES_SENT':@RM:Recipient:'*':NoteID:@RM:@RM:TxDTM ;* First (and only) field in record is TxDTM
|
||||
obj_Tables('WriteRec',OtParms) ;* Writes new record
|
||||
|
||||
Update_Index('NOTES_SENT','USER_ID','', True$)
|
||||
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
|
||||
* * * * * * *
|
||||
Delete:
|
||||
* * * * * * *
|
||||
|
||||
|
||||
NotesSentKeys = Parms[1,@RM]
|
||||
|
||||
IF NotesSentKeys = '' THEN RETURN
|
||||
|
||||
OPEN 'NOTES_SENT' TO NotesSentFile THEN
|
||||
KeyCnt = COUNT(NotesSentKeys,@VM) + (NotesSentKeys NE '')
|
||||
FOR I = 1 TO KeyCnt
|
||||
DELETE NotesSentFile,NotesSentKeys<1,I> ELSE NULL
|
||||
NEXT I
|
||||
END
|
||||
|
||||
|
||||
|
||||
NotesSentKeys = Parms[1,@RM]
|
||||
|
||||
IF NotesSentKeys = '' THEN RETURN
|
||||
|
||||
OPEN 'NOTES_SENT' TO NotesSentFile THEN
|
||||
KeyCnt = COUNT(NotesSentKeys,@VM) + (NotesSentKeys NE '')
|
||||
FOR I = 1 TO KeyCnt
|
||||
DELETE NotesSentFile,NotesSentKeys<1,I> ELSE NULL
|
||||
NEXT I
|
||||
END
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
* * * * * * *
|
||||
GetUserKeys:
|
||||
* * * * * * *
|
||||
|
||||
Recipient = Parms[1,@RM]
|
||||
|
||||
IF Recipient = '' THEN RETURN
|
||||
|
||||
OPEN 'DICT.NOTES_SENT' TO DictVar THEN
|
||||
SearchString = 'USER_ID':@VM:Recipient:@FM
|
||||
Flag = ''
|
||||
Btree.Extract(SearchString,'NOTES_SENT',DictVar,NotesSentKeys,'',Flag)
|
||||
IF Get_Status(errCode) THEN
|
||||
ErrMsg(errCode)
|
||||
RETURN
|
||||
|
||||
Recipient = Parms[1,@RM]
|
||||
|
||||
IF Recipient = '' THEN RETURN
|
||||
|
||||
OPEN 'DICT.NOTES_SENT' TO DictVar THEN
|
||||
SearchString = 'USER_ID':@VM:Recipient:@FM
|
||||
Flag = ''
|
||||
Btree.Extract(SearchString,'NOTES_SENT',DictVar,NotesSentKeys,'',Flag)
|
||||
IF Get_Status(errCode) THEN
|
||||
ErrMsg(errCode)
|
||||
RETURN
|
||||
END
|
||||
|
||||
Result = NotesSentKeys
|
||||
END
|
||||
|
||||
Result = NotesSentKeys
|
||||
END
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user