Revision 912:5e80956cc792 .svn/pristine/0c
| .svn/pristine/0c/0c07ac7fadf7713b8982de217779de9a2084825c.svn-base | ||
|---|---|---|
| 1 |
# Redmine - project management software |
|
| 2 |
# Copyright (C) 2006-2011 Jean-Philippe Lang |
|
| 3 |
# |
|
| 4 |
# This program is free software; you can redistribute it and/or |
|
| 5 |
# modify it under the terms of the GNU General Public License |
|
| 6 |
# as published by the Free Software Foundation; either version 2 |
|
| 7 |
# of the License, or (at your option) any later version. |
|
| 8 |
# |
|
| 9 |
# This program is distributed in the hope that it will be useful, |
|
| 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 12 |
# GNU General Public License for more details. |
|
| 13 |
# |
|
| 14 |
# You should have received a copy of the GNU General Public License |
|
| 15 |
# along with this program; if not, write to the Free Software |
|
| 16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
| 17 |
|
|
| 18 |
class Group < Principal |
|
| 19 |
has_and_belongs_to_many :users, :after_add => :user_added, |
|
| 20 |
:after_remove => :user_removed |
|
| 21 |
|
|
| 22 |
acts_as_customizable |
|
| 23 |
|
|
| 24 |
validates_presence_of :lastname |
|
| 25 |
validates_uniqueness_of :lastname, :case_sensitive => false |
|
| 26 |
validates_length_of :lastname, :maximum => 30 |
|
| 27 |
|
|
| 28 |
before_destroy :remove_references_before_destroy |
|
| 29 |
|
|
| 30 |
def to_s |
|
| 31 |
lastname.to_s |
|
| 32 |
end |
|
| 33 |
|
|
| 34 |
alias :name :to_s |
|
| 35 |
|
|
| 36 |
def user_added(user) |
|
| 37 |
members.each do |member| |
|
| 38 |
next if member.project.nil? |
|
| 39 |
user_member = Member.find_by_project_id_and_user_id(member.project_id, user.id) || Member.new(:project_id => member.project_id, :user_id => user.id) |
|
| 40 |
member.member_roles.each do |member_role| |
|
| 41 |
user_member.member_roles << MemberRole.new(:role => member_role.role, :inherited_from => member_role.id) |
|
| 42 |
end |
|
| 43 |
user_member.save! |
|
| 44 |
end |
|
| 45 |
end |
|
| 46 |
|
|
| 47 |
def user_removed(user) |
|
| 48 |
members.each do |member| |
|
| 49 |
MemberRole.find(:all, :include => :member, |
|
| 50 |
:conditions => ["#{Member.table_name}.user_id = ? AND #{MemberRole.table_name}.inherited_from IN (?)", user.id, member.member_role_ids]).each(&:destroy)
|
|
| 51 |
end |
|
| 52 |
end |
|
| 53 |
|
|
| 54 |
def self.human_attribute_name(attribute_key_name) |
|
| 55 |
attr_name = attribute_key_name |
|
| 56 |
if attr_name == 'lastname' |
|
| 57 |
attr_name = "name" |
|
| 58 |
end |
|
| 59 |
super(attr_name) |
|
| 60 |
end |
|
| 61 |
|
|
| 62 |
private |
|
| 63 |
|
|
| 64 |
# Removes references that are not handled by associations |
|
| 65 |
def remove_references_before_destroy |
|
| 66 |
return if self.id.nil? |
|
| 67 |
|
|
| 68 |
Issue.update_all 'assigned_to_id = NULL', ['assigned_to_id = ?', id] |
|
| 69 |
end |
|
| 70 |
end |
|
| .svn/pristine/0c/0c29497a56078e0463be76e7192d98e2c38a77c5.svn-base | ||
|---|---|---|
| 1 |
// Translated by: Alexandre da Silva <simpsomboy@gmail.com> |
|
| 2 |
|
|
| 3 |
jsToolBar.strings = {};
|
|
| 4 |
jsToolBar.strings['Strong'] = 'Negrito'; |
|
| 5 |
jsToolBar.strings['Italic'] = 'Itálico'; |
|
| 6 |
jsToolBar.strings['Underline'] = 'Sublinhado'; |
|
| 7 |
jsToolBar.strings['Deleted'] = 'Excluído'; |
|
| 8 |
jsToolBar.strings['Code'] = 'Código Inline'; |
|
| 9 |
jsToolBar.strings['Heading 1'] = 'Cabeçalho 1'; |
|
| 10 |
jsToolBar.strings['Heading 2'] = 'Cabeçalho 2'; |
|
| 11 |
jsToolBar.strings['Heading 3'] = 'Cabeçalho 3'; |
|
| 12 |
jsToolBar.strings['Unordered list'] = 'Lista não ordenada'; |
|
| 13 |
jsToolBar.strings['Ordered list'] = 'Lista ordenada'; |
|
| 14 |
jsToolBar.strings['Quote'] = 'Quote'; |
|
| 15 |
jsToolBar.strings['Unquote'] = 'Remove Quote'; |
|
| 16 |
jsToolBar.strings['Preformatted text'] = 'Texto pré-formatado'; |
|
| 17 |
jsToolBar.strings['Wiki link'] = 'Link para uma página Wiki'; |
|
| 18 |
jsToolBar.strings['Image'] = 'Imagem'; |
|
| .svn/pristine/0c/0c3d44b905a542240e7c616a63f74580e8cbbb9d.svn-base | ||
|---|---|---|
| 1 |
<% diff = Redmine::UnifiedDiff.new( |
|
| 2 |
diff, :type => diff_type, |
|
| 3 |
:max_lines => Setting.diff_max_lines_displayed.to_i) -%> |
|
| 4 |
|
|
| 5 |
<% diff.each do |table_file| -%> |
|
| 6 |
<div class="autoscroll"> |
|
| 7 |
<% if diff.diff_type == 'sbs' -%> |
|
| 8 |
<table class="filecontent"> |
|
| 9 |
<thead> |
|
| 10 |
<tr> |
|
| 11 |
<th colspan="4" class="filename"> |
|
| 12 |
<%= h(Redmine::CodesetUtil.to_utf8_by_setting(table_file.file_name)) %> |
|
| 13 |
</th> |
|
| 14 |
</tr> |
|
| 15 |
</thead> |
|
| 16 |
<tbody> |
|
| 17 |
<% table_file.each_line do |spacing, line| -%> |
|
| 18 |
<% if spacing -%> |
|
| 19 |
<tr class="spacing"> |
|
| 20 |
<th class="line-num">...</th><td></td><th class="line-num">...</th><td></td> |
|
| 21 |
</tr> |
|
| 22 |
<% end -%> |
|
| 23 |
<tr> |
|
| 24 |
<th class="line-num"><%= line.nb_line_left %></th> |
|
| 25 |
<td class="line-code <%= line.type_diff_left %>"> |
|
| 26 |
<pre><%= Redmine::CodesetUtil.to_utf8_by_setting(line.html_line_left) %></pre> |
|
| 27 |
</td> |
|
| 28 |
<th class="line-num"><%= line.nb_line_right %></th> |
|
| 29 |
<td class="line-code <%= line.type_diff_right %>"> |
|
| 30 |
<pre><%= Redmine::CodesetUtil.to_utf8_by_setting(line.html_line_right) %></pre> |
|
| 31 |
</td> |
|
| 32 |
</tr> |
|
| 33 |
<% end -%> |
|
| 34 |
</tbody> |
|
| 35 |
</table> |
|
| 36 |
|
|
| 37 |
<% else -%> |
|
| 38 |
<table class="filecontent"> |
|
| 39 |
<thead> |
|
| 40 |
<tr> |
|
| 41 |
<th colspan="3" class="filename"> |
|
| 42 |
<%= h(Redmine::CodesetUtil.to_utf8_by_setting(table_file.file_name)) %> |
|
| 43 |
</th> |
|
| 44 |
</tr> |
|
| 45 |
</thead> |
|
| 46 |
<tbody> |
|
| 47 |
<% table_file.each_line do |spacing, line| %> |
|
| 48 |
<% if spacing -%> |
|
| 49 |
<tr class="spacing"> |
|
| 50 |
<th class="line-num">...</th><th class="line-num">...</th><td></td> |
|
| 51 |
</tr> |
|
| 52 |
<% end -%> |
|
| 53 |
<tr> |
|
| 54 |
<th class="line-num"><%= line.nb_line_left %></th> |
|
| 55 |
<th class="line-num"><%= line.nb_line_right %></th> |
|
| 56 |
<td class="line-code <%= line.type_diff %>"> |
|
| 57 |
<pre><%= Redmine::CodesetUtil.to_utf8_by_setting(line.html_line) %></pre> |
|
| 58 |
</td> |
|
| 59 |
</tr> |
|
| 60 |
<% end -%> |
|
| 61 |
</tbody> |
|
| 62 |
</table> |
|
| 63 |
<% end -%> |
|
| 64 |
</div> |
|
| 65 |
<% end -%> |
|
| 66 |
|
|
| 67 |
<%= l(:text_diff_truncated) if diff.truncated? %> |
|
| .svn/pristine/0c/0c7edc475b37b33857cc262660c5a82535a455e8.svn-base | ||
|---|---|---|
| 1 |
--- |
|
| 2 |
versions_001: |
|
| 3 |
created_on: 2006-07-19 21:00:07 +02:00 |
|
| 4 |
name: "0.1" |
|
| 5 |
project_id: 1 |
|
| 6 |
updated_on: 2006-07-19 21:00:07 +02:00 |
|
| 7 |
id: 1 |
|
| 8 |
description: Beta |
|
| 9 |
effective_date: 2006-07-01 |
|
| 10 |
status: closed |
|
| 11 |
sharing: 'none' |
|
| 12 |
versions_002: |
|
| 13 |
created_on: 2006-07-19 21:00:33 +02:00 |
|
| 14 |
name: "1.0" |
|
| 15 |
project_id: 1 |
|
| 16 |
updated_on: 2006-07-19 21:00:33 +02:00 |
|
| 17 |
id: 2 |
|
| 18 |
description: Stable release |
|
| 19 |
effective_date: <%= 20.day.from_now.to_date.to_s(:db) %> |
|
| 20 |
status: locked |
|
| 21 |
sharing: 'none' |
|
| 22 |
versions_003: |
|
| 23 |
created_on: 2006-07-19 21:00:33 +02:00 |
|
| 24 |
name: "2.0" |
|
| 25 |
project_id: 1 |
|
| 26 |
updated_on: 2006-07-19 21:00:33 +02:00 |
|
| 27 |
id: 3 |
|
| 28 |
description: Future version |
|
| 29 |
effective_date: |
|
| 30 |
status: open |
|
| 31 |
sharing: 'none' |
|
| 32 |
versions_004: |
|
| 33 |
created_on: 2006-07-19 21:00:33 +02:00 |
|
| 34 |
name: "2.0" |
|
| 35 |
project_id: 3 |
|
| 36 |
updated_on: 2006-07-19 21:00:33 +02:00 |
|
| 37 |
id: 4 |
|
| 38 |
description: Future version on subproject |
|
| 39 |
effective_date: |
|
| 40 |
status: open |
|
| 41 |
sharing: 'tree' |
|
| 42 |
versions_005: |
|
| 43 |
created_on: 2006-07-19 21:00:07 +02:00 |
|
| 44 |
name: "Alpha" |
|
| 45 |
project_id: 2 |
|
| 46 |
updated_on: 2006-07-19 21:00:07 +02:00 |
|
| 47 |
id: 5 |
|
| 48 |
description: Private Alpha |
|
| 49 |
effective_date: 2006-07-01 |
|
| 50 |
status: open |
|
| 51 |
sharing: 'none' |
|
| 52 |
versions_006: |
|
| 53 |
created_on: 2006-07-19 21:00:07 +02:00 |
|
| 54 |
name: "Private Version of public subproject" |
|
| 55 |
project_id: 5 |
|
| 56 |
updated_on: 2006-07-19 21:00:07 +02:00 |
|
| 57 |
id: 6 |
|
| 58 |
description: "Should be done any day now..." |
|
| 59 |
effective_date: |
|
| 60 |
status: open |
|
| 61 |
sharing: 'tree' |
|
| 62 |
versions_007: |
|
| 63 |
created_on: 2006-07-19 21:00:07 +02:00 |
|
| 64 |
name: "Systemwide visible version" |
|
| 65 |
project_id: 2 |
|
| 66 |
updated_on: 2006-07-19 21:00:07 +02:00 |
|
| 67 |
id: 7 |
|
| 68 |
description: |
|
| 69 |
effective_date: |
|
| 70 |
status: open |
|
| 71 |
sharing: 'system' |
|
| .svn/pristine/0c/0cd8ee527e2f2ff13b3817238dc6eed2ab240c57.svn-base | ||
|---|---|---|
| 1 |
class <%= class_name %>Controller < ApplicationController |
|
| 2 |
unloadable |
|
| 3 |
|
|
| 4 |
<% actions.each do |action| -%> |
|
| 5 |
|
|
| 6 |
def <%= action %> |
|
| 7 |
end |
|
| 8 |
<% end -%> |
|
| 9 |
end |
|
Also available in: Unified diff