单位审核相关Bug修复

dev_shcool
daiao 9 years ago
parent 7d7c8bcd8c
commit 5f969c6593

@ -674,9 +674,7 @@ class AdminController < ApplicationController
aas.update_attribute(:status, 2) aas.update_attribute(:status, 2)
AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => true, :applied_id => aas.id, :applied_type => "ApplyAddSchools", :name => school[0].name ) AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => true, :applied_id => aas.id, :applied_type => "ApplyAddSchools", :name => school[0].name )
users = UserExtensions.where("school_id = #{aas.school_id}") users = UserExtensions.where("school_id = #{aas.school_id}")
users.each do |user| users.update_all(:school_id => school[0].id)
user.update_column("school_id", school[0].id)
end
if aas.school_id != school[0].id.to_i if aas.school_id != school[0].id.to_i
aas.school.destroy aas.school.destroy
end end
@ -720,17 +718,11 @@ class AdminController < ApplicationController
AppliedMessage.create(:user_id => applied_school.user_id, :status => 3, :viewed => true, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools", :name => applied_school.name ) AppliedMessage.create(:user_id => applied_school.user_id, :status => 3, :viewed => true, :applied_id => applied_school.id, :applied_type => "ApplyAddSchools", :name => applied_school.name )
# 删除学校的用户 # 删除学校的用户
users = UserExtensions.where("school_id = #{applied_school.school_id}") users = UserExtensions.where("school_id = #{applied_school.school_id}")
users.each do |user| users.update_all(:school_id => nil)
user.update_column("school_id", nil)
end
applied_school.school.destroy applied_school.school.destroy
redirect_to unapplied_schools_url redirect_to unapplied_schools_url
# 已审批删除 # 已审批删除
elsif params[:tip] == "applied" elsif params[:tip] == "applied"
users = UserExtensions.where("school_id = #{applied_school.school_id}")
users.each do |user|
user.update_column("school_id", nil)
end
applied_school.destroy applied_school.destroy
redirect_to applied_schools_url redirect_to applied_schools_url
end end

@ -8,7 +8,9 @@
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入名称搜索" class="mt10 mb10 course-search" /> <input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入名称搜索" class="mt10 mb10 course-search" />
</div> </div>
<div id="schools_list"> <div id="schools_list">
<% if !@search.nil? %>
<%= render :partial => "admin/update_school_form", :locals => {:schools => schools, :edit_id => edit_id} %> <%= render :partial => "admin/update_school_form", :locals => {:schools => schools, :edit_id => edit_id} %>
<% end %>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">

@ -11,7 +11,7 @@
</label> </label>
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '输入单位名称进行搜索' %> <%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '输入单位名称进行搜索' %>
<%= submit_tag l(:button_apply ), :class => "small", :name => nil %> <%= submit_tag l(:button_apply ), :class => "small", :name => nil %>
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'applied_shcools'}, :class => 'icon icon-reload' %> <%= link_to l(:button_clear), {:controller => 'admin', :action => 'applied_schools'}, :class => 'icon icon-reload' %>
</fieldset> </fieldset>
<% end %> <% end %>
&nbsp; &nbsp;
@ -132,7 +132,7 @@
<td> <td>
</td> </td>
<td style="text-align: left;" colspan="6"> <td style="text-align: left;" colspan="7">
<%= apply.remarks %> <%= apply.remarks %>
</td> </td>
</tr> </tr>

@ -11,7 +11,7 @@
</label> </label>
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '输入单位名称进行搜索' %> <%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '输入单位名称进行搜索' %>
<%= submit_tag l(:button_apply ), :class => "small", :name => nil %> <%= submit_tag l(:button_apply ), :class => "small", :name => nil %>
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'applied_shcools'}, :class => 'icon icon-reload' %> <%= link_to l(:button_clear), {:controller => 'admin', :action => 'has_applied_schools'}, :class => 'icon icon-reload' %>
</fieldset> </fieldset>
<% end %> <% end %>
&nbsp; &nbsp;
@ -20,7 +20,7 @@
<table class="list" style="width: 100%;table-layout: fixed"> <table class="list" style="width: 100%;table-layout: fixed">
<thead> <thead>
<tr> <tr>
<th style="width: 20px;"> <th style="width: 25px;">
序号 序号
</th> </th>
<th style="width: 80px;"> <th style="width: 80px;">

@ -80,7 +80,7 @@
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" > <input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="" placeholder=" --请选择您所属的单位--"/> <input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="" placeholder=" --请选择您所属的单位--"/>
<p class="fl ml10"> <p class="fl ml10">
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> <!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span> <span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
</p> </p>
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>--> <!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
@ -88,7 +88,7 @@
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" > <input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" /> <input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" />
<p class="fl ml10"> <p class="fl ml10">
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> <!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span> <span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
</p> </p>
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>--> <!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
@ -96,7 +96,7 @@
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" > <input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" placeholder=" --请选择您所属的单位--" /> <input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" placeholder=" --请选择您所属的单位--" />
<p class="fl ml10"> <p class="fl ml10">
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> <!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span> <span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
</p> </p>
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>--> <!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
@ -104,7 +104,7 @@
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" value="<%= User.current.user_extensions.school %>" /> <input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" value="<%= User.current.user_extensions.school %>" />
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" type="text" style="display: none;" class="w210" value="<%= User.current.user_extensions.school.id %>"/> <input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" type="text" style="display: none;" class="w210" value="<%= User.current.user_extensions.school.id %>"/>
<p class="fl ml10"> <p class="fl ml10">
<span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> <!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
<span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span> <span id="hint" style="color: #7f7f7f;display: none">平台找到了<a id="school_num" href="javascript:void(0)" style="color: red" >0</a>个包含<a id="search_condition" href="javascript:void(0)">"国防"</a>的高校</span>
</p> </p>
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" value="<%#= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>--> <!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" value="<%#= User.current.user_extensions.school.name %>" readonly="true" style="background-color: #E2E2E2;"/>-->
@ -466,7 +466,7 @@
}else{ }else{
$("#search_school_result_list").html(''); $("#search_school_result_list").html('');
str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value; str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value;
$("#hint").html('您输入的名称尚不存在,<a style="color:#64bdd9" onclick="apply_add_school();" href="javascript:void(0);">申请添加</a>'); $("#hint").html('如果找不到自己的单位,您可以<a style="color:#64bdd9" onclick="apply_add_school();" href="javascript:void(0);">添加单位</a>');
$("#hint").show(); $("#hint").show();
$("#errortip").show(); $("#errortip").show();
} }

@ -15,23 +15,23 @@
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">
<% if ma.status == 1 %> <% if ma.status == 1 %>
<span class="newsBlue homepageNewsPublisher">系统提示</span> <span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位</span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的单位:</span>
<li class="homepageNewsContent fl"> <li class="homepageNewsContent fl">
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="<%= ma.name %>的申请,已通过">“<%= ma.name %>”的申请,已通过</a> <a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="<%= ma.name %>的申请,已通过审核。谢谢!">“<%= ma.name %>”的申请,已通过审核。谢谢!</a>
</li> </li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<% elsif ma.status == 2 %> <% elsif ma.status == 2 %>
<span class="newsBlue homepageNewsPublisher">系统提示</span> <span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位</span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的单位:</span>
<li class="homepageNewsContent fl"> <li class="homepageNewsContent fl">
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="“<%= ma.applied.name %>”的申请,因名称不合法,系统已将其更改为“<%= ma.name %>”">“<%= ma.applied.name %>”的申请,因名称不合法,系统已将其更改为“<%= ma.name %>”</a> <a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="“<%= ma.applied.name %>”的申请,因名称不符合规范,系统已将其更改为“<%= ma.name %>”。谢谢!">“<%= ma.applied.name %>”的申请,因名称不符合规范,系统已将其更改为“<%= ma.name %>”。谢谢!</a>
</li> </li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<% elsif ma.status == 3 %> <% elsif ma.status == 3 %>
<span class="newsBlue homepageNewsPublisher">系统提示</span> <span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位</span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的单位:</span>
<li class="homepageNewsContent fl"> <li class="homepageNewsContent fl">
<%= link_to "“"+ma.name+"”" + "的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", { :controller=> "my",:action => "account" }, :title => "“#{ma.name}”的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", :target => '_blank'%> <%= link_to "“"+ma.name+"”" + "的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", { :controller=> "my",:action => "account" }, :title => "“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%>
</li> </li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li> <li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
<% elsif ma.status == 0 %> <% elsif ma.status == 0 %>

@ -1910,6 +1910,7 @@ function edit_school_name(url,id){
url, url,
{id: id ,name: $("#school_name_edit_"+id).val() }, {id: id ,name: $("#school_name_edit_"+id).val() },
function (data) { function (data) {
$("#school_name_edit_"+id).val("");
if(data.status == 0){ if(data.status == 0){
$("#apply_title_"+data.id).show(); $("#apply_title_"+data.id).show();
$("#school_name_edit_"+data.id).hide(); $("#school_name_edit_"+data.id).hide();
@ -1943,6 +1944,7 @@ function edit_school_address(url,id){
url, url,
{id: id ,address: $("#school_address_edit_"+id).val() }, {id: id ,address: $("#school_address_edit_"+id).val() },
function (data) { function (data) {
$("#school_address_edit_"+data.id).val("");
if(data.status == 0){ if(data.status == 0){
$("#apply_address_"+data.id).show(); $("#apply_address_"+data.id).show();
$("#school_address_edit_"+data.id).hide(); $("#school_address_edit_"+data.id).hide();

Loading…
Cancel
Save