Functions used in resource viewers
*/
-function loadResourceViewer(resourceId, tab, display_title, period, elt) {
- if (display_title == null) {
- display_title = true;
- }
-
- var url = baseUrl + '/resource/index/' + resourceId + '?tab=' + tab + '&display_title=' + display_title
- + '&period=' + period;
- openAccordionItem(url, elt, true);
-
- return false;
-}
-
-// Display GWT component
-function loadGWT(gwtId, resourceId, resourceKey, resourceName, resourceScope, resourceQualifier, resourceLanguage) {
- config["resource"] = [
- {"id":resourceId, "key":resourceKey, "name":resourceName, "scope":resourceScope, "qualifier":resourceQualifier,
- "lang":resourceLanguage}
- ];
- config["resource_key"] = resourceId;
- modules[gwtId]();
-}
-
/*
Functions used in tests viewer
*/
SECTION=Navigation::SECTION_RESOURCE
- def index
- redirect_to :overwrite_params => {:controller => :dashboard, :action => 'index'}
- end
def delete_form
access_denied unless (is_admin?(@project))
SECTION=Navigation::SECTION_RESOURCE
def index
- anchor = "component=#{params[:id]}"
+ require_parameters 'id'
+
+ component_key = params[:id]
+ if Api::Utils.is_number?(component_key)
+ component=Project.by_key(component_key)
+ not_found unless component
+ access_denied unless has_role?(:user, component)
+ component_key = component.key
+ end
+
+ anchor = "component=#{component_key}"
anchor += "&tab=#{params[:tab]}" if params[:tab]
redirect_to :controller => 'component', :action => 'index', :anchor => anchor
end
<span class="h1">
<% if component %>
<%= qualifier_icon(component) %>
- <a href="<%= ApplicationController.root_context -%>/resource/index/<%= component.key() -%>?layout=false&tab=issues" class="issue-component-link"
+ <a href="<%= ApplicationController.root_context -%>/component/index#component=<%= component.key() -%>&tab=issues" class="issue-component-link"
onclick="window.open(this.href,'resource-<%= component.key().parameterize -%>','height=800,width=900,scrollbars=1,resizable=1');return false;"><%= h component.longName() -%></a>
<% else %>
<%= h @issue.componentKey() %> [<del><%= message('issue.component_deleted') %></del>]
<% @test_case_by_test_plan.sort_by { |test_plan, test_cases| test_plan.component.longName }.each do |test_plan, test_cases| %>
<p style="padding: 0 0 2px 5px">
<% resource_key = test_plan.component.key %>
- <a href="<%= ApplicationController.root_context -%>/resource/index/<%= h resource_key -%>?display_title=true&tab=source"
+ <a href="<%= ApplicationController.root_context -%>/component/index#component=<%= resource_key -%>"
class="testable-testplan-link" onclick="openAccordionItem(this.href, this); return false;"><%= h test_plan.component.longName %>
</a>
</p>