Project

General

Profile

Feature #3319 » add_copy_query.diff

Git Patch. - ciaran jessup, 2009-05-28 22:48

View differences:

app/controllers/queries_controller.rb
57 57
      end
58 58
    end
59 59
  end
60
  
61
  def copy
62
    @query.name = "Copy of " + @query.name
63
  end
60 64

  
61 65
  def destroy
62 66
    @query.destroy if request.post?
app/views/issues/index.rhtml
34 34
    <div class="contextual">
35 35
    <% if @query.editable_by?(User.current) %>
36 36
    <%= link_to l(:button_edit), {:controller => 'queries', :action => 'edit', :id => @query}, :class => 'icon icon-edit' %>
37
    <%= link_to l(:button_copy), {:controller => 'queries', :action => 'copy', :id => @query}, :class => 'icon icon-copy' %>
37 38
    <%= link_to l(:button_delete), {:controller => 'queries', :action => 'destroy', :id => @query}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
38 39
    <% end %>
39 40
    </div>
app/views/queries/copy.rhtml
1
<h2><%= l(:label_query_copy) %></h2>
2

  
3
<% form_tag({:action => 'new', :project_id => @query.project}, :onsubmit => 'selectAllOptions("selected_columns");') do %>
4
  <%= render :partial => 'form', :locals => {:query => @query} %>
5
  <%= submit_tag l(:button_save) %>
6
<% end %>
config/locales/en.yml
513 513
  label_query: Custom query
514 514
  label_query_plural: Custom queries
515 515
  label_query_new: New query
516
  label_query_copy: New cloned query
516 517
  label_filter_add: Add filter
517 518
  label_filter_plural: Filters
518 519
  label_equals: is
(1-1/2)