open-insight/LSL2/STPROC/COMM_NOTIFICATION.txt
2024-10-24 16:37:24 -07:00

236 lines
4.8 KiB
Plaintext

COMPILE FUNCTION Comm_Notification(Instruction, Parm1,Parm2)
/*
Commuter module for Notification window
09/15/2005 - John C. Henry, J.C. Henry & Co., Inc.
*/
DECLARE SUBROUTINE Set_Property, Set_Status, ErrMsg, Set_Property, obj_AppWindow, obj_Notes
DECLARE SUBROUTINE Btree.Extract, Send_Event, Security_Err_Msg, Forward_Event, End_Window, Start_Window
DECLARE SUBROUTINE Send_Message
DECLARE FUNCTION Get_Property, Get_Status, Popup, Send_Message, Msg, Security_Check, Dialog_Box, RowExists
DECLARE FUNCTION Dialog_Box, obj_WO_Log, obj_RDS2, Admin_User
$INSERT POPUP_EQUATES
$INSERT MSG_EQUATES
$INSERT APPCOLORS
$INSERT SECURITY_RIGHTS_EQU
EQU CRLF$ TO \0D0A\
ErrTitle = 'Error in Comm_Notification'
ErrorMsg = ''
Result = ''
BEGIN CASE
CASE Instruction = 'Create' ; GOSUB Create
CASE Instruction = 'Refresh' ; GOSUB Refresh
CASE Instruction = 'Page' ; GOSUB Page
CASE Instruction = 'Read' ; GOSUB Read
CASE Instruction = 'Write' ; GOSUB Write
CASE Instruction = 'Clear' ; GOSUB Clear
CASE Instruction = 'Delete' ; GOSUB Delete
CASE Instruction = 'Close' ; GOSUB Close
CASE Instruction = 'LUNotifyID' ; GOSUB LUNotifyID
CASE Instruction = 'AddUsers' ; GOSUB AddUsers
CASE 1
ErrorMsg = 'Unknown Instruction passed to routine'
END CASE
IF ErrorMsg NE '' THEN
ErrMsg(ErrorMsg)
END
RETURN Result
* * * * * * *
Create:
* * * * * * *
IF NOT(Admin_User( @USER4 )) THEN
Message = 'You do not have the proper security to enter Message Notifications...'
Message<micon$> = 'H'
Msg( '', Message )
send_event( @window, 'CLOSE' )
END
obj_Appwindow('Create',@WINDOW)
GOSUB Refresh
RETURN
* * * * * * *
Read:
* * * * * * *
GOSUB Refresh
RETURN
* * * * * * *
Write:
* * * * * * *
RETURN
* * * * * * *
Clear:
* * * * * * *
GOTO Refresh
RETURN
* * * * * * *
Delete:
* * * * * * *
IF NOT(Security_Check('RDS',DELETE$)) THEN
Security_Err_Msg('RDS',DELETE$)
RETURN
END
Result = 0 ;* OK to proceed with the delete
RETURN
* * * * * * *
Page:
* * * * * * *
obj_Appwindow('Page')
GOSUB Refresh
RETURN
* * * * * * *
Close:
* * * * * * *
RETURN
* * * * * * *
Refresh:
* * * * * * *
* QBF buttons
Ctrls = @WINDOW:'.QBF_FIRST_FIX':@RM ; Props = 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_PREV_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_ABS_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_NEXT_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_LAST_FIX':@RM ; Props := 'ENABLED':@RM
Ctrls := @WINDOW:'.QBF_STOP_FIX' ; Props := 'ENABLED'
IF Get_Property(@WINDOW,'QBFLIST') = '' THEN
Vals = 0:@RM:0:@RM:0:@RM:0:@RM:0:@RM:0
END ELSE
Vals = 1:@RM:1:@RM:1:@RM:1:@RM:1:@RM:1
END
Set_Property(Ctrls,Props,Vals)
* Turn edit table symbolic column backgrounds to green
ETSymbolics = Get_Property(@WINDOW,'@ET_SYMBOLICS') ;* Loaded during 'Create' in obj_Appwindow
ETCtrls = ETSymbolics<1>
ETCols = ETSymbolics<2>
FOR I = 1 TO COUNT(ETCtrls,@VM) + (ETCtrls NE '')
ETCtrl = ETCtrls<1,I>
IF ETCtrl NE @WINDOW:'.CASSETTES' THEN
ETList = Get_Property(ETCtrl,'LIST')
FOR Line = 1 TO COUNT(ETList,@FM) + (ETList NE '')
IF ETList<Line,1> NE '' THEN
FOR N = 1 TO COUNT(ETCols<1,I>,@SVM) + (ETCols<1,I> NE '')
stat = Send_Message(ETCtrl,'COLOR_BY_POS',ETCols<1,I,N>,Line,GREEN$)
NEXT N
END
NEXT Line
END
NEXT I
RETURN
* * * * * * *
LUNotifyID:
* * * * * * *
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
TypeOver = ''
TypeOver<PSELECT$> = 1
NotifyID = Popup(@WINDOW,TypeOver,'NOTIFICATION')
IF NotifyID NE '' THEN
obj_Appwindow('LUValReturn',NotifyID:@RM:FocusControl:@RM:FocusPos)
END
RETURN
* * * * * * *
AddUsers:
* * * * * * *
CtrlEntID = @WINDOW:'.USER_ID'
CurrUserIDs = Get_Property(CtrlEntID,'ARRAY')<1> ;* Existing MFC codes in edit table
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
Set_Property(CtrlEntID,'DEFPROP',CurrUserIDs)
Send_Event(CtrlEntID,'CALCULATE',2)
GOSUB Refresh
RETURN