This commit is contained in:
huang 2015-05-23 10:40:48 +08:00
commit 4ab6558a5c
2 changed files with 26 additions and 18 deletions

View File

@ -255,7 +255,7 @@ module QueriesHelper
# Give it a name, required to be valid
@query = IssueQuery.new(:name => "_")
@query.project = @project
params[:f] = %w(subject status_id priority_id author_id assigned_to_id) unless params[:status_id].nil?
params[:f] = %w(subject status_id priority_id author_id assigned_to_id created_on) unless params[:status_id].nil?
params[:op] = {'subject' => "~" ,
'status_id' => ( params[:status_id] == '0' ? "!":"=" ),
'priority_id' => ( params[:priority_id] == '0' ? "!":"=" ),
@ -266,19 +266,22 @@ module QueriesHelper
'priority_id' => [params[:priority_id]],
'author_id' => [params[:author_id]],
'assigned_to_id' => [params[:assigned_to_id]]} unless params[:status_id].nil?
# if(params[:status_id] != nil)
# if( params[:issue_create_date_start]!=nil && params[:issue_create_date_start]!='' &&
# params[:issue_create_date_end]!=nil && params[:issue_create_date_end]!='' )
# params[:op][:created_on]='><'
# params[:v][:created_on]=[params[:issue_create_date_start],params[:issue_create_date_end]]
# elsif(params[:issue_create_date_start]!=nil && params[:issue_create_date_start]!='')
# params[:op][:created_on]='>='
# params[:v][:created_on]=[params[:issue_create_date_start]]
# elsif(params[:issue_create_date_end]!=nil && params[:issue_create_date_end]!='')
# params[:op][:created_on]='<='
# params[:v][:created_on]=[params[:issue_create_date_end]]
# end
# end
if(params[:status_id] != nil)
if( params[:issue_create_date_start]!=nil && params[:issue_create_date_start]!='' &&
params[:issue_create_date_end]!=nil && params[:issue_create_date_end]!='' )
params[:op][:created_on]='><'
params[:v][:created_on]=[params[:issue_create_date_start],params[:issue_create_date_end]]
elsif(params[:issue_create_date_start]!=nil && params[:issue_create_date_start]!='')
params[:op][:created_on]='>='
params[:v][:created_on]=[params[:issue_create_date_start]]
elsif(params[:issue_create_date_end]!=nil && params[:issue_create_date_end]!='')
params[:op][:created_on]='<='
params[:v][:created_on]=[params[:issue_create_date_end]]
else
params[:op][:created_on]='!'
params[:v][:created_on]=''
end
end
@query.build_from_params(params)
#session[:query] = {:project_id => @query.project_id, :filters => @query.filters, :group_by => @query.group_by, :column_names => @query.column_names}
# else

View File

@ -79,20 +79,25 @@
user_ischeck=true;
}
});
if(user_ischeck==false){
nh_show_err_message('请选择用户!');
return false;
}
var role_ischeck=false;
$("input[name='membership[role_ids][]']").each(function(){
if($(this).prop('checked')){
role_ischeck=true;
}
});
if(user_ischeck==false && role_ischeck==false){
nh_show_err_message('请选择用户和角色!');
return false;
}
if(user_ischeck==false){
nh_show_err_message('请选择用户!');
return false;
}
if(role_ischeck==false){
nh_show_err_message('请选择角色!');
return false;
}
return true;
});
});
</script>