Module | TaskImportsHelper |
In: |
app/helpers/task_imports_helper.rb
|
File: | task_imports_helper.rb |
(C): | Hipposoft 2008, 2009 |
Purpose: | Support functions for views related to Task Import objects. See controllers/task_imports_controller.rb for more. |
04-Jan-2008 (ADH): Created.
Generate a selector menu for collapsing a task tree to a given level. Pass the containing form, the maximum integer level to show and an optional string to add as a prefix to each line of output.
# File app/helpers/task_imports_helper.rb, line 40 40: def timphelp_collapse_selector( form, max_level, line_prefix = '' ) 41: levels = [] 42: 43: 0.upto( max_level ) do | level | 44: levels[ level ] = [ "Outline level #{ level }", level ] 45: end 46: 47: return apphelp_select( 48: form, 49: :collapse, 50: levels, 51: false 52: ).gsub( /^/, line_prefix ) 53: end
Generate a project selector for the project to which imported tasks will be assigned. HTML is output which is suitable for inclusion in a table cell or other similar container. Pass the form object being used for the task import view and optional string to add as a prefix to each line of output.
At least one active project must exist when this method is called, else the output string will be empty.
# File app/helpers/task_imports_helper.rb, line 22 22: def timphelp_project_selector( form, line_prefix = '' ) 23: unless ( Project.active.count.zero? ) 24: output = apphelp_project_selector( 25: 'import_project_id', 26: 'import[project_id]', 27: @current_user.control_panel.project_id 28: ).gsub( /^/, line_prefix ) 29: else 30: output = '' 31: end 32: 33: return output 34: end