open-insight/LSL2/OIEVENT/READ/MSG_GROUPS..json
2024-03-25 15:12:53 -07:00

11 lines
1.5 KiB
JSON

{
"header": {
"version": 1,
"type": "record"
},
"body": {
"record1": {
"<1>": "declare subroutine forward_event\r\ndeclare function msg, post_event, rowexists\r\ndeclare function set_property, get_property\r\n$insert msg_groups_equ\r\n$insert msg_equates\r\n\r\nTempGroupName = .group_name->text; *converting any spaces into underscores\r\nconvert ' ' to '_' in TempGroupName\r\n.group_name->text = TempGroupName\r\n\r\nGroupName = Get_Property(@WINDOW:'.GROUP_NAME','DEFPROP')\r\n\r\nif rowexists( 'MSG_GROUPS', GroupName ) then\r\n if @user4 = xlate( 'MSG_GROUPS', GroupName, msg_groups_entry_id$, '' ) OR GroupName = 'ALL_ACTIVE_USERS' then\r\n if get_property( @window, '@NoRead' ) <> 1 then\r\n \tforward_event(); *this reads & displays the record\r\n end\r\n end else\r\n Message = 'You are only allowed to view your own groups.' \r\n Message<micon$> = 'H'\r\n Void = msg( '', Message )\r\n .group_name->text = ''\r\n void = post_event( @window:'.GROUP_NAME', 'GOTFOCUS', '' )\r\n void = set_property( @window:'.GROUP_NAME', 'FOCUS', 1 )\r\n end\r\nend else; *new record\r\n\tforward_event()\r\n\t.entry_id->text = oconv( @user4, '[XLATE_CONV,LSL_USERS*FIRST_LAST]' )\r\n\t.entry_date->text = oconv( date(), 'D2/' )\r\nend\r\n\r\nProtectVar = 'ENTRY_ID/ENTRY_DATE'\r\nswap '/' with @rm:@window:'.' in ProtectVar\r\nProtectVar = @window:'.':ProtectVar\r\nVoid = set_property( ProtectVar, 'ENABLED', 0 )\r\n\r\nRETURN 0"
}
}
}