No edit summary |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
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, | ||
Line 19: | Line 19: | ||
} | } | ||
if VariablesLua.varexists('Employees') then | if VariablesLua.varexists('Employees') and VariablesLua.var('Employees') ~= '' then | ||
employees = VariablesLua.var('Employees') | employees = VariablesLua.var('Employees') | ||
employees = employees .. '&&&' .. mw.text.jsonEncode(newEmployee) | employees = employees .. '&&&' .. mw.text.jsonEncode(newEmployee) |
Latest revision as of 08:35, 25 April 2024
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') and VariablesLua.var('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