Adds missing native eol properties.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2895 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
+38
-38
@@ -1,38 +1,38 @@
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2009 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class Principal < ActiveRecord::Base
|
||||
set_table_name 'users'
|
||||
|
||||
has_many :members, :foreign_key => 'user_id', :dependent => :destroy
|
||||
has_many :memberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :project, :roles ], :conditions => "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}", :order => "#{Project.table_name}.name"
|
||||
has_many :projects, :through => :memberships
|
||||
|
||||
# Groups and active users
|
||||
named_scope :active, :conditions => "#{Principal.table_name}.type='Group' OR (#{Principal.table_name}.type='User' AND #{Principal.table_name}.status = 1)"
|
||||
|
||||
named_scope :like, lambda {|q|
|
||||
s = "%#{q.to_s.strip.downcase}%"
|
||||
{:conditions => ["LOWER(login) LIKE ? OR LOWER(firstname) LIKE ? OR LOWER(lastname) LIKE ?", s, s, s],
|
||||
:order => 'type, login, lastname, firstname'
|
||||
}
|
||||
}
|
||||
|
||||
def <=>(principal)
|
||||
self.to_s.downcase <=> principal.to_s.downcase
|
||||
end
|
||||
end
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2009 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class Principal < ActiveRecord::Base
|
||||
set_table_name 'users'
|
||||
|
||||
has_many :members, :foreign_key => 'user_id', :dependent => :destroy
|
||||
has_many :memberships, :class_name => 'Member', :foreign_key => 'user_id', :include => [ :project, :roles ], :conditions => "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}", :order => "#{Project.table_name}.name"
|
||||
has_many :projects, :through => :memberships
|
||||
|
||||
# Groups and active users
|
||||
named_scope :active, :conditions => "#{Principal.table_name}.type='Group' OR (#{Principal.table_name}.type='User' AND #{Principal.table_name}.status = 1)"
|
||||
|
||||
named_scope :like, lambda {|q|
|
||||
s = "%#{q.to_s.strip.downcase}%"
|
||||
{:conditions => ["LOWER(login) LIKE ? OR LOWER(firstname) LIKE ? OR LOWER(lastname) LIKE ?", s, s, s],
|
||||
:order => 'type, login, lastname, firstname'
|
||||
}
|
||||
}
|
||||
|
||||
def <=>(principal)
|
||||
self.to_s.downcase <=> principal.to_s.downcase
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<h3><%=l(:label_watched_issues)%> (<%= Issue.visible.count(:include => :watchers,
|
||||
:conditions => ["#{Watcher.table_name}.user_id = ?", user.id]) %>)</h3>
|
||||
<% watched_issues = Issue.visible.find(:all,
|
||||
:include => [:status, :project, :tracker, :watchers],
|
||||
:limit => 10,
|
||||
:conditions => ["#{Watcher.table_name}.user_id = ?", user.id],
|
||||
:order => "#{Issue.table_name}.updated_on DESC") %>
|
||||
|
||||
<%= render :partial => 'issues/list_simple', :locals => { :issues => watched_issues } %>
|
||||
<% if watched_issues.length > 0 %>
|
||||
<p class="small"><%= link_to l(:label_issue_view_all), :controller => 'issues',
|
||||
:action => 'index',
|
||||
:set_filter => 1,
|
||||
:watcher_id => 'me',
|
||||
:sort => 'updated_on:desc' %></p>
|
||||
<% end %>
|
||||
<h3><%=l(:label_watched_issues)%> (<%= Issue.visible.count(:include => :watchers,
|
||||
:conditions => ["#{Watcher.table_name}.user_id = ?", user.id]) %>)</h3>
|
||||
<% watched_issues = Issue.visible.find(:all,
|
||||
:include => [:status, :project, :tracker, :watchers],
|
||||
:limit => 10,
|
||||
:conditions => ["#{Watcher.table_name}.user_id = ?", user.id],
|
||||
:order => "#{Issue.table_name}.updated_on DESC") %>
|
||||
|
||||
<%= render :partial => 'issues/list_simple', :locals => { :issues => watched_issues } %>
|
||||
<% if watched_issues.length > 0 %>
|
||||
<p class="small"><%= link_to l(:label_issue_view_all), :controller => 'issues',
|
||||
:action => 'index',
|
||||
:set_filter => 1,
|
||||
:watcher_id => 'me',
|
||||
:sort => 'updated_on:desc' %></p>
|
||||
<% end %>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<h2><%= l(:label_query_new) %></h2>
|
||||
|
||||
<% form_tag({:action => 'new', :project_id => @query.project}, :onsubmit => 'selectAllOptions("selected_columns");') do %>
|
||||
<%= render :partial => 'form', :locals => {:query => @query} %>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
||||
<h2><%= l(:label_query_new) %></h2>
|
||||
|
||||
<% form_tag({:action => 'new', :project_id => @query.project}, :onsubmit => 'selectAllOptions("selected_columns");') do %>
|
||||
<%= render :partial => 'form', :locals => {:query => @query} %>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<h2><%= l(:label_statistics) %></h2>
|
||||
|
||||
<p>
|
||||
<%= tag("embed", :width => 800, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :graph => "commits_per_month")) %>
|
||||
</p>
|
||||
<p>
|
||||
<%= tag("embed", :width => 800, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :graph => "commits_per_author")) %>
|
||||
</p>
|
||||
|
||||
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>
|
||||
|
||||
<% html_title(l(:label_repository), l(:label_statistics)) -%>
|
||||
<h2><%= l(:label_statistics) %></h2>
|
||||
|
||||
<p>
|
||||
<%= tag("embed", :width => 800, :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :graph => "commits_per_month")) %>
|
||||
</p>
|
||||
<p>
|
||||
<%= tag("embed", :width => 800, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :graph => "commits_per_author")) %>
|
||||
</p>
|
||||
|
||||
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>
|
||||
|
||||
<% html_title(l(:label_repository), l(:label_statistics)) -%>
|
||||
|
||||
@@ -1,51 +1,51 @@
|
||||
<h2><%= l(:label_search) %></h2>
|
||||
|
||||
<div class="box">
|
||||
<% form_tag({}, :method => :get) do %>
|
||||
<p><%= text_field_tag 'q', @question, :size => 60, :id => 'search-input' %>
|
||||
<%= javascript_tag "Field.focus('search-input')" %>
|
||||
<%= project_select_tag %>
|
||||
<label><%= check_box_tag 'all_words', 1, @all_words %> <%= l(:label_all_words) %></label>
|
||||
<label><%= check_box_tag 'titles_only', 1, @titles_only %> <%= l(:label_search_titles_only) %></label>
|
||||
</p>
|
||||
<p>
|
||||
<% @object_types.each do |t| %>
|
||||
<label><%= check_box_tag t, 1, @scope.include?(t) %> <%= type_label(t) %></label>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<p><%= submit_tag l(:button_submit), :name => 'submit' %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if @results %>
|
||||
<div id="search-results-counts">
|
||||
<%= render_results_by_type(@results_by_type) unless @scope.size == 1 %>
|
||||
</div>
|
||||
|
||||
<h3><%= l(:label_result_plural) %> (<%= @results_by_type.values.sum %>)</h3>
|
||||
<dl id="search-results">
|
||||
<% @results.each do |e| %>
|
||||
<dt class="<%= e.event_type %>"><%= content_tag('span', h(e.project), :class => 'project') unless @project == e.project %> <%= link_to highlight_tokens(truncate(e.event_title, :length => 255), @tokens), e.event_url %></dt>
|
||||
<dd><span class="description"><%= highlight_tokens(e.event_description, @tokens) %></span>
|
||||
<span class="author"><%= format_time(e.event_datetime) %></span></dd>
|
||||
<% end %>
|
||||
</dl>
|
||||
<% end %>
|
||||
|
||||
<p><center>
|
||||
<% if @pagination_previous_date %>
|
||||
<%= link_to_remote ('« ' + l(:label_previous)),
|
||||
{:update => :content,
|
||||
:url => params.merge(:previous => 1, :offset => @pagination_previous_date.strftime("%Y%m%d%H%M%S"))
|
||||
}, :href => url_for(params.merge(:previous => 1, :offset => @pagination_previous_date.strftime("%Y%m%d%H%M%S"))) %>
|
||||
<% end %>
|
||||
<% if @pagination_next_date %>
|
||||
<%= link_to_remote (l(:label_next) + ' »'),
|
||||
{:update => :content,
|
||||
:url => params.merge(:previous => nil, :offset => @pagination_next_date.strftime("%Y%m%d%H%M%S"))
|
||||
}, :href => url_for(params.merge(:previous => nil, :offset => @pagination_next_date.strftime("%Y%m%d%H%M%S"))) %>
|
||||
<% end %>
|
||||
</center></p>
|
||||
|
||||
<% html_title(l(:label_search)) -%>
|
||||
<h2><%= l(:label_search) %></h2>
|
||||
|
||||
<div class="box">
|
||||
<% form_tag({}, :method => :get) do %>
|
||||
<p><%= text_field_tag 'q', @question, :size => 60, :id => 'search-input' %>
|
||||
<%= javascript_tag "Field.focus('search-input')" %>
|
||||
<%= project_select_tag %>
|
||||
<label><%= check_box_tag 'all_words', 1, @all_words %> <%= l(:label_all_words) %></label>
|
||||
<label><%= check_box_tag 'titles_only', 1, @titles_only %> <%= l(:label_search_titles_only) %></label>
|
||||
</p>
|
||||
<p>
|
||||
<% @object_types.each do |t| %>
|
||||
<label><%= check_box_tag t, 1, @scope.include?(t) %> <%= type_label(t) %></label>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<p><%= submit_tag l(:button_submit), :name => 'submit' %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if @results %>
|
||||
<div id="search-results-counts">
|
||||
<%= render_results_by_type(@results_by_type) unless @scope.size == 1 %>
|
||||
</div>
|
||||
|
||||
<h3><%= l(:label_result_plural) %> (<%= @results_by_type.values.sum %>)</h3>
|
||||
<dl id="search-results">
|
||||
<% @results.each do |e| %>
|
||||
<dt class="<%= e.event_type %>"><%= content_tag('span', h(e.project), :class => 'project') unless @project == e.project %> <%= link_to highlight_tokens(truncate(e.event_title, :length => 255), @tokens), e.event_url %></dt>
|
||||
<dd><span class="description"><%= highlight_tokens(e.event_description, @tokens) %></span>
|
||||
<span class="author"><%= format_time(e.event_datetime) %></span></dd>
|
||||
<% end %>
|
||||
</dl>
|
||||
<% end %>
|
||||
|
||||
<p><center>
|
||||
<% if @pagination_previous_date %>
|
||||
<%= link_to_remote ('« ' + l(:label_previous)),
|
||||
{:update => :content,
|
||||
:url => params.merge(:previous => 1, :offset => @pagination_previous_date.strftime("%Y%m%d%H%M%S"))
|
||||
}, :href => url_for(params.merge(:previous => 1, :offset => @pagination_previous_date.strftime("%Y%m%d%H%M%S"))) %>
|
||||
<% end %>
|
||||
<% if @pagination_next_date %>
|
||||
<%= link_to_remote (l(:label_next) + ' »'),
|
||||
{:update => :content,
|
||||
:url => params.merge(:previous => nil, :offset => @pagination_next_date.strftime("%Y%m%d%H%M%S"))
|
||||
}, :href => url_for(params.merge(:previous => nil, :offset => @pagination_next_date.strftime("%Y%m%d%H%M%S"))) %>
|
||||
<% end %>
|
||||
</center></p>
|
||||
|
||||
<% html_title(l(:label_search)) -%>
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
<div class="contextual">
|
||||
<%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :project_id => @project, :issue_id => @issue}, :class => 'icon icon-time-add' %>
|
||||
</div>
|
||||
|
||||
<%= render_timelog_breadcrumb %>
|
||||
|
||||
<h2><%= l(:label_spent_time) %></h2>
|
||||
|
||||
<% form_remote_tag( :url => {}, :html => {:method => :get, :id => 'query_form'}, :method => :get, :update => 'content' ) do %>
|
||||
<%# TOOD: remove the project_id and issue_id hidden fields, that information is
|
||||
already in the URI %>
|
||||
<%= hidden_field_tag('project_id', params[:project_id]) if @project %>
|
||||
<%= hidden_field_tag 'issue_id', params[:issue_id] if @issue %>
|
||||
<%= render :partial => 'date_range' %>
|
||||
<% end %>
|
||||
|
||||
<div class="total-hours">
|
||||
<p><%= l(:label_total) %>: <%= html_hours(l_hours(@total_hours)) %></p>
|
||||
</div>
|
||||
|
||||
<% unless @entries.empty? %>
|
||||
<%= render :partial => 'list', :locals => { :entries => @entries }%>
|
||||
<p class="pagination"><%= pagination_links_full @entry_pages, @entry_count %></p>
|
||||
|
||||
<% other_formats_links do |f| %>
|
||||
<%= f.link_to 'Atom', :url => params.merge({:issue_id => @issue, :key => User.current.rss_key}) %>
|
||||
<%= f.link_to 'CSV', :url => params %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% html_title l(:label_spent_time), l(:label_details) %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(:atom, {:issue_id => @issue, :format => 'atom', :key => User.current.rss_key}, :title => l(:label_spent_time)) %>
|
||||
<% end %>
|
||||
<div class="contextual">
|
||||
<%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :project_id => @project, :issue_id => @issue}, :class => 'icon icon-time-add' %>
|
||||
</div>
|
||||
|
||||
<%= render_timelog_breadcrumb %>
|
||||
|
||||
<h2><%= l(:label_spent_time) %></h2>
|
||||
|
||||
<% form_remote_tag( :url => {}, :html => {:method => :get, :id => 'query_form'}, :method => :get, :update => 'content' ) do %>
|
||||
<%# TOOD: remove the project_id and issue_id hidden fields, that information is
|
||||
already in the URI %>
|
||||
<%= hidden_field_tag('project_id', params[:project_id]) if @project %>
|
||||
<%= hidden_field_tag 'issue_id', params[:issue_id] if @issue %>
|
||||
<%= render :partial => 'date_range' %>
|
||||
<% end %>
|
||||
|
||||
<div class="total-hours">
|
||||
<p><%= l(:label_total) %>: <%= html_hours(l_hours(@total_hours)) %></p>
|
||||
</div>
|
||||
|
||||
<% unless @entries.empty? %>
|
||||
<%= render :partial => 'list', :locals => { :entries => @entries }%>
|
||||
<p class="pagination"><%= pagination_links_full @entry_pages, @entry_count %></p>
|
||||
|
||||
<% other_formats_links do |f| %>
|
||||
<%= f.link_to 'Atom', :url => params.merge({:issue_id => @issue, :key => User.current.rss_key}) %>
|
||||
<%= f.link_to 'CSV', :url => params %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% html_title l(:label_spent_time), l(:label_details) %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= auto_discovery_link_tag(:atom, {:issue_id => @issue, :format => 'atom', :key => User.current.rss_key}, :title => l(:label_spent_time)) %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<h2><%= l(:label_spent_time) %></h2>
|
||||
|
||||
<% labelled_tabular_form_for :time_entry, @time_entry, :url => {:action => 'edit', :id => @time_entry, :project_id => @time_entry.project} do |f| %>
|
||||
<%= error_messages_for 'time_entry' %>
|
||||
<%= back_url_hidden_field_tag %>
|
||||
|
||||
<div class="box">
|
||||
<p><%= f.text_field :issue_id, :size => 6 %> <em><%= h("#{@time_entry.issue.tracker.name} ##{@time_entry.issue.id}: #{@time_entry.issue.subject}") if @time_entry.issue %></em></p>
|
||||
<p><%= f.text_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
|
||||
<p><%= f.text_field :hours, :size => 6, :required => true %></p>
|
||||
<p><%= f.text_field :comments, :size => 100 %></p>
|
||||
<p><%= f.select :activity_id, activity_collection_for_select_options, :required => true %></p>
|
||||
<% @time_entry.custom_field_values.each do |value| %>
|
||||
<p><%= custom_field_tag_with_label :time_entry, value %></p>
|
||||
<% end %>
|
||||
<%= call_hook(:view_timelog_edit_form_bottom, { :time_entry => @time_entry, :form => f }) %>
|
||||
</div>
|
||||
|
||||
<%= submit_tag l(:button_save) %>
|
||||
|
||||
<% end %>
|
||||
<h2><%= l(:label_spent_time) %></h2>
|
||||
|
||||
<% labelled_tabular_form_for :time_entry, @time_entry, :url => {:action => 'edit', :id => @time_entry, :project_id => @time_entry.project} do |f| %>
|
||||
<%= error_messages_for 'time_entry' %>
|
||||
<%= back_url_hidden_field_tag %>
|
||||
|
||||
<div class="box">
|
||||
<p><%= f.text_field :issue_id, :size => 6 %> <em><%= h("#{@time_entry.issue.tracker.name} ##{@time_entry.issue.id}: #{@time_entry.issue.subject}") if @time_entry.issue %></em></p>
|
||||
<p><%= f.text_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
|
||||
<p><%= f.text_field :hours, :size => 6, :required => true %></p>
|
||||
<p><%= f.text_field :comments, :size => 100 %></p>
|
||||
<p><%= f.select :activity_id, activity_collection_for_select_options, :required => true %></p>
|
||||
<% @time_entry.custom_field_values.each do |value| %>
|
||||
<p><%= custom_field_tag_with_label :time_entry, value %></p>
|
||||
<% end %>
|
||||
<%= call_hook(:view_timelog_edit_form_bottom, { :time_entry => @time_entry, :form => f }) %>
|
||||
</div>
|
||||
|
||||
<%= submit_tag l(:button_save) %>
|
||||
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user