def prepare_key_bulk_update
@project = get_current_project(params[:id])
- @old_prefix = params[:old_prefix].strip
- @new_prefix = params[:new_prefix].strip
- if @old_prefix.blank? || @new_prefix.blank?
+ @string_to_replace = params[:string_to_replace].strip
+ @replacement_string = params[:replacement_string].strip
+ if @string_to_replace.blank? || @replacement_string.blank?
flash[:error] = message('update_key.fieds_cant_be_blank_for_bulk_update')
redirect_to :action => 'key', :id => @project.id
else
- @key_check_results = java_facade.checkModuleKeysBeforeRenaming(@project.id, @old_prefix, @new_prefix)
+ @key_check_results = java_facade.checkModuleKeysBeforeRenaming(@project.id, @string_to_replace, @replacement_string)
@can_update = false
@duplicate_key_found = false
@key_check_results.each do |key, value|
def perform_key_bulk_update
project = get_current_project(params[:id])
- old_prefix = params[:old_prefix].strip
- new_prefix = params[:new_prefix].strip
+ string_to_replace = params[:string_to_replace].strip
+ replacement_string = params[:replacement_string].strip
- unless old_prefix.blank? || new_prefix.blank?
+ unless string_to_replace.blank? || replacement_string.blank?
begin
- java_facade.bulkUpdateKey(project.id, old_prefix, new_prefix)
+ java_facade.bulkUpdateKey(project.id, string_to_replace, replacement_string)
flash[:notice] = message('update_key.key_updated')
rescue Exception => e
flash[:error] = message('update_key.error_occured_while_renaming_key_of_x',
<table>
<tr>
<td style="padding-right: 20px"><%= message('update_key.replace') -%>:</td>
- <td><input type="text" value="" name="old_prefix" id="old_prefix" size="40"></td>
+ <td><input type="text" value="" name="string_to_replace" id="string_to_replace" size="40"></td>
<td class="form-val-note" style="padding-left: 10px;"><%= message('update_key.replace_example') -%></td>
</tr>
<tr>
<td style="padding-right: 20px"><%= message('update_key.by') -%>:</td>
- <td><input type="text" value="" name="new_prefix" id="new_prefix" size="40"></td>
+ <td><input type="text" value="" name="replacement_string" id="replacement_string" size="40"></td>
<td class="form-val-note" style="padding-left: 10px;"><%= message('update_key.by_example') -%></td>
</tr>
<tr>
<%
- if @old_prefix && @new_prefix
+ if @string_to_replace && @replacement_string
# validation screen for bulk update
reset_cycle 'modules_tree'
%>
<%= message('update_key.keys_will_be_updated_as_follows') -%>
<% else %>
<% if @duplicate_key_found %>
- <%= message('update_key.cant_update_because_duplicate_keys', :params => [@old_prefix, @new_prefix]) -%>
+ <%= message('update_key.cant_update_because_duplicate_keys', :params => [@string_to_replace, @replacement_string]) -%>
<% else %>
- <%= message('update_key.no_key_to_update', :params => @old_prefix) -%>
+ <%= message('update_key.no_key_to_update', :params => @string_to_replace) -%>
<% end %>
<% end %>
</p>
<% if @can_update %>
<% form_tag( {:action => 'perform_key_bulk_update', :id => @project.id }, :onsubmit => "update_launched();$('loading_bulk_update').show();") do -%>
<input type="hidden" value="<%= @project.id -%>" name="id" id="project_id">
- <input type="hidden" value="<%= @old_prefix -%>" name="old_prefix" id="old_prefix">
- <input type="hidden" value="<%= @new_prefix -%>" name="new_prefix" id="new_prefix">
+ <input type="hidden" value="<%= @string_to_replace -%>" name="string_to_replace" id="string_to_replace">
+ <input type="hidden" value="<%= @replacement_string -%>" name="replacement_string" id="replacement_string">
<br/>
<%= submit_tag message('update_key.rename'), :id => 'bulk_update_button', :class => 'action' -%>
<a href="<%= url_for :action => 'key', :id => @project.key -%>"><%= message('cancel') -%></a>