patch.txt

Brad Beattie, 2009-04-14 20:00

Download (1.99 KB)

 
1
### Eclipse Workspace Patch 1.0
2
#P Redmine
3
Index: app/controllers/issue_relations_controller.rb
4
===================================================================
5
--- app/controllers/issue_relations_controller.rb	(revision 2670)
6
+++ app/controllers/issue_relations_controller.rb	(working copy)
7
@@ -51,6 +51,14 @@
8
     end
9
   end
10
   
11
+  def autocomplete
12
+    @issues = Issue.find(:all, :conditions => ["LOWER(subject) LIKE ? OR id LIKE ?", "#{params[:subject]}%", "#{params[:subject]}%"],
13
+                                    :limit => 10,
14
+                                    :order => 'login ASC')
15
+    render :layout => false
16
+  end
17
+  
18
+  
19
 private
20
   def find_project
21
     @issue = Issue.find(params[:issue_id])
22
Index: app/views/issue_relations/autocomplete.rhtml
23
===================================================================
24
--- app/views/issue_relations/autocomplete.rhtml	(revision 0)
25
+++ app/views/issue_relations/autocomplete.rhtml	(revision 0)
26
@@ -0,0 +1,5 @@
27
+<ul>
28
+<% @issues.each do |issue| -%>
29
+    <li>Hi!</li>
30
+<% end -%>
31
+</ul>
32
Index: app/views/issue_relations/_form.rhtml
33
===================================================================
34
--- app/views/issue_relations/_form.rhtml	(revision 2670)
35
+++ app/views/issue_relations/_form.rhtml	(working copy)
36
@@ -2,6 +2,12 @@
37
 
38
 <p><%= f.select :relation_type, collection_for_relation_type_select, {}, :onchange => "setPredecessorFieldsVisibility();" %>
39
 <%= l(:label_issue) %> #<%= f.text_field :issue_to_id, :size => 6 %>
40
+
41
+<p><%= text_field_tag 'member[user_login]', nil, :size => "40" %></p>
42
+<div id="member_user_login_choices" class="autocomplete">sqd</div>
43
+<%= javascript_tag "new Ajax.Autocompleter('member_user_login', 'member_user_login_choices', '#{ url_for(:controller => 'issue_relations', :action => 'autocomplete') }', { minChars: 1, frequency: 0.5, paramName: 'subject' });" %>
44
+        
45
+
46
 <span id="predecessor_fields" style="display:none;">
47
 <%= l(:field_delay) %>: <%= f.text_field :delay, :size => 3 %> <%= l(:label_day_plural) %>
48
 </span>