修复bug#2357:项目--邀请注册用户,成功搜索后若忘了选择用户或角色直接邀请,建议不要再让用户重新搜索了

This commit is contained in:
yutao 2015-05-22 11:20:41 +08:00
parent a7e2e4766a
commit 04e9618a59
1 changed files with 27 additions and 1 deletions
app/views/projects

View File

@ -1,4 +1,3 @@
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_invite_join) %></h2>
</div>
@ -68,5 +67,32 @@
var text=$(label).text();
$(label).attr("title",text);
}
function nh_show_err_message(msg){
$("#RSide>.flash").remove();
$("#RSide").prepend('<div class="flash error" id="flash_error">'+msg+'</div>');
}
$('#new_membership').submit(function(){
var user_ischeck=false;
$("input[name='membership[user_ids][]']").each(function(){
if($(this).prop('checked')){
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(role_ischeck==false){
nh_show_err_message('请选择角色!');
return false;
}
});
});
</script>