##// END OF EJS Templates
Merged r3249 to r3252 and r3254 from trunk....
Jean-Philippe Lang -
r3141:a23399f220b3
parent child
Show More
@@ -0,0 +1,16
1 class ChangeWikiContentsTextLimit < ActiveRecord::Migration
2 def self.up
3 # Migrates MySQL databases only
4 # Postgres would raise an error (see http://dev.rubyonrails.org/ticket/3818)
5 # Not fixed in Rails 2.3.5
6 if ActiveRecord::Base.connection.adapter_name =~ /mysql/i
7 max_size = 16.megabytes
8 change_column :wiki_contents, :text, :text, :limit => max_size
9 change_column :wiki_content_versions, :data, :binary, :limit => max_size
10 end
11 end
12
13 def self.down
14 # no-op
15 end
16 end
@@ -57,6 +57,14 class Member < ActiveRecord::Base
57 57 member_roles.detect {|mr| mr.inherited_from}.nil?
58 58 end
59 59
60 def include?(user)
61 if principal.is_a?(Group)
62 !user.nil? && user.groups.include?(principal)
63 else
64 self.user == user
65 end
66 end
67
60 68 def before_destroy
61 69 if user
62 70 # remove category based auto assignments for this member
@@ -30,6 +30,10 class MemberRole < ActiveRecord::Base
30 30 errors.add :role_id, :invalid if role && !role.member?
31 31 end
32 32
33 def inherited?
34 !inherited_from.nil?
35 end
36
33 37 private
34 38
35 39 def remove_member_if_empty
@@ -23,6 +23,7 class Project < ActiveRecord::Base
23 23 # Specific overidden Activities
24 24 has_many :time_entry_activities
25 25 has_many :members, :include => [:user, :roles], :conditions => "#{User.table_name}.type='User' AND #{User.table_name}.status=#{User::STATUS_ACTIVE}"
26 has_many :memberships, :class_name => 'Member'
26 27 has_many :member_principals, :class_name => 'Member',
27 28 :include => :principal,
28 29 :conditions => "#{Principal.table_name}.type='Group' OR (#{Principal.table_name}.type='User' AND #{Principal.table_name}.status=#{User::STATUS_ACTIVE})"
@@ -583,10 +584,14 class Project < ActiveRecord::Base
583 584
584 585 # Copies members from +project+
585 586 def copy_members(project)
586 project.members.each do |member|
587 project.memberships.each do |member|
587 588 new_member = Member.new
588 589 new_member.attributes = member.attributes.dup.except("id", "project_id", "created_on")
589 new_member.role_ids = member.role_ids.dup
590 # only copy non inherited roles
591 # inherited roles will be added when copying the group membership
592 role_ids = member.member_roles.reject(&:inherited?).collect(&:role_id)
593 next if role_ids.empty?
594 new_member.role_ids = role_ids
590 595 new_member.project = self
591 596 self.members << new_member
592 597 end
@@ -35,7 +35,8
35 35 <td class="buttons">
36 36 <%= link_to_function l(:button_edit), "$('member-#{member.id}-roles').hide(); $('member-#{member.id}-roles-form').show(); return false;", :class => 'icon icon-edit' %>
37 37 <%= link_to_remote(l(:button_delete), { :url => {:controller => 'members', :action => 'destroy', :id => member},
38 :method => :post
38 :method => :post,
39 :confirm => (!User.current.admin? && member.include?(User.current) ? l(:text_own_membership_delete_confirmation) : nil)
39 40 }, :title => l(:button_delete),
40 41 :class => 'icon icon-del') if member.deletable? %>
41 42 </td>
@@ -869,3 +869,6 bg:
869 869 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
870 870 permission_add_subprojects: Create subprojects
871 871 label_subproject_new: New subproject
872 text_own_membership_delete_confirmation: |-
873 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
874 Are you sure you want to continue?
@@ -893,3 +893,6 bs:
893 893 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
894 894 permission_add_subprojects: Create subprojects
895 895 label_subproject_new: New subproject
896 text_own_membership_delete_confirmation: |-
897 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
898 Are you sure you want to continue?
@@ -872,3 +872,6 ca:
872 872 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
873 873 permission_add_subprojects: Create subprojects
874 874 label_subproject_new: New subproject
875 text_own_membership_delete_confirmation: |-
876 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
877 Are you sure you want to continue?
@@ -875,3 +875,6 cs:
875 875 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
876 876 permission_add_subprojects: Create subprojects
877 877 label_subproject_new: New subproject
878 text_own_membership_delete_confirmation: |-
879 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
880 Are you sure you want to continue?
@@ -895,3 +895,6 da:
895 895 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
896 896 permission_add_subprojects: Create subprojects
897 897 label_subproject_new: New subproject
898 text_own_membership_delete_confirmation: |-
899 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
900 Are you sure you want to continue?
@@ -895,3 +895,6 de:
895 895 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
896 896 permission_add_subprojects: Create subprojects
897 897 label_subproject_new: New subproject
898 text_own_membership_delete_confirmation: |-
899 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
900 Are you sure you want to continue?
@@ -875,3 +875,6 el:
875 875 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
876 876 permission_add_subprojects: Create subprojects
877 877 label_subproject_new: New subproject
878 text_own_membership_delete_confirmation: |-
879 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
880 Are you sure you want to continue?
@@ -848,6 +848,7 en:
848 848 text_wiki_page_nullify_children: "Keep child pages as root pages"
849 849 text_wiki_page_destroy_children: "Delete child pages and all their descendants"
850 850 text_wiki_page_reassign_children: "Reassign child pages to this parent page"
851 text_own_membership_delete_confirmation: "You are about to remove some or all of your permissions and may no longer be able to edit this project after that.\nAre you sure you want to continue?"
851 852
852 853 default_role_manager: Manager
853 854 default_role_developper: Developer
@@ -919,3 +919,6 es:
919 919 setting_mail_handler_body_delimiters: Truncar correos tras una de estas líneas
920 920 permission_add_subprojects: Create subprojects
921 921 label_subproject_new: New subproject
922 text_own_membership_delete_confirmation: |-
923 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
924 Are you sure you want to continue?
@@ -905,3 +905,6 fi:
905 905 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
906 906 permission_add_subprojects: Create subprojects
907 907 label_subproject_new: New subproject
908 text_own_membership_delete_confirmation: |-
909 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
910 Are you sure you want to continue?
@@ -856,6 +856,7 fr:
856 856 text_wiki_page_nullify_children: "Conserver les sous-pages en tant que pages racines"
857 857 text_wiki_page_destroy_children: "Supprimer les sous-pages et toutes leurs descedantes"
858 858 text_wiki_page_reassign_children: "Réaffecter les sous-pages à cette page"
859 text_own_membership_delete_confirmation: "Vous allez supprimer tout ou partie de vos permissions sur ce projet et ne serez peut-être plus autorisé à modifier ce projet.\nEtes-vous sûr de vouloir continuer ?"
859 860
860 861 default_role_manager: Manager
861 862 default_role_developper: Développeur
@@ -895,3 +895,6 gl:
895 895 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
896 896 permission_add_subprojects: Create subprojects
897 897 label_subproject_new: New subproject
898 text_own_membership_delete_confirmation: |-
899 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
900 Are you sure you want to continue?
@@ -879,3 +879,6 he:
879 879 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
880 880 permission_add_subprojects: Create subprojects
881 881 label_subproject_new: New subproject
882 text_own_membership_delete_confirmation: |-
883 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
884 Are you sure you want to continue?
@@ -900,3 +900,6
900 900 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
901 901 permission_add_subprojects: Create subprojects
902 902 label_subproject_new: New subproject
903 text_own_membership_delete_confirmation: |-
904 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
905 Are you sure you want to continue?
@@ -887,3 +887,6 id:
887 887 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
888 888 permission_add_subprojects: Create subprojects
889 889 label_subproject_new: New subproject
890 text_own_membership_delete_confirmation: |-
891 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
892 Are you sure you want to continue?
@@ -882,3 +882,6 it:
882 882 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
883 883 permission_add_subprojects: Create subprojects
884 884 label_subproject_new: New subproject
885 text_own_membership_delete_confirmation: |-
886 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
887 Are you sure you want to continue?
@@ -904,3 +904,6 ja:
904 904 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
905 905 permission_add_subprojects: Create subprojects
906 906 label_subproject_new: New subproject
907 text_own_membership_delete_confirmation: |-
908 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
909 Are you sure you want to continue?
@@ -935,3 +935,6 ko:
935 935 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
936 936 permission_add_subprojects: Create subprojects
937 937 label_subproject_new: New subproject
938 text_own_membership_delete_confirmation: |-
939 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
940 Are you sure you want to continue?
@@ -943,3 +943,6 lt:
943 943 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
944 944 permission_add_subprojects: Create subprojects
945 945 label_subproject_new: New subproject
946 text_own_membership_delete_confirmation: |-
947 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
948 Are you sure you want to continue?
@@ -857,3 +857,6 nl:
857 857 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
858 858 permission_add_subprojects: Create subprojects
859 859 label_subproject_new: New subproject
860 text_own_membership_delete_confirmation: |-
861 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
862 Are you sure you want to continue?
@@ -870,3 +870,6
870 870 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
871 871 permission_add_subprojects: Create subprojects
872 872 label_subproject_new: New subproject
873 text_own_membership_delete_confirmation: |-
874 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
875 Are you sure you want to continue?
@@ -898,3 +898,6 pl:
898 898 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
899 899 permission_add_subprojects: Create subprojects
900 900 label_subproject_new: New subproject
901 text_own_membership_delete_confirmation: |-
902 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
903 Are you sure you want to continue?
@@ -902,3 +902,6 pt-BR:
902 902 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
903 903 permission_add_subprojects: Create subprojects
904 904 label_subproject_new: New subproject
905 text_own_membership_delete_confirmation: |-
906 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
907 Are you sure you want to continue?
@@ -887,3 +887,6 pt:
887 887 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
888 888 permission_add_subprojects: Create subprojects
889 889 label_subproject_new: New subproject
890 text_own_membership_delete_confirmation: |-
891 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
892 Are you sure you want to continue?
@@ -872,3 +872,6 ro:
872 872 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
873 873 permission_add_subprojects: Create subprojects
874 874 label_subproject_new: New subproject
875 text_own_membership_delete_confirmation: |-
876 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
877 Are you sure you want to continue?
@@ -983,3 +983,6 ru:
983 983 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
984 984 permission_add_subprojects: Create subprojects
985 985 label_subproject_new: New subproject
986 text_own_membership_delete_confirmation: |-
987 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
988 Are you sure you want to continue?
@@ -874,3 +874,6 sk:
874 874 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
875 875 permission_add_subprojects: Create subprojects
876 876 label_subproject_new: New subproject
877 text_own_membership_delete_confirmation: |-
878 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
879 Are you sure you want to continue?
@@ -871,3 +871,6 sl:
871 871 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
872 872 permission_add_subprojects: Create subprojects
873 873 label_subproject_new: New subproject
874 text_own_membership_delete_confirmation: |-
875 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
876 Are you sure you want to continue?
@@ -890,3 +890,6
890 890 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
891 891 permission_add_subprojects: Create subprojects
892 892 label_subproject_new: New subproject
893 text_own_membership_delete_confirmation: |-
894 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
895 Are you sure you want to continue?
@@ -925,3 +925,6 sv:
925 925 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
926 926 permission_add_subprojects: Create subprojects
927 927 label_subproject_new: New subproject
928 text_own_membership_delete_confirmation: |-
929 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
930 Are you sure you want to continue?
@@ -872,3 +872,6 th:
872 872 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
873 873 permission_add_subprojects: Create subprojects
874 874 label_subproject_new: New subproject
875 text_own_membership_delete_confirmation: |-
876 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
877 Are you sure you want to continue?
@@ -902,3 +902,6 tr:
902 902 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
903 903 permission_add_subprojects: Create subprojects
904 904 label_subproject_new: New subproject
905 text_own_membership_delete_confirmation: |-
906 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
907 Are you sure you want to continue?
@@ -871,3 +871,6 uk:
871 871 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
872 872 permission_add_subprojects: Create subprojects
873 873 label_subproject_new: New subproject
874 text_own_membership_delete_confirmation: |-
875 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
876 Are you sure you want to continue?
@@ -934,3 +934,6 vi:
934 934 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
935 935 permission_add_subprojects: Create subprojects
936 936 label_subproject_new: New subproject
937 text_own_membership_delete_confirmation: |-
938 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
939 Are you sure you want to continue?
@@ -968,3 +968,6
968 968 enumeration_system_activity: 系統活動
969 969 permission_add_subprojects: Create subprojects
970 970 label_subproject_new: New subproject
971 text_own_membership_delete_confirmation: |-
972 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
973 Are you sure you want to continue?
@@ -899,3 +899,6 zh:
899 899 setting_mail_handler_body_delimiters: Truncate emails after one of these lines
900 900 permission_add_subprojects: Create subprojects
901 901 label_subproject_new: New subproject
902 text_own_membership_delete_confirmation: |-
903 You are about to remove some or all of your permissions and may no longer be able to edit this project after that.
904 Are you sure you want to continue?
@@ -182,7 +182,7 module Redmine
182 182 end
183 183
184 184 def self.shellout(cmd, &block)
185 logger.debug "Shelling out: #{cmd}" if logger && logger.debug?
185 logger.debug "Shelling out: #{strip_credential(cmd)}" if logger && logger.debug?
186 186 if Rails.env == 'development'
187 187 # Capture stderr when running in dev environment
188 188 cmd = "#{cmd} 2>>#{RAILS_ROOT}/log/scm.stderr.log"
@@ -190,7 +190,7 Calendar.setup = function (params) {
190 190 cal.create();
191 191 cal.refresh();
192 192 if (!params.position)
193 cal.showAtElement(params.button || params.displayArea || params.inputField, params.align);
193 cal.showAtElement(params.button || params.displayArea || params.inputField);
194 194 else
195 195 cal.showAt(params.position[0], params.position[1]);
196 196 return false;
@@ -2,4 +2,7
2 2 groups_users_001:
3 3 group_id: 10
4 4 user_id: 8
5 groups_users_002:
6 group_id: 11
7 user_id: 8
5 8 No newline at end of file
@@ -37,3 +37,13 member_roles_009:
37 37 role_id: 2
38 38 member_id: 7
39 39 inherited_from: 7
40 member_roles_010:
41 id: 10
42 role_id: 2
43 member_id: 9
44 inherited_from:
45 member_roles_011:
46 id: 11
47 role_id: 2
48 member_id: 10
49 inherited_from: 10
@@ -48,3 +48,15 members_008:
48 48 id: 8
49 49 user_id: 1
50 50 mail_notification: true
51 members_009:
52 id: 9
53 created_on: 2006-07-19 19:35:33 +02:00
54 project_id: 2
55 user_id: 11
56 mail_notification: false
57 members_010:
58 id: 10
59 created_on: 2006-07-19 19:35:33 +02:00
60 project_id: 2
61 user_id: 8
62 mail_notification: false
@@ -633,15 +633,15 class ProjectTest < ActiveSupport::TestCase
633 633 assert_not_equal source_relation_cross_project.id, copied_relation.id
634 634 end
635 635
636 should "copy members" do
636 should "copy memberships" do
637 637 assert @project.valid?
638 638 assert @project.members.empty?
639 639 assert @project.copy(@source_project)
640 640
641 assert_equal @source_project.members.size, @project.members.size
642 @project.members.each do |member|
643 assert member
644 assert_equal @project, member.project
641 assert_equal @source_project.memberships.size, @project.memberships.size
642 @project.memberships.each do |membership|
643 assert membership
644 assert_equal @project, membership.project
645 645 end
646 646 end
647 647
@@ -77,4 +77,12 class WikiContentTest < ActiveSupport::TestCase
77 77 assert_kind_of String, version.text
78 78 end
79 79 end
80
81 def test_large_text_should_not_be_truncated_to_64k
82 page = WikiPage.new(:wiki => @wiki, :title => "Big page")
83 page.content = WikiContent.new(:text => "a" * 500.kilobyte, :author => User.find(1))
84 assert page.save
85 page.reload
86 assert_equal 500.kilobyte, page.content.text.size
87 end
80 88 end
General Comments 0
You need to be logged in to leave comments. Login now