Project

General

Profile

Feature #1102 ยป assign-to-me.patch

Simone Carletti, 2008-04-24 22:17

View differences:

app/views/issues/_form.rhtml (working copy)
<% end %>
<p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %></p>
<p><%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %></p>
<p><%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %>
<%= link_to_function(l(:label_issue_assign_to_me), "setSelectedIndexByValue('issue_assigned_to_id', '#{User.current.id}')") if User.current.logged? and @issue.assignable_users.any? {|u| u.id == User.current.id} %>
</p>
<p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %>
<%= prompt_to_remote(l(:label_issue_category_new),
l(:label_issue_category_new), 'category[name]',
lang/en.yml (working copy)
label_issue_category: Issue category
label_issue_category_plural: Issue categories
label_issue_category_new: New category
label_issue_assign_to_me: Assign to me
label_custom_field: Custom field
label_custom_field_plural: Custom fields
label_custom_field_new: New custom field
public/javascripts/application.js (working copy)
}
}
/**
* Sets the selected option for given select +s+
* to index corresponding
*/
function setSelectedIndexByValue(id, value) {
var s = document.getElementById(id);
for (var ii = 0; ii < s.options.length; ii++) {
if (value == s.options[ii].value) {
s.selectedIndex = ii;
return;
}
}
}
var fileFieldCount = 1;
function addFileField() {
    (1-1/1)