summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-01-16 08:46:18 +0000
committerGo MAEDA <maeda@farend.jp>2023-01-16 08:46:18 +0000
commit4768bebf3f7fc611739ab1bb63f5d2c8d2b2edfc (patch)
tree0fab7bdd0f906de2d3a027145522c4f81319d9a3 /app
parent91705e083beeece533afcad8b7285f6698c2a6da (diff)
downloadredmine-4768bebf3f7fc611739ab1bb63f5d2c8d2b2edfc.tar.gz
redmine-4768bebf3f7fc611739ab1bb63f5d2c8d2b2edfc.zip
Remove code no longer necessary due to r21823 (#37674).
git-svn-id: https://svn.redmine.org/redmine/trunk@22046 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/users_helper.rb59
1 files changed, 0 insertions, 59 deletions
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb
index b2c09e5dc..860a60ccf 100644
--- a/app/helpers/users_helper.rb
+++ b/app/helpers/users_helper.rb
@@ -20,11 +20,6 @@
module UsersHelper
include ApplicationHelper
- def users_status_options_for_select(selected)
- user_count_by_status = User.group('status').count.to_hash
- options_for_select([[l(:label_all), '']] + (User.valid_statuses.map {|c| ["#{l('status_' + User::LABEL_BY_STATUS[c])} (#{user_count_by_status[c].to_i})", c]}), selected.to_s)
- end
-
def user_mail_notification_options(user)
user.valid_notification_options.collect {|o| [l(o.last), o.first]}
end
@@ -105,58 +100,4 @@ module UsersHelper
end
tabs
end
-
- def csv_content(column_name, user)
- case column_name
- when 'status'
- l("status_#{User::LABEL_BY_STATUS[user.status]}")
- when 'twofa_scheme'
- if user.twofa_active?
- l("twofa__#{user.twofa_scheme}__name")
- else
- l(:label_disabled)
- end
- else
- user.send(column_name)
- end
- end
-
- def users_to_csv(users)
- Redmine::Export::CSV.generate(:encoding => params[:encoding]) do |csv|
- columns = [
- 'login',
- 'firstname',
- 'lastname',
- 'mail',
- 'admin',
- 'status',
- 'twofa_scheme',
- 'created_on',
- 'updated_on',
- 'last_login_on',
- 'passwd_changed_on'
- ]
- user_custom_fields = UserCustomField.sorted
-
- # csv header fields
- csv << columns.map {|column| l('field_' + column)} + user_custom_fields.pluck(:name)
- # csv lines
- users = users.preload(:custom_values)
- users.each do |user|
- values = columns.map {|c| csv_content(c, user)} +
- user_custom_fields.map {|custom_field| user.custom_value_for(custom_field)}
-
- csv << values.map do |value|
- format_object(value, false) do |v|
- case v.class.name
- when 'Float'
- sprintf('%.2f', v).gsub('.', l(:general_csv_decimal_separator))
- else
- v
- end
- end
- end
- end
- end
- end
end