No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
id=args.id, | id=args.id, | ||
name=args.name, | name=args.name, | ||
flag=args.flag, | |||
position=args.position, | position=args.position, | ||
joindate=args.joindate, | joindate=args.joindate, |
Revision as of 22:51, 6 May 2023
Documentation for this module may be created at Module:Employee/doc
local getArgs = require('Module:Arguments').getArgs
VariablesLua = mw.ext.VariablesLua
local Employee = {}
function Employee.main(frame)
local args = getArgs(frame)
local employees = ''
local newEmployee = {
id=args.id,
name=args.name,
flag=args.flag,
position=args.position,
joindate=args.joindate,
leavedate=args.leavedate,
inactivedate=args.inactivedate,
newcompany=args.newcompany
}
if VariablesLua.varexists('Employees') then
employees = VariablesLua.var('Employees')
employees = employees .. '&&&' .. mw.text.jsonEncode(newEmployee)
else
employees = mw.text.jsonEncode(newEmployee)
end
VariablesLua.vardefine( 'Employees', employees )
return 'yes'
end
return Employee