Files
open-insight/LSL2/OIEVENT/CLICK/WO_MAST_SCHED.CANCEL.json
2024-03-25 15:12:53 -07:00

11 lines
1.5 KiB
JSON

{
"header": {
"version": 1,
"type": "record"
},
"body": {
"record1": {
"<1>": "declare function msg, send_event, memberof\r\ndeclare subroutine end_dialog\r\n$insert logical\r\n$insert msg_equates\r\n\r\nif memberof(@user4,'MASTER_SCHED' ) and get_property( @window, '@GotLock' ) then\r\n OrigSched = get_property( @window, '@OrigSched' )\r\n CurSched = .sched_info->array\r\n SaveSched = false$\r\n if CurSched <> OrigSched then\r\n MsgInfo = ''\r\n Msg = 'Would you like to save changes?'\r\n \tMsgInfo<mtext$> = Msg\r\n\t MsgInfo<mtype$> = 'BNYC'\r\n\t MsgInfo<micon$> = '?'\r\n\t Response = msg( '', MsgInfo )\r\n\t if Response = 1 then\r\n\t SaveSched = true$\r\n\t end else\r\n\t if Response = 0 then\r\n\t SaveSched = false$\r\n\t end else\r\n\t return 0 ;* user cancelled leave in window\r\n\t end\r\n\t end\r\n\tend\r\n if SaveSched then\r\n Void = send_event( @window:'.SAVE', 'CLICK' )\r\n end else\r\n\t\topen 'CONFIG' to ConfigTable else\r\n\t\t Void = msg( '', 'Unable to open CONFIG table' )\r\n\t\t end_dialog( @window, '' )\r\n\t\t return 0\r\n\t\tend\r\n\t\tunlock ConfigTable, 'WO_MAST_SCHED' else\r\n\t\t Void = msg( '', 'Unable to unlock CONFIG WO_MAST_SCHED')\r\n\t\tend\r\n end_dialog( @window, '' )\t\t\r\n\tend\r\nend else\r\n end_dialog( @window, '' )\t\r\nend\r\nRETURN 0"
}
}
}