Removed Out of Service calibrations from notifications being sent
This commit is contained in:
committed by
Stieber Daniel (CSC FI SPS MESLEO)
parent
ad6ed9c002
commit
261e13ceac
@ -58,105 +58,103 @@ RETURN Result
|
|||||||
SendReminders:
|
SendReminders:
|
||||||
* * * * * * *
|
* * * * * * *
|
||||||
|
|
||||||
OPEN 'CALIB_LIST' TO FileIn ELSE
|
OPEN 'CALIB_LIST' TO FileIn ELSE
|
||||||
ErrorMsg = 'Unable to open "CALIB_LIST" table. (':Method:')'
|
ErrorMsg = 'Unable to open "CALIB_LIST" table. (':Method:')'
|
||||||
RETURN
|
RETURN
|
||||||
END
|
|
||||||
|
|
||||||
CheckDt = OCONV(Date()+15,'D4/')
|
|
||||||
SelectSent = 'SELECT CALIB_LIST WITH NEXT_CAL_DT < ':QUOTE(CheckDt):' BY NEXT_CAL_DT'
|
|
||||||
RList(SelectSent,TARGET_ACTIVELIST$,'','','')
|
|
||||||
|
|
||||||
NoteText = ''
|
|
||||||
Depts = ''
|
|
||||||
|
|
||||||
Done = 0
|
|
||||||
LOOP
|
|
||||||
READNEXT CLNo ELSE Done = 1
|
|
||||||
UNTIL Done
|
|
||||||
READ CLRec FROM FileIn,CLNo THEN
|
|
||||||
|
|
||||||
NextCalDt = OCONV(XLATE('CALIB_LIST',CLNo,'NEXT_CAL_DT','X'),'D4/')
|
|
||||||
|
|
||||||
IF NextCalDt NE '' THEN
|
|
||||||
|
|
||||||
CLType = CLRec<CALIB_LIST_CL_TYPE$>
|
|
||||||
Dept = CLRec<CALIB_LIST_DEPT$>
|
|
||||||
IF Dept = '' THEN Dept = 'MET'
|
|
||||||
|
|
||||||
IF CLType = 'E' THEN
|
|
||||||
Desc = CLRec<CALIB_LIST_EQ_DESC$>
|
|
||||||
SN = CLRec<CALIB_LIST_EQ_SN$>
|
|
||||||
Loc = CLRec<CALIB_LIST_EQ_LOC$
|
|
||||||
NewLine = Desc:' (S/N: ':SN:') located in the ':Loc:' is due for calibration on ':NextCalDt:CRLF$
|
|
||||||
END
|
|
||||||
IF CLType = 'S' THEN
|
|
||||||
Desc = CLRec<CALIB_LIST_STD_DESC$>
|
|
||||||
SN = CLRec<CALIB_LIST_STD_SN$>
|
|
||||||
Loc = CLRec<CALIB_LIST_STD_LOC$>
|
|
||||||
NewLine = 'The NIST Standard ':Desc:' (S/N: ':SN:') located in the ':Loc:' is due for calibration on ':NextCalDt:CRLF$
|
|
||||||
END
|
|
||||||
|
|
||||||
LOCATE Dept IN Depts USING @FM SETTING Pos ELSE
|
|
||||||
Depts = INSERT(Depts,Pos,0,0,Dept)
|
|
||||||
END
|
|
||||||
NoteText<Pos> = NoteText<Pos>:NewLine
|
|
||||||
|
|
||||||
END ;* End of check for NextCalDt
|
|
||||||
END ;* End of CLRec read
|
|
||||||
REPEAT
|
|
||||||
|
|
||||||
DeptUsers = ''
|
|
||||||
DeptDescs =''
|
|
||||||
|
|
||||||
PopupLiteral = XLATE('SYSREPOSPOPUPS',@APPID<1>:'**DEPT',PDISPLAY$,'X')
|
|
||||||
|
|
||||||
CONVERT @VM:@SVM TO @FM:@VM IN PopupLiteral
|
|
||||||
|
|
||||||
LiteralCnt = COUNT(PopupLiteral,@FM) + (PopupLiteral NE '')
|
|
||||||
|
|
||||||
FOR I = 1 TO LiteralCnt
|
|
||||||
Dept = PopupLiteral<I,1>
|
|
||||||
DeptDesc = PopupLiteral<I,2>
|
|
||||||
UserNames = PopupLiteral<I,3>
|
|
||||||
LOCATE Dept IN Depts USING @FM SETTING Pos THEN
|
|
||||||
CONVERT ' ' TO '' IN UserNames
|
|
||||||
CONVERT ',' TO @VM IN UserNames
|
|
||||||
DeptUsers<Pos> = UserNames
|
|
||||||
DeptDescs<Pos> = DeptDesc
|
|
||||||
END
|
END
|
||||||
NEXT I
|
|
||||||
|
|
||||||
NoteSubject = "Equipment Calibration Reminder"
|
CheckDt = OCONV(Date()+15,'D4/')
|
||||||
|
SelectSent = 'SELECT CALIB_LIST WITH NEXT_CAL_DT < ':QUOTE(CheckDt):' AND WITH EQ_LOC NE "Out of Service" BY NEXT_CAL_DT'
|
||||||
|
RList(SelectSent,TARGET_ACTIVELIST$,'','','')
|
||||||
|
|
||||||
DeptCnt = COUNT(Depts,@FM) + (Depts NE '')
|
NoteText = ''
|
||||||
|
Depts = ''
|
||||||
|
|
||||||
FOR I = 1 TO DeptCnt
|
Done = 0
|
||||||
|
LOOP
|
||||||
IF NoteText<I> NE '' THEN
|
READNEXT CLNo ELSE Done = 1
|
||||||
*NoteText<I> = 'Testing during development of new functionality - disregard':CRLF$:NoteText<I>
|
UNTIL Done
|
||||||
|
READ CLRec FROM FileIn,CLNo THEN
|
||||||
|
|
||||||
Recipients = DeptUsers<I>
|
NextCalDt = OCONV(XLATE('CALIB_LIST',CLNo,'NEXT_CAL_DT','X'),'D4/')
|
||||||
|
|
||||||
LOCATE @USER4 IN Recipients SETTING Dummy THEN
|
IF NextCalDt NE '' THEN
|
||||||
Recipient = @USER4
|
|
||||||
|
CLType = CLRec<CALIB_LIST_CL_TYPE$>
|
||||||
SentFrom = 'System'
|
Dept = CLRec<CALIB_LIST_DEPT$>
|
||||||
Subject = DeptDescs<I>:" Department - Equipment Calibration Reminder"
|
IF Dept = '' THEN Dept = 'MET'
|
||||||
Message = NoteText<I>
|
|
||||||
AttachWindow = 'MASTER_CALIB_LIST'
|
|
||||||
AttachKeys = ''
|
|
||||||
SendToGroup = ''
|
|
||||||
|
|
||||||
Obj_Notes('Create',Recipient:@RM:'System':@RM:NoteSubject:@RM:NoteText<I>:@RM:'MASTER_CALIB_LIST')
|
IF CLType = 'E' THEN
|
||||||
|
Desc = CLRec<CALIB_LIST_EQ_DESC$>
|
||||||
|
SN = CLRec<CALIB_LIST_EQ_SN$>
|
||||||
|
Loc = CLRec<CALIB_LIST_EQ_LOC$
|
||||||
|
NewLine = Desc:' (S/N: ':SN:') located in the ':Loc:' is due for calibration on ':NextCalDt:CRLF$
|
||||||
|
END
|
||||||
|
IF CLType = 'S' THEN
|
||||||
|
Desc = CLRec<CALIB_LIST_STD_DESC$>
|
||||||
|
SN = CLRec<CALIB_LIST_STD_SN$>
|
||||||
|
Loc = CLRec<CALIB_LIST_STD_LOC$>
|
||||||
|
NewLine = 'The NIST Standard ':Desc:' (S/N: ':SN:') located in the ':Loc:' is due for calibration on ':NextCalDt:CRLF$
|
||||||
|
END
|
||||||
|
|
||||||
|
LOCATE Dept IN Depts USING @FM SETTING Pos ELSE
|
||||||
|
Depts = INSERT(Depts,Pos,0,0,Dept)
|
||||||
|
END
|
||||||
|
NoteText<Pos> = NoteText<Pos>:NewLine
|
||||||
|
|
||||||
|
END ;* End of check for NextCalDt
|
||||||
|
END ;* End of CLRec read
|
||||||
|
REPEAT
|
||||||
|
|
||||||
|
DeptUsers = ''
|
||||||
|
DeptDescs =''
|
||||||
|
|
||||||
|
PopupLiteral = XLATE('SYSREPOSPOPUPS',@APPID<1>:'**DEPT',PDISPLAY$,'X')
|
||||||
|
|
||||||
|
CONVERT @VM:@SVM TO @FM:@VM IN PopupLiteral
|
||||||
|
|
||||||
|
LiteralCnt = COUNT(PopupLiteral,@FM) + (PopupLiteral NE '')
|
||||||
|
|
||||||
|
FOR I = 1 TO LiteralCnt
|
||||||
|
Dept = PopupLiteral<I,1>
|
||||||
|
DeptDesc = PopupLiteral<I,2>
|
||||||
|
UserNames = PopupLiteral<I,3>
|
||||||
|
LOCATE Dept IN Depts USING @FM SETTING Pos THEN
|
||||||
|
CONVERT ' ' TO '' IN UserNames
|
||||||
|
CONVERT ',' TO @VM IN UserNames
|
||||||
|
DeptUsers<Pos> = UserNames
|
||||||
|
DeptDescs<Pos> = DeptDesc
|
||||||
END
|
END
|
||||||
|
NEXT I
|
||||||
END
|
|
||||||
|
|
||||||
NEXT I
|
NoteSubject = "Equipment Calibration Reminder"
|
||||||
|
|
||||||
|
DeptCnt = COUNT(Depts,@FM) + (Depts NE '')
|
||||||
|
|
||||||
|
FOR I = 1 TO DeptCnt
|
||||||
|
|
||||||
|
IF NoteText<I> NE '' THEN
|
||||||
|
*NoteText<I> = 'Testing during development of new functionality - disregard':CRLF$:NoteText<I>
|
||||||
|
|
||||||
|
Recipients = DeptUsers<I>
|
||||||
|
|
||||||
|
LOCATE @USER4 IN Recipients SETTING Dummy THEN
|
||||||
|
Recipient = @USER4
|
||||||
|
|
||||||
|
SentFrom = 'System'
|
||||||
|
Subject = DeptDescs<I>:" Department - Equipment Calibration Reminder"
|
||||||
|
Message = NoteText<I>
|
||||||
|
AttachWindow = 'MASTER_CALIB_LIST'
|
||||||
|
AttachKeys = ''
|
||||||
|
SendToGroup = ''
|
||||||
|
|
||||||
|
Obj_Notes('Create',Recipient:@RM:'System':@RM:NoteSubject:@RM:NoteText<I>:@RM:'MASTER_CALIB_LIST')
|
||||||
|
|
||||||
|
END
|
||||||
|
|
||||||
|
END
|
||||||
|
|
||||||
|
NEXT I
|
||||||
|
|
||||||
RETURN
|
RETURN
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user