diff --git a/app/controllers/admin/users_new_interface_controller.rb b/app/controllers/admin/users_new_interface_controller.rb index e4c956b62..8190f5df6 100644 --- a/app/controllers/admin/users_new_interface_controller.rb +++ b/app/controllers/admin/users_new_interface_controller.rb @@ -4,7 +4,6 @@ class Admin::UsersNewInterfaceController < OrbitMemberController helper OrbitBackendHelper before_filter :set_attribute,:except => [:index,:show] - open_for_user :only => [:setting_account, :edit_user_data, :update] open_for_visitor :only => [:index, :show] def index @@ -183,36 +182,6 @@ class Admin::UsersNewInterfaceController < OrbitMemberController # @disable_all_field = false @user = User.find(params[:users_new_interface_id]) end - - def edit_user_data - - if params[:users_new_interface_id].blank? - redirect_to :action => :index - else - @user = User.find(params[:users_new_interface_id]) - - if current_user.id != @user.id - redirect_to :action => :index - end - - @form_index = 0 - get_info_and_roles - end - - end - - def setting_account - - if params[:users_new_interface_id].blank? - redirect_to :action => :index - else - @user = User.find(params[:users_new_interface_id]) - if current_user.id != @user.id - redirect_to :action => :index - end - end - - end def update @@ -234,37 +203,6 @@ class Admin::UsersNewInterfaceController < OrbitMemberController render :action => :edit_passwd, :notice => flash.now[:error] end - elsif params[:edit_type] == 'edit_user_data' - - if current_user.id != @user.id - redirect_to :action => :index - end - - @user.update_attributes(params[:user]) - - attribute_values_key = params[:user].has_key?('new_attribute_values') ? 'new_attribute_values' : 'attribute_values' - - attribute_values = params[:user].delete(attribute_values_key) - @user.save - - redirect_to :action => :show - - elsif params[:edit_type] == 'setting_account' - - if current_user.id != @user.id - redirect_to :action => :index - end - - if !@user.valid_password?(params[:old_password]) - flash.now[:error] = t("users.valid_old_password") - end - - if !flash.now[:error] && @user.update_attributes(params[:user]) - redirect_to :action => :show - else - render :action => :setting_account, :notice => flash.now[:error] - end - else @user.update_attributes(params[:user]) diff --git a/app/views/admin/users_new_interface/_form_user_data.html.erb b/app/views/admin/users_new_interface/_form_user_data.html.erb deleted file mode 100644 index ecbf6df7b..000000000 --- a/app/views/admin/users_new_interface/_form_user_data.html.erb +++ /dev/null @@ -1,81 +0,0 @@ - - -<%= render :partial=>"infos"%> - -
-<%=render :partial=>"user_role_data",:collection=>Role.all.asc("_id")%> -
- - -<% content_for :page_specific_javascript do -%> - -<% ( params[:users_new_interface_id].blank? ? @fname = 'new_attribute_values' : @fname = 'attribute_values' ) %> - - - - - - - - - - -<% end -%> \ No newline at end of file diff --git a/app/views/admin/users_new_interface/_user_role_data.html.erb b/app/views/admin/users_new_interface/_user_role_data.html.erb deleted file mode 100644 index bea10438a..000000000 --- a/app/views/admin/users_new_interface/_user_role_data.html.erb +++ /dev/null @@ -1,91 +0,0 @@ - - - - <% role_disable = @user.roles.include?(user_role_data) ? false : true %> - -
-
- - <%= hidden_field_tag("user[disable_role][id][#{user_role_data.id}]",role_disable,:for=>@form_index,:value=>role_disable)%> - -

<%= user_role_data.title %><%= t(:role_info)%>

-
- -
- - <% @form_index = @form_index +1 %> - -
- <%= label_tag t(:status), nil, {:func=>"field_label", :for=>"1", :class=>"control-label muted"} %> -
- <% user_role_data.role_statuses.where(:disable => false).each_with_index do |rrs, i|%> - <%= hidden_field_tag("user[role_status][id][#{rrs.id}]", false,:for=>"#{@form_index}")%> - <%= label_tag(i,check_box_tag( "user[role_status][id][#{rrs.id}]", true, @user.role_statuses.include?(rrs))+rrs.title,:class=>"checkbox inline") %> - <% end %> -
-
- - - <% @form_index = @form_index +1 %> - -
- <%= label_tag t(:category), nil, {:func=>"field_label", :for=>"1", :class=>"control-label muted"} %> -
- <% user_role_data.role_categorys.where(:disable => false).each_with_index do |rrcg, i|%> - <%= hidden_field_tag("user[role_category][id][#{rrcg.id}]", false,:for=>"#{@form_index}")%> - <%= label_tag(i,check_box_tag( "user[role_category][id][#{rrcg.id}]", true, @user.role_categorys.include?(rrcg))+rrcg.title,:class=>"checkbox inline") %> - <% end %> -
-
- - - - <% user_role_data.attribute_fields.asc(:_id).each do |rf|%> - - <%= rf.block_helper(@user,@form_index)%> - <% @form_index = @form_index +1 %> - - <% end %> - - - - <% @form_index = @form_index +1 %> - -
- - <% user_role_data.sub_roles.where(:disabled=>false).asc("_id").each do |sub_role| %> - - <% sub_role_disable = @user.sub_roles.include?(sub_role) ? false : true %> - -
- -
- <%= hidden_field_tag("user[disable_sub_role][id][#{sub_role.id}]",sub_role_disable,:for=>@form_index,:value=>sub_role_disable)%> -

<%= sub_role.title %><%= t(:role_info)%>

-
- -
- - <% sub_role.attribute_fields.asc(:_id).each do |af|%> - <%= af.block_helper(@user,@form_index)%> - <% @form_index = @form_index +1 %> - <% end %> - -
- -
- - <% end %> - -
- - - - - -
- -
- - - diff --git a/app/views/admin/users_new_interface/_user_setting_account.html.erb b/app/views/admin/users_new_interface/_user_setting_account.html.erb deleted file mode 100644 index 65036f6e6..000000000 --- a/app/views/admin/users_new_interface/_user_setting_account.html.erb +++ /dev/null @@ -1,53 +0,0 @@ - <%#= devise_error_messages! %> - <%= flash_messages %> - -
-
-

<%=t("users.user_basic_id_form")%>

-
-
- - -
- -
- <%= @user.user_id %> -
-
- - -
- -
- <%= password_field_tag "old_password",nil, :class=>"input-medium", :id=>"password" %> -
-
- - -
- -
- <%= f.password_field :password, :class=>"input-medium", :id=>"password" %> - <%= t("users.new_password_note")%> -
-
- - -
- -
- <%= f.password_field :password_confirmation, :class=>"input-medium", :id=>"confirm_password" %> -
-
- -
-
\ No newline at end of file diff --git a/app/views/admin/users_new_interface/edit_user_data.html.erb b/app/views/admin/users_new_interface/edit_user_data.html.erb deleted file mode 100644 index 95c10e551..000000000 --- a/app/views/admin/users_new_interface/edit_user_data.html.erb +++ /dev/null @@ -1,43 +0,0 @@ -<% content_for :side_bar do %> - <%= render :partial => 'admin/users_new_interface/side_bar' %> -<% end %> - -<% content_for :page_specific_css do -%> - <%= stylesheet_link_tag "lib/wrap-nav.css" %> - <%= stylesheet_link_tag "lib/pageslide.css" %> - <%= stylesheet_link_tag "lib/main-forms.css" %> - <%= stylesheet_link_tag "lib/fileupload.css" %> - <%= stylesheet_link_tag "lib/togglebox.css" %> -<% end -%> -<% content_for :page_specific_javascript do -%> - <%= javascript_include_tag "lib/jquery-ui-1.10.3.custom.min.js" %> - <%= javascript_include_tag "lib/jquery.tmpl.min.js" %> - <%= javascript_include_tag "lib/bootstrap-fileupload.js" %> - <%= javascript_include_tag "lib/bootstrap-datetimepicker.js" %> - <%= javascript_include_tag "lib/datetimepicker/date.time.picker.js" %> - <%= javascript_include_tag "lib/member/textarea-lang-btn.js" %> - <%= javascript_include_tag "lib/member/role-forms.js" %> -<% end -%> - - -<%= form_for @user, :url => admin_users_new_interface_path(@user), :html => { :multipart => true , :class=>"form-horizontal main-forms", :id=>"user-forms"} do |f| %> - -
-
- - <%= f.error_messages %> - <%= render :partial => 'user_basic', :locals => {:f => f}%> - <%= render :partial => 'form_user_data', :locals => { :f => f } %> - -
- -
- <%= hidden_field_tag 'edit_type', 'edit_user_data' %> - <%= link_to t(:update_), "#", :class=>"btn btn-primary returnDecide", :onclick=>"$('#user-forms').submit()" %> - <%= link_back('btn') %> -
- -
- -<% end -%> - diff --git a/app/views/admin/users_new_interface/setting_account.html.erb b/app/views/admin/users_new_interface/setting_account.html.erb deleted file mode 100644 index 764536dc9..000000000 --- a/app/views/admin/users_new_interface/setting_account.html.erb +++ /dev/null @@ -1,39 +0,0 @@ -<% content_for :side_bar do %> - <%= render :partial => 'admin/users_new_interface/side_bar' %> -<% end %> - -<% content_for :page_specific_css do -%> - <%= stylesheet_link_tag "lib/wrap-nav.css" %> - <%= stylesheet_link_tag "lib/pageslide.css" %> - <%= stylesheet_link_tag "lib/main-forms.css" %> - <%= stylesheet_link_tag "lib/fileupload.css" %> - <%= stylesheet_link_tag "lib/togglebox.css" %> -<% end -%> -<% content_for :page_specific_javascript do -%> - <%= javascript_include_tag "lib/jquery.tmpl.min.js" %> - <%= javascript_include_tag "lib/bootstrap-fileupload.js" %> - <%= javascript_include_tag "lib/member/role-forms.js" %> - <%= javascript_include_tag "lib/member/textarea-lang-btn.js" %> -<% end -%> - - -<%= form_for @user, :url => admin_users_new_interface_path(@user), :html => { :multipart => true , :class=>"form-horizontal main-forms"} do |f| %> - -
-
- - <%= f.error_messages %> - <%= render :partial => 'user_setting_account', :locals => {:f => f}%> - -
- - -
- <%= link_back('btn') %> - <%= hidden_field_tag 'edit_type', 'setting_account' %> - <%= link_to t(:update_), "#", :class=>"btn btn-primary returnDecide", :onclick=>"$('#edit_user_#{@user.id}').submit()" %> -
- -
- -<% end -%> diff --git a/app/views/admin/users_new_interface/show.html.erb b/app/views/admin/users_new_interface/show.html.erb index a9481c790..216177e27 100644 --- a/app/views/admin/users_new_interface/show.html.erb +++ b/app/views/admin/users_new_interface/show.html.erb @@ -20,7 +20,7 @@ <%= @user.email %>
<%= link_to(" #{t(:edit)}".html_safe,edit_admin_users_new_interface_path(@user),:class=>"btn btn-mini" ) if is_admin?%> - <%= link_to(" #{t("users.change_passwd")}".html_safe,admin_users_new_interface_edit_passwd_path(@user),:class=>"btn btn-mini" ) if is_admin? and current_user.id != @user.id %> + <%= link_to(" #{t("users.change_passwd")}".html_safe,admin_users_new_interface_edit_passwd_path(@user),:class=>"btn btn-mini" ) if is_admin?%>
diff --git a/app/views/layouts/_right_menu.html.erb b/app/views/layouts/_right_menu.html.erb index 917ea8615..fba8d449d 100644 --- a/app/views/layouts/_right_menu.html.erb +++ b/app/views/layouts/_right_menu.html.erb @@ -31,11 +31,8 @@ <%= current_user.name %>