Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop

This commit is contained in:
kg 2014-04-24 14:38:32 +08:00
commit 14511c079a
11 changed files with 13 additions and 23 deletions

View File

@ -114,22 +114,12 @@ class IssuesController < ApplicationController
@relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? }
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
# @edit_allowed = User.current.allowed_to?(:edit_issues, @project)
if User.current.admin? || User.current.id == @issue.author_id || User.current.id == @issue.assigned_to_id || ProjectInfo.manager?(User.current.id, @project)
@edit_allowed = true
# elsif User.current.id == @issue.author.id
else
@edit_allowed = false
end
# @edit_allowed = User.current.allowed_to?(:edit_issues, @project)
@edit_allowed = User.current.allowed_to?(:edit_issues, @project)
@priorities = IssuePriority.active
@time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young
#by huang
# @change_flag = (@issue.author == User.current) || (User.current.admin?)
#end
respond_to do |format|
format.html {
retrieve_previous_and_next_issue_ids

View File

@ -356,8 +356,8 @@ class ProjectsController < ApplicationController
def search
#modified by nie
project_type = params[:project_type]
projects_all = (project_type.eql? Project::ProjectType_project) ? Project.project_entities : Project.course_entities
project_type = params[:project_type].to_i
projects_all = (project_type.eql? Project::ProjectType_course) ? Project.course_entities : Project.project_entities
@projects = projects_all.visible
@projects = @projects.visible.like(params[:name]) if params[:name].present?
@offset, @limit = api_offset_and_limit({:limit => 10})

View File

@ -2,7 +2,7 @@
<%= error_messages_for 'issue', 'time_entry' %>
<%= render :partial => 'conflict' if @conflict %>
<div class="box">
<% if @edit_allowed && !@allowed_statuses.empty? %>
<% if @edit_allowed || !@allowed_statuses.empty? %>
<fieldset class="tabular"><legend><%= l(:label_change_properties) %></legend>
<div id="all_attributes">
<%= render :partial => 'form', :locals => {:f => f} %>

View File

@ -33,7 +33,7 @@
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px">
<div class="top-content-search" style="display:none">
<%= form_tag(:controller => 'projects', :action => "search", :method => :get) do %>
<%= form_tag(projects_search_path, :method => :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20 %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>

View File

@ -30,7 +30,7 @@
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px">
<div class="top-content-search">
<%= form_tag(:controller => 'projects', :action => "search", :method => :get) do %>
<%= form_tag(projects_search_path, :method => :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20 %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>

View File

@ -3,7 +3,7 @@
<% end %>
<div class="top-content">
<%= form_tag(:controller => 'projects', :action => 'search', :method => :get) do %>
<%= form_tag(projects_search_path, :method => :get) do %>
<table width="940px">
<tr>
<td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_course_practice) %></td>

View File

@ -3,7 +3,7 @@
<% end %>
<div class="top-content">
<%= form_tag(:controller => 'projects', :action => "search", :method => :get) do %>
<%= form_tag(projects_search_path, :method => :get) do %>
<table width="940px">
<tr>
<td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_project_deposit) %></td>

View File

@ -2,7 +2,7 @@
<%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %>
<% end %>
<div class="top-content">
<%= form_tag(:controller => 'projects', :action => "search", :method => :get) do %>
<%= form_tag(projects_search_path, :method => :get) do %>
<% if params[:project_type] == "1" %>
<table width="940px">
<tr>

View File

@ -23,7 +23,7 @@
<%= form_for "tag_for_save",:remote=>true,:url=>tag_path,
:update => "tags_show",
:complete => '$("#put-tag-form-issue").hide();' do |f| %>
<%= f.text_field :name ,:id => "name-issue",:size=>"30",:require=>true,:maxlength => 25,:minlength=>1 %>
<%= f.text_field :name ,:id => "name-issue",:size=>"30",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>1 %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<%= f.submit l(:button_project_tags_add),:class => "small"%>

View File

@ -2,7 +2,7 @@
$('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
$('#put-tag-form-issue').hide();
//$('#put-tag-form-issue').hide();
$('#name-issue').val("");
<% elsif @obj_flag == '6'%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
@ -15,6 +15,6 @@ $('#name-issue').val("");
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
$('#put-tag-form #name').val("");
$('#put-tag-form').hide();
//$('#put-tag-form').hide();
<% end %>

View File

@ -232,7 +232,7 @@ tags_min_length:
default: 1
tags_max_length:
format: int
default: 13
default: 30
tags_show_search_results:
format: int
default: 5