added AD group support to notifications system

This commit is contained in:
Infineon\StieberD 2024-10-04 17:35:08 -07:00
parent 0b5ce72c39
commit 2a5abee93e
38 changed files with 9811 additions and 2732 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
LSL2/STPROC/TEST_DANIEL3.txt LSL2/STPROC/TEST_DANIEL3.txt
LSL2/STPROC/TEST_DANIEL3.txt

File diff suppressed because it is too large Load Diff

View File

@ -10391,13 +10391,23 @@
"<2,2,166>": { "<2,2,166>": {
"<2,2,166,1>": "R", "<2,2,166,1>": "R",
"<2,2,166,2>": "EXECUTE", "<2,2,166,2>": "EXECUTE",
"<2,2,166,3>": "LSL2*OIWINEXE**NOTIFICATION", "<2,2,166,3>": "LSL2*OIWINEXE**NDW_NOTIFICATION",
"<2,2,166,4>": { "<2,2,166,4>": {
"<2,2,166,4,1>": "", "<2,2,166,4,1>": "CreateParam",
"<2,2,166,4,2>": "@WINDOW" "<2,2,166,4,2>": "@WINDOW"
}, },
"<2,2,166,5>": "", "<2,2,166,5>": "",
"<2,2,166,6>": "" "<2,2,166,6>": "",
"<2,2,166,7>": "",
"<2,2,166,8>": "",
"<2,2,166,9>": "",
"<2,2,166,10>": "",
"<2,2,166,11>": "",
"<2,2,166,12>": "",
"<2,2,166,13>": "",
"<2,2,166,14>": "",
"<2,2,166,15>": "STARTWIN",
"<2,2,166,16>": "0"
}, },
"<2,2,167>": { "<2,2,167>": {
"<2,2,167,1>": "R", "<2,2,167,1>": "R",

File diff suppressed because it is too large Load Diff

View File

@ -182,6 +182,7 @@ end service
// 9/26/2024 - [JRO] Initial Programmer. // 9/26/2024 - [JRO] Initial Programmer.
//---------------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------------
Service GetADGroupsByString(SearchString, Domain=DOMAIN, SearchByDescription=DESCRIPTION_BOOL, GroupType=AD_GROUP_TYPE) Service GetADGroupsByString(SearchString, Domain=DOMAIN, SearchByDescription=DESCRIPTION_BOOL, GroupType=AD_GROUP_TYPE)
Set_Status(0) Set_Status(0)
ErrMessage = '' ErrMessage = ''
ADGroups = '' ADGroups = ''

View File

@ -69,6 +69,7 @@ Set_Property( @WINDOW: '.NOTE_DATA2', 'PREVSELPOS', 0)
RETURN RETURN
* * * * * * * * * * * * * *
Refresh: Refresh:
* * * * * * * * * * * * * *
@ -92,6 +93,7 @@ Refresh:
RETURN RETURN
* * * * * * * * * * * * * *
Rebuild: Rebuild:
* * * * * * * * * * * * * *
@ -125,8 +127,6 @@ GOSUB Refresh
RETURN RETURN
* * * * * * * * * * * * * *
ReadNote: ReadNote:
* * * * * * * * * * * * * *
@ -252,11 +252,3 @@ GOSUB Refresh
RETURN RETURN

View File

@ -233,22 +233,3 @@ GOSUB Refresh
RETURN RETURN

View File

@ -866,8 +866,8 @@ AddMakeup:
Convert @VM to '' in SlotWaferIDs Convert @VM to '' in SlotWaferIDs
// Flush/update pending index transactions. // Flush/update pending index transactions.
Update_Index('WO_MAT', 'MU_PART_NO', False$) Update_Index('WO_MAT', 'MU_PART_NO', False$, True$)
Update_Index('WO_MAT', 'CURR_STATUS', False$) Update_Index('WO_MAT', 'CURR_STATUS', False$, True$)
IF Get_Status(errCode) THEN IF Get_Status(errCode) THEN
ErrMsg(errCode) ErrMsg(errCode)
@ -1197,3 +1197,4 @@ return

File diff suppressed because it is too large Load Diff

View File

@ -666,7 +666,6 @@ Service SearchIndex(TableName, ColumnName, SearchValue, UpdateIndex)
ServiceKeyID := '*' : TableName : '*' : ColumnName : '*' : SearchValue ServiceKeyID := '*' : TableName : '*' : ColumnName : '*' : SearchValue
ServiceKeyID = SRP_Encode(ServiceKeyID, 'BASE64') ServiceKeyID = SRP_Encode(ServiceKeyID, 'BASE64')
* KeyIDList = Memory_Services('GetValue', ServiceKeyID, True$, 5)
KeyIDList = '' KeyIDList = ''
If TableName NE '' AND ColumnName NE '' AND SearchValue NE '' then If TableName NE '' AND ColumnName NE '' AND SearchValue NE '' then
@ -674,7 +673,7 @@ Service SearchIndex(TableName, ColumnName, SearchValue, UpdateIndex)
DictTableHandle = Database_Services('GetTableHandle', 'DICT.' : TableName) DictTableHandle = Database_Services('GetTableHandle', 'DICT.' : TableName)
If Error_Services('NoError') then If Error_Services('NoError') then
Set_Status(0) Set_Status(0)
If UpdateIndex then Update_Index(TableName, ColumnName 0) If UpdateIndex then Update_Index(TableName, ColumnName, False$, True$)
Set_Status(0) Set_Status(0)
Flag = '' Flag = ''
Btree.Extract(ColumnName : @VM : SearchValue : @FM, Tablename, DictTableHandle, KeyIDList, 'S', Flag) Btree.Extract(ColumnName : @VM : SearchValue : @FM, Tablename, DictTableHandle, KeyIDList, 'S', Flag)
@ -1045,3 +1044,4 @@ end service
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -25,6 +25,7 @@ $insert LOGICAL
$insert SERVICE_SETUP $insert SERVICE_SETUP
$Insert LSL_USERS_EQU $Insert LSL_USERS_EQU
$Insert RLIST_EQUATES $Insert RLIST_EQUATES
$Insert NOTIFICATION_EQUATES
equ crlf$ to \0D0A\ equ crlf$ to \0D0A\
equ tab$ to char(09) equ tab$ to char(09)
@ -40,11 +41,17 @@ EQU FRIDAY$ to 5
EQU SATURDAY$ to 6 EQU SATURDAY$ to 6
EQU SUNDAY$ to 7 EQU SUNDAY$ to 7
Declare Function Get.RecCount, SRP_Datetime, Datetime, SRP_MATH, Lsl_Users_Services Declare Function Get.RecCount, SRP_Datetime, Datetime, SRP_MATH, Lsl_Users_Services, Active_Directory_Services
Declare Function DCount Declare Function DCount, Database_Services, Environment_Services, SRP_Array, Logging_Services
Declare Function Database_Services, Declare subroutine Btree.Extract, Logging_Services
Declare Function Environment_Services
Declare subroutine Btree.Extract LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\LSLUsers'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Notification Groups Update Log.csv'
Headers = 'Logging DTM' : @FM : 'Notification ID' : @FM : 'Notes'
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
GoToService else GoToService else
Error_Services('Add', Service : ' is not a valid service request within the ' : ServiceModule : ' services module.') Error_Services('Add', Service : ' is not a valid service request within the ' : ServiceModule : ' services module.')
@ -187,6 +194,28 @@ Service GetOnShiftUsersByClass(Class, IncludeNextShift)
end service end service
Service GetOnShiftUsers()
DatetimeNow = OConv(SRP_DateTime("Now"), 'DT')
CurrentShift = Lsl_Users_Services('GetShiftByDate', DatetimeNow)
Open 'DICT.LSL_USERS' to DictLSLUsers then
SearchString = ''
SearchString := 'SHIFT' : @VM : CurrentShift : @VM : '' : @FM ; // Include office personnel (i.e. no shift assigned)
SearchString := 'ACTIVE' : @VM : True$ : @FM
LSLUsersKeys = ''
Btree.Extract(SearchString, 'LSL_USERS', DictLSLUsers, LSLUsersKeys, '', '')
ErrCode = ''
IF Get_Status(ErrCode) then
ErrorMsg = 'Error in ':Service:' service. Error calling Btree.Extract. Error code ':ErrCode:'.'
end
Response = LSLUsersKeys
end else
ErrorMsg = 'Error in ':Service:' service. Error opening LSL_USERS dictionary.'
end
end service
Service GetShiftByDate(Date, GenerateFlag) Service GetShiftByDate(Date, GenerateFlag)
OnShift = ''; *Return Value OnShift = ''; *Return Value
@ -350,3 +379,86 @@ Service GetShiftByDate(Date, GenerateFlag)
end service end service
Service UpdateNotificationGroups()
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
Lock hSysLists, ServiceKeyID then
Open 'NOTIFICATION' to hTable then
EOF = False$
Select hTable
Loop
ReadNext KeyId else EOF = True$
Until EOF
Lock hTable, KeyId then
Read Rec from hTable, KeyId then
UseAD = Rec<NOTIFICATION_USE_ACTIVE_DIRECTORY$>
If UseAD then
LSLUserList = ''
// Update LSL_User list based on current members in Active Directory groups
ADGroups = Rec<NOTIFICATION_ACTIVE_DIRECTORY_GROUPS$>
For each GroupName in ADGroups using @VM
MemberList = Active_Directory_Services('GetADGroupMembersByGroupName', GroupName, 'INFINEON')
MemberList = SRP_Array('Rotate', MemberList, @FM, @VM)
ADUserNames = MemberList<1>
LSLUserNames = ''
LSLNames = ''
Open 'DICT.LSL_USERS' to hDict then
For each ADUserName in ADUserNames using @VM setting vPos
Query = 'DOMAIN_USERNAME':@VM:ADUserName:@FM:'ACTIVE':@VM:True$:@FM
Flag = ''
LSLUsername = ''
Btree.Extract(Query, 'LSL_USERS', hDict, LSLUsername, '', Flag)
If Flag EQ 0 then
If LSLUsername NE '' then
LSLUserList<0, -1> = LSLUsername
end else
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = KeyId
LogData<3> = 'No LSL_USERS record found for active directory member "':ADUserName:'".'
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
end
end else
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = KeyId
LogData<3> = 'Btree.Extract call failed for DOMAIN_USERNAME "':ADUserName:'".'
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
end
Next ADUserName
end
Next GroupName
LSLUserList = SRP_Array('Clean', LSLUserList, 'TrimAndMakeUnique', @VM)
LSLUserList = SRP_Array('SortSimpleList', LSLUserList, 'AscendingText', @VM)
Rec<NOTIFICATION_USER_ID$> = LSLUserList
Write Rec on hTable, KeyId else
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = KeyId
LogData<3> = 'Failed to write record during update.'
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
end
end
end else
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = KeyId
LogData<3> = 'Failed to read record during update.'
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
end
Unlock hTable, KeyId else
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = KeyId
LogData<3> = 'Failed to unlock record during update.'
Logging_Services('AppendLog', objLog, LogData, @RM, @FM)
end
end
Repeat
end
Unlock hSysLists, ServiceKeyID else Null
end
end service

View File

@ -0,0 +1,151 @@
Compile function NDW_ACTIVE_DIRECTORY_GROUPS_EVENTS(CtrlEntId, Event, @PARAMS)
/***********************************************************************************************************************
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
permission from Infineon.
Name : NDW_Active_Directory_Groups_Events
Description : This function acts as a commuter module for all events related to this window.
Notes : Commuter Modules are automatically called from the Promoted_Events function which is called by the
application-specific promoted event handler. This makes it possible to add QuickEvents that need to
execute Basic+ logic without having use the Form Designer to make the association, although this is
limited to the events which are currently promoted.
If the form needs to call the commuter module directly then the QuickEvent parameters should be
formatted like this:
'@SELF','@EVENT',['@PARAM1','@PARAMx']
Parameters :
CtrlEntId [in] -- The fully qualified name of the control calling the promoted event
Event [in] -- The event being executed. See the Notes section regarding "PRE" events
Param1-15 [in] -- Additional event parameter holders
EventFlow [out] -- Set to 1 or 0 so the calling event knows whether or not to chain forward. See comments in
EVENT_SETUP insert
History : (Date, Initials, Notes)
10/01/24 djs Created initial commuter module.
***********************************************************************************************************************/
#pragma precomp SRP_PreCompiler
#window NDW_ACTIVE_DIRECTORY_GROUPS
$Insert EVENT_SETUP
$Insert LOGICAL
$Insert RTI_STYLE_EQUATES
$Insert MSG_EQUATES
Declare function Active_Directory_Services, Send_Message, SRP_Array
Declare subroutine End_Dialog, Set_Property, Btree.Extract
GoToEvent Event for CtrlEntId else
// Event not implemented
end
Return EventFlow or 1
//-----------------------------------------------------------------------------
// EVENT HANDLERS
//-----------------------------------------------------------------------------
Event WINDOW.CREATE(CreateParam)
SelGroups = CreateParam
Def = ""
Def<MCOL$> = -2
Def<MROW$> = -2
Def<MTEXT$> = "Loading groups..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def) ;* display the processing message
ADGroupData = Active_Directory_Services('GetADGroupsByString', 'MES-Mesa*', 'INFINEON')
ADGroupData<-1> = Active_Directory_Services('GetADGroupsByString', 'IFX-IRF-Mesa*', 'INFINEON')
ADGroupData<-1> = Active_Directory_Services('GetADGroupsByString', 'KLU-Mesa*', 'INFINEON')
ADGroupData = SRP_Array('Clean', ADGroupData, 'TrimAndMakeUnique', @FM)
NumRows = DCount(ADGroupData, @FM)
If NumRows GT 0 then
For RowIndex = 1 to NumRows
ThisGroupID = ADGroupData<RowIndex, 1>
Selected = InList(SelGroups, ThisGroupID, @VM)
ADGroupData = Insert(ADGroupData, RowIndex, 1, 0, Selected)
Next RowIndex
end
Set_Property(@Window:'.EDT_AD_GROUPS', 'LIST', ADGroupData)
ColStyles = Send_Message(@Window:'.EDT_AD_GROUPS','COLSTYLE',0,'')
ColStyles<1> = BitOr(ColStyles<1>,DTCS_CHECKBOX$)
ColStyles<1> = BitOr(ColStyles<1>,DTCS_CHECKBOXCENTER$)
void = Send_Message(@Window:'.EDT_AD_GROUPS','COLSTYLE',0,ColStyles)
Msg(@window, MsgUp) ;* take down the processing message
End Event
Event PUB_OK.CLICK()
SelGroups = ''
List = Get_Property(@Window:'.EDT_AD_GROUPS', 'LIST')
If List NE '' then
For each Row in List using @FM setting RowIndex
RowSelected = Row<0, 1>
If RowSelected then
SelGroups<-1> = Row<0, 2> : @VM : Row<0, 3> : @VM : Row<0, 4>
end
Next Row
end
End_Dialog(@Window, SelGroups)
end event
Event PUB_CANCEL.CLICK()
End_Dialog(@Window, '')
end event
Event EDT_AD_GROUPS.ROWSELCHANGED(SelRow, SelState)
Def = ""
Def<MCOL$> = -2
Def<MROW$> = -2
Def<MTEXT$> = "Loading group data..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def) ;* display the processing message
List = Get_Property(CtrlEntId, 'LIST')
RowData = List<SelRow>
GroupName = RowData<0, 2>
Array = Get_Property(@Window, '@':GroupName)
If Array EQ '' then
MemberList = Active_Directory_Services('GetADGroupMembersByGroupName', GroupName, 'INFINEON')
MemberList = SRP_Array('Rotate', MemberList, @FM, @VM)
ADUserNames = MemberList<1>
LSLUserNames = ''
LSLNames = ''
Open 'DICT.LSL_USERS' to hDict then
For each ADUserName in ADUserNames using @VM setting vPos
Query = 'DOMAIN_USERNAME':@VM:ADUserName:@FM
Flag = ''
LSLUsername = ''
Btree.Extract(Query, 'LSL_USERS', hDict, LSLUsername, '', Flag)
LSLUsernames<0, vPos> = LSLUsername<0, 1>
LSLNames<0, vPos> = Xlate('LSL_USERS', LSLUserName<0, 1>, 'FIRST_LAST', 'X')
Next ADUserName
end
Array = ADUsernames : @FM : LSLUsernames : @FM : LSLNames
Set_Property(@Window, '@':GroupName, Array)
end
Set_Property(@Window:'.EDT_AD_MEMBERS', 'ARRAY', Array)
Msg(@window, MsgUp) ;* take down the processing message
end event

View File

@ -93,7 +93,7 @@ Set_List:
List = "" List = ""
Table = "AUDIT_WO_MAST_SCHED" Table = "AUDIT_WO_MAST_SCHED"
Field = "DATE_IN" Field = "DATE_IN"
Update_Index(Table, Field, No$) Update_Index(Table, Field, No$, True$)
Open Table to hTable else null Open Table to hTable else null
@ -133,3 +133,4 @@ Set_List:
Set_Property(@Window:".RPT_LIST", "OLE.List", List) Set_Property(@Window:".RPT_LIST", "OLE.List", List)
return return

View File

@ -378,6 +378,7 @@ Event WINDOW.TIMER()
end end
Notes_Services('UpdateNotes', @User4) Notes_Services('UpdateNotes', @User4)
If Error_Services('HasError') then Error_Services('DisplayError')
NewMessages = Notes_Services('GetUnreadMessageCount', @User4) NewMessages = Notes_Services('GetUnreadMessageCount', @User4)
ColorFill = '' ColorFill = ''
@ -852,3 +853,4 @@ return

View File

@ -0,0 +1,438 @@
Compile function NDW_NOTIFICATION_EVENTS(CtrlEntId, Event, @PARAMS)
/***********************************************************************************************************************
This program is proprietary and is not to be used by or disclosed to others, nor is it to be copied without written
permission from Infineon.
Name : NDW_Notification_Events
Description : This function acts as a commuter module for all events related to this window.
Notes : Commuter Modules are automatically called from the Promoted_Events function which is called by the
application-specific promoted event handler. This makes it possible to add QuickEvents that need to
execute Basic+ logic without having use the Form Designer to make the association, although this is
limited to the events which are currently promoted.
If the form needs to call the commuter module directly then the QuickEvent parameters should be
formatted like this:
'@SELF','@EVENT',['@PARAM1','@PARAMx']
Parameters :
CtrlEntId [in] -- The fully qualified name of the control calling the promoted event
Event [in] -- The event being executed. See the Notes section regarding "PRE" events
Param1-15 [in] -- Additional event parameter holders
EventFlow [out] -- Set to 1 or 0 so the calling event knows whether or not to chain forward. See comments in
EVENT_SETUP insert
History : (Date, Initials, Notes)
09/30/24 djs Created initial commuter module.
***********************************************************************************************************************/
#pragma precomp SRP_PreCompiler
#window NDW_NOTIFICATION
$Insert EVENT_SETUP
$Insert APP_INSERTS
$Insert MSG_EQUATES
$Insert POPUP_EQUATES
$Insert NOTIFICATION_EQUATES
EQU READONLY_GREEN$ TO 192 + (220*256) + (192*65536)
Declare function Admin_User, Database_Services, Error_Services, Active_Directory_Services, SRP_Array
Declare subroutine PlaceDialog, Error_Services, Database_Services, Btree.Extract
GoToEvent Event for CtrlEntId else
// Event not implemented
end
Return EventFlow or 1
//-----------------------------------------------------------------------------
// EVENT HANDLERS
//-----------------------------------------------------------------------------
Event WINDOW.CREATE(CreateParam)
PlaceDialog(-2, -2)
ColorArray = Send_Message(@Window:'.EDT_LSL_USERS', "COLOR_BY_POS", 2, 0)
ColorArray<1> = READONLY_GREEN$
Send_Message(@Window:'.EDT_LSL_USERS', "COLOR_BY_POS", 1, 0, ColorArray)
Send_Message(@Window:'.EDT_LSL_USERS', "COLOR_BY_POS", 2, 0, ColorArray)
Send_Message(@Window:'.EDT_AD_GROUPS', "COLOR_BY_POS", 1, 0, ColorArray)
Send_Message(@Window:'.EDT_AD_GROUPS', "COLOR_BY_POS", 2, 0, ColorArray)
Send_Message(@Window:'.EDT_AD_GROUPS', "COLOR_BY_POS", 3, 0, ColorArray)
End Event
Event WINDOW.READ()
Key = Get_Property(@Window:'.EDL_NOTIFICATION_ID', 'TEXT')
Begin Case
Case Key EQ ''
Set_Property(@Window:'.EDT_LSL_USERS', 'ENABLED', False$)
Case RowExists('NOTIFICATION', Key)
// Populate form
HaveLock = Database_Services('GetKeyIDLock', 'NOTIFICATION', Key, True$)
If HaveLock then
Set_Property(@Window, '@HAVE_LOCK', HaveLock)
Set_Property(@Window, '@LOCK_KEY', Key)
Set_Property(@Window:'.EDL_DESCRIPTION', 'ENABLED', True$)
Set_Property(@Window:'.CHK_USE_AD', 'ENABLED', True$)
Set_Property(@Window:'.CHK_LIMIT_TO_ACTIVE_SHIFT', True$)
Set_Property(@Window:'.PUB_CLEAR', 'ENABLED', True$)
Set_Property(@Window:'.PUB_DELETE', 'ENABLED', True$)
Set_Property(@Window:'.PUB_SAVE', 'ENABLED', True$)
NotifyRec = Database_Services('ReadDataRow', 'NOTIFICATION', Key)
If Error_Services('NoError') then
Set_Property(@Window, '@RECORD', NotifyRec)
Set_Property(@Window:'.EDL_DESCRIPTION', 'TEXT', NotifyRec<NOTIFICATION_DESC$>)
UseAD = NotifyRec<NOTIFICATION_USE_ACTIVE_DIRECTORY$>
Set_Property(@Window:'.CHK_USE_AD', 'DEFPROP', UseAD)
LimitOnShift = NotifyRec<NOTIFICATION_LIMIT_TO_ACTIVE_SHIFT$>
Set_Property(@Window:'.CHK_LIMIT_TO_ACTIVE_SHIFT', 'DEFPROP', LimitOnShift)
LSLUsers = NotifyRec<NOTIFICATION_USER_ID$>
LSLUsernames = Xlate('LSL_USERS', LSLUsers, 'FIRST_LAST', 'X')
LSLUsersArray = LSLUsers : @FM : LSLUsernames
Set_Property(@Window:'.EDT_LSL_USERS', 'ARRAY', LSLUsersArray)
ADGroups = NotifyRec<NOTIFICATION_ACTIVE_DIRECTORY_GROUPS$>
GroupList = ''
If ADGroups NE '' then
For each ADGroup in ADGroups using @VM setting vPos
GroupList<-1> = Active_Directory_Services('GetADGroupsByString', ADGroup, 'INFINEON')
Next ADGroup
end
Set_Property(@Window:'.EDT_AD_GROUPS', 'LIST', GroupList)
GoSub EnableControls
end else
Msg(@Window, '', 'OK', '', 'Error':@FM:'Error locking NOTIFICATION record "':Key:'" for update!')
end
end else
Msg(@Window, '', 'OK', '', 'Error':@FM:'Error reading NOTIFICATION record "':Key:'"!')
end
Case Otherwise$
// User is creating a new record
Set_Property(@Window:'.PUB_ADD_USERS', 'ENABLED', True$)
GoSub EnableControls
End Case
end event
Event WINDOW.CLEAR(bSaveKey, bSuppressWarning, bMaintainFocus)
GoSub EnableControls
Set_Property(@Window:'.PUB_DELETE', 'ENABLED', False$)
Set_Property(@Window:'.PUB_CLEAR', 'ENABLED', True$)
Set_Property(@Window:'.EDL_DESCRIPTION', 'ENABLED', False$)
Set_Property(@Window:'.CHK_USE_AD', 'ENABLED', False$)
Set_Property(@Window:'.CHK_LIMIT_TO_ACTIVE_SHIFT', 'ENABLED', False$)
Set_Property(@Window:'.PUB_ADD_USERS', 'ENABLED', False$)
Set_Property(@Window:'.REM_ADD_USERS', 'ENABLED', False$)
Set_Property(@Window:'.GRB_AD_GROUPS', 'ENABLED', False$)
Set_Property(@Window:'.EDT_AD_GROUPS', 'ENABLED', False$)
Set_Property(@Window:'.PUB_ADD_GROUPS', 'ENABLED', False$)
Set_Property(@Window:'.REM_ADD_GROUPS', 'ENABLED', False$)
end event
Event WINDOW.WRITE()
Key = Get_Property(@Window:'.EDL_NOTIFICATION_ID', 'TEXT')
NotifyRec = Get_Property(@Window, '@RECORD')
NotifyRec<NOTIFICATION_DESC$> = Get_Property(@Window:'.EDL_DESCRIPTION', 'TEXT')
UserArray = Get_Property(@Window:'.EDT_LSL_USERS', 'ARRAY')
UserIds = UserArray<1>
NotifyRec<NOTIFICATION_USER_ID$> = UserIds
GroupArray = Get_Property(@Window:'.EDT_AD_GROUPS', 'ARRAY')
GroupIds = GroupArray<1>
NotifyRec<NOTIFICATION_ACTIVE_DIRECTORY_GROUPS$> = GroupIds
NotifyRec<NOTIFICATION_USE_ACTIVE_DIRECTORY$> = Get_Property(@Window:'.CHK_USE_AD', 'DEFPROP')
NotifyRec<NOTIFICATION_LIMIT_TO_ACTIVE_SHIFT$> = Get_Property(@Window:'.CHK_LIMIT_TO_ACTIVE_SHIFT', 'DEFPROP')
Database_Services('WriteDataRow', 'NOTIFICATION', Key, NotifyRec, True$, False$, True$)
If Error_Services('NoError') then
GoSub UnlockRec
Post_Event(@Window, 'CLEAR')
end else
Msg(@Window, '', 'OK', '', 'Error':@FM:Error_Services('GetMessage'))
end
end event
Event WINDOW.CLOSE(CancelFlag, CloseFlags)
GoSub UnlockRec
end event
Event PUB_SAVE.CLICK()
Post_Event(@Window, 'WRITE')
end event
Event PUB_CLEAR.CLICK()
GoSub UnlockRec
Post_Event(@Window, 'CLEAR')
end event
Event PUB_LU_ID.CLICK()
TypeOver = ''
TypeOver<PSELECT$> = 1
NotifyID = Popup(@WINDOW,TypeOver,'NOTIFICATION')
IF NotifyID NE '' THEN
Set_Property(@Window:'.EDL_NOTIFICATION_ID', 'TEXT', NotifyID)
end
end event
Event EDT_LSL_USERS.ROWSELCHANGED(SelRow, SelState)
GoSub EnableControls
end event
Event EDT_AD_GROUPS.ROWSELCHANGED(SelRow, SelState)
GoSub EnableControls
end event
Event EDL_NOTIFICATION_ID.CHANGED(NewData)
If NewData NE '' then
GoSub UnlockRec
Post_Event(@Window, 'READ')
end
end event
Event EDL_NOTIFICATION_ID.LOSTFOCUS(Flag, FocusID)
If Flag EQ 1 then
GoSub UnlockRec
Post_Event(@Window, 'READ')
end
end event
Event PUB_ADD_USERS.CLICK()
CurrUserIDs = Get_Property(@Window:'.EDT_LSL_USERS','ARRAY')<1>
CurrUserIDsTrimmed = ''
FOR I = 1 TO COUNT(CurrUserIDs,@VM) + (CurrUserIDs NE '')
IF CurrUserIDs<1,I> NE '' THEN
CurrUserIDsTrimmed<1,I> = CurrUserIDs<1,I>
END
NEXT I
CurrUserIDs = CurrUserIDsTrimmed
NewUserIDs = Popup(@WINDOW,'','SHOW_USERS')
IF NewUserIDs = '' OR NewUserIDs = CHAR(27) THEN RETURN
FOR I = 1 TO COUNT(NewUserIDs,@VM) + (NewUserIDs NE '')
NewUserID = NewUserIDs<1,I>
LOCATE NewUserID IN CurrUserIDs BY 'AL' USING @VM SETTING POS ELSE
CurrUserIDs = INSERT(CurrUserIDs,1,POS,0,NewUserID)
END
NEXT I
LSLNames = Xlate('LSL_USERS', CurrUserIDs, 'FIRST_LAST', 'X')
NewArray = CurrUserIDs : @FM : LSLNames
Set_Property(@Window:'.EDT_LSL_USERS', 'ARRAY', NewArray)
end event
Event PUB_REM_USERS.CLICK()
SelRows = Get_Property(@Window:'.EDT_LSL_USERS', 'SELPOS')
SelRows = SelRows<2>
SelData = ''
NewList = ''
If SelRows NE '' then
DataList = Get_Property(@Window:'.EDT_LSL_USERS', 'LIST')
For each Row in DataList using @FM setting RowIndex
If Not(InList(SelRows, RowIndex, @VM)) then NewList<-1> = Row
Next Row
Set_Property(@Window:'.EDT_LSL_USERS', 'LIST', NewList)
GoSub EnableControls
end
end event
Event PUB_ADD_GROUPS.CLICK()
GroupArray = Get_Property(@Window:'.EDT_AD_GROUPS', 'ARRAY')
GroupIds = GroupArray<1>
SelGroups = Dialog_Box('NDW_ACTIVE_DIRECTORY_GROUPS', @Window, GroupIds)
Set_Property(@Window:'.EDT_AD_GROUPS', 'LIST', SelGroups)
Def = ""
Def<MCOL$> = -2
Def<MROW$> = -2
Def<MTEXT$> = "Updating LSL user list..."
Def<MTYPE$> = "U"
MsgUp = Msg(@window, Def) ;* display the processing message
GroupArray = Get_Property(@Window:'.EDT_AD_GROUPS', 'ARRAY')
GroupIds = GroupArray<1>
If GroupIds NE '' then
LSLUserNames = ''
LSLNames = ''
For each GroupId in GroupIds using @VM
MemberList = Active_Directory_Services('GetADGroupMembersByGroupName', GroupId, 'INFINEON')
MemberList = SRP_Array('Rotate', MemberList, @FM, @VM)
ADUserNames = MemberList<1>
Open 'DICT.LSL_USERS' to hDict then
For each ADUserName in ADUserNames using @VM setting vPos
Query = 'DOMAIN_USERNAME':@VM:ADUserName:@FM
Flag = ''
LSLUsername = ''
Btree.Extract(Query, 'LSL_USERS', hDict, LSLUsername, '', Flag)
If LSLUsername NE '' then LSLUsernames<0, -1> = LSLUsername<0, 1>
Next ADUserName
end
Next GroupId
If LSLUsernames NE '' then
LSLNames = Xlate('LSL_USERS', LSLUserNames, 'FIRST_LAST', 'X')
end
end
Array = LSLUsernames : @FM : LSLNames
Set_Property(@Window:'.EDT_LSL_USERS', 'ARRAY', Array)
Msg(@window, MsgUp) ;* take down the processing message
end event
Event PUB_REM_GROUPS.CLICK()
SelRows = Get_Property(@Window:'.EDT_AD_GROUPS', 'SELPOS')
SelRows = SelRows<2>
SelData = ''
NewList = ''
If SelRows NE '' then
DataList = Get_Property(@Window:'.EDT_AD_GROUPS', 'LIST')
For each Row in DataList using @FM setting RowIndex
If Not(InList(SelRows, RowIndex, @VM)) then NewList<-1> = Row
Next Row
Set_Property(@Window:'.EDT_AD_GROUPS', 'LIST', NewList)
GoSub EnableControls
end
end event
Event CHK_USE_AD.CLICK()
GoSub EnableControls
end event
EnableControls:
NotifyID = Get_Property(@Window:'.EDL_NOTIFICATION_ID', 'TEXT')
UseAD = Get_Property(@Window:'.CHK_USE_AD', 'DEFPROP')
Set_Property(@Window:'.PUB_CLEAR', 'ENABLED', (NotifyID NE ''))
Set_Property(@Window:'.EDL_DESCRIPTION', 'ENABLED', (NotifyID NE ''))
Set_Property(@Window:'.CHK_USE_AD', 'ENABLED', (NotifyID NE ''))
If UseAD NE True$ then Set_Property(@Window:'.CHK_LIMIT_TO_ACTIVE_SHIFT', 'DEFPROP', False$)
Set_Property(@Window:'.CHK_LIMIT_TO_ACTIVE_SHIFT', 'ENABLED', UseAD)
Set_Property(@Window:'.PUB_ADD_USERS', 'ENABLED', (UseAD NE True$))
Set_Property(@Window:'.EDT_LSL_USERS', 'ENABLED', (NotifyID NE ''))
If NotifyID NE '' then
Backcolor = WHITE$
end else
Backcolor = GREY$
end
Set_Property(@Window:'.EDT_LSL_USERS', 'BACKCOLOR', Backcolor)
Set_Property(@Window:'.GRB_AD_GROUPS', 'ENABLED', (UseAD EQ True$))
Set_Property(@Window:'.PUB_ADD_GROUPS', 'ENABLED', (UseAD EQ True$))
Set_Property(@Window:'.EDT_AD_GROUPS', 'ENABLED', (UseAD EQ True$))
If ( (NotifyID NE '') and (UseAD EQ True$) ) then
Backcolor = WHITE$
end else
Backcolor = GREY$
end
Set_Property(@Window:'.EDT_AD_GROUPS', 'BACKCOLOR', Backcolor)
DelBtnEnabled = False$
SelRows = Get_Property(@Window:'.EDT_LSL_USERS', 'SELPOS')
SelRows = SelRows<2>
SelData = ''
If SelRows NE '' then
Data = Get_Property(@Window:'.EDT_LSL_USERS', 'LIST')
Convert @VM to '' in Data
For each Row in SelRows using @VM
If Data<Row> NE '' then
SelData<-1> = Data<Row>
end
Next Row
If (SelData NE '') and (UseAD NE True$) then DelBtnEnabled = True$
end
Set_Property(@Window:'.PUB_REM_USERS', 'ENABLED', DelBtnEnabled)
DelBtnEnabled = False$
SelRows = Get_Property(@Window:'.EDT_AD_GROUPS', 'SELPOS')
SelRows = SelRows<2>
SelData = ''
If SelRows NE '' then
Data = Get_Property(@Window:'.EDT_AD_GROUPS', 'LIST')
Convert @VM to '' in Data
For each Row in SelRows using @VM
If Data<Row> NE '' then
SelData<-1> = Data<Row>
end
Next Row
If (SelData NE '') and (UseAD EQ True$) then DelBtnEnabled = True$
end
Set_Property(@Window:'.PUB_REM_GROUPS', 'ENABLED', DelBtnEnabled)
return
UnlockRec:
Key = Get_Property(@Window, '@LOCK_KEY')
If Key NE '' then
HaveLock = Get_Property(@Window, '@HAVE_LOCK')
If HaveLock then
Database_Services('ReleaseKeyIDLock', 'NOTIFICATION', Key)
end
end
return

View File

@ -67,7 +67,7 @@ OnClick.HYP_FIND:
Case Field EQ "WO" ; Field = "WO_NO2" Case Field EQ "WO" ; Field = "WO_NO2"
Case Field EQ "PSN" ; Field = "PSN_NO" Case Field EQ "PSN" ; Field = "PSN_NO"
End Case End Case
Update_Index(Table, Field, No$) Update_Index(Table, Field, No$, Yes$)
Extract_SI_Keys(Table, Field, Find, Keys) Extract_SI_Keys(Table, Field, Find, Keys)
rv = Xlate(Table, Keys, "REACT_NO", "X") :@FM: Xlate(Table, Keys, "WO_NO", "X") :@FM: Keys rv = Xlate(Table, Keys, "REACT_NO", "X") :@FM: Xlate(Table, Keys, "WO_NO", "X") :@FM: Keys
Appts = "";!! Appts = "";!!
@ -109,3 +109,4 @@ Window.CREATE:
SRP_Redirect_OLE_Events() SRP_Redirect_OLE_Events()
return return

View File

@ -1,15 +1,80 @@
Compile function Notes_Services(@Service, @Params) Compile function Notes_Services(@Service, @Params)
/***********************************************************************************************************************
Declare function Database_Services,obj_Notes_Sent, Get_Status, Error_Services, Obj_Tables, Datetime, SRP_Datetime Name : RDS_Services
Declare subroutine Obj_Tables, Obj_Notes_Sent, Update_Index, Errmsg, Database_Services, Btree.Extract, Error_Services
Declare subroutine Notes_Services Description : Handler program for all RDS services.
Notes : Application errors should be logged using the Error Services module. There are a few methodological
assumptions built into way errors are managed which are important to understand in order to properly
work with Error Services:
- The term 'top' refers to the originating procedure of a call stack and the term 'bottom' refers to
the last routine (or the current routine) within a call stack. Within the OpenInsight Debugger
this will appear backwards since the originating procedure always appears at the bottom of the
list and the current routine appears at the top of the list. We are using this orientation because
it is common to refer to the process of calling other procedures as 'drilling down'.
- The reason for defining the orientation of the call stack is because Error_Services allows for
multiple error conditions to be appended to an original error. In most cases this will happen when
a procedure at the bottom of the stack generates an error condition and then returns to its
calling procedure. This higher level procedure can optionally add more information relevant to
itself. This continues as the call stack 'bubbles' its way back to the top to where the
originating procedure is waiting.
- Native OpenInsight commands that handle errors (e.g., Set_Status, Set_FSError, Set_EventStatus)
preserve their error state until explicitly cleared. This can hinder the normal execution of code
since subsequent procedures (usually SSPs) will fail if a pre-existing error condition exists.
Our philosophy is that error conditions should automatically be cleared before a new procedure
is executed to avoid this problem. However, the nature of Basic+ does not make this easy to
automate for any given stored procedure. Therefore, if a stored procedure wants to conform to our
philosophy then it should include a call into the 'Clear' service request at the top of the
program. Alternatively this can be done through a common insert (see SERVICE_SETUP for example.)
- Service modules will use the SERVICE_SETUP insert and therefore automatically clear out any
error conditions that were set before.
Parameters :
Service [in] -- Name of the service being requested
Param1-10 [in/out] -- Additional request parameter holders
Response [out] -- Response to be sent back to the Controller (MCP) or requesting procedure
Metadata :
History : (Date, Initials, Notes)
10/16/24 djs Added service to process notes queue.
***********************************************************************************************************************/
#pragma precomp SRP_PreCompiler #pragma precomp SRP_PreCompiler
$insert LOGICAL $Insert SERVICE_SETUP
$insert NOTE_PTRS_EQU $Insert LOGICAL
$insert MSG_EQUATES $Insert NOTE_PTRS_EQUATES
$Insert NOTES_EQU $Insert MSG_EQUATES
*$Insert NOTES_EQUATES $Insert NOTES_EQUATES
$Insert LSL_USERS_EQUATES
$Insert EMAIL_BOX_EQUATES
$Insert NOTES_QUEUE_EQUATES
$Insert NOTIFICATION_EQUATES
Declare function Database_Services, obj_Notes_Sent, Get_Status, Error_Services, Obj_Tables, Datetime, SRP_Datetime
Declare function SRP_Array, Environment_Services, Logging_Services, RTI_CreateGuid, LSL_Users_Services
Declare subroutine Obj_Tables, Obj_Notes_Sent, Update_Index, Errmsg, Database_Services, Btree.Extract, Error_Services
Declare subroutine Notes_Services, Logging_Services
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\NOTES'
LogDate = Oconv(Date(), 'D4/')
LogTime = Oconv(Time(), 'MTS')
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Notes Queue Processing Log.csv'
Headers = 'Logging DTM' : @FM : 'Notes Queue ID' : @FM : 'Notes'
objNotesQProcLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' Notes Queue Log.csv'
Headers = 'Logging DTM' : @FM : 'Notes Queue ID' : @FM : 'Notes'
objNotesQueueLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
GoToService GoToService
@ -20,6 +85,7 @@ Return Response or ""
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
Service SnoozeNewMessageNotifications(UserID) Service SnoozeNewMessageNotifications(UserID)
Open 'NOTE_PTRS' to hTable then Open 'NOTE_PTRS' to hTable then
SnoozeTime = Datetime() SnoozeTime = Datetime()
WriteV SnoozeTime to hTable, UserID, NOTE_PTRS_SNOOZE$ else WriteV SnoozeTime to hTable, UserID, NOTE_PTRS_SNOOZE$ else
@ -31,7 +97,9 @@ Service SnoozeNewMessageNotifications(UserID)
end service end service
Service AllowNewMessageNotifications(UserID) Service AllowNewMessageNotifications(UserID)
Open 'NOTE_PTRS' to hTable then Open 'NOTE_PTRS' to hTable then
SnoozeTime = '' SnoozeTime = ''
WriteV SnoozeTime to hTable, UserID, NOTE_PTRS_SNOOZE$ else WriteV SnoozeTime to hTable, UserID, NOTE_PTRS_SNOOZE$ else
@ -43,6 +111,7 @@ Service AllowNewMessageNotifications(UserID)
end service end service
Service CheckForNotificationSnooze(UserID) Service CheckForNotificationSnooze(UserID)
SnoozeRow = '' SnoozeRow = ''
@ -62,8 +131,9 @@ Service CheckForNotificationSnooze(UserID)
end service end service
Service GetInboxMessages(UserID) Service GetInboxMessages(UserID)
//debug
InboxList = '' InboxList = ''
UserRec = Database_Services('ReadDataRow','NOTE_PTRS', @USER4, '', '', '') UserRec = Database_Services('ReadDataRow','NOTE_PTRS', @USER4, '', '', '')
MessageCount = Dcount(UserRec<1>, @VM) MessageCount = Dcount(UserRec<1>, @VM)
@ -80,10 +150,12 @@ Service GetInboxMessages(UserID)
end end
Next index Next index
Response = InboxList Response = InboxList
end service end service
Service GetArchivedMessages(UserID) Service GetArchivedMessages(UserID)
//debug
ArchiveList = '' ArchiveList = ''
UserRec = Database_Services('ReadDataRow','NOTE_PTRS', @USER4, '', '', '') UserRec = Database_Services('ReadDataRow','NOTE_PTRS', @USER4, '', '', '')
MessageCount = Dcount(UserRec<1>, @VM) MessageCount = Dcount(UserRec<1>, @VM)
@ -100,20 +172,16 @@ Service GetArchivedMessages(UserID)
end end
Next index Next index
Response = ArchiveList Response = ArchiveList
end service end service
Service UpdateNotes(UserID) Service UpdateNotes(UserID)
ErrorMsg = '' ErrorMsg = ''
IF UserID = '' THEN ErrorMsg = 'Unassigned Parameter "UserID" passed to object. (':Method:')' IF UserID NE '' then
IF ErrorMsg NE '' THEN RETURN
//OtParms = 'NOTE_PTRS':@RM:UserID
//NPRec = obj_Tables('ReadRec',OtParms) ;* If not found then returns null, otherwise reads and sets the lock
NPRec = Database_Services('ReadDataRow', 'NOTE_PTRS', UserID) NPRec = Database_Services('ReadDataRow', 'NOTE_PTRS', UserID)
If Error_Services('NoError') then
IF LEN(NPRec) > 60000 THEN IF LEN(NPRec) > 60000 THEN
* Dump the oldest note pointers * Dump the oldest note pointers
PtrCnt = COUNT(NPRec<note_ptrs_from$>, @vm) + (NPRec<note_ptrs_from$> NE '') PtrCnt = COUNT(NPRec<note_ptrs_from$>, @vm) + (NPRec<note_ptrs_from$> NE '')
@ -171,19 +239,26 @@ IF NotesSentKeys NE '' THEN
Database_Services('WriteDataRow', 'NOTE_PTRS', UserID, NPRec, True$, False$, True$) Database_Services('WriteDataRow', 'NOTE_PTRS', UserID, NPRec, True$, False$, True$)
NEXT I NEXT I
IF Get_Status(errCode) THEN IF Get_Status(errCode) THEN
ErrMsg(errCode) ErrorMsg = 'Error in service: ':Service:'. Error code: ':errCode
END ELSE END ELSE
obj_Notes_Sent('Delete',NotesSentKeys) obj_Notes_Sent('Delete',NotesSentKeys)
Update_Index('NOTES_SENT','USER_ID', False$, True$)
END
END
end else
ErrorMsg = Error_Services('GetMessage')
end
end else
ErrorMsg = 'Error in service: ':Service:'. Unassigned Parameter "UserID" passed into service.'
end
Update_Index('NOTES_SENT','USER_ID','') If ErrorMsg NE '' then Error_Services('Add', ErrorMsg)
END
END ELSE
//obj_Tables('UnlockRec',OtParms)
END
end service end service
Service GetUnreadMessageCount(UserID) Service GetUnreadMessageCount(UserID)
unreadMessageCount = 0 unreadMessageCount = 0
IF UserID NE '' then IF UserID NE '' then
if xlate( 'NOTE_PTRS', @user4, 'NEW_MESSAGES', 'X' ) then if xlate( 'NOTE_PTRS', @user4, 'NEW_MESSAGES', 'X' ) then
@ -197,9 +272,12 @@ Service GetUnreadMessageCount(UserID)
end end
end end
Response = unreadMessageCount Response = unreadMessageCount
end service end service
Service GetNewMessages(UserId) Service GetNewMessages(UserId)
NotesSentKeys = '' NotesSentKeys = ''
IF UserId NE '' THEN IF UserId NE '' THEN
@ -214,9 +292,12 @@ Service GetNewMessages(UserId)
END END
end end
Response = NotesSentKeys Response = NotesSentKeys
end service end service
Service MarkAllAsRead(UserId) Service MarkAllAsRead(UserId)
if UserID NE '' then if UserID NE '' then
NotePtrsRec = Database_Services('ReadDataRow', 'NOTE_PTRS', UserId) NotePtrsRec = Database_Services('ReadDataRow', 'NOTE_PTRS', UserId)
NotePtrsStatus = NotePtrsRec<NOTE_PTRS_NEW$> NotePtrsStatus = NotePtrsRec<NOTE_PTRS_NEW$>
@ -230,12 +311,240 @@ Service MarkAllAsRead(UserId)
end else end else
Error_Services('Set', 'Error in Notes Service, MarkAllAsRead. UserId parameter not supplied') Error_Services('Set', 'Error in Notes Service, MarkAllAsRead. UserId parameter not supplied')
end end
end service end service
Service SendNotes()
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
Lock hSysLists, ServiceKeyID then
ErrorMsg = ''
Open 'NOTES_QUEUE' to hNotesQueue then
Select hNotesQueue
EOF = False$
Loop
ReadNext NotesQueueId else EOF = True$
Until EOF
// Send NOTES record
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = NotesQueueId
LogData<3> = 'Being processing NOTES_QUEUE record, "':NotesQueueID:'".'
Logging_Services('AppendLog', objNotesQProcLog, LogData, @RM, @FM)
DeleteRec = False$
Read NotesQueueRec from hNotesQueue, NotesQueueId then
NotesId = NotesQueueRec<NOTES_QUEUE.NOTES_ID$>
If NotesId NE '' then
NotesRec = Database_Services('ReadDataRow', 'NOTES', NotesId)
If Error_Services('NoError') then
If NotesRec NE '' then
DeleteRec = True$
Recipients = NotesRec<NOTES_SEND_TO$>
SentFrom = NotesRec<NOTES_FROM$>
Subject = NotesRec<NOTES_SUBJECT$>
Message = NotesRec<NOTES_MESSAGE$>
AttachWindow = NotesRec<NOTES_ATTACH_WINDOW$>
AttachKeys = NotesRec<NOTES_ATTACH_KEYS$>
SendToGroup = NotesRec<NOTES_MSG_GROUPS_IDS$>
GroupRecipients = ''
If SendToGroup NE '' then
NotifyGroupRecipients = ''
SecGroupRecipients = ''
For each GroupID in SendToGroup using @VM
If RowExists('NOTIFICATION', GroupID) then
GroupRec = Database_Services('ReadDataRow', 'NOTIFICATION', GroupID)
If Error_Services('NoError') then
GroupUsers = GroupRec<NOTIFICATION_USER_ID$>
LimitToOnShift = GroupRec<NOTIFICATION_LIMIT_TO_ACTIVE_SHIFT$>
If LimitToOnShift then
UsersOnShift = LSL_Users_Services('GetOnShiftUsers')
NotifyGroupRecipients = SRP_Array('Join', GroupUsers, UsersOnShift, 'AND', @VM)
end else
NotifyGroupRecipients = GroupUsers
end
end
end
If RowExists('SEC_GROUPS', GroupID) then
! Todo: Add SEC_GROUPS support
end
GroupRecipients = SRP_Array('Join', NotifyGroupRecipients, GroupRecipients, 'OR', @VM)
GroupRecipients = SRP_Array('Join', SecGroupRecipients, GroupRecipients, 'OR', @VM)
Next GroupID
end
thisRecipients = ''
RecipCnt = 0
Recipients = SRP_Array('Join', GroupRecipients, Recipients, 'OR', @VM)
thisRecipients = SRP_Array('Clean', Recipients, 'TrimAndMakeUnique', @VM)
RecipCnt = DCount(thisRecipients, @VM)
// Previous logic from obj_Notes
CurrDTM = OConv(Date(),'D4/'):' ':OConv(Time(),'MTHS')
RecipientsText = thisRecipients
SWAP @VM WITH ', ' IN RecipientsText
FOR RecipIndex = 1 TO RecipCnt
thisRecipient = thisRecipients<1, RecipIndex>
obj_Notes_Sent('Create',thisRecipient:@RM:NotesId:@RM:CurrDTM) ;* Add to Notes Sent buffer table
UserRec = XLATE('LSL_USERS',thisRecipient,'','X')
FwdFlag = UserRec<LSL_USERS_FWD_EMAIL$>
eMailAddr = UserRec<LSL_USERS_EMAIL$>
IF FwdFlag = 1 AND eMailAddr NE '' THEN
Text = ''
Text<-1> = 'OI eMail From: ':OCONV(SentFrom,'[XLATE_CONV,LSL_USERS*FIRST_LAST]'):' at ':CurrDTM
Text<-1> = ''
Text<-1> = 'Recipients: ':RecipientsText
Text<-1> = ''
Text<-1> = 'Subject: ':Subject
Text<-1> = ''
Text<-1> = 'Message: '
Text<-1> = ''
Text<-1> = Message
Text<-1> = ''
IF AttachWindow NE '' THEN
Text<-1> = ''
Text<-1> = 'Attached Window: ':AttachWindow
END
IF AttachKeys NE '' THEN
Text<-1> = ''
Text<-1> = 'Record Key: ':AttachKeys
END
IF SendToGroup NE '' THEN
Text<-1> = ''
Text<-1> = 'Sent to Group: ':SendToGroup
END
HeaderText = Text<1>
CONVERT \00\ TO ',' IN Text
SWAP @VM WITH ':@VM:' IN Text
SWAP @FM WITH CHAR(13):CHAR(10) IN Text
SWAP @TM WITH CHAR(13):CHAR(10) IN Text
eMailBoxKey = NotesId:'*':thisRecipient
eMailBoxRec = ''
eMailBoxRec<EMAIL_BOX_EMAIL_ADDR$> = eMailAddr
eMailBoxRec<EMAIL_BOX_EMAIL_TEXT$> = Text
eMailBoxRec<EMAIL_BOX_EMAIL_HEADER$> = HeaderText
eMailBoxRec<EMAIL_BOX_FROM_USER$> = SentFrom
ebParms = 'EMAIL_BOX':@RM:eMailBoxKey:@RM:@RM:eMailBoxRec
obj_Tables('WriteRec',ebParms)
END ;* End of check for forwarding flag
Next RecipIndex
end else
// Log this condition, but delete record since we have nothing to send.
DeleteRec = True$
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = NotesQueueId
LogData<3> = 'Error in ':Service:' service. Failed to send Note due to null NOTES record, "':NotesId:'", read in.'
Logging_Services('AppendLog', objNotesQProcLog, LogData, @RM, @FM)
end
end else
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = NotesQueueId
LogData<3> = 'Error in ':Service:' service. Failed to read NOTES record, "':NotesId:'". Error message: ':Error_Services('GetMessage')
Logging_Services('AppendLog', objNotesQProcLog, LogData, @RM, @FM)
end
end else
// Log this condition, but delete record since we have nothing to send.
DeleteRec = True$
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = NotesQueueId
LogData<3> = 'Error in ':Service:' service. Null NotesId in NOTES_QUEUE record, "':NotesQueueId:'".'
Logging_Services('AppendLog', objNotesQProcLog, LogData, @RM, @FM)
end
end else
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = NotesQueueId
LogData<3> = 'Error in ':Service:' service. Error reading NOTES_QUEUE record, "':NotesQueueId:'". File error: ':@File.Error
Logging_Services('AppendLog', objNotesQProcLog, LogData, @RM, @FM)
end
If DeleteRec then
Database_Services('DeleteDataRow', 'NOTES_QUEUE', NotesQueueId, True$, False$)
If Error_Services('NoError') then
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = NotesQueueId
LogData<3> = 'Successfuly deleted NOTES_QUEUE record, "':NotesQueueID:'".'
Logging_Services('AppendLog', objNotesQProcLog, LogData, @RM, @FM)
end
end
Repeat
end else
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = NotesQueueId
LogData<3> = 'Error in ':Service:' service. Failed to open NOTES_QUEUE table.'
Logging_Services('AppendLog', objNotesQProcLog, LogData, @RM, @FM)
end
Unlock hSysLists, ServiceKeyID else Null
end
end service
Service AddToQueue(NotesId)
If NotesId NE '' then
If RowExists('NOTES', NotesId) then
QueueId = RTI_CreateGuid()
If QueueId NE '' then
QueueRec = NotesId
Database_Services('WriteDataRow', 'NOTES_QUEUE', QueueId, QueueRec)
If Error_Services('HasError') then
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = NotesId
ErrorMsg = 'Error in ':Service:' service. Failed to write NOTES_QUEUE record, "':QueueID:'", for NOTES record, "':NotesId:'".'
ErrorMsg := 'Error message: ':Error_Services('GetMessage')
LogData<3> = ErrorMsg
Logging_Services('AppendLog', objNotesQProcLog, LogData, @RM, @FM)
end
end else
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = NotesId
ErrorMsg = 'Error in ':Service:' service. Failed to genereate NOTES_QUEUE Id for NOTES record, "':NotesId:'".'
LogData<3> = ErrorMsg
Logging_Services('AppendLog', objNotesQProcLog, LogData, @RM, @FM)
end
end else
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = NotesId
ErrorMsg = 'Error in ':Service:' service. NOTES record, "':NotesId:'", does not exist!.'
LogData<3> = ErrorMsg
end
end else
LogData = ''
LogData<1> = LoggingDtm
LogData<2> = NotesId
ErrorMsg = 'Error in ':Service:' service. Null NOTES Id passed into service.'
LogData<3> = ErrorMsg
end
end service

View File

@ -7,7 +7,7 @@ COMPILE FUNCTION Note_Message(EntID,Event,Parm1,Parm2,Parm3,Parm4,Parm5)
*/ */
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, Center_Window, Post_Event, RList DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, Center_Window, Post_Event, RList
DECLARE SUBROUTINE ErrMsg, Send_Message, Set_Property, Send_Event, Btree.Extract, obj_AppWindow DECLARE SUBROUTINE ErrMsg, Send_Message, Set_Property, Send_Event, Btree.Extract, obj_AppWindow, Notes_Services
DECLARE SUBROUTINE obj_Notes, Security_Err_Msg, End_Window, Forward_Event, Start_Window, Create_Note, obj_Notes_Sent DECLARE SUBROUTINE obj_Notes, Security_Err_Msg, End_Window, Forward_Event, Start_Window, Create_Note, obj_Notes_Sent
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Popup, Collect.Ixvals, Admin_User, Printer_Select, obj_Notes DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Popup, Collect.Ixvals, Admin_User, Printer_Select, obj_Notes
@ -41,9 +41,6 @@ BEGIN CASE
CASE Event = 'CLOSE' ; GOSUB Close CASE Event = 'CLOSE' ; GOSUB Close
CASE Event = 'READ' ; GOSUB Read CASE Event = 'READ' ; GOSUB Read
CASE Event = 'WRITE' ; GOSUB Write CASE Event = 'WRITE' ; GOSUB Write
END CASE END CASE
CASE EntID = @WINDOW:'.YOUR_GROUPS' AND Event = 'CLICK' ; GOSUB YourGroupsClick CASE EntID = @WINDOW:'.YOUR_GROUPS' AND Event = 'CLICK' ; GOSUB YourGroupsClick
@ -70,7 +67,6 @@ END
RETURN Result RETURN Result
* * * * * * * * * * * * * *
Create: Create:
* * * * * * * * * * * * * *
@ -101,7 +97,6 @@ End_Dialog(@WINDOW,'')
RETURN RETURN
* * * * * * * * * * * * * *
Refresh: Refresh:
* * * * * * * * * * * * * *
@ -217,32 +212,13 @@ IF RowExists('NOTES',NoteID) THEN
END ELSE END ELSE
Forward_Event() Forward_Event()
Notes_Services('AddToQueue', NoteId)
obj_Notes('PostEMail',NoteID) ;* Forwards to Outlook eMail if the users flag is set
IF Get_Status(errCode) THEN
ErrMsg(errCode)
END
CurrDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTHS')
Pos = 1
Flag = ""
LOOP
REMOVE SendToID FROM SendToIDs AT Pos SETTING FLAG
IF SendToID NE '' THEN
obj_Notes_Sent('Create',SendToID:@RM:NoteID:@RM:CurrDTM)
END
WHILE Flag
REPEAT
END END
RETURN 0 RETURN 0
* * * * * * * * * * * * * *
YourGroupsClick: YourGroupsClick:
* * * * * * * * * * * * * *
@ -278,7 +254,6 @@ END
RETURN RETURN
* * * * * * * * * * * * * *
CopyYourSelfClick: CopyYourSelfClick:
* * * * * * * * * * * * * *
@ -311,7 +286,6 @@ RETURN
AllUsersClick: AllUsersClick:
* * * * * * * * * * * * * *
NewSendToIDs = Popup(@WINDOW,'','USER_ID') NewSendToIDs = Popup(@WINDOW,'','USER_ID')
IF NewSendToIDs = CHAR(27) THEN RETURN IF NewSendToIDs = CHAR(27) THEN RETURN
@ -450,9 +424,6 @@ Set_Property(@WINDOW:'.MESSAGE', "FOCUS", 1)
RETURN RETURN
* * * * * * * * * * * * * *
Forward: Forward:
* * * * * * * * * * * * * *
@ -577,8 +548,6 @@ GOSUB Refresh
RETURN RETURN
* * * * * * * * * * * * * *
Print: Print:
* * * * * * * * * * * * * *
@ -629,8 +598,10 @@ x = Set_Printer("ADDTABLE", TableColInfo, '', MessageText, '', '', 1, TB_NONE)
Stat = Set_Printer( 'TERM' ) Stat = Set_Printer( 'TERM' )
GOSUB CheckErr GOSUB CheckErr
RETURN RETURN
* * * * * * * * * * * * * *
CheckErr: CheckErr:
* * * * * * * * * * * * * *
@ -642,12 +613,3 @@ END
RETURN RETURN

View File

@ -17,7 +17,7 @@ COMPILE FUNCTION obj_Notes(Method,Parms)
DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables, NextKey, SRP_Send_Mail, obj_Calendar, Database_Services, SRP_Stopwatch DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables, NextKey, SRP_Send_Mail, obj_Calendar, Database_Services, SRP_Stopwatch
DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, RList, ErrMsg, obj_Notes_Sent, Btree.Extract, Send_Info, obj_Notes DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, RList, ErrMsg, obj_Notes_Sent, Btree.Extract, Send_Info, obj_Notes
Declare subroutine Obj_Post_Log, SRP_Stopwatch DECLARE SUBROUTINE Obj_Post_Log, SRP_Stopwatch, Notes_Services
$INSERT MSG_EQUATES $INSERT MSG_EQUATES
$INSERT NOTES_EQU $INSERT NOTES_EQU
@ -88,12 +88,14 @@ IF XLATE( 'NOTE_PTRS', UserName, 'NEW_MESSAGES', 'X' ) THEN
Msg( @WINDOW, MsgInfo ) Msg( @WINDOW, MsgInfo )
END END
END END
RETURN RETURN
* * * * * * * * * * * * * *
Create: Create:
* * * * * * * * * * * * * *
Recipients = Parms[1,@RM] Recipients = Parms[1,@RM]
SentFrom = Parms[COL2()+1,@RM] SentFrom = Parms[COL2()+1,@RM]
Subject = Parms[COL2()+1,@RM] Subject = Parms[COL2()+1,@RM]
@ -102,7 +104,9 @@ AttachWindow = Parms[COL2()+1,@RM]
AttachKeys = Parms[COL2()+1,@RM] AttachKeys = Parms[COL2()+1,@RM]
SendToGroup = Parms[COL2()+1,@RM] SendToGroup = Parms[COL2()+1,@RM]
IF NOT(ASSIGNED(Recipients)) THEN ErrorMsg = 'Unassigned Parameter "Recipients" passed to object. (':Method:')' IF ( NOT(ASSIGNED(Recipients)) AND NOT(ASSIGNED(SendToGroup)) ) THEN
ErrorMsg = 'Unassigned Parameter "Recipients" or "SendToGroup" passed to object. (':Method:')'
end
IF NOT(ASSIGNED(SentFrom)) THEN ErrorMsg = 'Unassigned Parameter "SentFrom" passed to object. (':Method:')' IF NOT(ASSIGNED(SentFrom)) THEN ErrorMsg = 'Unassigned Parameter "SentFrom" passed to object. (':Method:')'
IF NOT(ASSIGNED(Subject)) THEN ErrorMsg = 'Unassigned Parameter "Subject" passed to object. (':Method:')' IF NOT(ASSIGNED(Subject)) THEN ErrorMsg = 'Unassigned Parameter "Subject" passed to object. (':Method:')'
IF NOT(ASSIGNED(Message)) THEN ErrorMsg = 'Unassigned Parameter "Message" passed to object. (':Method:')' IF NOT(ASSIGNED(Message)) THEN ErrorMsg = 'Unassigned Parameter "Message" passed to object. (':Method:')'
@ -144,82 +148,15 @@ NoteRec<notes_msg_groups_ids$> = SendToGroup
OtParms = 'NOTES':@RM:NextNoteKey:@RM:@RM:NoteRec OtParms = 'NOTES':@RM:NextNoteKey:@RM:@RM:NoteRec
obj_Tables('WriteRec',OtParms) ;* Writes the Note record to disk obj_Tables('WriteRec',OtParms) ;* Writes the Note record to disk
CurrDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTHS') Notes_Services('AddToQueue', NextNoteKey)
RecipientsText = thisRecipients
SWAP @VM WITH ', ' IN RecipientsText
FOR I = 1 TO RecipCnt
thisRecipient = thisRecipients<1,I>
obj_Notes_Sent('Create',thisRecipient:@RM:NextNoteKey:@RM:CurrDTM) ;* Add to Notes Sent buffer table
UserRec = XLATE('LSL_USERS',thisRecipient,'','X')
FwdFlag = UserRec<LSL_USERS_FWD_EMAIL$>
eMailAddr = UserRec<LSL_USERS_EMAIL$>
IF FwdFlag = 1 AND eMailAddr NE '' THEN
Text = ''
Text<-1> = 'OI eMail From: ':OCONV(SentFrom,'[XLATE_CONV,LSL_USERS*FIRST_LAST]'):' at ':CurrDTM
Text<-1> = ''
Text<-1> = 'Recipients: ':RecipientsText
Text<-1> = ''
Text<-1> = 'Subject: ':Subject
Text<-1> = ''
Text<-1> = 'Message: '
Text<-1> = ''
Text<-1> = Message
Text<-1> = ''
IF AttachWindow NE '' THEN
Text<-1> = ''
Text<-1> = 'Attached Window: ':AttachWindow
END
IF AttachKeys NE '' THEN
Text<-1> = ''
Text<-1> = 'Record Key: ':AttachKeys
END
IF SendToGroup NE '' THEN
Text<-1> = ''
Text<-1> = 'Sent to Group: ':SendToGroup
END
HeaderText = Text<1>
CONVERT \00\ TO ',' IN Text
SWAP @VM WITH ':@VM:' IN Text
SWAP @FM WITH CHAR(13):CHAR(10) IN Text
SWAP @TM WITH CHAR(13):CHAR(10) IN Text
eMailBoxKey = NextNoteKey:'*':thisRecipient
eMailBoxRec = ''
eMailBoxRec<EMAIL_BOX_EMAIL_ADDR$> = eMailAddr
eMailBoxRec<EMAIL_BOX_EMAIL_TEXT$> = Text
eMailBoxRec<EMAIL_BOX_EMAIL_HEADER$> = HeaderText
eMailBoxRec<EMAIL_BOX_FROM_USER$> = SentFrom
ebParms = 'EMAIL_BOX':@RM:eMailBoxKey:@RM:@RM:eMailBoxRec
obj_Tables('WriteRec',ebParms)
END ;* End of check for forwarding flag
NEXT I
RETURN RETURN
* * * * * * * * * * * * * *
Rebuild: Rebuild:
* * * * * * * * * * * * * *
thisRecipient = Parms[1,@RM] thisRecipient = Parms[1,@RM]
IF thisRecipient = '' THEN thisRecipient = @USER4 IF thisRecipient = '' THEN thisRecipient = @USER4
@ -294,7 +231,6 @@ obj_Tables('WriteRec',OtParms)
RETURN RETURN
* * * * * * * * * * * * * *
AllActiveUsers: AllActiveUsers:
* * * * * * * * * * * * * *
@ -315,7 +251,6 @@ Result = AllUserList
RETURN RETURN
* * * * * * * * * * * * * *
PostEMail: PostEMail:
* * * * * * * * * * * * * *
@ -405,7 +340,6 @@ FOR I = 1 TO RecipCnt
NEXT I NEXT I
RETURN RETURN
@ -459,9 +393,7 @@ ForwardEMail:
MsgSent = SRP_Send_Mail(Message, ConfigFile) MsgSent = SRP_Send_Mail(Message, ConfigFile)
IF MsgSent = 1 THEN IF MsgSent NE True$ THEN
* obj_Tables('DeleteRec',mbParms)
END ELSE
Set_Status(0) Set_Status(0)
obj_Tables('UnlockRec',mbParms) obj_Tables('UnlockRec',mbParms)
@ -498,7 +430,6 @@ EMail:
* Direct outside eMail without creating a NOTES record * Direct outside eMail without creating a NOTES record
Recipients = Parms[1,@RM] Recipients = Parms[1,@RM]
SentFrom = Parms[COL2()+1,@RM] SentFrom = Parms[COL2()+1,@RM]
Subject = Parms[COL2()+1,@RM] Subject = Parms[COL2()+1,@RM]
@ -562,7 +493,6 @@ FOR I = 1 TO RecipCnt
ConfigFile<1> = SendUsing_Port$ ConfigFile<1> = SendUsing_Port$
ConfigFile<2> = '' ConfigFile<2> = ''
ConfigFile<3> = 25 ;* Server port ConfigFile<3> = 25 ;* Server port
*ConfigFile<4> = 'appmail.eu.infineon.com' ;* IFX Mail server
ConfigFile<4> = 'mailrelay-external.infineon.com' ConfigFile<4> = 'mailrelay-external.infineon.com'
ConfigFile<5> = Yes$ ;* Authenticate ConfigFile<5> = Yes$ ;* Authenticate
ConfigFile<6> = 'oinotify@infineon.com' ;* Username ConfigFile<6> = 'oinotify@infineon.com' ;* Username
@ -587,18 +517,15 @@ FOR I = 1 TO RecipCnt
END END
NEXT I ;* End of Recipient Loop NEXT I ;* End of Recipient Loop
RETURN RETURN
* * * * * * * * * * * * * *
BulkCreate: BulkCreate:
* * * * * * * * * * * * * *
* SRP_Stopwatch('Reset')
Recipients = Parms[1,@RM] Recipients = Parms[1,@RM]
SentFrom = Parms[COL2()+1,@RM] SentFrom = Parms[COL2()+1,@RM]
Subject = Parms[COL2()+1,@RM] Subject = Parms[COL2()+1,@RM]
@ -666,10 +593,7 @@ oblParms := Fields :@RM
oblParms := Values :@RM oblParms := Values :@RM
oblParms := "TOP" :@VM: "TOP" :@VM: "TOP":@VM: "TOP" :@VM: "TOP":@VM: "TOP" :@VM: "TOP":@VM: "TOP" :@VM: "TOP":@VM: "TOP" :@VM: "TOP" oblParms := "TOP" :@VM: "TOP" :@VM: "TOP":@VM: "TOP" :@VM: "TOP":@VM: "TOP" :@VM: "TOP":@VM: "TOP" :@VM: "TOP":@VM: "TOP" :@VM: "TOP"
* SRP_Stopwatch('Start', 'NOTES Write')
//Obj_Post_Log('Create', oblParms)
obj_Tables('WriteRec',OtParms) ;* Writes the Note record to disk obj_Tables('WriteRec',OtParms) ;* Writes the Note record to disk
* SRP_Stopwatch('Stop', 'NOTES Write')
CurrDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTHS') CurrDTM = OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTHS')
RecipientsText = thisRecipients RecipientsText = thisRecipients
@ -731,7 +655,6 @@ FOR I = 1 TO RecipCnt
eMailBoxRec<EMAIL_BOX_FROM_USER$> = SentFrom eMailBoxRec<EMAIL_BOX_FROM_USER$> = SentFrom
SRP_Stopwatch('Start', 'Email Write') SRP_Stopwatch('Start', 'Email Write')
ebParms = 'EMAIL_BOX':@RM:eMailBoxKey:@RM:@RM:eMailBoxRec ebParms = 'EMAIL_BOX':@RM:eMailBoxKey:@RM:@RM:eMailBoxRec
//obj_Tables('WriteRec',ebParms)
Fields = EMAIL_BOX_EMAIL_ADDR$:@VM ; Values = eMailAddr :@VM Fields = EMAIL_BOX_EMAIL_ADDR$:@VM ; Values = eMailAddr :@VM
Fields := EMAIL_BOX_EMAIL_TEXT$:@VM ; Values := Text :@VM Fields := EMAIL_BOX_EMAIL_TEXT$:@VM ; Values := Text :@VM
@ -743,15 +666,10 @@ FOR I = 1 TO RecipCnt
eblParms := Fields :@RM eblParms := Fields :@RM
eblParms := Values :@RM eblParms := Values :@RM
eblParms := "TOP" :@VM: "TOP" :@VM: "TOP":@VM: "TOP" eblParms := "TOP" :@VM: "TOP" :@VM: "TOP":@VM: "TOP"
* obj_Tables('WriteRec',ebParms)
Obj_Post_Log('Create' eblParms) Obj_Post_Log('Create' eblParms)
* SRP_Stopwatch('Stop', 'Email Write')
END ;* End of check for forwarding flag END ;* End of check for forwarding flag
NEXT I NEXT I
//SRP_Stopwatch('ShowAll')
* Test = SRP_Stopwatch('GetAll')
* debug
RETURN RETURN

View File

@ -14,7 +14,6 @@ COMPILE FUNCTION obj_Notes_Sent(Method,Parms)
*/ */
DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables
DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, ErrMsg, Btree.Extract,ErrMsg, Update_Index DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, ErrMsg, Btree.Extract,ErrMsg, Update_Index
@ -58,7 +57,6 @@ END
RETURN Result RETURN Result
* * * * * * * * * * * * * *
Create: Create:
* * * * * * * * * * * * * *
@ -83,13 +81,12 @@ END
OtParms = 'NOTES_SENT':@RM:Recipient:'*':NoteID:@RM:@RM:TxDTM ;* First (and only) field in record is TxDTM OtParms = 'NOTES_SENT':@RM:Recipient:'*':NoteID:@RM:@RM:TxDTM ;* First (and only) field in record is TxDTM
obj_Tables('WriteRec',OtParms) ;* Writes new record obj_Tables('WriteRec',OtParms) ;* Writes new record
Update_Index('NOTES_SENT','USER_ID','') Update_Index('NOTES_SENT','USER_ID','', True$)
RETURN RETURN
* * * * * * * * * * * * * *
Delete: Delete:
* * * * * * * * * * * * * *
@ -131,4 +128,3 @@ END
RETURN RETURN

View File

@ -16,6 +16,7 @@ COMPILE FUNCTION obj_Note_Ptrs(Method,Parms)
DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables, NextKey, obj_Notes_Sent DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables, NextKey, obj_Notes_Sent
DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, RList, ErrMsg, obj_Notes_Sent, Update_Index DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, RList, ErrMsg, obj_Notes_Sent, Update_Index
$INSERT LOGICAL
$INSERT MSG_EQUATES $INSERT MSG_EQUATES
$INSERT NOTES_EQU $INSERT NOTES_EQU
$INSERT NOTE_PTRS_EQU $INSERT NOTE_PTRS_EQU
@ -128,7 +129,7 @@ IF NotesSentKeys NE '' THEN
END ELSE END ELSE
obj_Notes_Sent('Delete',NotesSentKeys) obj_Notes_Sent('Delete',NotesSentKeys)
Update_Index('NOTES_SENT','USER_ID','') Update_Index('NOTES_SENT','USER_ID', False$, True$)
END END
END ELSE END ELSE
obj_Tables('UnlockRec',OtParms) obj_Tables('UnlockRec',OtParms)

View File

@ -1730,7 +1730,7 @@ END
* obj_PRS_Stage('Convert',PSNo) ;* Dead JCH 3/11/2013 * obj_PRS_Stage('Convert',PSNo) ;* Dead JCH 3/11/2013
// Flush pending index transactions // Flush pending index transactions
Update_Index("PRS_LAYER", "PRS_PROP_KEY", "") Update_Index("PRS_LAYER", "PRS_PROP_KEY", False$, True$)
RETURN RETURN
@ -2109,3 +2109,4 @@ GetQAMet:
RETURN RETURN

View File

@ -198,8 +198,8 @@ PostReactItems:
//obj_Tables('WriteRec',otParms) //obj_Tables('WriteRec',otParms)
Database_Services('WriteDataRow', 'REACTOR_LOG', RLNo, ReactorLogRec, 1, 0, 1) Database_Services('WriteDataRow', 'REACTOR_LOG', RLNo, ReactorLogRec, 1, 0, 1)
Update_Index('REACT_ITEM_HIST', 'INST_RL_ID', '') ;* Don't wait for indexer - flush pending indexes now Update_Index('REACT_ITEM_HIST', 'INST_RL_ID', False$, True$) ;* Don't wait for indexer - flush pending indexes now
Update_Index('REACT_ITEM_HIST', 'REM_RL_ID', '') Update_Index('REACT_ITEM_HIST', 'REM_RL_ID', False$, True$)
end else end else
Error_Services('Add', ValidationFailureReason) Error_Services('Add', ValidationFailureReason)
end end
@ -299,8 +299,8 @@ UnpostReactItems:
//obj_Tables('WriteRec',otParms) //obj_Tables('WriteRec',otParms)
Database_Services('WriteDataRow', 'REACTOR_LOG', RLNo, ReactorLogRec, 1,0,1) Database_Services('WriteDataRow', 'REACTOR_LOG', RLNo, ReactorLogRec, 1,0,1)
Update_Index('REACT_ITEM_HIST', 'REM_RL_ID', '') ;* Don't wait for indexer - flush pending indexes now Update_Index('REACT_ITEM_HIST', 'REM_RL_ID', False$, True$) ;* Don't wait for indexer - flush pending indexes now
Update_Index('REACT_ITEM_HIST', 'INST_RL_ID', '') Update_Index('REACT_ITEM_HIST', 'INST_RL_ID', False$, True$)
RETURN RETURN
@ -392,3 +392,4 @@ RETURN

View File

@ -73,7 +73,7 @@ Appts:
// Build list of keys that fall on the three days // Build list of keys that fall on the three days
Keys = "" Keys = ""
Field = "DATE_SPAN_XREF" Field = "DATE_SPAN_XREF"
Update_Index(Table, Field, No$) Update_Index(Table, Field, No$, Yes$)
For i = 0 to 2 For i = 0 to 2
Extract_SI_Keys(Table, Field, Date+i, rv) Extract_SI_Keys(Table, Field, Date+i, rv)
Keys<-1> = rv Keys<-1> = rv
@ -271,3 +271,4 @@ Print_Two:
Next r Next r
Next x Next x
return return

View File

@ -3548,10 +3548,10 @@ Service ProcessSQLRequests()
GoSub ClearCursors GoSub ClearCursors
Sentence = 'SELECT ':Tablename:' WITH RESPONSE_DATE EQ "" BY REQUEST_DATE BY REQUEST_TIME' Sentence = 'SELECT ':Tablename:' WITH RESPONSE_DATE EQ "" BY REQUEST_DATE BY REQUEST_TIME'
Set_Status(0) Set_Status(0)
Update_Index(Tablename, 'REQUEST_DATE', 0) Update_Index(Tablename, 'REQUEST_DATE', False$, True$)
Update_Index(Tablename, 'REQUEST_TIME', 0) Update_Index(Tablename, 'REQUEST_TIME', False$, True$)
Update_Index(Tablename, 'RESPONSE_DATE', 0) Update_Index(Tablename, 'RESPONSE_DATE', False$, True$)
Update_Index(Tablename, 'RESPONSE_TIME', 0) Update_Index(Tablename, 'RESPONSE_TIME', False$, True$)
RList(Sentence, TARGET_ACTIVELIST$, '', '', '') RList(Sentence, TARGET_ACTIVELIST$, '', '', '')
EOF = False$ EOF = False$
Loop Loop
@ -3640,3 +3640,4 @@ return

View File

@ -417,7 +417,7 @@ Bump:
Table = "WO_MAST_SCHED" Table = "WO_MAST_SCHED"
Open Table to hTable then Open Table to hTable then
Update_Index(Table, "DATE_REACT", No$) Update_Index(Table, "DATE_REACT", No$, Yes$)
Extract_SI_Keys(Table, "DATE_REACT", DateReact, Keys) Extract_SI_Keys(Table, "DATE_REACT", DateReact, Keys)
Duration = (Appt<3> - Appt<2>) Duration = (Appt<3> - Appt<2>)
If Noon then Duration -= .5 If Noon then Duration -= .5
@ -785,7 +785,7 @@ return
WO_Status_Colors: WO_Status_Colors:
Color_F = "" ; Color_B = "" ; Color_S = "" Color_F = "" ; Color_B = "" ; Color_S = ""
Begin Case Begin Case
Case Event EQ "Down No Material" ; Color_F = White$ ; Color_B = "Sienna" ; Color_S = "Offline" Case Event EQ "Down – No Material" ; Color_F = White$ ; Color_B = "Sienna" ; Color_S = "Offline"
Case Event ; Color_F = Black$ ; Color_B = "GoldenRod" ; Color_S = "Offline" Case Event ; Color_F = Black$ ; Color_B = "GoldenRod" ; Color_S = "Offline"
Case WO.Done ; Color_F = Black$ ; Color_B = "Gainsboro" ; Color_S = "Completed" Case WO.Done ; Color_F = Black$ ; Color_B = "Gainsboro" ; Color_S = "Completed"
Case Hot ; Color_F = Black$ ; Color_B = "LightCoral" ; Color_S = "Hot" Case Hot ; Color_F = Black$ ; Color_B = "LightCoral" ; Color_S = "Hot"
@ -855,3 +855,4 @@ Reactor_List:
Next i Next i
return return

View File

@ -506,8 +506,8 @@ Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRow, True$, False, Tr
WOMatRow<12> = RDSNo ; // Restore the RDS No so the index on RDS_FINAL_SIG will be forced to recalculate with the most recent value. WOMatRow<12> = RDSNo ; // Restore the RDS No so the index on RDS_FINAL_SIG will be forced to recalculate with the most recent value.
WOMatRow<23> = True$ ; // Restore the MakeUp box flag so the index will be forced to recalculate. WOMatRow<23> = True$ ; // Restore the MakeUp box flag so the index will be forced to recalculate.
Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRow, True$, False, True$) Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRow, True$, False, True$)
call Update_Index('WO_MAT', 'MU_PART_NO', False$) call Update_Index('WO_MAT', 'MU_PART_NO', False$, True$)
call Update_Index('WO_MAT', 'CURR_STATUS', False$) call Update_Index('WO_MAT', 'CURR_STATUS', False$, True$)
@ -950,3 +950,4 @@ Debug
Return Return

View File

@ -94,6 +94,24 @@ $Insert PS_EQUATES
* $INSERT PRINTSETUP_EQUATES * $INSERT PRINTSETUP_EQUATES
* equ REV_CREATE_ENGINE_NO_UI$ to 0x040 * equ REV_CREATE_ENGINE_NO_UI$ to 0x040
Main:
debug
Recipients = ''
SentFrom = @USER4
SendToGroup = 'RDS_HOLD' : @VM : 'FI_SUPPORT'
Subject = 'Testing 2'
Message = 'Testing 1234'
AttachWindow = ''
AttachKey = ''
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
obj_Notes('Create',Parms)
return
* Main: * Main:
* debug * debug
* Open 'LSL_USERS' to hTable then * Open 'LSL_USERS' to hTable then
@ -203,3 +221,4 @@ Main2:
return return

View File

@ -163,7 +163,7 @@ Service ChangeToolMode(ToolID, NewMode, NewReason, CurrUser, ForceModeChange)
// Close old mode record // Close old mode record
// Don't wait for the indexer. Flush pending index transactions BEFORE reading // Don't wait for the indexer. Flush pending index transactions BEFORE reading
// the Tool CURR_MODE_KEY. // the Tool CURR_MODE_KEY.
Update_Index('TOOL_LOG', 'TOOL_CURR_MODE', False$) Update_Index('TOOL_LOG', 'TOOL_CURR_MODE', False$, True$)
// Get Current Mode - There should only be one key, but we will verify before proceeding. // Get Current Mode - There should only be one key, but we will verify before proceeding.
CurrModeKeys = Xlate('TOOL', ToolID, TOOL_CURR_MODE_KEY$, 'X') CurrModeKeys = Xlate('TOOL', ToolID, TOOL_CURR_MODE_KEY$, 'X')
// CurrModeKey will be set within the following GoSub // CurrModeKey will be set within the following GoSub
@ -313,10 +313,10 @@ VerifyCurrModeIndex:
StopDtm = ToolLogRec<TOOL_LOG_STOP_DTM$> StopDtm = ToolLogRec<TOOL_LOG_STOP_DTM$>
ToolLogRec<TOOL_LOG_STOP_DTM$> = '' ToolLogRec<TOOL_LOG_STOP_DTM$> = ''
Database_Services('WriteDataRow', 'TOOL_LOG', CurrModeKey, ToolLogRec, True$, False$, True$) Database_Services('WriteDataRow', 'TOOL_LOG', CurrModeKey, ToolLogRec, True$, False$, True$)
Update_Index('TOOL_LOG', 'TOOL_CURR_MODE', False$) Update_Index('TOOL_LOG', 'TOOL_CURR_MODE', False$, True$)
ToolLogRec<TOOL_LOG_STOP_DTM$> = StopDtm ToolLogRec<TOOL_LOG_STOP_DTM$> = StopDtm
Database_Services('WriteDataRow', 'TOOL_LOG', CurrModeKey, ToolLogRec, True$, False$, True$) Database_Services('WriteDataRow', 'TOOL_LOG', CurrModeKey, ToolLogRec, True$, False$, True$)
Update_Index('TOOL_LOG', 'TOOL_CURR_MODE', False$) Update_Index('TOOL_LOG', 'TOOL_CURR_MODE', False$, True$)
Next CurrModeKey Next CurrModeKey
// The index should be healthy now and we should only have one key. // The index should be healthy now and we should only have one key.
@ -328,3 +328,4 @@ VerifyCurrModeIndex:
return return

View File

@ -409,3 +409,4 @@ return

View File

@ -82,7 +82,7 @@ Open:
// Update indexes // Update indexes
Wait = SRP_Wait("Init", "Scheduler Load":@RM:"Updating indexes...") Wait = SRP_Wait("Init", "Scheduler Load":@RM:"Updating indexes...")
Update_Index(Table, "SCHED_DT", No$) Update_Index(Table, "SCHED_DT", No$, Yes$)
return return
@ -286,3 +286,4 @@ Check_Pace:
end end
end end
return return

View File

@ -0,0 +1,25 @@
compile insert NOTES_EQUATES
* Equates for NOTES created on 10/16/2024 11:02AM
Equ NOTES_MESSAGE_TYPE$ to 1
equ NOTES_ENTRY_DATE$ to 2
equ NOTES_ENTRY_TIME$ to 3
equ NOTES_SEND_TO$ to 4
equ NOTES_FROM$ to 5
equ NOTES_COMPANY$ to 6
equ NOTES_PHONE$ to 7
equ NOTES_INTL_PHONE$ to 8
equ NOTES_MESSAGE$ to 9
equ NOTES_ENTRY_ID$ to 10
equ NOTES_PT_PHONED$ to 11
equ NOTES_PT_CALL_BACK$ to 12
equ NOTES_PT_RET_CALL$ to 13
equ NOTES_PT_WANTS_SEE$ to 14
equ NOTES_PT_WILL_CALL$ to 15
equ NOTES_PT_WAS_IN$ to 16
equ NOTES_PT_URGENT$ to 17
equ NOTES_SUBJECT$ to 18
equ NOTES_ATTACH_WINDOW$ to 19
equ NOTES_ATTACH_KEYS$ to 20 ;* Not used anymore
equ NOTES_ATTACH_KEY$ to 20
equ NOTES_MSG_GROUPS_IDS$ to 21

View File

@ -0,0 +1,12 @@
compile insert NOTES_QUEUE_EQUATES
/*----------------------------------------
Author : Table Create Insert Routine
Written : 16/10/2024
Description : Insert for Table NOTES_QUEUE
----------------------------------------*/
#ifndef __NOTES_QUEUE_EQUATES__
#define __NOTES_QUEUE_EQUATES__
equ NOTES_QUEUE.NOTES_ID$ to 1
#endif

View File

@ -0,0 +1,14 @@
compile insert NOTE_PTRS_EQUATES
* Equates for NOTE_PTRS created on 08/03/95 07:31AM
Equ NOTE_PTRS_SUBJECT$ to 1
Equ NOTE_PTRS_FROM$ to 2
Equ NOTE_PTRS_DATE$ to 3
Equ NOTE_PTRS_TIME$ to 4
Equ NOTE_PTRS_NEW$ to 5
Equ NOTE_PTRS_ATTACHMENT$ to 6
Equ NOTE_PTRS_NOTE_IDS$ to 7
Equ NOTE_PTRS_ARCHIVED$ to 8
Equ NOTE_PTRS_SNOOZE$ to 9

View File

@ -9,3 +9,6 @@ compile insert NOTIFICATION_EQUATES
Equ NOTIFICATION_NOTIFY_ID$ To 0 Equ NOTIFICATION_NOTIFY_ID$ To 0
Equ NOTIFICATION_DESC$ To 1 Equ NOTIFICATION_DESC$ To 1
Equ NOTIFICATION_USER_ID$ To 2 Equ NOTIFICATION_USER_ID$ To 2
Equ NOTIFICATION_USE_ACTIVE_DIRECTORY$ To 3
Equ NOTIFICATION_ACTIVE_DIRECTORY_GROUPS$ To 4
Equ NOTIFICATION_LIMIT_TO_ACTIVE_SHIFT$ To 5

View File

@ -666,7 +666,6 @@ Service SearchIndex(TableName, ColumnName, SearchValue, UpdateIndex)
ServiceKeyID := '*' : TableName : '*' : ColumnName : '*' : SearchValue ServiceKeyID := '*' : TableName : '*' : ColumnName : '*' : SearchValue
ServiceKeyID = SRP_Encode(ServiceKeyID, 'BASE64') ServiceKeyID = SRP_Encode(ServiceKeyID, 'BASE64')
* KeyIDList = Memory_Services('GetValue', ServiceKeyID, True$, 5)
KeyIDList = '' KeyIDList = ''
If TableName NE '' AND ColumnName NE '' AND SearchValue NE '' then If TableName NE '' AND ColumnName NE '' AND SearchValue NE '' then
@ -674,7 +673,7 @@ Service SearchIndex(TableName, ColumnName, SearchValue, UpdateIndex)
DictTableHandle = Database_Services('GetTableHandle', 'DICT.' : TableName) DictTableHandle = Database_Services('GetTableHandle', 'DICT.' : TableName)
If Error_Services('NoError') then If Error_Services('NoError') then
Set_Status(0) Set_Status(0)
If UpdateIndex then Update_Index(TableName, ColumnName 0) If UpdateIndex then Update_Index(TableName, ColumnName, False$, True$)
Set_Status(0) Set_Status(0)
Flag = '' Flag = ''
Btree.Extract(ColumnName : @VM : SearchValue : @FM, Tablename, DictTableHandle, KeyIDList, 'S', Flag) Btree.Extract(ColumnName : @VM : SearchValue : @FM, Tablename, DictTableHandle, KeyIDList, 'S', Flag)
@ -1045,3 +1044,4 @@ end service
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -3548,10 +3548,10 @@ Service ProcessSQLRequests()
GoSub ClearCursors GoSub ClearCursors
Sentence = 'SELECT ':Tablename:' WITH RESPONSE_DATE EQ "" BY REQUEST_DATE BY REQUEST_TIME' Sentence = 'SELECT ':Tablename:' WITH RESPONSE_DATE EQ "" BY REQUEST_DATE BY REQUEST_TIME'
Set_Status(0) Set_Status(0)
Update_Index(Tablename, 'REQUEST_DATE', 0) Update_Index(Tablename, 'REQUEST_DATE', False$, True$)
Update_Index(Tablename, 'REQUEST_TIME', 0) Update_Index(Tablename, 'REQUEST_TIME', False$, True$)
Update_Index(Tablename, 'RESPONSE_DATE', 0) Update_Index(Tablename, 'RESPONSE_DATE', False$, True$)
Update_Index(Tablename, 'RESPONSE_TIME', 0) Update_Index(Tablename, 'RESPONSE_TIME', False$, True$)
RList(Sentence, TARGET_ACTIVELIST$, '', '', '') RList(Sentence, TARGET_ACTIVELIST$, '', '', '')
EOF = False$ EOF = False$
Loop Loop
@ -3640,3 +3640,4 @@ return

View File

@ -1,24 +1,26 @@
Compile Subroutine Temp(dummy) Compile Subroutine Temp(dummy)
Declare Function datetime
Debug Debug
Open 'SYSENV' To hSysenv Then dt = datetime()
Open 'TEMP_SYSENV' To hNewSysenv Then
Select hSysenv *Open 'SYSENV' To hSysenv Then
EOF = 0 * Open 'TEMP_SYSENV' To hNewSysenv Then
Loop * Select hSysenv
Readnext Key Else EOF = 1 * EOF = 0
Until EOF * Loop
//If IndexC(Key, 'SRP', 1) then * Readnext Key Else EOF = 1
Read Rec From hSysenv, Key Then * Until EOF
Write Rec To hNewSysenv, Key Else * //If IndexC(Key, 'SRP', 1) then
Debug * Read Rec From hSysenv, Key Then
end * Write Rec To hNewSysenv, Key Else
End * Debug
//end * end
Repeat * End
End * //end
End * Repeat
* End
*End
return return