@@ -0,0 +1,1 | |||
|
1 | default directory for uploaded files No newline at end of file |
@@ -1,68 +1,70 | |||
|
1 | 1 | # redMine - project management software |
|
2 | 2 | # Copyright (C) 2006 Jean-Philippe Lang |
|
3 | 3 | # |
|
4 | 4 | # This program is free software; you can redistribute it and/or |
|
5 | 5 | # modify it under the terms of the GNU General Public License |
|
6 | 6 | # as published by the Free Software Foundation; either version 2 |
|
7 | 7 | # of the License, or (at your option) any later version. |
|
8 | 8 | # |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 | 13 | # |
|
14 | 14 | # You should have received a copy of the GNU General Public License |
|
15 | 15 | # along with this program; if not, write to the Free Software |
|
16 | 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
17 | 17 | |
|
18 | 18 | module CustomFieldsHelper |
|
19 | 19 | |
|
20 | 20 | # Return custom field html tag corresponding to its format |
|
21 | 21 | def custom_field_tag(custom_value) |
|
22 | 22 | custom_field = custom_value.custom_field |
|
23 | 23 | field_name = "custom_fields[#{custom_field.id}]" |
|
24 | 24 | field_id = "custom_fields_#{custom_field.id}" |
|
25 | 25 | |
|
26 | 26 | case custom_field.field_format |
|
27 | 27 | when "string", "int" |
|
28 | 28 | text_field 'custom_value', 'value', :name => field_name, :id => field_id |
|
29 | 29 | when "date" |
|
30 | 30 | text_field('custom_value', 'value', :name => field_name, :id => field_id, :size => 10) + |
|
31 | 31 | calendar_for(field_id) |
|
32 | 32 | when "text" |
|
33 | 33 | text_area 'custom_value', 'value', :name => field_name, :id => field_id, :cols => 60, :rows => 3 |
|
34 | 34 | when "bool" |
|
35 | 35 | check_box 'custom_value', 'value', :name => field_name, :id => field_id |
|
36 | 36 | when "list" |
|
37 | 37 | select 'custom_value', 'value', custom_field.possible_values.split('|'), { :include_blank => true }, :name => field_name, :id => field_id |
|
38 | 38 | end |
|
39 | 39 | end |
|
40 | 40 | |
|
41 | 41 | # Return custom field label tag |
|
42 | 42 | def custom_field_label_tag(custom_value) |
|
43 | 43 | content_tag "label", custom_value.custom_field.name + |
|
44 | 44 | (custom_value.custom_field.is_required? ? " <span class=\"required\">*</span>" : ""), |
|
45 | 45 | :for => "custom_fields_#{custom_value.custom_field.id}", |
|
46 | 46 | :class => (custom_value.errors.empty? ? nil : "error" ) |
|
47 | 47 | end |
|
48 | 48 | |
|
49 | 49 | # Return custom field tag with its label tag |
|
50 | 50 | def custom_field_tag_with_label(custom_value) |
|
51 | 51 | custom_field_label_tag(custom_value) + custom_field_tag(custom_value) |
|
52 | 52 | end |
|
53 | 53 | |
|
54 | 54 | # Return a string used to display a custom value |
|
55 | 55 | def show_value(custom_value) |
|
56 | 56 | case custom_value.custom_field.field_format |
|
57 | when "date" | |
|
58 | format_date(custom_value.value.to_date) | |
|
57 | 59 | when "bool" |
|
58 | 60 | l_YesNo(custom_value.value == "1") |
|
59 | 61 | else |
|
60 | 62 | custom_value.value |
|
61 | 63 | end |
|
62 | 64 | end |
|
63 | 65 | |
|
64 | 66 | # Return an array of custom field formats which can be used in select_tag |
|
65 | 67 | def custom_field_formats_for_select |
|
66 | 68 | CustomField::FIELD_FORMATS.keys.collect { |k| [ l(CustomField::FIELD_FORMATS[k]), k ] } |
|
67 | 69 | end |
|
68 | 70 | end |
@@ -1,115 +1,119 | |||
|
1 | 1 | # redMine - project management software |
|
2 | 2 | # Copyright (C) 2006 Jean-Philippe Lang |
|
3 | 3 | # |
|
4 | 4 | # This program is free software; you can redistribute it and/or |
|
5 | 5 | # modify it under the terms of the GNU General Public License |
|
6 | 6 | # as published by the Free Software Foundation; either version 2 |
|
7 | 7 | # of the License, or (at your option) any later version. |
|
8 | 8 | # |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 | 13 | # |
|
14 | 14 | # You should have received a copy of the GNU General Public License |
|
15 | 15 | # along with this program; if not, write to the Free Software |
|
16 | 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
17 | 17 | |
|
18 | 18 | require "digest/sha1" |
|
19 | 19 | |
|
20 | 20 | class User < ActiveRecord::Base |
|
21 | 21 | has_many :memberships, :class_name => 'Member', :include => [ :project, :role ], :dependent => true |
|
22 | 22 | has_many :custom_values, :dependent => true, :as => :customized |
|
23 | 23 | belongs_to :auth_source |
|
24 | 24 | |
|
25 | 25 | attr_accessor :password, :password_confirmation |
|
26 | 26 | attr_accessor :last_before_login_on |
|
27 | 27 | # Prevents unauthorized assignments |
|
28 | 28 | attr_protected :login, :admin, :password, :password_confirmation, :hashed_password |
|
29 | 29 | |
|
30 | 30 | validates_presence_of :login, :firstname, :lastname, :mail |
|
31 | 31 | validates_uniqueness_of :login, :mail |
|
32 | 32 | # Login must contain lettres, numbers, underscores only |
|
33 | 33 | validates_format_of :login, :with => /^[a-z0-9_]+$/i |
|
34 | 34 | validates_format_of :mail, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i |
|
35 | 35 | # Password length between 4 and 12 |
|
36 | 36 | validates_length_of :password, :in => 4..12, :allow_nil => true |
|
37 | 37 | validates_confirmation_of :password, :allow_nil => true |
|
38 | 38 | validates_associated :custom_values, :on => :update |
|
39 | 39 | |
|
40 | 40 | # Account statuses |
|
41 | 41 | STATUS_ACTIVE = 1 |
|
42 | 42 | STATUS_REGISTERED = 2 |
|
43 | 43 | STATUS_LOCKED = 3 |
|
44 | 44 | |
|
45 | 45 | def before_save |
|
46 | 46 | # update hashed_password if password was set |
|
47 | 47 | self.hashed_password = User.hash_password(self.password) if self.password |
|
48 | 48 | end |
|
49 | 49 | |
|
50 | 50 | # Returns the user that matches provided login and password, or nil |
|
51 | 51 | def self.try_to_login(login, password) |
|
52 | 52 | user = find(:first, :conditions => ["login=?", login]) |
|
53 | 53 | if user |
|
54 | 54 | # user is already in local database |
|
55 | 55 | return nil if !user.active? |
|
56 | 56 | if user.auth_source |
|
57 | 57 | # user has an external authentication method |
|
58 | 58 | return nil unless user.auth_source.authenticate(login, password) |
|
59 | 59 | else |
|
60 | 60 | # authentication with local password |
|
61 | 61 | return nil unless User.hash_password(password) == user.hashed_password |
|
62 | 62 | end |
|
63 | 63 | else |
|
64 | 64 | # user is not yet registered, try to authenticate with available sources |
|
65 | 65 | attrs = AuthSource.authenticate(login, password) |
|
66 | 66 | if attrs |
|
67 | 67 | onthefly = new(*attrs) |
|
68 | 68 | onthefly.login = login |
|
69 | 69 | onthefly.language = $RDM_DEFAULT_LANG |
|
70 | 70 | if onthefly.save |
|
71 | 71 | user = find(:first, :conditions => ["login=?", login]) |
|
72 | 72 | logger.info("User '#{user.login}' created on the fly.") if logger |
|
73 | 73 | end |
|
74 | 74 | end |
|
75 | 75 | end |
|
76 | 76 | user.update_attribute(:last_login_on, Time.now) if user |
|
77 | 77 | user |
|
78 | 78 | |
|
79 | 79 | rescue => text |
|
80 | 80 | raise text |
|
81 | 81 | end |
|
82 | 82 | |
|
83 | 83 | # Return user's full name for display |
|
84 | 84 | def display_name |
|
85 | 85 | firstname + " " + lastname |
|
86 | 86 | end |
|
87 | 87 | |
|
88 | 88 | def active? |
|
89 | 89 | self.status == STATUS_ACTIVE |
|
90 | 90 | end |
|
91 | ||
|
91 | ||
|
92 | def registered? | |
|
93 | self.status == STATUS_REGISTERED | |
|
94 | end | |
|
95 | ||
|
92 | 96 | def locked? |
|
93 | 97 | self.status == STATUS_LOCKED |
|
94 | 98 | end |
|
95 | 99 | |
|
96 | 100 | def check_password?(clear_password) |
|
97 | 101 | User.hash_password(clear_password) == self.hashed_password |
|
98 | 102 | end |
|
99 | 103 | |
|
100 | 104 | def role_for_project(project_id) |
|
101 | 105 | @role_for_projects ||= |
|
102 | 106 | begin |
|
103 | 107 | roles = {} |
|
104 | 108 | self.memberships.each { |m| roles.store m.project_id, m.role_id } |
|
105 | 109 | roles |
|
106 | 110 | end |
|
107 | 111 | @role_for_projects[project_id] |
|
108 | 112 | end |
|
109 | 113 | |
|
110 | 114 | private |
|
111 | 115 | # Return password digest |
|
112 | 116 | def self.hash_password(clear_password) |
|
113 | 117 | Digest::SHA1.hexdigest(clear_password || "") |
|
114 | 118 | end |
|
115 | 119 | end |
@@ -1,137 +1,137 | |||
|
1 | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|
2 | 2 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
|
3 | 3 | <head> |
|
4 | 4 | <title><%= $RDM_HEADER_TITLE %></title> |
|
5 | 5 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
|
6 | 6 | <meta name="description" content="redMine" /> |
|
7 | 7 | <meta name="keywords" content="issue,bug,tracker" /> |
|
8 | 8 | <%= stylesheet_link_tag "application" %> |
|
9 | 9 | <%= stylesheet_link_tag "menu" %> |
|
10 | 10 | <%= stylesheet_link_tag "rails" %> |
|
11 | 11 | <%= javascript_include_tag :defaults %> |
|
12 | 12 | <%= javascript_include_tag 'menu' %> |
|
13 | 13 | <%= javascript_include_tag 'calendar/calendar' %> |
|
14 | 14 | <%= javascript_include_tag "calendar/lang/calendar-#{current_language}.js" %> |
|
15 | 15 | <%= javascript_include_tag 'calendar/calendar-setup' %> |
|
16 |
<%= stylesheet_link_tag 'calendar |
|
|
16 | <%= stylesheet_link_tag 'calendar' %> | |
|
17 | 17 | <script type='text/javascript'> |
|
18 | 18 | var menu_contenu=' \ |
|
19 | 19 | <div id="menuAdmin" class="menu" onmouseover="menuMouseover(event)"> \ |
|
20 | 20 | <a class="menuItem" href="\/admin\/projects" onmouseover="menuItemMouseover(event,\'menuProjects\');"><span class="menuItemText"><%=l(:label_project_plural)%><\/span><span class="menuItemArrow">▶<\/span><\/a> \ |
|
21 | 21 | <a class="menuItem" href="\/users" onmouseover="menuItemMouseover(event,\'menuUsers\');"><span class="menuItemText"><%=l(:label_user_plural)%><\/span><span class="menuItemArrow">▶<\/span><\/a> \ |
|
22 | 22 | <a class="menuItem" href="\/roles"><%=l(:label_role_and_permissions)%><\/a> \ |
|
23 | 23 | <a class="menuItem" href="\/trackers" onmouseover="menuItemMouseover(event,\'menuTrackers\');"><span class="menuItemText"><%=l(:label_tracker_plural)%><\/span><span class="menuItemArrow">▶<\/span><\/a> \ |
|
24 | 24 | <a class="menuItem" href="\/custom_fields"><%=l(:label_custom_field_plural)%><\/a> \ |
|
25 | 25 | <a class="menuItem" href="\/enumerations"><%=l(:label_enumerations)%><\/a> \ |
|
26 | 26 | <a class="menuItem" href="\/admin\/mail_options"><%=l(:field_mail_notification)%><\/a> \ |
|
27 | 27 | <a class="menuItem" href="\/auth_sources"><%=l(:label_authentication)%><\/a> \ |
|
28 | 28 | <a class="menuItem" href="\/admin\/info"><%=l(:label_information_plural)%><\/a> \ |
|
29 | 29 | <\/div> \ |
|
30 | 30 | <div id="menuTrackers" class="menu"> \ |
|
31 | 31 | <a class="menuItem" href="\/issue_statuses"><%=l(:label_issue_status_plural)%><\/a> \ |
|
32 | 32 | <a class="menuItem" href="\/roles\/workflow"><%=l(:label_workflow)%><\/a> \ |
|
33 | 33 | <\/div> \ |
|
34 | 34 | <div id="menuProjects" class="menu"><a class="menuItem" href="\/projects\/add"><%=l(:label_new)%><\/a><\/div> \ |
|
35 | 35 | <div id="menuUsers" class="menu"><a class="menuItem" href="\/users\/add"><%=l(:label_new)%><\/a><\/div> \ |
|
36 | 36 | \ |
|
37 | 37 | <% unless @project.nil? || @project.id.nil? %> \ |
|
38 | 38 | <div id="menuProject" class="menu" onmouseover="menuMouseover(event)"> \ |
|
39 | 39 | <%= link_to l(:label_issue_plural), {:controller => 'projects', :action => 'list_issues', :id => @project }, :class => "menuItem" %> \ |
|
40 | 40 | <%= link_to l(:label_report_plural), {:controller => 'reports', :action => 'issue_report', :id => @project }, :class => "menuItem" %> \ |
|
41 | 41 | <%= link_to l(:label_news_plural), {:controller => 'projects', :action => 'list_news', :id => @project }, :class => "menuItem" %> \ |
|
42 | 42 | <%= link_to l(:label_change_log), {:controller => 'projects', :action => 'changelog', :id => @project }, :class => "menuItem" %> \ |
|
43 | 43 | <%= link_to l(:label_document_plural), {:controller => 'projects', :action => 'list_documents', :id => @project }, :class => "menuItem" %> \ |
|
44 | 44 | <%= link_to l(:label_member_plural), {:controller => 'projects', :action => 'list_members', :id => @project }, :class => "menuItem" %> \ |
|
45 | 45 | <%= link_to l(:label_attachment_plural), {:controller => 'projects', :action => 'list_files', :id => @project }, :class => "menuItem" %> \ |
|
46 | 46 | <%= link_to_if_authorized l(:label_settings), {:controller => 'projects', :action => 'settings', :id => @project }, :class => "menuItem" %> \ |
|
47 | 47 | <\/div> \ |
|
48 | 48 | <% end %> \ |
|
49 | 49 | '; |
|
50 | 50 | </script> |
|
51 | 51 | |
|
52 | 52 | </head> |
|
53 | 53 | |
|
54 | 54 | <body> |
|
55 | 55 | <div id="container" > |
|
56 | 56 | |
|
57 | 57 | <div id="header"> |
|
58 | 58 | <div style="float: left;"> |
|
59 | 59 | <h1><%= $RDM_HEADER_TITLE %></h1> |
|
60 | 60 | <h2><%= $RDM_HEADER_SUBTITLE %></h2> |
|
61 | 61 | </div> |
|
62 | 62 | <div style="float: right; padding-right: 1em; padding-top: 0.2em;"> |
|
63 | 63 | <% if loggedin? %><small><%=l(:label_logged_as)%> <b><%= @logged_in_user.login %></b></small><% end %> |
|
64 | 64 | </div> |
|
65 | 65 | </div> |
|
66 | 66 | |
|
67 | 67 | <div id="navigation"> |
|
68 | 68 | <ul> |
|
69 | 69 | <li class="selected"><%= link_to l(:label_home), { :controller => '' }, :class => "picHome" %></li> |
|
70 | 70 | <li><%= link_to l(:label_my_page), { :controller => 'account', :action => 'my_page'}, :class => "picUserPage" %></li> |
|
71 | 71 | <li><%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => "picProject" %></li> |
|
72 | 72 | |
|
73 | 73 | <% unless @project.nil? || @project.id.nil? %> |
|
74 | 74 | <li><%= link_to @project.name, { :controller => 'projects', :action => 'show', :id => @project }, :class => "picProject", :onmouseover => "buttonMouseover(event, 'menuProject');" %></li> |
|
75 | 75 | <% end %> |
|
76 | 76 | |
|
77 | 77 | <% if loggedin? %> |
|
78 | 78 | <li><%= link_to l(:label_my_account), { :controller => 'account', :action => 'my_account' }, :class => "picUser" %></li> |
|
79 | 79 | <% end %> |
|
80 | 80 | |
|
81 | 81 | <% if admin_loggedin? %> |
|
82 | 82 | <li><%= link_to l(:label_administration), { :controller => 'admin' }, :class => "picAdmin", :onmouseover => "buttonMouseover(event, 'menuAdmin');" %></li> |
|
83 | 83 | <% end %> |
|
84 | 84 | |
|
85 | 85 | <li class="right"><%= link_to l(:label_help), { :controller => 'help', :ctrl => @params[:controller], :page => @params[:action] }, :target => "new", :class => "picHelp" %></li> |
|
86 | 86 | |
|
87 | 87 | <% if loggedin? %> |
|
88 | 88 | <li class="right"><%= link_to l(:label_logout), { :controller => 'account', :action => 'logout' }, :class => "picUser" %></li> |
|
89 | 89 | <% else %> |
|
90 | 90 | <li class="right"><%= link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => "picUser" %></li> |
|
91 | 91 | <% end %> |
|
92 | 92 | </ul> |
|
93 | 93 | </div> |
|
94 | 94 | <script type='text/javascript'>if(document.getElementById) {document.write(menu_contenu);}</script> |
|
95 | 95 | |
|
96 | 96 | <div id="subcontent"> |
|
97 | 97 | |
|
98 | 98 | <% unless @project.nil? || @project.id.nil? %> |
|
99 | 99 | <h2><%= @project.name %></h2> |
|
100 | 100 | <ul class="menublock"> |
|
101 | 101 | <li><%= link_to l(:label_overview), :controller => 'projects', :action => 'show', :id => @project %></li> |
|
102 | 102 | <li><%= link_to l(:label_issue_plural), :controller => 'projects', :action => 'list_issues', :id => @project %></li> |
|
103 | 103 | <li><%= link_to l(:label_report_plural), :controller => 'reports', :action => 'issue_report', :id => @project %></li> |
|
104 | 104 | <li><%= link_to l(:label_news_plural), :controller => 'projects', :action => 'list_news', :id => @project %></li> |
|
105 | 105 | <li><%= link_to l(:label_change_log), :controller => 'projects', :action => 'changelog', :id => @project %></li> |
|
106 | 106 | <li><%= link_to l(:label_document_plural), :controller => 'projects', :action => 'list_documents', :id => @project %></li> |
|
107 | 107 | <li><%= link_to l(:label_member_plural), :controller => 'projects', :action => 'list_members', :id => @project %></li> |
|
108 | 108 | <li><%= link_to l(:label_attachment_plural), :controller => 'projects', :action => 'list_files', :id => @project %></li> |
|
109 | 109 | <li><%= link_to_if_authorized l(:label_settings), :controller => 'projects', :action => 'settings', :id => @project %></li> |
|
110 | 110 | </ul> |
|
111 | 111 | <% end %> |
|
112 | 112 | |
|
113 | 113 | <% if loggedin? and @logged_in_user.memberships.length > 0 %> |
|
114 | 114 | <h2><%=l(:label_my_projects) %></h2> |
|
115 | 115 | <ul class="menublock"> |
|
116 | 116 | <% for membership in @logged_in_user.memberships %> |
|
117 | 117 | <li><%= link_to membership.project.name, :controller => 'projects', :action => 'show', :id => membership.project %></li> |
|
118 | 118 | <% end %> |
|
119 | 119 | </ul> |
|
120 | 120 | <% end %> |
|
121 | 121 | </div> |
|
122 | 122 | |
|
123 | 123 | <div id="content"> |
|
124 | 124 | <% if flash[:notice] %><p style="color: green"><%= flash[:notice] %></p><% end %> |
|
125 | 125 | <%= @content_for_layout %> |
|
126 | 126 | </div> |
|
127 | 127 | |
|
128 | 128 | <div id="footer"> |
|
129 | 129 | <p> |
|
130 | 130 | <%= auto_link $RDM_FOOTER_SIG %> | |
|
131 | 131 | <a href="http://redmine.org/" target="_new"><%= RDM_APP_NAME %></a> <%= RDM_APP_VERSION %> |
|
132 | 132 | </p> |
|
133 | 133 | </div> |
|
134 | 134 | |
|
135 | 135 | </div> |
|
136 | 136 | </body> |
|
137 | 137 | </html> No newline at end of file |
@@ -1,72 +1,72 | |||
|
1 | 1 | <h2><%=l(:label_overview)%></h2> |
|
2 | 2 | |
|
3 | 3 | <div class="splitcontentleft"> |
|
4 | 4 | <%= simple_format(auto_link(@project.description)) %> |
|
5 | 5 | <ul> |
|
6 | <li><%=l(:field_homepage)%>: <%= link_to @project.homepage, @project.homepage %></li> | |
|
6 | <% unless @project.homepage.empty? %><li><%=l(:field_homepage)%>: <%= link_to @project.homepage, @project.homepage %></li><% end %> | |
|
7 | 7 | <li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li> |
|
8 | 8 | <% for custom_value in @custom_values %> |
|
9 | 9 | <% if !custom_value.value.empty? %> |
|
10 |
<li><%= custom_value.custom_field.name%>: <%= custom_value |
|
|
10 | <li><%= custom_value.custom_field.name%>: <%= show_value(custom_value) %></li> | |
|
11 | 11 | <% end %> |
|
12 | 12 | <% end %> |
|
13 | 13 | </ul> |
|
14 | 14 | |
|
15 | 15 | <div class="box"> |
|
16 | 16 | <h3><%= image_tag "tracker" %> <%=l(:label_tracker_plural)%></h3> |
|
17 | 17 | <ul> |
|
18 | 18 | <% for tracker in @trackers %> |
|
19 | 19 | <li><%= link_to tracker.name, :controller => 'projects', :action => 'list_issues', :id => @project, |
|
20 | 20 | :set_filter => 1, |
|
21 | 21 | "tracker_id" => tracker.id %>: |
|
22 | 22 | <%= issue_count = Issue.count(:conditions => ["project_id=? and tracker_id=? and issue_statuses.is_closed=?", @project.id, tracker.id, false], :include => :status) %> |
|
23 | 23 | <%= lwr(:label_open_issues, issue_count) %> |
|
24 | 24 | </li> |
|
25 | 25 | <% end %> |
|
26 | 26 | </ul> |
|
27 | 27 | <% if authorize_for 'projects', 'add_issue' %> |
|
28 | 28 | » <%=l(:label_issue_new)%>: |
|
29 | 29 | <ul> |
|
30 | 30 | <% @trackers.each do |tracker| %> |
|
31 | 31 | <li><%= link_to tracker.name, :controller => 'projects', :action => 'add_issue', :id => @project, :tracker_id => tracker %></li> |
|
32 | 32 | <% end %> |
|
33 | 33 | </ul> |
|
34 | 34 | <% end %> |
|
35 | 35 | <center><small>[ <%= link_to l(:label_issue_view_all), :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 %> ]</small></center> |
|
36 | 36 | </div> |
|
37 | 37 | </div> |
|
38 | 38 | |
|
39 | 39 | <div class="splitcontentright"> |
|
40 | 40 | <div class="box"> |
|
41 | 41 | <h3><%= image_tag "users" %> <%=l(:label_member_plural)%></h3> |
|
42 | 42 | <% for member in @members %> |
|
43 | 43 | <%= link_to_user member.user %> (<%= member.role.name %>)<br /> |
|
44 | 44 | <% end %> |
|
45 | 45 | </div> |
|
46 | 46 | |
|
47 | 47 | <% if @subprojects %> |
|
48 | 48 | <div class="box"> |
|
49 | 49 | <h3><%= image_tag "projects" %> <%=l(:label_subproject_plural)%></h3> |
|
50 | 50 | <% for subproject in @subprojects %> |
|
51 | 51 | <%= link_to subproject.name, :action => 'show', :id => subproject %><br /> |
|
52 | 52 | <% end %> |
|
53 | 53 | </div> |
|
54 | 54 | <% end %> |
|
55 | 55 | |
|
56 | 56 | <div class="box"> |
|
57 | 57 | <h3><%=l(:label_news_latest)%></h3> |
|
58 | 58 | <% for news in @news %> |
|
59 | 59 | <p><b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small><br /> |
|
60 | 60 | <%= news.summary %> |
|
61 | 61 | <small>[<%= link_to l(:label_read), :controller => 'news', :action => 'show', :id => news %>]</small></p> |
|
62 | 62 | <hr /> |
|
63 | 63 | <% end %> |
|
64 | 64 | <center><small>[ <%= link_to l(:label_news_view_all), :controller => 'projects', :action => 'list_news', :id => @project %> ]</small></center> |
|
65 | 65 | </div> |
|
66 | 66 | </div> |
|
67 | 67 | |
|
68 | 68 | |
|
69 | 69 | |
|
70 | 70 | |
|
71 | 71 | |
|
72 | 72 |
@@ -1,46 +1,47 | |||
|
1 | 1 | <% if @statuses.empty? or rows.empty? %> |
|
2 | 2 | <p><i><%=l(:label_no_data)%></i></p> |
|
3 | 3 | <% else %> |
|
4 | 4 | <% col_width = 70 / (@statuses.length+3) %> |
|
5 | 5 | <table border="0" cellspacing="1" cellpadding="2" width="100%"> |
|
6 | 6 | <tr> |
|
7 | 7 | <td width="25%"></td> |
|
8 | 8 | <% for status in @statuses %> |
|
9 | 9 | <td align="center" width="<%= col_width %>%" bgcolor="#<%= status.html_color %>"><small><%= status.name %></small></td> |
|
10 | 10 | <% end %> |
|
11 | 11 | <td align="center" width="<%= col_width %>%"><strong><%=l(:label_open_issues_plural)%></strong></td> |
|
12 | 12 | <td align="center" width="<%= col_width %>%"><strong><%=l(:label_closed_issues_plural)%></strong></td> |
|
13 | 13 | <td align="center" width="<%= col_width %>%"><strong><%=l(:label_total)%></strong></td> |
|
14 | 14 | </tr> |
|
15 | 15 | |
|
16 | 16 | <% for row in rows %> |
|
17 | <tr style="background-color:#CEE1ED"> | |
|
17 | <tr class="<%= cycle("odd", "even") %>"> | |
|
18 | 18 | <td><%= link_to row.name, :controller => 'projects', :action => 'list_issues', :id => @project, |
|
19 | 19 | :set_filter => 1, |
|
20 | 20 | "#{field_name}" => row.id %></td> |
|
21 | 21 | <% for status in @statuses %> |
|
22 | 22 | <td align="center"><%= link_to (aggregate data, { field_name => row.id, "status_id" => status.id }), |
|
23 | 23 | :controller => 'projects', :action => 'list_issues', :id => @project, |
|
24 | 24 | :set_filter => 1, |
|
25 | 25 | "status_id" => status.id, |
|
26 | 26 | "#{field_name}" => row.id %></td> |
|
27 | 27 | <% end %> |
|
28 | 28 | <td align="center"><%= link_to (aggregate data, { field_name => row.id, "closed" => 0 }), |
|
29 | 29 | :controller => 'projects', :action => 'list_issues', :id => @project, |
|
30 | 30 | :set_filter => 1, |
|
31 | 31 | "#{field_name}" => row.id, |
|
32 | 32 | "status_id" => "O" %></td> |
|
33 | 33 | <td align="center"><%= link_to (aggregate data, { field_name => row.id, "closed" => 1 }), |
|
34 | 34 | :controller => 'projects', :action => 'list_issues', :id => @project, |
|
35 | 35 | :set_filter => 1, |
|
36 | 36 | "#{field_name}" => row.id, |
|
37 | 37 | "status_id" => "C" %></td> |
|
38 | 38 | <td align="center"><%= link_to (aggregate data, { field_name => row.id }), |
|
39 | 39 | :controller => 'projects', :action => 'list_issues', :id => @project, |
|
40 | 40 | :set_filter => 1, |
|
41 | 41 | "#{field_name}" => row.id, |
|
42 | 42 | "status_id" => "A" %></td> |
|
43 | 43 | <% end %> |
|
44 | 44 | </tr> |
|
45 | 45 | </table> |
|
46 |
<% end |
|
|
46 | <% end | |
|
47 | reset_cycle %> No newline at end of file |
@@ -1,70 +1,71 | |||
|
1 | 1 | <h2><%=l(:label_workflow)%></h2> |
|
2 | 2 | |
|
3 | 3 | <p><%=l(:text_workflow_edit)%>:</p> |
|
4 | 4 | |
|
5 | 5 | <%= start_form_tag ({:action => 'workflow'}, :method => 'get') %> |
|
6 | 6 | <div style="float:left;margin-right:10px;"> |
|
7 | 7 | <p><label for="role_id"><%=l(:label_role)%></label><br/> |
|
8 | 8 | <select id="role_id" name="role_id"> |
|
9 | 9 | <%= options_from_collection_for_select @roles, "id", "name", (@role.id unless @role.nil?) %> |
|
10 | 10 | </select></p> |
|
11 | 11 | </div> |
|
12 | 12 | |
|
13 | 13 | <div> |
|
14 | 14 | <p><label for="tracker_id"><%=l(:label_tracker)%></label><br/> |
|
15 | 15 | <select id="tracker_id" name="tracker_id"> |
|
16 | 16 | <%= options_from_collection_for_select @trackers, "id", "name", (@tracker.id unless @tracker.nil?) %> |
|
17 | 17 | </select> |
|
18 | 18 | |
|
19 | 19 | <%= submit_tag l(:button_edit) %> |
|
20 | 20 | </p> |
|
21 | 21 | </div> |
|
22 | 22 | <%= end_form_tag %> |
|
23 | 23 | |
|
24 | 24 | |
|
25 | 25 | |
|
26 | 26 | <% unless @tracker.nil? or @role.nil? %> |
|
27 | 27 | <div class="box"> |
|
28 | 28 | <%= form_tag ({:action => 'workflow', :role_id => @role, :tracker_id => @tracker }, :id => 'workflow_form' ) %> |
|
29 | 29 | <table> |
|
30 | 30 | <tr> |
|
31 | <td align="center"><strong><%=l(:label_current_status)%></strong></td> | |
|
31 | <td align="center" colspan="2"><strong><%=l(:label_current_status)%></strong></td> | |
|
32 | 32 | <td align="center" colspan="<%= @statuses.length %>"><strong><%=l(:label_new_statuses_allowed)%></strong></td> |
|
33 | 33 | </tr> |
|
34 | 34 | <tr> |
|
35 | <td></td> | |
|
35 | <td colspan="2"></td> | |
|
36 | 36 | <% for new_status in @statuses %> |
|
37 |
<td width=" |
|
|
37 | <td width="80" align="center"><%= new_status.name %></td> | |
|
38 | 38 | <% end %> |
|
39 | 39 | </tr> |
|
40 | 40 | |
|
41 | 41 | <% for old_status in @statuses %> |
|
42 | 42 | <tr> |
|
43 | <td width="20" align="center"><div style="background-color:#<%= old_status.html_color %>"> </div></td> | |
|
43 | 44 | <td><%= old_status.name %></td> |
|
44 | 45 | |
|
45 | 46 | <% for new_status in @statuses %> |
|
46 | 47 | <td align="center"> |
|
47 | 48 | |
|
48 | 49 | <input type="checkbox" |
|
49 | 50 | name="issue_status[<%= old_status.id %>][]" |
|
50 | 51 | value="<%= new_status.id %>" |
|
51 | 52 | <%if old_status.new_statuses_allowed_to(@role, @tracker).include? new_status%>checked="checked"<%end%> |
|
52 | 53 | <%if old_status==new_status%>disabled<%end%> |
|
53 | 54 | > |
|
54 | 55 | </td> |
|
55 | 56 | <% end %> |
|
56 | 57 | |
|
57 | 58 | </tr> |
|
58 | 59 | <% end %> |
|
59 | 60 | </table> |
|
60 | 61 | <br /> |
|
61 | 62 | <p> |
|
62 | 63 | <a href="javascript:checkAll('workflow_form', true)"><%=l(:button_check_all)%></a> | |
|
63 | 64 | <a href="javascript:checkAll('workflow_form', false)"><%=l(:button_uncheck_all)%></a> |
|
64 | 65 | </p> |
|
65 | 66 | <br /> |
|
66 | 67 | <%= submit_tag l(:button_save) %> |
|
67 | 68 | <%= end_form_tag %> |
|
68 | 69 | |
|
69 | 70 | <% end %> |
|
70 | 71 | </div> No newline at end of file |
@@ -1,46 +1,46 | |||
|
1 | 1 | <h2><%=l(:label_user_plural)%></h2> |
|
2 | 2 | |
|
3 | 3 | <table class="listTableContent"> |
|
4 | 4 | <tr class="ListHead"> |
|
5 | 5 | <%= sort_header_tag('login', :caption => l(:field_login)) %> |
|
6 | 6 | <%= sort_header_tag('firstname', :caption => l(:field_firstname)) %> |
|
7 | 7 | <%= sort_header_tag('lastname', :caption => l(:field_lastname)) %> |
|
8 | 8 | <th><%=l(:field_mail)%></th> |
|
9 | 9 | <%= sort_header_tag('admin', :caption => l(:field_admin)) %> |
|
10 | 10 | <%= sort_header_tag('status', :caption => l(:field_status)) %> |
|
11 | 11 | <%= sort_header_tag('created_on', :caption => l(:field_created_on)) %> |
|
12 | 12 | <%= sort_header_tag('last_login_on', :caption => l(:field_last_login_on)) %> |
|
13 | 13 | <th></th> |
|
14 | 14 | </tr> |
|
15 | 15 | <% for user in @users %> |
|
16 | 16 | <tr class="<%= cycle("odd", "even") %>"> |
|
17 | 17 | <td><%= link_to user.login, :action => 'edit', :id => user %></td> |
|
18 | 18 | <td><%= user.firstname %></td> |
|
19 | 19 | <td><%= user.lastname %></td> |
|
20 | 20 | <td><%= user.mail %></td> |
|
21 | 21 | <td align="center"><%= image_tag 'true' if user.admin? %></td> |
|
22 | <td align="center"><%= image_tag 'locked' if user.locked? %></td> | |
|
22 | <td align="center"><%= image_tag 'locked' if user.locked? %><%= image_tag 'user_new' if user.registered? %></td> | |
|
23 | 23 | <td align="center"><%= format_time(user.created_on) %></td> |
|
24 | 24 | <td align="center"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td> |
|
25 | 25 | <td align="center"> |
|
26 | 26 | <%= start_form_tag :action => 'edit', :id => user %> |
|
27 | 27 | <% if user.locked? %> |
|
28 | 28 | <%= hidden_field_tag 'user[status]', User::STATUS_ACTIVE %> |
|
29 | 29 | <%= submit_tag l(:button_unlock), :class => "button-small" %> |
|
30 | 30 | <% else %> |
|
31 | 31 | <%= hidden_field_tag 'user[status]', User::STATUS_LOCKED %> |
|
32 | 32 | <%= submit_tag l(:button_lock), :class => "button-small" %> |
|
33 | 33 | <% end %> |
|
34 | 34 | <%= end_form_tag %> |
|
35 | 35 | </td> |
|
36 | 36 | </tr> |
|
37 | 37 | <% end %> |
|
38 | 38 | </table> |
|
39 | 39 | |
|
40 | 40 | <p><%= pagination_links_full @user_pages %> |
|
41 | 41 | [ <%= @user_pages.current.first_item %> - <%= @user_pages.current.last_item %> / <%= @user_count %> ] |
|
42 | 42 | </p> |
|
43 | 43 | |
|
44 | 44 | <p> |
|
45 | 45 | <%= link_to '» ' + l(:label_user_new), :action => 'add' %> |
|
46 | 46 | </p> No newline at end of file |
@@ -1,232 +1,231 | |||
|
1 | 1 | /* The main calendar widget. DIV containing a table. */ |
|
2 | 2 | |
|
3 | 3 | div.calendar { position: relative; } |
|
4 | 4 | |
|
5 | 5 | .calendar, .calendar table { |
|
6 | 6 | border: 1px solid #556; |
|
7 | 7 | font-size: 11px; |
|
8 | 8 | color: #000; |
|
9 | 9 | cursor: default; |
|
10 |
background: # |
|
|
10 | background: #fafbfc; | |
|
11 | 11 | font-family: tahoma,verdana,sans-serif; |
|
12 | 12 | } |
|
13 | 13 | |
|
14 | 14 | /* Header part -- contains navigation buttons and day names. */ |
|
15 | 15 | |
|
16 | 16 | .calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ |
|
17 | 17 | text-align: center; /* They are the navigation buttons */ |
|
18 | 18 | padding: 2px; /* Make the buttons seem like they're pressing */ |
|
19 | 19 | } |
|
20 | 20 | |
|
21 | 21 | .calendar .nav { |
|
22 |
background: #77 |
|
|
22 | background: #467aa7 url(menuarrow.gif) no-repeat 100% 100%; | |
|
23 | 23 | } |
|
24 | 24 | |
|
25 | 25 | .calendar thead .title { /* This holds the current "month, year" */ |
|
26 | 26 | font-weight: bold; /* Pressing it will take you to the current date */ |
|
27 | 27 | text-align: center; |
|
28 | 28 | background: #fff; |
|
29 | 29 | color: #000; |
|
30 | 30 | padding: 2px; |
|
31 | 31 | } |
|
32 | 32 | |
|
33 | 33 | .calendar thead .headrow { /* Row <TR> containing navigation buttons */ |
|
34 |
background: #77 |
|
|
34 | background: #467aa7; | |
|
35 | 35 | color: #fff; |
|
36 | 36 | } |
|
37 | 37 | |
|
38 | 38 | .calendar thead .daynames { /* Row <TR> containing the day names */ |
|
39 | 39 | background: #bdf; |
|
40 | 40 | } |
|
41 | 41 | |
|
42 | 42 | .calendar thead .name { /* Cells <TD> containing the day names */ |
|
43 | 43 | border-bottom: 1px solid #556; |
|
44 | 44 | padding: 2px; |
|
45 | 45 | text-align: center; |
|
46 | 46 | color: #000; |
|
47 | 47 | } |
|
48 | 48 | |
|
49 | 49 | .calendar thead .weekend { /* How a weekend day name shows in header */ |
|
50 | 50 | color: #a66; |
|
51 | 51 | } |
|
52 | 52 | |
|
53 | 53 | .calendar thead .hilite { /* How do the buttons in header appear when hover */ |
|
54 |
background-color: # |
|
|
54 | background-color: #80b0da; | |
|
55 | 55 | color: #000; |
|
56 | border: 1px solid #04f; | |
|
57 | 56 | padding: 1px; |
|
58 | 57 | } |
|
59 | 58 | |
|
60 | 59 | .calendar thead .active { /* Active (pressed) buttons in header */ |
|
61 | 60 | background-color: #77c; |
|
62 | 61 | padding: 2px 0px 0px 2px; |
|
63 | 62 | } |
|
64 | 63 | |
|
65 | 64 | /* The body part -- contains all the days in month. */ |
|
66 | 65 | |
|
67 | 66 | .calendar tbody .day { /* Cells <TD> containing month days dates */ |
|
68 | 67 | width: 2em; |
|
69 | 68 | color: #456; |
|
70 | 69 | text-align: right; |
|
71 | 70 | padding: 2px 4px 2px 2px; |
|
72 | 71 | } |
|
73 | 72 | .calendar tbody .day.othermonth { |
|
74 | 73 | font-size: 80%; |
|
75 | 74 | color: #bbb; |
|
76 | 75 | } |
|
77 | 76 | .calendar tbody .day.othermonth.oweekend { |
|
78 | 77 | color: #fbb; |
|
79 | 78 | } |
|
80 | 79 | |
|
81 | 80 | .calendar table .wn { |
|
82 | 81 | padding: 2px 3px 2px 2px; |
|
83 | 82 | border-right: 1px solid #000; |
|
84 | 83 | background: #bdf; |
|
85 | 84 | } |
|
86 | 85 | |
|
87 | 86 | .calendar tbody .rowhilite td { |
|
88 | 87 | background: #def; |
|
89 | 88 | } |
|
90 | 89 | |
|
91 | 90 | .calendar tbody .rowhilite td.wn { |
|
92 |
background: # |
|
|
91 | background: #80b0da; | |
|
93 | 92 | } |
|
94 | 93 | |
|
95 | 94 | .calendar tbody td.hilite { /* Hovered cells <TD> */ |
|
96 |
background: # |
|
|
95 | background: #80b0da; | |
|
97 | 96 | padding: 1px 3px 1px 1px; |
|
98 | 97 | border: 1px solid #bbb; |
|
99 | 98 | } |
|
100 | 99 | |
|
101 | 100 | .calendar tbody td.active { /* Active (pressed) cells <TD> */ |
|
102 | 101 | background: #cde; |
|
103 | 102 | padding: 2px 2px 0px 2px; |
|
104 | 103 | } |
|
105 | 104 | |
|
106 | 105 | .calendar tbody td.selected { /* Cell showing today date */ |
|
107 | 106 | font-weight: bold; |
|
108 | 107 | border: 1px solid #000; |
|
109 | 108 | padding: 1px 3px 1px 1px; |
|
110 | 109 | background: #fff; |
|
111 | 110 | color: #000; |
|
112 | 111 | } |
|
113 | 112 | |
|
114 | 113 | .calendar tbody td.weekend { /* Cells showing weekend days */ |
|
115 | 114 | color: #a66; |
|
116 | 115 | } |
|
117 | 116 | |
|
118 | 117 | .calendar tbody td.today { /* Cell showing selected date */ |
|
119 | 118 | font-weight: bold; |
|
120 | 119 | color: #f00; |
|
121 | 120 | } |
|
122 | 121 | |
|
123 | 122 | .calendar tbody .disabled { color: #999; } |
|
124 | 123 | |
|
125 | 124 | .calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ |
|
126 | 125 | visibility: hidden; |
|
127 | 126 | } |
|
128 | 127 | |
|
129 | 128 | .calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ |
|
130 | 129 | display: none; |
|
131 | 130 | } |
|
132 | 131 | |
|
133 | 132 | /* The footer part -- status bar and "Close" button */ |
|
134 | 133 | |
|
135 | 134 | .calendar tfoot .footrow { /* The <TR> in footer (only one right now) */ |
|
136 | 135 | text-align: center; |
|
137 | 136 | background: #556; |
|
138 | 137 | color: #fff; |
|
139 | 138 | } |
|
140 | 139 | |
|
141 | 140 | .calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */ |
|
142 | 141 | background: #fff; |
|
143 | 142 | color: #445; |
|
144 | 143 | border-top: 1px solid #556; |
|
145 | 144 | padding: 1px; |
|
146 | 145 | } |
|
147 | 146 | |
|
148 | 147 | .calendar tfoot .hilite { /* Hover style for buttons in footer */ |
|
149 | 148 | background: #aaf; |
|
150 | 149 | border: 1px solid #04f; |
|
151 | 150 | color: #000; |
|
152 | 151 | padding: 1px; |
|
153 | 152 | } |
|
154 | 153 | |
|
155 | 154 | .calendar tfoot .active { /* Active (pressed) style for buttons in footer */ |
|
156 | 155 | background: #77c; |
|
157 | 156 | padding: 2px 0px 0px 2px; |
|
158 | 157 | } |
|
159 | 158 | |
|
160 | 159 | /* Combo boxes (menus that display months/years for direct selection) */ |
|
161 | 160 | |
|
162 | 161 | .calendar .combo { |
|
163 | 162 | position: absolute; |
|
164 | 163 | display: none; |
|
165 | 164 | top: 0px; |
|
166 | 165 | left: 0px; |
|
167 | 166 | width: 4em; |
|
168 | 167 | cursor: default; |
|
169 | 168 | border: 1px solid #655; |
|
170 | 169 | background: #def; |
|
171 | 170 | color: #000; |
|
172 | 171 | font-size: 90%; |
|
173 | 172 | z-index: 100; |
|
174 | 173 | } |
|
175 | 174 | |
|
176 | 175 | .calendar .combo .label, |
|
177 | 176 | .calendar .combo .label-IEfix { |
|
178 | 177 | text-align: center; |
|
179 | 178 | padding: 1px; |
|
180 | 179 | } |
|
181 | 180 | |
|
182 | 181 | .calendar .combo .label-IEfix { |
|
183 | 182 | width: 4em; |
|
184 | 183 | } |
|
185 | 184 | |
|
186 | 185 | .calendar .combo .hilite { |
|
187 | 186 | background: #acf; |
|
188 | 187 | } |
|
189 | 188 | |
|
190 | 189 | .calendar .combo .active { |
|
191 | 190 | border-top: 1px solid #46a; |
|
192 | 191 | border-bottom: 1px solid #46a; |
|
193 | 192 | background: #eef; |
|
194 | 193 | font-weight: bold; |
|
195 | 194 | } |
|
196 | 195 | |
|
197 | 196 | .calendar td.time { |
|
198 | 197 | border-top: 1px solid #000; |
|
199 | 198 | padding: 1px 0px; |
|
200 | 199 | text-align: center; |
|
201 | 200 | background-color: #f4f0e8; |
|
202 | 201 | } |
|
203 | 202 | |
|
204 | 203 | .calendar td.time .hour, |
|
205 | 204 | .calendar td.time .minute, |
|
206 | 205 | .calendar td.time .ampm { |
|
207 | 206 | padding: 0px 3px 0px 4px; |
|
208 | 207 | border: 1px solid #889; |
|
209 | 208 | font-weight: bold; |
|
210 | 209 | background-color: #fff; |
|
211 | 210 | } |
|
212 | 211 | |
|
213 | 212 | .calendar td.time .ampm { |
|
214 | 213 | text-align: center; |
|
215 | 214 | } |
|
216 | 215 | |
|
217 | 216 | .calendar td.time .colon { |
|
218 | 217 | padding: 0px 2px 0px 3px; |
|
219 | 218 | font-weight: bold; |
|
220 | 219 | } |
|
221 | 220 | |
|
222 | 221 | .calendar td.time span.hilite { |
|
223 | 222 | border-color: #000; |
|
224 | 223 | background-color: #667; |
|
225 | 224 | color: #fff; |
|
226 | 225 | } |
|
227 | 226 | |
|
228 | 227 | .calendar td.time span.active { |
|
229 | 228 | border-color: #f00; |
|
230 | 229 | background-color: #000; |
|
231 | 230 | color: #0f0; |
|
232 | 231 | } |
General Comments 0
You need to be logged in to leave comments.
Login now