里程碑修改,报名称重复
This commit is contained in:
parent
19684099b8
commit
1d6fb6849a
|
@ -202,6 +202,7 @@ class VersionsController < ApplicationController
|
||||||
@is_setting = params[:is_setting]
|
@is_setting = params[:is_setting]
|
||||||
@is_create = params[:is_create]
|
@is_create = params[:is_create]
|
||||||
@is_index = params[:is_index]
|
@is_index = params[:is_index]
|
||||||
|
@version_id = params[:id]
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
@ -276,10 +277,11 @@ class VersionsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
# 判断里程碑是否重名
|
# 判断里程碑是否重名
|
||||||
|
# 项目内的里程碑不能重名,项目之间的里程碑能重名
|
||||||
def judge_version_title
|
def judge_version_title
|
||||||
begin
|
begin
|
||||||
version = Version.where(:name => params[:version_name], :project_id => @project.id).first
|
version = Version.where(:name => params[:version_name], :project_id => @project.id).first
|
||||||
if version.blank?
|
if version.blank? || version.id == params[:version_id].to_i
|
||||||
result = {:result => true}
|
result = {:result => true}
|
||||||
else
|
else
|
||||||
result = {:result => false}
|
result = {:result => false}
|
||||||
|
|
|
@ -75,7 +75,8 @@
|
||||||
url:"<%= judge_version_title_project_versions_path(:project_id => @project) %>",
|
url:"<%= judge_version_title_project_versions_path(:project_id => @project) %>",
|
||||||
type: "GET",
|
type: "GET",
|
||||||
data: {
|
data: {
|
||||||
version_name: $.trim($("#popub_setting_version_name").val())
|
version_name: $.trim($("#popub_setting_version_name").val()),
|
||||||
|
version_id: <%= version_id %>
|
||||||
},
|
},
|
||||||
success:function(data){
|
success:function(data){
|
||||||
if(data.result == true) {
|
if(data.result == true) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
var htmlvalue = "<%= escape_javascript(render :partial => 'versions/edit') %>";
|
var htmlvalue = "<%= escape_javascript(render :partial => 'versions/edit', :locals => {:version_id => @version_id}) %>";
|
||||||
pop_box_new(htmlvalue,820,316);
|
pop_box_new(htmlvalue,820,316);
|
||||||
var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};
|
var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};
|
||||||
$(function() { $('#version_effective_date2').datepicker(datepickerOptions);
|
$(function() { $('#version_effective_date2').datepicker(datepickerOptions);
|
||||||
|
|
Loading…
Reference in New Issue