class PersonAdmin
Allows to add, modify and delete persons
Public Instance Methods
layout()
click to toggle source
# File Views/Person/Admin.rb, line 4 def layout set_data_class :Persons @update = true @order = 30 gui_vboxg do gui_group do gui_hboxg :nogroup do gui_hboxg :nogroup do gui_fields do show_str_ro :login_name show_str_ro :person_id show_block :admin show_arg :permissions, :flexheight => 1 end end gui_vbox :nogroup do gui_vbox :nogroup do show_field :groups end end end show_button :save end gui_window :win_error do show_html :err_html show_entity_person :centers, :drop, :full_name, :width => 200 show_button :chose end end end
rpc_find(session, field, data)
click to toggle source
# File Views/Person/Admin.rb, line 72 def rpc_find(session, field, data) rep = Persons.find(field, data) if not rep rep = {"#{field}" => data} end update_layout(session) + reply(:update, rep) + rpc_update(session) end
rpc_list_choice(session, name, data)
click to toggle source
# File Views/Person/Admin.rb, line 81 def rpc_list_choice(session, name, data) if name == 'persons' dputs(2) { "Got data: #{data.inspect}" } if p = Persons.match_by_login_name(data['persons'].flatten[0]) #reply( :empty_nonlists, [:internet_none] ) + reply(:empty_nonlists, [:permissions, :groups]) + reply(:update, :permissions => Permission.list.sort) + reply(:update, :groups => eval(Persons.get_value(:groups).list)) + reply(:update, p) end end end
update(session)
click to toggle source
# File Views/Person/Admin.rb, line 94 def update(session) if ConfigBase.has_function? :accounting {:your_account_total_due => session.owner.account_total_due} end end