def show
return true unless request.post?
begin
@person.transaction do
conference_ids = params[:person].delete(:conference_ids) || []
@person.update_attributes(params[:person])
Conference.find(:all, :order => 'id').each do |conf|
present = @person.conferences.include?(conf)
desired = conference_ids.include?(conf.id.to_s)
next if present == desired
begin
if desired
@person.conferences += [conf]
else
@person.conferences -= [conf]
end
rescue ActiveRecord::RecordNotSaved => err
flash[:warning] << err.message
end
end
this_task = AdminTask.find_by_sys_name('people_adm')
if @person == @user and !@person.admin_tasks.include? this_task
flash[:notice] << _('Removing this administrative task from your ' +
'own account is not allowed - Restoring.')
@person.admin_tasks << this_task
end
flash[:notice] << _('Person data successfully updated')
end
rescue TypeError => err
flash[:error] << _("Error recording requested data: %s") % err
end
end