open-insight/LSL2/OIEVENT/READ/EXPORTS..json
Infineon\StieberD 7762b129af pre cutover push
2024-09-04 20:33:41 -07:00

11 lines
3.5 KiB
JSON

{
"header": {
"version": 1,
"type": "record"
},
"body": {
"record1": {
"<1>": "declare subroutine forward_event, rlist, Set_Property, Send_Event\r\ndeclare function msg, rowexists, post_event, fieldcount\r\n\r\n$insert rlist_equates\r\n$insert msg_equates\r\n$insert logical\r\n$insert exports_equ\r\n\r\nEid = .export_name->text\r\nif rowexists( 'EXPORTS', Eid ) then\r\n * ok now did this user enter it or is Heather trying to snoop\r\n Erec = xlate( 'EXPORTS', Eid, '', '' )\r\n ReadOk = false$\r\n if Erec<exports_sharable$> or get_property( @window, '@SystemGenerated' ) then\r\n ReadOk = true$\r\n end else\r\n if @user4 = xlate( 'EXPORTS', Eid, exports_entry_id$, '' ) then\r\n ReadOk = true$\r\n end\r\n end\r\n if ReadOk then\r\n forward_event() \r\n if .exporttablenames->text = 'REACT_UTIL' then\r\n .UTIL_START->VISIBLE = 1\r\n .UTIL_END->VISIBLE = 1\r\n .UTIL_START_LABEL->VISIBLE = 1\r\n .UTIL_END_LABEL->VISIBLE = 1\r\n end else\r\n .UTIL_START->VISIBLE = 0\r\n .UTIL_END->VISIBLE = 0\r\n .UTIL_START_LABEL->VISIBLE = 0\r\n .UTIL_END_LABEL->VISIBLE = 0\r\n end \r\n\t\tTtable = .exporttablenames->text\r\n\t\tIF Ttable = '' THEN\r\n\t\t\tCall ErrMsg('You do not have Read rights to the Table used in this export.')\r\n\t\t\tSet_Property(@WINDOW,'SAVEWARN',0)\r\n\t\t\tSend_Event(@WINDOW,'CLEAR')\r\n\t\t\tRETURN 0\r\n\t\tEND\r\n\t\t\r\n \tColumns = ''\r\n \tBtreeColumns = ''\t\t\r\n\t\tif Ttable then\r\n\t\t\tDictTable = 'DICT.':Ttable\r\n\t\t\tVoid = utility( 'CURSOR', 'H' )\r\n\t\t\tCmd = \"SELECT \":DictTable:\" BY @ID WITH F1 = 'F' 'S'\"\r\n\t\t\trlist( Cmd, target_activelist$, '', '', '' )\r\n\t\t\tif @reccount then\r\n\t\t\t Eof = false$\r\n\t\t\t loop\r\n\t\t\t readnext DictId else Eof = true$\r\n\t\t\t until Eof\r\n\t\t\t Columns := DictId:@vm\r\n\t\t\t repeat\r\n\t\t\t Columns[-1,1] = ''\r\n\t\t\t Void = set_property( @window, '@Columns', Columns )\r\n\t\t\tend \r\n\t\t\tCmd = \"SELECT \":DictTable:\" USING EXPORTS BY @ID WITH F6 = 1\"\r\n\t\t\trlist( Cmd, target_activelist$, '', '', '' )\r\n\t\t\t\r\n\t\t\tif @reccount then\r\n\t\t\t Eof = false$\r\n\t\t\t\tloop\r\n\t\t\t\t readnext DictId else Eof = true$\r\n\t\t\t\t until Eof\r\n\t\t\t\t BtreeColumns := DictId:@vm\r\n\t\t\t\trepeat\r\n\t\t\t\tBtreeColumns[-1,1] = ''\r\n\t\t\t\tVoid = set_property( @window, '@BtreeColumns', BtreeColumns )\r\n\t\t\tend else\r\n\t\t\t * no btree columns\r\n\t\t\tend\r\n\t\t\tVoid = utility( 'CURSOR', 'A' )\r\n\t\tend\r\n QColumns = Columns\r\n BcCnt = fieldcount( BtreeColumns, @vm )\r\n for i = 1 to BcCnt\r\n locate BtreeColumns<1,i> in QColumns using @vm setting Rpos then\r\n QColumns = delete( QColumns, 1, Rpos, 0 )\r\n end\r\n next i\r\n Void = set_property( @window, '@QColumns', QColumns )\r\n end else\r\n Message = 'You are only allowed to view sharable or your own Export Templates...' \r\n Message<micon$> = 'H'\r\n Void = msg( '', Message )\r\n .export_name->text = ''\r\n void = post_event( @window:'.EXPORT_NAME', 'GOTFOCUS', '' )\r\n void = set_property( @window:'.EXPORT_NAME', 'FOCUS', 1 )\r\n end\r\nend else\r\n forward_event( CtrlEntID, CtrlClassID )\r\n .entry_id->text = oconv( @user4, '[XLATE_CONV,LSL_USERS*FIRST_LAST]' )\r\n .entry_date->text = oconv( date(), 'D2/' )\r\nend\r\nRETURN 0"
}
}
}