@keys = params[:keys]
@qualifiers = params[:qualifiers] || 'TRK'
@results_count = params[:results_count].to_i || 0
+ @components = params[:components]
render :partial => 'apply_template_form'
end
verify_post_request
require_parameters :template_key
- params['pageSize'] = -1
- components = Internal.component_api.find(params).components().to_a
+ if params['components'].blank?
+ params['pageSize'] = -1
+ components = Internal.component_api.find(params).components().to_a
+ params['components'] = components.collect{|component| component.getId()}.join(',')
+ end
- params['components'] = components.collect{|component| component.getId()}.join(',')
Internal.permissions.applyPermissionTemplate(params)
redirect_to :action => 'projects'
<input type="hidden" name="names" id="apply-template-names" value="<%= @names %>"/>
<input type="hidden" name="keys" id="apply-template-keys" value="<%= @keys %>"/>
<input type="hidden" name="qualifiers" id="apply-template-qualifiers" value="<%= @qualifiers %>"/>
+ <input type="hidden" name="components" id="apply-template-components" value="<%= @components %>"/>
<% end %>
<fieldset>
<div class="modal-head">
</td>
<% end %>
<td align="right">
- <%= link_to message('projects_role.apply_template'), {:action => :apply_template_form, :names => project.name, :results_count => 1},
+ <%= link_to message('projects_role.apply_template'), {:action => :apply_template_form, :components => [project.id], :names => project.name,
+ :results_count => 1, :qualifiers => @components_qualifiers},
:id => "apply-template-#{u project.kee}", :class => 'open-modal link-action' %>
</td>
</tr>