Feature #1460 » loader_helper.rb.diff
| loader_helper2.rb 2010-04-22 08:16:05.600313384 +0200 | ||
|---|---|---|
|
# #
|
||
|
# History: 04-Jan-2008 (ADH): Created. #
|
||
|
# Feb 2009 (SJS): Hacked into plugin for redmine #
|
||
|
# Apr 2010 (XE): Updated category management #
|
||
|
########################################################################
|
||
|
module LoaderHelper
|
||
| ... | ... | |
|
# First populate the selection box with all the existing categories from this project
|
||
|
existingCategoryList = IssueCategory.find :all, :conditions => { :project_id => project }
|
||
|
|
||
|
output = "<select id=\"" + fieldId + "\" name=\"" + fieldId + "\"><optgroup label=\"Existing Categories\"> "
|
||
|
output = "<select id=\"" + fieldId + "\" name=\"" + fieldId + "\"> "
|
||
|
# Empty entry
|
||
|
output << "<option value=\"\"></option>"
|
||
|
output << "<optgroup label=\"Existing Categories\"> "
|
||
|
existingCategoryList.each do | category_info |
|
||
|
if ( category_info.to_s == requestedCategory )
|
||
|
output << "<option value=\"" + category_info.to_s + "\" selected=\"selected\">" + category_info.to_s + "</option>"
|
||
| ... | ... | |
|
output << "</optgroup>"
|
||
|
#
|
||
|
# We comment those lines because we dont want new categories based on imported tasks
|
||
|
# Now add any new categories that we found in the project file
|
||
|
output << "<optgroup label=\"New Categories\"> "
|
||
|
#output << "<optgroup label=\"New Categories\"> "
|
||
|
allNewCategories.each do | category_name |
|
||
|
if ( not existingCategoryList.include?(category_name) )
|
||
|
if ( category_name == requestedCategory )
|
||
|
output << "<option value=\"" + category_name + "\" selected=\"selected\">" + category_name + "</option>"
|
||
|
else
|
||
|
output << "<option value=\"" + category_name + "\">" + category_name + "</option>"
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
#allNewCategories.each do | category_name |
|
||
|
# if ( not existingCategoryList.include?(category_name) )
|
||
|
# if ( category_name == requestedCategory )
|
||
|
# output << "<option value=\"" + category_name + "\" selected=\"selected\">" + category_name + "</option>"
|
||
|
# else
|
||
|
# output << "<option value=\"" + category_name + "\">" + category_name + "</option>"
|
||
|
# end
|
||
|
# end
|
||
|
#end
|
||
|
output << "</optgroup>"
|
||
|
#output << "</optgroup>"
|
||
|
output << "</select>"
|
||
| ... | ... | |
|
end
|
||
|
|
||
|
end
|
||
|
end
|
||