@date_to ||= Date.today + 1
@date_from = @date_to - @days
@with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1')
+ @author = (params[:user_id] ? User.find_active(params[:user_id]) : nil)
- @activity = Redmine::Activity::Fetcher.new(User.current, :project => @project, :with_subprojects => @with_subprojects)
+ @activity = Redmine::Activity::Fetcher.new(User.current, :project => @project,
+ :with_subprojects => @with_subprojects,
+ :author => @author)
@activity.scope_select {|t| !params["show_#{t}"].nil?}
- @activity.default_scope! if @activity.scope.empty?
+ @activity.scope = (@author.nil? ? :default : :all) if @activity.scope.empty?
events = @activity.events(@date_from, @date_to)
render :layout => false if request.xhr?
}
format.atom {
- title = (@activity.scope.size == 1) ? l("label_#{@activity.scope.first.singularize}_plural") : l(:label_activity)
+ title = l(:label_activity)
+ if @author
+ title = @author.name
+ elsif @activity.scope.size == 1
+ title = l("label_#{@activity.scope.first.singularize}_plural")
+ end
render_feed(events, :title => "#{@project || Setting.app_title}: #{title}")
}
end
+
+ rescue ActiveRecord::RecordNotFound
+ render_404
end
private
-<h2><%= l(:label_activity) %></h2>
+<h2><%= @author.nil? ? l(:label_activity) : l(:label_user_activity, @author.to_s) %></h2>
<p class="subtitle"><%= "#{l(:label_date_from)} #{format_date(@date_to - @days)} #{l(:label_date_to).downcase} #{format_date(@date_to-1)}" %></p>
<div id="activity">
<p><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label></p>
<%= hidden_field_tag 'with_subprojects', 0 %>
<% end %>
+<%= hidden_field_tag 'user_id', params[:user_id] %>
<p><%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %></p>
<% end %>
<% end %>
-<% html_title(l(:label_activity)) -%>
+<% html_title(l(:label_activity), @author) -%>
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."\r
permission_edit_own_messages: Edit own messages\r
permission_delete_own_messages: Delete own messages\r
+label_user_activity: "%s's activity"\r
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
enumeration_issue_priorities: Ticket-Prioritäten
enumeration_doc_categories: Dokumentenkategorien
enumeration_activities: Aktivitäten (Zeiterfassung)
+label_user_activity: "%s's activity"
label_registered_on: Registered on
label_activity: Activity
label_overall_activity: Overall activity
+label_user_activity: "%s's activity"
label_new: New
label_logged_as: Logged in as
label_environment: Environment
text_user_wrote: '%s escribió:'
text_wiki_destroy_confirmation: ¿Seguro que quiere borrar el wiki y todo su contenido?
text_workflow_edit: Seleccionar un flujo de trabajo para actualizar
+label_user_activity: "%s's activity"
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
field_subproject: Sous-projet
field_hours: Heures
field_activity: Activité
-label_overall_activity: Activité globale
field_spent_on: Date
field_identifier: Identifiant
field_is_filter: Utilisé comme filtre
label_last_updates_plural: %d dernières mises à jour
label_registered_on: Inscrit le
label_activity: Activité
+label_overall_activity: Activité globale
+label_user_activity: "Activité de %s"
label_new: Nouveau
label_logged_as: Connecté en tant que
label_environment: Environnement
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
text_repository_usernames_mapping: "Állítsd be a felhasználó összerendeléseket a Redmine, és a tároló logban található felhasználók között.\nAz azonos felhasználó nevek összerendelése automatikusan megtörténik."
permission_edit_own_messages: Saját üzenetek szerkesztése
permission_delete_own_messages: Saját üzenetek törlése
+label_user_activity: "%s's activity"
text_repository_usernames_mapping: "Seleziona per aggiornare la corrispondenza tra gli utenti Redmine e quelli presenti nel log del repository.\nGli utenti Redmine e repository con lo stesso username o email sono mappati automaticamente."
permission_edit_own_messages: Modifica propri messaggi
permission_delete_own_messages: Elimina propri messaggi
+label_user_activity: "%s's activity"
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
text_wiki_destroy_confirmation: Jesteś pewien, że chcesz usunąć to wiki i całą jego zawartość ?
text_workflow_edit: Zaznacz rolę i typ zagadnienia do edycji przepływu
+label_user_activity: "%s's activity"
text_repository_usernames_mapping: "Seleciona ou atualiza os usuários do Redmine mapeando para cada usuário encontrado no log do repositório.\nUsuários com o mesmo login ou email no Redmine e no repositório serão mapeados automaticamente."
permission_edit_own_messages: Editar próprias mensagens\r
permission_delete_own_messages: Excluir próprias mensagens
+label_user_activity: "%s's activity"\r
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
text_user_wrote: '%s написал(а):'
text_wiki_destroy_confirmation: Вы уверены, что хотите удалить данную Wiki и все ее содержимое?
text_workflow_edit: Выберите роль и трекер для редактирования последовательности состояний
+label_user_activity: "%s's activity"
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
text_repository_usernames_mapping: "Select or update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
+label_user_activity: "%s's activity"\r
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
text_repository_usernames_mapping: "Select or update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
+label_user_activity: "%s's activity"
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
text_repository_usernames_mapping: "Select ou update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped."
permission_edit_own_messages: Edit own messages
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
label_example: Ví dụ
text_repository_usernames_mapping: "Chọn hoặc cập nhật ánh xạ người dùng hệ thống với người dùng trong kho lưu trữ.\nNhững trường hợp trùng hợp về tên và email sẽ được tự động ánh xạ."
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"\r
enumeration_issue_priorities: 項目優先權
enumeration_doc_categories: 文件分類
enumeration_activities: 活動 (時間追蹤)
+label_user_activity: "%s's activity"
enumeration_doc_categories: 文档类别
enumeration_activities: 活动(时间跟踪)
permission_delete_own_messages: Delete own messages
+label_user_activity: "%s's activity"
end
# Sets the scope
+ # Argument can be :all, :default or an array of event types
def scope=(s)
- @scope = s & event_types
+ case s
+ when :all
+ @scope = event_types
+ when :default
+ default_scope!
+ else
+ @scope = s & event_types
+ end
end
# Resets the scope to the default scope
}
end
+ def test_user_activity
+ get :activity, :user_id => 2
+ assert_response :success
+ assert_template 'activity'
+ assert_not_nil assigns(:events_by_day)
+
+ assert_tag :tag => "h3",
+ :content => /#{3.day.ago.to_date.day}/,
+ :sibling => { :tag => "dl",
+ :child => { :tag => "dt",
+ :attributes => { :class => /issue/ },
+ :child => { :tag => "a",
+ :content => /#{Issue.find(1).subject}/,
+ }
+ }
+ }
+ end
+
def test_activity_atom_feed
get :activity, :format => 'atom'
assert_response :success