##// END OF EJS Templates
Fixed: Cannot create a new category on ticket creation/update page with 0.8.7 (#4400)....
Jean-Philippe Lang -
r3190:8bab5b4730b1
parent child
Show More
@@ -1,63 +1,63
1 1 <% if @issue.new_record? %>
2 2 <p><%= f.select :tracker_id, @project.trackers.collect {|t| [t.name, t.id]}, :required => true %></p>
3 3 <%= observe_field :issue_tracker_id, :url => { :action => :new },
4 4 :update => :content,
5 5 :with => "Form.serialize('issue-form')" %>
6 6 <hr />
7 7 <% end %>
8 8
9 9 <div id="issue_descr_fields" <%= 'style="display:none"' unless @issue.new_record? || @issue.errors.any? %>>
10 10 <p><%= f.text_field :subject, :size => 80, :required => true %></p>
11 11 <p><%= f.text_area :description,
12 12 :cols => 60,
13 13 :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min),
14 14 :accesskey => accesskey(:edit),
15 15 :class => 'wiki-edit' %></p>
16 16 </div>
17 17
18 18 <div class="splitcontentleft">
19 19 <% if @issue.new_record? || @allowed_statuses.any? %>
20 20 <p><%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), :required => true %></p>
21 21 <% else %>
22 22 <p><label><%= l(:field_status) %></label> <%= @issue.status.name %></p>
23 23 <% end %>
24 24
25 25 <p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %></p>
26 26 <p><%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %></p>
27 27 <% unless @project.issue_categories.empty? %>
28 28 <p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %>
29 29 <%= prompt_to_remote(l(:label_issue_category_new),
30 30 l(:label_issue_category_new), 'category[name]',
31 {:controller => 'projects', :action => 'add_issue_category', :id => @project},
31 {:controller => 'projects', :action => 'add_issue_category', :id => @project, :authenticity_token => form_authenticity_token},
32 32 :class => 'small', :tabindex => 199) if authorize_for('projects', 'add_issue_category') %></p>
33 33 <% end %>
34 34 <%= content_tag('p', f.select(:fixed_version_id,
35 35 (@project.versions.sort.collect {|v| [v.name, v.id]}),
36 36 { :include_blank => true })) unless @project.versions.empty? %>
37 37 </div>
38 38
39 39 <div class="splitcontentright">
40 40 <p><%= f.text_field :start_date, :size => 10 %><%= calendar_for('issue_start_date') %></p>
41 41 <p><%= f.text_field :due_date, :size => 10 %><%= calendar_for('issue_due_date') %></p>
42 42 <p><%= f.text_field :estimated_hours, :size => 3 %> <%= l(:field_hours) %></p>
43 43 <p><%= f.select :done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }) %></p>
44 44 </div>
45 45
46 46 <div style="clear:both;"> </div>
47 47 <%= render :partial => 'form_custom_fields' %>
48 48
49 49 <% if @issue.new_record? %>
50 50 <p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
51 51 <% end %>
52 52
53 53 <% if @issue.new_record? && User.current.allowed_to?(:add_issue_watchers, @project) -%>
54 54 <p><label><%= l(:label_issue_watchers) %></label>
55 55 <% @issue.project.users.sort.each do |user| -%>
56 56 <label class="floating"><%= check_box_tag 'issue[watcher_user_ids][]', user.id, @issue.watcher_user_ids.include?(user.id) %> <%=h user %></label>
57 57 <% end -%>
58 58 </p>
59 59 <% end %>
60 60
61 61 <%= call_hook(:view_issues_form_details_bottom, { :issue => @issue, :form => f }) %>
62 62
63 63 <%= wikitoolbar_for 'issue_description' %>
@@ -1,144 +1,145
1 1 /* redMine - project management software
2 2 Copyright (C) 2006-2008 Jean-Philippe Lang */
3 3
4 4 function checkAll (id, checked) {
5 5 var els = Element.descendants(id);
6 6 for (var i = 0; i < els.length; i++) {
7 7 if (els[i].disabled==false) {
8 8 els[i].checked = checked;
9 9 }
10 10 }
11 11 }
12 12
13 13 function toggleCheckboxesBySelector(selector) {
14 14 boxes = $$(selector);
15 15 var all_checked = true;
16 16 for (i = 0; i < boxes.length; i++) { if (boxes[i].checked == false) { all_checked = false; } }
17 17 for (i = 0; i < boxes.length; i++) { boxes[i].checked = !all_checked; }
18 18 }
19 19
20 20 function showAndScrollTo(id, focus) {
21 21 Element.show(id);
22 22 if (focus!=null) { Form.Element.focus(focus); }
23 23 Element.scrollTo(id);
24 24 }
25 25
26 26 var fileFieldCount = 1;
27 27
28 28 function addFileField() {
29 29 if (fileFieldCount >= 10) return false
30 30 fileFieldCount++;
31 31 var f = document.createElement("input");
32 32 f.type = "file";
33 33 f.name = "attachments[" + fileFieldCount + "][file]";
34 34 f.size = 30;
35 35 var d = document.createElement("input");
36 36 d.type = "text";
37 37 d.name = "attachments[" + fileFieldCount + "][description]";
38 38 d.size = 60;
39 39
40 40 p = document.getElementById("attachments_fields");
41 41 p.appendChild(document.createElement("br"));
42 42 p.appendChild(f);
43 43 p.appendChild(d);
44 44 }
45 45
46 46 function showTab(name) {
47 47 var f = $$('div#content .tab-content');
48 48 for(var i=0; i<f.length; i++){
49 49 Element.hide(f[i]);
50 50 }
51 51 var f = $$('div.tabs a');
52 52 for(var i=0; i<f.length; i++){
53 53 Element.removeClassName(f[i], "selected");
54 54 }
55 55 Element.show('tab-content-' + name);
56 56 Element.addClassName('tab-' + name, "selected");
57 57 return false;
58 58 }
59 59
60 60 function setPredecessorFieldsVisibility() {
61 61 relationType = $('relation_relation_type');
62 62 if (relationType && relationType.value == "precedes") {
63 63 Element.show('predecessor_fields');
64 64 } else {
65 65 Element.hide('predecessor_fields');
66 66 }
67 67 }
68 68
69 69 function promptToRemote(text, param, url) {
70 70 value = prompt(text + ':');
71 71 if (value) {
72 new Ajax.Request(url + '?' + param + '=' + encodeURIComponent(value), {asynchronous:true, evalScripts:true});
72 var sep = (url.indexOf('?') < 0 ? '?' : '&' )
73 new Ajax.Request(url + sep + param + '=' + encodeURIComponent(value), {asynchronous:true, evalScripts:true});
73 74 return false;
74 75 }
75 76 }
76 77
77 78 function collapseScmEntry(id) {
78 79 var els = document.getElementsByClassName(id, 'browser');
79 80 for (var i = 0; i < els.length; i++) {
80 81 if (els[i].hasClassName('open')) {
81 82 collapseScmEntry(els[i].id);
82 83 }
83 84 Element.hide(els[i]);
84 85 }
85 86 $(id).removeClassName('open');
86 87 }
87 88
88 89 function expandScmEntry(id) {
89 90 var els = document.getElementsByClassName(id, 'browser');
90 91 for (var i = 0; i < els.length; i++) {
91 92 Element.show(els[i]);
92 93 if (els[i].hasClassName('loaded') && !els[i].hasClassName('collapsed')) {
93 94 expandScmEntry(els[i].id);
94 95 }
95 96 }
96 97 $(id).addClassName('open');
97 98 }
98 99
99 100 function scmEntryClick(id) {
100 101 el = $(id);
101 102 if (el.hasClassName('open')) {
102 103 collapseScmEntry(id);
103 104 el.addClassName('collapsed');
104 105 return false;
105 106 } else if (el.hasClassName('loaded')) {
106 107 expandScmEntry(id);
107 108 el.removeClassName('collapsed');
108 109 return false;
109 110 }
110 111 if (el.hasClassName('loading')) {
111 112 return false;
112 113 }
113 114 el.addClassName('loading');
114 115 return true;
115 116 }
116 117
117 118 function scmEntryLoaded(id) {
118 119 Element.addClassName(id, 'open');
119 120 Element.addClassName(id, 'loaded');
120 121 Element.removeClassName(id, 'loading');
121 122 }
122 123
123 124 function randomKey(size) {
124 125 var chars = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
125 126 var key = '';
126 127 for (i = 0; i < size; i++) {
127 128 key += chars[Math.floor(Math.random() * chars.length)];
128 129 }
129 130 return key;
130 131 }
131 132
132 133 /* shows and hides ajax indicator */
133 134 Ajax.Responders.register({
134 135 onCreate: function(){
135 136 if ($('ajax-indicator') && Ajax.activeRequestCount > 0) {
136 137 Element.show('ajax-indicator');
137 138 }
138 139 },
139 140 onComplete: function(){
140 141 if ($('ajax-indicator') && Ajax.activeRequestCount == 0) {
141 142 Element.hide('ajax-indicator');
142 143 }
143 144 }
144 145 });
General Comments 0
You need to be logged in to leave comments. Login now