# HG changeset patch # User bsw # Date 1533554449 -7200 # Node ID a1a2f59e083eb728db5dcf5a6c341cbb78ffb318 # Parent 14a75a6c02c3c489703789ee71e42aae128f8f74 Changed order of unit dropdown diff -r 14a75a6c02c3 -r a1a2f59e083e app/main/registration/_register_form.lua --- a/app/main/registration/_register_form.lua Mon Aug 06 13:15:16 2018 +0200 +++ b/app/main/registration/_register_form.lua Mon Aug 06 13:20:49 2018 +0200 @@ -96,13 +96,16 @@ if field.where then units_selector:add_where(field.where) end - local units = units_selector:exec() + local units = {} if field.optional then table.insert(units, { id = "", name = _"None" }) end + for i_unit, unit in ipairs(units_selector:exec()) do + table.insert(units, unit) + end ui.field.select{ label = field.label, foreign_records = units, diff -r 14a75a6c02c3 -r a1a2f59e083e app/main/registration_admin/verification.lua --- a/app/main/registration_admin/verification.lua Mon Aug 06 13:15:16 2018 +0200 +++ b/app/main/registration_admin/verification.lua Mon Aug 06 13:20:49 2018 +0200 @@ -71,19 +71,23 @@ if field.where then units_selector:add_where(field.where) end - local units = units_selector:exec() + local units = {} if field.optional then table.insert(units, { id = "", name = _"None" }) end + for j, units in ipairs(units_selector:exec()) do + table.insert(units, unit) + end ui.field.select{ label = field.label, foreign_records = units, foreign_id = "id", foreign_name = "name", - name = field.name + name = field.name, + value = tonumber(data[field.name]) } else ui.field.text{