if logged_in?
if params[:did]
- @dashboard=Dashboard.find(:first, :conditions => ['id=? AND user_id=?', params[:did].to_i, current_user.id])
+ @dashboard=Dashboard.first(:conditions => ['id=? AND user_id=?', params[:did].to_i, current_user.id])
elsif params[:name]
- @dashboard=Dashboard.find(:first, :conditions => ['name=? AND user_id=?', params[:name], current_user.id])
+ @dashboard=Dashboard.first(:conditions => ['name=? AND user_id=?', params[:name], current_user.id])
elsif params[:id]
active=ActiveDashboard.user_dashboards(current_user, false).first
else
unless active or @dashboard
# anonymous or not found in user dashboards
if params[:did]
- @dashboard=Dashboard.find(:first, :conditions => ['id=? AND shared=?', params[:did].to_i, true])
+ @dashboard=Dashboard.first(:conditions => ['id=? AND shared=?', params[:did].to_i, true])
elsif params[:name]
- @dashboard=Dashboard.find(:first, :conditions => ['name=? AND shared=?', params[:name], true])
+ @dashboard=Dashboard.first(:conditions => ['name=? AND shared=?', params[:name], true])
elsif params[:id]
active=ActiveDashboard.user_dashboards(nil, false).first
else
# GET /issues/bulk_change_form?[&criteria]
def bulk_change_form
- params[:from] ||= 'issue_filters'
- params_for_query = params.clone.merge({'pageSize' => -1})
+ issues_query_params = params.clone.merge({'pageSize' => -1})
if params[:id]
- @issue_filter_result = Internal.issues.execute(params[:id].to_i, params_for_query)
+ @issue_filter_result = Internal.issues.execute(params[:id].to_i, issues_query_params)
else
- @issue_filter_result = Internal.issues.execute(params_for_query)
+ @issue_filter_result = Internal.issues.execute(issues_query_params)
end
render :partial => 'issues/bulk_change_form'
end
def bulk_change
verify_post_request
Internal.issues.bulkChange(params, params[:comment])
- render :text => params[:criteria_params], :status => 200
+ render :text => params[:issues_query_params], :status => 200
end
anchor = stripped_url[1];
}
+ // refresh page after issues bulk change
+ function onBulkIssues(issues_query_params, component_key){
+ window.location.reload();
+ }
+
openAccordionItem('<%= url_for(params.merge({:controller => 'resource', :action => :index, :id => @file.id, :display_title => 'false', :popup => 'false'})) -%>', this, false)
.done(function () {
if (anchor != null) {
openAccordionItem(url, this);
return false;
}
+
+ // refresh page after issues bulk change
+ function onBulkIssues(issues_query_params, component_key){
+ d(component_key);
+ closeModalWindow();
+ }
</script>
%>
<form id="bulk-change-form" method="post" action="<%= ApplicationController.root_context -%>/issues/bulk_change">
<input type="hidden" name="issues" value="<%= issues.map { |issue| issue.key() }.join(',') -%>">
- <input type="hidden" name="criteria_params" value="<%= params.to_query -%>">
+ <input type="hidden" name="issues_query_params" value="<%= params.to_query -%>">
<input type="hidden" name="actions[]" id="bulk-change-transition-action">
<fieldset>
<div class="modal-head">
unless plans.empty?
first_plan = plans[0]
options = plans.map { |plan|
- if plan.deadLine
- label = "#{h plan.name} (#{format_date(plan.deadLine)})"
- else
- label = h plan.name
- end
+ label = plan.deadLine ? "#{h plan.name} (#{format_date(plan.deadLine)})" : h(plan.name)
[label, plan.key]
}
options.unshift([escape_javascript(message('issue.unplan.submit')), ''])
<script>
$j("#bulk-change-form").modalForm({
success: function (data) {
- <% if params[:from] == 'issue_filters' %>
- window.location = baseUrl + '/issues/search?' + data;
- <% elsif params[:from] == 'drilldown' %>
- d('<%= component_key %>');
- closeModalWindow();
- <% else %>
- alert('Unknown origin : <%= params[:from] %>');
- <% end %>
+ onBulkIssues(data, '<%= component_key %>');
},
error: function (xhr, textStatus, errorThrown) {
$j('#bulk-change-loading-image').addClass("hidden");
<%= render :partial => 'list' -%>
</div>
</div>
-</div>
\ No newline at end of file
+</div>
+
+<script type="text/javascript">
+ function onBulkIssues(issues_query_params, component_key){
+ window.location = baseUrl + '/issues/search?' + issues_query_params;
+ }
+</script>
\ No newline at end of file
<% first=true %>
<% if logged_in? && @display_issues %>
<li class="<%= 'first' if first -%>">
- <a href="<%= url_for @issues_params.merge({:controller => 'issues', :action => 'bulk_change_form', :from => 'drilldown'}) -%>"
+ <a href="<%= url_for @issues_params.merge({:controller => 'issues', :action => 'bulk_change_form'}) -%>"
class="bulk-change-link open-modal"><%= message('bulk_change') -%></a>
</li>
<% first=false
</ul>
</div>
-
<% end %>