class DetailsIssueHooks < Redmine::Hook::ViewListener def protect_against_forgery? false end def view_layouts_base_html_head(context) stylesheet_link_tag('issue_dynamic_edit.css', :plugin => :redmine_issue_dynamic_edit) end def view_layouts_base_body_bottom(context) javascript_include_tag('issue_dynamic_edit.js', :plugin => :redmine_issue_dynamic_edit) end def view_issues_show_details_bottom(context = { }) project = context[:project] request = context[:request] issue_id = request.path_parameters[:id] back = request.env['HTTP_REFERER'] o = '' if (issue_id) issue = Issue.find(issue_id) if (issue) if (User.current.allowed_to?(:edit_issues, project)) # if there's a JS error, we hide the generated values o << '
' # Status dropdown statuses = issue.new_statuses_allowed_to(User.current) if (!statuses.empty?) o << "" o << " " end # Users dropdown assignables = project.assignable_users o << assignables.to_json if (!assignables.empty?) o << "" o << " " end # Priorities dropdown priorities = IssuePriority.all if(!priorities.empty?) o << "" o << " " end # %done dropdown percent = 0 o << "" o << " " # Estimated_time dropdown o << "" o << " " o << "" o << " " o << "" # Start date o << "" o << " " o << " " o << " " o << "" o << "" # Due date o << "" o << " " o << " " o << " " o << "" o << "" end end o << "" # closing the display none div parent o << "
" return o end end end