added LSL2 stored procedures
This commit is contained in:
272
LSL2/STPROC/COMM_REACT_ESC.txt
Normal file
272
LSL2/STPROC/COMM_REACT_ESC.txt
Normal file
@ -0,0 +1,272 @@
|
||||
COMPILE FUNCTION Comm_React_Esc(Instruction,Parm1,Parm2)
|
||||
|
||||
/*
|
||||
Template Commuter module for REACT_ESC (Reactor Escalation Log) window
|
||||
|
||||
09/26/2007 - John C. Henry, J.C. Henry & Co., Inc.
|
||||
*/
|
||||
|
||||
DECLARE SUBROUTINE Set_Property, End_Dialog, Send_Event, Set_Status, Center_Window, Post_Event
|
||||
DECLARE SUBROUTINE ErrMsg, Send_Message, Set_Property, Send_Event, Btree.Extract, obj_AppWindow,
|
||||
DECLARE SUBROUTINE obj_Notes, Security_Err_Msg, End_Window, Forward_Event, Start_Window, Create_Note
|
||||
|
||||
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box, Utility, Center_Window, Popup, Collect.Ixvals
|
||||
DECLARE FUNCTION Send_Message, Msg, Security_Check, RowExists, NextKey, obj_React_Esc
|
||||
|
||||
|
||||
|
||||
$INSERT MSG_EQUATES
|
||||
$INSERT APPCOLORS
|
||||
$INSERT LSL_USERS_EQU
|
||||
$INSERT SECURITY_RIGHTS_EQU
|
||||
$INSERT REACT_EVENT_EQUATES
|
||||
$INSERT POPUP_EQUATES
|
||||
|
||||
EQU CRLF$ TO \0D0A\
|
||||
|
||||
|
||||
ErrTitle = 'Error in Comm_React_Esc'
|
||||
ErrorMsg = ''
|
||||
|
||||
Result = ''
|
||||
|
||||
BEGIN CASE
|
||||
CASE Instruction = 'Create' ; GOSUB Create
|
||||
CASE Instruction = 'Refresh' ; GOSUB Refresh
|
||||
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 = 'LUReactEsc' ; GOSUB LUReactEsc
|
||||
|
||||
CASE 1
|
||||
ErrorMsg = 'Unknown Instruction ':QUOTE(Instruction):' passed to routine.'
|
||||
ErrMsg(ErrorMsg)
|
||||
|
||||
END CASE
|
||||
|
||||
IF ErrorMsg NE '' THEN
|
||||
ErrMsg(ErrTitle:@SVM:ErrorMsg)
|
||||
END
|
||||
|
||||
RETURN Result
|
||||
|
||||
|
||||
|
||||
* * * * * * *
|
||||
Create:
|
||||
* * * * * * *
|
||||
|
||||
IF NOT(Security_Check('Reactor Event Log',READ$)) THEN
|
||||
Security_Err_Msg('Reactor Event Log',READ$)
|
||||
End_Window(@WINDOW)
|
||||
RETURN
|
||||
END
|
||||
|
||||
obj_Appwindow('Create',@WINDOW)
|
||||
|
||||
|
||||
* Provides compatibility with the existing messaging attachment system
|
||||
|
||||
IF Parm1 NE '' THEN
|
||||
PassedKeys = FIELD(Parm1,'*',1)
|
||||
obj_Appwindow('ViewRelated',@WINDOW:@RM:PassedKeys)
|
||||
END
|
||||
|
||||
IOOptions = Get_Property(@WINDOW,'IOOPTIONS')
|
||||
IOOptions<11> = 1 ;* Generate READ event on QBFLoad
|
||||
|
||||
Set_Property(@WINDOW,'IOOPTIONS',IOOptions)
|
||||
|
||||
GOSUB Refresh
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
* * * * * * *
|
||||
Clear:
|
||||
* * * * * * *
|
||||
|
||||
|
||||
IF Get_Property(@WINDOW,'@READONLY') THEN
|
||||
obj_AppWindow('ReadOnly',@RM:1) ;* Reenables data bound controls
|
||||
Set_Property(@WINDOW,'@READONLY',0) ;* Clear flag on window
|
||||
END
|
||||
|
||||
|
||||
* * * * * * *
|
||||
Refresh:
|
||||
* * * * * * *
|
||||
|
||||
Active = Get_Property(@WINDOW:'.ACTIVE','CHECK')
|
||||
|
||||
IF Active = 1 THEN
|
||||
Set_Property(@WINDOW:'.ACTIVE_TEXT','VISIBLE',1)
|
||||
END ELSE
|
||||
Set_Property(@WINDOW:'.ACTIVE_TEXT','VISIBLE',0)
|
||||
END
|
||||
|
||||
* 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>
|
||||
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 I
|
||||
NEXT I
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
* * * * * * *
|
||||
Read:
|
||||
* * * * * * *
|
||||
|
||||
ReactNo = Get_Property(@WINDOW:'.REACT_NO','TEXT')
|
||||
StartDTM = Get_Property(@WINDOW:'.START_DTM','INVALUE')
|
||||
|
||||
GOSUB Refresh
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
* * * * * * *
|
||||
Write:
|
||||
* * * * * * *
|
||||
|
||||
/*
|
||||
OrderNo = Get_Property(@WINDOW:'.ORD_NO','TEXT')
|
||||
|
||||
Message = ''
|
||||
IF RowExists('ORDER',OrderNo) THEN
|
||||
IF Get_Property(@WINDOW,'SAVEWARN') THEN
|
||||
Message = 'Order No. ':OrderNo:' has been changed.'
|
||||
END
|
||||
END ELSE
|
||||
Message = 'New Order ':QUOTE(OrderNo):' entered into system.'
|
||||
END
|
||||
|
||||
IF Message NE '' THEN
|
||||
|
||||
Recipients = XLATE('NOTIFICATION','ORDER_ENTRY',NOTIFICATION_USER_ID$,'X')
|
||||
SentFrom = @USER4
|
||||
Subject = 'New/Update Order':OrderNo
|
||||
AttachWindow = 'ORDER2'
|
||||
AttachKey = OrderNo
|
||||
SendToGroup = ''
|
||||
|
||||
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||
*obj_Notes('Create',Parms) ;* Per Request from Customer Service
|
||||
|
||||
IF Get_Status(errCode) THEN
|
||||
ErrMsg(errCode)
|
||||
END
|
||||
|
||||
END
|
||||
/*/
|
||||
|
||||
Result = 1
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
* * * * * * *
|
||||
Delete:
|
||||
* * * * * * *
|
||||
|
||||
/*
|
||||
IF Security_Check('Order',Delete$) THEN
|
||||
Result = 1 ;* Proceed with delete
|
||||
END ELSE
|
||||
Security_Err_Msg('Order',Delete$)
|
||||
Result = 0 ;* Stop event chain
|
||||
END
|
||||
*/
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
* * * * * * *
|
||||
LUReactEsc:
|
||||
* * * * * * *
|
||||
|
||||
IF NOT(ASSIGNED(Parm1)) THEN FocusControl = '' ELSE FocusControl = Parm1
|
||||
IF NOT(ASSIGNED(Parm2)) THEN FocusPos = '' ELSE FocusPos = Parm2
|
||||
|
||||
Set_Status(0)
|
||||
|
||||
EventKeys = obj_React_Esc('Find')
|
||||
|
||||
IF Get_Status(errCode) THEN ErrMsg(ErrCode)
|
||||
|
||||
IF INDEX(EventKeys,@VM,1) THEN
|
||||
TypeOver = ''
|
||||
TypeOver<PMODE$> = 'K'
|
||||
TypeOver<PDISPLAY$> = EventKeys
|
||||
EventKeys = Popup(@WINDOW,TypeOver,'REACT_ESC_QUERY')
|
||||
END
|
||||
|
||||
CONVERT @VM TO @FM IN EventKeys
|
||||
|
||||
IF INDEX(EventKeys,@FM,1) THEN
|
||||
Send_Event(@WINDOW,'QBFINIT')
|
||||
Set_Property(@WINDOW,'QBFLIST',EventKeys)
|
||||
GOSUB Refresh
|
||||
Send_Event(@WINDOW,'QBFIRST')
|
||||
END ELSE
|
||||
obj_Appwindow('LoadFormKeys',@WINDOW:@RM:EventKeys)
|
||||
END
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
|
||||
|
||||
* * * * * * *
|
||||
Close:
|
||||
* * * * * * *
|
||||
|
||||
/*
|
||||
obj_Notes('Inbox',@USER4) ;* Checks for any new messages
|
||||
|
||||
obj_Appwindow('CardReturn',@WINDOW)
|
||||
|
||||
*/
|
||||
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user