]> source.dussan.org Git - redmine.git/commitdiff
Remove code no longer necessary due to r21823 (#37674).
authorGo MAEDA <maeda@farend.jp>
Mon, 16 Jan 2023 08:46:18 +0000 (08:46 +0000)
committerGo MAEDA <maeda@farend.jp>
Mon, 16 Jan 2023 08:46:18 +0000 (08:46 +0000)
git-svn-id: https://svn.redmine.org/redmine/trunk@22046 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/users_helper.rb

index b2c09e5dcfde85becde8a36119b62203ed4a1342..860a60ccf03a2dca4128c05165550f6f5383eaf6 100644 (file)
 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