Commit d0f7d62f authored by jplang's avatar jplang

Allows multiple roles on the same project (#706). Prerequisite for user groups feature.

git-svn-id: https://svn.redmine.org/redmine/trunk@2726 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 8f8e3832
......@@ -38,10 +38,6 @@ class ApplicationController < ActionController::Base
require_dependency "repository/#{scm.underscore}"
end
def current_role
@current_role ||= User.current.role_for_project(@project)
end
def user_setup
# Check the settings cache for each request
Setting.check_cache
......
......@@ -146,7 +146,7 @@ class IssuesController < ApplicationController
return
end
@issue.status = default_status
@allowed_statuses = ([default_status] + default_status.find_new_statuses_allowed_to(User.current.role_for_project(@project), @issue.tracker)).uniq
@allowed_statuses = ([default_status] + default_status.find_new_statuses_allowed_to(User.current.roles_for_project(@project), @issue.tracker)).uniq
if request.get? || request.xhr?
@issue.start_date ||= Date.today
......
......@@ -48,7 +48,12 @@ class MembersController < ApplicationController
if request.post? and @member.update_attributes(params[:member])
respond_to do |format|
format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project }
format.js { render(:update) {|page| page.replace_html "tab-content-members", :partial => 'projects/settings/members'} }
format.js {
render(:update) {|page|
page.replace_html "tab-content-members", :partial => 'projects/settings/members'
page.visual_effect(:highlight, "member-#{@member.id}")
}
}
end
end
end
......
......@@ -112,7 +112,7 @@ class ProjectsController < ApplicationController
redirect_to_project_menu_item(@project, params[:jump]) && return
end
@members_by_role = @project.members.find(:all, :include => [:user, :role], :order => 'position').group_by {|m| m.role}
@members_by_role = @project.members.find(:all, :include => [:user, :roles], :order => 'position').group_by {|m| m.roles.first}
@subprojects = @project.children.visible
@news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC")
@trackers = @project.rolled_up_trackers
......
......@@ -24,7 +24,7 @@ class QueriesController < ApplicationController
@query = Query.new(params[:query])
@query.project = params[:query_is_for_all] ? nil : @project
@query.user = User.current
@query.is_public = false unless (@query.project && current_role.allowed_to?(:manage_public_queries)) || User.current.admin?
@query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
@query.column_names = nil if params[:default_columns]
params[:fields].each do |field|
......@@ -48,7 +48,7 @@ class QueriesController < ApplicationController
end if params[:fields]
@query.attributes = params[:query]
@query.project = nil if params[:query_is_for_all]
@query.is_public = false unless (@query.project && current_role.allowed_to?(:manage_public_queries)) || User.current.admin?
@query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
@query.column_names = nil if params[:default_columns]
if @query.save
......
......@@ -40,7 +40,7 @@ class RolesController < ApplicationController
@role.workflows.copy(copy_from)
end
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'list'
redirect_to :action => 'index'
end
@permissions = @role.setable_permissions
@roles = Role.find :all, :order => 'builtin, position'
......@@ -50,7 +50,7 @@ class RolesController < ApplicationController
@role = Role.find(params[:id])
if request.post? and @role.update_attributes(params[:role])
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'list'
redirect_to :action => 'index'
end
@permissions = @role.setable_permissions
end
......@@ -58,7 +58,7 @@ class RolesController < ApplicationController
def destroy
@role = Role.find(params[:id])
@role.destroy
redirect_to :action => 'list'
redirect_to :action => 'index'
rescue
flash[:error] = 'This role is in use and can not be deleted.'
redirect_to :action => 'index'
......@@ -73,7 +73,7 @@ class RolesController < ApplicationController
role.save
end
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'list'
redirect_to :action => 'index'
end
end
end
......@@ -86,10 +86,7 @@ class UsersController < ApplicationController
end
end
@auth_sources = AuthSource.find(:all)
@roles = Role.find_all_givable
@projects = Project.active.find(:all, :order => 'lft')
@membership ||= Member.new
@memberships = @user.memberships
end
def edit_membership
......@@ -97,12 +94,23 @@ class UsersController < ApplicationController
@membership = params[:membership_id] ? Member.find(params[:membership_id]) : Member.new(:user => @user)
@membership.attributes = params[:membership]
@membership.save if request.post?
redirect_to :action => 'edit', :id => @user, :tab => 'memberships'
respond_to do |format|
format.html { redirect_to :controller => 'users', :action => 'edit', :id => @user, :tab => 'memberships' }
format.js {
render(:update) {|page|
page.replace_html "tab-content-memberships", :partial => 'users/memberships'
page.visual_effect(:highlight, "member-#{@membership.id}")
}
}
end
end
def destroy_membership
@user = User.find(params[:id])
Member.find(params[:membership_id]).destroy if request.post?
redirect_to :action => 'edit', :id => @user, :tab => 'memberships'
respond_to do |format|
format.html { redirect_to :controller => 'users', :action => 'edit', :id => @user, :tab => 'memberships' }
format.js { render(:update) {|page| page.replace_html "tab-content-memberships", :partial => 'users/memberships'} }
end
end
end
......@@ -28,10 +28,6 @@ module ApplicationHelper
extend Forwardable
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
def current_role
@current_role ||= User.current.role_for_project(@project)
end
# Return true if user is authorized for controller/action, otherwise false
def authorize_for(controller, action)
User.current.allowed_to?({:controller => controller, :action => action}, @project)
......
......@@ -205,7 +205,7 @@ class Issue < ActiveRecord::Base
# Returns an array of status that user is able to apply
def new_statuses_allowed_to(user)
statuses = status.find_new_statuses_allowed_to(user.role_for_project(project), tracker)
statuses = status.find_new_statuses_allowed_to(user.roles_for_project(project), tracker)
statuses << status unless statuses.empty?
statuses.uniq.sort
end
......
......@@ -36,24 +36,34 @@ class IssueStatus < ActiveRecord::Base
# Returns an array of all statuses the given role can switch to
# Uses association cache when called more than one time
def new_statuses_allowed_to(role, tracker)
new_statuses = workflows.select {|w| w.role_id == role.id && w.tracker_id == tracker.id}.collect{|w| w.new_status} if role && tracker
new_statuses ? new_statuses.compact.sort{|x, y| x.position <=> y.position } : []
def new_statuses_allowed_to(roles, tracker)
if roles && tracker
role_ids = roles.collect(&:id)
new_statuses = workflows.select {|w| role_ids.include?(w.role_id) && w.tracker_id == tracker.id}.collect{|w| w.new_status}.compact.sort
else
[]
end
end
# Same thing as above but uses a database query
# More efficient than the previous method if called just once
def find_new_statuses_allowed_to(role, tracker)
new_statuses = workflows.find(:all,
:include => :new_status,
:conditions => ["role_id=? and tracker_id=?", role.id, tracker.id]).collect{ |w| w.new_status }.compact if role && tracker
new_statuses ? new_statuses.sort{|x, y| x.position <=> y.position } : []
def find_new_statuses_allowed_to(roles, tracker)
if roles && tracker
workflows.find(:all,
:include => :new_status,
:conditions => { :role_id => roles.collect(&:id),
:tracker_id => tracker.id}).collect{ |w| w.new_status }.compact.sort
else
[]
end
end
def new_status_allowed_to?(status, role, tracker)
status && role && tracker ?
!workflows.find(:first, :conditions => {:new_status_id => status.id, :role_id => role.id, :tracker_id => tracker.id}).nil? :
def new_status_allowed_to?(status, roles, tracker)
if status && roles && tracker
!workflows.find(:first, :conditions => {:new_status_id => status.id, :role_id => roles.collect(&:id), :tracker_id => tracker.id}).nil?
else
false
end
end
def <=>(status)
......
# redMine - project management software
# Copyright (C) 2006 Jean-Philippe Lang
# 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
......@@ -17,15 +17,12 @@
class Member < ActiveRecord::Base
belongs_to :user
belongs_to :role
has_many :member_roles, :dependent => :delete_all
has_many :roles, :through => :member_roles
belongs_to :project
validates_presence_of :role, :user, :project
validates_presence_of :user, :project
validates_uniqueness_of :user_id, :scope => :project_id
def validate
errors.add :role_id, :invalid if role && !role.member?
end
def name
self.user.name
......@@ -42,11 +39,18 @@ class Member < ActiveRecord::Base
end
def <=>(member)
role == member.role ? (user <=> member.user) : (role <=> member.role)
a, b = roles.sort.first, member.roles.sort.first
a == b ? (user <=> member.user) : (a <=> b)
end
def before_destroy
# remove category based auto assignments for this member
IssueCategory.update_all "assigned_to_id = NULL", ["project_id = ? AND assigned_to_id = ?", project.id, user.id]
end
protected
def validate
errors.add_to_base "Role can't be blank" if roles.empty?
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 MemberRole < ActiveRecord::Base
belongs_to :member
belongs_to :role
validates_presence_of :role
def validate
errors.add :role_id, :invalid if role && !role.member?
end
end
......@@ -135,7 +135,7 @@ class Project < ActiveRecord::Base
statements << "1=0"
if user.logged?
statements << "#{Project.table_name}.is_public = #{connection.quoted_true}" if Role.non_member.allowed_to?(permission)
allowed_project_ids = user.memberships.select {|m| m.role.allowed_to?(permission)}.collect {|m| m.project_id}
allowed_project_ids = user.memberships.select {|m| m.roles.detect {|role| role.allowed_to?(permission)}}.collect {|m| m.project_id}
statements << "#{Project.table_name}.id IN (#{allowed_project_ids.join(',')})" if allowed_project_ids.any?
elsif Role.anonymous.allowed_to?(permission)
# anonymous user allowed on public project
......@@ -247,12 +247,14 @@ class Project < ActiveRecord::Base
# Deletes all project's members
def delete_all_members
me, mr = Member.table_name, MemberRole.table_name
connection.delete("DELETE FROM #{mr} WHERE #{mr}.member_id IN (SELECT #{me}.id FROM #{me} WHERE #{me}.project_id = #{id})")
Member.delete_all(['project_id = ?', id])
end
# Users issues can be assigned to
def assignable_users
members.select {|m| m.role.assignable?}.collect {|m| m.user}.sort
members.select {|m| m.roles.detect {|role| role.assignable?}}.collect {|m| m.user}.sort
end
# Returns the mail adresses of users that should be always notified on project events
......
......@@ -38,7 +38,8 @@ class Role < ActiveRecord::Base
end
end
has_many :members
has_many :member_roles, :dependent => :destroy
has_many :members, :through => :member_roles
acts_as_list
serialize :permissions, Array
......@@ -82,7 +83,11 @@ class Role < ActiveRecord::Base
end
def <=>(role)
position <=> role.position
role ? position <=> role.position : -1
end
def to_s
name
end
# Return true if the role is a builtin role
......
......@@ -33,7 +33,7 @@ class User < ActiveRecord::Base
:username => '#{login}'
}
has_many :memberships, :class_name => 'Member', :include => [ :project, :role ], :conditions => "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}", :order => "#{Project.table_name}.name"
has_many :memberships, :class_name => 'Member', :include => [ :project, :roles ], :conditions => "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}", :order => "#{Project.table_name}.name"
has_many :members, :dependent => :delete_all
has_many :projects, :through => :memberships
has_many :issue_categories, :foreign_key => 'assigned_to_id', :dependent => :nullify
......@@ -229,26 +229,30 @@ class User < ActiveRecord::Base
!logged?
end
# Return user's role for project
def role_for_project(project)
# Return user's roles for project
def roles_for_project(project)
roles = []
# No role on archived projects
return nil unless project && project.active?
return roles unless project && project.active?
if logged?
# Find project membership
membership = memberships.detect {|m| m.project_id == project.id}
if membership
membership.role
roles = membership.roles
else
@role_non_member ||= Role.non_member
roles << @role_non_member
end
else
@role_anonymous ||= Role.anonymous
roles << @role_anonymous
end
roles
end
# Return true if the user is a member of project
def member_of?(project)
role_for_project(project).member?
!roles_for_project(project).detect {|role| role.member?}.nil?
end
# Return true if the user is allowed to do the specified action on project
......@@ -264,13 +268,13 @@ class User < ActiveRecord::Base
# Admin users are authorized for anything else
return true if admin?
role = role_for_project(project)
return false unless role
role.allowed_to?(action) && (project.is_public? || role.member?)
roles = roles_for_project(project)
return false unless roles
roles.detect {|role| (project.is_public? || role.member?) && role.allowed_to?(action)}
elsif options[:global]
# authorize if user has at least one role that has this permission
roles = memberships.collect {|m| m.role}.uniq
roles = memberships.collect {|m| m.roles}.flatten.uniq
roles.detect {|r| r.allowed_to?(action)} || (self.logged? ? Role.non_member.allowed_to?(action) : Role.anonymous.allowed_to?(action))
else
false
......
......@@ -25,7 +25,7 @@
<ul>
<% for membership in @memberships %>
<li><%= link_to(h(membership.project.name), :controller => 'projects', :action => 'show', :id => membership.project) %>
(<%=h membership.role.name %>, <%= format_date(membership.created_on) %>)</li>
(<%=h membership.roles.collect(&:to_s).join(', ') %>, <%= format_date(membership.created_on) %>)</li>
<% end %>
</ul>
<% end %>
......
<%= error_messages_for 'member' %>
<% roles = Role.find_all_givable
members = @project.members.find(:all, :include => [:role, :user]).sort %>
members = @project.members.find(:all, :include => [:roles, :user]).sort %>
<div class="splitcontentleft">
<% if members.any? %>
<table class="list">
<table class="list members">
<thead>
<th><%= l(:label_user) %></th>
<th><%= l(:label_role) %></th>
<th><%= l(:label_role_plural) %></th>
<th style="width:15%"></th>
<%= call_hook(:view_projects_settings_members_table_header, :project => @project) %>
</thead>
<tbody>
<% members.each do |member| %>
<% next if member.new_record? %>
<tr id="member-<%= member.id %>" class="<%= cycle 'odd', 'even' %>">
<td><%=h member.name %></td>
<td align="center">
<tr id="member-<%= member.id %>" class="<%= cycle 'odd', 'even' %> member">
<td class="user"><%= link_to_user member.user %></td>
<td class="roles">
<span id="member-<%= member.id %>-roles"><%=h member.roles.sort.collect(&:to_s).join(', ') %></span>
<% if authorize_for('members', 'edit') %>
<% remote_form_for(:member, member, :url => {:controller => 'members', :action => 'edit', :id => member}, :method => :post) do |f| %>
<%= f.select :role_id, roles.collect{|role| [role.name, role.id]}, {}, :class => "small" %>
<%= submit_tag l(:button_change), :class => "small" %>
<% remote_form_for(:member, member, :url => {:controller => 'members', :action => 'edit', :id => member},
:method => :post,
:html => { :id => "member-#{member.id}-roles-form", :style => 'display:none;' }) do |f| %>
<p><% roles.each do |role| %>
<label><%= check_box_tag 'member[role_ids][]', role.id, member.roles.include?(role) %> <%=h role %></label><br />
<% end %></p>
<p><%= submit_tag l(:button_change), :class => "small" %>
<%= link_to_function l(:button_cancel), "$('member-#{member.id}-roles').show(); $('member-#{member.id}-roles-form').hide(); return false;" %></p>
<% end %>
<% end %>
</td>
<td align="center">
</td>
<td class="buttons">
<%= link_to_function l(:button_edit), "$('member-#{member.id}-roles').hide(); $('member-#{member.id}-roles-form').show(); return false;", :class => 'icon icon-edit' %>
<%= link_to_remote l(:button_delete), { :url => {:controller => 'members', :action => 'destroy', :id => member},
:method => :post
}, :title => l(:button_delete),
:class => 'icon icon-del' %>
</td>
<%= call_hook(:view_projects_settings_members_table_row, { :project => @project, :member => member}) %>
</td>
<%= call_hook(:view_projects_settings_members_table_row, { :project => @project, :member => member}) %>
</tr>
</tbody>
<% end; reset_cycle %>
......@@ -58,8 +65,11 @@
<% end -%>
</div>
<% end %>
<p><%= l(:label_role) %>: <%= f.select :role_id, roles.collect{|role| [role.name, role.id]}, :selected => nil %>
<%= submit_tag l(:button_add) %></p>
<p><%= l(:label_role_plural) %>:
<% roles.each do |role| %>
<label><%= check_box_tag 'member[role_ids][]', role.id %> <%=h role %></label>
<% end %></p>
<p><%= submit_tag l(:button_add) %></p>
</fieldset>
<% end %>
<% end %>
......
......@@ -6,7 +6,7 @@
<p><label for="query_name"><%=l(:field_name)%></label>
<%= text_field 'query', 'name', :size => 80 %></p>
<% if User.current.admin? || (@project && current_role.allowed_to?(:manage_public_queries)) %>
<% if User.current.admin? || User.current.allowed_to?(:manage_public_queries, @project) %>
<p><label for="query_is_public"><%=l(:field_is_public)%></label>
<%= check_box 'query', 'is_public',
:onchange => (User.current.admin? ? nil : 'if (this.checked) {$("query_is_for_all").checked = false; $("query_is_for_all").disabled = true;} else {$("query_is_for_all").disabled = false;}') %></p>
......
<% if @memberships.any? %>
<% roles = Role.find_all_givable %>
<% projects = Project.active.find(:all, :order => 'lft') %>
<div class="splitcontentleft">
<% if @user.memberships.any? %>
<table class="list memberships">
<thead>
<th><%= l(:label_project) %></th>
<th><%= l(:label_role) %></th>
<th><%= l(:label_role_plural) %></th>
<th style="width:15%"></th>
</thead>
<tbody>
<% @memberships.each do |membership| %>
<% @user.memberships.each do |membership| %>
<% next if membership.new_record? %>
<tr class="<%= cycle 'odd', 'even' %>">
<td><%=h membership.project %></td>
<td align="center">
<% form_tag({ :action => 'edit_membership', :id => @user, :membership_id => membership }) do %>
<%= select_tag 'membership[role_id]', options_from_collection_for_select(@roles, "id", "name", membership.role_id) %>
<%= submit_tag l(:button_change), :class => "small" %>
<tr id="member-<%= membership.id %>" class="<%= cycle 'odd', 'even' %> class">
<td class="project"><%=h membership.project %></td>
<td class="roles">
<span id="member-<%= membership.id %>-roles"><%=h membership.roles.sort.collect(&:to_s).join(', ') %></span>
<% remote_form_for(:membership, :url => { :action => 'edit_membership', :id => @user, :membership_id => membership },
:html => { :id => "member-#{membership.id}-roles-form", :style => 'display:none;'}) do %>
<p><% roles.each do |role| %>
<label><%= check_box_tag 'membership[role_ids][]', role.id, membership.roles.include?(role) %> <%=h role %></label><br />
<% end %></p>
<p><%= submit_tag l(:button_change) %>
<%= link_to_function l(:button_cancel), "$('member-#{membership.id}-roles').show(); $('member-#{membership.id}-roles-form').hide(); return false;" %></p>
<% end %>
</td>
<td align="center">
<%= link_to l(:button_delete), {:action => 'destroy_membership', :id => @user, :membership_id => membership }, :method => :post, :class => 'icon icon-del' %>
</td>
</td>
<td class="buttons">
<%= link_to_function l(:button_edit), "$('member-#{membership.id}-roles').hide(); $('member-#{membership.id}-roles-form').show(); return false;", :class => 'icon icon-edit' %>
<%= link_to_remote l(:button_delete), { :url => { :controller => 'users', :action => 'destroy_membership', :id => @user, :membership_id => membership },
:method => :post },
:class => 'icon icon-del' %>
</td>
</tr>
</tbody>
<% end; reset_cycle %>
......@@ -26,15 +38,19 @@
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
</div>
<% if @projects.any? %>
<p>
<label><%=l(:label_project_new)%></label><br/>
<% form_tag({ :action => 'edit_membership', :id => @user }) do %>
<%= select_tag 'membership[project_id]', options_for_membership_project_select(@user, @projects) %>
<%= l(:label_role) %>:
<%= select_tag 'membership[role_id]', options_from_collection_for_select(@roles, "id", "name") %>
<%= submit_tag l(:button_add) %>
<div class="splitcontentright">
<% if projects.any? %>
<fieldset><legend><%=l(:label_project_new)%></legend>
<% remote_form_for(:membership, :url => { :action => 'edit_membership', :id => @user }) do %>
<%= select_tag 'membership[project_id]', options_for_membership_project_select(@user, projects) %>
<p><%= l(:label_role_plural) %>:
<% roles.each do |role| %>
<label><%= check_box_tag 'membership[role_ids][]', role.id %> <%=h role %></label>
<% end %></p>
<p><%= submit_tag l(:button_add) %></p>
<% end %>
</p>
</fieldset>
<% end %>
</div>
......@@ -43,7 +43,7 @@
<% for old_status in @statuses %>
<tr class="<%= cycle("odd", "even") %>">
<td><%= old_status.name %></td>
<% new_status_ids_allowed = old_status.find_new_statuses_allowed_to(@role, @tracker).collect(&:id) -%>
<% new_status_ids_allowed = old_status.find_new_statuses_allowed_to([@role], @tracker).collect(&:id) -%>
<% for new_status in @statuses -%>
<td align="center">
<input type="checkbox"
......
class CreateMemberRoles < ActiveRecord::Migration
def self.up
create_table :member_roles do |t|
t.column :member_id, :integer, :null => false
t.column :role_id, :integer, :null => false
end
end
def self.down
drop_table :member_roles
end
end
class PopulateMemberRoles < ActiveRecord::Migration
def self.up
Member.find(:all).each do |member|
MemberRole.create!(:member_id => member.id, :role_id => member.role_id)
end
end
def self.down
MemberRole.delete_all
end
end
class DropMembersRoleId < ActiveRecord::Migration
def self.up
remove_column :members, :role_id
end
def self.down
raise IrreversibleMigration
end
end
......@@ -87,6 +87,8 @@ table.list th { background-color:#EEEEEE; padding: 4px; white-space:nowrap; }
table.list td { vertical-align: top; }
table.list td.id { width: 2%; text-align: center;}
table.list td.checkbox { width: 15px; padding: 0px;}
table.list td.buttons { width: 15%; white-space:nowrap; text-align: right; }
table.list td.buttons a { padding-right: 0.6em; }
tr.project td.name a { padding-left: 16px; white-space:nowrap; }
tr.project.parent td.name a { background: url('../images/bullet_toggle_minus.png') no-repeat; }
......@@ -114,6 +116,8 @@ table.files tr.file td { text-align: center; }
table.files tr.file td.filename { text-align: left; padding-left: 24px; }
table.files tr.file td.digest { font-size: 80%; }
table.members td.roles, table.memberships td.roles { width: 45%; }
tr.message { height: 2.6em; }
tr.message td.last_message { font-size: 80%; }
tr.message.locked td.subject a { background-image: url(../images/locked.png); }
......@@ -333,11 +337,11 @@ p.other-formats { text-align: right; font-size:0.9em; color: #666; }
a.atom { background: url(../images/feed.png) no-repeat 1px 50%; padding: 2px 0px 3px 16px; }
/* Project members tab */
div#tab-content-members .splitcontentleft { width: 64% }
div#tab-content-members .splitcontentright { width: 34% }
div#tab-content-members fieldset { padding:1em; margin-bottom: 1em; }
div#tab-content-members fieldset legend { font-weight: bold; }
div#tab-content-members fieldset label { display: block; }
div#tab-content-members .splitcontentleft, div#tab-content-memberships .splitcontentleft { width: 64% }
div#tab-content-members .splitcontentright, div#tab-content-memberships .splitcontentright { width: 34% }
div#tab-content-members fieldset, div#tab-content-memberships fieldset { padding:1em; margin-bottom: 1em; }
div#tab-content-members fieldset legend, div#tab-content-memberships fieldset legend { font-weight: bold; }
div#tab-content-members fieldset label, div#tab-content-memberships fieldset label { display: block; }
div#tab-content-members fieldset div { max-height: 400px; overflow:auto; }
* html div#tab-content-members fieldset div { height: 450px; }
......
---
member_roles_001:
id: 1
role_id: 1
member_id: 1
member_roles_002:
id: 2
role_id: 2
member_id: 2
member_roles_003:
id: 3
role_id: 2
member_id: 3
member_roles_004:
id: 4
role_id: 2